From 1cb0650cbaf198f31d0be208e9c8a8b8a4968ee4 Mon Sep 17 00:00:00 2001 From: Michael Bernardi Date: Sun, 25 Feb 2024 23:18:38 +0100 Subject: [PATCH 001/191] Fix #21289: Map window does not layout properly --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/Map.cpp | 66 ++++++++++++++++++------ src/openrct2/interface/Window.cpp | 5 ++ src/openrct2/interface/Window.h | 1 + src/openrct2/interface/Window_internal.h | 3 ++ src/openrct2/localisation/Language.cpp | 2 + 6 files changed, 62 insertions(+), 16 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 7c23184988..5929cc1981 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -12,6 +12,7 @@ - Fix: [#21220] When creating a new park from a SC4 file, the localised park name is not applied. - Fix: [#21286] Cannot build unbanking turns with RCT1 vehicles. - Fix: [#21288] Text overlaps in the “About ‘OpenRCT2’” window for Arabic, Chinese, Japanese, Korean and Vietnamese. +- Fix: [#21289] Text overlaps and overflows in the map window for some languages. - Fix: [#21310] Some half loop elements require more clearance than their upward/downward counterparts. - Fix: [#21318] Virtual Floor for building scenery is not properly invalidated. - Fix: [#21330] Tooltips from dropdown widgets have the wrong position. diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index ea19e56c17..1398b6acca 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -155,8 +156,15 @@ public: | (1uLL << WIDX_MAP_SIZE_SPINNER_X_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_X_DOWN) | (1uLL << WIDX_LAND_TOOL_LARGER) | (1uLL << WIDX_LAND_TOOL_SMALLER); + flags |= WF_RESIZABLE; + min_width = WW; + max_width = 800; + min_height = WH; + max_height = 560; + ResizeMap(); InitScrollWidgets(); + CalculateTextLayout(); _rotation = GetCurrentRotation(); @@ -183,15 +191,6 @@ public: } } - void OnResize() override - { - flags |= WF_RESIZABLE; - min_width = 245; - max_width = 800; - min_height = 259; - max_height = 560; - } - void OnMouseUp(WidgetIndex widgetIndex) override { switch (widgetIndex) @@ -287,6 +286,7 @@ public: selected_tab = widgetIndex; list_information_type = 0; + _recalculateScrollbars = true; } } } @@ -854,6 +854,11 @@ public: ShowDefaultScenarioEditorButtons(); } } + if (_recalculateScrollbars) + { + WidgetScrollUpdateThumbs(*this, WIDX_MAP); + _recalculateScrollbars = false; + } } void OnDraw(DrawPixelInfo& dpi) override @@ -889,22 +894,18 @@ public: { screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP].bottom + 2 }; - static constexpr StringId _mapLabels[] = { - STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, - STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, - }; - static_assert(std::size(RideKeyColours) == std::size(_mapLabels)); + static_assert(std::size(RideKeyColours) == std::size(MapLabels)); for (uint32_t i = 0; i < std::size(RideKeyColours); i++) { GfxFillRect( dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, RideKeyColours[i]); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, _mapLabels[i], {}); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, MapLabels[i], {}); screenCoords.y += LIST_ROW_HEIGHT; if (i == 3) { - screenCoords += { 118, -(LIST_ROW_HEIGHT * 4) }; + screenCoords += { _firstColumnWidth, -(LIST_ROW_HEIGHT * 4) }; } } } @@ -917,6 +918,11 @@ public: } } + void OnLanguageChange() override + { + CalculateTextLayout(); + } + void ResetMap() { InitMap(); @@ -1404,11 +1410,34 @@ private: widgets[WIDX_MAP].bottom = height - 1 - 14; } + void CalculateTextLayout() + { + int32_t textOffset = 4 + LIST_ROW_HEIGHT; + _firstColumnWidth = 118; + for (uint32_t i = 0; i < 4; i++) + { + const auto* labelStr = LanguageGetString(MapLabels[i]); + _firstColumnWidth = std::max(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium), _firstColumnWidth); + } + + textOffset += _firstColumnWidth + 4; + min_width = WW; + for (uint32_t i = 4; i < std::size(MapLabels); i++) + { + const auto* labelStr = LanguageGetString(MapLabels[i]); + min_width = std::max(static_cast(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium)), min_width); + } + width = std::max(min_width, width); + _recalculateScrollbars = true; + } + uint8_t _activeTool; uint32_t _currentLine; uint16_t _landRightsToolSize; + int32_t _firstColumnWidth; std::vector _mapImageData; bool _mapWidthAndHeightLinked{ true }; + bool _recalculateScrollbars = false; enum class ResizeDirection { Both, @@ -1416,6 +1445,11 @@ private: Y, } _resizeDirection{ ResizeDirection::Both }; + static constexpr StringId MapLabels[] = { + STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, + STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, + }; + static constexpr uint16_t RideKeyColours[] = { MapColour(PALETTE_INDEX_61), // COLOUR_KEY_RIDE MapColour(PALETTE_INDEX_42), // COLOUR_KEY_FOOD diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 2a71c91224..cdf29495bf 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -156,6 +156,11 @@ void WindowUpdateAll() windowManager->UpdateMouseWheel(); } +void WindowNotifyLanguageChange() +{ + WindowVisitEach([&](WindowBase* w) { w->OnLanguageChange(); }); +} + static void WindowCloseSurplus(int32_t cap, WindowClass avoid_classification) { // find the amount of windows that are currently open diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 66c4dc08e9..12e44616d8 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -501,6 +501,7 @@ void WindowVisitEach(std::function func); void WindowDispatchUpdateAll(); void WindowUpdateAllViewports(); void WindowUpdateAll(); +void WindowNotifyLanguageChange(); void WindowSetWindowLimit(int32_t value); diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 994c587089..2a1e3ffd9a 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -167,6 +167,9 @@ struct WindowBase { } virtual CursorID OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID); + virtual void OnLanguageChange() + { + } void ResizeFrame(); void ResizeFrameWithPage(); diff --git a/src/openrct2/localisation/Language.cpp b/src/openrct2/localisation/Language.cpp index a47d68c901..4bf4e9ada2 100644 --- a/src/openrct2/localisation/Language.cpp +++ b/src/openrct2/localisation/Language.cpp @@ -12,6 +12,7 @@ #include "../core/String.hpp" #include "../interface/FontFamilies.h" #include "../interface/Fonts.h" +#include "../interface/Window.h" #include "../object/ObjectManager.h" #include "../platform/Platform.h" #include "LanguagePack.h" @@ -85,6 +86,7 @@ bool LanguageOpen(int32_t id) // Objects and their localised strings need to be refreshed objectManager.ResetObjects(); ScrollingTextInvalidate(); + WindowNotifyLanguageChange(); return true; } catch (const std::exception&) From 412ca5d9c54b90e1d9468e7c4f6bfe27d5577d92 Mon Sep 17 00:00:00 2001 From: Michael Bernardi Date: Sat, 2 Mar 2024 16:05:07 +0100 Subject: [PATCH 002/191] Correct location of Map window variables Move local variables to top of class. Move static constexpr variables to file scope. --- src/openrct2-ui/windows/Map.cpp | 119 ++++++++++++++++---------------- 1 file changed, 59 insertions(+), 60 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 1398b6acca..9553ff5d87 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -138,9 +138,68 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { }; // clang-format on +static constexpr StringId MapLabels[] = { + STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, + STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, +}; + +static constexpr uint16_t RideKeyColours[] = { + MapColour(PALETTE_INDEX_61), // COLOUR_KEY_RIDE + MapColour(PALETTE_INDEX_42), // COLOUR_KEY_FOOD + MapColour(PALETTE_INDEX_20), // COLOUR_KEY_DRINK + MapColour(PALETTE_INDEX_209), // COLOUR_KEY_SOUVENIR + MapColour(PALETTE_INDEX_136), // COLOUR_KEY_KIOSK + MapColour(PALETTE_INDEX_102), // COLOUR_KEY_FIRST_AID + MapColour(PALETTE_INDEX_55), // COLOUR_KEY_CASH_MACHINE + MapColour(PALETTE_INDEX_161), // COLOUR_KEY_TOILETS +}; + +static constexpr uint8_t DefaultPeepMapColour = PALETTE_INDEX_20; +static constexpr uint8_t GuestMapColour = PALETTE_INDEX_172; +static constexpr uint8_t GuestMapColourAlternate = PALETTE_INDEX_21; +static constexpr uint8_t StaffMapColour = PALETTE_INDEX_138; +static constexpr uint8_t StaffMapColourAlternate = PALETTE_INDEX_10; + +static constexpr uint16_t WaterColour = MapColour(PALETTE_INDEX_195); + +static constexpr uint16_t ElementTypeMaskColour[] = { + 0xFFFF, // TILE_ELEMENT_TYPE_SURFACE + 0x0000, // TILE_ELEMENT_TYPE_PATH + 0x00FF, // TILE_ELEMENT_TYPE_TRACK + 0xFF00, // TILE_ELEMENT_TYPE_SMALL_SCENERY + 0x0000, // TILE_ELEMENT_TYPE_ENTRANCE + 0xFFFF, // TILE_ELEMENT_TYPE_WALL + 0x0000, // TILE_ELEMENT_TYPE_LARGE_SCENERY + 0xFFFF, // TILE_ELEMENT_TYPE_BANNER +}; + +static constexpr uint16_t ElementTypeAddColour[] = { + MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_SURFACE + MapColour(PALETTE_INDEX_17), // TILE_ELEMENT_TYPE_PATH + MapColour2(PALETTE_INDEX_183, PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_TRACK + MapColour2(PALETTE_INDEX_0, PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_SMALL_SCENERY + MapColour(PALETTE_INDEX_186), // TILE_ELEMENT_TYPE_ENTRANCE + MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_WALL + MapColour(PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_LARGE_SCENERY + MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_BANNER +}; + class MapWindow final : public Window { uint8_t _rotation; + uint8_t _activeTool; + uint32_t _currentLine; + uint16_t _landRightsToolSize; + int32_t _firstColumnWidth; + std::vector _mapImageData; + bool _mapWidthAndHeightLinked{ true }; + bool _recalculateScrollbars = false; + enum class ResizeDirection + { + Both, + X, + Y, + } _resizeDirection{ ResizeDirection::Both }; public: MapWindow() @@ -1430,66 +1489,6 @@ private: width = std::max(min_width, width); _recalculateScrollbars = true; } - - uint8_t _activeTool; - uint32_t _currentLine; - uint16_t _landRightsToolSize; - int32_t _firstColumnWidth; - std::vector _mapImageData; - bool _mapWidthAndHeightLinked{ true }; - bool _recalculateScrollbars = false; - enum class ResizeDirection - { - Both, - X, - Y, - } _resizeDirection{ ResizeDirection::Both }; - - static constexpr StringId MapLabels[] = { - STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, - STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, - }; - - static constexpr uint16_t RideKeyColours[] = { - MapColour(PALETTE_INDEX_61), // COLOUR_KEY_RIDE - MapColour(PALETTE_INDEX_42), // COLOUR_KEY_FOOD - MapColour(PALETTE_INDEX_20), // COLOUR_KEY_DRINK - MapColour(PALETTE_INDEX_209), // COLOUR_KEY_SOUVENIR - MapColour(PALETTE_INDEX_136), // COLOUR_KEY_KIOSK - MapColour(PALETTE_INDEX_102), // COLOUR_KEY_FIRST_AID - MapColour(PALETTE_INDEX_55), // COLOUR_KEY_CASH_MACHINE - MapColour(PALETTE_INDEX_161), // COLOUR_KEY_TOILETS - }; - - static constexpr uint8_t DefaultPeepMapColour = PALETTE_INDEX_20; - static constexpr uint8_t GuestMapColour = PALETTE_INDEX_172; - static constexpr uint8_t GuestMapColourAlternate = PALETTE_INDEX_21; - static constexpr uint8_t StaffMapColour = PALETTE_INDEX_138; - static constexpr uint8_t StaffMapColourAlternate = PALETTE_INDEX_10; - - static constexpr uint16_t WaterColour = MapColour(PALETTE_INDEX_195); - - static constexpr uint16_t ElementTypeMaskColour[] = { - 0xFFFF, // TILE_ELEMENT_TYPE_SURFACE - 0x0000, // TILE_ELEMENT_TYPE_PATH - 0x00FF, // TILE_ELEMENT_TYPE_TRACK - 0xFF00, // TILE_ELEMENT_TYPE_SMALL_SCENERY - 0x0000, // TILE_ELEMENT_TYPE_ENTRANCE - 0xFFFF, // TILE_ELEMENT_TYPE_WALL - 0x0000, // TILE_ELEMENT_TYPE_LARGE_SCENERY - 0xFFFF, // TILE_ELEMENT_TYPE_BANNER - }; - - static constexpr uint16_t ElementTypeAddColour[] = { - MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_SURFACE - MapColour(PALETTE_INDEX_17), // TILE_ELEMENT_TYPE_PATH - MapColour2(PALETTE_INDEX_183, PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_TRACK - MapColour2(PALETTE_INDEX_0, PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_SMALL_SCENERY - MapColour(PALETTE_INDEX_186), // TILE_ELEMENT_TYPE_ENTRANCE - MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_WALL - MapColour(PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_LARGE_SCENERY - MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_BANNER - }; }; WindowBase* WindowMapOpen() From baf3d8fdede501a2c8d973081b4b0d88969eef52 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Sat, 2 Mar 2024 20:41:16 +0100 Subject: [PATCH 003/191] Move gCashHistory to GameState_t --- src/openrct2-ui/windows/Finances.cpp | 4 ++-- src/openrct2/GameState.h | 1 + src/openrct2/management/Finance.cpp | 3 +-- src/openrct2/management/Finance.h | 1 - src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/world/Park.cpp | 4 +++- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index b94f1fed68..653b178d65 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -635,7 +635,7 @@ public: int32_t yAxisScale = 0; for (int32_t i = 0; i < 64; i++) { - auto balance = gCashHistory[i]; + auto balance = gameState.CashHistory[i]; if (balance == kMoney64Undefined) continue; @@ -667,7 +667,7 @@ public: // X axis labels and values coords = graphTopLeft + ScreenCoordsXY{ 98, 17 }; - Graph::Draw(dpi, gCashHistory, 64, coords, yAxisScale, 128); + Graph::Draw(dpi, gameState.CashHistory, 64, coords, yAxisScale, 128); } #pragma endregion diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 6a6eec7706..0701676609 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -51,6 +51,7 @@ namespace OpenRCT2 ClimateState ClimateNext; uint16_t ClimateUpdateTimer; money64 Cash; + money64 CashHistory[FINANCE_GRAPH_SIZE]; money64 InitialCash; money64 GuestInitialCash; uint8_t GuestInitialHappiness; diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 292fbe97e8..6e7e4fdd20 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -40,7 +40,6 @@ static constexpr int32_t dword_988E60[static_cast(ExpenditureType::Coun }; money64 gHistoricalProfit; -money64 gCashHistory[FINANCE_GRAPH_SIZE]; money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; /** @@ -190,7 +189,7 @@ void FinanceResetHistory() auto& gameState = GetGameState(); for (int32_t i = 0; i < FINANCE_GRAPH_SIZE; i++) { - gCashHistory[i] = kMoney64Undefined; + gameState.CashHistory[i] = kMoney64Undefined; gameState.WeeklyProfitHistory[i] = kMoney64Undefined; gameState.ParkValueHistory[i] = kMoney64Undefined; } diff --git a/src/openrct2/management/Finance.h b/src/openrct2/management/Finance.h index bc8b028871..6b3536937f 100644 --- a/src/openrct2/management/Finance.h +++ b/src/openrct2/management/Finance.h @@ -44,7 +44,6 @@ extern const money64 research_cost_table[RESEARCH_FUNDING_COUNT]; */ extern money64 gHistoricalProfit; -extern money64 gCashHistory[FINANCE_GRAPH_SIZE]; extern money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; bool FinanceCheckMoneyRequired(uint32_t flags); diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 799c829b68..4f37d842aa 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -927,7 +927,7 @@ namespace OpenRCT2 return true; }); - cs.ReadWriteArray(gCashHistory, [&cs](money64& value) { + cs.ReadWriteArray(gameState.CashHistory, [&cs](money64& value) { cs.ReadWrite(value); return true; }); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index e70c732791..6d714a69f0 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1441,7 +1441,7 @@ namespace RCT1 for (size_t i = 0; i < Limits::FinanceGraphSize; i++) { - gCashHistory[i] = ToMoney64(_s4.CashHistory[i]); + gameState.CashHistory[i] = ToMoney64(_s4.CashHistory[i]); gameState.ParkValueHistory[i] = CorrectRCT1ParkValue(_s4.ParkValueHistory[i]); gameState.WeeklyProfitHistory[i] = ToMoney64(_s4.WeeklyProfitHistory[i]); } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 9093aa1050..c52066d415 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -366,7 +366,7 @@ namespace RCT2 for (size_t i = 0; i < Limits::FinanceGraphSize; i++) { - gCashHistory[i] = ToMoney64(_s6.BalanceHistory[i]); + gameState.CashHistory[i] = ToMoney64(_s6.BalanceHistory[i]); gameState.WeeklyProfitHistory[i] = ToMoney64(_s6.WeeklyProfitHistory[i]); gameState.ParkValueHistory[i] = ToMoney64(_s6.ParkValueHistory[i]); } diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 652c65fdb7..5c7a8c8ece 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -752,7 +752,9 @@ void Park::UpdateHistories() // Update park rating, guests in park and current cash history HistoryPushRecord(gameState.ParkRatingHistory, gameState.ParkRating / 4); HistoryPushRecord(gGuestsInParkHistory, gameState.NumGuestsInPark); - HistoryPushRecord(gCashHistory, FinanceGetCurrentCash() - gameState.BankLoan); + + constexpr auto cashHistorySize = std::extent_v; + HistoryPushRecord(gameState.CashHistory, FinanceGetCurrentCash() - gameState.BankLoan); // Update weekly profit history auto currentWeeklyProfit = gameState.WeeklyProfitAverageDividend; From dabf85882a095bb498549e8c78b4bdbfb7233583 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Sat, 2 Mar 2024 20:48:18 +0100 Subject: [PATCH 004/191] Update contributors.md --- contributors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.md b/contributors.md index a50932ed55..e83a06460b 100644 --- a/contributors.md +++ b/contributors.md @@ -234,6 +234,7 @@ Appreciation for contributors who have provided substantial work, but are no lon * Michael Bernardi (mrmbernardi) * Aram Kazorian (aramk-hub) * Harry Hopkinson (Harry-Hopkinson) +* Jan Kelemen (jan-kelemen) ## Toolchain * (Balletie) - macOS From e05ae5f0510c4a4d877dfe40fd05bb0532b561c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 2 Mar 2024 22:47:13 +0100 Subject: [PATCH 005/191] Start v0.4.10 --- distribution/changelog.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 22c041996b..accd3ee889 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,3 +1,6 @@ +0.4.10 (in development) +------------------------------------------------------------------------ + 0.4.9 (2024-03-02) ------------------------------------------------------------------------ - Feature: [#20376] Add Ukrainian language. From eaa082bf3e56ff11d215bf796f552564fc8a03ea Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sun, 3 Mar 2024 04:01:58 +0000 Subject: [PATCH 006/191] Merge Localisation/master into OpenRCT2/develop --- data/language/ca-ES.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/language/ca-ES.txt b/data/language/ca-ES.txt index 2830536c36..df413d0cc0 100644 --- a/data/language/ca-ES.txt +++ b/data/language/ca-ES.txt @@ -3687,6 +3687,10 @@ STR_6610 :L’element de camí no s’ha trobat STR_6611 :L’element de mur no s’ha trobat STR_6612 :L’element de text de cartell no s’ha trobat STR_6613 :Recarrega l’objecte +STR_6614 :El preu de l’entrada al parc no es pot canviar +STR_6615 :La via d'aquesta casella necessita aigua +STR_6616 :L’acció no és vàlida per a aquest tipus d’empleat +STR_6617 :No es pot intercanviar l’element de la casella amb si mateix ############# # Scenarios # From bc149ca95cf576b09c20f3f205f36540e7c89913 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Sun, 3 Mar 2024 17:05:48 +0100 Subject: [PATCH 007/191] Move gHistoricalProfit and gGuestsInParkHistory to GameState_t (#21513) * Move gGuestsInParkHistory to GameState_t * Move gHistoricalProfit to GameState_t --- src/openrct2-ui/windows/Park.cpp | 6 ++++-- src/openrct2/GameState.h | 3 +++ src/openrct2/management/Finance.cpp | 17 ++++++++--------- src/openrct2/management/Finance.h | 6 ------ src/openrct2/park/ParkFile.cpp | 4 ++-- src/openrct2/rct1/S4Importer.cpp | 8 +++++--- src/openrct2/rct2/S6Importer.cpp | 4 ++-- src/openrct2/scenario/Scenario.cpp | 2 +- src/openrct2/world/Park.cpp | 5 ++--- src/openrct2/world/Park.h | 1 - 10 files changed, 27 insertions(+), 29 deletions(-) diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 4cbaeda968..6bdbd577ad 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -770,9 +770,11 @@ private: auto screenPos = windowPos; Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; + const auto& gameState = OpenRCT2::GetGameState(); + // Current value auto ft = Formatter(); - ft.Add(OpenRCT2::GetGameState().NumGuestsInPark); + ft.Add(gameState.NumGuestsInPark); DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); // Graph border @@ -803,7 +805,7 @@ private: uint8_t cappedHistory[32]; for (size_t i = 0; i < std::size(cappedHistory); i++) { - auto value = gGuestsInParkHistory[i]; + auto value = gameState.GuestsInParkHistory[i]; if (value != std::numeric_limits::max()) { cappedHistory[i] = static_cast(std::min(value, 5000) / 20); diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 0701676609..21a6ecdc5b 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -42,10 +42,13 @@ namespace OpenRCT2 money64 ParkValue; money64 ParkValueHistory[FINANCE_GRAPH_SIZE]; money64 CompanyValue; + // The total profit for the entire scenario that precedes the current financial table. + money64 HistoricalProfit; money64 ConstructionRightsPrice; money64 CurrentExpenditure; money64 CurrentProfit; uint8_t ParkRatingHistory[32]; + uint32_t GuestsInParkHistory[32]; ClimateType Climate; ClimateState ClimateCurrent; ClimateState ClimateNext; diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 6e7e4fdd20..9a99a987f0 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -25,6 +25,8 @@ #include "../windows/Intent.h" #include "../world/Park.h" +#include + using namespace OpenRCT2; // Monthly research funding costs @@ -39,7 +41,6 @@ static constexpr int32_t dword_988E60[static_cast(ExpenditureType::Coun 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, }; -money64 gHistoricalProfit; money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; /** @@ -229,11 +230,10 @@ void FinanceInit() gameState.BankLoan = 10000.00_GBP; gameState.MaxBankLoan = 20000.00_GBP; - gHistoricalProfit = 0; - gameState.BankLoanInterestRate = 10; gameState.ParkValue = 0; gameState.CompanyValue = 0; + gameState.HistoricalProfit = 0; gameState.ScenarioCompletedCompanyValue = kMoney64Undefined; gameState.TotalAdmissions = 0; gameState.TotalIncomeFromAdmissions = 0; @@ -322,12 +322,11 @@ void FinanceShiftExpenditureTable() // If EXPENDITURE_TABLE_MONTH_COUNT months have passed then is full, sum the oldest month if (GetDate().GetMonthsElapsed() >= EXPENDITURE_TABLE_MONTH_COUNT) { - money64 sum = 0; - for (uint32_t i = 0; i < static_cast(ExpenditureType::Count); i++) - { - sum += gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1][i]; - } - gHistoricalProfit += sum; + const money64 sum = std::accumulate( + std::cbegin(gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1]), + std::cend(gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1]), money64{}); + + GetGameState().HistoricalProfit += sum; } // Shift the table diff --git a/src/openrct2/management/Finance.h b/src/openrct2/management/Finance.h index 6b3536937f..7666f3e818 100644 --- a/src/openrct2/management/Finance.h +++ b/src/openrct2/management/Finance.h @@ -38,12 +38,6 @@ constexpr uint8_t MaxBankLoanInterestRate = 255; extern const money64 research_cost_table[RESEARCH_FUNDING_COUNT]; -/** - * The total profit for the entire scenario that precedes - * the current financial table. - */ -extern money64 gHistoricalProfit; - extern money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; bool FinanceCheckMoneyRequired(uint32_t flags); diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 4f37d842aa..26c4dea608 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -851,7 +851,7 @@ namespace OpenRCT2 } } } - cs.ReadWrite(gHistoricalProfit); + cs.ReadWrite(gameState.HistoricalProfit); // Marketing cs.ReadWriteVector(gMarketingCampaigns, [&cs](MarketingCampaign& campaign) { @@ -922,7 +922,7 @@ namespace OpenRCT2 return true; }); - cs.ReadWriteArray(gGuestsInParkHistory, [&cs](uint32_t& value) { + cs.ReadWriteArray(gameState.GuestsInParkHistory, [&cs](uint32_t& value) { cs.ReadWrite(value); return true; }); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 6d714a69f0..fc326b7f94 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2156,7 +2156,7 @@ namespace RCT1 { if (_s4.GuestsInParkHistory[i] != RCT12ParkHistoryUndefined) { - gGuestsInParkHistory[i] = _s4.GuestsInParkHistory[i] * RCT12GuestsInParkHistoryFactor; + gameState.GuestsInParkHistory[i] = _s4.GuestsInParkHistory[i] * RCT12GuestsInParkHistoryFactor; } } @@ -2171,12 +2171,14 @@ namespace RCT1 } // Number of guests history - std::fill(std::begin(gGuestsInParkHistory), std::end(gGuestsInParkHistory), std::numeric_limits::max()); + std::fill( + std::begin(gameState.GuestsInParkHistory), std::end(gameState.GuestsInParkHistory), + std::numeric_limits::max()); for (size_t i = 0; i < std::size(_s4.GuestsInParkHistory); i++) { if (_s4.GuestsInParkHistory[i] != std::numeric_limits::max()) { - gGuestsInParkHistory[i] = _s4.GuestsInParkHistory[i] * 20; + gameState.GuestsInParkHistory[i] = _s4.GuestsInParkHistory[i] * 20; } } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index c52066d415..82ebc8e647 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -314,7 +314,7 @@ namespace RCT2 { if (_s6.GuestsInParkHistory[i] != RCT12ParkHistoryUndefined) { - gGuestsInParkHistory[i] = _s6.GuestsInParkHistory[i] * RCT12GuestsInParkHistoryFactor; + gameState.GuestsInParkHistory[i] = _s6.GuestsInParkHistory[i] * RCT12GuestsInParkHistoryFactor; } } @@ -396,7 +396,7 @@ namespace RCT2 gameState.ScenarioCompanyValueRecord = _s6.CompletedCompanyValueRecord; // _s6.LoanHash; // Pad013587CA - gHistoricalProfit = ToMoney64(_s6.HistoricalProfit); + gameState.HistoricalProfit = ToMoney64(_s6.HistoricalProfit); // Pad013587D4 gameState.ScenarioCompletedBy = std::string_view(_s6.ScenarioCompletedName, sizeof(_s6.ScenarioCompletedName)); gameState.Cash = ToMoney64(DECRYPT_MONEY(_s6.Cash)); diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 1c141a8bbb..d6c055c9f4 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -104,7 +104,7 @@ void ScenarioReset(GameState_t& gameState) gameState.ParkRating = park.CalculateParkRating(); gameState.ParkValue = park.CalculateParkValue(); gameState.CompanyValue = park.CalculateCompanyValue(); - gHistoricalProfit = gameState.InitialCash - gameState.BankLoan; + gameState.HistoricalProfit = gameState.InitialCash - gameState.BankLoan; gameState.Cash = gameState.InitialCash; { diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 5c7a8c8ece..43d325f8b2 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -50,7 +50,6 @@ using namespace OpenRCT2; money64 gLandPrice; int16_t gParkRatingCasualtyPenalty; -uint32_t gGuestsInParkHistory[32]; // If this value is more than or equal to 0, the park rating is forced to this value. Used for cheat static int32_t _forcedParkRating = -1; @@ -729,7 +728,7 @@ void Park::ResetHistories() { auto& gameState = GetGameState(); std::fill(std::begin(gameState.ParkRatingHistory), std::end(gameState.ParkRatingHistory), ParkRatingHistoryUndefined); - std::fill(std::begin(gGuestsInParkHistory), std::end(gGuestsInParkHistory), GuestsInParkHistoryUndefined); + std::fill(std::begin(gameState.GuestsInParkHistory), std::end(gameState.GuestsInParkHistory), GuestsInParkHistoryUndefined); } void Park::UpdateHistories() @@ -751,7 +750,7 @@ void Park::UpdateHistories() // Update park rating, guests in park and current cash history HistoryPushRecord(gameState.ParkRatingHistory, gameState.ParkRating / 4); - HistoryPushRecord(gGuestsInParkHistory, gameState.NumGuestsInPark); + HistoryPushRecord(gameState.GuestsInParkHistory, gameState.NumGuestsInPark); constexpr auto cashHistorySize = std::extent_v; HistoryPushRecord(gameState.CashHistory, FinanceGetCurrentCash() - gameState.BankLoan); diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index c0858ff0fe..404bcdb78c 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -95,7 +95,6 @@ namespace OpenRCT2 extern money64 gLandPrice; extern int16_t gParkRatingCasualtyPenalty; -extern uint32_t gGuestsInParkHistory[32]; void ParkSetForcedRating(int32_t rating); int32_t ParkGetForcedRating(); From 4ccecd6e680727b46dc8001c778707a49960b831 Mon Sep 17 00:00:00 2001 From: mrmbernardi Date: Sun, 3 Mar 2024 18:04:09 +0100 Subject: [PATCH 008/191] Remove forwarding functions in Window.cpp (#21516) --- src/openrct2-ui/input/MouseInput.cpp | 32 +-- src/openrct2-ui/input/Shortcuts.cpp | 32 +-- src/openrct2-ui/interface/Widget.cpp | 2 +- src/openrct2-ui/interface/Window.cpp | 14 +- src/openrct2-ui/scripting/CustomWindow.cpp | 4 +- .../windows/EditorBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Finances.cpp | 4 +- src/openrct2-ui/windows/InstallTrack.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 4 +- src/openrct2-ui/windows/NewRide.cpp | 6 +- src/openrct2-ui/windows/News.cpp | 5 +- src/openrct2-ui/windows/Options.cpp | 4 +- src/openrct2-ui/windows/Park.cpp | 8 +- src/openrct2-ui/windows/RideConstruction.cpp | 228 +++++++++--------- src/openrct2-ui/windows/Scenery.cpp | 4 +- src/openrct2-ui/windows/Staff.cpp | 6 +- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2-ui/windows/TextInput.cpp | 10 +- src/openrct2-ui/windows/Themes.cpp | 2 +- src/openrct2-ui/windows/Tooltip.cpp | 4 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2/entity/Guest.cpp | 4 +- src/openrct2/entity/Peep.cpp | 4 +- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/interface/Window.cpp | 165 ++----------- src/openrct2/interface/Window.h | 27 --- src/openrct2/ride/Ride.cpp | 4 +- src/openrct2/ride/RideConstruction.cpp | 4 +- 28 files changed, 211 insertions(+), 376 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index b31e8c2e18..80aaa68cbf 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -390,7 +390,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState break; } - WindowEventToolDragCall(w, gCurrentToolWidget.widget_index, screenCoords); + w->OnToolDrag(gCurrentToolWidget.widget_index, screenCoords); break; case MouseState::LeftRelease: _inputState = InputState::Reset; @@ -401,7 +401,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) { - WindowEventToolUpCall(w, gCurrentToolWidget.widget_index, screenCoords); + w->OnToolUp(gCurrentToolWidget.widget_index, screenCoords); } } else if (!(_inputFlags & INPUT_FLAG_4)) @@ -482,7 +482,7 @@ static void InputWindowPositionEnd(WindowBase& w, const ScreenCoordsXY& screenCo _inputState = InputState::Normal; gTooltipCloseTimeout = 0; gTooltipWidget = _dragWidget; - WindowEventMovedCall(&w, screenCoords); + w.OnMoved(screenCoords); } static void InputWindowResizeBegin(WindowBase& w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) @@ -625,10 +625,10 @@ static void InputScrollBegin(WindowBase& w, WidgetIndex widgetIndex, const Scree _currentScrollArea = scroll_area; _currentScrollIndex = scroll_id; - WindowEventScrollSelectCall(&w, scroll_id, scroll_area); + w.OnScrollSelect(scroll_id, scroll_area); if (scroll_area == SCROLL_PART_VIEW) { - WindowEventScrollMousedownCall(&w, scroll_id, scrollCoords); + w.OnScrollMouseDown(scroll_id, scrollCoords); return; } @@ -718,7 +718,7 @@ static void InputScrollContinue(WindowBase& w, WidgetIndex widgetIndex, const Sc switch (scroll_part) { case SCROLL_PART_VIEW: - WindowEventScrollMousedragCall(&w, scroll_id, newScreenCoords); + w.OnScrollMouseDrag(scroll_id, newScreenCoords); break; case SCROLL_PART_HSCROLLBAR_LEFT: InputScrollPartUpdateHLeft(w, widgetIndex, scroll_id); @@ -938,7 +938,7 @@ static void InputWidgetOver(const ScreenCoordsXY& screenCoords, WindowBase* w, W WindowTooltipClose(); else { - WindowEventScrollMouseoverCall(w, scrollId, newScreenCoords); + w->OnScrollMouseOver(scrollId, newScreenCoords); InputUpdateTooltip(w, widgetIndex, screenCoords); } } @@ -985,7 +985,7 @@ static void InputWidgetOverFlatbuttonInvalidate() WindowBase* w = WindowFindByNumber(gHoverWidget.window_classification, gHoverWidget.window_number); if (w != nullptr) { - WindowEventOnPrepareDrawCall(w); + w->OnPrepareDraw(); if (w->widgets[gHoverWidget.widget_index].type == WindowWidgetType::FlatBtn) { WidgetInvalidateByNumber(gHoverWidget.window_classification, gHoverWidget.window_number, gHoverWidget.widget_index); @@ -1047,7 +1047,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, WindowBase* w, W if (w != nullptr) { InputSetFlag(INPUT_FLAG_4, true); - WindowEventToolDownCall(w, gCurrentToolWidget.widget_index, screenCoords); + w->OnToolDown(gCurrentToolWidget.widget_index, screenCoords); } } break; @@ -1091,7 +1091,7 @@ static void InputWidgetLeft(const ScreenCoordsXY& screenCoords, WindowBase* w, W _clickRepeatTicks = gCurrentRealTimeTicks; WidgetInvalidateByNumber(windowClass, windowNumber, widgetIndex); - WindowEventMouseDownCall(w, widgetIndex); + w->OnMouseDown(widgetIndex); } break; } @@ -1162,13 +1162,13 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords) break; } // Same as default but with scroll_x/y - cursorId = WindowEventCursorCall(window, widgetId, scrollCoords); + cursorId = window->OnCursor(widgetId, scrollCoords, CursorID::Arrow); if (cursorId == CursorID::Undefined) cursorId = CursorID::Arrow; break; } default: - cursorId = WindowEventCursorCall(window, widgetId, screenCoords); + cursorId = window->OnCursor(widgetId, screenCoords, CursorID::Arrow); if (cursorId == CursorID::Undefined) cursorId = CursorID::Arrow; break; @@ -1193,7 +1193,7 @@ void ProcessMouseTool(const ScreenCoordsXY& screenCoords) if (w == nullptr) ToolCancel(); else if (InputGetState() != InputState::ViewportRight) - WindowEventToolUpdateCall(w, gCurrentToolWidget.widget_index, screenCoords); + w->OnToolUpdate(gCurrentToolWidget.widget_index, screenCoords); } } @@ -1323,7 +1323,7 @@ void InputStateWidgetPressed( { if (WidgetIsHoldable(*w, widgetIndex)) { - WindowEventMouseDownCall(w, widgetIndex); + w->OnMouseDown(widgetIndex); } // Subtract initial delay from here on we want the event each third tick. @@ -1413,7 +1413,7 @@ void InputStateWidgetPressed( dropdown_index = gDropdownDefaultIndex; } } - WindowEventDropdownCall(cursor_w, cursor_widgetIndex, dropdown_index); + cursor_w->OnDropdown(cursor_widgetIndex, dropdown_index); } } } @@ -1445,7 +1445,7 @@ void InputStateWidgetPressed( break; WidgetInvalidateByNumber(cursor_w_class, cursor_w_number, widgetIndex); - WindowEventMouseUpCall(w, widgetIndex); + w->OnMouseUp(widgetIndex); return; default: diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 35e3805dba..bc7f27406c 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -93,7 +93,7 @@ static void ShortcutRotateConstructionObject() if (w != nullptr && !WidgetIsDisabled(*w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON) && w->widgets[WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type != WindowWidgetType::Empty) { - WindowEventMouseUpCall(w, WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON); + w->OnMouseUp(WC_SCENERY__WIDX_SCENERY_ROTATE_OBJECTS_BUTTON); return; } @@ -105,7 +105,7 @@ static void ShortcutRotateConstructionObject() // Check if building a maze... if (w->widgets[WC_RIDE_CONSTRUCTION__WIDX_ROTATE].tooltip != STR_RIDE_CONSTRUCTION_BUILD_MAZE_IN_THIS_DIRECTION_TIP) { - WindowEventMouseUpCall(w, WC_RIDE_CONSTRUCTION__WIDX_ROTATE); + w->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ROTATE); return; } } @@ -115,7 +115,7 @@ static void ShortcutRotateConstructionObject() if (w != nullptr && !WidgetIsDisabled(*w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE) && w->widgets[WC_TRACK_DESIGN_LIST__WIDX_ROTATE].type != WindowWidgetType::Empty) { - WindowEventMouseUpCall(w, WC_TRACK_DESIGN_LIST__WIDX_ROTATE); + w->OnMouseUp(WC_TRACK_DESIGN_LIST__WIDX_ROTATE); return; } @@ -124,7 +124,7 @@ static void ShortcutRotateConstructionObject() if (w != nullptr && !WidgetIsDisabled(*w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE) && w->widgets[WC_TRACK_DESIGN_PLACE__WIDX_ROTATE].type != WindowWidgetType::Empty) { - WindowEventMouseUpCall(w, WC_TRACK_DESIGN_PLACE__WIDX_ROTATE); + w->OnMouseUp(WC_TRACK_DESIGN_PLACE__WIDX_ROTATE); return; } @@ -133,7 +133,7 @@ static void ShortcutRotateConstructionObject() if (w != nullptr && !WidgetIsDisabled(*w, WC_MAP__WIDX_ROTATE_90) && w->widgets[WC_MAP__WIDX_ROTATE_90].type != WindowWidgetType::Empty) { - WindowEventMouseUpCall(w, WC_MAP__WIDX_ROTATE_90); + w->OnMouseUp(WC_MAP__WIDX_ROTATE_90); return; } @@ -142,7 +142,7 @@ static void ShortcutRotateConstructionObject() if (w != nullptr && !WidgetIsDisabled(*w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE) && w->widgets[WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE].type != WindowWidgetType::Empty) { - WindowEventMouseUpCall(w, WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE); + w->OnMouseUp(WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE); return; } } @@ -202,7 +202,7 @@ static void ShortcutAdjustLand() if (window != nullptr) { window->Invalidate(); - WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_LAND); + window->OnMouseUp(WC_TOP_TOOLBAR__WIDX_LAND); } } } @@ -221,7 +221,7 @@ static void ShortcutAdjustWater() if (window != nullptr) { window->Invalidate(); - WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_WATER); + window->OnMouseUp(WC_TOP_TOOLBAR__WIDX_WATER); } } } @@ -240,7 +240,7 @@ static void ShortcutBuildScenery() if (window != nullptr) { window->Invalidate(); - WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_SCENERY); + window->OnMouseUp(WC_TOP_TOOLBAR__WIDX_SCENERY); } } } @@ -417,7 +417,7 @@ static void ShortcutClearScenery() if (window != nullptr) { window->Invalidate(); - WindowEventMouseUpCall(window, WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY); + window->OnMouseUp(WC_TOP_TOOLBAR__WIDX_CLEAR_SCENERY); } } } @@ -462,7 +462,7 @@ static void ShortcutOpenSceneryPicker() if (window_toolbar != nullptr) { window_toolbar->Invalidate(); - WindowEventMouseUpCall(window_toolbar, WC_TOP_TOOLBAR__WIDX_SCENERY); + window_toolbar->OnMouseUp(WC_TOP_TOOLBAR__WIDX_SCENERY); } } @@ -471,7 +471,7 @@ static void ShortcutOpenSceneryPicker() && window_scenery->widgets[WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON].type != WindowWidgetType::Empty && !gWindowSceneryEyedropperEnabled) { - WindowEventMouseUpCall(window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON); + window_scenery->OnMouseUp(WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON); return; } } @@ -501,7 +501,7 @@ static void TileInspectorMouseUp(WidgetIndex widgetIndex) auto w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty) { - WindowEventMouseUpCall(w, widgetIndex); + w->OnMouseUp(widgetIndex); } } @@ -510,7 +510,7 @@ static void TileInspectorMouseDown(WidgetIndex widgetIndex) auto w = WindowFindByClass(WindowClass::TileInspector); if (w != nullptr && !WidgetIsDisabled(*w, widgetIndex) && w->widgets[widgetIndex].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, widgetIndex); + w->OnMouseDown(widgetIndex); } } @@ -573,7 +573,7 @@ static void ShortcutIncreaseElementHeight() break; } if (action != -1 && !WidgetIsDisabled(*w, action) && w->widgets[action].type != WindowWidgetType::Empty) - WindowEventMouseDownCall(w, action); + w->OnMouseDown(action); return; } } @@ -612,7 +612,7 @@ static void ShortcutDecreaseElementHeight() break; } if (action != -1 && !WidgetIsDisabled(*w, action) && w->widgets[action].type != WindowWidgetType::Empty) - WindowEventMouseDownCall(w, action); + w->OnMouseDown(action); return; } } diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 31a1167135..b3fe15bc59 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -726,7 +726,7 @@ static void WidgetScrollDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg // Draw the scroll contents if (scroll_dpi.width > 0 && scroll_dpi.height > 0) - WindowEventScrollDrawCall(&w, scroll_dpi, scrollIndex); + w.OnScrollDraw(scrollIndex, scroll_dpi); } static void WidgetHScrollbarDraw( diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 1bc3333010..ab5f204842 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -10,6 +10,7 @@ #include "Window.h" #include "Theme.h" +#include "openrct2/world/Location.hpp" #include #include @@ -503,7 +504,7 @@ static bool WindowOtherWheelInput(WindowBase& w, WidgetIndex widgetIndex, int32_ return false; } - WindowEventMouseDownCall(&w, buttonWidgetIndex); + w.OnMouseDown(buttonWidgetIndex); return true; } @@ -580,7 +581,6 @@ void WindowInitScrollWidgets(WindowBase& w) { Widget* widget; int32_t widget_index, scroll_index; - int32_t width, height; widget_index = 0; scroll_index = 0; @@ -594,13 +594,11 @@ void WindowInitScrollWidgets(WindowBase& w) auto& scroll = w.scrolls[scroll_index]; scroll.flags = 0; - width = 0; - height = 0; - WindowGetScrollSize(&w, scroll_index, &width, &height); + ScreenSize scrollSize = w.OnScrollGetSize(scroll_index); scroll.h_left = 0; - scroll.h_right = width + 1; + scroll.h_right = scrollSize.width + 1; scroll.v_top = 0; - scroll.v_bottom = height + 1; + scroll.v_bottom = scrollSize.height + 1; if (widget->content & SCROLL_HORIZONTAL) scroll.flags |= HSCROLLBAR_VISIBLE; @@ -688,7 +686,7 @@ void InvalidateAllWindowsAfterInput() WindowVisitEach([](WindowBase* w) { WindowUpdateScrollWidgets(*w); WindowInvalidatePressedImageButton(*w); - WindowEventResizeCall(w); + w->OnResize(); }); } diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index ad4bf16a7d..c6d4d91d78 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -745,8 +745,8 @@ namespace OpenRCT2::Ui::Windows RefreshWidgets(); Invalidate(); - WindowEventResizeCall(this); - WindowEventOnPrepareDrawCall(this); + OnResize(); + OnPrepareDraw(); WindowInitScrollWidgets(*this); Invalidate(); diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 9d52496352..ad5a361fec 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -201,7 +201,7 @@ private: if (w != nullptr) { // Click tab with missing object - WindowEventMouseUpCall(w, WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); + w->OnMouseUp(WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); } return false; } diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 653b178d65..d612e9a3d7 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -468,8 +468,8 @@ public: width = WW_OTHER_TABS; height = WH_OTHER_TABS; } - WindowEventResizeCall(this); - WindowEventOnPrepareDrawCall(this); + OnResize(); + OnPrepareDraw(); WindowInitScrollWidgets(*this); diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 12a509d186..f1cea9d926 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -128,7 +128,7 @@ public: _trackName = std::string(text); - WindowEventMouseUpCall(this, WIDX_INSTALL); + OnMouseUp(WIDX_INSTALL); } void OnPrepareDraw() override diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 420aea93d1..328e86fdde 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -212,8 +212,8 @@ void MultiplayerWindow::SetPage(int32_t page_number) widgets = window_multiplayer_page_widgets[page]; widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page]; - WindowEventResizeCall(this); - WindowEventOnPrepareDrawCall(this); + OnResize(); + OnPrepareDraw(); InitScrollWidgets(); Invalidate(); } diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index b72282669d..b90a39f7ba 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -905,14 +905,12 @@ private: auto& currentTabScroll = _windowNewRideTabScroll[_currentTab]; // Get maximum scroll height - int32_t scrollWidth = 0; - int32_t scrollHeight = 0; - WindowGetScrollSize(this, 0, &scrollWidth, &scrollHeight); + ScreenSize scrollSize = OnScrollGetSize(0); const Widget& listWidget = widgets[WIDX_RIDE_LIST]; const int32_t listWidgetHeight = listWidget.bottom - listWidget.top - 1; // Ensure the current tab scroll is within range - currentTabScroll = std::min(currentTabScroll, std::max(0, scrollHeight - listWidgetHeight)); + currentTabScroll = std::min(currentTabScroll, std::max(0, scrollSize.height - listWidgetHeight)); scrolls[0].v_top = currentTabScroll; WidgetScrollUpdateThumbs(*this, WIDX_RIDE_LIST); diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index d65b65fc88..0765f8c96f 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -63,10 +63,9 @@ public: WindowInitScrollWidgets(*this); _pressedNewsItemIndex = -1; - int32_t w = 0, h = 0; Widget* widget = &widgets[WIDX_SCROLL]; - WindowGetScrollSize(this, 0, &w, &h); - scrolls[0].v_top = std::max(0, h - (widget->height() - 1)); + ScreenSize scrollSize = OnScrollGetSize(0); + scrolls[0].v_top = std::max(0, scrollSize.height - (widget->height() - 1)); WidgetScrollUpdateThumbs(*this, WIDX_SCROLL); } diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 93995d3e7b..5e7d60256e 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2053,8 +2053,8 @@ private: widgets = window_options_page_widgets[page]; Invalidate(); - WindowEventResizeCall(this); - WindowEventOnPrepareDrawCall(this); + OnResize(); + OnPrepareDraw(); InitScrollWidgets(); Invalidate(); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 6bdbd577ad..c900be1989 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -637,7 +637,7 @@ private: } // Call invalidate event - WindowEventOnPrepareDrawCall(this); + OnPrepareDraw(); focus = newFocus; @@ -1202,9 +1202,9 @@ private: SetDisabledTabs(); Invalidate(); - WindowEventResizeCall(this); - WindowEventOnPrepareDrawCall(this); - WindowEventUpdateCall(this); + OnResize(); + OnPrepareDraw(); + OnUpdate(); if (listen && viewport != nullptr) viewport->flags |= VIEWPORT_FLAG_SOUND_ON; } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 1df39a2bd9..4f56bbcc1d 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2752,7 +2752,7 @@ static void CloseConstructWindowOnCompletion(const Ride& ride) } else { - WindowEventMouseUpCall(w, WIDX_ENTRANCE); + w->OnMouseUp(WIDX_ENTRANCE); } } } @@ -2774,7 +2774,7 @@ static void WindowRideConstructionDoEntranceExitCheck() { if (!RideAreAllPossibleEntrancesAndExitsBuilt(*ride).Successful) { - WindowEventMouseUpCall(w, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); + w->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); } } } @@ -3582,7 +3582,7 @@ void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords) break; gDisableErrorWindowSound = true; - WindowEventMouseUpCall(w, WIDX_CONSTRUCT); + w->OnMouseUp(WIDX_CONSTRUCT); gDisableErrorWindowSound = false; if (_trackPlaceCost == kMoney64Undefined) @@ -3642,20 +3642,20 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } break; case EnumValue(TrackCurve::Left): if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3665,19 +3665,19 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() case EnumValue(TrackCurve::LeftLarge): if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3688,23 +3688,23 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3714,29 +3714,29 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() case EnumValue(TrackCurve::RightLarge): if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3747,33 +3747,33 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3783,39 +3783,39 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() case EnumValue(TrackCurve::RightSmall): if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3826,43 +3826,43 @@ void WindowRideConstructionKeyboardShortcutTurnLeft() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); } else { @@ -3888,20 +3888,20 @@ void WindowRideConstructionKeyboardShortcutTurnRight() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } break; case EnumValue(TrackCurve::Right): if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -3911,19 +3911,19 @@ void WindowRideConstructionKeyboardShortcutTurnRight() case EnumValue(TrackCurve::RightLarge): if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -3934,23 +3934,23 @@ void WindowRideConstructionKeyboardShortcutTurnRight() if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -3960,29 +3960,29 @@ void WindowRideConstructionKeyboardShortcutTurnRight() case EnumValue(TrackCurve::LeftLarge): if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -3993,33 +3993,33 @@ void WindowRideConstructionKeyboardShortcutTurnRight() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4029,39 +4029,39 @@ void WindowRideConstructionKeyboardShortcutTurnRight() case EnumValue(TrackCurve::LeftSmall): if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4072,43 +4072,43 @@ void WindowRideConstructionKeyboardShortcutTurnRight() if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_SMALL); + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); } else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE); + w->OnMouseDown(WIDX_LEFT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEFT_CURVE_LARGE); + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_LARGE); + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); } else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE); + w->OnMouseDown(WIDX_RIGHT_CURVE); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); } else if ( !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_RIGHT_CURVE_VERY_SMALL); + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); } else { @@ -4130,23 +4130,23 @@ void WindowRideConstructionKeyboardShortcutUseTrackDefault() if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_STRAIGHT); + w->OnMouseDown(WIDX_STRAIGHT); } if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEVEL); + w->OnMouseDown(WIDX_LEVEL); } if (!WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) && w->widgets[WIDX_CHAIN_LIFT].type != WindowWidgetType::Empty && _currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) { - WindowEventMouseDownCall(w, WIDX_CHAIN_LIFT); + w->OnMouseDown(WIDX_CHAIN_LIFT); } if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_STRAIGHT); + w->OnMouseDown(WIDX_BANK_STRAIGHT); } } @@ -4165,20 +4165,20 @@ void WindowRideConstructionKeyboardShortcutSlopeDown() && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); } break; case TrackPitch::Down25: if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); } break; case TrackPitch::None: if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); + w->OnMouseDown(WIDX_SLOPE_DOWN); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4190,7 +4190,7 @@ void WindowRideConstructionKeyboardShortcutSlopeDown() !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); } else { @@ -4200,17 +4200,17 @@ void WindowRideConstructionKeyboardShortcutSlopeDown() case TrackPitch::Up25: if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEVEL); + w->OnMouseDown(WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); + w->OnMouseDown(WIDX_SLOPE_DOWN); } else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); } else { @@ -4220,15 +4220,15 @@ void WindowRideConstructionKeyboardShortcutSlopeDown() case TrackPitch::Up60: if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP); + w->OnMouseDown(WIDX_SLOPE_UP); } else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEVEL); + w->OnMouseDown(WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); + w->OnMouseDown(WIDX_SLOPE_DOWN); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4240,7 +4240,7 @@ void WindowRideConstructionKeyboardShortcutSlopeDown() !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); } else { @@ -4252,7 +4252,7 @@ void WindowRideConstructionKeyboardShortcutSlopeDown() && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); } break; default: @@ -4275,19 +4275,19 @@ void WindowRideConstructionKeyboardShortcutSlopeUp() && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); } break; case TrackPitch::Up25: if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); } break; case TrackPitch::None: if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP); + w->OnMouseDown(WIDX_SLOPE_UP); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4298,7 +4298,7 @@ void WindowRideConstructionKeyboardShortcutSlopeUp() else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); } else { @@ -4308,16 +4308,16 @@ void WindowRideConstructionKeyboardShortcutSlopeUp() case TrackPitch::Down25: if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEVEL); + w->OnMouseDown(WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP); + w->OnMouseDown(WIDX_SLOPE_UP); } else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); } else { @@ -4327,15 +4327,15 @@ void WindowRideConstructionKeyboardShortcutSlopeUp() case TrackPitch::Down60: if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN); + w->OnMouseDown(WIDX_SLOPE_DOWN); } else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_LEVEL); + w->OnMouseDown(WIDX_LEVEL); } else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP); + w->OnMouseDown(WIDX_SLOPE_UP); } else if ( IsTrackEnabled(TRACK_SLOPE_VERTICAL) @@ -4346,7 +4346,7 @@ void WindowRideConstructionKeyboardShortcutSlopeUp() else if ( !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_UP_STEEP); + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); } else { @@ -4358,7 +4358,7 @@ void WindowRideConstructionKeyboardShortcutSlopeUp() && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_SLOPE_DOWN_STEEP); + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); } break; default: @@ -4374,7 +4374,7 @@ void WindowRideConstructionKeyboardShortcutChainLiftToggle() return; } - WindowEventMouseDownCall(w, WIDX_CHAIN_LIFT); + w->OnMouseDown(WIDX_CHAIN_LIFT); } void WindowRideConstructionKeyboardShortcutBankLeft() @@ -4391,17 +4391,17 @@ void WindowRideConstructionKeyboardShortcutBankLeft() case TrackRoll::None: if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_LEFT); + w->OnMouseDown(WIDX_BANK_LEFT); } break; case TrackRoll::Right: if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_STRAIGHT); + w->OnMouseDown(WIDX_BANK_STRAIGHT); } else if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_LEFT); + w->OnMouseDown(WIDX_BANK_LEFT); } else { @@ -4427,17 +4427,17 @@ void WindowRideConstructionKeyboardShortcutBankRight() case TrackRoll::None: if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_RIGHT); + w->OnMouseDown(WIDX_BANK_RIGHT); } break; case TrackRoll::Left: if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_STRAIGHT); + w->OnMouseDown(WIDX_BANK_STRAIGHT); } else if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) { - WindowEventMouseDownCall(w, WIDX_BANK_RIGHT); + w->OnMouseDown(WIDX_BANK_RIGHT); } else { @@ -4458,7 +4458,7 @@ void WindowRideConstructionKeyboardShortcutPreviousTrack() return; } - WindowEventMouseUpCall(w, WIDX_PREVIOUS_SECTION); + w->OnMouseUp(WIDX_PREVIOUS_SECTION); } void WindowRideConstructionKeyboardShortcutNextTrack() @@ -4470,7 +4470,7 @@ void WindowRideConstructionKeyboardShortcutNextTrack() return; } - WindowEventMouseUpCall(w, WIDX_NEXT_SECTION); + w->OnMouseUp(WIDX_NEXT_SECTION); } void WindowRideConstructionKeyboardShortcutBuildCurrent() @@ -4481,7 +4481,7 @@ void WindowRideConstructionKeyboardShortcutBuildCurrent() return; } - WindowEventMouseUpCall(w, WIDX_CONSTRUCT); + w->OnMouseUp(WIDX_CONSTRUCT); } void WindowRideConstructionKeyboardShortcutDemolishCurrent() @@ -4492,7 +4492,7 @@ void WindowRideConstructionKeyboardShortcutDemolishCurrent() return; } - WindowEventMouseUpCall(w, WIDX_DEMOLISH); + w->OnMouseUp(WIDX_DEMOLISH); } static void WindowRideConstructionMouseUpDemolishNextPiece(const CoordsXYZD& piecePos, int32_t type) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 82b2ce0c57..28c38cfb13 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -322,7 +322,7 @@ public: height = min_height; Invalidate(); // HACK: For some reason invalidate has not been called - WindowEventOnPrepareDrawCall(this); + OnPrepareDraw(); ContentUpdateScroll(); } @@ -332,7 +332,7 @@ public: height = max_height; Invalidate(); // HACK: For some reason invalidate has not been called - WindowEventOnPrepareDrawCall(this); + OnPrepareDraw(); ContentUpdateScroll(); } diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index b720629f3f..0be54eae8a 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -1095,8 +1095,8 @@ private: RemoveViewport(); Invalidate(); - WindowEventResizeCall(this); - WindowEventOnPrepareDrawCall(this); + OnResize(); + OnPrepareDraw(); InitScrollWidgets(); ViewportInit(); Invalidate(); @@ -1159,7 +1159,7 @@ private: viewport_flags |= VIEWPORT_FLAG_GRIDLINES; } - WindowEventOnPrepareDrawCall(this); + OnPrepareDraw(); focus = tempFocus; diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 2aa55093bd..97d2f555a4 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -463,7 +463,7 @@ public: { ToolCancel(); auto* staffWindow = WindowStaffOpen(closestStaffMember); - WindowEventDropdownCall(staffWindow, WC_PEEP__WIDX_PATROL, 0); + staffWindow->OnDropdown(WC_PEEP__WIDX_PATROL, 0); } else { diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index c6dea3ad2b..b2e4639156 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -327,11 +327,13 @@ private: { if (HasParentWindow()) { - auto w = GetParentWindow(); - if (w != nullptr) + if (hasValue) { - auto value = hasValue ? _buffer.data() : nullptr; - WindowEventTextinputCall(w, _parentWidget.widget_index, value); + auto w = GetParentWindow(); + if (w != nullptr) + { + w->OnTextInput(_parentWidget.widget_index, _buffer); + } } } else diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 9b778f30fd..25bfb7928f 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -488,7 +488,7 @@ public: _selected_tab = static_cast(newSelectedTab); scrolls[0].v_top = 0; frame_no = 0; - WindowEventResizeCall(this); + OnResize(); Invalidate(); break; case WIDX_THEMES_PRESETS_DROPDOWN: diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index b114d00710..cb9fd93b61 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -169,7 +169,7 @@ void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const return; auto widget = &widgetWindow->widgets[widgetIndex]; - WindowEventOnPrepareDrawCall(widgetWindow); + widgetWindow->OnPrepareDraw(); OpenRCT2String result; if (widget->flags & WIDGET_FLAGS::TOOLTIP_IS_STRING) @@ -192,7 +192,7 @@ void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const gTooltipWidget.window_classification = widgetWindow->classification; gTooltipWidget.window_number = widgetWindow->number; gTooltipWidget.widget_index = widgetIndex; - result = WindowEventTooltipCall(widgetWindow, widgetIndex, stringId); + result = widgetWindow->OnTooltip(widgetIndex, stringId); if (result.str == STR_NONE) return; } diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index b8f73b0454..57f0785c38 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -250,7 +250,7 @@ public: { RideInitialiseConstructionWindow(*getRide); auto wnd = WindowFindByClass(WindowClass::RideConstruction); - WindowEventMouseUpCall(wnd, WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); + wnd->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); } } } diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index f73432fdd6..02f04eabbf 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -1433,7 +1433,7 @@ void Guest::CheckCantFindRide() if (w != nullptr) { - WindowEventOnPrepareDrawCall(w); + w->OnPrepareDraw(); } WindowInvalidateByNumber(WindowClass::Peep, Id); @@ -3119,7 +3119,7 @@ static void PeepLeavePark(Guest* peep) WindowBase* w = WindowFindByNumber(WindowClass::Peep, peep->Id); if (w != nullptr) - WindowEventOnPrepareDrawCall(w); + w->OnPrepareDraw(); WindowInvalidateByNumber(WindowClass::Peep, peep->Id); } diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index ec4966ed6e..3c16a9645e 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -25,7 +25,7 @@ #include "../entity/Balloon.h" #include "../entity/EntityRegistry.h" #include "../entity/EntityTweener.h" -#include "../interface/Window.h" +#include "../interface/Window_internal.h" #include "../localisation/Formatter.h" #include "../localisation/Formatting.h" #include "../localisation/Localisation.h" @@ -556,7 +556,7 @@ void PeepWindowStateUpdate(Peep* peep) { WindowBase* w = WindowFindByNumber(WindowClass::Peep, peep->Id.ToUnderlying()); if (w != nullptr) - WindowEventOnPrepareDrawCall(w); + w->OnPrepareDraw(); if (peep->Is()) { diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index bc6701c459..026cb67a09 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -565,7 +565,7 @@ static void ViewportSetUndergroundFlag(int32_t underground, WindowBase* window, */ void ViewportUpdatePosition(WindowBase* window) { - WindowEventResizeCall(window); + window->OnResize(); Viewport* viewport = window->viewport; if (viewport == nullptr) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 93514266ff..52dac802eb 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -114,7 +114,7 @@ void WindowVisitEach(std::function func) void WindowDispatchUpdateAll() { // gTooltipNotShownTicks++; - WindowVisitEach([&](WindowBase* w) { WindowEventUpdateCall(w); }); + WindowVisitEach([&](WindowBase* w) { w->OnUpdate(); }); } void WindowUpdateAllViewports() @@ -140,7 +140,7 @@ void WindowUpdateAll() { gWindowUpdateTicks = gCurrentRealTimeTicks + kGameUpdateFPS; - WindowVisitEach([](WindowBase* w) { WindowEventPeriodicUpdateCall(w); }); + WindowVisitEach([](WindowBase* w) { w->OnPeriodicUpdate(); }); } // Border flash invalidation @@ -218,7 +218,7 @@ void WindowSetWindowLimit(int32_t value) */ void WindowClose(WindowBase& w) { - WindowEventCloseCall(&w); + w.OnClose(); // Remove viewport w.RemoveViewport(); @@ -427,7 +427,7 @@ WindowBase* WindowFindFromPoint(const ScreenCoordsXY& screenCoords) WidgetIndex WindowFindWidgetFromPoint(WindowBase& w, const ScreenCoordsXY& screenCoords) { // Invalidate the window - WindowEventOnPrepareDrawCall(&w); + w.OnPrepareDraw(); // Find the widget at point x, y WidgetIndex widget_index = -1; @@ -589,9 +589,10 @@ void WindowUpdateScrollWidgets(WindowBase& w) continue; auto& scroll = w.scrolls[scrollIndex]; - width = 0; - height = 0; - WindowGetScrollSize(&w, scrollIndex, &width, &height); + ScreenSize scrollSize = w.OnScrollGetSize(scrollIndex); + width = scrollSize.width; + height = scrollSize.height; + if (height == 0) { scroll.v_top = 0; @@ -894,7 +895,7 @@ void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords) */ static void call_event_viewport_rotate_on_all_windows() { - WindowVisitEach([](WindowBase* w) { WindowEventViewportRotateCall(w); }); + WindowVisitEach([](WindowBase* w) { w->OnViewportRotate(); }); } /** @@ -1241,7 +1242,7 @@ static void WindowDrawSingle(DrawPixelInfo& dpi, WindowBase& w, int32_t left, in // Invalidate modifies the window colours so first get the correct // colour before setting the global variables for the string painting - WindowEventOnPrepareDrawCall(&w); + w.OnPrepareDraw(); // Text colouring gCurrentWindowColours[0] = NOT_TRANSLUCENT(w.colours[0]); @@ -1249,7 +1250,7 @@ static void WindowDrawSingle(DrawPixelInfo& dpi, WindowBase& w, int32_t left, in gCurrentWindowColours[2] = NOT_TRANSLUCENT(w.colours[2]); gCurrentWindowColours[3] = NOT_TRANSLUCENT(w.colours[3]); - WindowEventOnDrawCall(&w, copy); + w.OnDraw(copy); } /** @@ -1300,8 +1301,8 @@ void WindowResize(WindowBase& w, int32_t dw, int32_t dh) w.width = std::clamp(w.width + dw, w.min_width, w.max_width); w.height = std::clamp(w.height + dh, w.min_height, w.max_height); - WindowEventResizeCall(&w); - WindowEventOnPrepareDrawCall(&w); + w.OnResize(); + w.OnPrepareDraw(); // Update scroll widgets for (auto& scroll : w.scrolls) @@ -1393,143 +1394,11 @@ void ToolCancel() // Abort tool event WindowBase* w = WindowFindByNumber(gCurrentToolWidget.window_classification, gCurrentToolWidget.window_number); if (w != nullptr) - WindowEventToolAbortCall(w, gCurrentToolWidget.widget_index); + w->OnToolAbort(gCurrentToolWidget.widget_index); } } } -void WindowEventCloseCall(WindowBase* w) -{ - w->OnClose(); -} - -void WindowEventMouseUpCall(WindowBase* w, WidgetIndex widgetIndex) -{ - w->OnMouseUp(widgetIndex); -} - -void WindowEventResizeCall(WindowBase* w) -{ - w->OnResize(); -} - -void WindowEventMouseDownCall(WindowBase* w, WidgetIndex widgetIndex) -{ - w->OnMouseDown(widgetIndex); -} - -void WindowEventDropdownCall(WindowBase* w, WidgetIndex widgetIndex, int32_t dropdownIndex) -{ - w->OnDropdown(widgetIndex, dropdownIndex); -} - -void WindowEventUpdateCall(WindowBase* w) -{ - w->OnUpdate(); -} - -void WindowEventPeriodicUpdateCall(WindowBase* w) -{ - w->OnPeriodicUpdate(); -} - -void WindowEventToolUpdateCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnToolUpdate(widgetIndex, screenCoords); -} - -void WindowEventToolDownCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnToolDown(widgetIndex, screenCoords); -} - -void WindowEventToolDragCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnToolDrag(widgetIndex, screenCoords); -} - -void WindowEventToolUpCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnToolUp(widgetIndex, screenCoords); -} - -void WindowEventToolAbortCall(WindowBase* w, WidgetIndex widgetIndex) -{ - w->OnToolAbort(widgetIndex); -} - -void WindowGetScrollSize(WindowBase* w, int32_t scrollIndex, int32_t* width, int32_t* height) -{ - auto size = w->OnScrollGetSize(scrollIndex); - if (width != nullptr) - *width = size.width; - if (height != nullptr) - *height = size.height; -} - -void WindowEventScrollMousedownCall(WindowBase* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnScrollMouseDown(scrollIndex, screenCoords); -} - -void WindowEventScrollMousedragCall(WindowBase* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnScrollMouseDrag(scrollIndex, screenCoords); -} - -void WindowEventScrollMouseoverCall(WindowBase* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - w->OnScrollMouseOver(scrollIndex, screenCoords); -} - -void WindowEventTextinputCall(WindowBase* w, WidgetIndex widgetIndex, const char* text) -{ - if (text != nullptr) - { - w->OnTextInput(widgetIndex, text); - } -} - -void WindowEventViewportRotateCall(WindowBase* w) -{ - w->OnViewportRotate(); -} - -void WindowEventScrollSelectCall(WindowBase* w, int32_t scrollIndex, int32_t scrollAreaType) -{ - w->OnScrollSelect(scrollIndex, scrollAreaType); -} - -OpenRCT2String WindowEventTooltipCall(WindowBase* w, const WidgetIndex widgetIndex, const StringId fallback) -{ - return w->OnTooltip(widgetIndex, fallback); -} - -CursorID WindowEventCursorCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - return w->OnCursor(widgetIndex, screenCoords, CursorID::Arrow); -} - -void WindowEventMovedCall(WindowBase* w, const ScreenCoordsXY& screenCoords) -{ - w->OnMoved(screenCoords); -} - -void WindowEventOnPrepareDrawCall(WindowBase* w) -{ - w->OnPrepareDraw(); -} - -void WindowEventOnDrawCall(WindowBase* w, DrawPixelInfo& dpi) -{ - w->OnDraw(dpi); -} - -void WindowEventScrollDrawCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex) -{ - w->OnScrollDraw(scrollIndex, dpi); -} - /** * * rct2: 0x006ED710 @@ -1874,10 +1743,6 @@ void WindowCancelTextbox() if (gUsingWidgetTextBox) { WindowBase* w = WindowFindByNumber(gCurrentTextBox.window.classification, gCurrentTextBox.window.number); - if (w != nullptr) - { - WindowEventTextinputCall(w, gCurrentTextBox.widget_index, nullptr); - } gCurrentTextBox.window.classification = WindowClass::Null; gCurrentTextBox.window.number = 0; ContextStopTextInput(); @@ -1904,7 +1769,7 @@ void WindowUpdateTextbox() gTextBoxFrameNo = 0; WindowBase* w = WindowFindByNumber(gCurrentTextBox.window.classification, gCurrentTextBox.window.number); WidgetInvalidate(*w, gCurrentTextBox.widget_index); - WindowEventTextinputCall(w, gCurrentTextBox.widget_index, gTextBoxInput.c_str()); + w->OnTextInput(gCurrentTextBox.widget_index, gTextBoxInput); } } diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 86cc0ea8c2..556292be1b 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -616,33 +616,6 @@ void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords); void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords); void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords); -void WindowEventCloseCall(WindowBase* w); -void WindowEventMouseUpCall(WindowBase* w, WidgetIndex widgetIndex); -void WindowEventResizeCall(WindowBase* w); -void WindowEventMouseDownCall(WindowBase* w, WidgetIndex widgetIndex); -void WindowEventDropdownCall(WindowBase* w, WidgetIndex widgetIndex, int32_t dropdownIndex); -void WindowEventUnknown05Call(WindowBase* w); -void WindowEventUpdateCall(WindowBase* w); -void WindowEventPeriodicUpdateCall(WindowBase* w); -void WindowEventToolUpdateCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void WindowEventToolDownCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void WindowEventToolDragCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void WindowEventToolUpCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void WindowEventToolAbortCall(WindowBase* w, WidgetIndex widgetIndex); -void WindowGetScrollSize(WindowBase* w, int32_t scrollIndex, int32_t* width, int32_t* height); -void WindowEventScrollMousedownCall(WindowBase* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -void WindowEventScrollMousedragCall(WindowBase* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -void WindowEventScrollMouseoverCall(WindowBase* w, int32_t scrollIndex, const ScreenCoordsXY& screenCoords); -void WindowEventTextinputCall(WindowBase* w, WidgetIndex widgetIndex, const char* text); -void WindowEventViewportRotateCall(WindowBase* w); -void WindowEventScrollSelectCall(WindowBase* w, int32_t scrollIndex, int32_t scrollAreaType); -OpenRCT2String WindowEventTooltipCall(WindowBase* w, const WidgetIndex widgetIndex, const StringId fallback); -CursorID WindowEventCursorCall(WindowBase* w, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void WindowEventMovedCall(WindowBase* w, const ScreenCoordsXY& screenCoords); -void WindowEventOnPrepareDrawCall(WindowBase* w); -void WindowEventOnDrawCall(WindowBase* w, DrawPixelInfo& dpi); -void WindowEventScrollDrawCall(WindowBase* w, DrawPixelInfo& dpi, int32_t scrollIndex); - void InvalidateAllWindowsAfterInput(); void TextinputCancel(); diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9b8746528b..db11761041 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -31,7 +31,7 @@ #include "../entity/EntityRegistry.h" #include "../entity/Peep.h" #include "../entity/Staff.h" -#include "../interface/Window.h" +#include "../interface/Window_internal.h" #include "../localisation/Date.h" #include "../localisation/Formatter.h" #include "../localisation/Formatting.h" @@ -3968,7 +3968,7 @@ void Ride::ConstructMissingEntranceOrExit() const w = WindowFindByClass(WindowClass::RideConstruction); if (w != nullptr) - WindowEventMouseUpCall(w, entranceOrExit); + w->OnMouseUp(entranceOrExit); } } diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 64ca3022f4..e7591c482e 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -22,7 +22,7 @@ #include "../entity/EntityList.h" #include "../entity/EntityRegistry.h" #include "../entity/Staff.h" -#include "../interface/Window.h" +#include "../interface/Window_internal.h" #include "../localisation/Date.h" #include "../localisation/Formatter.h" #include "../localisation/Localisation.h" @@ -239,7 +239,7 @@ void RideClearForConstruction(Ride& ride) auto w = WindowFindByNumber(WindowClass::Ride, ride.id.ToUnderlying()); if (w != nullptr) - WindowEventResizeCall(w); + w->OnResize(); } /** From 4b6ba80a46e0cd686412dbdb3de1f3589f4ab23f Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 3 Mar 2024 21:44:15 +0000 Subject: [PATCH 009/191] Move cheats to struct in GameState_t --- src/openrct2-ui/input/Shortcuts.cpp | 3 +- .../interface/ViewportInteraction.cpp | 4 +- src/openrct2-ui/windows/Cheats.cpp | 118 +++++------ src/openrct2-ui/windows/Dropdown.cpp | 4 +- src/openrct2-ui/windows/Footpath.cpp | 11 +- src/openrct2-ui/windows/Map.cpp | 10 +- src/openrct2-ui/windows/NewRide.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 63 +++--- src/openrct2-ui/windows/RideConstruction.cpp | 24 +-- src/openrct2-ui/windows/Scenery.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 16 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 2 +- src/openrct2/Cheats.cpp | 187 ++++++++---------- src/openrct2/Cheats.h | 55 +++--- src/openrct2/GameState.h | 3 + src/openrct2/actions/CheatSetAction.cpp | 50 ++--- src/openrct2/actions/ClearAction.cpp | 3 +- .../actions/FootpathAdditionPlaceAction.cpp | 4 +- .../actions/FootpathAdditionRemoveAction.cpp | 4 +- .../actions/FootpathLayoutPlaceAction.cpp | 7 +- src/openrct2/actions/FootpathPlaceAction.cpp | 6 +- src/openrct2/actions/FootpathRemoveAction.cpp | 5 +- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/LandLowerAction.cpp | 3 +- src/openrct2/actions/LandRaiseAction.cpp | 3 +- src/openrct2/actions/LandSetHeightAction.cpp | 10 +- src/openrct2/actions/LandSetRightsAction.cpp | 3 +- .../actions/LargeSceneryPlaceAction.cpp | 14 +- .../actions/LargeSceneryRemoveAction.cpp | 4 +- .../actions/LargeScenerySetColourAction.cpp | 3 +- src/openrct2/actions/MazePlaceTrackAction.cpp | 5 +- src/openrct2/actions/MazeSetTrackAction.cpp | 5 +- .../actions/ParkEntrancePlaceAction.cpp | 2 +- .../actions/ParkEntranceRemoveAction.cpp | 2 +- src/openrct2/actions/PeepSpawnPlaceAction.cpp | 2 +- src/openrct2/actions/RideCreateAction.cpp | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 2 +- .../actions/RideEntranceExitPlaceAction.cpp | 11 +- src/openrct2/actions/RideSetSettingAction.cpp | 17 +- src/openrct2/actions/RideSetVehicleAction.cpp | 13 +- .../actions/SmallSceneryPlaceAction.cpp | 23 ++- .../actions/SmallSceneryRemoveAction.cpp | 3 +- .../actions/SmallScenerySetColourAction.cpp | 5 +- src/openrct2/actions/StaffHireNewAction.cpp | 2 +- .../actions/SurfaceSetStyleAction.cpp | 6 +- src/openrct2/actions/TrackDesignAction.cpp | 15 +- src/openrct2/actions/TrackPlaceAction.cpp | 25 +-- src/openrct2/actions/TrackRemoveAction.cpp | 4 +- src/openrct2/actions/WallPlaceAction.cpp | 17 +- src/openrct2/actions/WallRemoveAction.cpp | 4 +- src/openrct2/actions/WallSetColourAction.cpp | 5 +- src/openrct2/actions/WaterLowerAction.cpp | 9 +- src/openrct2/actions/WaterRaiseAction.cpp | 5 +- src/openrct2/actions/WaterSetHeightAction.cpp | 6 +- src/openrct2/entity/Guest.cpp | 14 +- src/openrct2/entity/Litter.cpp | 2 +- src/openrct2/interface/Colour.h | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 14 +- src/openrct2/management/Marketing.cpp | 5 +- src/openrct2/management/Research.cpp | 2 +- src/openrct2/paint/VirtualFloor.cpp | 3 +- .../paint/tile_element/Paint.Surface.cpp | 4 +- src/openrct2/ride/Ride.cpp | 14 +- src/openrct2/ride/RideConstruction.cpp | 5 +- src/openrct2/ride/RideData.cpp | 11 +- src/openrct2/ride/RideRatings.cpp | 2 +- src/openrct2/ride/Track.cpp | 11 +- src/openrct2/ride/TrackDesign.cpp | 4 +- .../scripting/bindings/game/ScCheats.hpp | 97 ++++----- src/openrct2/windows/_legacy.cpp | 6 +- src/openrct2/world/Climate.cpp | 2 +- src/openrct2/world/ConstructionClearance.cpp | 2 +- src/openrct2/world/Footpath.cpp | 9 +- src/openrct2/world/Map.cpp | 12 +- src/openrct2/world/Scenery.cpp | 6 +- test/tests/PlayTests.cpp | 4 +- 76 files changed, 561 insertions(+), 487 deletions(-) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index bc7f27406c..daef77393d 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -619,7 +619,8 @@ static void ShortcutDecreaseElementHeight() static void ShortcutToggleClearanceChecks() { - auto cheatSetAction = CheatSetAction(CheatType::DisableClearanceChecks, gCheatsDisableClearanceChecks ? 0 : 1); + auto cheatSetAction = CheatSetAction( + CheatType::DisableClearanceChecks, GetGameState().Cheats.DisableClearanceChecks ? 0 : 1); GameActions::Execute(&cheatSetAction); } diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 77d11d6fd5..7d3acc3c3d 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -364,7 +364,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor else { // FIXME: Why does it *2 the value? - if (!gCheatsSandboxMode && !MapIsLocationOwned({ info.Loc, tileElement->GetBaseZ() * 2 })) + if (!GetGameState().Cheats.SandboxMode && !MapIsLocationOwned({ info.Loc, tileElement->GetBaseZ() * 2 })) { info.SpriteType = ViewportInteractionItem::None; return info; @@ -494,7 +494,7 @@ InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoor return info; } case ViewportInteractionItem::ParkEntrance: - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) break; if (tileElement->GetType() != TileElementType::Entrance) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 31641e2c83..bb2aae8cb1 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -474,44 +474,43 @@ public: { auto ft = Formatter::Common(); ft.Add(1000.00_GBP); - SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gCheatsIgnoreRideIntensity); - SetCheckboxValue(WIDX_DISABLE_VANDALISM, gCheatsDisableVandalism); - SetCheckboxValue(WIDX_DISABLE_LITTERING, gCheatsDisableLittering); + SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gameState.Cheats.IgnoreRideIntensity); + SetCheckboxValue(WIDX_DISABLE_VANDALISM, gameState.Cheats.DisableVandalism); + SetCheckboxValue(WIDX_DISABLE_LITTERING, gameState.Cheats.DisableLittering); break; } case WINDOW_CHEATS_PAGE_MISC: widgets[WIDX_OPEN_CLOSE_PARK].text = (gameState.ParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK : STR_CHEAT_OPEN_PARK; SetCheckboxValue(WIDX_FORCE_PARK_RATING, ParkGetForcedRating() >= 0); - SetCheckboxValue(WIDX_FREEZE_WEATHER, gCheatsFreezeWeather); - SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gCheatsNeverendingMarketing); - SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gCheatsDisablePlantAging); - SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gCheatsAllowRegularPathAsQueue); - SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gCheatsAllowSpecialColourSchemes); + SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.FreezeWeather); + SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.NeverendingMarketing); + SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.DisablePlantAging); + SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.AllowRegularPathAsQueue); + SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.Cheats.AllowSpecialColourSchemes); break; case WINDOW_CHEATS_PAGE_RIDES: - SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gCheatsUnlockOperatingLimits); - SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gCheatsDisableBrakesFailure); - SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gCheatsDisableAllBreakdowns); - SetCheckboxValue(WIDX_BUILD_IN_PAUSE_MODE, gCheatsBuildInPauseMode); - SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gCheatsShowAllOperatingModes); - SetCheckboxValue(WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gCheatsShowVehiclesFromOtherTrackTypes); - SetCheckboxValue(WIDX_DISABLE_TRAIN_LENGTH_LIMITS, gCheatsDisableTrainLengthLimit); - SetCheckboxValue(WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, gCheatsEnableChainLiftOnAllTrack); - SetCheckboxValue(WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, gCheatsAllowArbitraryRideTypeChanges); - SetCheckboxValue(WIDX_DISABLE_RIDE_VALUE_AGING, gCheatsDisableRideValueAging); - SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gCheatsIgnoreResearchStatus); - SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gCheatsEnableAllDrawableTrackPieces); - SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gCheatsAllowTrackPlaceInvalidHeights); - SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gCheatsMakeAllDestructible); + SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gameState.Cheats.UnlockOperatingLimits); + SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gameState.Cheats.DisableBrakesFailure); + SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gameState.Cheats.DisableAllBreakdowns); + SetCheckboxValue(WIDX_BUILD_IN_PAUSE_MODE, gameState.Cheats.BuildInPauseMode); + SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gameState.Cheats.ShowAllOperatingModes); + SetCheckboxValue(WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gameState.Cheats.ShowVehiclesFromOtherTrackTypes); + SetCheckboxValue(WIDX_DISABLE_TRAIN_LENGTH_LIMITS, gameState.Cheats.DisableTrainLengthLimit); + SetCheckboxValue(WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, gameState.Cheats.EnableChainLiftOnAllTrack); + SetCheckboxValue(WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, gameState.Cheats.AllowArbitraryRideTypeChanges); + SetCheckboxValue(WIDX_DISABLE_RIDE_VALUE_AGING, gameState.Cheats.DisableRideValueAging); + SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gameState.Cheats.IgnoreResearchStatus); + SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gameState.Cheats.EnableAllDrawableTrackPieces); + SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.Cheats.AllowTrackPlaceInvalidHeights); + SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.Cheats.MakeAllDestructible); break; } // Current weather - window_cheats_misc_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue( - OpenRCT2::GetGameState().ClimateCurrent.Weather)]; + window_cheats_misc_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.ClimateCurrent.Weather)]; // Staff speed - window_cheats_misc_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue(gCheatsSelectedStaffSpeed)]; + window_cheats_misc_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue(gameState.Cheats.SelectedStaffSpeed)]; if (gScreenFlags & SCREEN_FLAGS_EDITOR) { @@ -802,6 +801,7 @@ private: void OnMouseDownMisc(WidgetIndex widgetIndex) { auto* widget = &widgets[widgetIndex]; + auto& gameState = GetGameState(); switch (widgetIndex) { case WIDX_INCREASE_PARK_RATING: @@ -834,7 +834,7 @@ private: { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, std::size(WeatherTypes), dropdownWidget->width() - 3); - auto currentWeather = OpenRCT2::GetGameState().ClimateCurrent.Weather; + auto currentWeather = gameState.ClimateCurrent.Weather; Dropdown::SetChecked(EnumValue(currentWeather), true); } break; @@ -853,17 +853,18 @@ private: WindowDropdownShowTextCustomWidth( { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3); - Dropdown::SetChecked(EnumValue(gCheatsSelectedStaffSpeed), true); + Dropdown::SetChecked(EnumValue(gameState.Cheats.SelectedStaffSpeed), true); } } } void OnMouseUpMisc(WidgetIndex widgetIndex) { + auto& gameState = GetGameState(); switch (widgetIndex) { case WIDX_FREEZE_WEATHER: - CheatsSet(CheatType::FreezeWeather, !gCheatsFreezeWeather); + CheatsSet(CheatType::FreezeWeather, !gameState.Cheats.FreezeWeather); break; case WIDX_OPEN_CLOSE_PARK: CheatsSet(CheatType::OpenClosePark); @@ -890,7 +891,7 @@ private: CheatsSet(CheatType::RemoveLitter); break; case WIDX_DISABLE_PLANT_AGING: - CheatsSet(CheatType::DisablePlantAging, !gCheatsDisablePlantAging); + CheatsSet(CheatType::DisablePlantAging, !gameState.Cheats.DisablePlantAging); break; case WIDX_WIN_SCENARIO: CheatsSet(CheatType::WinScenario); @@ -902,7 +903,7 @@ private: CheatsSet(CheatType::OwnAllLand); break; case WIDX_NEVERENDING_MARKETING: - CheatsSet(CheatType::NeverEndingMarketing, !gCheatsNeverendingMarketing); + CheatsSet(CheatType::NeverEndingMarketing, !gameState.Cheats.NeverendingMarketing); break; case WIDX_FORCE_PARK_RATING: if (ParkGetForcedRating() >= 0) @@ -915,10 +916,10 @@ private: } break; case WIDX_ALLOW_REGULAR_PATH_AS_QUEUE: - CheatsSet(CheatType::AllowRegularPathAsQueue, !gCheatsAllowRegularPathAsQueue); + CheatsSet(CheatType::AllowRegularPathAsQueue, !gameState.Cheats.AllowRegularPathAsQueue); break; case WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES: - CheatsSet(CheatType::AllowSpecialColourSchemes, !gCheatsAllowSpecialColourSchemes); + CheatsSet(CheatType::AllowSpecialColourSchemes, !gameState.Cheats.AllowSpecialColourSchemes); break; } } @@ -937,20 +938,21 @@ private: if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON) { int32_t speed = kCheatsStaffNormalSpeed; + auto& gameState = GetGameState(); switch (dropdownIndex) { case 0: - gCheatsSelectedStaffSpeed = StaffSpeedCheat::None; + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::None; speed = kCheatsStaffNormalSpeed; break; case 1: - gCheatsSelectedStaffSpeed = StaffSpeedCheat::Frozen; + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::Frozen; speed = kCheatsStaffFreezeSpeed; break; case 2: - gCheatsSelectedStaffSpeed = StaffSpeedCheat::Fast; + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::Fast; speed = kCheatsStaffFastSpeed; } CheatsSet(CheatType::SetStaffSpeed, speed); @@ -959,6 +961,7 @@ private: void OnMouseUpGuests(WidgetIndex widgetIndex) { + auto& gameState = GetGameState(); switch (widgetIndex) { case WIDX_GUEST_HAPPINESS_MAX: @@ -1028,41 +1031,42 @@ private: CheatsSet(CheatType::GiveAllGuests, OBJECT_UMBRELLA); break; case WIDX_GUEST_IGNORE_RIDE_INTENSITY: - CheatsSet(CheatType::IgnoreRideIntensity, !gCheatsIgnoreRideIntensity); + CheatsSet(CheatType::IgnoreRideIntensity, !gameState.Cheats.IgnoreRideIntensity); break; case WIDX_DISABLE_VANDALISM: - CheatsSet(CheatType::DisableVandalism, !gCheatsDisableVandalism); + CheatsSet(CheatType::DisableVandalism, !gameState.Cheats.DisableVandalism); break; case WIDX_DISABLE_LITTERING: - CheatsSet(CheatType::DisableLittering, !gCheatsDisableLittering); + CheatsSet(CheatType::DisableLittering, !gameState.Cheats.DisableLittering); break; } } void OnMouseUpRides(WidgetIndex widgetIndex) { + auto& gameState = GetGameState(); switch (widgetIndex) { case WIDX_RENEW_RIDES: CheatsSet(CheatType::RenewRides); break; case WIDX_MAKE_DESTRUCTIBLE: - CheatsSet(CheatType::MakeDestructible, !gCheatsMakeAllDestructible); + CheatsSet(CheatType::MakeDestructible, !gameState.Cheats.MakeAllDestructible); break; case WIDX_FIX_ALL: CheatsSet(CheatType::FixRides); break; case WIDX_UNLOCK_OPERATING_LIMITS: - CheatsSet(CheatType::FastLiftHill, !gCheatsUnlockOperatingLimits); + CheatsSet(CheatType::FastLiftHill, !gameState.Cheats.UnlockOperatingLimits); break; case WIDX_DISABLE_BRAKES_FAILURE: - CheatsSet(CheatType::DisableBrakesFailure, !gCheatsDisableBrakesFailure); + CheatsSet(CheatType::DisableBrakesFailure, !gameState.Cheats.DisableBrakesFailure); break; case WIDX_DISABLE_ALL_BREAKDOWNS: - CheatsSet(CheatType::DisableAllBreakdowns, !gCheatsDisableAllBreakdowns); + CheatsSet(CheatType::DisableAllBreakdowns, !gameState.Cheats.DisableAllBreakdowns); break; case WIDX_BUILD_IN_PAUSE_MODE: - CheatsSet(CheatType::BuildInPauseMode, !gCheatsBuildInPauseMode); + CheatsSet(CheatType::BuildInPauseMode, !gameState.Cheats.BuildInPauseMode); break; case WIDX_RESET_CRASH_STATUS: CheatsSet(CheatType::ResetCrashStatus); @@ -1072,59 +1076,59 @@ private: break; case WIDX_SHOW_ALL_OPERATING_MODES: { - if (!gCheatsShowAllOperatingModes) + if (!gameState.Cheats.ShowAllOperatingModes) { ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } - CheatsSet(CheatType::ShowAllOperatingModes, !gCheatsShowAllOperatingModes); + CheatsSet(CheatType::ShowAllOperatingModes, !gameState.Cheats.ShowAllOperatingModes); } break; case WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES: { - if (!gCheatsShowVehiclesFromOtherTrackTypes) + if (!gameState.Cheats.ShowVehiclesFromOtherTrackTypes) { ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } - CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gCheatsShowVehiclesFromOtherTrackTypes); + CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gameState.Cheats.ShowVehiclesFromOtherTrackTypes); } break; case WIDX_DISABLE_TRAIN_LENGTH_LIMITS: { - if (!gCheatsDisableTrainLengthLimit) + if (!gameState.Cheats.DisableTrainLengthLimit) { ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } - CheatsSet(CheatType::DisableTrainLengthLimit, !gCheatsDisableTrainLengthLimit); + CheatsSet(CheatType::DisableTrainLengthLimit, !gameState.Cheats.DisableTrainLengthLimit); } break; case WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK: - CheatsSet(CheatType::EnableChainLiftOnAllTrack, !gCheatsEnableChainLiftOnAllTrack); + CheatsSet(CheatType::EnableChainLiftOnAllTrack, !gameState.Cheats.EnableChainLiftOnAllTrack); break; case WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES: { - if (!gCheatsAllowArbitraryRideTypeChanges) + if (!gameState.Cheats.AllowArbitraryRideTypeChanges) { ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } - CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gCheatsAllowArbitraryRideTypeChanges); + CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gameState.Cheats.AllowArbitraryRideTypeChanges); } break; case WIDX_DISABLE_RIDE_VALUE_AGING: - CheatsSet(CheatType::DisableRideValueAging, !gCheatsDisableRideValueAging); + CheatsSet(CheatType::DisableRideValueAging, !gameState.Cheats.DisableRideValueAging); break; case WIDX_IGNORE_RESEARCH_STATUS: - CheatsSet(CheatType::IgnoreResearchStatus, !gCheatsIgnoreResearchStatus); + CheatsSet(CheatType::IgnoreResearchStatus, !gameState.Cheats.IgnoreResearchStatus); break; case WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES: - CheatsSet(CheatType::EnableAllDrawableTrackPieces, !gCheatsEnableAllDrawableTrackPieces); + CheatsSet(CheatType::EnableAllDrawableTrackPieces, !gameState.Cheats.EnableAllDrawableTrackPieces); break; case WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS: { - if (!gCheatsAllowTrackPlaceInvalidHeights) + if (!gameState.Cheats.AllowTrackPlaceInvalidHeights) { ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); } - CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gCheatsAllowTrackPlaceInvalidHeights); + CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gameState.Cheats.AllowTrackPlaceInvalidHeights); } break; } diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 6d138abb58..040f0ab728 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -525,7 +526,8 @@ void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownCol { int32_t defaultIndex = -1; - auto numColours = (gCheatsAllowSpecialColourSchemes) ? static_cast(COLOUR_COUNT) : COLOUR_NUM_NORMAL; + auto numColours = (GetGameState().Cheats.AllowSpecialColourSchemes) ? static_cast(COLOUR_COUNT) + : COLOUR_NUM_NORMAL; // Set items for (uint64_t i = 0; i < numColours; i++) { diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index d24ffce194..126ea3d7f4 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -638,7 +638,7 @@ private: uint32_t numPathTypes = 0; // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode); _dropdownEntries.clear(); std::optional defaultIndex; @@ -656,12 +656,15 @@ private: } // If regular paths can be used as queue, only hide the path if we’re _not_ looking at a queue, // but the path surface is one. - if (gCheatsAllowRegularPathAsQueue && !showQueues && ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + if (GetGameState().Cheats.AllowRegularPathAsQueue && !showQueues + && ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) { continue; } // If the cheat is disabled, hide queues from the regular path view and vice versa. - else if (!gCheatsAllowRegularPathAsQueue && showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + else if ( + !GetGameState().Cheats.AllowRegularPathAsQueue + && showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) { continue; } @@ -1393,7 +1396,7 @@ public: void KeyboardShortcutDemolishCurrent() { if (IsWidgetDisabled(WIDX_REMOVE) || widgets[WIDX_REMOVE].type == WindowWidgetType::Empty - || (!gCheatsBuildInPauseMode && GameIsPaused())) + || (!GetGameState().Cheats.BuildInPauseMode && GameIsPaused())) { return; } diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 1c992fc8e3..c46c7123c0 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -607,7 +607,7 @@ public: auto result = GameActions::Execute(&gameAction); if (result.Error == GameActions::Status::Ok) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result.Position); + Audio::Play3D(Audio::SoundId::PlaceItem, result.Position); } } } @@ -657,7 +657,7 @@ public: auto result = GameActions::Execute(&gameAction); if (result.Error == GameActions::Status::Ok) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result.Position); + Audio::Play3D(Audio::SoundId::PlaceItem, result.Position); } } @@ -875,7 +875,7 @@ public: widgets[i].type = WindowWidgetType::Empty; } - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) { // scenario editor: build park entrance selected, show rotate button if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map @@ -946,7 +946,7 @@ public: GfxDrawSprite(dpi, ImageId(SPR_6410, COLOUR_BRIGHT_RED, COLOUR_LIGHT_BROWN), screenCoords); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { // Render the map legend if (selected_tab == PAGE_RIDES) @@ -1461,7 +1461,7 @@ private: { widgets[WIDX_MAP].right = width - 4; - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) widgets[WIDX_MAP].bottom = height - 1 - 72; else if (selected_tab == PAGE_RIDES) widgets[WIDX_MAP].bottom = height - 1 - (4 * LIST_ROW_HEIGHT + 4); diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index b90a39f7ba..a2bda0caae 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -615,7 +615,7 @@ private: auto currentRideEntry = GetRideEntryByIndex(rideEntryIndex); // Skip if vehicle type is not invented yet - if (!RideEntryIsInvented(rideEntryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) { continue; } @@ -677,7 +677,7 @@ private: for (auto rideEntryIndex : rideEntries) { // Skip if vehicle type is not invented yet - if (!RideEntryIsInvented(rideEntryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) continue; // Ride entries diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 03d4880f9f..5fcacffb73 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -1603,7 +1603,7 @@ private: } } } - if (gCheatsAllowArbitraryRideTypeChanges) + if (GetGameState().Cheats.AllowArbitraryRideTypeChanges) { minHeight += 15; } @@ -1904,7 +1904,7 @@ private: int32_t rideTypeIterator, rideTypeIteratorMax; const auto& rtd = ride.GetRideTypeDescriptor(); - if (gCheatsShowVehiclesFromOtherTrackTypes + if (GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes && !( rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE) || ride.type == RIDE_TYPE_MINI_GOLF)) @@ -1945,7 +1945,7 @@ private: continue; // Skip if vehicle type has not been invented yet - if (!RideEntryIsInvented(rideEntryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) continue; auto name = currentRideEntry->naming.Name; @@ -2233,7 +2233,7 @@ private: disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) - && !gCheatsMakeAllDestructible) + && !GetGameState().Cheats.MakeAllDestructible) disabled_widgets |= (1uLL << WIDX_DEMOLISH); auto ft = Formatter::Common(); @@ -2271,7 +2271,7 @@ private: AnchorBorderWidgets(); - const int32_t offset = gCheatsAllowArbitraryRideTypeChanges ? 15 : 0; + const int32_t offset = GetGameState().Cheats.AllowArbitraryRideTypeChanges ? 15 : 0; // Anchor main page specific widgets widgets[WIDX_VIEWPORT].right = width - 26; widgets[WIDX_VIEWPORT].bottom = height - (14 + offset); @@ -2289,7 +2289,7 @@ private: widgets[WIDX_RIDE_TYPE_DROPDOWN].top = height - 16; widgets[WIDX_RIDE_TYPE_DROPDOWN].bottom = height - 5; - if (!gCheatsAllowArbitraryRideTypeChanges) + if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges) { widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::Empty; widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Empty; @@ -2698,7 +2698,7 @@ private: widgets[WIDX_VEHICLE_TYPE].text = rideEntry->naming.Name; // Trains - if (rideEntry->cars_per_flat_ride > 1 || gCheatsDisableTrainLengthLimit) + if (rideEntry->cars_per_flat_ride > 1 || GetGameState().Cheats.DisableTrainLengthLimit) { widgets[WIDX_VEHICLE_TRAINS].type = WindowWidgetType::Spinner; widgets[WIDX_VEHICLE_TRAINS_INCREASE].type = WindowWidgetType::Button; @@ -2712,7 +2712,7 @@ private: } // Cars per train - if (rideEntry->zero_cars + 1 < rideEntry->max_cars_in_train || gCheatsDisableTrainLengthLimit) + if (rideEntry->zero_cars + 1 < rideEntry->max_cars_in_train || GetGameState().Cheats.DisableTrainLengthLimit) { widgets[WIDX_VEHICLE_CARS_PER_TRAIN].type = WindowWidgetType::Spinner; widgets[WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE].type = WindowWidgetType::Button; @@ -2726,7 +2726,8 @@ private: } if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_REVERSED_TRAINS) - || (gCheatsDisableTrainLengthLimit && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))) + || (GetGameState().Cheats.DisableTrainLengthLimit + && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))) { widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Checkbox; if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) @@ -2954,9 +2955,9 @@ private: const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; uint8_t maxValue = operatingSettings.MaxValue; - uint8_t minValue = gCheatsUnlockOperatingLimits ? 0 : operatingSettings.MinValue; + uint8_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; - if (gCheatsUnlockOperatingLimits) + if (GetGameState().Cheats.UnlockOperatingLimits) { maxValue = OpenRCT2::Limits::CheatsMaxOperatingLimit; } @@ -2975,8 +2976,8 @@ private: const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; uint8_t maxValue = operatingSettings.MaxValue; - uint8_t minValue = gCheatsUnlockOperatingLimits ? 0 : operatingSettings.MinValue; - if (gCheatsUnlockOperatingLimits) + uint8_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; + if (GetGameState().Cheats.UnlockOperatingLimits) { maxValue = OpenRCT2::Limits::CheatsMaxOperatingLimit; } @@ -3113,17 +3114,19 @@ private: ModeTweakDecrease(); break; case WIDX_LIFT_HILL_SPEED_INCREASE: - upperBound = gCheatsUnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : ride->GetRideTypeDescriptor().LiftData.maximum_speed; - lowerBound = gCheatsUnlockOperatingLimits ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed; + upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : ride->GetRideTypeDescriptor().LiftData.maximum_speed; + lowerBound = GetGameState().Cheats.UnlockOperatingLimits ? 0 + : ride->GetRideTypeDescriptor().LiftData.minimum_speed; SetOperatingSetting( rideId, RideSetSetting::LiftHillSpeed, std::clamp(ride->lift_hill_speed + 1, lowerBound, upperBound)); break; case WIDX_LIFT_HILL_SPEED_DECREASE: - upperBound = gCheatsUnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : ride->GetRideTypeDescriptor().LiftData.maximum_speed; - lowerBound = gCheatsUnlockOperatingLimits ? 0 : ride->GetRideTypeDescriptor().LiftData.minimum_speed; + upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : ride->GetRideTypeDescriptor().LiftData.maximum_speed; + lowerBound = GetGameState().Cheats.UnlockOperatingLimits ? 0 + : ride->GetRideTypeDescriptor().LiftData.minimum_speed; SetOperatingSetting( rideId, RideSetSetting::LiftHillSpeed, std::clamp(ride->lift_hill_speed - 1, lowerBound, upperBound)); @@ -3169,15 +3172,15 @@ private: LoadDropdown(&widgets[widgetIndex]); break; case WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE: - upperBound = gCheatsUnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : OpenRCT2::Limits::MaxCircuitsPerRide; + upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : OpenRCT2::Limits::MaxCircuitsPerRide; lowerBound = 1; SetOperatingSetting( rideId, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits + 1, lowerBound, upperBound)); break; case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE: - upperBound = gCheatsUnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : OpenRCT2::Limits::MaxCircuitsPerRide; + upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : OpenRCT2::Limits::MaxCircuitsPerRide; lowerBound = 1; SetOperatingSetting( rideId, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits - 1, lowerBound, upperBound)); @@ -3219,9 +3222,9 @@ private: } const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; - int16_t maxValue = gCheatsUnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : operatingSettings.MaxValue; - int16_t minValue = gCheatsUnlockOperatingLimits ? 0 : operatingSettings.MinValue; + int16_t maxValue = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : operatingSettings.MaxValue; + int16_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; const auto& title = widgets[WIDX_MODE_TWEAK_LABEL].text; Formatter ft; @@ -3300,9 +3303,9 @@ private: if (widgetIndex == WIDX_MODE_TWEAK) { const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; - uint32_t maxValue = gCheatsUnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : operatingSettings.MaxValue; - uint32_t minValue = gCheatsUnlockOperatingLimits ? 0 : operatingSettings.MinValue; + uint32_t maxValue = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : operatingSettings.MaxValue; + uint32_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; try @@ -4880,7 +4883,7 @@ private: } } - if (gCheatsUnlockOperatingLimits || musicObj->SupportsRideType(ride->type)) + if (GetGameState().Cheats.UnlockOperatingLimits || musicObj->SupportsRideType(ride->type)) { musicOrder.push_back(i); } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 4f56bbcc1d..ec8a007811 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -404,7 +404,7 @@ public: } } if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) - && !gCheatsEnableAllDrawableTrackPieces) + && !GetGameState().Cheats.EnableAllDrawableTrackPieces) { // Disable lift hill toggle and banking if current track piece is uphill if (_previousTrackPitchEnd == TrackPitch::Up25 || _previousTrackPitchEnd == TrackPitch::Up60 @@ -714,7 +714,7 @@ public: { disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN); } - if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !gCheatsEnableChainLiftOnAllTrack) + if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !GetGameState().Cheats.EnableChainLiftOnAllTrack) { if (_currentTrackPitchEnd != TrackPitch::None && !IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) { @@ -808,7 +808,7 @@ public: { if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None && (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) - || gCheatsEnableAllDrawableTrackPieces)) + || GetGameState().Cheats.EnableAllDrawableTrackPieces)) { disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); } @@ -873,7 +873,7 @@ public: } // If chain lift cheat is enabled then show the chain lift widget no matter what - if (gCheatsEnableChainLiftOnAllTrack) + if (GetGameState().Cheats.EnableChainLiftOnAllTrack) { disabledWidgets &= ~(1uLL << WIDX_CHAIN_LIFT); } @@ -1290,7 +1290,8 @@ public: case WIDX_CHAIN_LIFT: RideConstructionInvalidateCurrentTrack(); _currentTrackLiftHill ^= CONSTRUCTION_LIFT_HILL_SELECTED; - if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !gCheatsEnableChainLiftOnAllTrack) + if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) + && !GetGameState().Cheats.EnableChainLiftOnAllTrack) _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); @@ -1369,7 +1370,7 @@ public: case WIDX_O_TRACK: RideConstructionInvalidateCurrentTrack(); _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; - if (!gCheatsEnableChainLiftOnAllTrack) + if (!GetGameState().Cheats.EnableChainLiftOnAllTrack) _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); @@ -1686,13 +1687,14 @@ public: if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) && (_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60) - && !gCheatsEnableAllDrawableTrackPieces) + && !GetGameState().Cheats.EnableAllDrawableTrackPieces) { _currentTrackLiftHill |= CONSTRUCTION_LIFT_HILL_SELECTED; } if ((IsTrackEnabled(TRACK_LIFT_HILL) && (_currentTrackCurve & RideConstructionSpecialPieceSelected) == 0) - || (gCheatsEnableChainLiftOnAllTrack && currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))) + || (GetGameState().Cheats.EnableChainLiftOnAllTrack + && currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))) { widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn; } @@ -2190,7 +2192,7 @@ private: } auto trackPlaceAction = TrackPlaceAction( - rideIndex, trackType, currentRide->type, { trackPos, static_cast(trackDirection) }, (properties)&0xFF, + rideIndex, trackType, currentRide->type, { trackPos, static_cast(trackDirection) }, properties & 0xFF, (properties >> 8) & 0x0F, (properties >> 12) & 0x0F, liftHillAndAlternativeState, false); if (_rideConstructionState == RideConstructionState::Back) { @@ -2414,7 +2416,7 @@ private: { _currentTrackPitchEnd = slope; _currentTrackPrice = kMoney64Undefined; - if (_rideConstructionState == RideConstructionState::Front && !gCheatsEnableChainLiftOnAllTrack) + if (_rideConstructionState == RideConstructionState::Front && !GetGameState().Cheats.EnableChainLiftOnAllTrack) { switch (slope) { @@ -3487,7 +3489,7 @@ void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords) z -= bx; // FIX not sure exactly why it starts trial and error place from a lower Z, but it causes issues with disable clearance - if (!gCheatsDisableClearanceChecks && z > kMinimumLandZ) + if (!GetGameState().Cheats.DisableClearanceChecks && z > kMinimumLandZ) { z -= LAND_HEIGHT_STEP; } diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 28c38cfb13..806a82cd5d 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -661,7 +661,7 @@ public: widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; } - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) { widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Button; if (IsSceneryItemRestricted(tabSelectedScenery)) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 93845d9853..2cc73bac57 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -1615,7 +1615,7 @@ private: void Sub6E1F34UpdateScreenCoordsAndButtonsPressed(bool canRaiseItem, ScreenCoordsXY& screenPos) { - if (!canRaiseItem && !gCheatsDisableSupportLimits) + if (!canRaiseItem && !GetGameState().Cheats.DisableSupportLimits) { gSceneryCtrlPressed = false; gSceneryShiftPressed = false; @@ -3230,7 +3230,7 @@ public: GfxDrawSprite(dpi, ImageId(SPR_G2_SANDBOX), screenPos); // Draw an overlay if clearance checks are disabled - if (gCheatsDisableClearanceChecks) + if (GetGameState().Cheats.DisableClearanceChecks) { auto colour = static_cast(EnumValue(COLOUR_DARK_ORANGE) | EnumValue(COLOUR_FLAG_OUTLINE)); DrawTextBasic( @@ -3746,15 +3746,15 @@ void TopToolbar::InitCheatsMenu(Widget& widget) Dropdown::SetDisabled(DDIDX_ENABLE_SANDBOX_MODE, true); } - if (gCheatsSandboxMode) + if (GetGameState().Cheats.SandboxMode) { Dropdown::SetChecked(DDIDX_ENABLE_SANDBOX_MODE, true); } - if (gCheatsDisableClearanceChecks) + if (GetGameState().Cheats.DisableClearanceChecks) { Dropdown::SetChecked(DDIDX_DISABLE_CLEARANCE_CHECKS, true); } - if (gCheatsDisableSupportLimits) + if (GetGameState().Cheats.DisableSupportLimits) { Dropdown::SetChecked(DDIDX_DISABLE_SUPPORT_LIMITS, true); } @@ -3786,13 +3786,13 @@ void TopToolbar::CheatsMenuDropdown(int16_t dropdownIndex) ContextOpenWindow(WindowClass::EditorObjectiveOptions); break; case DDIDX_ENABLE_SANDBOX_MODE: - CheatsSet(CheatType::SandboxMode, !gCheatsSandboxMode); + CheatsSet(CheatType::SandboxMode, !GetGameState().Cheats.SandboxMode); break; case DDIDX_DISABLE_CLEARANCE_CHECKS: - CheatsSet(CheatType::DisableClearanceChecks, !gCheatsDisableClearanceChecks); + CheatsSet(CheatType::DisableClearanceChecks, !GetGameState().Cheats.DisableClearanceChecks); break; case DDIDX_DISABLE_SUPPORT_LIMITS: - CheatsSet(CheatType::DisableSupportLimits, !gCheatsDisableSupportLimits); + CheatsSet(CheatType::DisableSupportLimits, !GetGameState().Cheats.DisableSupportLimits); break; } } diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 57f0785c38..d110128d88 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -174,7 +174,7 @@ public: mapZ = GetBaseZ(mapCoords); CoordsXYZD trackLoc = { mapCoords, mapZ, _currentTrackPieceDirection }; - if (GameIsNotPaused() || gCheatsBuildInPauseMode) + if (GameIsNotPaused() || GetGameState().Cheats.BuildInPauseMode) { ClearProvisional(); auto res = FindValidTrackDesignPlaceHeight(trackLoc, GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); diff --git a/src/openrct2/Cheats.cpp b/src/openrct2/Cheats.cpp index 58fc4be429..6c14cd65c4 100644 --- a/src/openrct2/Cheats.cpp +++ b/src/openrct2/Cheats.cpp @@ -30,61 +30,36 @@ using namespace OpenRCT2; // TODO: Refactor this. Cheat variables should contain the cheat type // and a serialisation method. -bool gCheatsSandboxMode = false; -bool gCheatsDisableClearanceChecks = false; -bool gCheatsDisableSupportLimits = false; -bool gCheatsShowAllOperatingModes = false; -bool gCheatsShowVehiclesFromOtherTrackTypes = false; -bool gCheatsUnlockOperatingLimits = false; -bool gCheatsDisableBrakesFailure = false; -bool gCheatsDisableAllBreakdowns = false; -bool gCheatsBuildInPauseMode = false; -bool gCheatsIgnoreRideIntensity = false; -bool gCheatsDisableVandalism = false; -bool gCheatsDisableLittering = false; -bool gCheatsNeverendingMarketing = false; -bool gCheatsFreezeWeather = false; -bool gCheatsDisableTrainLengthLimit = false; -bool gCheatsDisablePlantAging = false; -bool gCheatsEnableChainLiftOnAllTrack = false; -bool gCheatsAllowArbitraryRideTypeChanges = false; -bool gCheatsDisableRideValueAging = false; -bool gCheatsIgnoreResearchStatus = false; -bool gCheatsEnableAllDrawableTrackPieces = false; -bool gCheatsAllowTrackPlaceInvalidHeights = false; -bool gCheatsAllowRegularPathAsQueue = false; -bool gCheatsAllowSpecialColourSchemes = false; -bool gCheatsMakeAllDestructible = false; -StaffSpeedCheat gCheatsSelectedStaffSpeed = StaffSpeedCheat::None; void CheatsReset() { - gCheatsSandboxMode = false; - gCheatsDisableClearanceChecks = false; - gCheatsDisableSupportLimits = false; - gCheatsShowAllOperatingModes = false; - gCheatsShowVehiclesFromOtherTrackTypes = false; - gCheatsDisableTrainLengthLimit = false; - gCheatsEnableChainLiftOnAllTrack = false; - gCheatsUnlockOperatingLimits = false; - gCheatsDisableBrakesFailure = false; - gCheatsDisableAllBreakdowns = false; - gCheatsBuildInPauseMode = false; - gCheatsIgnoreRideIntensity = false; - gCheatsDisableVandalism = false; - gCheatsDisableLittering = false; - gCheatsNeverendingMarketing = false; - gCheatsFreezeWeather = false; - gCheatsDisablePlantAging = false; - gCheatsAllowArbitraryRideTypeChanges = false; - gCheatsDisableRideValueAging = false; - gCheatsIgnoreResearchStatus = false; - gCheatsEnableAllDrawableTrackPieces = false; - gCheatsAllowTrackPlaceInvalidHeights = false; - gCheatsAllowRegularPathAsQueue = false; - gCheatsAllowSpecialColourSchemes = false; - gCheatsMakeAllDestructible = false; - gCheatsSelectedStaffSpeed = StaffSpeedCheat::None; + auto& gameState = GetGameState(); + gameState.Cheats.SandboxMode = false; + gameState.Cheats.DisableClearanceChecks = false; + gameState.Cheats.DisableSupportLimits = false; + gameState.Cheats.ShowAllOperatingModes = false; + gameState.Cheats.ShowVehiclesFromOtherTrackTypes = false; + gameState.Cheats.DisableTrainLengthLimit = false; + gameState.Cheats.EnableChainLiftOnAllTrack = false; + gameState.Cheats.UnlockOperatingLimits = false; + gameState.Cheats.DisableBrakesFailure = false; + gameState.Cheats.DisableAllBreakdowns = false; + gameState.Cheats.BuildInPauseMode = false; + gameState.Cheats.IgnoreRideIntensity = false; + gameState.Cheats.DisableVandalism = false; + gameState.Cheats.DisableLittering = false; + gameState.Cheats.NeverendingMarketing = false; + gameState.Cheats.FreezeWeather = false; + gameState.Cheats.DisablePlantAging = false; + gameState.Cheats.AllowArbitraryRideTypeChanges = false; + gameState.Cheats.DisableRideValueAging = false; + gameState.Cheats.IgnoreResearchStatus = false; + gameState.Cheats.EnableAllDrawableTrackPieces = false; + gameState.Cheats.AllowTrackPlaceInvalidHeights = false; + gameState.Cheats.AllowRegularPathAsQueue = false; + gameState.Cheats.AllowSpecialColourSchemes = false; + gameState.Cheats.MakeAllDestructible = false; + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::None; } void CheatsSet(CheatType cheatType, int64_t param1 /* = 0*/, int64_t param2 /* = 0*/) @@ -102,6 +77,7 @@ template static void CheatEntrySerialise(DataSerialiser& ds, CheatTy void CheatsSerialise(DataSerialiser& ds) { uint16_t count = 0; + auto& gameState = GetGameState(); if (ds.IsSaving()) { @@ -111,32 +87,35 @@ void CheatsSerialise(DataSerialiser& ds) uint64_t countOffset = stream.GetPosition(); ds << count; - CheatEntrySerialise(ds, CheatType::SandboxMode, gCheatsSandboxMode, count); - CheatEntrySerialise(ds, CheatType::DisableClearanceChecks, gCheatsDisableClearanceChecks, count); - CheatEntrySerialise(ds, CheatType::DisableSupportLimits, gCheatsDisableSupportLimits, count); - CheatEntrySerialise(ds, CheatType::ShowAllOperatingModes, gCheatsShowAllOperatingModes, count); - CheatEntrySerialise(ds, CheatType::ShowVehiclesFromOtherTrackTypes, gCheatsShowVehiclesFromOtherTrackTypes, count); - CheatEntrySerialise(ds, CheatType::FastLiftHill, gCheatsUnlockOperatingLimits, count); - CheatEntrySerialise(ds, CheatType::DisableBrakesFailure, gCheatsDisableBrakesFailure, count); - CheatEntrySerialise(ds, CheatType::DisableAllBreakdowns, gCheatsDisableAllBreakdowns, count); - CheatEntrySerialise(ds, CheatType::BuildInPauseMode, gCheatsBuildInPauseMode, count); - CheatEntrySerialise(ds, CheatType::IgnoreRideIntensity, gCheatsIgnoreRideIntensity, count); - CheatEntrySerialise(ds, CheatType::DisableVandalism, gCheatsDisableVandalism, count); - CheatEntrySerialise(ds, CheatType::DisableLittering, gCheatsDisableLittering, count); - CheatEntrySerialise(ds, CheatType::NeverEndingMarketing, gCheatsNeverendingMarketing, count); - CheatEntrySerialise(ds, CheatType::FreezeWeather, gCheatsFreezeWeather, count); - CheatEntrySerialise(ds, CheatType::DisableTrainLengthLimit, gCheatsDisableTrainLengthLimit, count); - CheatEntrySerialise(ds, CheatType::DisablePlantAging, gCheatsDisablePlantAging, count); - CheatEntrySerialise(ds, CheatType::EnableChainLiftOnAllTrack, gCheatsEnableChainLiftOnAllTrack, count); - CheatEntrySerialise(ds, CheatType::AllowArbitraryRideTypeChanges, gCheatsAllowArbitraryRideTypeChanges, count); - CheatEntrySerialise(ds, CheatType::DisableRideValueAging, gCheatsDisableRideValueAging, count); - CheatEntrySerialise(ds, CheatType::IgnoreResearchStatus, gCheatsIgnoreResearchStatus, count); - CheatEntrySerialise(ds, CheatType::EnableAllDrawableTrackPieces, gCheatsEnableAllDrawableTrackPieces, count); - CheatEntrySerialise(ds, CheatType::AllowTrackPlaceInvalidHeights, gCheatsAllowTrackPlaceInvalidHeights, count); - CheatEntrySerialise(ds, CheatType::AllowRegularPathAsQueue, gCheatsAllowRegularPathAsQueue, count); - CheatEntrySerialise(ds, CheatType::AllowSpecialColourSchemes, gCheatsAllowSpecialColourSchemes, count); - CheatEntrySerialise(ds, CheatType::MakeDestructible, gCheatsMakeAllDestructible, count); - CheatEntrySerialise(ds, CheatType::SetStaffSpeed, gCheatsSelectedStaffSpeed, count); + CheatEntrySerialise(ds, CheatType::SandboxMode, gameState.Cheats.SandboxMode, count); + CheatEntrySerialise(ds, CheatType::DisableClearanceChecks, gameState.Cheats.DisableClearanceChecks, count); + CheatEntrySerialise(ds, CheatType::DisableSupportLimits, gameState.Cheats.DisableSupportLimits, count); + CheatEntrySerialise(ds, CheatType::ShowAllOperatingModes, gameState.Cheats.ShowAllOperatingModes, count); + CheatEntrySerialise( + ds, CheatType::ShowVehiclesFromOtherTrackTypes, gameState.Cheats.ShowVehiclesFromOtherTrackTypes, count); + CheatEntrySerialise(ds, CheatType::FastLiftHill, gameState.Cheats.UnlockOperatingLimits, count); + CheatEntrySerialise(ds, CheatType::DisableBrakesFailure, gameState.Cheats.DisableBrakesFailure, count); + CheatEntrySerialise(ds, CheatType::DisableAllBreakdowns, gameState.Cheats.DisableAllBreakdowns, count); + CheatEntrySerialise(ds, CheatType::BuildInPauseMode, gameState.Cheats.BuildInPauseMode, count); + CheatEntrySerialise(ds, CheatType::IgnoreRideIntensity, gameState.Cheats.IgnoreRideIntensity, count); + CheatEntrySerialise(ds, CheatType::DisableVandalism, gameState.Cheats.DisableVandalism, count); + CheatEntrySerialise(ds, CheatType::DisableLittering, gameState.Cheats.DisableLittering, count); + CheatEntrySerialise(ds, CheatType::NeverEndingMarketing, gameState.Cheats.NeverendingMarketing, count); + CheatEntrySerialise(ds, CheatType::FreezeWeather, gameState.Cheats.FreezeWeather, count); + CheatEntrySerialise(ds, CheatType::DisableTrainLengthLimit, gameState.Cheats.DisableTrainLengthLimit, count); + CheatEntrySerialise(ds, CheatType::DisablePlantAging, gameState.Cheats.DisablePlantAging, count); + CheatEntrySerialise(ds, CheatType::EnableChainLiftOnAllTrack, gameState.Cheats.EnableChainLiftOnAllTrack, count); + CheatEntrySerialise( + ds, CheatType::AllowArbitraryRideTypeChanges, gameState.Cheats.AllowArbitraryRideTypeChanges, count); + CheatEntrySerialise(ds, CheatType::DisableRideValueAging, gameState.Cheats.DisableRideValueAging, count); + CheatEntrySerialise(ds, CheatType::IgnoreResearchStatus, gameState.Cheats.IgnoreResearchStatus, count); + CheatEntrySerialise(ds, CheatType::EnableAllDrawableTrackPieces, gameState.Cheats.EnableAllDrawableTrackPieces, count); + CheatEntrySerialise( + ds, CheatType::AllowTrackPlaceInvalidHeights, gameState.Cheats.AllowTrackPlaceInvalidHeights, count); + CheatEntrySerialise(ds, CheatType::AllowRegularPathAsQueue, gameState.Cheats.AllowRegularPathAsQueue, count); + CheatEntrySerialise(ds, CheatType::AllowSpecialColourSchemes, gameState.Cheats.AllowSpecialColourSchemes, count); + CheatEntrySerialise(ds, CheatType::MakeDestructible, gameState.Cheats.MakeAllDestructible, count); + CheatEntrySerialise(ds, CheatType::SetStaffSpeed, gameState.Cheats.SelectedStaffSpeed, count); // Remember current position and update count. uint64_t endOffset = stream.GetPosition(); @@ -161,85 +140,85 @@ void CheatsSerialise(DataSerialiser& ds) switch (static_cast(type)) { case CheatType::SandboxMode: - ds << gCheatsSandboxMode; + ds << gameState.Cheats.SandboxMode; break; case CheatType::DisableClearanceChecks: - ds << gCheatsDisableClearanceChecks; + ds << gameState.Cheats.DisableClearanceChecks; break; case CheatType::DisableSupportLimits: - ds << gCheatsDisableSupportLimits; + ds << gameState.Cheats.DisableSupportLimits; break; case CheatType::ShowAllOperatingModes: - ds << gCheatsShowAllOperatingModes; + ds << gameState.Cheats.ShowAllOperatingModes; break; case CheatType::ShowVehiclesFromOtherTrackTypes: - ds << gCheatsShowVehiclesFromOtherTrackTypes; + ds << gameState.Cheats.ShowVehiclesFromOtherTrackTypes; break; case CheatType::FastLiftHill: - ds << gCheatsUnlockOperatingLimits; + ds << gameState.Cheats.UnlockOperatingLimits; break; case CheatType::DisableBrakesFailure: - ds << gCheatsDisableBrakesFailure; + ds << gameState.Cheats.DisableBrakesFailure; break; case CheatType::DisableAllBreakdowns: - ds << gCheatsDisableAllBreakdowns; + ds << gameState.Cheats.DisableAllBreakdowns; break; case CheatType::BuildInPauseMode: - ds << gCheatsBuildInPauseMode; + ds << gameState.Cheats.BuildInPauseMode; break; case CheatType::IgnoreRideIntensity: - ds << gCheatsIgnoreRideIntensity; + ds << gameState.Cheats.IgnoreRideIntensity; break; case CheatType::DisableVandalism: - ds << gCheatsDisableVandalism; + ds << gameState.Cheats.DisableVandalism; break; case CheatType::DisableLittering: - ds << gCheatsDisableLittering; + ds << gameState.Cheats.DisableLittering; break; case CheatType::NeverEndingMarketing: - ds << gCheatsNeverendingMarketing; + ds << gameState.Cheats.NeverendingMarketing; break; case CheatType::FreezeWeather: - ds << gCheatsFreezeWeather; + ds << gameState.Cheats.FreezeWeather; break; case CheatType::DisableTrainLengthLimit: - ds << gCheatsDisableTrainLengthLimit; + ds << gameState.Cheats.DisableTrainLengthLimit; break; case CheatType::DisablePlantAging: - ds << gCheatsDisablePlantAging; + ds << gameState.Cheats.DisablePlantAging; break; case CheatType::EnableChainLiftOnAllTrack: - ds << gCheatsEnableChainLiftOnAllTrack; + ds << gameState.Cheats.EnableChainLiftOnAllTrack; break; case CheatType::AllowArbitraryRideTypeChanges: - ds << gCheatsAllowArbitraryRideTypeChanges; + ds << gameState.Cheats.AllowArbitraryRideTypeChanges; break; case CheatType::DisableRideValueAging: - ds << gCheatsDisableRideValueAging; + ds << gameState.Cheats.DisableRideValueAging; break; case CheatType::IgnoreResearchStatus: - ds << gCheatsIgnoreResearchStatus; + ds << gameState.Cheats.IgnoreResearchStatus; break; case CheatType::EnableAllDrawableTrackPieces: - ds << gCheatsEnableAllDrawableTrackPieces; + ds << gameState.Cheats.EnableAllDrawableTrackPieces; break; case CheatType::AllowTrackPlaceInvalidHeights: - ds << gCheatsAllowTrackPlaceInvalidHeights; + ds << gameState.Cheats.AllowTrackPlaceInvalidHeights; break; case CheatType::NoCapOnQueueLengthDummy: ds << dummyBool; break; case CheatType::AllowRegularPathAsQueue: - ds << gCheatsAllowRegularPathAsQueue; + ds << gameState.Cheats.AllowRegularPathAsQueue; break; case CheatType::AllowSpecialColourSchemes: - ds << gCheatsAllowSpecialColourSchemes; + ds << gameState.Cheats.AllowSpecialColourSchemes; break; case CheatType::MakeDestructible: - ds << gCheatsMakeAllDestructible; + ds << gameState.Cheats.MakeAllDestructible; break; case CheatType::SetStaffSpeed: - ds << gCheatsSelectedStaffSpeed; + ds << gameState.Cheats.SelectedStaffSpeed; break; default: break; diff --git a/src/openrct2/Cheats.h b/src/openrct2/Cheats.h index 8ce041666c..6f4680517f 100644 --- a/src/openrct2/Cheats.h +++ b/src/openrct2/Cheats.h @@ -18,32 +18,35 @@ enum class StaffSpeedCheat Fast, }; -extern bool gCheatsSandboxMode; -extern bool gCheatsDisableClearanceChecks; -extern bool gCheatsDisableSupportLimits; -extern bool gCheatsShowAllOperatingModes; -extern bool gCheatsShowVehiclesFromOtherTrackTypes; -extern bool gCheatsUnlockOperatingLimits; -extern bool gCheatsDisableBrakesFailure; -extern bool gCheatsDisableAllBreakdowns; -extern bool gCheatsBuildInPauseMode; -extern bool gCheatsIgnoreRideIntensity; -extern bool gCheatsDisableVandalism; -extern bool gCheatsDisableLittering; -extern bool gCheatsNeverendingMarketing; -extern bool gCheatsFreezeWeather; -extern bool gCheatsDisableTrainLengthLimit; -extern bool gCheatsDisablePlantAging; -extern bool gCheatsDisableRideValueAging; -extern bool gCheatsEnableChainLiftOnAllTrack; -extern bool gCheatsAllowArbitraryRideTypeChanges; -extern bool gCheatsIgnoreResearchStatus; -extern bool gCheatsEnableAllDrawableTrackPieces; -extern bool gCheatsAllowTrackPlaceInvalidHeights; -extern bool gCheatsAllowRegularPathAsQueue; -extern bool gCheatsAllowSpecialColourSchemes; -extern bool gCheatsMakeAllDestructible; -extern StaffSpeedCheat gCheatsSelectedStaffSpeed; +struct CheatsState +{ + bool SandboxMode; + bool DisableClearanceChecks; + bool DisableSupportLimits; + bool ShowAllOperatingModes; + bool ShowVehiclesFromOtherTrackTypes; + bool UnlockOperatingLimits; + bool DisableBrakesFailure; + bool DisableAllBreakdowns; + bool BuildInPauseMode; + bool IgnoreRideIntensity; + bool DisableVandalism; + bool DisableLittering; + bool NeverendingMarketing; + bool FreezeWeather; + bool DisableTrainLengthLimit; + bool DisablePlantAging; + bool DisableRideValueAging; + bool EnableChainLiftOnAllTrack; + bool AllowArbitraryRideTypeChanges; + bool IgnoreResearchStatus; + bool EnableAllDrawableTrackPieces; + bool AllowTrackPlaceInvalidHeights; + bool AllowRegularPathAsQueue; + bool AllowSpecialColourSchemes; + bool MakeAllDestructible; + StaffSpeedCheat SelectedStaffSpeed; +}; enum class CheatType : int32_t { diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 21a6ecdc5b..9b048aa6c8 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -9,6 +9,7 @@ #pragma once +#include "Cheats.h" #include "Date.h" #include "Editor.h" #include "Limits.h" @@ -128,6 +129,8 @@ namespace OpenRCT2 * In a difficult guest generation scenario, no guests will be generated if over this value. */ uint32_t SuggestedGuestMaximum; + + CheatsState Cheats; }; GameState_t& GetGameState(); diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 3b1e98362f..c66939fe12 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -98,50 +98,50 @@ GameActions::Result CheatSetAction::Execute() const switch (static_cast(_cheatType.id)) { case CheatType::SandboxMode: - gCheatsSandboxMode = _param1 != 0; + GetGameState().Cheats.SandboxMode = _param1 != 0; WindowInvalidateByClass(WindowClass::Map); WindowInvalidateByClass(WindowClass::Footpath); break; case CheatType::DisableClearanceChecks: - gCheatsDisableClearanceChecks = _param1 != 0; + GetGameState().Cheats.DisableClearanceChecks = _param1 != 0; // Required to update the clearance checks overlay on the Cheats button. WindowInvalidateByClass(WindowClass::TopToolbar); break; case CheatType::DisableSupportLimits: - gCheatsDisableSupportLimits = _param1 != 0; + GetGameState().Cheats.DisableSupportLimits = _param1 != 0; break; case CheatType::ShowAllOperatingModes: - gCheatsShowAllOperatingModes = _param1 != 0; + GetGameState().Cheats.ShowAllOperatingModes = _param1 != 0; break; case CheatType::ShowVehiclesFromOtherTrackTypes: - gCheatsShowVehiclesFromOtherTrackTypes = _param1 != 0; + GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes = _param1 != 0; break; case CheatType::FastLiftHill: - gCheatsUnlockOperatingLimits = _param1 != 0; + GetGameState().Cheats.UnlockOperatingLimits = _param1 != 0; break; case CheatType::DisableBrakesFailure: - gCheatsDisableBrakesFailure = _param1 != 0; + GetGameState().Cheats.DisableBrakesFailure = _param1 != 0; break; case CheatType::DisableAllBreakdowns: - gCheatsDisableAllBreakdowns = _param1 != 0; + GetGameState().Cheats.DisableAllBreakdowns = _param1 != 0; break; case CheatType::DisableTrainLengthLimit: - gCheatsDisableTrainLengthLimit = _param1 != 0; + GetGameState().Cheats.DisableTrainLengthLimit = _param1 != 0; break; case CheatType::EnableChainLiftOnAllTrack: - gCheatsEnableChainLiftOnAllTrack = _param1 != 0; + GetGameState().Cheats.EnableChainLiftOnAllTrack = _param1 != 0; break; case CheatType::BuildInPauseMode: - gCheatsBuildInPauseMode = _param1 != 0; + GetGameState().Cheats.BuildInPauseMode = _param1 != 0; break; case CheatType::IgnoreRideIntensity: - gCheatsIgnoreRideIntensity = _param1 != 0; + GetGameState().Cheats.IgnoreRideIntensity = _param1 != 0; break; case CheatType::DisableVandalism: - gCheatsDisableVandalism = _param1 != 0; + GetGameState().Cheats.DisableVandalism = _param1 != 0; break; case CheatType::DisableLittering: - gCheatsDisableLittering = _param1 != 0; + GetGameState().Cheats.DisableLittering = _param1 != 0; break; case CheatType::NoMoney: SetScenarioNoMoney(_param1 != 0); @@ -180,7 +180,7 @@ GameActions::Result CheatSetAction::Execute() const RemoveLitter(); break; case CheatType::DisablePlantAging: - gCheatsDisablePlantAging = _param1 != 0; + GetGameState().Cheats.DisablePlantAging = _param1 != 0; break; case CheatType::SetStaffSpeed: SetStaffSpeed(_param1); @@ -189,7 +189,7 @@ GameActions::Result CheatSetAction::Execute() const RenewRides(); break; case CheatType::MakeDestructible: - gCheatsMakeAllDestructible = _param1 != 0; + GetGameState().Cheats.MakeAllDestructible = _param1 != 0; WindowInvalidateByClass(WindowClass::Ride); break; case CheatType::FixRides: @@ -209,10 +209,10 @@ GameActions::Result CheatSetAction::Execute() const ClimateForceWeather(WeatherType{ static_cast(_param1) }); break; case CheatType::FreezeWeather: - gCheatsFreezeWeather = _param1 != 0; + GetGameState().Cheats.FreezeWeather = _param1 != 0; break; case CheatType::NeverEndingMarketing: - gCheatsNeverendingMarketing = _param1 != 0; + GetGameState().Cheats.NeverendingMarketing = _param1 != 0; break; case CheatType::OpenClosePark: ParkSetOpen(!ParkIsOpen()); @@ -224,20 +224,20 @@ GameActions::Result CheatSetAction::Execute() const ParkSetForcedRating(_param1); break; case CheatType::AllowArbitraryRideTypeChanges: - gCheatsAllowArbitraryRideTypeChanges = _param1 != 0; + GetGameState().Cheats.AllowArbitraryRideTypeChanges = _param1 != 0; WindowInvalidateByClass(WindowClass::Ride); break; case CheatType::OwnAllLand: OwnAllLand(); break; case CheatType::DisableRideValueAging: - gCheatsDisableRideValueAging = _param1 != 0; + GetGameState().Cheats.DisableRideValueAging = _param1 != 0; break; case CheatType::IgnoreResearchStatus: - gCheatsIgnoreResearchStatus = _param1 != 0; + GetGameState().Cheats.IgnoreResearchStatus = _param1 != 0; break; case CheatType::EnableAllDrawableTrackPieces: - gCheatsEnableAllDrawableTrackPieces = _param1 != 0; + GetGameState().Cheats.EnableAllDrawableTrackPieces = _param1 != 0; break; case CheatType::CreateDucks: CreateDucks(_param1); @@ -246,13 +246,13 @@ GameActions::Result CheatSetAction::Execute() const Duck::RemoveAll(); break; case CheatType::AllowTrackPlaceInvalidHeights: - gCheatsAllowTrackPlaceInvalidHeights = _param1 != 0; + GetGameState().Cheats.AllowTrackPlaceInvalidHeights = _param1 != 0; break; case CheatType::AllowRegularPathAsQueue: - gCheatsAllowRegularPathAsQueue = _param1 != 0; + GetGameState().Cheats.AllowRegularPathAsQueue = _param1 != 0; break; case CheatType::AllowSpecialColourSchemes: - gCheatsAllowSpecialColourSchemes = static_cast(_param1); + GetGameState().Cheats.AllowSpecialColourSchemes = static_cast(_param1); break; case CheatType::RemoveParkFences: RemoveParkFences(); diff --git a/src/openrct2/actions/ClearAction.cpp b/src/openrct2/actions/ClearAction.cpp index f1507526af..366d1661da 100644 --- a/src/openrct2/actions/ClearAction.cpp +++ b/src/openrct2/actions/ClearAction.cpp @@ -239,5 +239,6 @@ void ClearAction::ResetClearLargeSceneryFlag() bool ClearAction::MapCanClearAt(const CoordsXY& location) { - return (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode || MapIsLocationOwnedOrHasRights(location); + return (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode + || MapIsLocationOwnedOrHasRights(location); } diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 1e37025d2b..e4d78a015a 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -10,6 +10,7 @@ #include "FootpathAdditionPlaceAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../core/MemoryStream.h" #include "../interface/Window.h" @@ -57,7 +58,8 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || OpenRCT2::GetGameState().Cheats.SandboxMode) + && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); } diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index d09bcdb148..a8f7b9be87 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -10,6 +10,7 @@ #include "FootpathAdditionRemoveAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../core/MemoryStream.h" #include "../interface/Window.h" @@ -49,7 +50,8 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || OpenRCT2::GetGameState().Cheats.SandboxMode) + && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp index 37e4b351db..0be2ad2a47 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp @@ -10,6 +10,7 @@ #include "FootpathLayoutPlaceAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../core/MemoryStream.h" #include "../interface/Window.h" @@ -23,6 +24,8 @@ #include "../world/Surface.h" #include "../world/Wall.h" +using namespace OpenRCT2; + FootpathLayoutPlaceAction::FootpathLayoutPlaceAction( const CoordsXYZ& loc, uint8_t slope, ObjectEntryIndex type, ObjectEntryIndex railingsType, uint8_t edges, PathConstructFlags constructFlags) @@ -73,7 +76,7 @@ GameActions::Result FootpathLayoutPlaceAction::Query() const GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -164,7 +167,7 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertQuery(GameActions::R const auto clearanceData = canBuild.GetData(); gFootpathGroundFlags = clearanceData.GroundFlags; - if (!gCheatsDisableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) + if (!GetGameState().Cheats.DisableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index e0fcb85b42..342f00ea57 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -78,7 +78,7 @@ GameActions::Result FootpathPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_LAND_NOT_OWNED_BY_PARK); } @@ -132,7 +132,7 @@ GameActions::Result FootpathPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { - if (_direction != INVALID_DIRECTION && !gCheatsDisableClearanceChecks) + if (_direction != INVALID_DIRECTION && !GetGameState().Cheats.DisableClearanceChecks) { // It is possible, let's remove walls between the old and new piece of path auto zLow = _loc.z; @@ -314,7 +314,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result const auto clearanceData = canBuild.GetData(); gFootpathGroundFlags = clearanceData.GroundFlags; - if (!gCheatsDisableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) + if (!GetGameState().Cheats.DisableClearanceChecks && (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER)) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_FOOTPATH_HERE, STR_CANT_BUILD_THIS_UNDERWATER); diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 5f4c14aba8..96f3536247 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -10,6 +10,7 @@ #include "FootpathRemoveAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../core/MemoryStream.h" #include "../interface/Window.h" @@ -21,6 +22,8 @@ #include "../world/Wall.h" #include "BannerRemoveAction.h" +using namespace OpenRCT2; + FootpathRemoveAction::FootpathRemoveAction(const CoordsXYZ& location) : _loc(location) { @@ -56,7 +59,7 @@ GameActions::Result FootpathRemoveAction::Query() const GameActions::Status::InvalidParameters, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_OFF_EDGE_OF_MAP); } - if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && !MapIsLocationOwned(_loc)) + if (!((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) && !MapIsLocationOwned(_loc)) { return GameActions::Result( GameActions::Status::NotOwned, STR_CANT_REMOVE_FOOTPATH_FROM_HERE, STR_LAND_NOT_OWNED_BY_PARK); diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 468d124e4e..9a10edff70 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -184,7 +184,7 @@ namespace GameActions { if (gGamePaused == 0) return true; - if (gCheatsBuildInPauseMode) + if (GetGameState().Cheats.BuildInPauseMode) return true; if (actionFlags & GameActions::Flags::AllowWhilePaused) return true; diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 026ab3e239..3280a28a99 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -10,6 +10,7 @@ #include "LandLowerAction.h" #include "../Context.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../actions/LandSetHeightAction.h" #include "../audio/audio.h" @@ -93,7 +94,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const if (surfaceElement == nullptr) continue; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ x, y })) { diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 8707766891..4ec0329399 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -11,6 +11,7 @@ #include "LandRaiseAction.h" #include "../Context.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../actions/LandSetHeightAction.h" #include "../audio/audio.h" @@ -94,7 +95,7 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const if (surfaceElement == nullptr) continue; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ x, y })) { diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index b81da2d3e9..f350cc6783 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -67,7 +67,7 @@ GameActions::Result LandSetHeightAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, errorMessage); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(_coords)) { @@ -76,7 +76,7 @@ GameActions::Result LandSetHeightAction::Query() const } money64 sceneryRemovalCost = 0; - if (!gCheatsDisableClearanceChecks) + if (!GetGameState().Cheats.DisableClearanceChecks) { if (gameState.ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) { @@ -93,7 +93,7 @@ GameActions::Result LandSetHeightAction::Query() const } // Check for ride support limits - if (!gCheatsDisableSupportLimits) + if (!GetGameState().Cheats.DisableSupportLimits) { errorMessage = CheckRideSupports(); if (errorMessage != STR_NONE) @@ -124,7 +124,7 @@ GameActions::Result LandSetHeightAction::Query() const return res; } - if (!gCheatsDisableClearanceChecks) + if (!GetGameState().Cheats.DisableClearanceChecks) { uint8_t zCorner = _height; if (_style & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) @@ -157,7 +157,7 @@ GameActions::Result LandSetHeightAction::Execute() const auto surfaceHeight = TileElementHeight(_coords); FootpathRemoveLitter({ _coords, surfaceHeight }); - if (!gCheatsDisableClearanceChecks) + if (!GetGameState().Cheats.DisableClearanceChecks) { WallRemoveAt({ _coords, _height * 8 - 16, _height * 8 + 32 }); cost += GetSmallSceneryRemovalCost(); diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 1ed0cc10b9..4dfc838413 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -10,6 +10,7 @@ #include "LandSetRightsAction.h" #include "../Context.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../actions/LandSetHeightAction.h" #include "../audio/audio.h" @@ -82,7 +83,7 @@ GameActions::Result LandSetRightsAction::QueryExecute(bool isExecuting) const res.Position = centre; res.Expenditure = ExpenditureType::LandPurchase; - if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.SandboxMode) { return GameActions::Result(GameActions::Status::NotInEditorMode, STR_NONE, STR_LAND_NOT_FOR_SALE); } diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 684e022313..c0a2e50c58 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -9,6 +9,7 @@ #include "LargeSceneryPlaceAction.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../management/Finance.h" #include "../object/LargeSceneryEntry.h" @@ -21,6 +22,8 @@ #include "../world/MapAnimation.h" #include "../world/Surface.h" +using namespace OpenRCT2; + LargeSceneryPlaceAction::LargeSceneryPlaceAction( const CoordsXYZD& loc, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour, uint8_t tertiaryColour) : _loc(loc) @@ -81,7 +84,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); + auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); @@ -134,7 +137,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const const auto clearanceData = canBuild.GetData(); int32_t tempSceneryGroundFlags = clearanceData.GroundFlags & (ELEMENT_IS_ABOVE_GROUND | ELEMENT_IS_UNDERGROUND); - if (!gCheatsDisableClearanceChecks) + if (!GetGameState().Cheats.DisableClearanceChecks) { if ((clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER) || (clearanceData.GroundFlags & ELEMENT_IS_UNDERGROUND)) { @@ -156,7 +159,8 @@ GameActions::Result LargeSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationOwned({ curTile, zLow }) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationOwned({ curTile, zLow }) + && !GetGameState().Cheats.SandboxMode) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -194,7 +198,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const money64 supportsCost = 0; - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); + auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); @@ -279,7 +283,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { FootpathRemoveLitter({ curTile, zLow }); - if (!gCheatsDisableClearanceChecks) + if (!GetGameState().Cheats.DisableClearanceChecks) { WallRemoveAt({ curTile, zLow, zHigh }); } diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 04df54135e..1c265f6bda 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -92,7 +92,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const auto currentTile = CoordsXYZ{ firstTile.x, firstTile.y, firstTile.z } + currentTileRotatedOffset; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (GetGameState().ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) { @@ -175,7 +175,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const auto currentTile = CoordsXYZ{ firstTile.x, firstTile.y, firstTile.z } + rotatedCurrentTile; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationOwned({ currentTile.x, currentTile.y, currentTile.z })) { diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 4f550d55ec..e53ecefda1 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -9,6 +9,7 @@ #include "LargeScenerySetColourAction.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../management/Finance.h" #include "../object/LargeSceneryEntry.h" @@ -127,7 +128,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) auto rotatedTileCoords = CoordsXYZ{ CoordsXY{ tile->x_offset, tile->y_offset }.Rotate(_loc.direction), tile->z_offset }; auto currentTile = CoordsXYZ{ baseTile.x, baseTile.y, baseTile.z } + rotatedTileCoords; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { if (!MapIsLocationOwned(currentTile)) { diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index bd3dfa1874..00d7329912 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -8,6 +8,7 @@ *****************************************************************************/ #include "MazePlaceTrackAction.h" +#include "../GameState.h" #include "../management/Finance.h" #include "../ride/RideData.h" #include "../ride/TrackData.h" @@ -56,7 +57,7 @@ GameActions::Result MazePlaceTrackAction::Query() const res.ErrorMessage = STR_OFF_EDGE_OF_MAP; return res; } - if (!MapIsLocationOwned(_loc) && !gCheatsSandboxMode) + if (!MapIsLocationOwned(_loc) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { res.Error = GameActions::Status::NotOwned; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; @@ -81,7 +82,7 @@ GameActions::Result MazePlaceTrackAction::Query() const auto clearanceHeight = _loc.z + MAZE_CLEARANCE_HEIGHT; auto heightDifference = baseHeight - surfaceElement->GetBaseZ(); - if (heightDifference >= 0 && !gCheatsDisableSupportLimits) + if (heightDifference >= 0 && !OpenRCT2::GetGameState().Cheats.DisableSupportLimits) { heightDifference /= COORDS_Z_PER_TINY_Z; diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index ee322bfb43..87c1da6a0d 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -10,6 +10,7 @@ #include "MazeSetTrackAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../core/MemoryStream.h" #include "../interface/Window.h" #include "../localisation/Localisation.h" @@ -94,7 +95,7 @@ GameActions::Result MazeSetTrackAction::Query() const res.ErrorMessage = STR_OFF_EDGE_OF_MAP; return res; } - if (!MapIsLocationOwned(_loc) && !gCheatsSandboxMode) + if (!MapIsLocationOwned(_loc) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { res.Error = GameActions::Status::NotOwned; res.ErrorMessage = STR_LAND_NOT_OWNED_BY_PARK; @@ -119,7 +120,7 @@ GameActions::Result MazeSetTrackAction::Query() const auto clearanceHeight = _loc.z + 32; auto heightDifference = baseHeight - surfaceElement->GetBaseZ(); - if (heightDifference >= 0 && !gCheatsDisableSupportLimits) + if (heightDifference >= 0 && !OpenRCT2::GetGameState().Cheats.DisableSupportLimits) { heightDifference /= COORDS_Z_PER_TINY_Z; diff --git a/src/openrct2/actions/ParkEntrancePlaceAction.cpp b/src/openrct2/actions/ParkEntrancePlaceAction.cpp index e5c73e0dd8..50e3b7619f 100644 --- a/src/openrct2/actions/ParkEntrancePlaceAction.cpp +++ b/src/openrct2/actions/ParkEntrancePlaceAction.cpp @@ -51,7 +51,7 @@ void ParkEntrancePlaceAction::Serialise(DataSerialiser& stream) GameActions::Result ParkEntrancePlaceAction::Query() const { - if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.SandboxMode) { return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_BUILD_THIS_HERE, STR_NONE); } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index cc9ee8b019..31616d0ba7 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -41,7 +41,7 @@ void ParkEntranceRemoveAction::Serialise(DataSerialiser& stream) GameActions::Result ParkEntranceRemoveAction::Query() const { - if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.SandboxMode) { return GameActions::Result(GameActions::Status::NotInEditorMode, STR_CANT_REMOVE_THIS, STR_NONE); } diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index 6e38794033..ecd87e166c 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -43,7 +43,7 @@ void PeepSpawnPlaceAction::Serialise(DataSerialiser& stream) GameActions::Result PeepSpawnPlaceAction::Query() const { - if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 42894b6a4d..22d2d74cd2 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -161,7 +161,7 @@ GameActions::Result RideCreateAction::Execute() const ride->vehicle_change_timeout = 0; ride->num_stations = 0; ride->NumTrains = 1; - if (gCheatsDisableTrainLengthLimit) + if (GetGameState().Cheats.DisableTrainLengthLimit) { // Reduce amount of proposed trains to prevent 32 trains from always spawning when limits are disabled if (rideEntry->cars_per_flat_ride == NoFlatRideCars) diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 0b25f45a39..6b73159231 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -66,7 +66,7 @@ GameActions::Result RideDemolishAction::Query() const if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) && _modifyType == RIDE_MODIFY_DEMOLISH) - && !gCheatsMakeAllDestructible) + && !GetGameState().Cheats.MakeAllDestructible) { return GameActions::Result( GameActions::Status::NoClearance, STR_CANT_DEMOLISH_RIDE, diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 7fa7ced451..53f6054bc6 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -9,6 +9,7 @@ #include "RideEntranceExitPlaceAction.h" +#include "../GameState.h" #include "../actions/RideEntranceExitRemoveAction.h" #include "../management/Finance.h" #include "../ride/Ride.h" @@ -16,6 +17,8 @@ #include "../world/ConstructionClearance.h" #include "../world/MapAnimation.h" +using namespace OpenRCT2; + RideEntranceExitPlaceAction::RideEntranceExitPlaceAction( const CoordsXY& loc, Direction direction, RideId rideIndex, StationIndex stationNum, bool isExit) : _loc(loc) @@ -59,7 +62,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } - if (_stationNum.ToUnderlying() >= OpenRCT2::Limits::MaxStationsPerRide) + if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide) { LOG_WARNING("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); @@ -96,7 +99,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const { return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_OFF_EDGE_OF_MAP); } - if (!gCheatsSandboxMode && !MapIsLocationOwned({ _loc, z })) + if (!GetGameState().Cheats.SandboxMode && !MapIsLocationOwned({ _loc, z })) { return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } @@ -167,7 +170,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const auto z = station.GetBaseZ(); if (!(GetFlags() & GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST) - && !gCheatsDisableClearanceChecks) + && !GetGameState().Cheats.DisableClearanceChecks) { FootpathRemoveLitter({ _loc, z }); WallRemoveAtZ({ _loc, z }); @@ -230,7 +233,7 @@ GameActions::Result RideEntranceExitPlaceAction::TrackPlaceQuery(const CoordsXYZ const auto errorTitle = isExit ? STR_CANT_BUILD_MOVE_EXIT_FOR_THIS_RIDE_ATTRACTION : STR_CANT_BUILD_MOVE_ENTRANCE_FOR_THIS_RIDE_ATTRACTION; - if (!gCheatsSandboxMode && !MapIsLocationOwned(loc)) + if (!GetGameState().Cheats.SandboxMode && !MapIsLocationOwned(loc)) { return GameActions::Result(GameActions::Status::NotOwned, errorTitle, STR_LAND_NOT_OWNED_BY_PARK); } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 56ecdc5775..619d07529d 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -10,10 +10,13 @@ #include "RideSetSettingAction.h" #include "../Context.h" +#include "../GameState.h" #include "../object/ObjectManager.h" #include "../ride/Ride.h" #include "../ride/RideData.h" +using namespace OpenRCT2; + RideSetSettingAction::RideSetSettingAction(RideId rideIndex, RideSetSetting setting, uint8_t value) : _rideIndex(rideIndex) , _setting(setting) @@ -64,7 +67,7 @@ GameActions::Result RideSetSettingAction::Query() const GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_MUST_BE_CLOSED_FIRST); } - if (!RideIsModeValid(*ride) && !gCheatsShowAllOperatingModes) + if (!RideIsModeValid(*ride) && !GetGameState().Cheats.ShowAllOperatingModes) { LOG_WARNING("Invalid ride mode: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); @@ -105,7 +108,7 @@ GameActions::Result RideSetSettingAction::Query() const break; case RideSetSetting::MusicType: { - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& objManager = GetContext()->GetObjectManager(); auto musicObj = objManager.GetLoadedObject(ObjectType::Music, _value); if (musicObj == nullptr) { @@ -136,7 +139,7 @@ GameActions::Result RideSetSettingAction::Query() const } break; case RideSetSetting::RideType: - if (!gCheatsAllowArbitraryRideTypeChanges) + if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges) { LOG_WARNING("Arbitrary ride type changes not allowed."); return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); @@ -247,15 +250,15 @@ bool RideSetSettingAction::RideIsModeValid(const Ride& ride) const bool RideSetSettingAction::RideIsValidLiftHillSpeed(const Ride& ride) const { - int32_t minSpeed = gCheatsUnlockOperatingLimits ? 0 : ride.GetRideTypeDescriptor().LiftData.minimum_speed; - int32_t maxSpeed = gCheatsUnlockOperatingLimits ? 255 : ride.GetRideTypeDescriptor().LiftData.maximum_speed; + int32_t minSpeed = GetGameState().Cheats.UnlockOperatingLimits ? 0 : ride.GetRideTypeDescriptor().LiftData.minimum_speed; + int32_t maxSpeed = GetGameState().Cheats.UnlockOperatingLimits ? 255 : ride.GetRideTypeDescriptor().LiftData.maximum_speed; return _value >= minSpeed && _value <= maxSpeed; } bool RideSetSettingAction::RideIsValidNumCircuits() const { int32_t minNumCircuits = 1; - int32_t maxNumCircuits = gCheatsUnlockOperatingLimits ? 255 : OpenRCT2::Limits::MaxCircuitsPerRide; + int32_t maxNumCircuits = GetGameState().Cheats.UnlockOperatingLimits ? 255 : Limits::MaxCircuitsPerRide; return _value >= minNumCircuits && _value <= maxNumCircuits; } @@ -264,7 +267,7 @@ bool RideSetSettingAction::RideIsValidOperationOption(const Ride& ride) const const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; uint8_t minValue = operatingSettings.MinValue; uint8_t maxValue = operatingSettings.MaxValue; - if (gCheatsUnlockOperatingLimits) + if (GetGameState().Cheats.UnlockOperatingLimits) { minValue = 0; maxValue = 255; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 7a59a12737..783a4a9b50 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -11,6 +11,7 @@ #include "../Cheats.h" #include "../Context.h" +#include "../GameState.h" #include "../core/MemoryStream.h" #include "../drawing/Drawing.h" #include "../interface/Window.h" @@ -25,6 +26,8 @@ #include "../util/Util.h" #include "../world/Park.h" +using namespace OpenRCT2; + constexpr static StringId SetVehicleTypeErrorTitle[] = { STR_RIDE_SET_VEHICLE_SET_NUM_TRAINS_FAIL, STR_RIDE_SET_VEHICLE_SET_NUM_CARS_PER_TRAIN_FAIL, @@ -156,7 +159,7 @@ GameActions::Result RideSetVehicleAction::Execute() const } uint8_t clampValue = _value; static_assert(sizeof(clampValue) == sizeof(ride->proposed_num_cars_per_train)); - if (!gCheatsDisableTrainLengthLimit) + if (!GetGameState().Cheats.DisableTrainLengthLimit) { clampValue = std::clamp(clampValue, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train); } @@ -179,7 +182,7 @@ GameActions::Result RideSetVehicleAction::Execute() const } RideSetVehicleColoursToRandomPreset(*ride, _colour); - if (!gCheatsDisableTrainLengthLimit) + if (!GetGameState().Cheats.DisableTrainLengthLimit) { ride->proposed_num_cars_per_train = std::clamp( ride->proposed_num_cars_per_train, rideEntry->min_cars_in_train, rideEntry->max_cars_in_train); @@ -226,7 +229,7 @@ bool RideSetVehicleAction::RideIsVehicleTypeValid(const Ride& ride) const { const auto& rtd = ride.GetRideTypeDescriptor(); - if (gCheatsShowVehiclesFromOtherTrackTypes + if (GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes && !( ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE) || ride.type == RIDE_TYPE_MINI_GOLF)) @@ -255,13 +258,13 @@ bool RideSetVehicleAction::RideIsVehicleTypeValid(const Ride& ride) const continue; } - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& objManager = GetContext()->GetObjectManager(); auto& rideEntries = objManager.GetAllRideEntries(rideTypeIterator); for (auto rideEntryIndex : rideEntries) { if (rideEntryIndex == _value) { - if (!RideEntryIsInvented(rideEntryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) { return false; } diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 628d8bc357..0b9c2a5909 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -10,6 +10,7 @@ #include "SmallSceneryPlaceAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../common.h" #include "../core/MemoryStream.h" @@ -30,6 +31,8 @@ #include "GameAction.h" #include "SmallSceneryRemoveAction.h" +using namespace OpenRCT2; + SmallSceneryPlaceAction::SmallSceneryPlaceAction( const CoordsXYZD& loc, uint8_t quadrant, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour, uint8_t tertiaryColour) @@ -115,7 +118,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); + auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { return GameActions::Result( @@ -163,7 +166,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const targetHeight = surfaceHeight; } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode && !MapIsLocationOwned({ _loc.x, _loc.y, targetHeight })) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_POSITION_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -171,7 +174,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const auto* surfaceElement = MapGetSurfaceElementAt(_loc); - if (surfaceElement != nullptr && !gCheatsDisableClearanceChecks && surfaceElement->GetWaterHeight() > 0) + if (surfaceElement != nullptr && !GetGameState().Cheats.DisableClearanceChecks && surfaceElement->GetWaterHeight() > 0) { int32_t water_height = surfaceElement->GetWaterHeight() - 1; if (water_height > targetHeight) @@ -181,7 +184,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const } } - if (!gCheatsDisableClearanceChecks && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE))) + if (!GetGameState().Cheats.DisableClearanceChecks && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE))) { if (isOnWater) { @@ -199,13 +202,15 @@ GameActions::Result SmallSceneryPlaceAction::Query() const } } - if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE)) && !supportsRequired - && !isOnWater && surfaceElement != nullptr && (surfaceElement->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)) + if (!GetGameState().Cheats.DisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_REQUIRE_FLAT_SURFACE)) + && !supportsRequired && !isOnWater && surfaceElement != nullptr + && (surfaceElement->GetSlope() != TILE_ELEMENT_SLOPE_FLAT)) { return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_POSITION_THIS_HERE, STR_LEVEL_LAND_REQUIRED); } - if (!gCheatsDisableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) && supportsRequired) + if (!GetGameState().Cheats.DisableSupportLimits && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) + && supportsRequired) { if (!isOnWater) { @@ -308,7 +313,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const res.Position.z = surfaceHeight; } - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); + auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { return GameActions::Result( @@ -357,7 +362,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { FootpathRemoveLitter({ _loc, targetHeight }); - if (!gCheatsDisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS))) + if (!GetGameState().Cheats.DisableClearanceChecks && (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_NO_WALLS))) { WallRemoveAt({ _loc, targetHeight, targetHeight + sceneryEntry->height }); } diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index f9c8a2436d..fc70ff8c4f 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -74,7 +74,8 @@ GameActions::Result SmallSceneryRemoveAction::Query() const res.Expenditure = ExpenditureType::Landscaping; res.Position = _loc; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_GHOST) + && !GetGameState().Cheats.SandboxMode) { // Check if allowed to remove item if (GetGameState().ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL) diff --git a/src/openrct2/actions/SmallScenerySetColourAction.cpp b/src/openrct2/actions/SmallScenerySetColourAction.cpp index f5e647142c..3832657eab 100644 --- a/src/openrct2/actions/SmallScenerySetColourAction.cpp +++ b/src/openrct2/actions/SmallScenerySetColourAction.cpp @@ -10,6 +10,7 @@ #include "SmallScenerySetColourAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../common.h" #include "../core/MemoryStream.h" @@ -24,6 +25,8 @@ #include "../world/Surface.h" #include "../world/TileElement.h" +using namespace OpenRCT2; + SmallScenerySetColourAction::SmallScenerySetColourAction( const CoordsXYZ& loc, uint8_t quadrant, ObjectEntryIndex sceneryType, uint8_t primaryColour, uint8_t secondaryColour, uint8_t tertiaryColour) @@ -83,7 +86,7 @@ GameActions::Result SmallScenerySetColourAction::QueryExecute(bool isExecuting) return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationOwned(_loc)) { diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 410b547bbd..421383008a 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -204,7 +204,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const newPeep->TrousersColour = colour; // Staff energy determines their walking speed - switch (gCheatsSelectedStaffSpeed) + switch (GetGameState().Cheats.SelectedStaffSpeed) { case StaffSpeedCheat::None: newPeep->Energy = kCheatsStaffNormalSpeed; diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 2d61bc97b1..7e3205cdfd 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -85,7 +85,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const res.Position.z = heightMid; // Do nothing if not in editor, sandbox mode or landscaping is forbidden - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode && (GetGameState().ParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES)) { return GameActions::Result( @@ -102,7 +102,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const if (!LocationValid(coords)) continue; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(coords)) continue; @@ -170,7 +170,7 @@ GameActions::Result SurfaceSetStyleAction::Execute() const if (!LocationValid(coords)) continue; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(coords)) continue; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 4198d3f992..88bbc851d9 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -10,6 +10,7 @@ #include "TrackDesignAction.h" #include "../Context.h" +#include "../GameState.h" #include "../management/Finance.h" #include "../management/Research.h" #include "../object/ObjectManager.h" @@ -22,6 +23,8 @@ #include "RideSetSettingAction.h" #include "RideSetVehicleAction.h" +using namespace OpenRCT2; + TrackDesignAction::TrackDesignAction(const CoordsXYZD& location, const TrackDesign& td) : _loc(location) , _td(td) @@ -61,13 +64,13 @@ GameActions::Result TrackDesignAction::Query() const GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& objManager = GetContext()->GetObjectManager(); auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicle_object); if (entryIndex == OBJECT_ENTRY_INDEX_NULL) { // Force a fallback if the entry is not invented yet a td6 of it is selected, // which can happen in select-by-track-type mode - if (!RideEntryIsInvented(entryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(entryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) { entryIndex = OBJECT_ENTRY_INDEX_NULL; } @@ -133,13 +136,13 @@ GameActions::Result TrackDesignAction::Execute() const res.Position.z = _loc.z; res.Expenditure = ExpenditureType::RideConstruction; - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& objManager = GetContext()->GetObjectManager(); auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicle_object); if (entryIndex != OBJECT_ENTRY_INDEX_NULL) { // Force a fallback if the entry is not invented yet a track design using it is selected. // This can happen on rides with multiple vehicles where some have been invented and some haven’t. - if (!RideEntryIsInvented(entryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(entryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) { entryIndex = OBJECT_ENTRY_INDEX_NULL; } @@ -247,14 +250,14 @@ GameActions::Result TrackDesignAction::Execute() const ride->entrance_style = gLastEntranceStyle; } - for (int32_t i = 0; i < OpenRCT2::Limits::NumColourSchemes; i++) + for (int32_t i = 0; i < Limits::NumColourSchemes; i++) { ride->track_colour[i].main = _td.track_spine_colour[i]; ride->track_colour[i].additional = _td.track_rail_colour[i]; ride->track_colour[i].supports = _td.track_support_colour[i]; } - for (size_t i = 0; i < OpenRCT2::Limits::MaxVehicleColours; i++) + for (size_t i = 0; i < Limits::MaxVehicleColours; i++) { ride->vehicle_colours[i] = _td.vehicle_colours[i]; } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 0575e89b7e..ff85c0d611 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -9,6 +9,7 @@ #include "TrackPlaceAction.h" +#include "../GameState.h" #include "../core/Numerics.hpp" #include "../management/Finance.h" #include "../ride/RideData.h" @@ -21,6 +22,7 @@ #include "../world/Surface.h" #include "RideSetSettingAction.h" +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; TrackPlaceAction::TrackPlaceAction( @@ -89,7 +91,7 @@ GameActions::Result TrackPlaceAction::Query() const GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } - if (_rideType != ride->type && !gCheatsAllowArbitraryRideTypeChanges) + if (_rideType != ride->type && !GetGameState().Cheats.AllowArbitraryRideTypeChanges) { return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); @@ -120,7 +122,7 @@ GameActions::Result TrackPlaceAction::Query() const if (!(GetActionFlags() & GameActions::Flags::AllowWhilePaused)) { - if (GameIsPaused() && !gCheatsBuildInPauseMode) + if (GameIsPaused() && !GetGameState().Cheats.BuildInPauseMode) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, @@ -150,7 +152,8 @@ GameActions::Result TrackPlaceAction::Query() const } // Backwards steep lift hills are allowed, even on roller coasters that do not support forwards steep lift hills. if ((_trackPlaceFlags & CONSTRUCTION_LIFT_HILL_SELECTED) - && !ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) && !gCheatsEnableChainLiftOnAllTrack) + && !ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL_STEEP) + && !GetGameState().Cheats.EnableChainLiftOnAllTrack) { const auto& ted = GetTrackElementDescriptor(_trackType); if (ted.Flags & TRACK_ELEM_FLAG_IS_STEEP_UP) @@ -176,7 +179,7 @@ GameActions::Result TrackPlaceAction::Query() const return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } - if (!MapIsLocationOwned(tileCoords) && !gCheatsSandboxMode) + if (!MapIsLocationOwned(tileCoords) && !GetGameState().Cheats.SandboxMode) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_LAND_NOT_OWNED_BY_PARK); @@ -192,7 +195,7 @@ GameActions::Result TrackPlaceAction::Query() const STR_TILE_ELEMENT_LIMIT_REACHED); } - if (!gCheatsAllowTrackPlaceInvalidHeights) + if (!GetGameState().Cheats.AllowTrackPlaceInvalidHeights) { if (ted.Flags & TRACK_ELEM_FLAG_STARTS_AT_HALF_HEIGHT) { @@ -296,7 +299,7 @@ GameActions::Result TrackPlaceAction::Query() const } } - if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !gCheatsDisableClearanceChecks) + if (clearanceData.GroundFlags & ELEMENT_IS_UNDERWATER && !GetGameState().Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, @@ -359,7 +362,7 @@ GameActions::Result TrackPlaceAction::Query() const return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } - if (!gCheatsDisableSupportLimits) + if (!GetGameState().Cheats.DisableSupportLimits) { int32_t ride_height = clearanceZ - surfaceElement->GetBaseZ(); if (ride_height >= 0) @@ -486,7 +489,7 @@ GameActions::Result TrackPlaceAction::Execute() const } } - if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gCheatsDisableClearanceChecks) + if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !GetGameState().Cheats.DisableClearanceChecks) { FootpathRemoveLitter(mapLoc); if (rideTypeFlags & RIDE_TYPE_FLAG_TRACK_NO_WALLS) @@ -616,7 +619,7 @@ GameActions::Result TrackPlaceAction::Execute() const uint8_t availableDirections = entranceDirections & 0x0F; if (availableDirections != 0) { - if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !gCheatsDisableClearanceChecks) + if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST) && !GetGameState().Cheats.DisableClearanceChecks) { for (int32_t chosenDirection = UtilBitScanForward(availableDirections); chosenDirection != -1; chosenDirection = UtilBitScanForward(availableDirections)) @@ -658,7 +661,7 @@ GameActions::Result TrackPlaceAction::Execute() const } } - if (!gCheatsDisableClearanceChecks || !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) + if (!GetGameState().Cheats.DisableClearanceChecks || !(GetFlags() & GAME_COMMAND_FLAG_GHOST)) { FootpathConnectEdges(mapLoc, tileElement, GetFlags()); } @@ -689,7 +692,7 @@ GameActions::Result TrackPlaceAction::Execute() const if (ride->mode == RideMode::PoweredLaunch) { if (ride->GetRideTypeDescriptor().SupportsRideMode(RideMode::PoweredLaunchBlockSectioned) - || gCheatsShowAllOperatingModes) + || GetGameState().Cheats.ShowAllOperatingModes) newMode = RideMode::PoweredLaunchBlockSectioned; else newMode = RideMode::PoweredLaunch; diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 18c59eee93..0a1008531e 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -9,6 +9,7 @@ #include "TrackRemoveAction.h" +#include "../GameState.h" #include "../management/Finance.h" #include "../ride/RideData.h" #include "../ride/Track.h" @@ -19,6 +20,7 @@ #include "../world/Surface.h" #include "RideSetSettingAction.h" +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; TrackRemoveAction::TrackRemoveAction(track_type_t trackType, int32_t sequence, const CoordsXYZD& origin) @@ -440,7 +442,7 @@ GameActions::Result TrackRemoveAction::Execute() const InvalidateTestResults(*ride); FootpathQueueChainReset(); - if (!gCheatsDisableClearanceChecks || !(tileElement->IsGhost())) + if (!GetGameState().Cheats.DisableClearanceChecks || !(tileElement->IsGhost())) { FootpathRemoveEdgesAt(mapLoc, tileElement); } diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 2666f3db7c..70ad9cf55b 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -9,6 +9,7 @@ #include "WallPlaceAction.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../management/Finance.h" #include "../object/LargeSceneryEntry.h" @@ -23,6 +24,7 @@ #include "../world/Surface.h" #include "../world/Wall.h" +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; WallPlaceAction::WallPlaceAction( @@ -81,7 +83,8 @@ GameActions::Result WallPlaceAction::Query() const } auto mapSizeMax = GetMapSizeMaxXY(); - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) + && !GetGameState().Cheats.SandboxMode) { if (_loc.z == 0) { @@ -138,14 +141,14 @@ GameActions::Result WallPlaceAction::Query() const { uint16_t waterHeight = surfaceElement->GetWaterHeight(); - if (targetHeight < waterHeight && !gCheatsDisableClearanceChecks) + if (targetHeight < waterHeight && !GetGameState().Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } } - if (targetHeight < surfaceElement->GetBaseZ() && !gCheatsDisableClearanceChecks) + if (targetHeight < surfaceElement->GetBaseZ() && !GetGameState().Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); @@ -217,7 +220,7 @@ GameActions::Result WallPlaceAction::Query() const } } - auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(_wallType); + auto* wallEntry = ObjectManager::GetObjectEntry(_wallType); if (wallEntry == nullptr) { @@ -248,7 +251,7 @@ GameActions::Result WallPlaceAction::Query() const clearanceHeight += wallEntry->height; bool wallAcrossTrack = false; - if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gCheatsDisableClearanceChecks) + if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !GetGameState().Cheats.DisableClearanceChecks) { auto result = WallCheckObstruction(wallEntry, targetHeight / 8, clearanceHeight, &wallAcrossTrack); if (result.Error != GameActions::Status::Ok) @@ -307,7 +310,7 @@ GameActions::Result WallPlaceAction::Execute() const } auto targetLoc = CoordsXYZ(_loc, targetHeight); - auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(_wallType); + auto* wallEntry = ObjectManager::GetObjectEntry(_wallType); if (wallEntry == nullptr) { @@ -323,7 +326,7 @@ GameActions::Result WallPlaceAction::Execute() const clearanceHeight += wallEntry->height; bool wallAcrossTrack = false; - if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gCheatsDisableClearanceChecks) + if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !GetGameState().Cheats.DisableClearanceChecks) { auto result = WallCheckObstruction(wallEntry, targetHeight / COORDS_Z_STEP, clearanceHeight, &wallAcrossTrack); if (result.Error != GameActions::Status::Ok) diff --git a/src/openrct2/actions/WallRemoveAction.cpp b/src/openrct2/actions/WallRemoveAction.cpp index 8cfbb34a16..45276c784c 100644 --- a/src/openrct2/actions/WallRemoveAction.cpp +++ b/src/openrct2/actions/WallRemoveAction.cpp @@ -10,6 +10,7 @@ #include "WallRemoveAction.h" #include "../Cheats.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../core/MemoryStream.h" #include "../interface/Window.h" @@ -50,7 +51,8 @@ GameActions::Result WallRemoveAction::Query() const } const bool isGhost = GetFlags() & GAME_COMMAND_FLAG_GHOST; - if (!isGhost && !(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode && !MapIsLocationOwned(_loc)) + if (!isGhost && !(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode + && !MapIsLocationOwned(_loc)) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REMOVE_THIS, STR_LAND_NOT_OWNED_BY_PARK); } diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 46375cbb6b..917d120a6e 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -9,6 +9,7 @@ #include "WallSetColourAction.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../management/Finance.h" #include "../object/WallSceneryEntry.h" @@ -19,6 +20,8 @@ #include "../world/Scenery.h" #include "../world/Surface.h" +using namespace OpenRCT2; + WallSetColourAction::WallSetColourAction( const CoordsXYZD& loc, int32_t primaryColour, int32_t secondaryColour, int32_t tertiaryColour) : _loc(loc) @@ -63,7 +66,7 @@ GameActions::Result WallSetColourAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_OFF_EDGE_OF_MAP); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationInPark(_loc) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !MapIsLocationInPark(_loc) && !GetGameState().Cheats.SandboxMode) { return GameActions::Result(GameActions::Status::NotOwned, STR_CANT_REPAINT_THIS, STR_LAND_NOT_OWNED_BY_PARK); } diff --git a/src/openrct2/actions/WaterLowerAction.cpp b/src/openrct2/actions/WaterLowerAction.cpp index 1726000df2..7d76cace73 100644 --- a/src/openrct2/actions/WaterLowerAction.cpp +++ b/src/openrct2/actions/WaterLowerAction.cpp @@ -9,11 +9,14 @@ #include "WaterLowerAction.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../audio/audio.h" #include "../ride/RideConstruction.h" #include "WaterSetHeightAction.h" +using namespace OpenRCT2; + WaterLowerAction::WaterLowerAction(MapRange range) : _range(range) { @@ -76,7 +79,7 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const if (surfaceElement == nullptr) continue; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ x, y })) { @@ -119,7 +122,7 @@ GameActions::Result WaterLowerAction::QueryExecute(bool isExecuting) const if (isExecuting && hasChanged) { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::LayingOutWater, res.Position); + Audio::Play3D(Audio::SoundId::LayingOutWater, res.Position); } // Force ride construction to recheck area _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_RECHECK; @@ -135,7 +138,7 @@ uint8_t WaterLowerAction::GetLowestHeight(const MapRange& validRange) const { for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += COORDS_XY_STEP) { - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ x, y })) { diff --git a/src/openrct2/actions/WaterRaiseAction.cpp b/src/openrct2/actions/WaterRaiseAction.cpp index ebfad2b152..5f75573326 100644 --- a/src/openrct2/actions/WaterRaiseAction.cpp +++ b/src/openrct2/actions/WaterRaiseAction.cpp @@ -9,6 +9,7 @@ #include "WaterRaiseAction.h" +#include "../GameState.h" #include "../OpenRCT2.h" #include "../audio/audio.h" #include "../ride/RideConstruction.h" @@ -76,7 +77,7 @@ GameActions::Result WaterRaiseAction::QueryExecute(bool isExecuting) const if (surfaceElement == nullptr) continue; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ x, y })) { @@ -148,7 +149,7 @@ uint16_t WaterRaiseAction::GetHighestHeight(const MapRange& validRange) const { for (int32_t x = validRange.GetLeft(); x <= validRange.GetRight(); x += COORDS_XY_STEP) { - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ x, y })) { diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index 5eb0303eca..c16193793f 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -48,7 +48,7 @@ GameActions::Result WaterSetHeightAction::Query() const res.Expenditure = ExpenditureType::Landscaping; res.Position = { _coords, _height * COORDS_Z_STEP }; - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode && GetGameState().ParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES) { return GameActions::Result(GameActions::Status::Disallowed, STR_NONE, STR_FORBIDDEN_BY_THE_LOCAL_AUTHORITY); @@ -65,7 +65,7 @@ GameActions::Result WaterSetHeightAction::Query() const return GameActions::Result(GameActions::Status::NotOwned, STR_NONE, STR_LAND_NOT_OWNED_BY_PARK); } - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(_coords)) { @@ -117,7 +117,7 @@ GameActions::Result WaterSetHeightAction::Execute() const int32_t surfaceHeight = TileElementHeight(_coords); FootpathRemoveLitter({ _coords, surfaceHeight }); - if (!gCheatsDisableClearanceChecks) + if (!GetGameState().Cheats.DisableClearanceChecks) WallRemoveAtZ({ _coords, surfaceHeight }); SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 02f04eabbf..0c993b9e45 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -2048,7 +2048,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // excitement check and will only do a basic intensity check when they arrive at the ride itself. if (ride.id == GuestHeadingToRideId) { - if (ride.intensity > RIDE_RATING(10, 00) && !gCheatsIgnoreRideIntensity) + if (ride.intensity > RIDE_RATING(10, 00) && !GetGameState().Cheats.IgnoreRideIntensity) { PeepRideIsTooIntense(this, ride, peepAtRide); return false; @@ -2074,7 +2074,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b // ride intensity check and get me on a sheltered ride! if (!ClimateIsRaining() || !ShouldRideWhileRaining(ride)) { - if (!gCheatsIgnoreRideIntensity) + if (!GetGameState().Cheats.IgnoreRideIntensity) { // Intensity calculations. Even though the max intensity can go up to 15, it's capped // at 10.0 (before happiness calculations). A full happiness bar will increase the max @@ -2140,7 +2140,7 @@ bool Guest::ShouldGoOnRide(Ride& ride, StationIndex entranceNum, bool atQueue, b return false; } - if (!gCheatsIgnoreRideIntensity) + if (!GetGameState().Cheats.IgnoreRideIntensity) { if (ride.max_positive_vertical_g > FIXED_2DP(5, 00) || ride.max_negative_vertical_g < FIXED_2DP(-4, 00) || ride.max_lateral_g > FIXED_2DP(4, 00)) @@ -2854,7 +2854,7 @@ static bool PeepShouldGoOnRideAgain(Guest* peep, const Ride& ride) return false; if (!RideHasRatings(ride)) return false; - if (ride.intensity > RIDE_RATING(10, 00) && !gCheatsIgnoreRideIntensity) + if (ride.intensity > RIDE_RATING(10, 00) && !GetGameState().Cheats.IgnoreRideIntensity) return false; if (peep->Happiness < 180) return false; @@ -2899,7 +2899,7 @@ static bool PeepReallyLikedRide(Guest* peep, const Ride& ride) return false; if (!RideHasRatings(ride)) return false; - if (ride.intensity > RIDE_RATING(10, 00) && !gCheatsIgnoreRideIntensity) + if (ride.intensity > RIDE_RATING(10, 00) && !GetGameState().Cheats.IgnoreRideIntensity) return false; return true; } @@ -3018,7 +3018,7 @@ static PeepThoughtType PeepAssessSurroundings(int16_t centre_x, int16_t centre_y if (nearby_music == 1 && num_rubbish < 20) return PeepThoughtType::Music; - if (num_rubbish < 2 && !gCheatsDisableLittering) + if (num_rubbish < 2 && !GetGameState().Cheats.DisableLittering) // if disable littering cheat is enabled, peeps will not have the "clean and tidy park" thought return PeepThoughtType::VeryClean; @@ -6188,7 +6188,7 @@ static PathElement* FindBreakableElement(const CoordsXYZ& loc) */ static void PeepUpdateWalkingBreakScenery(Guest* peep) { - if (gCheatsDisableVandalism) + if (GetGameState().Cheats.DisableVandalism) return; if (!(peep->PeepFlags & PEEP_FLAGS_ANGRY)) diff --git a/src/openrct2/entity/Litter.cpp b/src/openrct2/entity/Litter.cpp index 3af4883f3f..7bb3acbd43 100644 --- a/src/openrct2/entity/Litter.cpp +++ b/src/openrct2/entity/Litter.cpp @@ -49,7 +49,7 @@ static bool IsLocationLitterable(const CoordsXYZ& mapPos) */ void Litter::Create(const CoordsXYZD& litterPos, Type type) { - if (gCheatsDisableLittering) + if (GetGameState().Cheats.DisableLittering) return; auto offsetLitterPos = litterPos diff --git a/src/openrct2/interface/Colour.h b/src/openrct2/interface/Colour.h index 9a47f2a7cb..7b4ce7adab 100644 --- a/src/openrct2/interface/Colour.h +++ b/src/openrct2/interface/Colour.h @@ -253,4 +253,4 @@ uint8_t BlendColours(const uint8_t paletteIndex1, const uint8_t paletteIndex2); #endif typedef uint8_t BlendColourMapType[PALETTE_COUNT][PALETTE_COUNT]; -BlendColourMapType* GetBlendColourMap(); \ No newline at end of file +BlendColourMapType* GetBlendColourMap(); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 4781474621..9013e739c4 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -211,7 +211,7 @@ static int32_t ConsoleCommandRides(InteractiveConsole& console, const arguments_ auto res = SetOperatingSetting(RideId::FromUnderlying(ride_index), RideSetSetting::RideType, type); if (res == kMoney64Undefined) { - if (!gCheatsAllowArbitraryRideTypeChanges) + if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges) { console.WriteFormatLine( "That didn't work. Try enabling the 'Allow arbitrary ride type changes' cheat"); @@ -721,15 +721,15 @@ static int32_t ConsoleCommandGet(InteractiveConsole& console, const arguments_t& } else if (argv[0] == "cheat_sandbox_mode") { - console.WriteFormatLine("cheat_sandbox_mode %d", gCheatsSandboxMode); + console.WriteFormatLine("cheat_sandbox_mode %d", GetGameState().Cheats.SandboxMode); } else if (argv[0] == "cheat_disable_clearance_checks") { - console.WriteFormatLine("cheat_disable_clearance_checks %d", gCheatsDisableClearanceChecks); + console.WriteFormatLine("cheat_disable_clearance_checks %d", GetGameState().Cheats.DisableClearanceChecks); } else if (argv[0] == "cheat_disable_support_limits") { - console.WriteFormatLine("cheat_disable_support_limits %d", gCheatsDisableSupportLimits); + console.WriteFormatLine("cheat_disable_support_limits %d", GetGameState().Cheats.DisableSupportLimits); } else if (argv[0] == "current_rotation") { @@ -1111,7 +1111,7 @@ static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t& } else if (argv[0] == "cheat_sandbox_mode" && InvalidArguments(&invalidArgs, int_valid[0])) { - if (gCheatsSandboxMode != (int_val[0] != 0)) + if (GetGameState().Cheats.SandboxMode != (int_val[0] != 0)) { auto cheatSetAction = CheatSetAction(CheatType::SandboxMode, int_val[0] != 0); cheatSetAction.SetCallback([&console](const GameAction*, const GameActions::Result* res) { @@ -1129,7 +1129,7 @@ static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t& } else if (argv[0] == "cheat_disable_clearance_checks" && InvalidArguments(&invalidArgs, int_valid[0])) { - if (gCheatsDisableClearanceChecks != (int_val[0] != 0)) + if (GetGameState().Cheats.DisableClearanceChecks != (int_val[0] != 0)) { auto cheatSetAction = CheatSetAction(CheatType::DisableClearanceChecks, int_val[0] != 0); cheatSetAction.SetCallback([&console](const GameAction*, const GameActions::Result* res) { @@ -1147,7 +1147,7 @@ static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t& } else if (argv[0] == "cheat_disable_support_limits" && InvalidArguments(&invalidArgs, int_valid[0])) { - if (gCheatsDisableSupportLimits != (int_val[0] != 0)) + if (GetGameState().Cheats.DisableSupportLimits != (int_val[0] != 0)) { auto cheatSetAction = CheatSetAction(CheatType::DisableSupportLimits, int_val[0] != 0); cheatSetAction.SetCallback([&console](const GameAction*, const GameActions::Result* res) { diff --git a/src/openrct2/management/Marketing.cpp b/src/openrct2/management/Marketing.cpp index 685c08ea32..8cda9cb79a 100644 --- a/src/openrct2/management/Marketing.cpp +++ b/src/openrct2/management/Marketing.cpp @@ -11,6 +11,7 @@ #include "../Cheats.h" #include "../Game.h" +#include "../GameState.h" #include "../config/Config.h" #include "../entity/Guest.h" #include "../interface/Window.h" @@ -24,6 +25,8 @@ #include "Finance.h" #include "NewsItem.h" +using namespace OpenRCT2; + const money64 AdvertisingCampaignPricePerWeek[] = { 50.00_GBP, // PARK_ENTRY_FREE 50.00_GBP, // RIDE_FREE @@ -100,7 +103,7 @@ void MarketingUpdate() { PROFILED_FUNCTION(); - if (gCheatsNeverendingMarketing) + if (GetGameState().Cheats.NeverendingMarketing) return; for (auto it = gMarketingCampaigns.begin(); it != gMarketingCampaigns.end();) diff --git a/src/openrct2/management/Research.cpp b/src/openrct2/management/Research.cpp index 99349efac9..ae3919dae1 100644 --- a/src/openrct2/management/Research.cpp +++ b/src/openrct2/management/Research.cpp @@ -627,7 +627,7 @@ bool SceneryGroupIsInvented(int32_t sgIndex) return true; } - if (gCheatsIgnoreResearchStatus) + if (GetGameState().Cheats.IgnoreResearchStatus) { return true; } diff --git a/src/openrct2/paint/VirtualFloor.cpp b/src/openrct2/paint/VirtualFloor.cpp index 633de8010b..aa031803f2 100644 --- a/src/openrct2/paint/VirtualFloor.cpp +++ b/src/openrct2/paint/VirtualFloor.cpp @@ -10,6 +10,7 @@ #include "VirtualFloor.h" #include "../Cheats.h" +#include "../GameState.h" #include "../Input.h" #include "../config/Config.h" #include "../interface/Viewport.h" @@ -244,7 +245,7 @@ static void VirtualFloorGetTileProperties( *tileOwned = MapIsLocationOwned({ loc, height }); - if (gCheatsSandboxMode) + if (GetGameState().Cheats.SandboxMode) *tileOwned = true; // Iterate through the map elements of the current tile to find: diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 88d3fc6f3a..cde1e0a5d7 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -40,6 +40,8 @@ #include #include +using namespace OpenRCT2; + // Needed to make the sign appear above footpaths. static constexpr int16_t ForSaleSignZOffset = 3; @@ -1188,7 +1190,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con PaintPatrolArea(session, tileElement, height, surfaceShape); // Draw Peep Spawns - if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) + if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) && session.ViewFlags & VIEWPORT_FLAG_LAND_OWNERSHIP) { const CoordsXY& pos = session.MapPosition; diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index db11761041..c4fdbe11b2 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1434,7 +1434,7 @@ static void RideBreakdownUpdate(Ride& ride) // continues. if ((ride.reliability == 0 || static_cast(ScenarioRand() & 0x2FFFFF) <= 1 + RIDE_INITIAL_RELIABILITY - ride.reliability) - && !gCheatsDisableAllBreakdowns) + && !GetGameState().Cheats.DisableAllBreakdowns) { int32_t breakdownReason = RideGetNewBreakdownProblem(ride); if (breakdownReason != -1) @@ -1493,7 +1493,7 @@ static int32_t RideGetNewBreakdownProblem(const Ride& ride) return -1; // If brakes failure is disabled, also take it out of the equation (see above comment why) - if (gCheatsDisableBrakesFailure) + if (GetGameState().Cheats.DisableBrakesFailure) return -1; auto monthsOld = ride.GetAge(); @@ -5077,7 +5077,7 @@ void Ride::UpdateMaxVehicles() } int32_t newCarsPerTrain = std::max(proposed_num_cars_per_train, rideEntry->min_cars_in_train); maxCarsPerTrain = std::max(maxCarsPerTrain, static_cast(rideEntry->min_cars_in_train)); - if (!gCheatsDisableTrainLengthLimit) + if (!GetGameState().Cheats.DisableTrainLengthLimit) { newCarsPerTrain = std::min(maxCarsPerTrain, newCarsPerTrain); } @@ -5166,7 +5166,7 @@ void Ride::UpdateMaxVehicles() maxNumTrains = rideEntry->cars_per_flat_ride; } - if (gCheatsDisableTrainLengthLimit) + if (GetGameState().Cheats.DisableTrainLengthLimit) { maxNumTrains = OpenRCT2::Limits::MaxTrainsPerRide; } @@ -5512,7 +5512,7 @@ int32_t RideGetEntryIndex(int32_t rideType, int32_t rideSubType) } // Can happen in select-by-track-type mode - if (!RideEntryIsInvented(rideEntryIndex) && !gCheatsIgnoreResearchStatus) + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) { continue; } @@ -5741,7 +5741,7 @@ void Ride::FormatNameTo(Formatter& ft) const uint64_t Ride::GetAvailableModes() const { - if (gCheatsShowAllOperatingModes) + if (GetGameState().Cheats.ShowAllOperatingModes) return AllRideModesAvailable; return GetRideTypeDescriptor().RideModes; @@ -5923,7 +5923,7 @@ ResultWithMessage Ride::ChangeStatusCheckTrackValidity(const CoordsXYE& trackEle } } - if (subtype != OBJECT_ENTRY_INDEX_NULL && !gCheatsEnableAllDrawableTrackPieces) + if (subtype != OBJECT_ENTRY_INDEX_NULL && !GetGameState().Cheats.EnableAllDrawableTrackPieces) { const auto* rideEntry = GetRideEntryByIndex(subtype); if (rideEntry->flags & RIDE_ENTRY_FLAG_NO_INVERSIONS) diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index e7591c482e..024d1bee72 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -697,7 +697,8 @@ void RideConstructionSetDefaultNextPiece() _currentTrackPitchEnd = slope; _previousTrackPitchEnd = slope; _currentTrackLiftHill = tileElement->AsTrack()->HasChain() - && ((slope != TrackPitch::Down25 && slope != TrackPitch::Down60) || gCheatsEnableChainLiftOnAllTrack); + && ((slope != TrackPitch::Down25 && slope != TrackPitch::Down60) + || GetGameState().Cheats.EnableChainLiftOnAllTrack); break; } case RideConstructionState::Back: @@ -744,7 +745,7 @@ void RideConstructionSetDefaultNextPiece() // Set track slope and lift hill _currentTrackPitchEnd = slope; _previousTrackPitchEnd = slope; - if (!gCheatsEnableChainLiftOnAllTrack) + if (!GetGameState().Cheats.EnableChainLiftOnAllTrack) { _currentTrackLiftHill = tileElement->AsTrack()->HasChain(); } diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index 61cd09ee81..623b742d6a 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -20,6 +20,7 @@ #include "RideData.h" #include "../Cheats.h" +#include "../GameState.h" #include "../audio/audio.h" #include "../interface/Colour.h" #include "../localisation/Localisation.h" @@ -120,6 +121,7 @@ #include +using namespace OpenRCT2; using namespace OpenRCT2::Entity::Yaw; // clang-format off @@ -180,7 +182,7 @@ const CarEntry CableLiftVehicle = { .no_seating_rows = 0, .spinning_inertia = 0, .spinning_friction = 255, - .friction_sound_id = OpenRCT2::Audio::SoundId::LiftClassic, + .friction_sound_id = Audio::SoundId::LiftClassic, .ReversedCarIndex = 0, .sound_range = 0, .double_sound_frequency = 0, @@ -358,13 +360,14 @@ bool RideTypeDescriptor::HasFlag(uint64_t flag) const void RideTypeDescriptor::GetAvailableTrackPieces(RideTrackGroup& res) const { res = EnabledTrackPieces; - if (gCheatsEnableAllDrawableTrackPieces) + if (GetGameState().Cheats.EnableAllDrawableTrackPieces) res |= ExtraTrackPieces; } bool RideTypeDescriptor::SupportsTrackPiece(const uint64_t trackPiece) const { - return EnabledTrackPieces.get(trackPiece) || (gCheatsEnableAllDrawableTrackPieces && ExtraTrackPieces.get(trackPiece)); + return EnabledTrackPieces.get(trackPiece) + || (GetGameState().Cheats.EnableAllDrawableTrackPieces && ExtraTrackPieces.get(trackPiece)); } ResearchCategory RideTypeDescriptor::GetResearchCategory() const @@ -407,7 +410,7 @@ void UpdateEnabledRidePieces(ride_type_t rideType) { GetRideTypeDescriptor(rideType).GetAvailableTrackPieces(_enabledRidePieces); - if (!gCheatsEnableAllDrawableTrackPieces) + if (!GetGameState().Cheats.EnableAllDrawableTrackPieces) { _enabledRidePieces &= ~_disabledRidePieces; } diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 5344c9b6f9..340954cfed 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -1142,7 +1142,7 @@ static void RideRatingsCalculateValue(Ride& ride) + (((ride.nausea * ratingsMultipliers.Nausea) * 32) >> 15); int32_t monthsOld = 0; - if (!gCheatsDisableRideValueAging) + if (!GetGameState().Cheats.DisableRideValueAging) { monthsOld = ride.GetAge(); } diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 81dacc60ac..113e00fa92 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -11,6 +11,7 @@ #include "../Cheats.h" #include "../Game.h" +#include "../GameState.h" #include "../audio/audio.h" #include "../config/Config.h" #include "../interface/Viewport.h" @@ -34,6 +35,7 @@ #include "TrackData.h" #include "TrackDesign.h" +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; PitchAndRoll TrackPitchAndRollStart(track_type_t trackType) @@ -121,7 +123,7 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_SINGLE_PIECE_STATION)) { - if (ride->num_stations >= OpenRCT2::Limits::MaxStationsPerRide) + if (ride->num_stations >= Limits::MaxStationsPerRide) { return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } @@ -190,7 +192,7 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 // When attempting to place a track design, it sometimes happens that the front and back of station 0 are built, // but the middle is not. Allow this, so the track place function can actually finish building all 4 stations. // This _might_ cause issues if the track designs is bugged and actually has 5. - if (stationBackLoc == stationFrontLoc && ride->num_stations >= OpenRCT2::Limits::MaxStationsPerRide && !fromTrackDesign) + if (stationBackLoc == stationFrontLoc && ride->num_stations >= Limits::MaxStationsPerRide && !fromTrackDesign) { return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } @@ -327,8 +329,7 @@ ResultWithMessage TrackRemoveStationElement(const CoordsXYZD& loc, RideId rideIn if (!(flags & GAME_COMMAND_FLAG_APPLY)) { - if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc) - && ride->num_stations >= OpenRCT2::Limits::MaxStationsPerRide) + if ((removeLoc != stationBackLoc) && (removeLoc != stationFrontLoc) && ride->num_stations >= Limits::MaxStationsPerRide) { return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } @@ -943,7 +944,7 @@ void TrackElement::SetBrakeClosed(bool isClosed) bool TrackElement::IsIndestructible() const { - return (Flags2 & TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE) != 0 && !gCheatsMakeAllDestructible; + return (Flags2 & TRACK_ELEMENT_FLAGS2_INDESTRUCTIBLE_TRACK_PIECE) != 0 && !GetGameState().Cheats.MakeAllDestructible; } void TrackElement::SetIsIndestructible(bool isIndestructible) diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 590898b7ea..acba501d46 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -743,7 +743,7 @@ static std::optional TrackDesignPlaceSceneryElementGetEntry(c { result.Type = obj->GetObjectType(); result.Index = objectMgr.GetLoadedObjectEntryIndex(obj); - if (!gCheatsIgnoreResearchStatus) + if (!GetGameState().Cheats.IgnoreResearchStatus) { objectUnavailable = !ResearchIsInvented(result.Type, result.Index); } @@ -1975,7 +1975,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon { *flags |= TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE; } - else if (!RideEntryIsInvented(entry_index) && !gCheatsIgnoreResearchStatus) + else if (!RideEntryIsInvented(entry_index) && !GetGameState().Cheats.IgnoreResearchStatus) { *flags |= TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE; } diff --git a/src/openrct2/scripting/bindings/game/ScCheats.hpp b/src/openrct2/scripting/bindings/game/ScCheats.hpp index f80f7ee622..4ba6849a8b 100644 --- a/src/openrct2/scripting/bindings/game/ScCheats.hpp +++ b/src/openrct2/scripting/bindings/game/ScCheats.hpp @@ -12,6 +12,7 @@ #ifdef ENABLE_SCRIPTING # include "../../../Cheats.h" +# include "../../../GameState.h" # include "../../Duktape.hpp" # include "../../ScriptEngine.h" @@ -78,266 +79,266 @@ namespace OpenRCT2::Scripting private: bool allowArbitraryRideTypeChanges_get() { - return gCheatsAllowArbitraryRideTypeChanges; + return GetGameState().Cheats.AllowArbitraryRideTypeChanges; } void allowArbitraryRideTypeChanges_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsAllowArbitraryRideTypeChanges = value; + GetGameState().Cheats.AllowArbitraryRideTypeChanges = value; } bool allowTrackPlaceInvalidHeights_get() { - return gCheatsAllowTrackPlaceInvalidHeights; + return GetGameState().Cheats.AllowTrackPlaceInvalidHeights; } void allowTrackPlaceInvalidHeights_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsAllowTrackPlaceInvalidHeights = value; + GetGameState().Cheats.AllowTrackPlaceInvalidHeights = value; } bool buildInPauseMode_get() { - return gCheatsBuildInPauseMode; + return GetGameState().Cheats.BuildInPauseMode; } void buildInPauseMode_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsBuildInPauseMode = value; + GetGameState().Cheats.BuildInPauseMode = value; } bool disableAllBreakdowns_get() { - return gCheatsDisableAllBreakdowns; + return GetGameState().Cheats.DisableAllBreakdowns; } void disableAllBreakdowns_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableAllBreakdowns = value; + GetGameState().Cheats.DisableAllBreakdowns = value; } bool disableBrakesFailure_get() { - return gCheatsDisableBrakesFailure; + return GetGameState().Cheats.DisableBrakesFailure; } void disableBrakesFailure_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableBrakesFailure = value; + GetGameState().Cheats.DisableBrakesFailure = value; } bool disableClearanceChecks_get() { - return gCheatsDisableClearanceChecks; + return GetGameState().Cheats.DisableClearanceChecks; } void disableClearanceChecks_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableClearanceChecks = value; + GetGameState().Cheats.DisableClearanceChecks = value; } bool disableLittering_get() { - return gCheatsDisableLittering; + return GetGameState().Cheats.DisableLittering; } void disableLittering_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableLittering = value; + GetGameState().Cheats.DisableLittering = value; } bool disablePlantAging_get() { - return gCheatsDisablePlantAging; + return GetGameState().Cheats.DisablePlantAging; } void disablePlantAging_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisablePlantAging = value; + GetGameState().Cheats.DisablePlantAging = value; } bool allowRegularPathAsQueue_get() { - return gCheatsAllowRegularPathAsQueue; + return GetGameState().Cheats.AllowRegularPathAsQueue; } void allowRegularPathAsQueue_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsAllowRegularPathAsQueue = value; + GetGameState().Cheats.AllowRegularPathAsQueue = value; } bool allowSpecialColourSchemes_get() { - return gCheatsAllowSpecialColourSchemes; + return GetGameState().Cheats.AllowSpecialColourSchemes; } void allowSpecialColourSchemes_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsAllowSpecialColourSchemes = value; + GetGameState().Cheats.AllowSpecialColourSchemes = value; } bool disableRideValueAging_get() { - return gCheatsDisableRideValueAging; + return GetGameState().Cheats.DisableRideValueAging; } void disableRideValueAging_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableRideValueAging = value; + GetGameState().Cheats.DisableRideValueAging = value; } bool disableSupportLimits_get() { - return gCheatsDisableSupportLimits; + return GetGameState().Cheats.DisableSupportLimits; } void disableSupportLimits_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableSupportLimits = value; + GetGameState().Cheats.DisableSupportLimits = value; } bool disableTrainLengthLimit_get() { - return gCheatsDisableTrainLengthLimit; + return GetGameState().Cheats.DisableTrainLengthLimit; } void disableTrainLengthLimit_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableTrainLengthLimit = value; + GetGameState().Cheats.DisableTrainLengthLimit = value; } bool disableVandalism_get() { - return gCheatsDisableVandalism; + return GetGameState().Cheats.DisableVandalism; } void disableVandalism_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsDisableVandalism = value; + GetGameState().Cheats.DisableVandalism = value; } bool enableAllDrawableTrackPieces_get() { - return gCheatsEnableAllDrawableTrackPieces; + return GetGameState().Cheats.EnableAllDrawableTrackPieces; } void enableAllDrawableTrackPieces_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsEnableAllDrawableTrackPieces = value; + GetGameState().Cheats.EnableAllDrawableTrackPieces = value; } bool enableChainLiftOnAllTrack_get() { - return gCheatsEnableChainLiftOnAllTrack; + return GetGameState().Cheats.EnableChainLiftOnAllTrack; } void enableChainLiftOnAllTrack_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsEnableChainLiftOnAllTrack = value; + GetGameState().Cheats.EnableChainLiftOnAllTrack = value; } bool fastLiftHill_get() { - return gCheatsUnlockOperatingLimits; + return GetGameState().Cheats.UnlockOperatingLimits; } void fastLiftHill_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsUnlockOperatingLimits = value; + GetGameState().Cheats.UnlockOperatingLimits = value; } bool freezeWeather_get() { - return gCheatsFreezeWeather; + return GetGameState().Cheats.FreezeWeather; } void freezeWeather_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsFreezeWeather = value; + GetGameState().Cheats.FreezeWeather = value; } bool ignoreResearchStatus_get() { - return gCheatsIgnoreResearchStatus; + return GetGameState().Cheats.IgnoreResearchStatus; } void ignoreResearchStatus_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsIgnoreResearchStatus = value; + GetGameState().Cheats.IgnoreResearchStatus = value; } bool ignoreRideIntensity_get() { - return gCheatsIgnoreRideIntensity; + return GetGameState().Cheats.IgnoreRideIntensity; } void ignoreRideIntensity_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsIgnoreRideIntensity = value; + GetGameState().Cheats.IgnoreRideIntensity = value; } bool neverendingMarketing_get() { - return gCheatsNeverendingMarketing; + return GetGameState().Cheats.NeverendingMarketing; } void neverendingMarketing_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsNeverendingMarketing = value; + GetGameState().Cheats.NeverendingMarketing = value; } bool sandboxMode_get() { - return gCheatsSandboxMode; + return GetGameState().Cheats.SandboxMode; } void sandboxMode_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsSandboxMode = value; + GetGameState().Cheats.SandboxMode = value; } bool showAllOperatingModes_get() { - return gCheatsShowAllOperatingModes; + return GetGameState().Cheats.ShowAllOperatingModes; } void showAllOperatingModes_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsShowAllOperatingModes = value; + GetGameState().Cheats.ShowAllOperatingModes = value; } bool showVehiclesFromOtherTrackTypes_get() { - return gCheatsShowVehiclesFromOtherTrackTypes; + return GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes; } void showVehiclesFromOtherTrackTypes_set(bool value) { ThrowIfGameStateNotMutable(); - gCheatsShowVehiclesFromOtherTrackTypes = value; + GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes = value; } }; } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/windows/_legacy.cpp b/src/openrct2/windows/_legacy.cpp index c42066c62e..f2d78f4cea 100644 --- a/src/openrct2/windows/_legacy.cpp +++ b/src/openrct2/windows/_legacy.cpp @@ -10,6 +10,7 @@ #include "../Cheats.h" #include "../Context.h" #include "../Game.h" +#include "../GameState.h" #include "../Input.h" #include "../actions/MazeSetTrackAction.h" #include "../actions/TrackPlaceAction.h" @@ -30,6 +31,7 @@ #include #include +using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; bool gDisableErrorWindowSound = false; @@ -307,7 +309,7 @@ bool WindowRideConstructionUpdateState( if (alternativeType != TrackElemType::None && (availablePieces.get(trackType))) { trackType = alternativeType; - if (!gCheatsEnableChainLiftOnAllTrack) + if (!GetGameState().Cheats.EnableChainLiftOnAllTrack) liftHillAndInvertedState &= ~CONSTRUCTION_LIFT_HILL_SELECTED; } } @@ -357,7 +359,7 @@ bool WindowRideConstructionUpdateState( turnOffLiftHill = true; } - if (turnOffLiftHill && !gCheatsEnableChainLiftOnAllTrack) + if (turnOffLiftHill && !GetGameState().Cheats.EnableChainLiftOnAllTrack) { liftHillAndInvertedState &= ~CONSTRUCTION_LIFT_HILL_SELECTED; _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index 3b7f1c78ce..951ec39d58 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -126,7 +126,7 @@ void ClimateUpdate() if (gScreenFlags & (~SCREEN_FLAGS_PLAYING)) return; - if (!gCheatsFreezeWeather) + if (!GetGameState().Cheats.FreezeWeather) { if (gameState.ClimateUpdateTimer) { diff --git a/src/openrct2/world/ConstructionClearance.cpp b/src/openrct2/world/ConstructionClearance.cpp index aa3cc35b88..8fc716aaaa 100644 --- a/src/openrct2/world/ConstructionClearance.cpp +++ b/src/openrct2/world/ConstructionClearance.cpp @@ -137,7 +137,7 @@ GameActions::Result MapCanConstructWithClearAt( return res; } - if (gCheatsDisableClearanceChecks) + if (GetGameState().Cheats.DisableClearanceChecks) { res.SetData(ConstructClearResult{ groundFlags }); return res; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index d5b105bb07..9902003726 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -10,6 +10,7 @@ #include "../Cheats.h" #include "../Context.h" #include "../Game.h" +#include "../GameState.h" #include "../Identifiers.h" #include "../OpenRCT2.h" #include "../actions/FootpathPlaceAction.h" @@ -825,7 +826,7 @@ static void Loc6A6D7E( FootpathNeighbourList* neighbourList) { auto targetPos = CoordsXY{ initialTileElementPos } + CoordsDirectionDelta[direction]; - if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode) && MapIsEdge(targetPos)) + if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || OpenRCT2::GetGameState().Cheats.SandboxMode) && MapIsEdge(targetPos)) { if (query) { @@ -2353,7 +2354,7 @@ void FootpathRemoveEdgesAt(const CoordsXY& footpathPos, TileElement* tileElement static ObjectEntryIndex FootpathGetDefaultSurface(bool queue) { - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || OpenRCT2::GetGameState().Cheats.SandboxMode); for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) { auto pathEntry = GetPathSurfaceEntry(i); @@ -2377,7 +2378,7 @@ static bool FootpathIsSurfaceEntryOkay(ObjectEntryIndex index, bool queue) auto pathEntry = GetPathSurfaceEntry(index); if (pathEntry != nullptr) { - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || OpenRCT2::GetGameState().Cheats.SandboxMode); if (!showEditorPaths && (pathEntry->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR)) { return false; @@ -2405,7 +2406,7 @@ static ObjectEntryIndex FootpathGetDefaultRailings() static bool FootpathIsLegacyPathEntryOkay(ObjectEntryIndex index) { - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gCheatsSandboxMode); + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || OpenRCT2::GetGameState().Cheats.SandboxMode); auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); auto footpathObj = static_cast(objManager.GetLoadedObject(ObjectType::Paths, index)); if (footpathObj != nullptr) diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 4bf4c6c66f..cf0cff8579 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -827,7 +827,7 @@ bool MapCanBuildAt(const CoordsXYZ& loc) { if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) return true; - if (gCheatsSandboxMode) + if (GetGameState().Cheats.SandboxMode) return true; if (MapIsLocationOwned(loc)) return true; @@ -963,7 +963,7 @@ uint8_t MapGetLowestLandHeight(const MapRange& range) if (surfaceElement != nullptr && min_height > surfaceElement->BaseHeight) { - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ xi, yi })) { @@ -992,7 +992,7 @@ uint8_t MapGetHighestLandHeight(const MapRange& range) auto* surfaceElement = MapGetSurfaceElementAt(CoordsXY{ xi, yi }); if (surfaceElement != nullptr) { - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !gCheatsSandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) { if (!MapIsLocationInPark(CoordsXY{ xi, yi })) { @@ -1362,8 +1362,8 @@ void MapRemoveOutOfRangeElements() // NOTE: This is only a workaround for non-networked games. // Map resize has to become its own Game Action to properly solve this issue. // - bool buildState = gCheatsBuildInPauseMode; - gCheatsBuildInPauseMode = true; + bool buildState = GetGameState().Cheats.BuildInPauseMode; + GetGameState().Cheats.BuildInPauseMode = true; for (int32_t y = MAXIMUM_MAP_SIZE_BIG - COORDS_XY_STEP; y >= 0; y -= COORDS_XY_STEP) { @@ -1384,7 +1384,7 @@ void MapRemoveOutOfRangeElements() } // Reset cheat state - gCheatsBuildInPauseMode = buildState; + GetGameState().Cheats.BuildInPauseMode = buildState; } static void MapExtendBoundarySurfaceExtendTile(const SurfaceElement& sourceTile, SurfaceElement& destTile) diff --git a/src/openrct2/world/Scenery.cpp b/src/openrct2/world/Scenery.cpp index 2bd2cee7e6..86418f2e83 100644 --- a/src/openrct2/world/Scenery.cpp +++ b/src/openrct2/world/Scenery.cpp @@ -180,7 +180,7 @@ void SmallSceneryElement::UpdateAge(const CoordsXY& sceneryPos) return; } - if (gCheatsDisablePlantAging && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED)) + if (OpenRCT2::GetGameState().Cheats.DisablePlantAging && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_BE_WATERED)) { return; } @@ -315,7 +315,7 @@ bool IsSceneryAvailableToBuild(const ScenerySelection& item) return true; } - if (!gCheatsIgnoreResearchStatus) + if (!OpenRCT2::GetGameState().Cheats.IgnoreResearchStatus) { if (!SceneryIsInvented(item)) { @@ -323,7 +323,7 @@ bool IsSceneryAvailableToBuild(const ScenerySelection& item) } } - if (!gCheatsSandboxMode && !(gScreenFlags & SCREEN_FLAGS_EDITOR)) + if (!OpenRCT2::GetGameState().Cheats.SandboxMode && !(gScreenFlags & SCREEN_FLAGS_EDITOR)) { if (IsSceneryItemRestricted(item)) { diff --git a/test/tests/PlayTests.cpp b/test/tests/PlayTests.cpp index 1c840be8cc..fafade06eb 100644 --- a/test/tests/PlayTests.cpp +++ b/test/tests/PlayTests.cpp @@ -116,7 +116,7 @@ TEST_F(PlayTests, SecondGuestInQueueShouldNotRideIfNoFunds) execute(ferrisWheel.id, 0, true); // Ignore intensity to stimulate peeps to queue into ferris wheel - gCheatsIgnoreRideIntensity = true; + GetGameState().Cheats.IgnoreRideIntensity = true; // Insert a rich guest auto richGuest = gs->GetPark().GenerateGuest(); @@ -176,7 +176,7 @@ TEST_F(PlayTests, CarRideWithOneCarOnlyAcceptsTwoGuests) execute(carRide.id, 0, true); // Ignore intensity to stimulate peeps to queue into the ride - gCheatsIgnoreRideIntensity = true; + GetGameState().Cheats.IgnoreRideIntensity = true; // Create some guests std::vector guests; From 97480388156f7616c1949e4cbfdfa1eeb8772951 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Mon, 4 Mar 2024 14:24:29 +0000 Subject: [PATCH 010/191] Move gExpenditureTable to GameState_t --- src/openrct2-ui/windows/Finances.cpp | 3 ++- src/openrct2/GameState.h | 1 + src/openrct2/management/Finance.cpp | 21 ++++++++++----------- src/openrct2/management/Finance.h | 2 -- src/openrct2/park/ParkFile.cpp | 4 ++-- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/scenario/Scenario.cpp | 4 ++-- 8 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index d612e9a3d7..ad2e3aad5e 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -387,6 +387,7 @@ public: screenCoords.y += TABLE_CELL_HEIGHT; } + auto& gameState = GetGameState(); // Expenditure / Income values for each month auto currentMonthYear = GetDate().GetMonthsElapsed(); for (int32_t i = SummaryMaxAvailableMonth(); i >= 0; i--) @@ -409,7 +410,7 @@ public: money64 profit = 0; for (int32_t j = 0; j < static_cast(ExpenditureType::Count); j++) { - auto expenditure = gExpenditureTable[i][j]; + auto expenditure = gameState.ExpenditureTable[i][j]; if (expenditure != 0) { profit += expenditure; diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 9b048aa6c8..09034b7945 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -78,6 +78,7 @@ namespace OpenRCT2 money64 BankLoan; uint8_t BankLoanInterestRate; money64 MaxBankLoan; + money64 ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; random_engine_t ScenarioRand; TileCoordsXY MapSize; diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index 9a99a987f0..b7afabef08 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -41,8 +41,6 @@ static constexpr int32_t dword_988E60[static_cast(ExpenditureType::Coun 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, }; -money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; - /** * Checks the condition if the game is required to use money. * @param flags game command flags. @@ -82,7 +80,7 @@ void FinancePayment(money64 amount, ExpenditureType type) auto& gameState = GetGameState(); gameState.Cash = AddClamp_money64(gameState.Cash, -amount); - gExpenditureTable[0][static_cast(type)] -= amount; + gameState.ExpenditureTable[0][static_cast(type)] -= amount; if (dword_988E60[static_cast(type)] & 1) { // Cumulative amount of money spent this day @@ -199,7 +197,7 @@ void FinanceResetHistory() { for (uint32_t j = 0; j < static_cast(ExpenditureType::Count); ++j) { - gExpenditureTable[i][j] = 0; + gameState.ExpenditureTable[i][j] = 0; } } } @@ -215,7 +213,7 @@ void FinanceInit() // It only initialises the first month for (uint32_t i = 0; i < static_cast(ExpenditureType::Count); i++) { - gExpenditureTable[0][i] = 0; + gameState.ExpenditureTable[0][i] = 0; } gameState.CurrentExpenditure = 0; @@ -319,12 +317,13 @@ money64 FinanceGetCurrentCash() */ void FinanceShiftExpenditureTable() { + auto& gameState = GetGameState(); // If EXPENDITURE_TABLE_MONTH_COUNT months have passed then is full, sum the oldest month if (GetDate().GetMonthsElapsed() >= EXPENDITURE_TABLE_MONTH_COUNT) { const money64 sum = std::accumulate( - std::cbegin(gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1]), - std::cend(gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1]), money64{}); + std::cbegin(gameState.ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1]), + std::cend(gameState.ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT - 1]), money64{}); GetGameState().HistoricalProfit += sum; } @@ -334,14 +333,14 @@ void FinanceShiftExpenditureTable() { for (size_t j = 0; j < static_cast(ExpenditureType::Count); j++) { - gExpenditureTable[i][j] = gExpenditureTable[i - 1][j]; + gameState.ExpenditureTable[i][j] = gameState.ExpenditureTable[i - 1][j]; } } // Zero the beginning of the table, which is the new month for (uint32_t i = 0; i < static_cast(ExpenditureType::Count); i++) { - gExpenditureTable[0][i] = 0; + gameState.ExpenditureTable[0][i] = 0; } WindowInvalidateByClass(WindowClass::Finances); @@ -365,7 +364,7 @@ money64 FinanceGetLastMonthShopProfit() money64 profit = 0; if (GetDate().GetMonthsElapsed() != 0) { - const auto* lastMonthExpenditure = gExpenditureTable[1]; + const auto* lastMonthExpenditure = GetGameState().ExpenditureTable[1]; profit += lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)]; profit += lastMonthExpenditure[static_cast(ExpenditureType::ShopStock)]; @@ -373,4 +372,4 @@ money64 FinanceGetLastMonthShopProfit() profit += lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkStock)]; } return profit; -} +} \ No newline at end of file diff --git a/src/openrct2/management/Finance.h b/src/openrct2/management/Finance.h index 7666f3e818..33375b8966 100644 --- a/src/openrct2/management/Finance.h +++ b/src/openrct2/management/Finance.h @@ -38,8 +38,6 @@ constexpr uint8_t MaxBankLoanInterestRate = 255; extern const money64 research_cost_table[RESEARCH_FUNDING_COUNT]; -extern money64 gExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; - bool FinanceCheckMoneyRequired(uint32_t flags); bool FinanceCheckAffordability(money64 cost, uint32_t flags); void FinancePayment(money64 amount, ExpenditureType type); diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 26c4dea608..a71f89e5b0 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -832,7 +832,7 @@ namespace OpenRCT2 { for (uint32_t j = 0; j < numTypes; j++) { - gExpenditureTable[i][j] = cs.Read(); + gameState.ExpenditureTable[i][j] = cs.Read(); } } } @@ -847,7 +847,7 @@ namespace OpenRCT2 { for (uint32_t j = 0; j < numTypes; j++) { - cs.Write(gExpenditureTable[i][j]); + cs.Write(gameState.ExpenditureTable[i][j]); } } } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index fc326b7f94..970d5ee818 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1450,7 +1450,7 @@ namespace RCT1 { for (size_t j = 0; j < Limits::ExpenditureTypeCount; j++) { - gExpenditureTable[i][j] = ToMoney64(_s4.Expenditure[i][j]); + gameState.ExpenditureTable[i][j] = ToMoney64(_s4.Expenditure[i][j]); } } gameState.CurrentExpenditure = ToMoney64(_s4.TotalExpenditure); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 82ebc8e647..36f8b5e86a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -295,7 +295,7 @@ namespace RCT2 { for (size_t j = 0; j < Limits::ExpenditureTypeCount; j++) { - gExpenditureTable[i][j] = ToMoney64(_s6.ExpenditureTable[i][j]); + gameState.ExpenditureTable[i][j] = ToMoney64(_s6.ExpenditureTable[i][j]); } } diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index d6c055c9f4..239f233a1b 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -743,7 +743,7 @@ ObjectiveStatus Objective::CheckGuestsAndRating() const ObjectiveStatus Objective::CheckMonthlyRideIncome() const { - money64 lastMonthRideIncome = gExpenditureTable[1][static_cast(ExpenditureType::ParkRideTickets)]; + money64 lastMonthRideIncome = GetGameState().ExpenditureTable[1][static_cast(ExpenditureType::ParkRideTickets)]; if (lastMonthRideIncome >= Currency) { return ObjectiveStatus::Success; @@ -831,7 +831,7 @@ ObjectiveStatus Objective::CheckRepayLoanAndParkValue() const ObjectiveStatus Objective::CheckMonthlyFoodIncome() const { - const auto* lastMonthExpenditure = gExpenditureTable[1]; + const auto* lastMonthExpenditure = GetGameState().ExpenditureTable[1]; auto lastMonthProfit = lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)] + lastMonthExpenditure[static_cast(ExpenditureType::ShopStock)] + lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkSales)] From ef9840f29bbcaee996a43308b9dfdb5336f360f0 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Mon, 4 Mar 2024 15:37:20 +0000 Subject: [PATCH 011/191] Replace static_cast with EnumValue --- src/openrct2-ui/UiContext.cpp | 2 +- src/openrct2-ui/windows/Finances.cpp | 2 +- src/openrct2-ui/windows/Options.cpp | 2 +- src/openrct2/GameState.h | 3 ++- src/openrct2/management/Finance.cpp | 14 +++++++------- src/openrct2/scenario/Scenario.cpp | 10 +++++----- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/openrct2-ui/UiContext.cpp b/src/openrct2-ui/UiContext.cpp index def05b4eee..16faf0a902 100644 --- a/src/openrct2-ui/UiContext.cpp +++ b/src/openrct2-ui/UiContext.cpp @@ -177,7 +177,7 @@ public: SDL_WINDOW_FULLSCREEN, SDL_WINDOW_FULLSCREEN_DESKTOP, }; - uint32_t windowFlags = _sdlFullscreenFlags[static_cast(mode)]; + uint32_t windowFlags = _sdlFullscreenFlags[EnumValue(mode)]; // HACK Changing window size when in fullscreen usually has no effect if (mode == FULLSCREEN_MODE::FULLSCREEN) diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index ad2e3aad5e..4910574e97 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -181,7 +181,7 @@ static_assert(std::size(_windowFinancesPageWidgets) == WINDOW_FINANCES_PAGE_COUN #pragma endregion -static constexpr StringId _windowFinancesSummaryRowLabels[static_cast(ExpenditureType::Count)] = { +static constexpr StringId _windowFinancesSummaryRowLabels[EnumValue(ExpenditureType::Count)] = { STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION, STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS, STR_FINANCES_SUMMARY_LAND_PURCHASE, diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 5e7d60256e..e9acc5492f 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -1043,7 +1043,7 @@ private: STR_VIRTUAL_FLOOR_STYLE_GLASSY, }; - widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[static_cast(gConfigGeneral.VirtualFloorStyle)]; + widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[EnumValue(gConfigGeneral.VirtualFloorStyle)]; SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.EnableLightFx); if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 09034b7945..578613dd93 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -18,6 +18,7 @@ #include "management/NewsItem.h" #include "ride/Ride.h" #include "scenario/Scenario.h" +#include "util/Util.h" #include "world/Banner.h" #include "world/Climate.h" #include "world/Location.hpp" @@ -78,7 +79,7 @@ namespace OpenRCT2 money64 BankLoan; uint8_t BankLoanInterestRate; money64 MaxBankLoan; - money64 ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; + money64 ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][EnumValue(ExpenditureType::Count)]; random_engine_t ScenarioRand; TileCoordsXY MapSize; diff --git a/src/openrct2/management/Finance.cpp b/src/openrct2/management/Finance.cpp index b7afabef08..cd0abc8660 100644 --- a/src/openrct2/management/Finance.cpp +++ b/src/openrct2/management/Finance.cpp @@ -37,7 +37,7 @@ const money64 research_cost_table[RESEARCH_FUNDING_COUNT] = { 400.00_GBP, // Maximum funding }; -static constexpr int32_t dword_988E60[static_cast(ExpenditureType::Count)] = { +static constexpr int32_t dword_988E60[EnumValue(ExpenditureType::Count)] = { 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 0, }; @@ -80,8 +80,8 @@ void FinancePayment(money64 amount, ExpenditureType type) auto& gameState = GetGameState(); gameState.Cash = AddClamp_money64(gameState.Cash, -amount); - gameState.ExpenditureTable[0][static_cast(type)] -= amount; - if (dword_988E60[static_cast(type)] & 1) + gameState.ExpenditureTable[0][EnumValue(type)] -= amount; + if (dword_988E60[EnumValue(type)] & 1) { // Cumulative amount of money spent this day gameState.CurrentExpenditure -= amount; @@ -366,10 +366,10 @@ money64 FinanceGetLastMonthShopProfit() { const auto* lastMonthExpenditure = GetGameState().ExpenditureTable[1]; - profit += lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)]; - profit += lastMonthExpenditure[static_cast(ExpenditureType::ShopStock)]; - profit += lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkSales)]; - profit += lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkStock)]; + profit += lastMonthExpenditure[EnumValue(ExpenditureType::ShopSales)]; + profit += lastMonthExpenditure[EnumValue(ExpenditureType::ShopStock)]; + profit += lastMonthExpenditure[EnumValue(ExpenditureType::FoodDrinkSales)]; + profit += lastMonthExpenditure[EnumValue(ExpenditureType::FoodDrinkStock)]; } return profit; } \ No newline at end of file diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 239f233a1b..f1424db3f0 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -743,7 +743,7 @@ ObjectiveStatus Objective::CheckGuestsAndRating() const ObjectiveStatus Objective::CheckMonthlyRideIncome() const { - money64 lastMonthRideIncome = GetGameState().ExpenditureTable[1][static_cast(ExpenditureType::ParkRideTickets)]; + money64 lastMonthRideIncome = GetGameState().ExpenditureTable[1][EnumValue(ExpenditureType::ParkRideTickets)]; if (lastMonthRideIncome >= Currency) { return ObjectiveStatus::Success; @@ -832,10 +832,10 @@ ObjectiveStatus Objective::CheckRepayLoanAndParkValue() const ObjectiveStatus Objective::CheckMonthlyFoodIncome() const { const auto* lastMonthExpenditure = GetGameState().ExpenditureTable[1]; - auto lastMonthProfit = lastMonthExpenditure[static_cast(ExpenditureType::ShopSales)] - + lastMonthExpenditure[static_cast(ExpenditureType::ShopStock)] - + lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkSales)] - + lastMonthExpenditure[static_cast(ExpenditureType::FoodDrinkStock)]; + auto lastMonthProfit = lastMonthExpenditure[EnumValue(ExpenditureType::ShopSales)] + + lastMonthExpenditure[EnumValue(ExpenditureType::ShopStock)] + + lastMonthExpenditure[EnumValue(ExpenditureType::FoodDrinkSales)] + + lastMonthExpenditure[EnumValue(ExpenditureType::FoodDrinkStock)]; if (lastMonthProfit >= Currency) { From 56df39dcb406277eea992c82cb32c77297d822ce Mon Sep 17 00:00:00 2001 From: Harry-Hopkinson Date: Mon, 4 Mar 2024 18:15:23 +0000 Subject: [PATCH 012/191] Replace uint8's with EnumValue Replace uint8's with EnumValue Replace uint8's with EnumValue Revertl arge change Revert large change Format --- src/openrct2-ui/windows/EditorScenarioOptions.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 4 ++-- src/openrct2-ui/windows/StaffList.cpp | 2 +- src/openrct2/Diagnostic.cpp | 14 +++++++------- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/command_line/RootCommands.cpp | 6 +++--- src/openrct2/core/FileIndex.hpp | 2 +- src/openrct2/entity/Staff.h | 2 +- src/openrct2/entity/Yaw.hpp | 4 +++- src/openrct2/interface/InteractiveConsole.cpp | 3 +-- src/openrct2/localisation/Currency.h | 3 ++- src/openrct2/rct2/RCT2.h | 4 ++-- src/openrct2/ride/CarEntry.cpp | 8 ++++---- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/ride/RideData.h | 4 ++-- src/openrct2/ride/Vehicle.cpp | 6 +++--- src/openrct2/world/Climate.cpp | 6 +++--- 18 files changed, 39 insertions(+), 37 deletions(-) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 47cd8b969d..9c28364ce3 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -1274,7 +1274,7 @@ private: // Climate value screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); - ft.Add(ClimateNames[static_cast(gameState.Climate)]); + ft.Add(ClimateNames[EnumValue(gameState.Climate)]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 5fcacffb73..e32383e0de 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -3435,7 +3435,7 @@ private: } // Mode - widgets[WIDX_MODE].text = RideModeNames[static_cast(ride->mode)]; + widgets[WIDX_MODE].text = RideModeNames[EnumValue(ride->mode)]; // Waiting widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)]; diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 0be54eae8a..5285b571fa 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -127,7 +127,7 @@ static Widget* window_staff_page_widgets[] = { class StaffWindow final : public Window { private: - EntertainerCostume _availableCostumes[static_cast(EntertainerCostume::Count)]{}; + EntertainerCostume _availableCostumes[EnumValue(EntertainerCostume::Count)]{}; uint16_t _tabAnimationOffset = 0; int32_t _pickedPeepOldX = LOCATION_NULL; @@ -778,7 +778,7 @@ private: { checkedIndex = i; } - gDropdownItems[i].Args = StaffCostumeNames[static_cast(costume)]; + gDropdownItems[i].Args = StaffCostumeNames[EnumValue(costume)]; gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; } diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 97d2f555a4..300ef4fa10 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -677,7 +677,7 @@ private: static EntertainerCostume GetRandomEntertainerCostume() { auto result = EntertainerCostume::Panda; - EntertainerCostume costumeList[static_cast(EntertainerCostume::Count)]; + EntertainerCostume costumeList[EnumValue(EntertainerCostume::Count)]; int32_t numCostumes = StaffGetAvailableEntertainerCostumeList(costumeList); if (numCostumes > 0) { diff --git a/src/openrct2/Diagnostic.cpp b/src/openrct2/Diagnostic.cpp index 4a888613ac..a800f2e2fe 100644 --- a/src/openrct2/Diagnostic.cpp +++ b/src/openrct2/Diagnostic.cpp @@ -11,6 +11,7 @@ #include "core/Console.hpp" #include "core/String.hpp" +#include "util/Util.h" #include #include @@ -38,7 +39,7 @@ static FILE* diagnostic_get_stream(DiagnosticLevel level) #ifdef __ANDROID__ -int _android_log_priority[static_cast(DiagnosticLevel::Count)] = { +int _android_log_priority[EnumValue(DiagnosticLevel::Count)] = { ANDROID_LOG_FATAL, ANDROID_LOG_ERROR, ANDROID_LOG_WARN, ANDROID_LOG_VERBOSE, ANDROID_LOG_INFO, }; @@ -50,7 +51,7 @@ void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...) return; va_start(args, format); - __android_log_vprint(_android_log_priority[static_cast(diagnosticLevel)], "OpenRCT2", format, args); + __android_log_vprint(_android_log_priority[EnumValue(diagnosticLevel)], "OpenRCT2", format, args); va_end(args); } @@ -66,7 +67,7 @@ void DiagnosticLogWithLocation( snprintf(buf, 1024, "[%s:%d (%s)]: ", file, line, function); va_start(args, format); - __android_log_vprint(_android_log_priority[static_cast(diagnosticLevel)], file, format, args); + __android_log_vprint(_android_log_priority[EnumValue(diagnosticLevel)], file, format, args); va_end(args); } @@ -91,7 +92,7 @@ void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...) if (_log_levels[static_cast(diagnosticLevel)]) { // Level - auto prefix = String::StdFormat("%s: ", _level_strings[static_cast(diagnosticLevel)]); + auto prefix = String::StdFormat("%s: ", _level_strings[EnumValue(diagnosticLevel)]); // Message va_start(args, format); @@ -112,12 +113,11 @@ void DiagnosticLogWithLocation( std::string prefix; if (_log_location_enabled) { - prefix = String::StdFormat( - "%s[%s:%d (%s)]: ", _level_strings[static_cast(diagnosticLevel)], file, line, function); + prefix = String::StdFormat("%s[%s:%d (%s)]: ", _level_strings[EnumValue(diagnosticLevel)], file, line, function); } else { - prefix = String::StdFormat("%s: ", _level_strings[static_cast(diagnosticLevel)]); + prefix = String::StdFormat("%s: ", _level_strings[EnumValue(diagnosticLevel)]); } // Message diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 1f34bc5206..9817890559 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -131,7 +131,7 @@ GameActions::Result RideSetStatusAction::Execute() const return res; } - res.ErrorTitle = _StatusErrorTitles[static_cast(_status)]; + res.ErrorTitle = _StatusErrorTitles[EnumValue(_status)]; Formatter ft(res.ErrorMessageArgs.data()); ft.Increment(6); diff --git a/src/openrct2/command_line/RootCommands.cpp b/src/openrct2/command_line/RootCommands.cpp index c723022bc9..8d51345738 100644 --- a/src/openrct2/command_line/RootCommands.cpp +++ b/src/openrct2/command_line/RootCommands.cpp @@ -71,10 +71,10 @@ static constexpr CommandLineOptionDefinition StandardOptions[] { 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 }, -#ifndef DISABLE_NETWORK +#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" }, -#endif +#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)" }, @@ -173,7 +173,7 @@ exitcode_t CommandLine::HandleCommandDefault() { if (_verbose) { - _log_levels[static_cast(DiagnosticLevel::Verbose)] = true; + _log_levels[EnumValue(DiagnosticLevel::Verbose)] = true; PrintLaunchInformation(); } diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 45e118b18e..61acb843d4 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -174,7 +174,7 @@ private: { const auto& filePath = scanResult.Files.at(i); - if (_log_levels[static_cast(DiagnosticLevel::Verbose)]) + if (_log_levels[EnumValue(DiagnosticLevel::Verbose)]) { std::lock_guard lock(printLock); LOG_VERBOSE("FileIndex:Indexing '%s'", filePath.c_str()); diff --git a/src/openrct2/entity/Staff.h b/src/openrct2/entity/Staff.h index 13815ac954..e8cc7b4c62 100644 --- a/src/openrct2/entity/Staff.h +++ b/src/openrct2/entity/Staff.h @@ -142,7 +142,7 @@ enum class EntertainerCostume : uint8_t Count }; -extern const StringId StaffCostumeNames[static_cast(EntertainerCostume::Count)]; +extern const StringId StaffCostumeNames[EnumValue(EntertainerCostume::Count)]; colour_t StaffGetColour(StaffType staffType); GameActions::Result StaffSetColour(StaffType staffType, colour_t value); diff --git a/src/openrct2/entity/Yaw.hpp b/src/openrct2/entity/Yaw.hpp index 9fce6252a7..f1cdc90aef 100644 --- a/src/openrct2/entity/Yaw.hpp +++ b/src/openrct2/entity/Yaw.hpp @@ -9,6 +9,8 @@ #pragma once +#include "../util/Util.h" + #include namespace OpenRCT2::Entity::Yaw @@ -63,7 +65,7 @@ namespace OpenRCT2::Entity::Yaw [[nodiscard]] constexpr int32_t YawToPrecision(int32_t yaw, SpritePrecision precision) { - return yaw >> PrecisionOffset[static_cast(precision)]; + return yaw >> PrecisionOffset[EnumValue(precision)]; } [[nodiscard]] constexpr uint8_t NumSpritesPrecision(SpritePrecision precision) diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 9013e739c4..ef92c1c711 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -679,8 +679,7 @@ static int32_t ConsoleCommandGet(InteractiveConsole& console, const arguments_t& else if (argv[0] == "climate") { console.WriteFormatLine( - "climate %s (%d)", ClimateNames[static_cast(gameState.Climate)], - static_cast(gameState.Climate)); + "climate %s (%d)", ClimateNames[EnumValue(gameState.Climate)], EnumValue(gameState.Climate)); } else if (argv[0] == "game_speed") { diff --git a/src/openrct2/localisation/Currency.h b/src/openrct2/localisation/Currency.h index 4fb2495a66..7ad966e0c9 100644 --- a/src/openrct2/localisation/Currency.h +++ b/src/openrct2/localisation/Currency.h @@ -11,6 +11,7 @@ #include "../common.h" #include "../core/String.hpp" +#include "../util/Util.h" // List of currencies enum class CurrencyType : uint8_t @@ -61,7 +62,7 @@ struct CurrencyDescriptor }; // List of currency formats -extern CurrencyDescriptor CurrencyDescriptors[static_cast(CurrencyType::Count)]; +extern CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)]; /** * Loads custom currency saved parameters into {@link CurrencyDescriptors}' diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index e52f9bd3d1..61ea286cd9 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -845,8 +845,8 @@ namespace RCT2 // SC6[6] uint32_t NextFreeTileElementPointerIndex; Entity Entities[Limits::MaxEntitiesRCTCExtended]; - uint16_t EntityListsHead[static_cast(EntityListId::Count)]; - uint16_t EntityListsCount[static_cast(EntityListId::Count)]; + uint16_t EntityListsHead[EnumValue(EntityListId::Count)]; + uint16_t EntityListsCount[EnumValue(EntityListId::Count)]; StringId ParkName; uint8_t Pad013573D6[2]; uint32_t ParkNameArgs; diff --git a/src/openrct2/ride/CarEntry.cpp b/src/openrct2/ride/CarEntry.cpp index 71a02ec7d4..fc84d82872 100644 --- a/src/openrct2/ride/CarEntry.cpp +++ b/src/openrct2/ride/CarEntry.cpp @@ -16,22 +16,22 @@ uint32_t CarEntry::NumRotationSprites(SpriteGroupType spriteGroup) const { - return NumSpritesPrecision(SpriteGroups[static_cast(spriteGroup)].spritePrecision); + return NumSpritesPrecision(SpriteGroups[EnumValue(spriteGroup)].spritePrecision); } int32_t CarEntry::SpriteByYaw(int32_t yaw, SpriteGroupType spriteGroup) const { - return YawToPrecision(yaw, SpriteGroups[static_cast(spriteGroup)].spritePrecision); + return YawToPrecision(yaw, SpriteGroups[EnumValue(spriteGroup)].spritePrecision); } bool CarEntry::GroupEnabled(SpriteGroupType spriteGroup) const { - return SpriteGroups[static_cast(spriteGroup)].Enabled(); + return SpriteGroups[EnumValue(spriteGroup)].Enabled(); } uint32_t CarEntry::GroupImageId(SpriteGroupType spriteGroup) const { - return SpriteGroups[static_cast(spriteGroup)].imageId; + return SpriteGroups[EnumValue(spriteGroup)].imageId; } uint32_t CarEntry::SpriteOffset(SpriteGroupType spriteGroup, int32_t imageDirection, uint8_t rankIndex) const diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index c4fdbe11b2..bf838c6442 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -4923,7 +4923,7 @@ OpenRCT2::BitSet RideEntryGetSupportedTrackPieces(const RideO { for (auto& group : trackPieceRequiredSprites[i]) { - auto precision = defaultVehicle->SpriteGroups[static_cast(group.VehicleSpriteGroup)].spritePrecision; + auto precision = defaultVehicle->SpriteGroups[EnumValue(group.VehicleSpriteGroup)].spritePrecision; if (precision < group.MinPrecision) supportedPieces.set(i, false); } diff --git a/src/openrct2/ride/RideData.h b/src/openrct2/ride/RideData.h index 3659a9ce16..1addb4053a 100644 --- a/src/openrct2/ride/RideData.h +++ b/src/openrct2/ride/RideData.h @@ -512,7 +512,7 @@ extern const CarEntry CableLiftVehicle; extern const uint16_t RideFilmLength[3]; -extern const StringId RideModeNames[static_cast(RideMode::Count)]; +extern const StringId RideModeNames[EnumValue(RideMode::Count)]; // clang-format off constexpr RideTypeDescriptor DummyRTD = @@ -546,7 +546,7 @@ constexpr RideTypeDescriptor DummyRTD = .ColourPreview = { static_cast(SPR_NONE), static_cast(SPR_NONE) }, .ColourKey = RideColourKey::Ride, .Name = "invalid", - .RatingsData = + .RatingsData = { RatingsCalculationType::FlatRide, { RIDE_RATING(1, 00), RIDE_RATING(1, 00), RIDE_RATING(1, 00) }, diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 3b57f5b7ac..60957501e5 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -517,7 +517,7 @@ static bool vehicle_move_info_valid( { return false; } - if (offset >= gTrackVehicleInfo[static_cast(trackSubposition)][typeAndDirection]->size) + if (offset >= gTrackVehicleInfo[EnumValue(trackSubposition)][typeAndDirection]->size) { return false; } @@ -534,7 +534,7 @@ static const VehicleInfo* vehicle_get_move_info( static constexpr VehicleInfo zero = {}; return &zero; } - return &gTrackVehicleInfo[static_cast(trackSubposition)][typeAndDirection]->info[offset]; + return &gTrackVehicleInfo[EnumValue(trackSubposition)][typeAndDirection]->info[offset]; } const VehicleInfo* Vehicle::GetMoveInfo() const @@ -550,7 +550,7 @@ uint16_t VehicleGetMoveInfoSize(VehicleTrackSubposition trackSubposition, track_ { return 0; } - return gTrackVehicleInfo[static_cast(trackSubposition)][typeAndDirection]->size; + return gTrackVehicleInfo[EnumValue(trackSubposition)][typeAndDirection]->size; } uint16_t Vehicle::GetTrackProgress() const diff --git a/src/openrct2/world/Climate.cpp b/src/openrct2/world/Climate.cpp index 951ec39d58..469a9b5f86 100644 --- a/src/openrct2/world/Climate.cpp +++ b/src/openrct2/world/Climate.cpp @@ -91,7 +91,7 @@ void ClimateReset(ClimateType climate) auto& gameState = GetGameState(); auto weather = WeatherType::PartiallyCloudy; int32_t month = GetDate().GetMonth(); - const WeatherTransition* transition = &ClimateTransitions[static_cast(climate)][month]; + const WeatherTransition* transition = &ClimateTransitions[EnumValue(climate)][month]; const WeatherState* weatherState = &ClimateWeatherData[EnumValue(weather)]; gameState.Climate = climate; @@ -202,7 +202,7 @@ void ClimateForceWeather(WeatherType weather) { auto& gameState = GetGameState(); int32_t month = GetDate().GetMonth(); - const WeatherTransition* transition = &ClimateTransitions[static_cast(gameState.Climate)][month]; + const WeatherTransition* transition = &ClimateTransitions[EnumValue(gameState.Climate)][month]; const auto weatherState = &ClimateWeatherData[EnumValue(weather)]; gameState.ClimateCurrent.Weather = weather; @@ -306,7 +306,7 @@ static void ClimateDetermineFutureWeather(int32_t randomDistribution) // Generate a random variable with values 0 up to DistributionSize-1 and chose weather from the distribution table // accordingly - const WeatherTransition* transition = &ClimateTransitions[static_cast(gameState.Climate)][month]; + const WeatherTransition* transition = &ClimateTransitions[EnumValue(gameState.Climate)][month]; WeatherType nextWeather = (transition->Distribution[((randomDistribution & 0xFF) * transition->DistributionSize) >> 8]); gameState.ClimateNext.Weather = nextWeather; From 3247d16ed8566010d9fb7ec187fed581f402fa59 Mon Sep 17 00:00:00 2001 From: Harry-Hopkinson Date: Mon, 4 Mar 2024 19:21:12 +0000 Subject: [PATCH 013/191] Replace size_t's with EnumValue --- src/openrct2-ui/windows/Map.cpp | 4 +-- src/openrct2-ui/windows/Ride.cpp | 4 +-- src/openrct2/PlatformEnvironment.cpp | 41 +++++++++++++--------------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index c46c7123c0..e4fe618391 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1204,7 +1204,7 @@ private: if (targetRide != nullptr) { const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; - colourA = RideKeyColours[static_cast(colourKey)]; + colourA = RideKeyColours[EnumValue(colourKey)]; } break; } @@ -1214,7 +1214,7 @@ private: if (targetRide != nullptr) { const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; - colourA = RideKeyColours[static_cast(colourKey)]; + colourA = RideKeyColours[EnumValue(colourKey)]; } break; diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e32383e0de..333cf304a4 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -2401,11 +2401,11 @@ private: if (ride->type == RIDE_TYPE_MINI_GOLF) return STR_EMPTY; - auto stringId = VehicleStatusNames[static_cast(vehicle->status)]; + auto stringId = VehicleStatusNames[EnumValue(vehicle->status)]; if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SINGLE_SESSION) && vehicle->status <= Vehicle::Status::UnloadingPassengers) { - stringId = SingleSessionVehicleStatusNames[static_cast(vehicle->status)]; + stringId = SingleSessionVehicleStatusNames[EnumValue(vehicle->status)]; } ft.Add(stringId); diff --git a/src/openrct2/PlatformEnvironment.cpp b/src/openrct2/PlatformEnvironment.cpp index 44b8f1ade9..025695715a 100644 --- a/src/openrct2/PlatformEnvironment.cpp +++ b/src/openrct2/PlatformEnvironment.cpp @@ -94,7 +94,7 @@ public: u8string GetDirectoryPath(DIRBASE base) const override { - return _basePath[static_cast(base)]; + return _basePath[EnumValue(base)]; } u8string GetDirectoryPath(DIRBASE base, DIRID did) const override @@ -105,15 +105,15 @@ public: { default: case DIRBASE::RCT1: - directoryName = DirectoryNamesRCT2[static_cast(did)]; + directoryName = DirectoryNamesRCT2[EnumValue(did)]; break; case DIRBASE::RCT2: - directoryName = _usingRCTClassic ? "Assets" : DirectoryNamesRCT2[static_cast(did)]; + directoryName = _usingRCTClassic ? "Assets" : DirectoryNamesRCT2[EnumValue(did)]; break; case DIRBASE::OPENRCT2: case DIRBASE::USER: case DIRBASE::CONFIG: - directoryName = DirectoryNamesOpenRCT2[static_cast(did)]; + directoryName = DirectoryNamesOpenRCT2[EnumValue(did)]; break; } @@ -124,7 +124,7 @@ public: { auto dirbase = GetDefaultBaseDirectory(pathid); auto basePath = GetDirectoryPath(dirbase); - auto fileName = FileNames[static_cast(pathid)]; + auto fileName = FileNames[EnumValue(pathid)]; return Path::Combine(basePath, fileName); } @@ -161,7 +161,7 @@ public: void SetBasePath(DIRBASE base, u8string_view path) override { - _basePath[static_cast(base)] = path; + _basePath[EnumValue(base)] = path; if (base == DIRBASE::RCT2) { @@ -223,38 +223,35 @@ std::unique_ptr OpenRCT2::CreatePlatformEnvironment() // Set default paths std::string basePaths[DIRBASE_COUNT]; - basePaths[static_cast(DIRBASE::OPENRCT2)] = Platform::GetInstallPath(); - basePaths[static_cast(DIRBASE::USER)] = Path::Combine( - Platform::GetFolderPath(SPECIAL_FOLDER::USER_DATA), subDirectory); - basePaths[static_cast(DIRBASE::CONFIG)] = Path::Combine( - Platform::GetFolderPath(SPECIAL_FOLDER::USER_CONFIG), subDirectory); - basePaths[static_cast(DIRBASE::CACHE)] = Path::Combine( - Platform::GetFolderPath(SPECIAL_FOLDER::USER_CACHE), subDirectory); - basePaths[static_cast(DIRBASE::DOCUMENTATION)] = Platform::GetDocsPath(); + 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); + basePaths[EnumValue(DIRBASE::CACHE)] = Path::Combine(Platform::GetFolderPath(SPECIAL_FOLDER::USER_CACHE), subDirectory); + basePaths[EnumValue(DIRBASE::DOCUMENTATION)] = Platform::GetDocsPath(); // Override paths that have been specified via the command line if (!gCustomRCT1DataPath.empty()) { - basePaths[static_cast(DIRBASE::RCT1)] = gCustomRCT1DataPath; + basePaths[EnumValue(DIRBASE::RCT1)] = gCustomRCT1DataPath; } if (!gCustomRCT2DataPath.empty()) { - basePaths[static_cast(DIRBASE::RCT2)] = gCustomRCT2DataPath; + basePaths[EnumValue(DIRBASE::RCT2)] = gCustomRCT2DataPath; } if (!gCustomOpenRCT2DataPath.empty()) { - basePaths[static_cast(DIRBASE::OPENRCT2)] = gCustomOpenRCT2DataPath; + basePaths[EnumValue(DIRBASE::OPENRCT2)] = gCustomOpenRCT2DataPath; } if (!gCustomUserDataPath.empty()) { - basePaths[static_cast(DIRBASE::USER)] = gCustomUserDataPath; - basePaths[static_cast(DIRBASE::CONFIG)] = gCustomUserDataPath; - basePaths[static_cast(DIRBASE::CACHE)] = gCustomUserDataPath; + basePaths[EnumValue(DIRBASE::USER)] = gCustomUserDataPath; + basePaths[EnumValue(DIRBASE::CONFIG)] = gCustomUserDataPath; + basePaths[EnumValue(DIRBASE::CACHE)] = gCustomUserDataPath; } - if (basePaths[static_cast(DIRBASE::DOCUMENTATION)].empty()) + if (basePaths[EnumValue(DIRBASE::DOCUMENTATION)].empty()) { - basePaths[static_cast(DIRBASE::DOCUMENTATION)] = basePaths[static_cast(DIRBASE::OPENRCT2)]; + basePaths[EnumValue(DIRBASE::DOCUMENTATION)] = basePaths[EnumValue(DIRBASE::OPENRCT2)]; } auto env = OpenRCT2::CreatePlatformEnvironment(basePaths); From 33a5ee2160dd1a957c7b276928cda46ab5cd59a0 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 5 Mar 2024 04:02:03 +0000 Subject: [PATCH 014/191] Merge Localisation/master into OpenRCT2/develop --- data/language/eo-ZZ.txt | 5 +++++ data/language/nl-NL.txt | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/data/language/eo-ZZ.txt b/data/language/eo-ZZ.txt index 078dbfb778..1ca70355c8 100644 --- a/data/language/eo-ZZ.txt +++ b/data/language/eo-ZZ.txt @@ -3686,6 +3686,11 @@ STR_6614 :Ne povas ŝanĝi enirpagon de parko STR_6615 :Trako sur ĉi tiu bloko bezonas akvon STR_6616 :Ago estas nevalida por tiu dungitotipo STR_6617 :Ne povas permuti blokelementon kun si mem +STR_6618 :Ne povas limigi aŭ mallimigi objekton… +STR_6619 :Objekotipo ne povas esti limigita! +STR_6620 :Objekto ne troviĝis! +STR_6621 :Limigi +STR_6622 :Limigi objekton al la Scenaroredaktilo kaj Provejo-reĝimo. ############# # Scenarios # diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 3ec708da80..0e6433134c 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -3685,6 +3685,11 @@ STR_6614 :Kan de toegangsprijs niet aanpassen STR_6615 :Dit baantype vereist water STR_6616 :Ongeldige actie voor dit type werknemer STR_6617 :Kan een kaartelement niet met zichzelf verwisselen +STR_6618 :Kan de beperkingen van dit object niet aanpassen… +STR_6619 :Dit objecttype kan niet worden beperkt! +STR_6620 :Object niet gevonden! +STR_6621 :Beperken +STR_6622 :Maakt het object enkel beschikbaar in de scenariobewerker en zandbakmodus. ############# # Scenarios # From 1a197af7155cb2ee250ae224973c484028a2bd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:34:21 +0200 Subject: [PATCH 015/191] Make ViewportPaint static, refactor TrackDesign to use ViewportRender --- src/openrct2/interface/Viewport.cpp | 4 +++- src/openrct2/interface/Viewport.h | 1 - src/openrct2/ride/TrackDesign.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 026cb67a09..345ee3d480 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -75,7 +75,9 @@ InteractionInfo::InteractionInfo(const PaintStruct* ps) , SpriteType(ps->InteractionItem) { } + static void ViewportPaintWeatherGloom(DrawPixelInfo& dpi); +static void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const ScreenRect& screenRect); /** * This is not a viewport function. It is used to setup many variables for @@ -891,7 +893,7 @@ static void ViewportPaintColumn(PaintSession& session) * edi: dpi * ebp: bottom */ -void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const ScreenRect& screenRect) +static void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const ScreenRect& screenRect) { PROFILED_FUNCTION(); diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index d206a672a8..74287b9198 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -137,7 +137,6 @@ void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep); void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff* peep); void ViewportUpdateSmartFollowVehicle(WindowBase* window); void ViewportRender(DrawPixelInfo& dpi, const Viewport* viewport, const ScreenRect& screenRect); -void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const ScreenRect& screenRect); CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index acba501d46..b571d7ce17 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2084,7 +2084,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) gCurrentRotation = i; view.viewPos = Translate3DTo2DWithZ(i, centre) - offset; - ViewportPaint(&view, dpi, { view.viewPos, view.viewPos + ScreenCoordsXY{ size_x, size_y } }); + ViewportRender(dpi, &view, { {}, ScreenCoordsXY{ size_x, size_y } }); dpi.bits += TRACK_PREVIEW_IMAGE_SIZE; } From 81499643db595fa5909f60d6c75940c26bd099b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:42:52 +0200 Subject: [PATCH 016/191] Rename unused field to Rotation --- src/openrct2/interface/Window.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 556292be1b..9d84d0bd0a 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -148,16 +148,16 @@ struct Widget */ struct Viewport { - int32_t width; - int32_t height; - ScreenCoordsXY pos; - ScreenCoordsXY viewPos; - int32_t view_width; - int32_t view_height; - uint32_t flags; - ZoomLevel zoom; - uint8_t var_11; - VisibilityCache visibility; + int32_t width{}; + int32_t height{}; + ScreenCoordsXY pos{}; + ScreenCoordsXY viewPos{}; + int32_t view_width{}; + int32_t view_height{}; + uint32_t flags{}; + ZoomLevel zoom{}; + uint8_t rotation{}; + VisibilityCache visibility{}; // Use this function on coordinates that are relative to the viewport zoom i.e. a peeps x, y position after transforming // from its x, y, z From 8864f6cf51133155d23a845664bdb2e5b40784d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:47:58 +0200 Subject: [PATCH 017/191] Add ViewportGetMain --- src/openrct2/interface/Viewport.cpp | 10 ++++++++++ src/openrct2/interface/Viewport.h | 1 + 2 files changed, 11 insertions(+) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 345ee3d480..a6e2382adb 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -229,6 +229,16 @@ void ViewportRemove(Viewport* viewport) _viewports.erase(it); } +Viewport* ViewportGetMain() +{ + auto mainWindow = WindowGetMain(); + if (mainWindow == nullptr) + { + return nullptr; + } + return mainWindow->viewport; +} + void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom) { for (auto& vp : _viewports) diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 74287b9198..70e6aacd34 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -129,6 +129,7 @@ void ViewportInitAll(); std::optional centre_2d_coordinates(const CoordsXYZ& loc, Viewport* viewport); void ViewportCreate(WindowBase* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus); void ViewportRemove(Viewport* viewport); +Viewport* ViewportGetMain(); void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom = ZoomLevel{ -1 }); void ViewportUpdatePosition(WindowBase* window); void ViewportUpdateFollowSprite(WindowBase* window); From 2661cf8772701d456e959889a461f25d0a963d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 02:57:33 +0200 Subject: [PATCH 018/191] Refactor out all uses of gCurrentRotation, remove gCurrentRotation --- src/openrct2-ui/WindowManager.cpp | 2 +- src/openrct2-ui/windows/Main.cpp | 2 +- src/openrct2/interface/Screenshot.cpp | 11 ++++------- src/openrct2/interface/Viewport.cpp | 10 +++++++--- src/openrct2/interface/Viewport.h | 2 -- src/openrct2/interface/Window.cpp | 2 +- src/openrct2/ride/TrackDesign.cpp | 3 +-- src/openrct2/world/Map.cpp | 3 --- 8 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 7e9e73d519..16466cb4a2 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -587,7 +587,7 @@ public: mainWindow->viewport_target_sprite = EntityId::GetNull(); mainWindow->savedViewPos = viewPos; viewport->zoom = zoom; - gCurrentRotation = rotation; + viewport->rotation = rotation; if (zoomDifference != ZoomLevel{ 0 }) { diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 6b3d414c17..3484275922 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -35,8 +35,8 @@ public: if (viewport != nullptr) { SetViewportFlags(); + viewport->rotation = 0; } - gCurrentRotation = 0; gShowGridLinesRefCount = 0; gShowLandRightsRefCount = 0; gShowConstructionRightsRefCount = 0; diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 56e27dcc61..3d6f2227b1 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -498,7 +498,7 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti auto zoom = ZoomLevel{ customZoom }; auto rotation = std::atoi(argv[4]) & 3; viewport = GetGiantViewport(rotation, zoom); - gCurrentRotation = rotation; + viewport.rotation = rotation; } else { @@ -554,7 +554,7 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti viewport.viewPos = { coords2d.x - ((viewport.view_width << customZoom) / 2), coords2d.y - ((viewport.view_height << customZoom) / 2) }; viewport.zoom = ZoomLevel{ static_cast(customZoom) }; - gCurrentRotation = customRotation; + viewport.rotation = customRotation; } else { @@ -562,7 +562,7 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti viewport.viewPos = { gameState.SavedView - ScreenCoordsXY{ (viewport.view_width / 2), (viewport.view_height / 2) } }; viewport.zoom = gameState.SavedViewZoom; - gCurrentRotation = gameState.SavedViewRotation; + viewport.rotation = gameState.SavedViewRotation; } } @@ -656,8 +656,7 @@ void CaptureImage(const CaptureOptions& options) viewport = GetGiantViewport(options.Rotation, options.Zoom); } - auto backupRotation = gCurrentRotation; - gCurrentRotation = options.Rotation; + viewport.rotation = options.Rotation; if (options.Transparent) { @@ -669,6 +668,4 @@ void CaptureImage(const CaptureOptions& options) RenderViewport(nullptr, viewport, dpi); WriteDpiToFile(outputPath, dpi, gPalette); ReleaseDPI(dpi); - - gCurrentRotation = backupRotation; } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index a6e2382adb..242d7fd643 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -65,8 +65,6 @@ Viewport* g_music_tracking_viewport; static std::unique_ptr _paintJobs; static std::vector _paintColumns; -uint8_t gCurrentRotation; - static uint32_t _currentImageType; InteractionInfo::InteractionInfo(const PaintStruct* ps) : Loc(ps->MapPos) @@ -2055,7 +2053,13 @@ std::optional ScreenGetMapXYSideWithZ(const ScreenCoordsXY& screenCoor */ uint8_t GetCurrentRotation() { - uint8_t rotation = gCurrentRotation; + auto* viewport = ViewportGetMain(); + if (viewport == nullptr) + { + LOG_ERROR("No viewport found! Will return 0."); + return 0; + } + uint8_t rotation = viewport->rotation; uint8_t rotation_masked = rotation & 3; #if defined(DEBUG_LEVEL_1) && DEBUG_LEVEL_1 if (rotation != rotation_masked) diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 70e6aacd34..7269c8c354 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -123,8 +123,6 @@ extern uint8_t gShowConstructionRightsRefCount; // rct2: 0x014234BC extern Viewport* g_music_tracking_viewport; -extern uint8_t gCurrentRotation; - void ViewportInitAll(); std::optional centre_2d_coordinates(const CoordsXYZ& loc, Viewport* viewport); void ViewportCreate(WindowBase* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 52dac802eb..787835eb75 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -933,7 +933,7 @@ void WindowRotateCamera(WindowBase& w, int32_t direction) coords.z = TileElementHeight(coords); } - gCurrentRotation = (GetCurrentRotation() + direction) & 3; + viewport->rotation = (viewport->rotation + direction) & 3; auto centreLoc = centre_2d_coordinates(coords, viewport); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index b571d7ce17..df37b689a5 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2081,9 +2081,8 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) const ScreenCoordsXY offset = { size_x / 2, size_y / 2 }; for (uint8_t i = 0; i < 4; i++) { - gCurrentRotation = i; - view.viewPos = Translate3DTo2DWithZ(i, centre) - offset; + view.rotation = i; ViewportRender(dpi, &view, { {}, ScreenCoordsXY{ size_x, size_y } }); dpi.bits += TRACK_PREVIEW_IMAGE_SIZE; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index cf0cff8579..a5f4066fef 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -111,7 +111,6 @@ static std::vector _tileElementsStash; static size_t _tileElementsInUse; static size_t _tileElementsInUseStash; static TileCoordsXY _mapSizeStash; -static int32_t _currentRotationStash; void StashMap() { @@ -119,7 +118,6 @@ void StashMap() _tileIndexStash = std::move(_tileIndex); _tileElementsStash = std::move(gameState.TileElements); _mapSizeStash = GetGameState().MapSize; - _currentRotationStash = gCurrentRotation; _tileElementsInUseStash = _tileElementsInUse; } @@ -129,7 +127,6 @@ void UnstashMap() _tileIndex = std::move(_tileIndexStash); gameState.TileElements = std::move(_tileElementsStash); GetGameState().MapSize = _mapSizeStash; - gCurrentRotation = _currentRotationStash; _tileElementsInUse = _tileElementsInUseStash; } From 98acdf37436de789038ecc217518b28a09bdb183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 03:13:04 +0200 Subject: [PATCH 019/191] Use the rotation from the Viewport where applicable --- src/openrct2-ui/scripting/ScViewport.hpp | 9 ++++-- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2/drawing/LightFX.cpp | 4 +-- src/openrct2/interface/Viewport.cpp | 32 ++++++++++---------- src/openrct2/interface/Window.cpp | 2 +- src/openrct2/paint/Paint.cpp | 15 ++++----- src/openrct2/paint/Paint.h | 2 +- src/openrct2/paint/Painter.cpp | 3 +- src/openrct2/paint/Painter.h | 2 +- 9 files changed, 39 insertions(+), 32 deletions(-) diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 6781c16e96..053c1f6ebe 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -111,7 +111,12 @@ namespace OpenRCT2::Scripting int32_t rotation_get() const { - return GetCurrentRotation(); + auto viewport = GetViewport(); + if (viewport != nullptr) + { + return viewport->rotation; + } + return 0; } void rotation_set(int32_t value) { @@ -120,7 +125,7 @@ namespace OpenRCT2::Scripting auto w = GetWindow(); if (w != nullptr) { - while (GetCurrentRotation() != value) + while (w->viewport->rotation != value) { WindowRotateCamera(*w, 1); } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index ec8a007811..446055c5a4 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2584,7 +2584,7 @@ private: TileElement tempSideTrackTileElement{ 0x80, 0x8F, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; TileElement tempTrackTileElement{}; TileElement* backupTileElementArrays[5]{}; - PaintSession* session = PaintSessionAlloc(dpi, 0); + PaintSession* session = PaintSessionAlloc(dpi, 0, GetCurrentRotation()); trackDirection &= 3; auto currentRide = GetRide(rideIndex); diff --git a/src/openrct2/drawing/LightFX.cpp b/src/openrct2/drawing/LightFX.cpp index c1ebd2ec05..73b8b3e58a 100644 --- a/src/openrct2/drawing/LightFX.cpp +++ b/src/openrct2/drawing/LightFX.cpp @@ -305,7 +305,7 @@ void LightFXPrepareLightList() dpi.zoom_level = _current_view_zoom_front; dpi.width = 1; - PaintSession* session = PaintSessionAlloc(dpi, w->viewport->flags); + PaintSession* session = PaintSessionAlloc(dpi, w->viewport->flags, w->viewport->rotation); PaintSessionGenerate(*session); PaintSessionArrange(*session); auto info = SetInteractionInfoFromPaintSession(session, w->viewport->flags, ViewportInteractionItemAll); @@ -437,7 +437,7 @@ void LightFXUpdateViewportSettings() Viewport* viewport = WindowGetViewport(mainWindow); _current_view_x_back = viewport->viewPos.x; _current_view_y_back = viewport->viewPos.y; - _current_view_rotation_back = GetCurrentRotation(); + _current_view_rotation_back = viewport->rotation; _current_view_zoom_back = viewport->zoom; } } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 242d7fd643..13d7e0aeaf 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -122,7 +122,7 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, Viewpo return std::nullopt; } - auto screenCoord = Translate3DTo2DWithZ(GetCurrentRotation(), loc); + auto screenCoord = Translate3DTo2DWithZ(viewport->rotation, loc); screenCoord.x -= viewport->view_width / 2; screenCoord.y -= viewport->view_height / 2; return { screenCoord }; @@ -962,7 +962,7 @@ static void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const Sc // Generate and sort columns. for (x = alignedX; x < rightBorder; x += 32) { - PaintSession* session = PaintSessionAlloc(dpi1, viewFlags); + PaintSession* session = PaintSessionAlloc(dpi1, viewFlags, viewport->rotation); _paintColumns.push_back(session); DrawPixelInfo& dpi2 = session->DPI; @@ -1829,31 +1829,31 @@ InteractionInfo GetMapCoordinatesFromPosWindow(WindowBase* window, const ScreenC return info; } - Viewport* myviewport = window->viewport; + Viewport* viewport = window->viewport; auto viewLoc = screenCoords; - viewLoc -= myviewport->pos; - if (viewLoc.x >= 0 && viewLoc.x < static_cast(myviewport->width) && viewLoc.y >= 0 - && viewLoc.y < static_cast(myviewport->height)) + viewLoc -= viewport->pos; + if (viewLoc.x >= 0 && viewLoc.x < static_cast(viewport->width) && viewLoc.y >= 0 + && viewLoc.y < static_cast(viewport->height)) { - viewLoc.x = myviewport->zoom.ApplyTo(viewLoc.x); - viewLoc.y = myviewport->zoom.ApplyTo(viewLoc.y); - viewLoc += myviewport->viewPos; - if (myviewport->zoom > ZoomLevel{ 0 }) + viewLoc.x = viewport->zoom.ApplyTo(viewLoc.x); + viewLoc.y = viewport->zoom.ApplyTo(viewLoc.y); + viewLoc += viewport->viewPos; + if (viewport->zoom > ZoomLevel{ 0 }) { - viewLoc.x &= myviewport->zoom.ApplyTo(0xFFFFFFFF) & 0xFFFFFFFF; - viewLoc.y &= myviewport->zoom.ApplyTo(0xFFFFFFFF) & 0xFFFFFFFF; + viewLoc.x &= viewport->zoom.ApplyTo(0xFFFFFFFF) & 0xFFFFFFFF; + viewLoc.y &= viewport->zoom.ApplyTo(0xFFFFFFFF) & 0xFFFFFFFF; } DrawPixelInfo dpi; dpi.x = viewLoc.x; dpi.y = viewLoc.y; dpi.height = 1; - dpi.zoom_level = myviewport->zoom; + dpi.zoom_level = viewport->zoom; dpi.width = 1; - PaintSession* session = PaintSessionAlloc(dpi, myviewport->flags); + PaintSession* session = PaintSessionAlloc(dpi, viewport->flags, viewport->rotation); PaintSessionGenerate(*session); PaintSessionArrange(*session); - info = SetInteractionInfoFromPaintSession(session, myviewport->flags, flags & 0xFFFF); + info = SetInteractionInfoFromPaintSession(session, viewport->flags, flags & 0xFFFF); PaintSessionFree(session); } return info; @@ -2097,7 +2097,7 @@ void ViewportSetSavedView() gameState.SavedView = ScreenCoordsXY{ viewport->view_width / 2, viewport->view_height / 2 } + viewport->viewPos; gameState.SavedViewZoom = viewport->zoom; - gameState.SavedViewRotation = GetCurrentRotation(); + gameState.SavedViewRotation = viewport->rotation; } } diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 787835eb75..a2e95b7f9d 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -836,7 +836,7 @@ void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords) } } - auto screenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), coords); + auto screenCoords = Translate3DTo2DWithZ(w.viewport->rotation, coords); int32_t i = 0; if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 714f203fea..e556870997 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -55,7 +55,7 @@ bool gPaintBoundingBoxes; bool gPaintBlockedTiles; static void PaintAttachedPS(DrawPixelInfo& dpi, PaintStruct* ps, uint32_t viewFlags); -static void PaintPSImageWithBoundingBoxes(DrawPixelInfo& dpi, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y); +static void PaintPSImageWithBoundingBoxes(PaintSession& session, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y); static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uint32_t viewFlags); static int32_t RemapPositionToQuadrant(const PaintStruct& ps, uint8_t rotation) @@ -243,7 +243,6 @@ template void PaintSessionGenerateRotate(PaintSession& sessio */ void PaintSessionGenerate(PaintSession& session) { - session.CurrentRotation = GetCurrentRotation(); switch (DirectionFlipXAxis(session.CurrentRotation)) { case 0: @@ -533,7 +532,7 @@ static void PaintDrawStruct(PaintSession& session, PaintStruct* ps) auto imageId = PaintPSColourifyImage(ps, ps->image_id, session.ViewFlags); if (gPaintBoundingBoxes && session.DPI.zoom_level == ZoomLevel{ 0 }) { - PaintPSImageWithBoundingBoxes(session.DPI, ps, imageId, screenPos.x, screenPos.y); + PaintPSImageWithBoundingBoxes(session, ps, imageId, screenPos.x, screenPos.y); } else { @@ -588,10 +587,12 @@ static void PaintAttachedPS(DrawPixelInfo& dpi, PaintStruct* ps, uint32_t viewFl } } -static void PaintPSImageWithBoundingBoxes(DrawPixelInfo& dpi, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y) +static void PaintPSImageWithBoundingBoxes(PaintSession& session, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y) { + auto& dpi = session.DPI; + const uint8_t colour = BoundBoxDebugColours[EnumValue(ps->InteractionItem)]; - const uint8_t rotation = GetCurrentRotation(); + const uint8_t rotation = session.CurrentRotation; const CoordsXYZ frontTop = { ps->Bounds.x_end, @@ -688,9 +689,9 @@ static ImageId PaintPSColourifyImage(const PaintStruct* ps, ImageId imageId, uin } } -PaintSession* PaintSessionAlloc(DrawPixelInfo& dpi, uint32_t viewFlags) +PaintSession* PaintSessionAlloc(DrawPixelInfo& dpi, uint32_t viewFlags, uint8_t rotation) { - return GetContext()->GetPainter()->CreateSession(dpi, viewFlags); + return GetContext()->GetPainter()->CreateSession(dpi, viewFlags, rotation); } void PaintSessionFree(PaintSession* session) diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 7248fe134c..3bd4dc19e8 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -338,7 +338,7 @@ void PaintFloatingMoneyEffect( PaintSession& session, money64 amount, StringId string_id, int32_t y, int32_t z, int8_t y_offsets[], int32_t offset_x, uint32_t rotation); -PaintSession* PaintSessionAlloc(DrawPixelInfo& dpi, uint32_t viewFlags); +PaintSession* PaintSessionAlloc(DrawPixelInfo& dpi, uint32_t viewFlags, uint8_t rotation); void PaintSessionFree(PaintSession* session); void PaintSessionGenerate(PaintSession& session); void PaintSessionArrange(PaintSessionCore& session); diff --git a/src/openrct2/paint/Painter.cpp b/src/openrct2/paint/Painter.cpp index 1240a9270b..d91d24d94a 100644 --- a/src/openrct2/paint/Painter.cpp +++ b/src/openrct2/paint/Painter.cpp @@ -133,7 +133,7 @@ void Painter::MeasureFPS() _lastSecond = currentTime; } -PaintSession* Painter::CreateSession(DrawPixelInfo& dpi, uint32_t viewFlags) +PaintSession* Painter::CreateSession(DrawPixelInfo& dpi, uint32_t viewFlags, uint8_t rotation) { PROFILED_FUNCTION(); @@ -160,6 +160,7 @@ PaintSession* Painter::CreateSession(DrawPixelInfo& dpi, uint32_t viewFlags) session->QuadrantFrontIndex = 0; session->PaintEntryChain = _paintStructPool.Create(); session->Flags = 0; + session->CurrentRotation = rotation; std::fill(std::begin(session->Quadrants), std::end(session->Quadrants), nullptr); session->PaintHead = nullptr; diff --git a/src/openrct2/paint/Painter.h b/src/openrct2/paint/Painter.h index 7f51f6558e..54a119fd0c 100644 --- a/src/openrct2/paint/Painter.h +++ b/src/openrct2/paint/Painter.h @@ -47,7 +47,7 @@ namespace OpenRCT2 explicit Painter(const std::shared_ptr& uiContext); void Paint(Drawing::IDrawingEngine& de); - PaintSession* CreateSession(DrawPixelInfo& dpi, uint32_t viewFlags); + PaintSession* CreateSession(DrawPixelInfo& dpi, uint32_t viewFlags, uint8_t rotation); void ReleaseSession(PaintSession* session); ~Painter(); From afe266e2fe568fef8dcb23233036e9f444313505 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 03:30:49 +0200 Subject: [PATCH 020/191] Recalculate the screen position for entities when painting --- src/openrct2/paint/Paint.Entity.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/openrct2/paint/Paint.Entity.cpp b/src/openrct2/paint/Paint.Entity.cpp index be86e4e3a5..a1b351119c 100644 --- a/src/openrct2/paint/Paint.Entity.cpp +++ b/src/openrct2/paint/Paint.Entity.cpp @@ -94,10 +94,15 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos) } } - if (session.DPI.y + session.DPI.height <= spr->SpriteData.SpriteRect.GetTop() - || spr->SpriteData.SpriteRect.GetBottom() <= session.DPI.y - || session.DPI.x + session.DPI.width <= spr->SpriteData.SpriteRect.GetLeft() - || spr->SpriteData.SpriteRect.GetRight() <= session.DPI.x) + auto screenCoords = Translate3DTo2DWithZ(session.CurrentRotation, spr->GetLocation()); + auto spriteRect = ScreenRect( + screenCoords - ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMin }, + screenCoords + ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMax }); + + if (session.DPI.y + session.DPI.height <= spriteRect.GetTop() + || spriteRect.GetBottom() <= session.DPI.y + || session.DPI.x + session.DPI.width <= spriteRect.GetLeft() + || spriteRect.GetRight() <= session.DPI.x) { continue; } From 87dd29f3bce090446f5362a2cd2225783ecc927f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:43:58 +0200 Subject: [PATCH 021/191] Make GetClosestPeep static --- src/openrct2-ui/interface/ViewportInteraction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 7d3acc3c3d..4fee4d686a 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -718,7 +718,7 @@ struct PeepDistance }; template -PeepDistance GetClosestPeep(const ScreenCoordsXY& viewportCoords, const int32_t maxDistance, PeepDistance goal) +static PeepDistance GetClosestPeep(const ScreenCoordsXY& viewportCoords, const int32_t maxDistance, PeepDistance goal) { for (auto peep : EntityList()) { From 1a7b87325620ecf2cccc5a3b93985a2741031800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:46:17 +0200 Subject: [PATCH 022/191] Fix ViewportInteractionGetClosestPeep not using the right rotation --- .../interface/ViewportInteraction.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 4fee4d686a..276b2c9830 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -718,16 +718,21 @@ struct PeepDistance }; template -static PeepDistance GetClosestPeep(const ScreenCoordsXY& viewportCoords, const int32_t maxDistance, PeepDistance goal) +static PeepDistance GetClosestPeep( + const ScreenCoordsXY& viewportCoords, uint8_t rotation, const int32_t maxDistance, PeepDistance goal) { for (auto peep : EntityList()) { if (peep->x == LOCATION_NULL) continue; - auto distance = abs(((peep->SpriteData.SpriteRect.GetLeft() + peep->SpriteData.SpriteRect.GetRight()) / 2) - - viewportCoords.x) - + abs(((peep->SpriteData.SpriteRect.GetTop() + peep->SpriteData.SpriteRect.GetBottom()) / 2) - viewportCoords.y); + auto screenCoords = Translate3DTo2DWithZ(rotation, peep->GetLocation()); + auto spriteRect = ScreenRect( + screenCoords - ScreenCoordsXY{ peep->SpriteData.Width, peep->SpriteData.HeightMin }, + screenCoords + ScreenCoordsXY{ peep->SpriteData.Width, peep->SpriteData.HeightMax }); + + auto distance = abs(((spriteRect.GetLeft() + spriteRect.GetRight()) / 2) - viewportCoords.x) + + abs(((spriteRect.GetTop() + spriteRect.GetBottom()) / 2) - viewportCoords.y); if (distance > maxDistance) continue; @@ -754,9 +759,9 @@ static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int3 PeepDistance goal; if (!(viewport->flags & VIEWPORT_FLAG_HIDE_GUESTS)) - goal = GetClosestPeep(viewportCoords, maxDistance, goal); + goal = GetClosestPeep(viewportCoords, viewport->rotation, maxDistance, goal); if (!(viewport->flags & VIEWPORT_FLAG_HIDE_STAFF)) - goal = GetClosestPeep(viewportCoords, maxDistance, goal); + goal = GetClosestPeep(viewportCoords, viewport->rotation, maxDistance, goal); return goal.peep; } From 7be082caccf9e5219e5abfc4a3164341961b6bc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:50:06 +0200 Subject: [PATCH 023/191] Fix ViewportAdjustForMapHeight not using the correct rotation --- src/openrct2/interface/Viewport.cpp | 3 +-- src/openrct2/interface/Viewport.h | 2 +- src/openrct2/interface/Window.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 13d7e0aeaf..bfaac7f70d 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -254,11 +254,10 @@ void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom) * edx is assumed to be (and always is) the current rotation, so it is not * needed as parameter. */ -CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords) +CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords, uint8_t rotation) { int32_t height = 0; - uint32_t rotation = GetCurrentRotation(); CoordsXY pos{}; for (int32_t i = 0; i < 6; i++) { diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 7269c8c354..76ce230286 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -137,7 +137,7 @@ void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff* peep); void ViewportUpdateSmartFollowVehicle(WindowBase* window); void ViewportRender(DrawPixelInfo& dpi, const Viewport* viewport, const ScreenRect& screenRect); -CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords); +CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords, uint8_t rotation); CoordsXY ViewportPosToMapPos(const ScreenCoordsXY& coords, int32_t z); std::optional ScreenPosToMapPos(const ScreenCoordsXY& screenCoords, int32_t* direction); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index a2e95b7f9d..4067a38ed6 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -924,7 +924,7 @@ void WindowRotateCamera(WindowBase& w, int32_t direction) { auto viewPos = ScreenCoordsXY{ (viewport->view_width >> 1), (viewport->view_height >> 1) } + viewport->viewPos; - coords = ViewportAdjustForMapHeight(viewPos); + coords = ViewportAdjustForMapHeight(viewPos, viewport->rotation); } else { @@ -957,7 +957,7 @@ void WindowViewportGetMapCoordsByCursor( // Compute map coordinate by mouse position. auto viewportPos = w.viewport->ScreenToViewportCoord(mouseCoords); - auto coordsXYZ = ViewportAdjustForMapHeight(viewportPos); + auto coordsXYZ = ViewportAdjustForMapHeight(viewportPos, w.viewport->rotation); auto mapCoords = ViewportPosToMapPos(viewportPos, coordsXYZ.z); *map_x = mapCoords.x; *map_y = mapCoords.y; From a33cc1ac86dc92647e60930ad1a43ec56fe0f4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 14:52:24 +0200 Subject: [PATCH 024/191] Fix ScViewport::moveTo not using the right rotation --- src/openrct2-ui/scripting/ScViewport.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 053c1f6ebe..a7e2145598 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -208,7 +208,7 @@ namespace OpenRCT2::Scripting auto coords = GetCoordsFromObject(position); if (coords) { - auto screenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), *coords); + auto screenCoords = Translate3DTo2DWithZ(viewport->rotation, *coords); auto left = screenCoords.x - (viewport->view_width / 2); auto top = screenCoords.y - (viewport->view_height / 2); SetViewLeftTop(left, top); From d95f14dcdadf262bb3f8a4482bd286a940761e0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 15:04:46 +0200 Subject: [PATCH 025/191] Fix ViewportPosToMapPos using the wrong rotation --- src/openrct2-ui/input/MouseInput.cpp | 4 ++-- src/openrct2-ui/interface/ViewportInteraction.cpp | 2 +- src/openrct2-ui/scripting/ScViewport.hpp | 2 +- src/openrct2/interface/Viewport.cpp | 10 +++++----- src/openrct2/interface/Viewport.h | 2 +- src/openrct2/interface/Window.cpp | 2 +- src/openrct2/world/Footpath.cpp | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 80aaa68cbf..2f9eb1915a 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1688,8 +1688,8 @@ void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords) int32_t y = mainWindow->savedViewPos.y + viewport->view_height / 2; int32_t y_dy = mainWindow->savedViewPos.y + viewport->view_height / 2 + dy; - auto mapCoord = ViewportPosToMapPos({ x, y }, 0); - auto mapCoord_dy = ViewportPosToMapPos({ x, y_dy }, 0); + auto mapCoord = ViewportPosToMapPos({ x, y }, 0, viewport->rotation); + auto mapCoord_dy = ViewportPosToMapPos({ x, y_dy }, 0, viewport->rotation); // Check if we're crossing the boundary // Clamp to the map minimum value diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 276b2c9830..b73668644b 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -805,7 +805,7 @@ CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoo { z = TileElementHeight(mapPos); } - mapPos = ViewportPosToMapPos(initialVPPos, z); + mapPos = ViewportPosToMapPos(initialVPPos, z, viewport->rotation); mapPos.x = std::clamp(mapPos.x, initialPos.x, initialPos.x + 31); mapPos.y = std::clamp(mapPos.y, initialPos.y, initialPos.y + 31); } diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index a7e2145598..0ef551313a 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -184,7 +184,7 @@ namespace OpenRCT2::Scripting if (viewport != nullptr) { auto centre = viewport->viewPos + ScreenCoordsXY{ viewport->view_width / 2, viewport->view_height / 2 }; - auto coords = ViewportPosToMapPos(centre, 24); + auto coords = ViewportPosToMapPos(centre, 24, viewport->rotation); auto ctx = GetContext()->GetScriptEngine().GetContext(); auto obj = duk_push_object(ctx); diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index bfaac7f70d..d211443826 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -261,7 +261,7 @@ CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords, uint8_t CoordsXY pos{}; for (int32_t i = 0; i < 6; i++) { - pos = ViewportPosToMapPos(startCoords, height); + pos = ViewportPosToMapPos(startCoords, height, rotation); height = TileElementHeight(pos); // HACK: This is to prevent the x and y values being set to values outside @@ -596,7 +596,7 @@ void ViewportUpdatePosition(WindowBase* window) auto viewportMidPoint = ScreenCoordsXY{ window->savedViewPos.x + viewport->view_width / 2, window->savedViewPos.y + viewport->view_height / 2 }; - auto mapCoord = ViewportPosToMapPos(viewportMidPoint, 0); + auto mapCoord = ViewportPosToMapPos(viewportMidPoint, 0, viewport->rotation); // Clamp to the map minimum value int32_t at_map_edge = 0; @@ -1100,11 +1100,11 @@ void Viewport::Invalidate() const ViewportInvalidate(this, { viewPos, viewPos + ScreenCoordsXY{ view_width, view_height } }); } -CoordsXY ViewportPosToMapPos(const ScreenCoordsXY& coords, int32_t z) +CoordsXY ViewportPosToMapPos(const ScreenCoordsXY& coords, int32_t z, uint8_t rotation) { // Reverse of Translate3DTo2DWithZ CoordsXY ret = { coords.y - coords.x / 2 + z, coords.y + coords.x / 2 + z }; - auto inverseRotation = DirectionFlipXAxis(GetCurrentRotation()); + auto inverseRotation = DirectionFlipXAxis(rotation); return ret.Rotate(inverseRotation); } @@ -1953,7 +1953,7 @@ std::optional ScreenGetMapXY(const ScreenCoordsXY& screenCoords, Viewp for (int32_t i = 0; i < 5; i++) { int32_t z = TileElementHeight(cursorMapPos); - cursorMapPos = ViewportPosToMapPos(start_vp_pos, z); + cursorMapPos = ViewportPosToMapPos(start_vp_pos, z, myViewport->rotation); cursorMapPos.x = std::clamp(cursorMapPos.x, info.Loc.x, info.Loc.x + 31); cursorMapPos.y = std::clamp(cursorMapPos.y, info.Loc.y, info.Loc.y + 31); } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 76ce230286..3d52d87265 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -139,7 +139,7 @@ void ViewportRender(DrawPixelInfo& dpi, const Viewport* viewport, const ScreenRe CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords, uint8_t rotation); -CoordsXY ViewportPosToMapPos(const ScreenCoordsXY& coords, int32_t z); +CoordsXY ViewportPosToMapPos(const ScreenCoordsXY& coords, int32_t z, uint8_t rotation); std::optional ScreenPosToMapPos(const ScreenCoordsXY& screenCoords, int32_t* direction); void ShowGridlines(); diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 4067a38ed6..afe5165230 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -958,7 +958,7 @@ void WindowViewportGetMapCoordsByCursor( // Compute map coordinate by mouse position. auto viewportPos = w.viewport->ScreenToViewportCoord(mouseCoords); auto coordsXYZ = ViewportAdjustForMapHeight(viewportPos, w.viewport->rotation); - auto mapCoords = ViewportPosToMapPos(viewportPos, coordsXYZ.z); + auto mapCoords = ViewportPosToMapPos(viewportPos, coordsXYZ.z, w.viewport->rotation); *map_x = mapCoords.x; *map_y = mapCoords.y; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index 9902003726..c54adceb7f 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -289,7 +289,7 @@ CoordsXY FootpathGetCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int32 { z = TileElementHeight(position); } - position = ViewportPosToMapPos(start_vp_pos, z); + position = ViewportPosToMapPos(start_vp_pos, z, viewport->rotation); position.x = std::clamp(position.x, minPosition.x, maxPosition.x); position.y = std::clamp(position.y, minPosition.y, maxPosition.y); } From 462bb33234540b1a2ea101820ba544028234ff83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 17:07:11 +0200 Subject: [PATCH 026/191] Refactor viewport rotation to keep it in sync with the primary viewport --- src/openrct2-ui/input/Shortcuts.cpp | 6 +- src/openrct2-ui/scripting/ScViewport.hpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 18 ++---- src/openrct2/interface/InteractiveConsole.cpp | 5 +- src/openrct2/interface/Viewport.cpp | 56 ++++++++++++++++++- src/openrct2/interface/Viewport.h | 2 + src/openrct2/title/Command/RotateView.cpp | 9 +-- 7 files changed, 70 insertions(+), 28 deletions(-) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index daef77393d..8081c03527 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -62,11 +62,7 @@ static void RotateCamera(int32_t direction) { if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { - auto window = WindowGetMain(); - if (window != nullptr) - { - WindowRotateCamera(*window, direction); - } + ViewportRotateAll(direction); } } diff --git a/src/openrct2-ui/scripting/ScViewport.hpp b/src/openrct2-ui/scripting/ScViewport.hpp index 0ef551313a..828e9639fe 100644 --- a/src/openrct2-ui/scripting/ScViewport.hpp +++ b/src/openrct2-ui/scripting/ScViewport.hpp @@ -127,7 +127,7 @@ namespace OpenRCT2::Scripting { while (w->viewport->rotation != value) { - WindowRotateCamera(*w, 1); + ViewportRotateSingle(w, 1); } } } diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 2cc73bac57..0abd720470 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -3689,19 +3689,13 @@ void TopToolbar::InitRotateMenu(Widget& widget) void TopToolbar::RotateMenuDropdown(int16_t dropdownIndex) { - auto* w = WindowGetMain(); - if (w != nullptr) + if (dropdownIndex == 0) { - if (dropdownIndex == 0) - { - WindowRotateCamera(*w, 1); - w->Invalidate(); - } - else if (dropdownIndex == 1) - { - WindowRotateCamera(*w, -1); - w->Invalidate(); - } + ViewportRotateAll(1); + } + else if (dropdownIndex == 1) + { + ViewportRotateAll(-1); } } diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 9013e739c4..5c2636e3eb 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -1166,15 +1166,14 @@ static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t& else if (argv[0] == "current_rotation" && InvalidArguments(&invalidArgs, int_valid[0])) { uint8_t currentRotation = GetCurrentRotation(); - WindowBase* mainWindow = WindowGetMain(); int32_t newRotation = int_val[0]; if (newRotation < 0 || newRotation > 3) { console.WriteLineError("Invalid argument. Valid rotations are 0-3."); } - else if (newRotation != currentRotation && mainWindow != nullptr) + else if (newRotation != currentRotation) { - WindowRotateCamera(*mainWindow, newRotation - currentRotation); + ViewportRotateAll(newRotation - currentRotation); } console.Execute("get current_rotation"); } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index d211443826..0ef86b2e50 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -802,6 +802,60 @@ void ViewportUpdateSmartFollowVehicle(WindowBase* window) window->viewport_target_sprite = window->viewport_smart_follow_sprite; } +static void ViewportRotateSingleInternal(WindowBase& w, int32_t direction) +{ + auto* viewport = w.viewport; + if (viewport == nullptr) + return; + + auto windowPos = ScreenCoordsXY{ (viewport->width >> 1), (viewport->height >> 1) } + viewport->pos; + + // has something to do with checking if middle of the viewport is obstructed + Viewport* other; + auto mapXYCoords = ScreenGetMapXY(windowPos, &other); + CoordsXYZ coords{}; + + // other != viewport probably triggers on viewports in ride or guest window? + // naoXYCoords is nullopt if middle of viewport is obstructed by another window? + if (!mapXYCoords.has_value() || other != viewport) + { + auto viewPos = ScreenCoordsXY{ (viewport->view_width >> 1), (viewport->view_height >> 1) } + viewport->viewPos; + + coords = ViewportAdjustForMapHeight(viewPos, viewport->rotation); + } + else + { + coords.x = mapXYCoords->x; + coords.y = mapXYCoords->y; + coords.z = TileElementHeight(coords); + } + + viewport->rotation = (viewport->rotation + direction) & 3; + + auto centreLoc = centre_2d_coordinates(coords, viewport); + + if (centreLoc.has_value()) + { + w.savedViewPos = centreLoc.value(); + viewport->viewPos = *centreLoc; + } + + w.Invalidate(); + WindowEventViewportRotateCall(&w); +} + +void ViewportRotateSingle(WindowBase* window, int32_t direction) +{ + ViewportRotateSingleInternal(*window, direction); + ResetAllSpriteQuadrantPlacements(); +} + +void ViewportRotateAll(int32_t direction) +{ + WindowVisitEach([direction](WindowBase* w) { ViewportRotateSingleInternal(*w, direction); }); + ResetAllSpriteQuadrantPlacements(); +} + /** * * rct2: 0x00685C02 @@ -1977,7 +2031,7 @@ std::optional ScreenGetMapXYWithZ(const ScreenCoordsXY& screenCoords, } auto vpCoords = viewport->ScreenToViewportCoord(screenCoords); - auto mapPosition = ViewportPosToMapPos(vpCoords, z); + auto mapPosition = ViewportPosToMapPos(vpCoords, z, viewport->rotation); if (!MapIsLocationValid(mapPosition)) { return std::nullopt; diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 3d52d87265..7420fd4fe7 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -135,6 +135,8 @@ void ViewportUpdateSmartFollowEntity(WindowBase* window); void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep); void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff* peep); void ViewportUpdateSmartFollowVehicle(WindowBase* window); +void ViewportRotateSingle(WindowBase* window, int32_t direction); +void ViewportRotateAll(int32_t direction); void ViewportRender(DrawPixelInfo& dpi, const Viewport* viewport, const ScreenRect& screenRect); CoordsXYZ ViewportAdjustForMapHeight(const ScreenCoordsXY& startCoords, uint8_t rotation); diff --git a/src/openrct2/title/Command/RotateView.cpp b/src/openrct2/title/Command/RotateView.cpp index a4e6ac7263..b49cf5b313 100644 --- a/src/openrct2/title/Command/RotateView.cpp +++ b/src/openrct2/title/Command/RotateView.cpp @@ -9,19 +9,16 @@ #include "RotateView.h" +#include "../../interface/Viewport.h" #include "../../interface/Window.h" namespace OpenRCT2::Title { int16_t RotateViewCommand::operator()(int16_t timer) { - WindowBase* w = WindowGetMain(); - if (w != nullptr) + for (uint_fast8_t i = 0; i < Rotations; i++) { - for (uint_fast8_t i = 0; i < Rotations; i++) - { - WindowRotateCamera(*w, 1); - } + ViewportRotateAll(1); } return 0; From 47d346ee811d29bf4583342008a37bb22e41a201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 20:37:48 +0200 Subject: [PATCH 027/191] Remove unused code --- src/openrct2/interface/Window.cpp | 60 ------------------------------- src/openrct2/interface/Window.h | 1 - 2 files changed, 61 deletions(-) diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index afe5165230..4d7b2898a1 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -889,66 +889,6 @@ void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords) } } -/** - * - * rct2: 0x00688956 - */ -static void call_event_viewport_rotate_on_all_windows() -{ - WindowVisitEach([](WindowBase* w) { w->OnViewportRotate(); }); -} - -/** - * - * rct2: 0x0068881A - * direction can be used to alter the camera rotation: - * 1: clockwise - * -1: anti-clockwise - */ -void WindowRotateCamera(WindowBase& w, int32_t direction) -{ - Viewport* viewport = w.viewport; - if (viewport == nullptr) - return; - - auto windowPos = ScreenCoordsXY{ (viewport->width >> 1), (viewport->height >> 1) } + viewport->pos; - - // has something to do with checking if middle of the viewport is obstructed - Viewport* other; - auto mapXYCoords = ScreenGetMapXY(windowPos, &other); - CoordsXYZ coords{}; - - // other != viewport probably triggers on viewports in ride or guest window? - // naoXYCoords is nullopt if middle of viewport is obstructed by another window? - if (!mapXYCoords.has_value() || other != viewport) - { - auto viewPos = ScreenCoordsXY{ (viewport->view_width >> 1), (viewport->view_height >> 1) } + viewport->viewPos; - - coords = ViewportAdjustForMapHeight(viewPos, viewport->rotation); - } - else - { - coords.x = mapXYCoords->x; - coords.y = mapXYCoords->y; - coords.z = TileElementHeight(coords); - } - - viewport->rotation = (viewport->rotation + direction) & 3; - - auto centreLoc = centre_2d_coordinates(coords, viewport); - - if (centreLoc.has_value()) - { - w.savedViewPos = centreLoc.value(); - viewport->viewPos = *centreLoc; - } - - w.Invalidate(); - - call_event_viewport_rotate_on_all_windows(); - ResetAllSpriteQuadrantPlacements(); -} - void WindowViewportGetMapCoordsByCursor( const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y) { diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 9d84d0bd0a..f671194564 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -579,7 +579,6 @@ void WindowPushOthersBelow(WindowBase& w1); WindowBase* WindowGetMain(); void WindowScrollToLocation(WindowBase& w, const CoordsXYZ& coords); -void WindowRotateCamera(WindowBase& w, int32_t direction); void WindowViewportGetMapCoordsByCursor( const WindowBase& w, int32_t* map_x, int32_t* map_y, int32_t* offset_x, int32_t* offset_y); void WindowViewportCentreTileAroundCursor(WindowBase& w, int32_t map_x, int32_t map_y, int32_t offset_x, int32_t offset_y); From bdcfa5af8f6a831c987f241739a7537814288415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:11:31 +0200 Subject: [PATCH 028/191] Add a function to invalidate viewports pre-transformed position --- src/openrct2/entity/EntityBase.cpp | 2 +- src/openrct2/interface/Viewport.cpp | 38 +++++++++++++++++++++++++++++ src/openrct2/interface/Viewport.h | 2 ++ src/openrct2/world/Map.cpp | 13 +--------- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/src/openrct2/entity/EntityBase.cpp b/src/openrct2/entity/EntityBase.cpp index 75e9a07bfa..ac71e56e36 100644 --- a/src/openrct2/entity/EntityBase.cpp +++ b/src/openrct2/entity/EntityBase.cpp @@ -64,7 +64,7 @@ void EntityBase::Invalidate() break; } - ViewportsInvalidate(SpriteData.SpriteRect, maxZoom); + ViewportsInvalidate(GetLocation(), SpriteData.Width, SpriteData.HeightMin, SpriteData.HeightMax, maxZoom); } void EntityBase::Serialise(DataSerialiser& stream) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 0ef86b2e50..90b78fbf1c 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -237,6 +237,44 @@ Viewport* ViewportGetMain() return mainWindow->viewport; } +void ViewportsInvalidate(int32_t x, int32_t y, int32_t z0, int32_t z1, ZoomLevel maxZoom) +{ + for (auto& vp : _viewports) + { + if (maxZoom == ZoomLevel{ -1 } || vp.zoom <= ZoomLevel{ maxZoom }) + { + int32_t x1, y1, x2, y2; + + x += 16; + y += 16; + auto screenCoord = Translate3DTo2DWithZ(vp.rotation, CoordsXYZ{ x, y, 0 }); + + x1 = screenCoord.x - 32; + y1 = screenCoord.y - 32 - z1; + x2 = screenCoord.x + 32; + y2 = screenCoord.y + 32 - z0; + + ViewportInvalidate(&vp, ScreenRect{ { x1, y1 }, { x2, y2 } }); + } + } +} + +void ViewportsInvalidate(const CoordsXYZ& pos, int32_t width, int32_t minHeight, int32_t maxHeight, ZoomLevel maxZoom) +{ + for (auto& vp : _viewports) + { + if (maxZoom == ZoomLevel{ -1 } || vp.zoom <= ZoomLevel{ maxZoom }) + { + auto screenCoords = Translate3DTo2DWithZ(vp.rotation, pos); + auto screenPos = ScreenRect( + screenCoords - ScreenCoordsXY{ width, minHeight }, + screenCoords + ScreenCoordsXY{ width, maxHeight }); + + ViewportInvalidate(&vp, screenPos); + } + } +} + void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom) { for (auto& vp : _viewports) diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 7420fd4fe7..270d5d2fdb 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -128,6 +128,8 @@ std::optional centre_2d_coordinates(const CoordsXYZ& loc, Viewpo void ViewportCreate(WindowBase* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus); void ViewportRemove(Viewport* viewport); Viewport* ViewportGetMain(); +void ViewportsInvalidate(int32_t x, int32_t y, int32_t z0, int32_t z1, ZoomLevel maxZoom); +void ViewportsInvalidate(const CoordsXYZ& pos, int32_t width, int32_t minHeight, int32_t maxHeight, ZoomLevel maxZoom); void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom = ZoomLevel{ -1 }); void ViewportUpdatePosition(WindowBase* window); void ViewportUpdateFollowSprite(WindowBase* window); diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index a5f4066fef..d1b5e81d3e 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -1794,18 +1794,7 @@ static void MapInvalidateTileUnderZoom(int32_t x, int32_t y, int32_t z0, int32_t if (gOpenRCT2Headless) return; - int32_t x1, y1, x2, y2; - - x += 16; - y += 16; - auto screenCoord = Translate3DTo2D(GetCurrentRotation(), { x, y }); - - x1 = screenCoord.x - 32; - y1 = screenCoord.y - 32 - z1; - x2 = screenCoord.x + 32; - y2 = screenCoord.y + 32 - z0; - - ViewportsInvalidate({ { x1, y1 }, { x2, y2 } }, maxZoom); + ViewportsInvalidate(x, y, z0, z1, maxZoom); } /** From f7682f6b13817363e1d68362f82cec7b856eb633 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 18 Feb 2024 21:12:46 +0200 Subject: [PATCH 029/191] Apply clang-format --- src/openrct2/interface/Viewport.cpp | 3 +-- src/openrct2/paint/Paint.Entity.cpp | 6 ++---- src/openrct2/paint/Paint.cpp | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 90b78fbf1c..0a516f9f25 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -267,8 +267,7 @@ void ViewportsInvalidate(const CoordsXYZ& pos, int32_t width, int32_t minHeight, { auto screenCoords = Translate3DTo2DWithZ(vp.rotation, pos); auto screenPos = ScreenRect( - screenCoords - ScreenCoordsXY{ width, minHeight }, - screenCoords + ScreenCoordsXY{ width, maxHeight }); + screenCoords - ScreenCoordsXY{ width, minHeight }, screenCoords + ScreenCoordsXY{ width, maxHeight }); ViewportInvalidate(&vp, screenPos); } diff --git a/src/openrct2/paint/Paint.Entity.cpp b/src/openrct2/paint/Paint.Entity.cpp index a1b351119c..3e1e074dc6 100644 --- a/src/openrct2/paint/Paint.Entity.cpp +++ b/src/openrct2/paint/Paint.Entity.cpp @@ -99,10 +99,8 @@ void EntityPaintSetup(PaintSession& session, const CoordsXY& pos) screenCoords - ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMin }, screenCoords + ScreenCoordsXY{ spr->SpriteData.Width, spr->SpriteData.HeightMax }); - if (session.DPI.y + session.DPI.height <= spriteRect.GetTop() - || spriteRect.GetBottom() <= session.DPI.y - || session.DPI.x + session.DPI.width <= spriteRect.GetLeft() - || spriteRect.GetRight() <= session.DPI.x) + if (session.DPI.y + session.DPI.height <= spriteRect.GetTop() || spriteRect.GetBottom() <= session.DPI.y + || session.DPI.x + session.DPI.width <= spriteRect.GetLeft() || spriteRect.GetRight() <= session.DPI.x) { continue; } diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index e556870997..3a99d2117f 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -590,7 +590,7 @@ static void PaintAttachedPS(DrawPixelInfo& dpi, PaintStruct* ps, uint32_t viewFl static void PaintPSImageWithBoundingBoxes(PaintSession& session, PaintStruct* ps, ImageId imageId, int32_t x, int32_t y) { auto& dpi = session.DPI; - + const uint8_t colour = BoundBoxDebugColours[EnumValue(ps->InteractionItem)]; const uint8_t rotation = session.CurrentRotation; From 8bf33a6039d1e0f172aa500e5582554cffbcef98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 2 Mar 2024 10:45:48 +0200 Subject: [PATCH 030/191] Fix viewport not using the correct rotation in some cases --- src/openrct2/interface/Viewport.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 0a516f9f25..21452ce348 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -190,6 +190,7 @@ void ViewportCreate(WindowBase* w, const ScreenCoordsXY& screenCoords, int32_t w viewport->view_height = zoom.ApplyTo(height); viewport->zoom = zoom; viewport->flags = 0; + viewport->rotation = GetCurrentRotation(); if (gConfigGeneral.AlwaysShowGridlines) viewport->flags |= VIEWPORT_FLAG_GRIDLINES; From c87b82d75e1548eae7fd1c76e889595611231722 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:15:41 +0200 Subject: [PATCH 031/191] Add a rotate button to the extra viewport --- src/openrct2-ui/windows/Viewport.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 09a29e24ad..b7e846a585 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -28,6 +28,7 @@ enum WindowViewportWidgetIdx WIDX_ZOOM_IN, WIDX_ZOOM_OUT, WIDX_LOCATE, + WIDX_ROTATE, }; #pragma region MEASUREMENTS @@ -48,6 +49,7 @@ static Widget _viewportWidgets[] = MakeWidget({WW - 25, 17}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_G2_ZOOM_IN), STR_ZOOM_IN_TIP ), // zoom in MakeWidget({WW - 25, 41}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_G2_ZOOM_OUT), STR_ZOOM_OUT_TIP ), // zoom out MakeWidget({WW - 25, 65}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // locate + MakeWidget({WW - 25, 89}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_ROTATE_ARROW),STR_LOCATE_SUBJECT_TIP), // rotate WIDGETS_END, }; @@ -125,20 +127,25 @@ public: Close(); break; case WIDX_ZOOM_IN: + { if (viewport != nullptr && viewport->zoom > ZoomLevel::min()) { viewport->zoom--; Invalidate(); } break; + } case WIDX_ZOOM_OUT: + { if (viewport != nullptr && viewport->zoom < ZoomLevel::max()) { viewport->zoom++; Invalidate(); } break; + } case WIDX_LOCATE: + { auto* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { @@ -147,6 +154,13 @@ public: WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); } break; + } + case WIDX_ROTATE: + { + ViewportRotateSingle(this, 1); + Invalidate(); + break; + } } } @@ -184,6 +198,8 @@ public: widgets[WIDX_ZOOM_OUT].right = width - 2; widgets[WIDX_LOCATE].left = width - 27; widgets[WIDX_LOCATE].right = width - 2; + widgets[WIDX_ROTATE].left = width - 27; + widgets[WIDX_ROTATE].right = width - 2; widgets[WIDX_VIEWPORT].right = widgets[WIDX_ZOOM_IN].left - 1; widgets[WIDX_VIEWPORT].bottom = widgets[WIDX_BACKGROUND].bottom - 3; From 425c4cf04e3f8406080d8ce6460b0cd2578effac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:27:17 +0200 Subject: [PATCH 032/191] Allow viewports to have an independent rotation --- src/openrct2-ui/windows/Viewport.cpp | 4 +- src/openrct2/interface/Viewport.cpp | 9 ++++- src/openrct2/interface/Viewport.h | 60 ++++++++++++++-------------- 3 files changed, 41 insertions(+), 32 deletions(-) diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index b7e846a585..6a5599c45b 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -95,7 +95,7 @@ public: savedViewPos = { x - (viewport->view_width / 2), y - (viewport->view_height / 2) }; } - viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + viewport->flags |= VIEWPORT_FLAG_SOUND_ON | VIEWPORT_FLAG_INDEPEDENT_ROTATION; min_width = WW; min_height = WH; @@ -111,7 +111,7 @@ public: if (viewport != nullptr && viewport->flags != mainWindow->viewport->flags) { - viewport->flags = mainWindow->viewport->flags; + viewport->flags = mainWindow->viewport->flags | VIEWPORT_FLAG_INDEPEDENT_ROTATION; Invalidate(); } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 21452ce348..03ce7af4d7 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -890,7 +890,14 @@ void ViewportRotateSingle(WindowBase* window, int32_t direction) void ViewportRotateAll(int32_t direction) { - WindowVisitEach([direction](WindowBase* w) { ViewportRotateSingleInternal(*w, direction); }); + WindowVisitEach([direction](WindowBase* w) { + auto* viewport = w->viewport; + if (viewport == nullptr) + return; + if (viewport->flags & VIEWPORT_FLAG_INDEPEDENT_ROTATION) + return; + ViewportRotateSingleInternal(*w, direction); + }); ResetAllSpriteQuadrantPlacements(); } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 270d5d2fdb..3c3d9a4399 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -28,40 +28,42 @@ struct PaintEntry; // Flags must currenly retain their values to avoid breaking plugins. // Values can be changed when plugins move to using named constants. -enum +enum : uint32_t { - VIEWPORT_FLAG_GRIDLINES = (1 << 7), - VIEWPORT_FLAG_UNDERGROUND_INSIDE = (1 << 0), - VIEWPORT_FLAG_HIDE_BASE = (1 << 12), - VIEWPORT_FLAG_HIDE_VERTICAL = (1 << 13), + VIEWPORT_FLAG_GRIDLINES = (1U << 7), + VIEWPORT_FLAG_UNDERGROUND_INSIDE = (1U << 0), + VIEWPORT_FLAG_HIDE_BASE = (1U << 12), + VIEWPORT_FLAG_HIDE_VERTICAL = (1U << 13), - VIEWPORT_FLAG_SOUND_ON = (1 << 10), - VIEWPORT_FLAG_LAND_OWNERSHIP = (1 << 8), - VIEWPORT_FLAG_CONSTRUCTION_RIGHTS = (1 << 9), - VIEWPORT_FLAG_HIDE_ENTITIES = (1 << 14), - VIEWPORT_FLAG_CLIP_VIEW = (1 << 17), - VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES = (1 << 18), - VIEWPORT_FLAG_TRANSPARENT_BACKGROUND = (1 << 19), + VIEWPORT_FLAG_SOUND_ON = (1U << 10), + VIEWPORT_FLAG_LAND_OWNERSHIP = (1U << 8), + VIEWPORT_FLAG_CONSTRUCTION_RIGHTS = (1U << 9), + VIEWPORT_FLAG_HIDE_ENTITIES = (1U << 14), + VIEWPORT_FLAG_CLIP_VIEW = (1U << 17), + VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES = (1U << 18), + VIEWPORT_FLAG_TRANSPARENT_BACKGROUND = (1U << 19), - VIEWPORT_FLAG_LAND_HEIGHTS = (1 << 4), - VIEWPORT_FLAG_TRACK_HEIGHTS = (1 << 5), - VIEWPORT_FLAG_PATH_HEIGHTS = (1 << 6), + VIEWPORT_FLAG_LAND_HEIGHTS = (1U << 4), + VIEWPORT_FLAG_TRACK_HEIGHTS = (1U << 5), + VIEWPORT_FLAG_PATH_HEIGHTS = (1U << 6), - VIEWPORT_FLAG_HIDE_RIDES = (1 << 1), - VIEWPORT_FLAG_HIDE_VEHICLES = (1 << 20), - VIEWPORT_FLAG_HIDE_VEGETATION = (1 << 21), - VIEWPORT_FLAG_HIDE_SCENERY = (1 << 2), - VIEWPORT_FLAG_HIDE_PATHS = (1 << 16), - VIEWPORT_FLAG_HIDE_SUPPORTS = (1 << 3), - VIEWPORT_FLAG_HIDE_GUESTS = (1 << 11), - VIEWPORT_FLAG_HIDE_STAFF = (1 << 23), + VIEWPORT_FLAG_HIDE_RIDES = (1U << 1), + VIEWPORT_FLAG_HIDE_VEHICLES = (1U << 20), + VIEWPORT_FLAG_HIDE_VEGETATION = (1U << 21), + VIEWPORT_FLAG_HIDE_SCENERY = (1U << 2), + VIEWPORT_FLAG_HIDE_PATHS = (1U << 16), + VIEWPORT_FLAG_HIDE_SUPPORTS = (1U << 3), + VIEWPORT_FLAG_HIDE_GUESTS = (1U << 11), + VIEWPORT_FLAG_HIDE_STAFF = (1U << 23), - VIEWPORT_FLAG_INVISIBLE_RIDES = (1 << 24), - VIEWPORT_FLAG_INVISIBLE_VEHICLES = (1 << 25), - VIEWPORT_FLAG_INVISIBLE_VEGETATION = (1 << 26), - VIEWPORT_FLAG_INVISIBLE_SCENERY = (1 << 27), - VIEWPORT_FLAG_INVISIBLE_PATHS = (1 << 28), - VIEWPORT_FLAG_INVISIBLE_SUPPORTS = (1 << 29), + VIEWPORT_FLAG_INVISIBLE_RIDES = (1U << 24), + VIEWPORT_FLAG_INVISIBLE_VEHICLES = (1U << 25), + VIEWPORT_FLAG_INVISIBLE_VEGETATION = (1U << 26), + VIEWPORT_FLAG_INVISIBLE_SCENERY = (1U << 27), + VIEWPORT_FLAG_INVISIBLE_PATHS = (1U << 28), + VIEWPORT_FLAG_INVISIBLE_SUPPORTS = (1U << 29), + + VIEWPORT_FLAG_INDEPEDENT_ROTATION = (1U << 30), }; enum class VisibilityKind From ae0af55a993df19265bb6a7525a74aaeab39779e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 2 Mar 2024 11:41:19 +0200 Subject: [PATCH 033/191] Make GCC happy due to non-enumerated usage --- src/openrct2-ui/windows/Banner.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 2 +- src/openrct2-ui/windows/Sign.cpp | 4 ++-- src/openrct2/interface/Viewport.h | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index b6d9a70dc7..bb4b06f602 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -85,7 +85,7 @@ private: (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, Focus(_bannerViewPos)); if (viewport != nullptr) - viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; Invalidate(); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index c900be1989..c7312ad288 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -628,7 +628,7 @@ private: int32_t viewportFlags{}; if (viewport == nullptr) { - viewportFlags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewportFlags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; } else { diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 0d16eeeaca..79926b55b3 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -137,7 +137,7 @@ public: this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ })); - viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; Invalidate(); return true; @@ -315,7 +315,7 @@ public: this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos })); if (viewport != nullptr) - viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : 0; + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; Invalidate(); } diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 3c3d9a4399..904ab8ddf9 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -30,6 +30,8 @@ struct PaintEntry; // Values can be changed when plugins move to using named constants. enum : uint32_t { + VIEWPORT_FLAG_NONE = 0U, + VIEWPORT_FLAG_GRIDLINES = (1U << 7), VIEWPORT_FLAG_UNDERGROUND_INSIDE = (1U << 0), VIEWPORT_FLAG_HIDE_BASE = (1U << 12), From a1304ef1476bd0f693aacabfba0a51537842feaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:34:03 +0200 Subject: [PATCH 034/191] Fix rebase --- src/openrct2/interface/Viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 03ce7af4d7..1ee356a80b 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -879,7 +879,7 @@ static void ViewportRotateSingleInternal(WindowBase& w, int32_t direction) } w.Invalidate(); - WindowEventViewportRotateCall(&w); + w.OnViewportRotate(); } void ViewportRotateSingle(WindowBase* window, int32_t direction) From 86c28693ba8784c5ba02f5d5a72c099dc160a8c0 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Tue, 5 Mar 2024 23:06:27 +0000 Subject: [PATCH 035/191] Move gGuestChangeModifier to GameState_t --- src/openrct2-ui/windows/GameBottomToolbar.cpp | 4 ++-- src/openrct2/Editor.cpp | 2 +- src/openrct2/GameState.h | 1 + src/openrct2/entity/Guest.h | 2 -- src/openrct2/entity/Peep.cpp | 2 -- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/world/Park.cpp | 4 ++-- 8 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 12fa470ae5..c21bdce9db 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -125,8 +125,8 @@ private: Widget widget = window_game_bottom_toolbar_widgets[WIDX_GUESTS]; auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(), windowPos.y + widget.midY() - 6 }; - StringId stringId = gameState.NumGuestsInPark == 1 ? _guestCountFormatsSingular[gGuestChangeModifier] - : _guestCountFormats[gGuestChangeModifier]; + StringId stringId = gameState.NumGuestsInPark == 1 ? _guestCountFormatsSingular[gameState.GuestChangeModifier] + : _guestCountFormats[gameState.GuestChangeModifier]; colour_t colour = (gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == WIDX_GUESTS ? COLOUR_WHITE diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index f415059550..3c6deb1040 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -321,7 +321,7 @@ namespace Editor gameState.NumGuestsInPark = 0; gameState.NumGuestsHeadingForPark = 0; gameState.NumGuestsInParkLastWeek = 0; - gGuestChangeModifier = 0; + gameState.GuestChangeModifier = 0; if (fromSave) { gameState.ParkFlags |= PARK_FLAGS_NO_MONEY; diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 09034b7945..d310163a18 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -61,6 +61,7 @@ namespace OpenRCT2 uint8_t GuestInitialHappiness; uint8_t GuestInitialHunger; uint8_t GuestInitialThirst; + uint8_t GuestChangeModifier; uint32_t NextGuestNumber; uint32_t NumGuestsInPark; uint32_t NumGuestsHeadingForPark; diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index 6ecee9a3a0..6f379cbb68 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -460,8 +460,6 @@ enum EASTEREGG_PEEP_NAME_DAVID_ELLIS }; -extern uint8_t gGuestChangeModifier; - void PeepThoughtSetFormatArgs(const PeepThought* thought, Formatter& ft); void IncrementGuestsInPark(); diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 3c16a9645e..1a28829cca 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -66,8 +66,6 @@ using namespace OpenRCT2; using namespace OpenRCT2::Audio; -uint8_t gGuestChangeModifier; - uint8_t gPeepWarningThrottle[16]; static uint8_t _unk_F1AEF0; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index a71f89e5b0..c5dad5fa8a 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -908,7 +908,7 @@ namespace OpenRCT2 cs.ReadWrite(gameState.TotalRideValueForMoney); } cs.ReadWrite(gameState.NumGuestsInParkLastWeek); - cs.ReadWrite(gGuestChangeModifier); + cs.ReadWrite(gameState.GuestChangeModifier); cs.ReadWrite(gameState.GuestGenerationProbability); cs.ReadWrite(gameState.SuggestedGuestMaximum); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 36f8b5e86a..910464b52f 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -282,7 +282,7 @@ namespace RCT2 ImportPeepSpawns(); - gGuestChangeModifier = _s6.GuestCountChangeModifier; + gameState.GuestChangeModifier = _s6.GuestCountChangeModifier; gameState.ResearchFundingLevel = _s6.CurrentResearchLevel; // Pad01357400 // _s6.ResearchedTrackTypesA diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 43d325f8b2..4f3eda7aae 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -240,7 +240,7 @@ void Park::Initialise() gameState.NumGuestsInPark = 0; gameState.NumGuestsInParkLastWeek = 0; gameState.NumGuestsHeadingForPark = 0; - gGuestChangeModifier = 0; + gameState.GuestChangeModifier = 0; gameState.ParkRating = 0; gameState.GuestGenerationProbability = 0; gameState.TotalRideValueForMoney = 0; @@ -745,7 +745,7 @@ void Park::UpdateHistories() guestChangeModifier = 0; } } - gGuestChangeModifier = guestChangeModifier; + gameState.GuestChangeModifier = guestChangeModifier; gameState.NumGuestsInParkLastWeek = gameState.NumGuestsInPark; // Update park rating, guests in park and current cash history From aa6a1b0bdd89c7cc2ae316cd451b24c57af06f8d Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Wed, 6 Mar 2024 04:02:01 +0000 Subject: [PATCH 036/191] Merge Localisation/master into OpenRCT2/develop --- data/language/hu-HU.txt | 127 +++++++++++++++++++++------------------- data/language/ko-KR.txt | 13 ++-- 2 files changed, 75 insertions(+), 65 deletions(-) diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index 71e0bb05fd..c912d8a2b4 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -14,7 +14,7 @@ STR_0009 :Mini felfüggesztett hullámvasút STR_0010 :Csónakkölcsönző STR_0011 :Fa vadegér STR_0012 :Akadályverseny -STR_0013 :Autós utazás +STR_0013 :Autós játék STR_0014 :Kilövéses szabadesés STR_0015 :Bobpálya hullámvasút STR_0016 :Megfigyelőtorony @@ -27,7 +27,7 @@ STR_0022 :Útvesztő STR_0023 :Spirál csúszda STR_0024 :Gokart STR_0025 :Faúsztató -STR_0026 :Vadvízi utazás +STR_0026 :Vadvízi játék STR_0027 :Dodzsem STR_0028 :Hajóhinta STR_0029 :Fejreálló hajóhinta @@ -81,7 +81,7 @@ STR_0076 :Vízi hullámvasút STR_0077 :Léghajtású függőleges hullámvasút STR_0078 :Fordított hajtű hullámvasút STR_0079 :Varázsszőnyeg -STR_0080 :Tengeralattjáró-utazás +STR_0080 :Tengeralattjáró-játék STR_0081 :Folyami tutajok STR_0082 :Ismeretlen játék (50) STR_0083 :Enterprise @@ -326,7 +326,7 @@ STR_0934 :A játék bejárata útban van STR_0935 :A játék kijárata útban van STR_0936 :A park bejárata útban van STR_0937 :Nézet beállítások -STR_0938 :A föld magasságának és lejtésének módosítása +STR_0938 :A talaj magasságának és lejtésének módosítása STR_0939 :Földalatti/belső nézet STR_0940 :Alaptalaj elrejtése STR_0941 :Függőleges felületek elrejtése @@ -543,7 +543,7 @@ STR_1150 :Háromnegyed terhelés STR_1151 :Teljes terhelés STR_1152 :Bármekkora terhelés STR_1153 :Magasságjelzők a játékpályákon -STR_1154 :Magasságjelzők a terepen +STR_1154 :Magasságjelzők a talajon STR_1155 :Magasságjelzők az utakon STR_1156 :{MOVE_X}{10}{STRINGID} STR_1157 :✓{MOVE_X}{10}{STRINGID} @@ -1256,12 +1256,12 @@ STR_1875 :{BLACK} {SPRITE}{BLACK} {STRINGID} STR_1876 :{WINDOW_COLOUR_2}{INLINE_SPRITE}{251}{19}{00}{00}Játékok ellenőrzése STR_1877 :{WINDOW_COLOUR_2}{INLINE_SPRITE}{252}{19}{00}{00}Játékok javítása STR_1878 :{WINDOW_COLOUR_2}Ellenőrzés: -STR_1879 :Minden 10. percben -STR_1880 :Minden 20. percben -STR_1881 :Minden 30. percben -STR_1882 :Minden 45. percben -STR_1883 :Minden órában -STR_1884 :Minden második órában +STR_1879 :10 percenként +STR_1880 :20 percenként +STR_1881 :30 percenként +STR_1882 :45 percenként +STR_1883 :Óránként +STR_1884 :Kétóránként STR_1885 :Soha STR_1886 :Ezt ellenőrzi: {STRINGID} STR_1887 :{WINDOW_COLOUR_2}Legutóbbi ellenőrzés óta eltelt idő: {BLACK}{COMMA16} perc @@ -1279,9 +1279,9 @@ STR_1900 :{WINDOW_COLOUR_2}Tereprendezés STR_1901 :{WINDOW_COLOUR_2}Park belépőjegyek STR_1902 :{WINDOW_COLOUR_2}Játék jegyek STR_1903 :{WINDOW_COLOUR_2}Bolti eladások -STR_1904 :{WINDOW_COLOUR_2}Bolti készletek +STR_1904 :{WINDOW_COLOUR_2}Bolti árufeltöltés STR_1905 :{WINDOW_COLOUR_2}Étel/ital eladások -STR_1906 :{WINDOW_COLOUR_2}Étel/ital készletek +STR_1906 :{WINDOW_COLOUR_2}Étel/ital árufeltöltés STR_1907 :{WINDOW_COLOUR_2}Alkalmazottak bére STR_1908 :{WINDOW_COLOUR_2}Marketing STR_1909 :{WINDOW_COLOUR_2}Kutatás @@ -1652,7 +1652,7 @@ STR_2291 :Válassz pályát az új játékhoz STR_2292 :{WINDOW_COLOUR_2}Az alábbi játékokon volt: STR_2293 :{BLACK} Semmi STR_2294 :A talajtípus megváltoztatása -STR_2295 :A föld függőleges széleinek megváltoztatása +STR_2295 :A talaj függőleges széleinek megváltoztatása STR_2296 :{BLACK}{CURRENCY2DP}{WINDOW_COLOUR_2} kiadás {BLACK}park belépőre STR_2297 :{BLACK}{CURRENCY2DP}{WINDOW_COLOUR_2} kiadás {BLACK}{COMMA16} játékra STR_2298 :{BLACK}{CURRENCY2DP}{WINDOW_COLOUR_2} kiadás {BLACK}{COMMA16} játékra @@ -1749,7 +1749,7 @@ STR_2394 :{BLACK}Fejezd be az 5 félkész hullámvasút építését, úgy, h STR_2395 :{BLACK}Fizesd vissza a kölcsönödet és a park értéke legyen legalább {POP16}{POP16}{CURRENCY} STR_2396 :{BLACK}Az ételek, italok és szuvenírek utáni havi bevételed legyen legalább {POP16}{POP16}{CURRENCY} STR_2397 :Nincs -STR_2398 :A vendégek száma +STR_2398 :Vendégek száma STR_2399 :A park értéke egy meghatározott időpontban STR_2400 :Érezd jól magad STR_2401 :Építsd meg a lehető legjobb játékot @@ -1850,7 +1850,7 @@ STR_2507 :Láthatatlan emberek be/ki STR_2508 :Magasságjelek a talajon be/ki STR_2509 :Magasságjelek a játékok pályáin be/ki STR_2510 :Magasságjelek az utakon be/ki -STR_2511 :Föld módosítása +STR_2511 :Talaj módosítása STR_2512 :Víz módosítása STR_2513 :Díszlet építése STR_2514 :Utak építése @@ -1921,11 +1921,11 @@ STR_2694 :Generálás STR_2695 :Véletlenszerű táj STR_2696 :Rakjon le fákat STR_2700 :Automatikus mentés: -STR_2701 :Minden percben -STR_2702 :Minden 5. percben -STR_2703 :Minden 15. percben -STR_2704 :Minden 30. percben -STR_2705 :Minden órában +STR_2701 :Percenként +STR_2702 :5 percenként +STR_2703 :15 percenként +STR_2704 :30 percenként +STR_2705 :Óránként STR_2706 :Soha STR_2707 :Rendszer fájlkezelőjének használata STR_2708 :{WINDOW_COLOUR_1}Biztos, hogy felül akarod írni ezt: {STRINGID}? @@ -1947,7 +1947,7 @@ STR_2730 :{UINT16} óra {UINT16} perc STR_2731 :{UINT16} óra {UINT16} perc STR_2732 :{COMMA32} láb STR_2733 :{COMMA32} m -STR_2734 :{COMMA16} mph +STR_2734 :{COMMA16} mi/h STR_2735 :{COMMA16} km/h STR_2736 :{POP16}{COMMA16}. év {PUSH16}{PUSH16}{MONTH} STR_2737 :{POP16}{POP16}{COMMA16}. év {PUSH16}{PUSH16}{MONTH} {PUSH16}{PUSH16}{STRINGID} @@ -1988,9 +1988,9 @@ STR_2786 :Kattints a parancs leírására új gyorsbillentyű megadásához STR_2787 :{WINDOW_COLOUR_2}A park értéke: {BLACK}{CURRENCY} STR_2788 :{WINDOW_COLOUR_2}Gratulálunk !{NEWLINE}{BLACK}Sikeresen teljesítetted a kitűzött célt egy {CURRENCY} értékű vállalattal ! STR_2789 :{WINDOW_COLOUR_2}Nem sikerült teljesítened a kitűzött célt ! -STR_2790 :Írd be a neved az eredménytáblába -STR_2791 :Írd be a neved -STR_2792 :Kérlek írd be a neved az eredménytáblába: +STR_2790 :Név beírása az eredménytáblába +STR_2791 :Név beírása +STR_2792 :Írd be a neved az eredménytáblába: STR_2793 :(Teljesítette: {STRINGID}) STR_2794 :{BLACK}{STRINGID} {WINDOW_COLOUR_2}teljesítette{NEWLINE}{WINDOW_COLOUR_2}egy {BLACK}{CURRENCY} {WINDOW_COLOUR_2}értékű vállalattal STR_2795 :Rendezés @@ -2169,7 +2169,7 @@ STR_3130 :Mentés STR_3131 :Mégse STR_3132 :{BLACK}Klikkelj azokra a díszletelemekre, amelyeket a játéktervvel együtt el akarsz menteni… STR_3133 :Nem építhető lejtőre -STR_3134 :{RED}(A terv el nem érhető díszletet tartalmaz) +STR_3134 :{RED}(A terv olyan díszletet tartalmaz, amely nem elérhető) STR_3135 :{RED}(A járműterv nem elérhető - Befolyásolhatja a játék teljesítményét) STR_3136 :Figyelmeztetés: A terv alternatív járműtípussal lesz megépítve és lehet, hogy nem az elvártnak megfelelően fog teljesíteni STR_3137 :Közeli díszletek kiválasztása @@ -2196,7 +2196,7 @@ STR_3176 :Az objektum nem választható ki STR_3177 :Az objektum kiválasztása nem vonható vissza STR_3179 :Legalább egy játék járművet/játékot ki kell választani STR_3180 :Érvénytelen objektumkijelölés -STR_3181 :Objektum kiválasztás - {STRINGID} +STR_3181 :Objektumok kiválasztása - {STRINGID} STR_3182 :A parkbejárat típusát ki kell választani STR_3183 :A víz típusát ki kell választani STR_3184 :Játékok és járműveik @@ -2253,7 +2253,7 @@ STR_3235 :Pénzügyi beállítások STR_3236 :A vendégek beállításai STR_3237 :A park beállításai STR_3238 :Nem kell pénz -STR_3239 :Legyen ez a park egy pénzügyi korlátok nélküli, ’nem kell pénz’ park +STR_3239 :Legyen ez a park egy „pénz nélküli” park, pénzügyi korlátozások nélkül STR_3240 :{WINDOW_COLOUR_2}Kezdőtőke: STR_3241 :{WINDOW_COLOUR_2}Kezdeti kölcsön: STR_3242 :{WINDOW_COLOUR_2}Maximális kölcsönösszeg: @@ -2308,7 +2308,7 @@ STR_3290 :Hűvös és nedves STR_3291 :Meleg STR_3292 :Forró és száraz STR_3293 :Hideg -STR_3294 :Változtatás… +STR_3294 :Változtat… STR_3295 :A park nevének megváltoztatása STR_3296 :A pálya nevének megváltoztatása STR_3297 :A park / pálya részletes leírásának megváltoztatása @@ -2392,7 +2392,7 @@ STR_3380 :A játékterv nem telepíthető… STR_3381 :A fájl nem kompatibilis, vagy érvénytelen adatokat tartalmaz STR_3382 :A fájl másolása meghiúsult STR_3383 :Válassz egy új nevet a játékterv számára -STR_3384 :Már létezik egy játékterv ezen a néven - Kérlek válassz egy új nevet a terv számára: +STR_3384 :Már létezik egy játékterv ezen a néven - Válassz egy új nevet a terv számára: STR_3389 :Nem választható ki több díszletelem… STR_3390 :Túl sok elem van kiválasztva STR_3437 :Nagy földterületek megtisztítása a díszletektől @@ -2408,7 +2408,7 @@ STR_5122 :A játékok pályatípus szerinti kiválasztása (mint az RCT1-ben) STR_5123 :Játékok felújítása STR_5125 :Minden rombolható STR_5126 :Véletlenszerű főcímzene -STR_5127 :Húzás közben tájképfestés a magasságváltoztatás helyett +STR_5127 :Húzás közben a táj festése, magasságváltoztatás helyett STR_5128 :Kiválasztás mérete STR_5129 :Add meg a kiválasztás méretét {COMMA16} és {COMMA16} között STR_5130 :Térkép mérete @@ -2460,7 +2460,7 @@ STR_5189 :Kutatás STR_5190 :Térkép STR_5191 :Látkép STR_5192 :Friss hírek -STR_5193 :Föld +STR_5193 :Talaj STR_5194 :Víz STR_5195 :Díszlet törlése STR_5196 :Földjogok @@ -2477,7 +2477,7 @@ STR_5206 :Vendéglista STR_5207 :Személyzet STR_5208 :Személyzeti lista STR_5209 :Hirdetőtábla -STR_5210 :Objektum választás +STR_5210 :Objektumok kiválasztása STR_5211 :Találmányok listája STR_5212 :Pályabeállítások STR_5213 :Cél beállítások @@ -2609,7 +2609,7 @@ STR_5365 :{BLACK}Dolgozók sebessége: STR_5366 :Normál STR_5367 :Gyors STR_5368 :Ütközés törlése -STR_5371 :Objektum választás +STR_5371 :Objektumok kiválasztása STR_5372 :Jobb egérgombos húzás invertálása STR_5373 :Név {STRINGID} STR_5374 :Dátum {STRINGID} @@ -2717,7 +2717,7 @@ STR_5547 :Világos rózsaszín STR_5548 :Minden működési mód megjelenítése STR_5549 :Év/hónap/nap STR_5550 :{POP16}{POP16}{COMMA16}. év {PUSH16}{PUSH16}{MONTH} {PUSH16}{PUSH16}{STRINGID} -STR_5551 :év/nap/hónap +STR_5551 :Év/nap/hónap STR_5552 :{POP16}{POP16}{COMMA16}. év {PUSH16}{PUSH16}{PUSH16}{STRINGID} {MONTH} STR_5553 :Játék megállítása, ha a Steam Átfedés nyitva van STR_5554 :A hegy-eszköz bekapcsolása @@ -2726,7 +2726,7 @@ STR_5556 :Játékos kirúgása STR_5557 :Kapcsolat fenntartása hiba esetén (többjátékos mód) STR_5558 :A beállítás érvénybe lépéséhez az OpenRCT2 újraindítása szükséges STR_5559 :10 perces ellenőrzés -STR_5560 :Az ellenőrzési időt „minden 10. percben”-re állítja az összes játékon +STR_5560 :Az ellenőrzési időt „10 percenként”-re állítja az összes játékon STR_5561 :A nyelv betöltése sikertelen STR_5562 :FIGYELMEZTETÉS! STR_5563 :Ez a funkció jelenleg instabil, legyél rendkívül elővigyázatos. @@ -2800,7 +2800,7 @@ STR_5633 :CMD + STR_5634 :OPTION + STR_5635 :{WINDOW_COLOUR_2}Elköltött pénz: {BLACK}{CURRENCY2DP} STR_5636 :{WINDOW_COLOUR_2}Futtatott parancsok: {BLACK}{COMMA16} -STR_5637 :Ezt nem csinálhatod… +STR_5637 :Nem lehet megtenni… STR_5638 :Engedély megtagadva STR_5639 :Játékosok listája STR_5640 :Csoportok kezelése @@ -3053,7 +3053,7 @@ STR_5930 :Nagy díszlet részletei STR_5931 :Hirdetőtábla részletei STR_5932 :Sérült elem részletei STR_5933 :Tulajdonságok -STR_5934 :Terep textúrája: {BLACK}{STRINGID} +STR_5934 :Talaj textúrája: {BLACK}{STRINGID} STR_5935 :Terepszegély: {BLACK}{STRINGID} STR_5936 :Földtulajdon: {BLACK}{STRINGID} STR_5937 :Nincs tulajdonban és nem eladó @@ -3154,7 +3154,7 @@ STR_6031 :Szerver leírása: STR_6032 :Szerver üdvözlés: STR_6033 :Az RCT1 telepítési útvonala: STR_6034 :{BLACK}{STRING} -STR_6035 :Kérlek válaszd ki az RCT1 mappádat +STR_6035 :Válaszd ki az RCT1 mappádat STR_6036 :Törlés STR_6037 :A kiválasztott könyvtár nem tartalmaz érvényes RollerCoaster Tycoon 1 telepítést. STR_6038 :Ha az RCT1 telepítve van, itt add meg a mappája helyét, hogy betölthesd a pályákat, zenét stb. @@ -3162,7 +3162,7 @@ STR_6039 :Játék/épület gyors lerombolása STR_6040 :Pályabeállítások módosítása STR_6041 :{BLACK}Nem vettél fel gépészt! STR_6042 :Magasságtérkép betöltése -STR_6043 :Magasságtérkép kiválasztása +STR_6043 :Magasságtérkép választása STR_6044 :Magasságtérkép simítása STR_6045 :Erősség STR_6046 :Magasságtérkép normalizálása @@ -3243,7 +3243,7 @@ STR_6129 :Másolás STR_6130 :Összes másolása STR_6131 :Objektum forrása STR_6132 :Kutatási állapot figyelmen kívül hagyása -STR_6133 :Hozzáférés a még fel nem fedezett játékokhoz és díszletekhez +STR_6133 :Hozzáférés a még felfedezetlen játékokhoz és díszletekhez STR_6134 :Díszlet törlése STR_6135 :A kliens érvénytelen kérést küldött STR_6136 :A szerver érvénytelen kérést küldött @@ -3265,7 +3265,7 @@ STR_6151 :A főszerver nem tudja listázni a szervereket STR_6152 :Érvénytelen válasz a főszervertől (nincs JSON-tömb) STR_6153 :Fizetős parkbelépő / Fizetős játékok STR_6154 :Biztonsági okokból nem javasolt az OpenRCT2 emelt jogosultságokkal történő futtatása. -STR_6155 :Se a KDialog, se a Zenity nincs telepítve. Kérlek telepítsd valamelyiket, vagy konfiguráld a parancssorból. +STR_6155 :Se a KDialog, se a Zenity nincs telepítve. Telepítsd valamelyiket, vagy konfiguráld a parancssorból. STR_6156 :A név le van foglalva STR_6157 :Konzol STR_6160 :{WINDOW_COLOUR_2}Rendelkezésre álló járművek: {BLACK}{STRING} @@ -3281,7 +3281,7 @@ STR_6169 :Pályaválasztás STR_6170 :Felület finomhangolása STR_6171 :Keresés STR_6172 :Keresés -STR_6173 :Kérlek add meg a keresendő nevet: +STR_6173 :Add meg a keresendő nevet: STR_6188 :Hányás STR_6189 :Kacsa STR_6191 :Felület @@ -3349,7 +3349,7 @@ STR_6266 :Egyedi tartalmak mappájának megnyitása STR_6267 :Mezővizsgáló megnyitása STR_6268 :Megállított játék léptetése STR_6269 :Érvénytelen éghajlati ID -STR_6270 :Terepfelületek +STR_6270 :Talajfelületek STR_6271 :Terepszegélyek STR_6272 :Állomások STR_6273 :Zene @@ -3419,7 +3419,7 @@ STR_6346 :Mezővizsgáló: Elem magasságának csökkentése STR_6347 :Úti extrák nem helyezhetőek útátjárókra! STR_6348 :Előbb távolítsd el az útátjárót! STR_6349 :Véletlenszerű főcím -STR_6350 :Szórás +STR_6350 :Szétszórás STR_6351 :Díszletszóró eszköz STR_6352 :Sűrűség STR_6353 :Alacsony sűrűség @@ -3459,25 +3459,25 @@ STR_6386 :Hóvihar STR_6387 :Nem süllyeszthető itt le az elem… STR_6388 :Nem emelhető itt meg az elem… STR_6389 :Érvénytelen űrszelvény -STR_6390 :Az OpenRCT2 működéséhez szükség van az eredeti RollerCoaster Tycoon 2 fájljaira. Kérlek add meg a mappát, ahova telepítetted a RollerCoaster Tycoon 2-t. -STR_6391 :Kérlek válaszd ki az RCT2 mappádat +STR_6390 :Az OpenRCT2 működéséhez szükség van az eredeti RollerCoaster Tycoon 2 fájljaira. Add meg a mappát, ahova telepítetted a RollerCoaster Tycoon 2-t. +STR_6391 :Válaszd ki az RCT2 mappádat STR_6392 :A(z) {STRING} nem található ezen az útvonalon. STR_6393 :Cél kiválasztása STR_6394 :Cél STR_6395 :Karbantartás STR_6396 :Képernyővédő és a monitor energiagazdálkodása ki STR_6397 :Ha ki van választva, szüneteltetve lesz a képernyővédő és a monitor egyéb energiagazdálkodási funkciói, amíg az OpenRCT2 fut. -STR_6398 :A fájl nem támogatott játék-típusokat tartalmaz. Kérlek frissíts egy újabb OpenRCT2 verzióra. -STR_6399 :Az OpenRCT2 működéséhez szükség van az eredeti RollerCoaster Tycoon 2 fájljaira. Kérlek állítsd be a „game_path” változót a config.ini-ben arra a mappára, amelybe telepítetted a RollerCoaster Tycoon 2-t, majd indítsd újra az OpenRCT2-t. +STR_6398 :A fájl nem támogatott játék-típusokat tartalmaz. Frissíts egy újabb OpenRCT2 verzióra. +STR_6399 :Az OpenRCT2 működéséhez szükség van az eredeti RollerCoaster Tycoon 2 fájljaira. Állítsd be a „game_path” változót a config.ini-ben arra a mappára, amelybe telepítetted a RollerCoaster Tycoon 2-t, majd indítsd újra az OpenRCT2-t. STR_6400 :Letöltöttem a GOG RollerCoaster Tycoon 2 offline telepítőjét, de nincs telepítve STR_6401 :Már telepítettem a RollerCoaster Tycoon 2-t STR_6402 :OpenRCT2 adatok megadása STR_6403 :Válaszd ki a számodra legmegfelelőbbet -STR_6404 :Kérlek válaszd ki a GOG RollerCoaster Tycoon 2 telepítőjét. +STR_6404 :Válaszd ki a GOG RollerCoaster Tycoon 2 telepítőjét. STR_6405 :GOG telepítő kiválasztása STR_6406 :GOG RollerCoaster Tycoon 2 telepítő STR_6407 :Ez eltarthat pár percig. -STR_6408 :Kérlek rakd fel az “innoextract”-ot a GOG telepítő kitömörítéséhez, majd indítsd újra az OpenRCT2-t. +STR_6408 :Rakd fel az „innoextract”-ot a GOG telepítő kitömörítéséhez, majd indítsd újra az OpenRCT2-t. STR_6409 :A kiválasztott fájl nem a GOG RollerCoaster Tycoon 2 offline telepítője. Lehet, hogy a GOG Galaxy letöltő stub-ját töltötted le, vagy rossz fájlt választottál. STR_6410 :Kicsinyítés/nagyítás STR_6411 :A kicsinyítés és nagyítás gombjainak megjelenítése az eszköztáron @@ -3521,7 +3521,7 @@ STR_6448 :Nem támogatott objektumformátum STR_6449 :{WINDOW_COLOUR_2}Számok: STR_6450 :{BLACK}„{STRING}” STR_6451 :{BLACK}„{STRING}” - {STRING} -STR_6452 :{WINDOW_COLOUR_2}Árul: {BLACK}{STRING} +STR_6452 :{WINDOW_COLOUR_2}Ezeket árulja: {BLACK}{STRING} STR_6453 :Verzió infó másolása STR_6454 :A hirdetőtábla nem nevezhető át… STR_6455 :A felirat nem nevezhető át… @@ -3572,7 +3572,7 @@ STR_6500 :A játékterv formátum által nem támogatott pályaelemek STR_6501 :Véletlenszerű szín STR_6502 :Írj be egy értéket {COMMA16} és {COMMA16} között STR_6503 :Legalább egy állomásobjektumot ki kell választani -STR_6504 :Legalább egy terepfelületet ki kell választani +STR_6504 :Legalább egy talajfelületet ki kell választani STR_6505 :Legalább egy terepszegélyt ki kell választani STR_6506 :Nagy fél dugóhúzó (balra) STR_6507 :Nagy fél dugóhúzó (jobbra) @@ -3686,6 +3686,11 @@ STR_6614 :Nem változtatható meg a park belépési díja STR_6615 :A pályának ezen a mezőn vízre van szüksége STR_6616 :Az adott személyzettípus számára érvénytelen akció STR_6617 :Nem lehet önmagával cserélni mezőelemet +STR_6618 :Nem lehet korlátozni vagy feloldani az objektumot... +STR_6619 :Az objektumtípus nem korlátozható! +STR_6620 :Az objektum nem található! +STR_6621 :Korlátozás +STR_6622 :Objektum korlátozása a pályaszerkesztőre és a homokozó módra. ############# # Scenarios # @@ -3713,9 +3718,9 @@ STR_PARK :Gyémánt-fennsík STR_DTLS :Gyémánt-fennsík már egy sikeres vidámpark, remek játékokkal - fejleszd, hogy megduplázd az értékét -STR_SCNR :Örökzöld Kertek -STR_PARK :Örökzöld Kertek -STR_DTLS :Alakítsd át a csodaszép Örökzöld Kerteket egy virágzó vidámparkká +STR_SCNR :Örökzöld Kert +STR_PARK :Örökzöld Kert +STR_DTLS :Alakítsd át a csodaszép Örökzöld Kertet egy virágzó vidámparkká STR_SCNR :Suta Strand @@ -3949,8 +3954,8 @@ STR_PARK :Városi Park STR_DTLS :Egy apró park egyezséget kötött a közeli várossal, amelynek értelmében magán a városon keresztül terjeszkedhet -STR_SCNR :Geoffrey Kertek -STR_PARK :Geoffrey Kertek +STR_SCNR :Geoffrey Kert +STR_PARK :Geoffrey Kert STR_DTLS :Egy nagy kertnek arra van szüksége, hogy sikeres vidámpark legyen belőle @@ -4218,9 +4223,9 @@ STR_PARK :Szellemváros STR_DTLS :Egy nagy vidámparklánc felbérelt, hogy építs nekik óriási hullámvasútparkot egy elhagyatott bányászváros köré -STR_SCNR :Gravitációs Kertek -STR_PARK :Gravitációs Kertek -STR_DTLS :A kihívásod az, hogy építs egy hullámvasútparkot a gyönyörű Gravitációs Kertekben. Semmi más játékot, csak hullámvasutakat! +STR_SCNR :Gravitációs Kert +STR_PARK :Gravitációs Kert +STR_DTLS :A kihívásod az, hogy építs egy hullámvasútparkot a gyönyörű Gravitációs Kertben. Semmi más játékot, csak hullámvasutakat! STR_SCNR :Pokoli Kilátások diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 0a6f409f0a..6d13e60581 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -2585,7 +2585,7 @@ STR_5335 :놀이기구 입구 STR_5336 :놀이기구 출구 STR_5337 :공원 입구 STR_5338 :요소 종류 -STR_5339 :기본 고도 +STR_5339 :기본 높이 STR_5340 :최상단 높이 STR_5343 :직원 자동 배치 STR_5344 :변경기록 @@ -2783,9 +2783,9 @@ STR_5612 :유령 플래그 STR_5613 :B STR_5614 :깨짐 플래그 STR_5615 :L -STR_5616 :타일 플래그의 마지막 요소 -STR_5617 :선택한 요소를 위로 이동합니다. -STR_5618 :선택한 요소를 아래로 이동합니다. +STR_5616 :이 칸의 마지막 요소 +STR_5617 :선택한 요소를 위로 이동합니다 +STR_5618 :선택한 요소를 아래로 이동합니다 STR_5619 :롤러코스터 타이쿤 STR_5620 :애디드 어트랙션 STR_5621 :루피 랜드스케이프 @@ -3689,6 +3689,11 @@ STR_6614 :공원 입장료를 변경할 수 없습니다 STR_6615 :이 칸에 있는 트랙은 물이 있어야 합니다 STR_6616 :그 직원에 대한 잘못된 행동입니다 STR_6617 :칸 요소를 자기 자신과 바꿀 수는 없습니다 +STR_6618 :오브젝트를 제한하거나 제한 해제할 수 없습니다… +STR_6619 :오브젝트 종류를 제한할 수 없습니다! +STR_6620 :오브젝트를 찾을 수 없습니다! +STR_6621 :제한 +STR_6622 :시나리오 에디터 및 모래상자 모드에서 선택한 오브젝트를 사용할 수 없도록 제한합니다. ############# # Scenarios # From 9ab18e37a21ae58562611b92239394a4a6d4fe33 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Mon, 4 Mar 2024 21:34:08 +0000 Subject: [PATCH 037/191] Cleanup static_cast's Cleanup static_cast's Cleanup static_casts' Cleanup static_casts' Format Code Address requested changes Address requested changes Change uint16_t to size_t Stop undefined behaviour Address requested changes. --- src/openrct2/Diagnostic.cpp | 10 +++++----- src/openrct2/core/Imaging.cpp | 2 +- src/openrct2/drawing/Drawing.h | 6 +++--- src/openrct2/drawing/ImageImporter.cpp | 4 ++-- src/openrct2/drawing/Weather.cpp | 5 +++-- src/openrct2/interface/Colour.cpp | 4 ++-- src/openrct2/math/Trigonometry.hpp | 2 +- src/openrct2/ride/Vehicle.cpp | 6 +++--- src/openrct2/ride/VehicleSubpositionData.cpp | 2 +- .../scripting/bindings/ride/ScTrackSegment.cpp | 3 +-- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/openrct2/Diagnostic.cpp b/src/openrct2/Diagnostic.cpp index a800f2e2fe..c6554a0f26 100644 --- a/src/openrct2/Diagnostic.cpp +++ b/src/openrct2/Diagnostic.cpp @@ -21,7 +21,7 @@ #endif [[maybe_unused]] static bool _log_location_enabled = true; -bool _log_levels[static_cast(DiagnosticLevel::Count)] = { +bool _log_levels[EnumValue(DiagnosticLevel::Count)] = { true, true, true, false, true, }; @@ -47,7 +47,7 @@ void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...) { va_list args; - if (!_log_levels[static_cast(diagnosticLevel)]) + if (!_log_levels[EnumValue(diagnosticLevel)]) return; va_start(args, format); @@ -61,7 +61,7 @@ void DiagnosticLogWithLocation( va_list args; char buf[1024]; - if (!_log_levels[static_cast(diagnosticLevel)]) + if (!_log_levels[EnumValue(diagnosticLevel)]) return; snprintf(buf, 1024, "[%s:%d (%s)]: ", file, line, function); @@ -89,7 +89,7 @@ static void DiagnosticPrint(DiagnosticLevel level, const std::string& prefix, co void DiagnosticLog(DiagnosticLevel diagnosticLevel, const char* format, ...) { va_list args; - if (_log_levels[static_cast(diagnosticLevel)]) + if (_log_levels[EnumValue(diagnosticLevel)]) { // Level auto prefix = String::StdFormat("%s: ", _level_strings[EnumValue(diagnosticLevel)]); @@ -107,7 +107,7 @@ void DiagnosticLogWithLocation( DiagnosticLevel diagnosticLevel, const char* file, const char* function, int32_t line, const char* format, ...) { va_list args; - if (_log_levels[static_cast(diagnosticLevel)]) + if (_log_levels[EnumValue(diagnosticLevel)]) { // Level and source code information std::string prefix; diff --git a/src/openrct2/core/Imaging.cpp b/src/openrct2/core/Imaging.cpp index c43b19b030..a0b3f351e8 100644 --- a/src/openrct2/core/Imaging.cpp +++ b/src/openrct2/core/Imaging.cpp @@ -201,7 +201,7 @@ namespace Imaging } for (size_t i = 0; i < PNG_MAX_PALETTE_LENGTH; i++) { - const auto& entry = (*image.Palette)[static_cast(i)]; + const auto& entry = (*image.Palette)[i]; png_palette[i].blue = entry.Blue; png_palette[i].green = entry.Green; png_palette[i].red = entry.Red; diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index a52b2f4eb5..cc375ef02a 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -44,13 +44,13 @@ struct PaletteBGRA uint8_t Alpha{}; }; -constexpr auto PALETTE_SIZE = 256; +constexpr auto PALETTE_SIZE = 256U; struct GamePalette { PaletteBGRA Colour[PALETTE_SIZE]{}; - PaletteBGRA& operator[](uint16_t idx) + PaletteBGRA& operator[](size_t idx) { assert(idx < PALETTE_SIZE); if (idx >= PALETTE_SIZE) @@ -62,7 +62,7 @@ struct GamePalette return Colour[idx]; } - const PaletteBGRA operator[](uint16_t idx) const + const PaletteBGRA operator[](size_t idx) const { assert(idx < PALETTE_SIZE); if (idx >= PALETTE_SIZE) diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index 650211f76a..2d5354f10a 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -305,7 +305,7 @@ int32_t ImageImporter::GetPaletteIndex(const GamePalette& palette, int16_t* colo { if (!IsTransparentPixel(colour)) { - for (int32_t i = 0; i < PALETTE_SIZE; i++) + for (uint32_t i = 0; i < PALETTE_SIZE; i++) { if (static_cast(palette[i].Red) == colour[0] && static_cast(palette[i].Green) == colour[1] && static_cast(palette[i].Blue) == colour[2]) @@ -363,7 +363,7 @@ int32_t ImageImporter::GetClosestPaletteIndex(const GamePalette& palette, const { auto smallestError = static_cast(-1); auto bestMatch = PALETTE_TRANSPARENT; - for (int32_t x = 0; x < PALETTE_SIZE; x++) + for (uint32_t x = 0; x < PALETTE_SIZE; x++) { if (IsChangablePixel(x)) { diff --git a/src/openrct2/drawing/Weather.cpp b/src/openrct2/drawing/Weather.cpp index 0fcf9ee35d..ef5112e074 100644 --- a/src/openrct2/drawing/Weather.cpp +++ b/src/openrct2/drawing/Weather.cpp @@ -16,6 +16,7 @@ #include "../ride/TrackDesign.h" #include "../scenario/Scenario.h" #include "../ui/UiContext.h" +#include "../util/Util.h" #include "../world/Climate.h" #include "Drawing.h" #include "IDrawingEngine.h" @@ -66,10 +67,10 @@ void DrawWeather(DrawPixelInfo& dpi, IWeatherDrawer* weatherDrawer) auto weatherLevel = GetGameState().ClimateCurrent.Level; if (weatherLevel != WeatherLevel::None && !gTrackDesignSaveMode && !(viewFlags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES)) { - auto drawFunc = DrawRainFunctions[static_cast(weatherLevel)]; + auto drawFunc = DrawRainFunctions[EnumValue(weatherLevel)]; if (ClimateIsSnowing()) { - drawFunc = DrawSnowFunctions[static_cast(weatherLevel)]; + drawFunc = DrawSnowFunctions[EnumValue(weatherLevel)]; } auto uiContext = GetContext()->GetUiContext(); uiContext->DrawWeatherAnimation(weatherDrawer, dpi, drawFunc); diff --git a/src/openrct2/interface/Colour.cpp b/src/openrct2/interface/Colour.cpp index 1514e287a0..97dec8f039 100644 --- a/src/openrct2/interface/Colour.cpp +++ b/src/openrct2/interface/Colour.cpp @@ -156,9 +156,9 @@ static uint8_t FindClosestPaletteIndex(uint8_t red, uint8_t green, uint8_t blue) static void InitBlendColourMap() { - for (int i = 0; i < PALETTE_SIZE; i++) + for (size_t i = 0; i < PALETTE_SIZE; i++) { - for (int j = i; j < PALETTE_SIZE; j++) + for (size_t j = i; j < PALETTE_SIZE; j++) { uint8_t red = (gPalette[i].Red + gPalette[j].Red) / 2; uint8_t green = (gPalette[i].Green + gPalette[j].Green) / 2; diff --git a/src/openrct2/math/Trigonometry.hpp b/src/openrct2/math/Trigonometry.hpp index 0ec685dd80..f5a617af56 100644 --- a/src/openrct2/math/Trigonometry.hpp +++ b/src/openrct2/math/Trigonometry.hpp @@ -106,7 +106,7 @@ namespace OpenRCT2::Math::Trigonometry constexpr int32_t ComputeHorizontalMagnitude(int32_t length, uint8_t pitch) { - return (-PitchToDirectionVectorFromGeometry[static_cast(pitch)].y * length) / 256; + return (-PitchToDirectionVectorFromGeometry[pitch].y * length) / 256; } constexpr CoordsXY ComputeXYVector(int32_t magnitude, uint8_t yaw) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 60957501e5..ab92586cab 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -4823,17 +4823,17 @@ void Vehicle::UpdateRotating() timeToSpriteMap = Rotation3TimeToSpriteMaps[sub_state]; } - int32_t time = current_time; + uint16_t time = current_time; if (_vehicleBreakdown == BREAKDOWN_CONTROL_FAILURE) { time += (curRide->breakdown_sound_modifier >> 6) + 1; } time++; - uint8_t sprite = timeToSpriteMap[static_cast(time)]; + uint8_t sprite = timeToSpriteMap[time]; if (sprite != 0xFF) { - current_time = static_cast(time); + current_time = time; if (sprite == Pitch) return; Pitch = sprite; diff --git a/src/openrct2/ride/VehicleSubpositionData.cpp b/src/openrct2/ride/VehicleSubpositionData.cpp index 53cdc1f3c4..4a1696f887 100644 --- a/src/openrct2/ride/VehicleSubpositionData.cpp +++ b/src/openrct2/ride/VehicleSubpositionData.cpp @@ -31742,7 +31742,7 @@ static constexpr const VehicleInfoList *TrackVehicleInfoListReverserRCRearBogie[ }; // rct2: 0x008B8F30 -constexpr const VehicleInfoList * const * gTrackVehicleInfo[static_cast(VehicleTrackSubposition::Count)] = { +constexpr const VehicleInfoList * const * gTrackVehicleInfo[EnumValue(VehicleTrackSubposition::Count)] = { TrackVehicleInfoListDefault, // VehicleTrackSubposition::Default TrackVehicleInfoListChairliftGoingOut, // VehicleTrackSubposition::ChairliftGoingOut TrackVehicleInfoListChairliftGoingBack, // VehicleTrackSubposition::ChairliftGoingBack diff --git a/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp b/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp index 56421b7982..64df591cd9 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp +++ b/src/openrct2/scripting/bindings/ride/ScTrackSegment.cpp @@ -189,8 +189,7 @@ std::vector ScTrackSegment::getSubpositions(uint8_t trackSubposition, for (auto idx = 0; idx < size; idx++) { - result.push_back( - ToDuk(ctx, gTrackVehicleInfo[static_cast(trackSubposition)][typeAndDirection]->info[idx])); + result.push_back(ToDuk(ctx, gTrackVehicleInfo[trackSubposition][typeAndDirection]->info[idx])); } return result; } From ee4e8d0323e83dc4f675459ebe6e4086609a5917 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Tue, 5 Mar 2024 22:31:27 +0100 Subject: [PATCH 038/191] Move gSamePriceThroughoutPark to GameState_t --- src/openrct2-ui/windows/Ride.cpp | 15 ++++++++------- src/openrct2/GameState.h | 1 + src/openrct2/actions/ParkSetParameterAction.cpp | 2 +- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 4 ++-- src/openrct2/rct2/S6Importer.cpp | 3 ++- src/openrct2/ride/ShopItem.cpp | 7 ++++--- src/openrct2/ride/ShopItem.h | 2 -- 8 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 5fcacffb73..642b3b26a1 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5914,23 +5914,24 @@ private: static void UpdateSamePriceThroughoutFlags(ShopItem shop_item) { + const auto& gameState = GetGameState(); + const auto existingFlags = gameState.SamePriceThroughoutPark; + + auto newFlags = existingFlags; if (GetShopItemDescriptor(shop_item).IsPhoto()) { - auto newFlags = gSamePriceThroughoutPark; - if (gSamePriceThroughoutPark & EnumToFlag(shop_item)) + if (existingFlags & EnumToFlag(shop_item)) newFlags &= ~EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); else newFlags |= EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); - auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); - GameActions::Execute(&parkSetParameter); } else { - auto newFlags = gSamePriceThroughoutPark; newFlags ^= EnumToFlag(shop_item); - auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); - GameActions::Execute(&parkSetParameter); } + + auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); + GameActions::Execute(&parkSetParameter); } void IncomeTogglePrimaryPrice() diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 09034b7945..8018ef152e 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -101,6 +101,7 @@ namespace OpenRCT2 colour_t StaffHandymanColour; colour_t StaffMechanicColour; colour_t StaffSecurityColour; + uint64_t SamePriceThroughoutPark{}; uint8_t ResearchFundingLevel; uint8_t ResearchPriorities; diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index af35815c34..0da59e5072 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -73,7 +73,7 @@ GameActions::Result ParkSetParameterAction::Execute() const } break; case ParkParameter::SamePriceInPark: - gSamePriceThroughoutPark = _value; + gameState.SamePriceThroughoutPark = _value; WindowInvalidateByClass(WindowClass::Ride); break; default: diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index a71f89e5b0..6d609c902c 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -821,7 +821,7 @@ namespace OpenRCT2 cs.ReadWrite(gameState.StaffHandymanColour); cs.ReadWrite(gameState.StaffMechanicColour); cs.ReadWrite(gameState.StaffSecurityColour); - cs.ReadWrite(gSamePriceThroughoutPark); + cs.ReadWrite(gameState.SamePriceThroughoutPark); // Finances if (cs.GetMode() == OrcaStream::Mode::READING) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 970d5ee818..4c4c21f2d0 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2236,10 +2236,10 @@ namespace RCT1 gameState.ParkSize = _s4.ParkSize; gameState.TotalRideValueForMoney = _s4.TotalRideValueForMoney; - gSamePriceThroughoutPark = 0; + gameState.SamePriceThroughoutPark = 0; if (_gameVersion == FILE_VERSION_RCT1_LL) { - gSamePriceThroughoutPark = _s4.SamePriceThroughout; + gameState.SamePriceThroughoutPark = _s4.SamePriceThroughout; } } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 36f8b5e86a..0416d109e9 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -403,7 +403,8 @@ namespace RCT2 // Pad013587FC gParkRatingCasualtyPenalty = _s6.ParkRatingCasualtyPenalty; gameState.MapSize = { _s6.MapSize, _s6.MapSize }; - gSamePriceThroughoutPark = _s6.SamePriceThroughout | (static_cast(_s6.SamePriceThroughoutExtended) << 32); + gameState.SamePriceThroughoutPark = _s6.SamePriceThroughout + | (static_cast(_s6.SamePriceThroughoutExtended) << 32); gameState.SuggestedGuestMaximum = _s6.SuggestedMaxGuests; gameState.ScenarioParkRatingWarningDays = _s6.ParkRatingWarningDays; gLastEntranceStyle = _s6.LastEntranceStyle; diff --git a/src/openrct2/ride/ShopItem.cpp b/src/openrct2/ride/ShopItem.cpp index 1dd91d92ed..f85620c1a2 100644 --- a/src/openrct2/ride/ShopItem.cpp +++ b/src/openrct2/ride/ShopItem.cpp @@ -9,19 +9,20 @@ #include "ShopItem.h" +#include "../GameState.h" #include "../common.h" #include "../entity/Guest.h" #include "../localisation/StringIds.h" #include "../ride/RideEntry.h" #include "../sprites.h" +using namespace OpenRCT2; + ShopItem& operator++(ShopItem& d, int) { return d = (d == ShopItem::Count) ? ShopItem::Balloon : ShopItem(EnumValue(d) + 1); } -uint64_t gSamePriceThroughoutPark; - // clang-format off /** rct2: 0x00982164 (cost, base value, hot and cold value); 0x00982358 (default price) */ constexpr ShopItemDescriptor ShopItems[EnumValue(ShopItem::Count)] = { @@ -146,7 +147,7 @@ money64 ShopItemGetCommonPrice(Ride* forRide, const ShopItem shopItem) bool ShopItemHasCommonPrice(const ShopItem shopItem) { - return (gSamePriceThroughoutPark & EnumToFlag(shopItem)) != 0; + return (GetGameState().SamePriceThroughoutPark & EnumToFlag(shopItem)) != 0; } bool ShopItemDescriptor::IsFood() const diff --git a/src/openrct2/ride/ShopItem.h b/src/openrct2/ride/ShopItem.h index 241ecfae5f..9aa53277c5 100644 --- a/src/openrct2/ride/ShopItem.h +++ b/src/openrct2/ride/ShopItem.h @@ -128,8 +128,6 @@ enum SHOP_ITEM_FLAG_IS_RECOLOURABLE = (1 << 5), }; -extern uint64_t gSamePriceThroughoutPark; - money64 ShopItemGetCommonPrice(Ride* forRide, const ShopItem shopItem); bool ShopItemHasCommonPrice(const ShopItem shopItem); From 56df47a48d9ef6d85491af59a6164903cfe58899 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Tue, 5 Mar 2024 22:01:47 +0100 Subject: [PATCH 039/191] Move gRideRatingUpdateStates to GameState_t - Move gRideRatingUpdateStates variable to GameState_t - Remove RideRatingGetUpdateStates function --- src/openrct2/GameState.h | 2 ++ src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/RideRatings.cpp | 15 +++++---------- src/openrct2/ride/RideRatings.h | 2 -- 5 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 8018ef152e..66757b972e 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -17,6 +17,7 @@ #include "management/Finance.h" #include "management/NewsItem.h" #include "ride/Ride.h" +#include "ride/RideRatings.h" #include "scenario/Scenario.h" #include "world/Banner.h" #include "world/Climate.h" @@ -92,6 +93,7 @@ namespace OpenRCT2 std::vector Banners; // Ride storage for all the rides in the park, rides with RideId::Null are considered free. std::array Rides{}; + ::RideRatingUpdateStates RideRatingUpdateStates; std::vector TileElements; std::vector RestrictedScenery; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 6d609c902c..2cc8c084c7 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -552,7 +552,7 @@ namespace OpenRCT2 cs.ReadWrite(gGrassSceneryTileLoopPosition); cs.ReadWrite(gWidePathTileLoopPosition); - auto& rideRatings = RideRatingGetUpdateStates(); + auto& rideRatings = gameState.RideRatingUpdateStates; if (os.GetHeader().TargetVersion >= 21) { cs.ReadWriteArray(rideRatings, [this, &cs](RideRatingUpdateState& calcData) { diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 0416d109e9..fd37bbd069 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1613,7 +1613,7 @@ namespace RCT2 const auto& src = _s6.RideRatingsCalcData; // S6 has only one state, ensure we reset all states before reading the first one. RideRatingResetUpdateStates(); - auto& rideRatingStates = RideRatingGetUpdateStates(); + auto& rideRatingStates = GetGameState().RideRatingUpdateStates; auto& dst = rideRatingStates[0]; dst = {}; dst.Proximity = { src.ProximityX, src.ProximityY, src.ProximityZ }; diff --git a/src/openrct2/ride/RideRatings.cpp b/src/openrct2/ride/RideRatings.cpp index 340954cfed..55f2c96c8f 100644 --- a/src/openrct2/ride/RideRatings.cpp +++ b/src/openrct2/ride/RideRatings.cpp @@ -78,8 +78,6 @@ struct ShelteredEights uint8_t TotalShelteredEighths; }; -static RideRatingUpdateStates gRideRatingUpdateStates; - // Amount of updates allowed per updating state on the current tick. // The total amount would be MaxRideRatingSubSteps * RideRatingMaxUpdateStates which // would be currently 80, this is the worst case of sub-steps and may break out earlier. @@ -153,17 +151,13 @@ static void RideRatingsApplyRequirementStations(RatingTuple& ratings, const Ride static void RideRatingsApplyRequirementSplashdown(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier); static void RideRatingsApplyPenaltyLateralGs(RatingTuple& ratings, const Ride& ride, RatingsModifier modifier); -RideRatingUpdateStates& RideRatingGetUpdateStates() -{ - return gRideRatingUpdateStates; -} - void RideRatingResetUpdateStates() { RideRatingUpdateState nullState{}; nullState.State = RIDE_RATINGS_STATE_FIND_NEXT_RIDE; - std::fill(gRideRatingUpdateStates.begin(), gRideRatingUpdateStates.end(), nullState); + auto& updateStates = GetGameState().RideRatingUpdateStates; + std::fill(updateStates.begin(), updateStates.end(), nullState); } /** @@ -197,7 +191,7 @@ void RideRatingsUpdateAll() if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) return; - for (auto& updateState : gRideRatingUpdateStates) + for (auto& updateState : GetGameState().RideRatingUpdateStates) { for (size_t i = 0; i < MaxRideRatingUpdateSubSteps; ++i) { @@ -237,7 +231,8 @@ static void ride_ratings_update_state(RideRatingUpdateState& state) static bool RideRatingIsUpdatingRide(RideId id) { - return std::any_of(gRideRatingUpdateStates.begin(), gRideRatingUpdateStates.end(), [id](auto& state) { + const auto& updateStates = GetGameState().RideRatingUpdateStates; + return std::any_of(updateStates.begin(), updateStates.end(), [id](auto& state) { return state.CurrentRide == id && state.State != RIDE_RATINGS_STATE_FIND_NEXT_RIDE; }); } diff --git a/src/openrct2/ride/RideRatings.h b/src/openrct2/ride/RideRatings.h index 82c8579d62..27c16bd617 100644 --- a/src/openrct2/ride/RideRatings.h +++ b/src/openrct2/ride/RideRatings.h @@ -55,10 +55,8 @@ struct RideRatingUpdateState }; static constexpr size_t RideRatingMaxUpdateStates = 4; - using RideRatingUpdateStates = std::array; -RideRatingUpdateStates& RideRatingGetUpdateStates(); void RideRatingResetUpdateStates(); void RideRatingsUpdateRide(const Ride& ride); From 01248c26a46109f7e0d59ddf12dda4a778037c3b Mon Sep 17 00:00:00 2001 From: Stephan Spengler Date: Wed, 6 Mar 2024 18:22:50 +0100 Subject: [PATCH 040/191] Improve API documentation: use Direction type in FootpathElement Change type of slopeDirection and queueBannerDirection of footpaths to Direction in openrct2.d.ts --- distribution/openrct2.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 4b7e5f28d7..60e5dde1ad 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1503,12 +1503,12 @@ declare global { edges: number; corners: number; - slopeDirection: number | null; + slopeDirection: Direction | null; isBlockedByVehicle: boolean; isWide: boolean; isQueue: boolean; - queueBannerDirection: number | null; + queueBannerDirection: Direction | null; ride: number | null; station: number | null; From 96be44153330956808c5227eb7785bfca91d9a37 Mon Sep 17 00:00:00 2001 From: Piotr Kubaj Date: Wed, 6 Mar 2024 18:02:27 +0000 Subject: [PATCH 041/191] Don't include alloca.h on FreeBSD (#21535) alloca.h does not exist on FreeBSD. --- src/openrct2/core/String.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/openrct2/core/String.cpp b/src/openrct2/core/String.cpp index 8db36139a3..9800f8d0bf 100644 --- a/src/openrct2/core/String.cpp +++ b/src/openrct2/core/String.cpp @@ -15,7 +15,9 @@ #include #include #ifndef _WIN32 -# include +# ifndef __FreeBSD__ +# include +# endif # include # include # include From d3b8ad471ee4c9a5f5d512a647050444549e74c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 7 Mar 2024 00:54:09 +0200 Subject: [PATCH 042/191] Turn the error into a verbose message when there is no viewport --- src/openrct2/interface/Viewport.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 1ee356a80b..8c0f77651d 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -2154,7 +2154,7 @@ uint8_t GetCurrentRotation() auto* viewport = ViewportGetMain(); if (viewport == nullptr) { - LOG_ERROR("No viewport found! Will return 0."); + LOG_VERBOSE("No viewport found! Will return 0."); return 0; } uint8_t rotation = viewport->rotation; From 2814662ea8b343e946aa0f852eb2413f1d54d242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 7 Mar 2024 01:05:47 +0200 Subject: [PATCH 043/191] Remove unnecessary reset of entities spatial index, coordinates are 3D --- src/openrct2/interface/Viewport.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 8c0f77651d..65eb269a9a 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -885,7 +885,6 @@ static void ViewportRotateSingleInternal(WindowBase& w, int32_t direction) void ViewportRotateSingle(WindowBase* window, int32_t direction) { ViewportRotateSingleInternal(*window, direction); - ResetAllSpriteQuadrantPlacements(); } void ViewportRotateAll(int32_t direction) @@ -898,7 +897,6 @@ void ViewportRotateAll(int32_t direction) return; ViewportRotateSingleInternal(*w, direction); }); - ResetAllSpriteQuadrantPlacements(); } /** From 81814bd81eed1bc8e258e7c212796b77bf1a5608 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson Date: Thu, 7 Mar 2024 18:44:21 +0000 Subject: [PATCH 044/191] Move gLandPrice to GameState_t --- src/openrct2-ui/windows/EditorScenarioOptions.cpp | 10 +++++----- src/openrct2/GameState.h | 1 + src/openrct2/actions/LandBuyRightsAction.cpp | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/ScenarioSetSettingAction.cpp | 2 +- src/openrct2/interface/InteractiveConsole.cpp | 2 +- src/openrct2/park/ParkFile.cpp | 4 ++-- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/scripting/bindings/world/ScPark.cpp | 4 ++-- src/openrct2/world/Park.cpp | 4 +--- src/openrct2/world/Park.h | 2 -- 12 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 47cd8b969d..5a68fb0c64 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -1005,10 +1005,10 @@ private: switch (widgetIndex) { case WIDX_LAND_COST_INCREASE: - if (gLandPrice < 200.00_GBP) + if (gameState.LandPrice < 200.00_GBP) { auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::CostToBuyLand, gLandPrice + 1.00_GBP); + ScenarioSetSetting::CostToBuyLand, gameState.LandPrice + 1.00_GBP); GameActions::Execute(&scenarioSetSetting); } else @@ -1018,10 +1018,10 @@ private: Invalidate(); break; case WIDX_LAND_COST_DECREASE: - if (gLandPrice > 5.00_GBP) + if (gameState.LandPrice > 5.00_GBP) { auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::CostToBuyLand, gLandPrice - 1.00_GBP); + ScenarioSetSetting::CostToBuyLand, gameState.LandPrice - 1.00_GBP); GameActions::Execute(&scenarioSetSetting); } else @@ -1215,7 +1215,7 @@ private: // Cost to buy land value screenCoords = windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top }; auto ft = Formatter(); - ft.Add(gLandPrice); + ft.Add(gameState.LandPrice); DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index d310163a18..80451a60e8 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -82,6 +82,7 @@ namespace OpenRCT2 money64 ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][static_cast(ExpenditureType::Count)]; random_engine_t ScenarioRand; TileCoordsXY MapSize; + money64 LandPrice; ::EditorStep EditorStep; diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 74a025e6a5..e976375579 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -144,7 +144,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& surfaceElement->SetOwnership(OWNERSHIP_OWNED); ParkUpdateFencesAroundTile(loc); } - res.Cost = gLandPrice; + res.Cost = GetGameState().LandPrice; return res; case LandBuyRightSetting::BuyConstructionRights: // 2 diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 4dfc838413..9b7de8c1d6 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -184,7 +184,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& } } - res.Cost = gLandPrice; + res.Cost = GetGameState().LandPrice; if (isExecuting) { if (_ownership != OWNERSHIP_UNOWNED) diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index 60a2fb773f..bc64961cc0 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -146,7 +146,7 @@ GameActions::Result ScenarioSetSettingAction::Execute() const } break; case ScenarioSetSetting::CostToBuyLand: - gLandPrice = std::clamp(_value, 5.00_GBP, 200.00_GBP); + gameState.LandPrice = std::clamp(_value, 5.00_GBP, 200.00_GBP); break; case ScenarioSetSetting::CostToBuyConstructionRights: gameState.ConstructionRightsPrice = std::clamp(_value, 5.00_GBP, 200.00_GBP); diff --git a/src/openrct2/interface/InteractiveConsole.cpp b/src/openrct2/interface/InteractiveConsole.cpp index 9013e739c4..d064257f6a 100644 --- a/src/openrct2/interface/InteractiveConsole.cpp +++ b/src/openrct2/interface/InteractiveConsole.cpp @@ -668,7 +668,7 @@ static int32_t ConsoleCommandGet(InteractiveConsole& console, const arguments_t& } else if (argv[0] == "land_rights_cost") { - console.WriteFormatLine("land_rights_cost %d.%d0", gLandPrice / 10, gLandPrice % 10); + console.WriteFormatLine("land_rights_cost %d.%d0", gameState.LandPrice / 10, gameState.LandPrice % 10); } else if (argv[0] == "construction_rights_cost") { diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index c5dad5fa8a..1b10cc3907 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -541,12 +541,12 @@ namespace OpenRCT2 money16 tempConstructionRightPrice{}; cs.ReadWrite(tempLandPrice); cs.ReadWrite(tempConstructionRightPrice); - gLandPrice = ToMoney64(tempLandPrice); + gameState.LandPrice = ToMoney64(tempLandPrice); gameState.ConstructionRightsPrice = ToMoney64(tempConstructionRightPrice); } else { - cs.ReadWrite(gLandPrice); + cs.ReadWrite(gameState.LandPrice); cs.ReadWrite(gameState.ConstructionRightsPrice); } cs.ReadWrite(gGrassSceneryTileLoopPosition); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 970d5ee818..d6c506bb23 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1425,7 +1425,7 @@ namespace RCT1 void ImportFinance(GameState_t& gameState) { gameState.ParkEntranceFee = _s4.ParkEntranceFee; - gLandPrice = ToMoney64(_s4.LandPrice); + gameState.LandPrice = ToMoney64(_s4.LandPrice); gameState.ConstructionRightsPrice = ToMoney64(_s4.ConstructionRightsPrice); gameState.Cash = ToMoney64(_s4.Cash); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 910464b52f..76f62bed87 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -387,7 +387,7 @@ namespace RCT2 } } - gLandPrice = ToMoney64(_s6.LandPrice); + gameState.LandPrice = ToMoney64(_s6.LandPrice); gameState.ConstructionRightsPrice = ToMoney64(_s6.ConstructionRightsPrice); // unk_01358774 // Pad01358776 diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index 58b7e59cea..d7bc857dcd 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -243,12 +243,12 @@ namespace OpenRCT2::Scripting money64 ScPark::landPrice_get() const { - return gLandPrice; + return GetGameState().LandPrice; } void ScPark::landPrice_set(money64 value) { ThrowIfGameStateNotMutable(); - gLandPrice = value; + GetGameState().LandPrice = value; } money64 ScPark::constructionRightsPrice_get() const diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 4f3eda7aae..68ff18ee35 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -47,8 +47,6 @@ using namespace OpenRCT2; -money64 gLandPrice; - int16_t gParkRatingCasualtyPenalty; // If this value is more than or equal to 0, the park rating is forced to this value. Used for cheat @@ -272,7 +270,7 @@ void Park::Initialise() gameState.ScenarioObjective.Type = OBJECTIVE_GUESTS_BY; gameState.ScenarioObjective.Year = 4; gameState.ScenarioObjective.NumGuests = 1000; - gLandPrice = 90.00_GBP; + gameState.LandPrice = 90.00_GBP; gameState.ConstructionRightsPrice = 40.00_GBP; gameState.ParkFlags = PARK_FLAGS_NO_MONEY | PARK_FLAGS_SHOW_REAL_GUEST_NAMES; ResetHistories(); diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 404bcdb78c..0337793c50 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -92,8 +92,6 @@ namespace OpenRCT2 }; } // namespace OpenRCT2 -extern money64 gLandPrice; - extern int16_t gParkRatingCasualtyPenalty; void ParkSetForcedRating(int32_t rating); From 64bc52c5f6c70eb500a9b1989e4d623d6655325c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Thu, 7 Mar 2024 21:56:39 +0200 Subject: [PATCH 045/191] Update changelog.txt --- distribution/changelog.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index a1ba38e2f6..b1330260e8 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,7 @@ 0.4.10 (in development) ------------------------------------------------------------------------ +- Improved: [#21424] Extra viewports can now rotate independently from the main viewport. +- Fix: [#910] Extra viewport does not preserve the location when rotating. 0.4.9 (2024-03-02) ------------------------------------------------------------------------ From cb100db56e4737c4594afa7712d412c1166e9ded Mon Sep 17 00:00:00 2001 From: Duncan Date: Thu, 7 Mar 2024 22:36:49 +0000 Subject: [PATCH 046/191] Put a number of OpenRCT2::Ui items in the OpenRCT2::Ui namespace --- src/openrct2-ui/SDLException.cpp | 2 + src/openrct2-ui/SDLException.h | 29 +- src/openrct2-ui/UiContext.h | 62 +-- src/openrct2-ui/audio/AudioContext.cpp | 2 +- src/openrct2-ui/drawing/BitmapReader.cpp | 139 +++--- src/openrct2-ui/drawing/BitmapReader.h | 5 +- .../drawing/engines/DrawingEngineFactory.hpp | 59 ++- .../engines/opengl/ApplyPaletteShader.cpp | 2 + .../engines/opengl/ApplyPaletteShader.h | 37 +- .../opengl/ApplyTransparencyShader.cpp | 2 + .../engines/opengl/ApplyTransparencyShader.h | 48 ++- .../drawing/engines/opengl/DrawCommands.h | 206 ++++----- .../drawing/engines/opengl/DrawLineShader.cpp | 2 + .../drawing/engines/opengl/DrawLineShader.h | 42 +- .../drawing/engines/opengl/DrawRectShader.cpp | 2 + .../drawing/engines/opengl/DrawRectShader.h | 74 ++-- .../drawing/engines/opengl/GLSLTypes.h | 162 +++---- .../drawing/engines/opengl/OpenGLAPI.cpp | 6 +- .../drawing/engines/opengl/OpenGLAPI.h | 37 +- .../engines/opengl/OpenGLFramebuffer.cpp | 2 + .../engines/opengl/OpenGLFramebuffer.h | 84 ++-- .../engines/opengl/OpenGLShaderProgram.cpp | 2 +- .../engines/opengl/OpenGLShaderProgram.h | 64 +-- .../engines/opengl/SwapFramebuffer.cpp | 2 + .../drawing/engines/opengl/SwapFramebuffer.h | 76 ++-- .../drawing/engines/opengl/TextureCache.cpp | 2 + .../drawing/engines/opengl/TextureCache.h | 403 +++++++++--------- .../engines/opengl/TransparencyDepth.cpp | 338 +++++++-------- .../engines/opengl/TransparencyDepth.h | 15 +- 29 files changed, 980 insertions(+), 926 deletions(-) diff --git a/src/openrct2-ui/SDLException.cpp b/src/openrct2-ui/SDLException.cpp index a358abcaa6..7623981ffc 100644 --- a/src/openrct2-ui/SDLException.cpp +++ b/src/openrct2-ui/SDLException.cpp @@ -11,6 +11,8 @@ #include +using namespace OpenRCT2::Ui; + SDLException::SDLException(const std::string& message) : runtime_error(message.c_str()) { diff --git a/src/openrct2-ui/SDLException.h b/src/openrct2-ui/SDLException.h index 6ba8aed36d..06f01d78cf 100644 --- a/src/openrct2-ui/SDLException.h +++ b/src/openrct2-ui/SDLException.h @@ -12,19 +12,22 @@ #include #include -/** - * An exception which wraps an SDL error. - */ -class SDLException : public std::runtime_error +namespace OpenRCT2::Ui { -public: - explicit SDLException(const std::string& message); - - explicit SDLException(const char* message); - /** - * Throws an SDL exception with a message containing the given call information - * and the message given by SDL_GetError. + * An exception which wraps an SDL error. */ - static void Throw(const char* call); -}; + class SDLException : public std::runtime_error + { + public: + explicit SDLException(const std::string& message); + + explicit SDLException(const char* message); + + /** + * Throws an SDL exception with a message containing the given call information + * and the message given by SDL_GetError. + */ + static void Throw(const char* call); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/UiContext.h b/src/openrct2-ui/UiContext.h index 37d4922701..a98ab7a900 100644 --- a/src/openrct2-ui/UiContext.h +++ b/src/openrct2-ui/UiContext.h @@ -20,35 +20,35 @@ namespace OpenRCT2 { struct IContext; struct IPlatformEnvironment; - - namespace Ui - { - struct FileDialogDesc; - class InGameConsole; - struct IUiContext; - - struct IPlatformUiContext - { - virtual ~IPlatformUiContext() = default; - virtual void SetWindowIcon(SDL_Window* window) abstract; - virtual bool IsSteamOverlayAttached() abstract; - - virtual void ShowMessageBox(SDL_Window* window, const std::string& message) abstract; - virtual bool HasMenuSupport() abstract; - virtual int32_t ShowMenuDialog( - const std::vector& options, const std::string& title, const std::string& text) abstract; - virtual void OpenFolder(const std::string& path) abstract; - - virtual void OpenURL(const std::string& url) abstract; - virtual std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) abstract; - virtual std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) abstract; - - virtual bool HasFilePicker() const abstract; - }; - - [[nodiscard]] std::unique_ptr CreateUiContext(const std::shared_ptr& env); - [[nodiscard]] std::unique_ptr CreatePlatformUiContext(); - - [[nodiscard]] InGameConsole& GetInGameConsole(); - } // namespace Ui } // namespace OpenRCT2 + +namespace OpenRCT2::Ui +{ + struct FileDialogDesc; + class InGameConsole; + struct IUiContext; + + struct IPlatformUiContext + { + virtual ~IPlatformUiContext() = default; + virtual void SetWindowIcon(SDL_Window* window) abstract; + virtual bool IsSteamOverlayAttached() abstract; + + virtual void ShowMessageBox(SDL_Window* window, const std::string& message) abstract; + virtual bool HasMenuSupport() abstract; + virtual int32_t ShowMenuDialog( + const std::vector& options, const std::string& title, const std::string& text) abstract; + virtual void OpenFolder(const std::string& path) abstract; + + virtual void OpenURL(const std::string& url) abstract; + virtual std::string ShowFileDialog(SDL_Window* window, const FileDialogDesc& desc) abstract; + virtual std::string ShowDirectoryDialog(SDL_Window* window, const std::string& title) abstract; + + virtual bool HasFilePicker() const abstract; + }; + + [[nodiscard]] std::unique_ptr CreateUiContext(const std::shared_ptr& env); + [[nodiscard]] std::unique_ptr CreatePlatformUiContext(); + + [[nodiscard]] InGameConsole& GetInGameConsole(); +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/audio/AudioContext.cpp b/src/openrct2-ui/audio/AudioContext.cpp index 9fcb5e3926..829fffc754 100644 --- a/src/openrct2-ui/audio/AudioContext.cpp +++ b/src/openrct2-ui/audio/AudioContext.cpp @@ -34,7 +34,7 @@ namespace OpenRCT2::Audio { if (SDL_Init(SDL_INIT_AUDIO) < 0) { - SDLException::Throw("SDL_Init(SDL_INIT_AUDIO)"); + Ui::SDLException::Throw("SDL_Init(SDL_INIT_AUDIO)"); } _audioMixer = std::make_unique(); } diff --git a/src/openrct2-ui/drawing/BitmapReader.cpp b/src/openrct2-ui/drawing/BitmapReader.cpp index 185fba6fec..242d5b8fb6 100644 --- a/src/openrct2-ui/drawing/BitmapReader.cpp +++ b/src/openrct2-ui/drawing/BitmapReader.cpp @@ -15,90 +15,93 @@ #include #include -static std::vector ReadToVector(std::istream& stream) +namespace OpenRCT2::Ui { - std::vector result; - if (!stream.eof() && !stream.fail()) + static std::vector ReadToVector(std::istream& stream) { - stream.seekg(0, std::ios_base::end); - auto size = stream.tellg(); - result.resize(size); - stream.seekg(0, std::ios_base::beg); - stream.read(reinterpret_cast(result.data()), size); - } - return result; -} - -// TODO Bitmaps aren't very complicated to read so we should probably just write our -// own implementation in libopenrct2 and spare the AOT implementation registration. -static Image ReadBitmap(std::istream& istream, IMAGE_FORMAT format) -{ - auto buffer = ReadToVector(istream); - auto sdlStream = SDL_RWFromConstMem(buffer.data(), static_cast(buffer.size())); - auto bitmap = SDL_LoadBMP_RW(sdlStream, 1); - if (bitmap != nullptr) - { - auto numChannels = bitmap->format->BytesPerPixel; - if (numChannels < 3 || bitmap->format->BitsPerPixel < 24) + std::vector result; + if (!stream.eof() && !stream.fail()) { - SDL_FreeSurface(bitmap); - throw std::runtime_error("Only 24-bit bitmaps are supported."); + stream.seekg(0, std::ios_base::end); + auto size = stream.tellg(); + result.resize(size); + stream.seekg(0, std::ios_base::beg); + stream.read(reinterpret_cast(result.data()), size); } + return result; + } - // Copy pixels over, then discard the surface - if (SDL_LockSurface(bitmap) == 0) + // TODO Bitmaps aren't very complicated to read so we should probably just write our + // own implementation in libopenrct2 and spare the AOT implementation registration. + static Image ReadBitmap(std::istream& istream, IMAGE_FORMAT format) + { + auto buffer = ReadToVector(istream); + auto sdlStream = SDL_RWFromConstMem(buffer.data(), static_cast(buffer.size())); + auto bitmap = SDL_LoadBMP_RW(sdlStream, 1); + if (bitmap != nullptr) { - Image image; - image.Width = bitmap->w; - image.Height = bitmap->h; - image.Depth = 32; - image.Pixels.resize(bitmap->w * bitmap->h * 4); - image.Stride = bitmap->w * 4; - - // Clear image with 0xFF - std::fill(image.Pixels.begin(), image.Pixels.end(), 0xFF); - - // Copy pixels over - auto src = static_cast(bitmap->pixels); - auto dst = image.Pixels.data(); - if (numChannels == 4) + auto numChannels = bitmap->format->BytesPerPixel; + if (numChannels < 3 || bitmap->format->BitsPerPixel < 24) { - for (int32_t y = 0; y < bitmap->h; y++) - { - std::memcpy(dst, src, bitmap->w); - src += bitmap->pitch; - dst += bitmap->w; - } + SDL_FreeSurface(bitmap); + throw std::runtime_error("Only 24-bit bitmaps are supported."); } - else + + // Copy pixels over, then discard the surface + if (SDL_LockSurface(bitmap) == 0) { - for (int32_t y = 0; y < bitmap->h; y++) + Image image; + image.Width = bitmap->w; + image.Height = bitmap->h; + image.Depth = 32; + image.Pixels.resize(bitmap->w * bitmap->h * 4); + image.Stride = bitmap->w * 4; + + // Clear image with 0xFF + std::fill(image.Pixels.begin(), image.Pixels.end(), 0xFF); + + // Copy pixels over + auto src = static_cast(bitmap->pixels); + auto dst = image.Pixels.data(); + if (numChannels == 4) { - for (int32_t x = 0; x < bitmap->w; x++) + for (int32_t y = 0; y < bitmap->h; y++) { - std::memcpy(dst, src, 3); - src += 3; - dst += 4; + std::memcpy(dst, src, bitmap->w); + src += bitmap->pitch; + dst += bitmap->w; } - src += bitmap->pitch - (bitmap->w * 3); } + else + { + for (int32_t y = 0; y < bitmap->h; y++) + { + for (int32_t x = 0; x < bitmap->w; x++) + { + std::memcpy(dst, src, 3); + src += 3; + dst += 4; + } + src += bitmap->pitch - (bitmap->w * 3); + } + } + SDL_UnlockSurface(bitmap); + SDL_FreeSurface(bitmap); + + return image; } - SDL_UnlockSurface(bitmap); + SDL_FreeSurface(bitmap); - - return image; + throw std::runtime_error("Unable to lock surface."); + } + else + { + throw std::runtime_error(SDL_GetError()); } - - SDL_FreeSurface(bitmap); - throw std::runtime_error("Unable to lock surface."); } - else + + void RegisterBitmapReader() { - throw std::runtime_error(SDL_GetError()); + Imaging::SetReader(IMAGE_FORMAT::BITMAP, ReadBitmap); } -} - -void RegisterBitmapReader() -{ - Imaging::SetReader(IMAGE_FORMAT::BITMAP, ReadBitmap); -} +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/BitmapReader.h b/src/openrct2-ui/drawing/BitmapReader.h index 18d6adcf36..75ba243ad8 100644 --- a/src/openrct2-ui/drawing/BitmapReader.h +++ b/src/openrct2-ui/drawing/BitmapReader.h @@ -9,4 +9,7 @@ #pragma once -void RegisterBitmapReader(); +namespace OpenRCT2::Ui +{ + void RegisterBitmapReader(); +} diff --git a/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp b/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp index d535b8464b..f852816c87 100644 --- a/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp +++ b/src/openrct2-ui/drawing/engines/DrawingEngineFactory.hpp @@ -13,41 +13,38 @@ #include #include -namespace OpenRCT2 +namespace OpenRCT2::Ui { - namespace Ui + struct IUiContext; + + [[nodiscard]] std::unique_ptr CreateSoftwareDrawingEngine( + const std::shared_ptr& uiContext); + [[nodiscard]] std::unique_ptr CreateHardwareDisplayDrawingEngine( + const std::shared_ptr& uiContext); +#ifndef DISABLE_OPENGL + [[nodiscard]] std::unique_ptr CreateOpenGLDrawingEngine( + const std::shared_ptr& uiContext); +#endif + + class DrawingEngineFactory final : public Drawing::IDrawingEngineFactory { - using namespace OpenRCT2::Drawing; - - struct IUiContext; - - [[nodiscard]] std::unique_ptr CreateSoftwareDrawingEngine(const std::shared_ptr& uiContext); - [[nodiscard]] std::unique_ptr CreateHardwareDisplayDrawingEngine( - const std::shared_ptr& uiContext); -#ifndef DISABLE_OPENGL - [[nodiscard]] std::unique_ptr CreateOpenGLDrawingEngine(const std::shared_ptr& uiContext); -#endif - - class DrawingEngineFactory final : public IDrawingEngineFactory + public: + [[nodiscard]] std::unique_ptr Create( + DrawingEngine type, const std::shared_ptr& uiContext) override { - public: - [[nodiscard]] std::unique_ptr Create( - DrawingEngine type, const std::shared_ptr& uiContext) override + switch (type) { - switch (type) - { - case DrawingEngine::Software: - return CreateSoftwareDrawingEngine(uiContext); - case DrawingEngine::SoftwareWithHardwareDisplay: - return CreateHardwareDisplayDrawingEngine(uiContext); + case DrawingEngine::Software: + return CreateSoftwareDrawingEngine(uiContext); + case DrawingEngine::SoftwareWithHardwareDisplay: + return CreateHardwareDisplayDrawingEngine(uiContext); #ifndef DISABLE_OPENGL - case DrawingEngine::OpenGL: - return CreateOpenGLDrawingEngine(uiContext); + case DrawingEngine::OpenGL: + return CreateOpenGLDrawingEngine(uiContext); #endif - default: - return nullptr; - } + default: + return nullptr; } - }; - } // namespace Ui -} // namespace OpenRCT2 + } + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp index fc75168840..bcd74090c7 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.cpp @@ -11,6 +11,8 @@ # include "ApplyPaletteShader.h" +using namespace OpenRCT2::Ui; + namespace { struct VDStruct diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.h b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.h index c7c94e95b4..a05aea4219 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.h +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyPaletteShader.h @@ -12,27 +12,30 @@ #include "GLSLTypes.h" #include "OpenGLShaderProgram.h" -class ApplyPaletteShader final : public OpenGLShaderProgram +namespace OpenRCT2::Ui { -private: - GLuint uTexture; - GLuint uPalette; + class ApplyPaletteShader final : public OpenGLShaderProgram + { + private: + GLuint uTexture; + GLuint uPalette; - GLuint vPosition; - GLuint vTextureCoordinate; + GLuint vPosition; + GLuint vTextureCoordinate; - GLuint _vbo; - GLuint _vao; + GLuint _vbo; + GLuint _vao; -public: - ApplyPaletteShader(); - ~ApplyPaletteShader() override; + public: + ApplyPaletteShader(); + ~ApplyPaletteShader() override; - static void SetTexture(GLuint texture); - void SetPalette(const vec4* glPalette); + static void SetTexture(GLuint texture); + void SetPalette(const vec4* glPalette); - void Draw(); + void Draw(); -private: - void GetLocations(); -}; + private: + void GetLocations(); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp index 86451d6917..7bbb1f2f4b 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.cpp @@ -11,6 +11,8 @@ # include "ApplyTransparencyShader.h" +using namespace OpenRCT2::Ui; + namespace { struct VDStruct diff --git a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.h b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.h index 9ef4305460..430ed3903c 100644 --- a/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.h +++ b/src/openrct2-ui/drawing/engines/opengl/ApplyTransparencyShader.h @@ -11,32 +11,34 @@ #include "GLSLTypes.h" #include "OpenGLShaderProgram.h" - -class ApplyTransparencyShader final : public OpenGLShaderProgram +namespace OpenRCT2::Ui { -private: - GLuint uOpaqueTex; - GLuint uOpaqueDepth; - GLuint uTransparentTex; - GLuint uTransparentDepth; - GLuint uPaletteTex; - GLuint uBlendPaletteTex; + class ApplyTransparencyShader final : public OpenGLShaderProgram + { + private: + GLuint uOpaqueTex; + GLuint uOpaqueDepth; + GLuint uTransparentTex; + GLuint uTransparentDepth; + GLuint uPaletteTex; + GLuint uBlendPaletteTex; - GLuint vPosition; - GLuint vTextureCoordinate; + GLuint vPosition; + GLuint vTextureCoordinate; - GLuint _vbo; - GLuint _vao; + GLuint _vbo; + GLuint _vao; -public: - ApplyTransparencyShader(); - ~ApplyTransparencyShader() override; + public: + ApplyTransparencyShader(); + ~ApplyTransparencyShader() override; - static void SetTextures( - GLuint opaqueTex, GLuint opaqueDepth, GLuint transparentTex, GLuint transparentDepth, GLuint paletteTex, - GLuint blendPaletteTex); - void Draw(); + static void SetTextures( + GLuint opaqueTex, GLuint opaqueDepth, GLuint transparentTex, GLuint transparentDepth, GLuint paletteTex, + GLuint blendPaletteTex); + void Draw(); -private: - void GetLocations(); -}; + private: + void GetLocations(); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h b/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h index d343938eef..e53baea7d3 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h +++ b/src/openrct2-ui/drawing/engines/opengl/DrawCommands.h @@ -15,114 +15,116 @@ #include #include - -template class CommandBatch +namespace OpenRCT2::Ui { -private: - std::vector _instances; - size_t _numInstances; + template class CommandBatch + { + private: + std::vector _instances; + size_t _numInstances; -public: - CommandBatch() - : _numInstances(0) - { - } - - [[nodiscard]] bool empty() const // NOLINT(readability-identifier-naming) - { - return _numInstances == 0; - } - void clear() // NOLINT(readability-identifier-naming) - { - _numInstances = 0; - } - T& allocate() // NOLINT(readability-identifier-naming) - { - if (_numInstances + 1 > _instances.size()) + public: + CommandBatch() + : _numInstances(0) { - _instances.resize((_numInstances + 1) << 1); } - return _instances[_numInstances++]; - } - T& insert(const T& value) // NOLINT(readability-identifier-naming) - { - if (_numInstances + 1 > _instances.size()) + + [[nodiscard]] bool empty() const // NOLINT(readability-identifier-naming) { - _instances.resize((_numInstances + 1) << 1); + return _numInstances == 0; + } + void clear() // NOLINT(readability-identifier-naming) + { + _numInstances = 0; + } + T& allocate() // NOLINT(readability-identifier-naming) + { + if (_numInstances + 1 > _instances.size()) + { + _instances.resize((_numInstances + 1) << 1); + } + return _instances[_numInstances++]; + } + T& insert(const T& value) // NOLINT(readability-identifier-naming) + { + if (_numInstances + 1 > _instances.size()) + { + _instances.resize((_numInstances + 1) << 1); + } + return _instances[_numInstances++] = value; + } + [[nodiscard]] size_t size() const // NOLINT(readability-identifier-naming) + { + return _numInstances; + } + const T* data() const // NOLINT(readability-identifier-naming) + { + return _instances.data(); + } + const T& operator[](size_t idx) const + { + return _instances.at(idx); } - return _instances[_numInstances++] = value; - } - [[nodiscard]] size_t size() const // NOLINT(readability-identifier-naming) - { - return _numInstances; - } - const T* data() const // NOLINT(readability-identifier-naming) - { - return _instances.data(); - } - const T& operator[](size_t idx) const - { - return _instances.at(idx); - } - typename std::vector::iterator begin() // NOLINT(readability-identifier-naming) - { - return _instances.begin(); - } - typename std::vector::const_iterator begin() const // NOLINT(readability-identifier-naming) - { - return _instances.cbegin(); - } - typename std::vector::const_iterator cbegin() const // NOLINT(readability-identifier-naming) - { - return _instances.cbegin(); - } - typename std::vector::iterator end() // NOLINT(readability-identifier-naming) - { - return _instances.begin() + _numInstances; - } - typename std::vector::const_iterator end() const // NOLINT(readability-identifier-naming) - { - return _instances.cbegin() + _numInstances; - } - typename std::vector::const_iterator cend() const // NOLINT(readability-identifier-naming) - { - return _instances.cbegin() + _numInstances; - } -}; - -struct DrawLineCommand -{ - ivec4 clip; - ivec4 bounds; - GLuint colour; - GLint depth; -}; - -// Per-instance data for images -struct DrawRectCommand -{ - ivec4 clip; - GLint texColourAtlas; - vec4 texColourBounds; - GLint texMaskAtlas; - vec4 texMaskBounds; - ivec3 palettes; - GLint flags; - GLuint colour; - ivec4 bounds; - GLint depth; - - enum - { - FLAG_NO_TEXTURE = (1u << 2u), - FLAG_MASK = (1u << 3u), - FLAG_CROSS_HATCH = (1u << 4u), - FLAG_TTF_TEXT = (1u << 5u), - // bits 8 to 16 used to store hinting threshold. - FLAG_TTF_HINTING_THRESHOLD_MASK = 0xff00 + typename std::vector::iterator begin() // NOLINT(readability-identifier-naming) + { + return _instances.begin(); + } + typename std::vector::const_iterator begin() const // NOLINT(readability-identifier-naming) + { + return _instances.cbegin(); + } + typename std::vector::const_iterator cbegin() const // NOLINT(readability-identifier-naming) + { + return _instances.cbegin(); + } + typename std::vector::iterator end() // NOLINT(readability-identifier-naming) + { + return _instances.begin() + _numInstances; + } + typename std::vector::const_iterator end() const // NOLINT(readability-identifier-naming) + { + return _instances.cbegin() + _numInstances; + } + typename std::vector::const_iterator cend() const // NOLINT(readability-identifier-naming) + { + return _instances.cbegin() + _numInstances; + } }; -}; -using LineCommandBatch = CommandBatch; -using RectCommandBatch = CommandBatch; + struct DrawLineCommand + { + ivec4 clip; + ivec4 bounds; + GLuint colour; + GLint depth; + }; + + // Per-instance data for images + struct DrawRectCommand + { + ivec4 clip; + GLint texColourAtlas; + vec4 texColourBounds; + GLint texMaskAtlas; + vec4 texMaskBounds; + ivec3 palettes; + GLint flags; + GLuint colour; + ivec4 bounds; + GLint depth; + + enum + { + FLAG_NO_TEXTURE = (1u << 2u), + FLAG_MASK = (1u << 3u), + FLAG_CROSS_HATCH = (1u << 4u), + FLAG_TTF_TEXT = (1u << 5u), + // bits 8 to 16 used to store hinting threshold. + FLAG_TTF_HINTING_THRESHOLD_MASK = 0xff00 + }; + }; + + using LineCommandBatch = CommandBatch; + using RectCommandBatch = CommandBatch; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp index c5f81310de..2b687d764e 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.cpp @@ -13,6 +13,8 @@ # include "OpenGLFramebuffer.h" +using namespace OpenRCT2::Ui; + namespace { struct VDStruct diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.h b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.h index 6ddaa94b53..0150b1ad7a 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.h +++ b/src/openrct2-ui/drawing/engines/opengl/DrawLineShader.h @@ -12,30 +12,32 @@ #include "DrawCommands.h" #include "GLSLTypes.h" #include "OpenGLShaderProgram.h" - -class DrawLineShader final : public OpenGLShaderProgram +namespace OpenRCT2::Ui { -private: - GLuint uScreenSize; + class DrawLineShader final : public OpenGLShaderProgram + { + private: + GLuint uScreenSize; - GLuint vClip; - GLuint vBounds; - GLuint vColour; - GLuint vDepth; + GLuint vClip; + GLuint vBounds; + GLuint vColour; + GLuint vDepth; - GLuint vVertMat; + GLuint vVertMat; - GLuint _vbo; - GLuint _vboInstances; - GLuint _vao; + GLuint _vbo; + GLuint _vboInstances; + GLuint _vao; -public: - DrawLineShader(); - ~DrawLineShader() override; + public: + DrawLineShader(); + ~DrawLineShader() override; - void SetScreenSize(int32_t width, int32_t height); - void DrawInstances(const LineCommandBatch& instances); + void SetScreenSize(int32_t width, int32_t height); + void DrawInstances(const LineCommandBatch& instances); -private: - void GetLocations(); -}; + private: + void GetLocations(); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp index 5b760f7da5..ed43dddb34 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.cpp @@ -11,6 +11,8 @@ # include "DrawRectShader.h" +using namespace OpenRCT2::Ui; + namespace { struct VDStruct diff --git a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h index 76a8a83335..bf4dd07668 100644 --- a/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h +++ b/src/openrct2-ui/drawing/engines/opengl/DrawRectShader.h @@ -14,49 +14,51 @@ #include "OpenGLShaderProgram.h" #include - -class DrawRectShader final : public OpenGLShaderProgram +namespace OpenRCT2::Ui { -private: - GLuint uScreenSize; - GLuint uTexture; - GLuint uPaletteTex; + class DrawRectShader final : public OpenGLShaderProgram + { + private: + GLuint uScreenSize; + GLuint uTexture; + GLuint uPaletteTex; - GLuint uPeelingTex; - GLuint uPeeling; + GLuint uPeelingTex; + GLuint uPeeling; - GLuint vVertMat; - GLuint vVertVec; + GLuint vVertMat; + GLuint vVertVec; - GLuint vClip; - GLuint vTexColourAtlas; - GLuint vTexColourBounds; - GLuint vTexMaskAtlas; - GLuint vTexMaskBounds; - GLuint vPalettes; - GLuint vFlags; - GLuint vColour; - GLuint vBounds; - GLuint vDepth; + GLuint vClip; + GLuint vTexColourAtlas; + GLuint vTexColourBounds; + GLuint vTexMaskAtlas; + GLuint vTexMaskBounds; + GLuint vPalettes; + GLuint vFlags; + GLuint vColour; + GLuint vBounds; + GLuint vDepth; - GLuint _vbo; - GLuint _vboInstances; - GLuint _vao; + GLuint _vbo; + GLuint _vboInstances; + GLuint _vao; - GLsizei _instanceCount = 0; - size_t _maxInstancesBufferSize; + GLsizei _instanceCount = 0; + size_t _maxInstancesBufferSize; -public: - DrawRectShader(); - ~DrawRectShader() override; + public: + DrawRectShader(); + ~DrawRectShader() override; - void SetScreenSize(int32_t width, int32_t height); - void EnablePeeling(GLuint peelingTex); - void DisablePeeling(); + void SetScreenSize(int32_t width, int32_t height); + void EnablePeeling(GLuint peelingTex); + void DisablePeeling(); - void SetInstances(const RectCommandBatch& instances); - void DrawInstances(); + void SetInstances(const RectCommandBatch& instances); + void DrawInstances(); -private: - void GetLocations(); -}; + private: + void GetLocations(); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/GLSLTypes.h b/src/openrct2-ui/drawing/engines/opengl/GLSLTypes.h index 96dba238c8..624c295550 100644 --- a/src/openrct2-ui/drawing/engines/opengl/GLSLTypes.h +++ b/src/openrct2-ui/drawing/engines/opengl/GLSLTypes.h @@ -13,100 +13,102 @@ #include -#pragma pack(push, 1) - -namespace detail +namespace OpenRCT2::Ui { - template struct Vec2 +#pragma pack(push, 1) + namespace detail { - using ValueType = T_; - - union + template struct Vec2 { - ValueType x; - ValueType s; - ValueType r; + using ValueType = T_; + + union + { + ValueType x; + ValueType s; + ValueType r; + }; + union + { + ValueType y; + ValueType t; + ValueType g; + }; }; - union + + template struct Vec2; + template struct Vec2; + + template struct Vec3 { - ValueType y; - ValueType t; - ValueType g; + using ValueType = T_; + + union + { + ValueType x; + ValueType s; + ValueType r; + }; + union + { + ValueType y; + ValueType t; + ValueType g; + }; + union + { + ValueType z; + ValueType p; + ValueType b; + }; }; - }; - template struct Vec2; - template struct Vec2; + template struct Vec3; + template struct Vec3; - template struct Vec3 - { - using ValueType = T_; - - union + template struct Vec4 { - ValueType x; - ValueType s; - ValueType r; + using ValueType = T_; + + union + { + ValueType x; + ValueType s; + ValueType r; + }; + union + { + ValueType y; + ValueType t; + ValueType g; + }; + union + { + ValueType z; + ValueType p; + ValueType b; + }; + union + { + ValueType w; + ValueType q; + ValueType a; + }; }; - union - { - ValueType y; - ValueType t; - ValueType g; - }; - union - { - ValueType z; - ValueType p; - ValueType b; - }; - }; - template struct Vec3; - template struct Vec3; + template struct Vec4; + template struct Vec4; - template struct Vec4 - { - using ValueType = T_; + } // namespace detail - union - { - ValueType x; - ValueType s; - ValueType r; - }; - union - { - ValueType y; - ValueType t; - ValueType g; - }; - union - { - ValueType z; - ValueType p; - ValueType b; - }; - union - { - ValueType w; - ValueType q; - ValueType a; - }; - }; + using vec2 = detail::Vec2; + using ivec2 = detail::Vec2; - template struct Vec4; - template struct Vec4; + using vec3 = detail::Vec3; + using ivec3 = detail::Vec3; -} // namespace detail - -using vec2 = detail::Vec2; -using ivec2 = detail::Vec2; - -using vec3 = detail::Vec3; -using ivec3 = detail::Vec3; - -using vec4 = detail::Vec4; -using ivec4 = detail::Vec4; + using vec4 = detail::Vec4; + using ivec4 = detail::Vec4; #pragma pack(pop) +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp index 7e074e29cb..d54f1c70cc 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.cpp @@ -38,7 +38,9 @@ static const char* TryLoadAllProcAddresses() # endif /* #if OPENGL_NO_LINK */ -namespace OpenGLState +using namespace OpenRCT2::Ui; + +namespace OpenRCT2::Ui::OpenGLState { uint16_t ActiveTexture; GLuint CurrentProgram; @@ -48,7 +50,7 @@ namespace OpenGLState ActiveTexture = UINT16_MAX; CurrentProgram = UINT32_MAX; } -} // namespace OpenGLState +} // namespace OpenRCT2::Ui::OpenGLState void OpenGLAPI::SetTexture(uint16_t index, GLenum type, GLuint texture) { diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h index 86e3c1be12..8791fb6567 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLAPI.h @@ -113,26 +113,29 @@ using PFNGLGETTEXIMAGEPROC = void(APIENTRYP)(GLenum target, GLint level, GLenum #endif /* OPENGL_NO_LINK */ -inline void CheckGLError() +namespace OpenRCT2::Ui { - GLenum error = glGetError(); - while (error != GL_NO_ERROR) + inline void CheckGLError() { - LOG_ERROR("OpenGL Error 0x%04X", error); - error = glGetError(); + GLenum error = glGetError(); + while (error != GL_NO_ERROR) + { + LOG_ERROR("OpenGL Error 0x%04X", error); + error = glGetError(); + } } -} -namespace OpenGLAPI -{ - bool Initialise(); - void SetTexture(uint16_t index, GLenum type, GLuint texture); -} // namespace OpenGLAPI + namespace OpenGLAPI + { + bool Initialise(); + void SetTexture(uint16_t index, GLenum type, GLuint texture); + } // namespace OpenGLAPI -namespace OpenGLState -{ - extern uint16_t ActiveTexture; - extern GLuint CurrentProgram; + namespace OpenGLState + { + extern uint16_t ActiveTexture; + extern GLuint CurrentProgram; - void Reset(); -} // namespace OpenGLState + void Reset(); + } // namespace OpenGLState +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp index 70771ef501..f1845cbdfa 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.cpp @@ -16,6 +16,8 @@ # include # include +using namespace OpenRCT2::Ui; + constexpr GLuint BACKBUFFER_ID = 0; OpenGLFramebuffer::OpenGLFramebuffer(SDL_Window* window) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.h index c13971fbc4..6999f997d9 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLFramebuffer.h @@ -16,49 +16,51 @@ #include struct SDL_Window; - -class OpenGLFramebuffer +namespace OpenRCT2::Ui { -private: - GLuint _id; - GLuint _texture; - GLuint _depth; - int32_t _width; - int32_t _height; - -public: - explicit OpenGLFramebuffer(SDL_Window* window); - OpenGLFramebuffer(int32_t width, int32_t height, bool depth = true, bool integer = true, bool word = false); - ~OpenGLFramebuffer(); - - OpenGLFramebuffer(const OpenGLFramebuffer&) = delete; - OpenGLFramebuffer& operator=(const OpenGLFramebuffer&) = delete; - - GLuint GetWidth() const + class OpenGLFramebuffer { - return _width; - } - GLuint GetHeight() const - { - return _height; - } - GLuint GetTexture() const - { - return _texture; - } - GLuint GetDepthTexture() const - { - return _depth; - } + private: + GLuint _id; + GLuint _texture; + GLuint _depth; + int32_t _width; + int32_t _height; - void Bind() const; - void BindDraw() const; - void BindRead() const; - void GetPixels(DrawPixelInfo& dpi) const; + public: + explicit OpenGLFramebuffer(SDL_Window* window); + OpenGLFramebuffer(int32_t width, int32_t height, bool depth = true, bool integer = true, bool word = false); + ~OpenGLFramebuffer(); - void SwapColourBuffer(OpenGLFramebuffer& other); - GLuint SwapDepthTexture(GLuint depth); - void Copy(OpenGLFramebuffer& src, GLenum filter); + OpenGLFramebuffer(const OpenGLFramebuffer&) = delete; + OpenGLFramebuffer& operator=(const OpenGLFramebuffer&) = delete; - static GLuint CreateDepthTexture(int32_t width, int32_t height); -}; + GLuint GetWidth() const + { + return _width; + } + GLuint GetHeight() const + { + return _height; + } + GLuint GetTexture() const + { + return _texture; + } + GLuint GetDepthTexture() const + { + return _depth; + } + + void Bind() const; + void BindDraw() const; + void BindRead() const; + void GetPixels(DrawPixelInfo& dpi) const; + + void SwapColourBuffer(OpenGLFramebuffer& other); + GLuint SwapDepthTexture(GLuint depth); + void Copy(OpenGLFramebuffer& src, GLenum filter); + + static GLuint CreateDepthTexture(int32_t width, int32_t height); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp index 8647c110f3..7e9278087d 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.cpp @@ -18,7 +18,7 @@ # include # include -using namespace OpenRCT2; +using namespace OpenRCT2::Ui; OpenGLShader::OpenGLShader(const char* name, GLenum type) : _type(type) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h index 1cded5b523..141276f7cc 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLShaderProgram.h @@ -14,43 +14,45 @@ #include #include #include - -class OpenGLShader final +namespace OpenRCT2::Ui { -private: - static constexpr uint64_t MaxSourceSize = 8 * 1024 * 1024; // 8 MiB + class OpenGLShader final + { + private: + static constexpr uint64_t MaxSourceSize = 8 * 1024 * 1024; // 8 MiB - GLenum _type; - GLuint _id = 0; + GLenum _type; + GLuint _id = 0; -public: - OpenGLShader(const char* name, GLenum type); - ~OpenGLShader(); + public: + OpenGLShader(const char* name, GLenum type); + ~OpenGLShader(); - GLuint GetShaderId(); + GLuint GetShaderId(); -private: - std::string GetPath(const std::string& name); - static std::string ReadSourceCode(const std::string& path); -}; + private: + std::string GetPath(const std::string& name); + static std::string ReadSourceCode(const std::string& path); + }; -class OpenGLShaderProgram -{ -private: - GLuint _id = 0; - std::unique_ptr _vertexShader; - std::unique_ptr _fragmentShader; + class OpenGLShaderProgram + { + private: + GLuint _id = 0; + std::unique_ptr _vertexShader; + std::unique_ptr _fragmentShader; -public: - explicit OpenGLShaderProgram(const char* name); - explicit OpenGLShaderProgram(const OpenGLShaderProgram&) = delete; - explicit OpenGLShaderProgram(OpenGLShaderProgram&&) = default; - virtual ~OpenGLShaderProgram(); + public: + explicit OpenGLShaderProgram(const char* name); + explicit OpenGLShaderProgram(const OpenGLShaderProgram&) = delete; + explicit OpenGLShaderProgram(OpenGLShaderProgram&&) = default; + virtual ~OpenGLShaderProgram(); - GLuint GetAttributeLocation(const char* name); - GLuint GetUniformLocation(const char* name); - void Use(); + GLuint GetAttributeLocation(const char* name); + GLuint GetUniformLocation(const char* name); + void Use(); -private: - bool Link(); -}; + private: + bool Link(); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp index bdccec25c5..cf44c003b5 100644 --- a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.cpp @@ -13,6 +13,8 @@ # include "OpenGLFramebuffer.h" +using namespace OpenRCT2::Ui; + constexpr GLfloat depthValue[1] = { 1.0f }; constexpr GLfloat depthValueTransparent[1] = { 0.0f }; constexpr GLuint indexValue[4] = { 0, 0, 0, 0 }; diff --git a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h index c13d5fb5a9..cfc23ded77 100644 --- a/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h +++ b/src/openrct2-ui/drawing/engines/opengl/SwapFramebuffer.h @@ -14,44 +14,46 @@ #include "OpenGLFramebuffer.h" #include - -/** - * Class to maintain two different framebuffers where the active framebuffer - * will swap between the two, copying the other's pixels in the process for - * performing pre-processing filters. - * - * When you need to bind the current frame to a shader, call SwapCopy and - * then bind the value of GetSourceTexture to your shader. - */ -class SwapFramebuffer final +namespace OpenRCT2::Ui { -private: - OpenGLFramebuffer _opaqueFramebuffer; - OpenGLFramebuffer _transparentFramebuffer; - OpenGLFramebuffer _mixFramebuffer; - GLuint _backDepth; + /** + * Class to maintain two different framebuffers where the active framebuffer + * will swap between the two, copying the other's pixels in the process for + * performing pre-processing filters. + * + * When you need to bind the current frame to a shader, call SwapCopy and + * then bind the value of GetSourceTexture to your shader. + */ + class SwapFramebuffer final + { + private: + OpenGLFramebuffer _opaqueFramebuffer; + OpenGLFramebuffer _transparentFramebuffer; + OpenGLFramebuffer _mixFramebuffer; + GLuint _backDepth; -public: - SwapFramebuffer(int32_t width, int32_t height); - ~SwapFramebuffer(); + public: + SwapFramebuffer(int32_t width, int32_t height); + ~SwapFramebuffer(); - const OpenGLFramebuffer& GetFinalFramebuffer() const - { - return _opaqueFramebuffer; - } - GLuint GetBackDepthTexture() const - { - return _backDepth; - } - void BindOpaque() - { - _opaqueFramebuffer.Bind(); - } - void BindTransparent() - { - _transparentFramebuffer.Bind(); - } + const OpenGLFramebuffer& GetFinalFramebuffer() const + { + return _opaqueFramebuffer; + } + GLuint GetBackDepthTexture() const + { + return _backDepth; + } + void BindOpaque() + { + _opaqueFramebuffer.Bind(); + } + void BindTransparent() + { + _transparentFramebuffer.Bind(); + } - void ApplyTransparency(ApplyTransparencyShader& shader, GLuint paletteTex, GLuint blendPaletteTex); - void Clear(); -}; + void ApplyTransparency(ApplyTransparencyShader& shader, GLuint paletteTex, GLuint blendPaletteTex); + void Clear(); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp index c66173d30e..bbfad0be1e 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.cpp @@ -19,6 +19,8 @@ # include # include +using namespace OpenRCT2::Ui; + constexpr uint32_t UNUSED_INDEX = 0xFFFFFFFF; TextureCache::TextureCache() diff --git a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h index da3df3d33b..097e4f98b9 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TextureCache.h +++ b/src/openrct2-ui/drawing/engines/opengl/TextureCache.h @@ -29,220 +29,223 @@ struct DrawPixelInfo; struct PaletteMap; enum class FilterPaletteID : int32_t; -struct GlyphId +namespace OpenRCT2::Ui { - ImageIndex Image; - uint64_t Palette; - - struct Hash + struct GlyphId { - size_t operator()(const GlyphId& k) const + ImageIndex Image; + uint64_t Palette; + + struct Hash { - size_t hash = k.Image * 7; - hash += (k.Palette & 0xFFFFFFFFUL) * 13; - hash += (k.Palette >> 32uL) * 23; - return hash; + size_t operator()(const GlyphId& k) const + { + size_t hash = k.Image * 7; + hash += (k.Palette & 0xFFFFFFFFUL) * 13; + hash += (k.Palette >> 32uL) * 23; + return hash; + } + }; + + struct Equal + { + bool operator()(const GlyphId& lhs, const GlyphId& rhs) const + { + return lhs.Image == rhs.Image && lhs.Palette == rhs.Palette; + } + }; + }; + + // 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; + + // Pixel dimensions of smallest supported slots in texture atlases + // Must be a power of 2! + constexpr int32_t TEXTURE_CACHE_SMALLEST_SLOT = 32; + + struct BasicTextureInfo + { + GLuint index; + vec4 normalizedBounds; + }; + + // Location of an image (texture atlas index, slot and normalized coordinates) + struct AtlasTextureInfo : public BasicTextureInfo + { + GLuint slot; + ivec4 bounds; + ImageIndex image; + }; + + // Represents a texture atlas that images of a given maximum size can be allocated from + // Atlases are all stored in the same 2D texture array, occupying the specified index + // Slots in atlases are always squares. + class Atlas final + { + private: + GLuint _index = 0; + int32_t _imageSize = 0; + int32_t _atlasWidth = 0; + int32_t _atlasHeight = 0; + std::vector _freeSlots; + + int32_t _cols = 0; + int32_t _rows = 0; + + public: + Atlas(GLuint index, int32_t imageSize) + : _index(index) + , _imageSize(imageSize) + { + } + + void Initialise(int32_t atlasWidth, int32_t atlasHeight) + { + _atlasWidth = atlasWidth; + _atlasHeight = atlasHeight; + + _cols = std::max(1, _atlasWidth / _imageSize); + _rows = std::max(1, _atlasHeight / _imageSize); + + _freeSlots.resize(_cols * _rows); + for (size_t i = 0; i < _freeSlots.size(); i++) + { + _freeSlots[i] = static_cast(i); + } + } + + AtlasTextureInfo Allocate(int32_t actualWidth, int32_t actualHeight) + { + assert(!_freeSlots.empty()); + + GLuint slot = _freeSlots.back(); + _freeSlots.pop_back(); + + auto bounds = GetSlotCoordinates(slot, actualWidth, actualHeight); + + AtlasTextureInfo info{}; + info.index = _index; + info.slot = slot; + info.bounds = bounds; + info.normalizedBounds = NormalizeCoordinates(bounds); + + return info; + } + + void Free(const AtlasTextureInfo& info) + { + assert(_index == info.index); + + _freeSlots.push_back(info.slot); + } + + // Checks if specified image would be tightly packed in this atlas + // by checking if it is within the right power of 2 range + [[nodiscard]] bool IsImageSuitable(int32_t actualWidth, int32_t actualHeight) const + { + int32_t imageOrder = CalculateImageSizeOrder(actualWidth, actualHeight); + int32_t atlasOrder = log2(_imageSize); + + return imageOrder == atlasOrder; + } + + [[nodiscard]] int32_t GetFreeSlots() const + { + return static_cast(_freeSlots.size()); + } + + static int32_t CalculateImageSizeOrder(int32_t actualWidth, int32_t actualHeight) + { + int32_t actualSize = std::max(actualWidth, actualHeight); + + if (actualSize < TEXTURE_CACHE_SMALLEST_SLOT) + { + actualSize = TEXTURE_CACHE_SMALLEST_SLOT; + } + + return static_cast(ceil(log2f(static_cast(actualSize)))); + } + + private: + [[nodiscard]] ivec4 GetSlotCoordinates(GLuint slot, int32_t actualWidth, int32_t actualHeight) const + { + int32_t row = slot / _cols; + int32_t col = slot % _cols; + + return ivec4{ + _imageSize * col, + _imageSize * row, + _imageSize * col + actualWidth, + _imageSize * row + actualHeight, + }; + } + + [[nodiscard]] vec4 NormalizeCoordinates(const ivec4& coords) const + { + return vec4{ + coords.x / static_cast(_atlasWidth), + coords.y / static_cast(_atlasHeight), + coords.z / static_cast(_atlasWidth), + coords.w / static_cast(_atlasHeight), + }; } }; - struct Equal + class TextureCache final { - bool operator()(const GlyphId& lhs, const GlyphId& rhs) const - { - return lhs.Image == rhs.Image && lhs.Palette == rhs.Palette; - } - }; -}; + private: + bool _initialized = false; -// 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; + GLuint _atlasesTexture = 0; + GLint _atlasesTextureDimensions = 0; + GLuint _atlasesTextureCapacity = 0; + GLuint _atlasesTextureIndices = 0; + GLint _atlasesTextureIndicesLimit = 0; + std::vector _atlases; + std::unordered_map _glyphTextureMap; + std::vector _textureCache; + std::array _indexMap; -// Pixel dimensions of smallest supported slots in texture atlases -// Must be a power of 2! -constexpr int32_t TEXTURE_CACHE_SMALLEST_SLOT = 32; - -struct BasicTextureInfo -{ - GLuint index; - vec4 normalizedBounds; -}; - -// Location of an image (texture atlas index, slot and normalized coordinates) -struct AtlasTextureInfo : public BasicTextureInfo -{ - GLuint slot; - ivec4 bounds; - ImageIndex image; -}; - -// Represents a texture atlas that images of a given maximum size can be allocated from -// Atlases are all stored in the same 2D texture array, occupying the specified index -// Slots in atlases are always squares. -class Atlas final -{ -private: - GLuint _index = 0; - int32_t _imageSize = 0; - int32_t _atlasWidth = 0; - int32_t _atlasHeight = 0; - std::vector _freeSlots; - - int32_t _cols = 0; - int32_t _rows = 0; - -public: - Atlas(GLuint index, int32_t imageSize) - : _index(index) - , _imageSize(imageSize) - { - } - - void Initialise(int32_t atlasWidth, int32_t atlasHeight) - { - _atlasWidth = atlasWidth; - _atlasHeight = atlasHeight; - - _cols = std::max(1, _atlasWidth / _imageSize); - _rows = std::max(1, _atlasHeight / _imageSize); - - _freeSlots.resize(_cols * _rows); - for (size_t i = 0; i < _freeSlots.size(); i++) - { - _freeSlots[i] = static_cast(i); - } - } - - AtlasTextureInfo Allocate(int32_t actualWidth, int32_t actualHeight) - { - assert(!_freeSlots.empty()); - - GLuint slot = _freeSlots.back(); - _freeSlots.pop_back(); - - auto bounds = GetSlotCoordinates(slot, actualWidth, actualHeight); - - AtlasTextureInfo info{}; - info.index = _index; - info.slot = slot; - info.bounds = bounds; - info.normalizedBounds = NormalizeCoordinates(bounds); - - return info; - } - - void Free(const AtlasTextureInfo& info) - { - assert(_index == info.index); - - _freeSlots.push_back(info.slot); - } - - // Checks if specified image would be tightly packed in this atlas - // by checking if it is within the right power of 2 range - [[nodiscard]] bool IsImageSuitable(int32_t actualWidth, int32_t actualHeight) const - { - int32_t imageOrder = CalculateImageSizeOrder(actualWidth, actualHeight); - int32_t atlasOrder = log2(_imageSize); - - return imageOrder == atlasOrder; - } - - [[nodiscard]] int32_t GetFreeSlots() const - { - return static_cast(_freeSlots.size()); - } - - static int32_t CalculateImageSizeOrder(int32_t actualWidth, int32_t actualHeight) - { - int32_t actualSize = std::max(actualWidth, actualHeight); - - if (actualSize < TEXTURE_CACHE_SMALLEST_SLOT) - { - actualSize = TEXTURE_CACHE_SMALLEST_SLOT; - } - - return static_cast(ceil(log2f(static_cast(actualSize)))); - } - -private: - [[nodiscard]] ivec4 GetSlotCoordinates(GLuint slot, int32_t actualWidth, int32_t actualHeight) const - { - int32_t row = slot / _cols; - int32_t col = slot % _cols; - - return ivec4{ - _imageSize * col, - _imageSize * row, - _imageSize * col + actualWidth, - _imageSize * row + actualHeight, - }; - } - - [[nodiscard]] vec4 NormalizeCoordinates(const ivec4& coords) const - { - return vec4{ - coords.x / static_cast(_atlasWidth), - coords.y / static_cast(_atlasHeight), - coords.z / static_cast(_atlasWidth), - coords.w / static_cast(_atlasHeight), - }; - } -}; - -class TextureCache final -{ -private: - bool _initialized = false; - - GLuint _atlasesTexture = 0; - GLint _atlasesTextureDimensions = 0; - GLuint _atlasesTextureCapacity = 0; - GLuint _atlasesTextureIndices = 0; - GLint _atlasesTextureIndicesLimit = 0; - std::vector _atlases; - std::unordered_map _glyphTextureMap; - std::vector _textureCache; - std::array _indexMap; - - GLuint _paletteTexture = 0; - GLuint _blendPaletteTexture = 0; + GLuint _paletteTexture = 0; + GLuint _blendPaletteTexture = 0; #ifndef __MACOSX__ - std::shared_mutex _mutex; - using shared_lock = std::shared_lock; - using unique_lock = std::unique_lock; + std::shared_mutex _mutex; + using shared_lock = std::shared_lock; + using unique_lock = std::unique_lock; #else - std::mutex _mutex; - using shared_lock = std::unique_lock; - using unique_lock = std::unique_lock; + std::mutex _mutex; + using shared_lock = std::unique_lock; + using unique_lock = std::unique_lock; #endif -public: - TextureCache(); - ~TextureCache(); - void InvalidateImage(ImageIndex image); - BasicTextureInfo GetOrLoadImageTexture(const ImageId imageId); - BasicTextureInfo GetOrLoadGlyphTexture(const ImageId imageId, const PaletteMap& paletteMap); - BasicTextureInfo GetOrLoadBitmapTexture(ImageIndex image, const void* pixels, size_t width, size_t height); + public: + TextureCache(); + ~TextureCache(); + void InvalidateImage(ImageIndex image); + BasicTextureInfo GetOrLoadImageTexture(const ImageId imageId); + BasicTextureInfo GetOrLoadGlyphTexture(const ImageId imageId, const PaletteMap& paletteMap); + BasicTextureInfo GetOrLoadBitmapTexture(ImageIndex image, const void* pixels, size_t width, size_t height); - GLuint GetAtlasesTexture(); - GLuint GetPaletteTexture(); - GLuint GetBlendPaletteTexture(); - static GLint PaletteToY(FilterPaletteID palette); + GLuint GetAtlasesTexture(); + GLuint GetPaletteTexture(); + GLuint GetBlendPaletteTexture(); + static GLint PaletteToY(FilterPaletteID palette); -private: - void CreateTextures(); - void GeneratePaletteTexture(); - void EnlargeAtlasesTexture(GLuint newEntries); - AtlasTextureInfo LoadImageTexture(const ImageId image); - AtlasTextureInfo LoadGlyphTexture(const ImageId image, const PaletteMap& paletteMap); - AtlasTextureInfo AllocateImage(int32_t imageWidth, int32_t imageHeight); - AtlasTextureInfo LoadBitmapTexture(ImageIndex image, const void* pixels, size_t width, size_t height); - static DrawPixelInfo GetImageAsDPI(const ImageId imageId); - static DrawPixelInfo GetGlyphAsDPI(const ImageId imageId, const PaletteMap& paletteMap); - void FreeTextures(); + private: + void CreateTextures(); + void GeneratePaletteTexture(); + void EnlargeAtlasesTexture(GLuint newEntries); + AtlasTextureInfo LoadImageTexture(const ImageId image); + AtlasTextureInfo LoadGlyphTexture(const ImageId image, const PaletteMap& paletteMap); + AtlasTextureInfo AllocateImage(int32_t imageWidth, int32_t imageHeight); + AtlasTextureInfo LoadBitmapTexture(ImageIndex image, const void* pixels, size_t width, size_t height); + static DrawPixelInfo GetImageAsDPI(const ImageId imageId); + static DrawPixelInfo GetGlyphAsDPI(const ImageId imageId, const PaletteMap& paletteMap); + void FreeTextures(); - static DrawPixelInfo CreateDPI(int32_t width, int32_t height); - static void DeleteDPI(DrawPixelInfo dpi); -}; + static DrawPixelInfo CreateDPI(int32_t width, int32_t height); + static void DeleteDPI(DrawPixelInfo dpi); + }; +} // namespace OpenRCT2::Ui diff --git a/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp b/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp index aa9db60ee1..bd113014b2 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.cpp @@ -15,194 +15,196 @@ # include # include -/* - * Structure to store locations of vertical bounding box edge. - */ -struct XData +namespace OpenRCT2::Ui { - int32_t xposition; - bool begin; - int32_t top, bottom; -}; -using SweepLine = std::vector; - -/* - * Creates a list of vertical bounding box edges, stored as xdata and sorted - * from left to right. If multiple edges are at the same x coordinate, Then - * edges for boxes to the left will appear before edges for boxes to the right. - */ -static inline SweepLine CreateXList(const RectCommandBatch& transparent) -{ - SweepLine x_sweep; - x_sweep.reserve(transparent.size() * 2); - - for (const DrawRectCommand& command : transparent) + /* + * Structure to store locations of vertical bounding box edge. + */ + struct XData { - int32_t left = std::min(std::max(command.bounds.x, command.clip.x), command.clip.z); - int32_t top = std::min(std::max(command.bounds.y, command.clip.y), command.clip.w); - int32_t right = std::min(std::max(command.bounds.z, command.clip.x), command.clip.z); - int32_t bottom = std::min(std::max(command.bounds.w, command.clip.y), command.clip.w); + int32_t xposition; + bool begin; + int32_t top, bottom; + }; + using SweepLine = std::vector; - assert(left <= right); - assert(top <= bottom); - if (left == right) - continue; - if (top == bottom) - continue; - - x_sweep.push_back({ left, true, top, bottom }); - x_sweep.push_back({ right, false, top, bottom }); - } - - std::sort(x_sweep.begin(), x_sweep.end(), [](const XData& a, const XData& b) -> bool { - if (a.xposition != b.xposition) - return a.xposition < b.xposition; - - return !a.begin && b.begin; - }); - - return x_sweep; -} - -/* - * Structure that stores intervals. YData.count stores how many intervals have - * an endpoint at this position, and YData.depth stores how many intervals - * intersect on the left limit of this point. In other words, IntervalTree - * stores half-closed intervals, with the left endpoint open, and the right - * endpoint closed. The IntervalTree uses std::map because it stores the values - * sorted, and we can traverse it in order using its bidirectional iterators. - */ -struct YData -{ - int32_t count, depth; -}; -using IntervalTree = std::map; - -/* - * Inserts the interval's top endpoint into the interval tree. If the endpoint - * already exists in the interval tree, it stacks the endpoints. - */ -static inline IntervalTree::iterator InsertTopEndpoint(IntervalTree& y_intersect, int32_t top) -{ - auto top_in = y_intersect.insert({ top, { 1, 0 } }); - IntervalTree::iterator top_it = top_in.first; - if (top_in.second) + /* + * Creates a list of vertical bounding box edges, stored as xdata and sorted + * from left to right. If multiple edges are at the same x coordinate, Then + * edges for boxes to the left will appear before edges for boxes to the right. + */ + static inline SweepLine CreateXList(const RectCommandBatch& transparent) { - IntervalTree::iterator top_next = std::next(top_it); - if (top_next != y_intersect.end()) + SweepLine x_sweep; + x_sweep.reserve(transparent.size() * 2); + + for (const DrawRectCommand& command : transparent) { - top_it->second.depth = top_next->second.depth; + int32_t left = std::min(std::max(command.bounds.x, command.clip.x), command.clip.z); + int32_t top = std::min(std::max(command.bounds.y, command.clip.y), command.clip.w); + int32_t right = std::min(std::max(command.bounds.z, command.clip.x), command.clip.z); + int32_t bottom = std::min(std::max(command.bounds.w, command.clip.y), command.clip.w); + + assert(left <= right); + assert(top <= bottom); + if (left == right) + continue; + if (top == bottom) + continue; + + x_sweep.push_back({ left, true, top, bottom }); + x_sweep.push_back({ right, false, top, bottom }); } - } - else - { - ++top_it->second.count; - } - return top_it; -} -/* - * Inserts the interval's bottom endpoint into the interval tree. If the - * endpoint already exists in the interval tree, it stacks the endpoint. - * This function can produce a new maximum depth. - */ -static inline IntervalTree::iterator InsertBottomEndpoint(IntervalTree& y_intersect, int32_t bottom) -{ - auto bottom_in = y_intersect.insert({ bottom, { 1, 1 } }); - IntervalTree::iterator bottom_it = bottom_in.first; - if (bottom_in.second) + std::sort(x_sweep.begin(), x_sweep.end(), [](const XData& a, const XData& b) -> bool { + if (a.xposition != b.xposition) + return a.xposition < b.xposition; + + return !a.begin && b.begin; + }); + + return x_sweep; + } + + /* + * Structure that stores intervals. YData.count stores how many intervals have + * an endpoint at this position, and YData.depth stores how many intervals + * intersect on the left limit of this point. In other words, IntervalTree + * stores half-closed intervals, with the left endpoint open, and the right + * endpoint closed. The IntervalTree uses std::map because it stores the values + * sorted, and we can traverse it in order using its bidirectional iterators. + */ + struct YData { - IntervalTree::iterator bottom_next = std::next(bottom_it); - if (bottom_next != y_intersect.end()) + int32_t count, depth; + }; + using IntervalTree = std::map; + + /* + * Inserts the interval's top endpoint into the interval tree. If the endpoint + * already exists in the interval tree, it stacks the endpoints. + */ + static inline IntervalTree::iterator InsertTopEndpoint(IntervalTree& y_intersect, int32_t top) + { + auto top_in = y_intersect.insert({ top, { 1, 0 } }); + IntervalTree::iterator top_it = top_in.first; + if (top_in.second) { - bottom_it->second.depth = bottom_next->second.depth + 1; - } - } - else - { - ++bottom_it->second.count; - ++bottom_it->second.depth; - } - return bottom_it; -} - -/* - * Removes the interval's top endpoint, handling stacked endpoints. - */ -static inline void RemoveTopEndpoint(IntervalTree& y_intersect, IntervalTree::iterator top_it) -{ - if (top_it->second.count == 1) - { - y_intersect.erase(top_it); - } - else - { - --top_it->second.count; - } -} - -/* - * Removes the interval's bottom endpoint, handling stacked endpoints. - */ -static inline void RemoveBottomEndpoint(IntervalTree& y_intersect, IntervalTree::iterator bottom_it) -{ - if (bottom_it->second.count == 1) - { - y_intersect.erase(bottom_it); - } - else - { - --bottom_it->second.count; - --bottom_it->second.depth; - } -} - -/* - * Determines an approximation of the number of depth peeling iterations needed - * to render the command batch. It will never underestimate the number of - * iterations, but it can overestimate, usually by no more than +2. - */ -int32_t MaxTransparencyDepth(const RectCommandBatch& transparent) -{ - int32_t max_depth = 1; - SweepLine x_sweep = CreateXList(transparent); - IntervalTree y_intersect{}; - - for (const XData& x : x_sweep) - { - if (x.begin) - { - IntervalTree::iterator top_it = InsertTopEndpoint(y_intersect, x.top); - IntervalTree::iterator bottom_it = InsertBottomEndpoint(y_intersect, x.bottom); - max_depth = std::max(max_depth, bottom_it->second.depth); - - /* - * Increment the depth for endpoings that intersect this interval - */ - for (IntervalTree::iterator it = std::next(top_it); it != bottom_it && it != std::end(y_intersect); ++it) + IntervalTree::iterator top_next = std::next(top_it); + if (top_next != y_intersect.end()) { - max_depth = std::max(max_depth, ++it->second.depth); + top_it->second.depth = top_next->second.depth; } } else { - IntervalTree::iterator top_it = y_intersect.find(x.top); - IntervalTree::iterator bottom_it = y_intersect.find(x.bottom); + ++top_it->second.count; + } + return top_it; + } - /* - * Decrement the depth for endpoings that intersected this interval - */ - for (IntervalTree::iterator it = std::next(top_it); it != bottom_it && it != std::end(y_intersect); ++it) + /* + * Inserts the interval's bottom endpoint into the interval tree. If the + * endpoint already exists in the interval tree, it stacks the endpoint. + * This function can produce a new maximum depth. + */ + static inline IntervalTree::iterator InsertBottomEndpoint(IntervalTree& y_intersect, int32_t bottom) + { + auto bottom_in = y_intersect.insert({ bottom, { 1, 1 } }); + IntervalTree::iterator bottom_it = bottom_in.first; + if (bottom_in.second) + { + IntervalTree::iterator bottom_next = std::next(bottom_it); + if (bottom_next != y_intersect.end()) { - --it->second.depth; + bottom_it->second.depth = bottom_next->second.depth + 1; } + } + else + { + ++bottom_it->second.count; + ++bottom_it->second.depth; + } + return bottom_it; + } - RemoveTopEndpoint(y_intersect, top_it); - RemoveBottomEndpoint(y_intersect, bottom_it); + /* + * Removes the interval's top endpoint, handling stacked endpoints. + */ + static inline void RemoveTopEndpoint(IntervalTree& y_intersect, IntervalTree::iterator top_it) + { + if (top_it->second.count == 1) + { + y_intersect.erase(top_it); + } + else + { + --top_it->second.count; } } - return max_depth; -} + /* + * Removes the interval's bottom endpoint, handling stacked endpoints. + */ + static inline void RemoveBottomEndpoint(IntervalTree& y_intersect, IntervalTree::iterator bottom_it) + { + if (bottom_it->second.count == 1) + { + y_intersect.erase(bottom_it); + } + else + { + --bottom_it->second.count; + --bottom_it->second.depth; + } + } + /* + * Determines an approximation of the number of depth peeling iterations needed + * to render the command batch. It will never underestimate the number of + * iterations, but it can overestimate, usually by no more than +2. + */ + int32_t MaxTransparencyDepth(const RectCommandBatch& transparent) + { + int32_t max_depth = 1; + SweepLine x_sweep = CreateXList(transparent); + IntervalTree y_intersect{}; + + for (const XData& x : x_sweep) + { + if (x.begin) + { + IntervalTree::iterator top_it = InsertTopEndpoint(y_intersect, x.top); + IntervalTree::iterator bottom_it = InsertBottomEndpoint(y_intersect, x.bottom); + max_depth = std::max(max_depth, bottom_it->second.depth); + + /* + * Increment the depth for endpoings that intersect this interval + */ + for (IntervalTree::iterator it = std::next(top_it); it != bottom_it && it != std::end(y_intersect); ++it) + { + max_depth = std::max(max_depth, ++it->second.depth); + } + } + else + { + IntervalTree::iterator top_it = y_intersect.find(x.top); + IntervalTree::iterator bottom_it = y_intersect.find(x.bottom); + + /* + * Decrement the depth for endpoings that intersected this interval + */ + for (IntervalTree::iterator it = std::next(top_it); it != bottom_it && it != std::end(y_intersect); ++it) + { + --it->second.depth; + } + + RemoveTopEndpoint(y_intersect, top_it); + RemoveBottomEndpoint(y_intersect, bottom_it); + } + } + + return max_depth; + } +} // namespace OpenRCT2::Ui #endif /* DISABLE_OPENGL */ diff --git a/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.h b/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.h index 053b36f538..3ae4bb017b 100644 --- a/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.h +++ b/src/openrct2-ui/drawing/engines/opengl/TransparencyDepth.h @@ -13,9 +13,12 @@ #include -/* - * Determines an approximation of the number of depth peeling iterations needed - * to render the command batch. It will never underestimate the number of - * iterations, but it can overestimate, usually by no more than +2. - */ -int32_t MaxTransparencyDepth(const RectCommandBatch& transparent); +namespace OpenRCT2::Ui +{ + /* + * Determines an approximation of the number of depth peeling iterations needed + * to render the command batch. It will never underestimate the number of + * iterations, but it can overestimate, usually by no more than +2. + */ + int32_t MaxTransparencyDepth(const RectCommandBatch& transparent); +} // namespace OpenRCT2::Ui From d0592e0887deedf9d155eddecaa304768383714f Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Fri, 8 Mar 2024 04:01:38 +0000 Subject: [PATCH 047/191] Merge Localisation/master into OpenRCT2/develop --- data/language/en-US.txt | 1 + data/language/pt-BR.txt | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/data/language/en-US.txt b/data/language/en-US.txt index 3424f63ee6..e05f413892 100644 --- a/data/language/en-US.txt +++ b/data/language/en-US.txt @@ -7,6 +7,7 @@ # Vanilla strings. Only change strings that differ from UK English! STR_0007 :Miniature Railroad STR_0015 :Bobsled Coaster +STR_0027 :Bumper Cars STR_0035 :Carousel STR_0038 :Restroom STR_0041 :3D Theater diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index 8416d192a4..a98e04eda5 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -3686,6 +3686,11 @@ STR_6614 :Não é possível mudar o preço de entrada do parque STR_6615 :A pista nesse azulejo precisa de água STR_6616 :Ação inválida para esse tipo de funcionário STR_6617 :Não é possível trocar o elemento do azulejo com ele mesmo +STR_6618 :Não é possível restringir ou liberar o objeto… +STR_6619 :Tipo de objeto não pode ser restringido! +STR_6620 :Objeto não encontrado! +STR_6621 :Restringir +STR_6622 :Restringir objeto ao Editor de Cenário e ao modo sandbox. ############# # Scenarios # From 048276b67a269168b1bcc72326cd32cfa380e2cb Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sat, 9 Mar 2024 10:27:05 +0000 Subject: [PATCH 048/191] Move gLastEntranceStyle to GameState_t --- src/openrct2-ui/ride/Construction.cpp | 4 +++- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2/EditorObjectSelectionSession.cpp | 6 +++--- src/openrct2/GameState.h | 2 ++ src/openrct2/actions/TrackDesignAction.cpp | 12 +++++++----- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Ride.h | 2 -- src/openrct2/ride/RideConstruction.cpp | 2 -- src/openrct2/ride/TrackDesign.cpp | 6 +++--- src/openrct2/scenario/Scenario.cpp | 6 +++--- 11 files changed, 24 insertions(+), 22 deletions(-) diff --git a/src/openrct2-ui/ride/Construction.cpp b/src/openrct2-ui/ride/Construction.cpp index 7029aa0986..42b6817922 100644 --- a/src/openrct2-ui/ride/Construction.cpp +++ b/src/openrct2-ui/ride/Construction.cpp @@ -9,6 +9,7 @@ #include "Construction.h" +#include #include #include #include @@ -28,7 +29,8 @@ void RideConstructNew(RideSelection listItem) int32_t colour1 = RideGetRandomColourPresetIndex(listItem.Type); int32_t colour2 = RideGetUnusedPresetVehicleColour(rideEntryIndex); - auto gameAction = RideCreateAction(listItem.Type, listItem.EntryIndex, colour1, colour2, gLastEntranceStyle); + auto gameAction = RideCreateAction( + listItem.Type, listItem.EntryIndex, colour1, colour2, OpenRCT2::GetGameState().LastEntranceStyle); gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { if (result->Error != GameActions::Status::Ok) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index c7f909c855..5a20dcde4f 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4322,7 +4322,7 @@ private: rideSetAppearanceAction.SetCallback([objIndex](const GameAction*, const GameActions::Result* res) { if (res->Error != GameActions::Status::Ok) return; - gLastEntranceStyle = objIndex; + GetGameState().LastEntranceStyle = objIndex; }); GameActions::Execute(&rideSetAppearanceAction); break; diff --git a/src/openrct2/EditorObjectSelectionSession.cpp b/src/openrct2/EditorObjectSelectionSession.cpp index 5a793d0136..a54958c3a2 100644 --- a/src/openrct2/EditorObjectSelectionSession.cpp +++ b/src/openrct2/EditorObjectSelectionSession.cpp @@ -487,10 +487,10 @@ void FinishObjectSelection() SetEveryRideEntryInvented(); auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - gLastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain"); - if (gLastEntranceStyle == OBJECT_ENTRY_INDEX_NULL) + gameState.LastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain"); + if (gameState.LastEntranceStyle == OBJECT_ENTRY_INDEX_NULL) { - gLastEntranceStyle = 0; + gameState.LastEntranceStyle = 0; } gameState.EditorStep = EditorStep::RollercoasterDesigner; diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 6b9310443d..539febfc85 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -125,6 +125,8 @@ namespace OpenRCT2 uint8_t SavedViewRotation; ZoomLevel SavedViewZoom; + ObjectEntryIndex LastEntranceStyle; + /** * Probability out of 65535, of gaining a new guest per game tick. * new guests per second = 40 * (probability / 65535) diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 88bbc851d9..7f74c6006f 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -64,20 +64,21 @@ GameActions::Result TrackDesignAction::Query() const GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_OFF_EDGE_OF_MAP); } + auto& gameState = GetGameState(); auto& objManager = GetContext()->GetObjectManager(); auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicle_object); if (entryIndex == OBJECT_ENTRY_INDEX_NULL) { // Force a fallback if the entry is not invented yet a td6 of it is selected, // which can happen in select-by-track-type mode - if (!RideEntryIsInvented(entryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) + if (!RideEntryIsInvented(entryIndex) && !gameState.Cheats.IgnoreResearchStatus) { entryIndex = OBJECT_ENTRY_INDEX_NULL; } } // Colours do not matter as will be overwritten - auto rideCreateAction = RideCreateAction(_td.type, entryIndex, 0, 0, gLastEntranceStyle); + auto rideCreateAction = RideCreateAction(_td.type, entryIndex, 0, 0, gameState.LastEntranceStyle); rideCreateAction.SetFlags(GetFlags()); auto r = GameActions::ExecuteNested(&rideCreateAction); if (r.Error != GameActions::Status::Ok) @@ -136,20 +137,21 @@ GameActions::Result TrackDesignAction::Execute() const res.Position.z = _loc.z; res.Expenditure = ExpenditureType::RideConstruction; + auto& gameState = GetGameState(); auto& objManager = GetContext()->GetObjectManager(); auto entryIndex = objManager.GetLoadedObjectEntryIndex(_td.vehicle_object); if (entryIndex != OBJECT_ENTRY_INDEX_NULL) { // Force a fallback if the entry is not invented yet a track design using it is selected. // This can happen on rides with multiple vehicles where some have been invented and some haven’t. - if (!RideEntryIsInvented(entryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) + if (!RideEntryIsInvented(entryIndex) && !gameState.Cheats.IgnoreResearchStatus) { entryIndex = OBJECT_ENTRY_INDEX_NULL; } } // Colours do not matter as will be overwritten - auto rideCreateAction = RideCreateAction(_td.type, entryIndex, 0, 0, gLastEntranceStyle); + auto rideCreateAction = RideCreateAction(_td.type, entryIndex, 0, 0, gameState.LastEntranceStyle); rideCreateAction.SetFlags(GetFlags()); auto r = GameActions::ExecuteNested(&rideCreateAction); if (r.Error != GameActions::Status::Ok) @@ -247,7 +249,7 @@ GameActions::Result TrackDesignAction::Execute() const ride->entrance_style = objManager.GetLoadedObjectEntryIndex(_td.StationObjectIdentifier); if (ride->entrance_style == OBJECT_ENTRY_INDEX_NULL) { - ride->entrance_style = gLastEntranceStyle; + ride->entrance_style = gameState.LastEntranceStyle; } for (int32_t i = 0; i < Limits::NumColourSchemes; i++) diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 524ec2153e..00ab7f958b 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -617,7 +617,7 @@ namespace OpenRCT2 cs.Write(static_cast(gameState.SavedViewZoom)); } cs.ReadWrite(gameState.SavedViewRotation); - cs.ReadWrite(gLastEntranceStyle); + cs.ReadWrite(gameState.LastEntranceStyle); cs.ReadWrite(gameState.EditorStep); }); } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 1c795152ee..28f13df83a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -407,7 +407,7 @@ namespace RCT2 | (static_cast(_s6.SamePriceThroughoutExtended) << 32); gameState.SuggestedGuestMaximum = _s6.SuggestedMaxGuests; gameState.ScenarioParkRatingWarningDays = _s6.ParkRatingWarningDays; - gLastEntranceStyle = _s6.LastEntranceStyle; + gameState.LastEntranceStyle = _s6.LastEntranceStyle; // rct1_water_colour // Pad01358842 ImportResearchList(gameState); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index e25961e5e3..dc1795a7fa 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1014,8 +1014,6 @@ std::string_view GetRideEntryName(ObjectEntryIndex index); extern const StringId ColourSchemeNames[4]; -extern ObjectEntryIndex gLastEntranceStyle; - int32_t RideGetCount(); void RideInitAll(); void ResetAllRideBuildDates(); diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index 024d1bee72..c133283391 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -79,8 +79,6 @@ uint8_t _currentSeatRotationAngle; CoordsXYZD _unkF440C5; -ObjectEntryIndex gLastEntranceStyle; - uint8_t gRideEntranceExitPlaceType; RideId gRideEntranceExitPlaceRideIndex; StationIndex gRideEntranceExitPlaceStationIndex; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index df37b689a5..8e45f2c5b0 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -1873,7 +1873,7 @@ int32_t TrackDesignGetZPlacement(TrackDesign* td6, Ride& ride, const CoordsXYZD& static money64 TrackDesignCreateRide(int32_t type, int32_t subType, int32_t flags, RideId* outRideIndex) { // Don't set colours as will be set correctly later. - auto gameAction = RideCreateAction(type, subType, 0, 0, gLastEntranceStyle); + auto gameAction = RideCreateAction(type, subType, 0, 0, GetGameState().LastEntranceStyle); gameAction.SetFlags(flags); auto res = GameActions::ExecuteNested(&gameAction); @@ -1900,6 +1900,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon *outRide = nullptr; *flags = 0; + auto& gameState = GetGameState(); auto& objManager = GetContext()->GetObjectManager(); auto entry_index = objManager.GetLoadedObjectEntryIndex(td6->vehicle_object); @@ -1919,7 +1920,7 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon ride->entrance_style = objManager.GetLoadedObjectEntryIndex(td6->StationObjectIdentifier); if (ride->entrance_style == OBJECT_ENTRY_INDEX_NULL) { - ride->entrance_style = gLastEntranceStyle; + ride->entrance_style = gameState.LastEntranceStyle; } for (int32_t i = 0; i < OpenRCT2::Limits::NumColourSchemes; i++) @@ -1939,7 +1940,6 @@ static bool TrackDesignPlacePreview(TrackDesignState& tds, TrackDesign* td6, mon } } - auto& gameState = GetGameState(); _trackDesignDrawingPreview = true; uint8_t backup_rotation = _currentTrackPieceDirection; uint32_t backup_park_flags = gameState.ParkFlags; diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index f1424db3f0..b2d2db843c 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -156,11 +156,11 @@ void ScenarioReset(GameState_t& gameState) Staff::ResetStats(); auto& objManager = GetContext()->GetObjectManager(); - gLastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain"); - if (gLastEntranceStyle == OBJECT_ENTRY_INDEX_NULL) + gameState.LastEntranceStyle = objManager.GetLoadedObjectEntryIndex("rct2.station.plain"); + if (gameState.LastEntranceStyle == OBJECT_ENTRY_INDEX_NULL) { // Fall back to first entrance object - gLastEntranceStyle = 0; + gameState.LastEntranceStyle = 0; } gMarketingCampaigns.clear(); From 0c1fb5fec0aa5ff07809f19bdca163c9916e987c Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:15:28 +0000 Subject: [PATCH 049/191] Fix #21543: Game Crashing with invalid TrackIterator (#21547) * Check if el is nullptr Check if el is nullptr Format * Add changelog --- distribution/changelog.txt | 1 + src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b1330260e8..3dd2d08bee 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -2,6 +2,7 @@ ------------------------------------------------------------------------ - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. 0.4.9 (2024-03-02) ------------------------------------------------------------------------ diff --git a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp index c797ac7639..6f9cd60626 100644 --- a/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp +++ b/src/openrct2/scripting/bindings/ride/ScTrackIterator.cpp @@ -23,6 +23,8 @@ using namespace OpenRCT2::TrackMetaData; std::shared_ptr ScTrackIterator::FromElement(const CoordsXY& position, int32_t elementIndex) { auto el = MapGetNthElementAt(position, elementIndex); + if (el == nullptr) + return nullptr; auto origin = GetTrackSegmentOrigin(CoordsXYE(position, el)); if (!origin) return nullptr; From 3146d463bdd603218a2878e18cfcf91e79f1cf7e Mon Sep 17 00:00:00 2001 From: Duncan Date: Sat, 9 Mar 2024 14:15:45 +0000 Subject: [PATCH 050/191] Move Ui header items to OpenRCT2::Ui (#21546) * Move ui definitions to ui project * Enforce coding style * Apply clang format * Add clang tidy ignore * Increase compiler happiness --- src/openrct2-ui/input/MouseInput.cpp | 16 +- .../interface/ViewportInteraction.cpp | 4 +- src/openrct2-ui/interface/Widget.cpp | 72 ++++----- src/openrct2-ui/interface/Widget.h | 141 +++++++++++++++++- src/openrct2-ui/interface/Window.cpp | 1 + src/openrct2-ui/scripting/CustomWindow.cpp | 6 +- src/openrct2-ui/windows/About.cpp | 4 +- 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 | 8 +- 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 +- src/openrct2-ui/windows/Dropdown.cpp | 2 +- .../windows/EditorBottomToolbar.cpp | 2 +- .../windows/EditorInventionsList.cpp | 4 +- .../windows/EditorObjectSelection.cpp | 2 +- .../windows/EditorObjectiveOptions.cpp | 4 +- .../windows/EditorScenarioOptions.cpp | 6 +- src/openrct2-ui/windows/Error.cpp | 2 +- src/openrct2-ui/windows/Finances.cpp | 12 +- src/openrct2-ui/windows/Footpath.cpp | 2 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 4 +- src/openrct2-ui/windows/Guest.cpp | 16 +- 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 | 6 +- src/openrct2-ui/windows/Main.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapGen.cpp | 8 +- src/openrct2-ui/windows/MapTooltip.cpp | 2 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 8 +- 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 | 14 +- src/openrct2-ui/windows/Park.cpp | 14 +- src/openrct2-ui/windows/PatrolArea.cpp | 2 +- src/openrct2-ui/windows/Player.cpp | 4 +- .../windows/RefurbishRidePrompt.cpp | 2 +- src/openrct2-ui/windows/Research.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 24 +-- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2-ui/windows/RideList.cpp | 2 +- src/openrct2-ui/windows/SavePrompt.cpp | 4 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 2 +- src/openrct2-ui/windows/Scenery.cpp | 4 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 8 +- src/openrct2-ui/windows/ServerStart.cpp | 2 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 10 +- src/openrct2-ui/windows/Sign.cpp | 2 +- src/openrct2-ui/windows/Staff.cpp | 8 +- 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 | 18 +-- 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/Tooltip.cpp | 2 +- src/openrct2-ui/windows/TopToolbar.cpp | 2 +- src/openrct2-ui/windows/TrackDesignManage.cpp | 4 +- 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 +- src/openrct2/interface/Viewport.cpp | 53 ++++--- src/openrct2/interface/Viewport.h | 12 +- src/openrct2/interface/Widget.h | 134 ----------------- 82 files changed, 375 insertions(+), 360 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 2f9eb1915a..af5cf6be10 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -637,12 +637,12 @@ static void InputScrollBegin(WindowBase& w, WidgetIndex widgetIndex, const Scree int32_t widget_width = widg.width() - 1; if (scroll.flags & VSCROLLBAR_VISIBLE) - widget_width -= SCROLLBAR_WIDTH + 1; + widget_width -= kScrollBarWidth + 1; int32_t widget_content_width = std::max(scroll.h_right - widget_width, 0); int32_t widget_height = widg.bottom - widg.top - 1; if (scroll.flags & HSCROLLBAR_VISIBLE) - widget_height -= SCROLLBAR_WIDTH + 1; + widget_height -= kScrollBarWidth + 1; int32_t widget_content_height = std::max(scroll.v_bottom - widget_height, 0); switch (scroll_area) @@ -757,7 +757,7 @@ static void InputScrollPartUpdateHThumb(WindowBase& w, WidgetIndex widgetIndex, newLeft *= x; x = widget.width() - 21; if (scroll.flags & VSCROLLBAR_VISIBLE) - x -= SCROLLBAR_WIDTH + 1; + x -= kScrollBarWidth + 1; newLeft /= x; x = newLeft; scroll.flags |= HSCROLLBAR_THUMB_PRESSED; @@ -767,7 +767,7 @@ static void InputScrollPartUpdateHThumb(WindowBase& w, WidgetIndex widgetIndex, newLeft = 0; x = widget.width() - 1; if (scroll.flags & VSCROLLBAR_VISIBLE) - x -= SCROLLBAR_WIDTH + 1; + x -= kScrollBarWidth + 1; x *= -1; x += scroll.h_right; if (x < 0) @@ -796,7 +796,7 @@ static void InputScrollPartUpdateVThumb(WindowBase& w, WidgetIndex widgetIndex, newTop *= y; y = widget.height() - 21; if (scroll.flags & HSCROLLBAR_VISIBLE) - y -= SCROLLBAR_WIDTH + 1; + y -= kScrollBarWidth + 1; newTop /= y; y = newTop; scroll.flags |= VSCROLLBAR_THUMB_PRESSED; @@ -806,7 +806,7 @@ static void InputScrollPartUpdateVThumb(WindowBase& w, WidgetIndex widgetIndex, newTop = 0; y = widget.height() - 1; if (scroll.flags & HSCROLLBAR_VISIBLE) - y -= SCROLLBAR_WIDTH + 1; + y -= kScrollBarWidth + 1; y *= -1; y += scroll.v_bottom; if (y < 0) @@ -850,7 +850,7 @@ static void InputScrollPartUpdateHRight(WindowBase& w, WidgetIndex widgetIndex, scroll.h_left += 3; int32_t newLeft = widget.width() - 1; if (scroll.flags & VSCROLLBAR_VISIBLE) - newLeft -= SCROLLBAR_WIDTH + 1; + newLeft -= kScrollBarWidth + 1; newLeft *= -1; newLeft += scroll.h_right; if (newLeft < 0) @@ -893,7 +893,7 @@ static void InputScrollPartUpdateVBottom(WindowBase& w, WidgetIndex widgetIndex, scroll.v_top += 3; int32_t newTop = widget.height() - 1; if (scroll.flags & HSCROLLBAR_VISIBLE) - newTop -= SCROLLBAR_WIDTH + 1; + newTop -= kScrollBarWidth + 1; newTop *= -1; newTop += scroll.v_bottom; if (newTop < 0) diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index b73668644b..1d08323064 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -66,7 +66,7 @@ static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int3 * * rct2: 0x006ED9D0 */ -InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoords) +static InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoords) { InteractionInfo info{}; // No click input for scenario editor or track manager @@ -250,7 +250,7 @@ bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords) * * rct2: 0x006EDE88 */ -InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoords) +static InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoords) { Ride* ride; int32_t i; diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index b3fe15bc59..0bec2d7d03 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -687,21 +687,21 @@ static void WidgetScrollDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widg // Horizontal scrollbar if (scroll.flags & HSCROLLBAR_VISIBLE) WidgetHScrollbarDraw( - dpi, scroll, topLeft.x, bottomRight.y - SCROLLBAR_WIDTH, - ((scroll.flags & VSCROLLBAR_VISIBLE) ? bottomRight.x - (SCROLLBAR_WIDTH + 1) : bottomRight.x), bottomRight.y, + dpi, scroll, topLeft.x, bottomRight.y - kScrollBarWidth, + ((scroll.flags & VSCROLLBAR_VISIBLE) ? bottomRight.x - (kScrollBarWidth + 1) : bottomRight.x), bottomRight.y, colour); // Vertical scrollbar if (scroll.flags & VSCROLLBAR_VISIBLE) WidgetVScrollbarDraw( - dpi, scroll, bottomRight.x - SCROLLBAR_WIDTH, topLeft.y, bottomRight.x, - ((scroll.flags & HSCROLLBAR_VISIBLE) ? bottomRight.y - (SCROLLBAR_WIDTH + 1) : bottomRight.y), colour); + dpi, scroll, bottomRight.x - kScrollBarWidth, topLeft.y, bottomRight.x, + ((scroll.flags & HSCROLLBAR_VISIBLE) ? bottomRight.y - (kScrollBarWidth + 1) : bottomRight.y), colour); // Contents if (scroll.flags & HSCROLLBAR_VISIBLE) - bottomRight.y -= (SCROLLBAR_WIDTH + 1); + bottomRight.y -= (kScrollBarWidth + 1); if (scroll.flags & VSCROLLBAR_VISIBLE) - bottomRight.x -= (SCROLLBAR_WIDTH + 1); + bottomRight.x -= (kScrollBarWidth + 1); bottomRight.y++; bottomRight.x++; @@ -734,25 +734,25 @@ static void WidgetHScrollbarDraw( { colour &= 0x7F; // Trough - GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, ColourMapA[colour].lighter); - GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t }, { r - SCROLLBAR_WIDTH, b } }, 0x1000000 | ColourMapA[colour].mid_dark); - GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 2 }, { r - SCROLLBAR_WIDTH, t + 2 } }, ColourMapA[colour].mid_dark); - GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 3 }, { r - SCROLLBAR_WIDTH, t + 3 } }, ColourMapA[colour].lighter); - GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 7 }, { r - SCROLLBAR_WIDTH, t + 7 } }, ColourMapA[colour].mid_dark); - GfxFillRect(dpi, { { l + SCROLLBAR_WIDTH, t + 8 }, { r - SCROLLBAR_WIDTH, t + 8 } }, ColourMapA[colour].lighter); + GfxFillRect(dpi, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, ColourMapA[colour].lighter); + GfxFillRect(dpi, { { l + kScrollBarWidth, t }, { r - kScrollBarWidth, b } }, 0x1000000 | ColourMapA[colour].mid_dark); + GfxFillRect(dpi, { { l + kScrollBarWidth, t + 2 }, { r - kScrollBarWidth, t + 2 } }, ColourMapA[colour].mid_dark); + GfxFillRect(dpi, { { l + kScrollBarWidth, t + 3 }, { r - kScrollBarWidth, t + 3 } }, ColourMapA[colour].lighter); + GfxFillRect(dpi, { { l + kScrollBarWidth, t + 7 }, { r - kScrollBarWidth, t + 7 } }, ColourMapA[colour].mid_dark); + GfxFillRect(dpi, { { l + kScrollBarWidth, t + 8 }, { r - kScrollBarWidth, t + 8 } }, ColourMapA[colour].lighter); // Left button { uint8_t flags = (scroll.flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; - GfxFillRectInset(dpi, { { l, t }, { l + (SCROLLBAR_WIDTH - 1), b } }, colour, flags); + GfxFillRectInset(dpi, { { l, t }, { l + (kScrollBarWidth - 1), b } }, colour, flags); GfxDrawString(dpi, { l + 1, t }, static_cast(BlackLeftArrowString), {}); } // Thumb { - int16_t left = std::max(l + SCROLLBAR_WIDTH, l + scroll.h_thumb_left - 1); - int16_t right = std::min(r - SCROLLBAR_WIDTH, l + scroll.h_thumb_right - 1); + int16_t left = std::max(l + kScrollBarWidth, l + scroll.h_thumb_left - 1); + int16_t right = std::min(r - kScrollBarWidth, l + scroll.h_thumb_right - 1); uint8_t flags = (scroll.flags & HSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; GfxFillRectInset(dpi, { { left, t }, { right, b } }, colour, flags); @@ -762,7 +762,7 @@ static void WidgetHScrollbarDraw( { uint8_t flags = (scroll.flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; - GfxFillRectInset(dpi, { { r - (SCROLLBAR_WIDTH - 1), t }, { r, b } }, colour, flags); + GfxFillRectInset(dpi, { { r - (kScrollBarWidth - 1), t }, { r, b } }, colour, flags); GfxDrawString(dpi, { r - 6, t }, static_cast(BlackRightArrowString), {}); } } @@ -772,31 +772,31 @@ static void WidgetVScrollbarDraw( { colour &= 0x7F; // Trough - GfxFillRect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter); - GfxFillRect(dpi, { { l, t + SCROLLBAR_WIDTH }, { r, b - SCROLLBAR_WIDTH } }, 0x1000000 | ColourMapA[colour].mid_dark); - GfxFillRect(dpi, { { l + 2, t + SCROLLBAR_WIDTH }, { l + 2, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark); - GfxFillRect(dpi, { { l + 3, t + SCROLLBAR_WIDTH }, { l + 3, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter); - GfxFillRect(dpi, { { l + 7, t + SCROLLBAR_WIDTH }, { l + 7, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].mid_dark); - GfxFillRect(dpi, { { l + 8, t + SCROLLBAR_WIDTH }, { l + 8, b - SCROLLBAR_WIDTH } }, ColourMapA[colour].lighter); + GfxFillRect(dpi, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, ColourMapA[colour].lighter); + GfxFillRect(dpi, { { l, t + kScrollBarWidth }, { r, b - kScrollBarWidth } }, 0x1000000 | ColourMapA[colour].mid_dark); + GfxFillRect(dpi, { { l + 2, t + kScrollBarWidth }, { l + 2, b - kScrollBarWidth } }, ColourMapA[colour].mid_dark); + GfxFillRect(dpi, { { l + 3, t + kScrollBarWidth }, { l + 3, b - kScrollBarWidth } }, ColourMapA[colour].lighter); + GfxFillRect(dpi, { { l + 7, t + kScrollBarWidth }, { l + 7, b - kScrollBarWidth } }, ColourMapA[colour].mid_dark); + GfxFillRect(dpi, { { l + 8, t + kScrollBarWidth }, { l + 8, b - kScrollBarWidth } }, ColourMapA[colour].lighter); // Up button GfxFillRectInset( - dpi, { { l, t }, { r, t + (SCROLLBAR_WIDTH - 1) } }, colour, + dpi, { { l, t }, { r, t + (kScrollBarWidth - 1) } }, colour, ((scroll.flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); GfxDrawString(dpi, { l + 1, t - 1 }, static_cast(BlackUpArrowString), {}); // Thumb GfxFillRectInset( dpi, - { { l, std::max(t + SCROLLBAR_WIDTH, t + scroll.v_thumb_top - 1) }, - { r, std::min(b - SCROLLBAR_WIDTH, t + scroll.v_thumb_bottom - 1) } }, + { { l, std::max(t + kScrollBarWidth, t + scroll.v_thumb_top - 1) }, + { r, std::min(b - kScrollBarWidth, t + scroll.v_thumb_bottom - 1) } }, colour, ((scroll.flags & VSCROLLBAR_THUMB_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); // Down button GfxFillRectInset( - dpi, { { l, b - (SCROLLBAR_WIDTH - 1) }, { r, b } }, colour, + dpi, { { l, b - (kScrollBarWidth - 1) }, { r, b } }, colour, ((scroll.flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); - GfxDrawString(dpi, { l + 1, b - (SCROLLBAR_WIDTH - 1) }, static_cast(BlackDownArrowString), {}); + GfxDrawString(dpi, { l + 1, b - (kScrollBarWidth - 1) }, static_cast(BlackDownArrowString), {}); } /** @@ -952,15 +952,15 @@ void WidgetScrollGetPart( } const auto& scroll = w.scrolls[*scroll_id]; - if ((scroll.flags & HSCROLLBAR_VISIBLE) && screenCoords.y >= (w.windowPos.y + widget->bottom - (SCROLLBAR_WIDTH + 1))) + if ((scroll.flags & HSCROLLBAR_VISIBLE) && screenCoords.y >= (w.windowPos.y + widget->bottom - (kScrollBarWidth + 1))) { // horizontal scrollbar int32_t rightOffset = 0; - int32_t iteratorLeft = widget->left + w.windowPos.x + SCROLLBAR_WIDTH; - int32_t iteratorRight = widget->right + w.windowPos.x - SCROLLBAR_WIDTH; + int32_t iteratorLeft = widget->left + w.windowPos.x + kScrollBarWidth; + int32_t iteratorRight = widget->right + w.windowPos.x - kScrollBarWidth; if (!(scroll.flags & VSCROLLBAR_VISIBLE)) { - rightOffset = SCROLLBAR_WIDTH + 1; + rightOffset = kScrollBarWidth + 1; } if (screenCoords.x <= iteratorLeft) @@ -971,7 +971,7 @@ void WidgetScrollGetPart( { *output_scroll_area = SCROLL_PART_NONE; } - else if (screenCoords.x >= iteratorRight + rightOffset - SCROLLBAR_WIDTH) + else if (screenCoords.x >= iteratorRight + rightOffset - kScrollBarWidth) { *output_scroll_area = SCROLL_PART_HSCROLLBAR_RIGHT; } @@ -988,15 +988,15 @@ void WidgetScrollGetPart( *output_scroll_area = SCROLL_PART_HSCROLLBAR_THUMB; } } - else if ((scroll.flags & VSCROLLBAR_VISIBLE) && (screenCoords.x >= w.windowPos.x + widget->right - (SCROLLBAR_WIDTH + 1))) + else if ((scroll.flags & VSCROLLBAR_VISIBLE) && (screenCoords.x >= w.windowPos.x + widget->right - (kScrollBarWidth + 1))) { // vertical scrollbar int32_t bottomOffset = 0; - int32_t iteratorTop = widget->top + w.windowPos.y + SCROLLBAR_WIDTH; + int32_t iteratorTop = widget->top + w.windowPos.y + kScrollBarWidth; int32_t iteratorBottom = widget->bottom + w.windowPos.y; if (scroll.flags & HSCROLLBAR_VISIBLE) { - bottomOffset = (SCROLLBAR_WIDTH + 1); + bottomOffset = (kScrollBarWidth + 1); } if (screenCoords.y <= iteratorTop) @@ -1007,7 +1007,7 @@ void WidgetScrollGetPart( { *output_scroll_area = SCROLL_PART_NONE; } - else if (screenCoords.y >= (iteratorBottom - bottomOffset - SCROLLBAR_WIDTH)) + else if (screenCoords.y >= (iteratorBottom - bottomOffset - kScrollBarWidth)) { *output_scroll_area = SCROLL_PART_VSCROLLBAR_BOTTOM; } diff --git a/src/openrct2-ui/interface/Widget.h b/src/openrct2-ui/interface/Widget.h index e253ba8af7..8273375012 100644 --- a/src/openrct2-ui/interface/Widget.h +++ b/src/openrct2-ui/interface/Widget.h @@ -9,8 +9,147 @@ #pragma once -#include +#include "Window.h" + +#include #include +#include ImageId GetColourButtonImage(colour_t colour); Widget* GetWidgetByIndex(const WindowBase& w, WidgetIndex widgetIndex); + +constexpr auto kWidgetsEnd = Widget{ WindowWidgetType::Last, 0, 0, 0, 0, 0, 0, 0 }; +constexpr auto kBarBlink = (1u << 31); + +enum class WindowColour : uint8_t +{ + Primary, + Secondary, + Tertiary, + Quaternary, +}; + +constexpr uint8_t kScrollBarWidth = 10; + +constexpr ScreenSize kTabSize = { 31, 27 }; + +constexpr Widget MakeWidget( + const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, + uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) +{ + Widget out = {}; + out.left = origin.x; + out.right = origin.x + size.width - 1; + out.top = origin.y; + out.bottom = origin.y + size.height - 1; + out.type = type; + out.colour = static_cast(colour); + out.content = content; + out.tooltip = tooltip; + + return out; +} + +constexpr Widget MakeWidget( + const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageId image, + StringId tooltip = STR_NONE) +{ + Widget out = {}; + out.left = origin.x; + out.right = origin.x + size.width - 1; + out.top = origin.y; + out.bottom = origin.y + size.height - 1; + out.type = type; + out.colour = static_cast(colour); + out.image = image; + out.tooltip = tooltip; + + return out; +} + +constexpr Widget MakeRemapWidget( + const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageIndex content, + StringId tooltip = STR_NONE) +{ + return MakeWidget(origin, size, type, colour, ImageId(content, FilterPaletteID::PaletteNull), tooltip); +} + +constexpr Widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = STR_NONE) +{ + const ScreenSize size = kTabSize; + const WindowWidgetType type = WindowWidgetType::Tab; + const WindowColour colour = WindowColour::Secondary; + const auto content = ImageId(ImageIndexUndefined); + + return MakeWidget(origin, size, type, colour, content, tooltip); +} + +// NOLINTBEGIN +#define MakeSpinnerWidgets(...) \ + MakeWidget(__VA_ARGS__), MakeSpinnerIncreaseWidget(__VA_ARGS__), MakeSpinnerDecreaseWidget(__VA_ARGS__) +// NOLINTEND + +constexpr Widget MakeSpinnerDecreaseWidget( + const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) +{ + const int16_t xPos = origin.x + size.width - 26; + const int16_t yPos = origin.y + 1; + const uint16_t width = 13; + const uint16_t height = size.height - 2; + + return MakeWidget({ xPos, yPos }, { width, height }, WindowWidgetType::Button, colour, STR_NUMERIC_DOWN, tooltip); +} + +constexpr Widget MakeSpinnerIncreaseWidget( + const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) +{ + const int16_t xPos = origin.x + size.width - 13; + const int16_t yPos = origin.y + 1; + const uint16_t width = 12; + const uint16_t height = size.height - 2; + + return MakeWidget({ xPos, yPos }, { width, height }, WindowWidgetType::Button, colour, STR_NUMERIC_UP, tooltip); +} + +// NOLINTNEXTLINE +#define MakeDropdownWidgets(...) MakeDropdownBoxWidget(__VA_ARGS__), MakeDropdownButtonWidget(__VA_ARGS__) + +constexpr Widget MakeDropdownBoxWidget( + const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, + [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) +{ + 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 = 0xFFFFFFFF, StringId tooltip = STR_NONE) +{ + const int16_t xPos = origin.x + size.width - 11; + const int16_t yPos = origin.y + 1; + const uint16_t width = 11; + const uint16_t height = 10; + + return MakeWidget({ xPos, yPos }, { width, height }, WindowWidgetType::Button, colour, STR_DROPDOWN_GLYPH, tooltip); +} + +void WidgetDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widgetIndex); + +bool WidgetIsDisabled(const WindowBase& w, WidgetIndex widgetIndex); +bool WidgetIsHoldable(const WindowBase& w, WidgetIndex widgetIndex); +bool WidgetIsVisible(const WindowBase& w, WidgetIndex widgetIndex); +bool WidgetIsPressed(const WindowBase& w, WidgetIndex widgetIndex); +bool WidgetIsHighlighted(const WindowBase& w, WidgetIndex widgetIndex); +bool WidgetIsActiveTool(const WindowBase& w, WidgetIndex widgetIndex); +void WidgetScrollGetPart( + WindowBase& w, const Widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords, + int32_t* output_scroll_area, int32_t* scroll_id); + +void WidgetSetEnabled(WindowBase& w, WidgetIndex widgetIndex, bool enabled); +void WidgetSetDisabled(WindowBase& w, WidgetIndex widgetIndex, bool value); +void WidgetSetHoldable(WindowBase& w, WidgetIndex widgetIndex, bool value); +void WidgetSetVisible(WindowBase& w, WidgetIndex widgetIndex, bool value); +void WidgetSetPressed(WindowBase& w, WidgetIndex widgetIndex, bool value); +void WidgetSetCheckboxValue(WindowBase& w, WidgetIndex widgetIndex, bool value); diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index ab5f204842..9f0ee0c34f 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -10,6 +10,7 @@ #include "Window.h" #include "Theme.h" +#include "Widget.h" #include "openrct2/world/Location.hpp" #include diff --git a/src/openrct2-ui/scripting/CustomWindow.cpp b/src/openrct2-ui/scripting/CustomWindow.cpp index c6d4d91d78..ba513ce796 100644 --- a/src/openrct2-ui/scripting/CustomWindow.cpp +++ b/src/openrct2-ui/scripting/CustomWindow.cpp @@ -508,11 +508,11 @@ namespace OpenRCT2::Ui::Windows if (listView.GetScrollbars() == ScrollbarType::Horizontal || listView.GetScrollbars() == ScrollbarType::Both) { - wheight -= SCROLLBAR_WIDTH + 1; + wheight -= kScrollBarWidth + 1; } if (listView.GetScrollbars() == ScrollbarType::Vertical || listView.GetScrollbars() == ScrollbarType::Both) { - wwidth -= SCROLLBAR_WIDTH + 1; + wwidth -= kScrollBarWidth + 1; } listView.Resize({ wwidth, wheight }); scrollIndex++; @@ -931,7 +931,7 @@ namespace OpenRCT2::Ui::Windows } } - widgetList.push_back(WIDGETS_END); + widgetList.push_back(kWidgetsEnd); widgets = widgetList.data(); WindowInitScrollWidgets(*this); diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index a7652fc4de..500dd9afcf 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -70,12 +70,12 @@ static Widget _windowAboutOpenRCT2Widgets[] = { MakeWidget({168, 115 + 40}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CHANGELOG_ELLIPSIS), // changelog button MakeWidget({168, 115 + 60}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_JOIN_DISCORD ), // "join discord" button MakeWidget({168, 115 + 80}, {200, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CONTRIBUTORS_WINDOW_BUTTON), // "contributors" button - WIDGETS_END, + kWidgetsEnd, }; static Widget _windowAboutRCT2Widgets[] = { WIDGETS_MAIN, - WIDGETS_END, + kWidgetsEnd, }; static Widget *_windowAboutPageWidgets[] = { diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index db8988ed34..6114257720 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -45,7 +45,7 @@ static Widget WindowAssetPacksWidgets[] = { MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_ARROW_UP), STR_INCREASE_PRIOTITY_TIP), MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_ARROW_DOWN), STR_DECREASE_PRIOTITY_TIP), MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_RELOAD), STR_RELOAD_ASSET_PACKS_TIP), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index bb4b06f602..7662621e06 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -67,7 +67,7 @@ static Widget window_banner_widgets[] = { MakeWidget({ 5, WH - 16}, {12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // high money MakeWidget({ 43, WH - 16}, {39, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // high money MakeWidget({ 70, WH - 15}, {11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_TEXT_COLOUR_TIP ), // high money - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 2a3c8aa2b4..5f51a4c71b 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -48,7 +48,7 @@ static Widget _windowChangelogWidgets[] = { MakeWidget({0, 14}, {500, 382}, WindowWidgetType::Resize, WindowColour::Secondary ), // content panel MakeWidget({3, 16}, {495, 366}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_BOTH ), // scroll area MakeWidget({3, 473}, {300, 14}, WindowWidgetType::Placeholder, WindowColour::Secondary, STR_NEW_RELEASE_DOWNLOAD_PAGE), // changelog button - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index bb2aae8cb1..4d05f99762 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -219,7 +219,7 @@ static Widget window_cheats_money_widgets[] = MakeSpinnerWidgets({120, 239}, CHEAT_SPINNER, WindowWidgetType::Spinner, WindowColour::Secondary ), // Day box MakeWidget ({ 11, 258}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_DATE_SET ), // Set Date MakeWidget ({127, 258}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_DATE_RESET ), // Reset Date - WIDGETS_END, + kWidgetsEnd, }; static Widget window_cheats_guests_widgets[] = @@ -252,7 +252,7 @@ static Widget window_cheats_guests_widgets[] = MakeWidget({127, 384}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_SHOP_ITEM_PLURAL_UMBRELLA ), // give guests umbrellas MakeWidget({ 11, 426}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_LARGE_TRAM_GUESTS, STR_CHEAT_LARGE_TRAM_GUESTS_TIP), // large tram MakeWidget({127, 426}, CHEAT_BUTTON, WindowWidgetType::Button, WindowColour::Secondary, STR_CHEAT_REMOVE_ALL_GUESTS, STR_CHEAT_REMOVE_ALL_GUESTS_TIP), // remove all guests - WIDGETS_END, + kWidgetsEnd, }; //Strings for following moved to window_cheats_paint() @@ -293,7 +293,7 @@ static Widget window_cheats_misc_widgets[] = MakeWidget ({ 11, 407}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_PATH_AS_QUEUE, STR_CHEAT_ALLOW_PATH_AS_QUEUE_TIP ), // Allow regular footpaths as queue path MakeWidget ({ 11, 428}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES, STR_CHEAT_ALLOW_SPECIAL_COLOUR_SCHEMES_TIP ), // Allow special colours in dropdown - WIDGETS_END, + kWidgetsEnd, }; static Widget window_cheats_rides_widgets[] = { @@ -319,7 +319,7 @@ static Widget window_cheats_rides_widgets[] = MakeWidget({ 11, 384}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES ), // Show vehicles from other track types MakeWidget({ 11, 405}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT, STR_CHEAT_DISABLE_TRAIN_LENGTH_LIMIT_TIP ), // Disable train length limits MakeWidget({ 11, 426}, CHEAT_CHECK, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CHEAT_IGNORE_RESEARCH_STATUS, STR_CHEAT_IGNORE_RESEARCH_STATUS_TIP ), // Ignore Research Status - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_cheats_page_widgets[] = diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index bd06d6c4af..0eff932f74 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -58,7 +58,7 @@ static Widget window_clear_scenery_widgets[] = { MakeRemapWidget( { 67, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_FOOTPATH, STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP), // footpaths - WIDGETS_END, + kWidgetsEnd, }; class CleanSceneryWindow final : public Window diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 13f2c64d14..a7a03f73a1 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -41,7 +41,7 @@ static Widget window_custom_currency_widgets[] = { MakeWidget ({120, 50}, { 81, 11}, WindowWidgetType::Button, WindowColour::Secondary, STR_EMPTY ), MakeWidget ({220, 50}, {131, 11}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), MakeWidget ({339, 51}, { 11, 9}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index a6adcada05..d7b6434325 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -40,7 +40,7 @@ static Widget window_debug_paint_widgets[] = { MakeWidget({8, 8 + 15 * 2}, { 185, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_DEBUG_PAINT_SHOW_SEGMENT_HEIGHTS), MakeWidget({8, 8 + 15 * 3}, { 185, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_DEBUG_PAINT_SHOW_BOUND_BOXES ), MakeWidget({8, 8 + 15 * 4}, { 185, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_DEBUG_PAINT_SHOW_DIRTY_VISUALS ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index cee8a4bd02..9e47e3fde7 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -39,7 +39,7 @@ static Widget window_ride_demolish_widgets[] = WINDOW_SHIM_WHITE(STR_DEMOLISH_RIDE, WW, WH), MakeWidget({ 10, WH - 22}, {85, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_DEMOLISH ), MakeWidget({WW - 95, WH - 22}, {85, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 040f0ab728..7cf3e40a78 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -45,7 +45,7 @@ enum static Widget window_dropdown_widgets[] = { MakeWidget({ 0, 0 }, { 1, 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; int32_t gDropdownNumItems; diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index ad5a361fec..99c30208f5 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -43,7 +43,7 @@ static Widget _editorBottomToolbarWidgets[] = { MakeWidget({ 2, 2}, {196, 30}, WindowWidgetType::FlatBtn, WindowColour::Primary), MakeWidget({440, 0}, {200, 34}, WindowWidgetType::ImgBtn, WindowColour::Primary), MakeWidget({442, 2}, {196, 30}, WindowWidgetType::FlatBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index c8a9b64aa6..cce7f2ac2c 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -59,12 +59,12 @@ static Widget _inventionListWidgets[] = { MakeWidget({375, 343}, {220, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_MOVE_ALL_TOP ), MakeWidget({375, 358}, {220, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_MOVE_ALL_BOTTOM ), MakeWidget({375, 373}, {220, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RANDOM_SHUFFLE, STR_RANDOM_SHUFFLE_TIP), - WIDGETS_END, + kWidgetsEnd, }; static Widget _inventionListDragWidgets[] = { MakeWidget({0, 0}, {150, 14}, WindowWidgetType::ImgBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 8f0cf44c86..b94649d3d9 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -219,7 +219,7 @@ static std::vector _window_editor_object_selection_widgets = { MakeTab ({ 3, 17}, STR_STRING_DEFINED_TOOLTIP ), // Copied object type times... - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 740ac35864..da18273156 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -126,13 +126,13 @@ static Widget window_editor_objective_options_main_widgets[] = { MakeWidget ({ 98, 133}, {180, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_NONE, 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), - WIDGETS_END, + kWidgetsEnd, }; static Widget window_editor_objective_options_rides_widgets[] = { MAIN_OBJECTIVE_OPTIONS_WIDGETS, MakeWidget({ 3, 60}, {374, 161}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_editor_objective_options_widgets[] = { diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index 8d0cf0059d..d923c7079d 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -135,7 +135,7 @@ static Widget window_editor_scenario_options_financial_widgets[] = { MakeSpinnerWidgets({168, 116}, { 70, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets MakeWidget ({ 8, 133}, {WW_FINANCIAL - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORBID_MARKETING, STR_FORBID_MARKETING_TIP ), MakeWidget ({ 8, 116}, {WW_FINANCIAL - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_RCT1_INTEREST, STR_RCT1_INTEREST_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget window_editor_scenario_options_guests_widgets[] = { @@ -150,7 +150,7 @@ static Widget window_editor_scenario_options_guests_widgets[] = { MakeSpinnerWidgets({268, 99}, { 70, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets MakeWidget ({ 8, 116}, {WW_GUESTS - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_GUESTS_PREFER_LESS_INTENSE_RIDES, STR_GUESTS_PREFER_LESS_INTENSE_RIDES_TIP), MakeWidget ({ 8, 133}, {WW_GUESTS - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_GUESTS_PREFER_MORE_INTENSE_RIDES, STR_GUESTS_PREFER_MORE_INTENSE_RIDES_TIP), - WIDGETS_END, + kWidgetsEnd, }; static Widget window_editor_scenario_options_park_widgets[] = { @@ -171,7 +171,7 @@ static Widget window_editor_scenario_options_park_widgets[] = { MakeWidget ({ 8, 150}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_FORBID_HIGH_CONSTRUCTION, STR_FORBID_HIGH_CONSTRUCTION_TIP ), MakeWidget ({ 8, 167}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_HARD_PARK_RATING, STR_HARD_PARK_RATING_TIP ), MakeWidget ({ 8, 184}, {WW_PARK - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_HARD_GUEST_GENERATION, STR_HARD_GUEST_GENERATION_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_editor_scenario_options_widgets[] = { diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index bd772f24ed..1dffdd6a9b 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -25,7 +25,7 @@ enum { static Widget window_error_widgets[] = { MakeWidget({0, 0}, {200, 42}, WindowWidgetType::ImgBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 4910574e97..d8a93935dc 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -116,25 +116,25 @@ static Widget _windowFinancesSummaryWidgets[] = MAIN_FINANCES_WIDGETS(STR_FINANCIAL_SUMMARY, RSW_OTHER_TABS, RSH_SUMMARY, WW_OTHER_TABS, WH_SUMMARY), MakeWidget ({130, 50}, {391, 211}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_HORIZONTAL ), MakeSpinnerWidgets({ 64, 279}, { 97, 14}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_FINANCES_SUMMARY_LOAN_VALUE), // NB: 3 widgets. - WIDGETS_END, + kWidgetsEnd, }; static Widget _windowFinancesCashWidgets[] = { MAIN_FINANCES_WIDGETS(STR_FINANCIAL_GRAPH, RSW_OTHER_TABS, RSH_OTHER_TABS, WW_OTHER_TABS, WH_OTHER_TABS), - WIDGETS_END, + kWidgetsEnd, }; static Widget _windowFinancesParkValueWidgets[] = { MAIN_FINANCES_WIDGETS(STR_PARK_VALUE_GRAPH, RSW_OTHER_TABS, RSH_OTHER_TABS, WW_OTHER_TABS, WH_OTHER_TABS), - WIDGETS_END, + kWidgetsEnd, }; static Widget _windowFinancesProfitWidgets[] = { MAIN_FINANCES_WIDGETS(STR_PROFIT_GRAPH, RSW_OTHER_TABS, RSH_OTHER_TABS, WW_OTHER_TABS, WH_OTHER_TABS), - WIDGETS_END, + kWidgetsEnd, }; static Widget _windowFinancesMarketingWidgets[] = @@ -148,7 +148,7 @@ static Widget _windowFinancesMarketingWidgets[] = MakeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN), MakeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN), MakeWidget({8, 0}, {WW_OTHER_TABS - 16, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_START_THIS_MARKETING_CAMPAIGN), - WIDGETS_END, + kWidgetsEnd, }; static Widget _windowFinancesResearchWidgets[] = @@ -165,7 +165,7 @@ static Widget _windowFinancesResearchWidgets[] = MakeWidget({ 8, 160}, {WW_RESEARCH - 14, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary, STR_RESEARCH_NEW_WATER_RIDES, STR_RESEARCH_NEW_WATER_RIDES_TIP ), MakeWidget({ 8, 173}, {WW_RESEARCH - 14, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary, STR_RESEARCH_NEW_SHOPS_AND_STALLS, STR_RESEARCH_NEW_SHOPS_AND_STALLS_TIP ), MakeWidget({ 8, 186}, {WW_RESEARCH - 14, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary, STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 126ea3d7f4..94080b04ec 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -112,7 +112,7 @@ static Widget window_footpath_widgets[] = { MakeWidget({ 3, 361}, {100, 54}, WindowWidgetType::Groupbox, WindowColour::Primary ), MakeWidget({13, 372}, { 36, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_LAND), STR_CONSTRUCT_FOOTPATH_ON_LAND_TIP ), MakeWidget({57, 372}, { 36, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_CONSTRUCTION_FOOTPATH_BRIDGE), STR_CONSTRUCT_BRIDGE_OR_TUNNEL_FOOTPATH_TIP ), - WIDGETS_END, + kWidgetsEnd, }; #pragma endregion diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index c21bdce9db..42453791d0 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -66,7 +66,7 @@ static Widget window_game_bottom_toolbar_widgets[] = MakeWidget({498, 0}, {142, 34}, WindowWidgetType::ImgBtn, WindowColour::Primary ), // Right outset panel MakeWidget({500, 2}, {138, 30}, WindowWidgetType::ImgBtn, WindowColour::Primary ), // Right inset panel MakeWidget({500, 2}, {138, 12}, WindowWidgetType::FlatBtn, WindowColour::Primary ), // Date - WIDGETS_END, + kWidgetsEnd, }; uint8_t gToolbarDirtyFlags; @@ -151,7 +151,7 @@ private: int16_t bar_width = (factor * 114) / 255; GfxFillRectInset( dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, colours[1], INSET_RECT_F_30); - if (!(colour & BAR_BLINK) || GameIsPaused() || (gCurrentRealTimeTicks & 8)) + if (!(colour & kBarBlink) || GameIsPaused() || (gCurrentRealTimeTicks & 8)) { if (bar_width > 2) { diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index f49e9eba4e..35c4b58c63 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -104,39 +104,39 @@ static Widget _guestWindowWidgetsOverview[] = { MakeWidget({167, 69}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_RENAME), STR_NAME_GUEST_TIP ), // Rename Button MakeWidget({167, 93}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP ), // Locate Button MakeWidget({167, 117}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_TRACK_PEEP), STR_TOGGLE_GUEST_TRACKING_TIP), // Track Button - WIDGETS_END, + kWidgetsEnd, }; // clang-format on static Widget _guestWindowWidgetsStats[] = { MAIN_GUEST_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget _guestWindowWidgetsRides[] = { MAIN_GUEST_WIDGETS, MakeWidget({ 3, 57 }, { 186, 87 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), - WIDGETS_END, + kWidgetsEnd, }; static Widget _guestWindowWidgetsFinance[] = { MAIN_GUEST_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget _guestWindowWidgetsThoughts[] = { MAIN_GUEST_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget _guestWindowWidgetsInventory[] = { MAIN_GUEST_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget _guestWindowWidgetsDebug[] = { MAIN_GUEST_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; // clang-format off @@ -706,7 +706,7 @@ private: return; } - ViewportUpdateSmartFollowGuest(this, peep); + ViewportUpdateSmartFollowGuest(this, *peep); bool reCreateViewport = false; uint16_t origViewportFlags{}; if (viewport != nullptr) diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 1871352059..60e0515ef7 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -67,7 +67,7 @@ static Widget window_guest_list_widgets[] = { MakeTab ({ 3, 17}, STR_INDIVIDUAL_GUESTS_TIP ), // tab 1 MakeTab ({ 34, 17}, STR_SUMMARISED_GUESTS_TIP ), // tab 2 MakeWidget({ 3, 72}, {344, 255}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_BOTH ), // guest list - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index f1cea9d926..59447abcc7 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -53,7 +53,7 @@ static Widget window_install_track_widgets[] = { MakeWidget({PREVIEW_BUTTONS_LEFT, 398}, { 22, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary, ImageId(SPR_SCENERY), STR_TOGGLE_SCENERY_TIP), MakeWidget({ ACTION_BUTTONS_LEFT, 241}, { 97, 15}, WindowWidgetType::Button, WindowColour::Primary, STR_INSTALL_NEW_TRACK_DESIGN_INSTALL ), MakeWidget({ ACTION_BUTTONS_LEFT, 259}, { 97, 15}, WindowWidgetType::Button, WindowColour::Primary, STR_INSTALL_NEW_TRACK_DESIGN_CANCEL ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index f7e185f66c..e88f254b17 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -49,7 +49,7 @@ static Widget window_land_widgets[] = { 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 MakeWidget ({49, 106}, {47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP), // wall texture - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 38523d4daa..63bef5983a 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -48,7 +48,7 @@ static Widget window_land_rights_widgets[] = { MakeRemapWidget({54, 32}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_LAND_RIGHTS_TIP ), // increment size MakeRemapWidget({22, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary, SPR_BUY_LAND_RIGHTS, STR_BUY_LAND_RIGHTS_TIP ), // land rights MakeRemapWidget({52, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary, SPR_BUY_CONSTRUCTION_RIGHTS, STR_BUY_CONSTRUCTION_RIGHTS_TIP ), // construction rights - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index aac1fd5180..62c3b2a0ae 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -78,7 +78,7 @@ static Widget window_loadsave_widgets[] = MakeWidget({(WW - 5) / 2 + 1, 55}, {170, 14}, WindowWidgetType::TableHeader, WindowColour::Primary ), // WIDX_SORT_DATE MakeWidget({ 4, 68}, {342, 303}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_VERTICAL ), // WIDX_SCROLL MakeWidget({ 4, WH - 24}, {197, 19}, WindowWidgetType::Button, WindowColour::Primary, STR_FILEBROWSER_USE_SYSTEM_WINDOW ), // WIDX_BROWSE - WIDGETS_END, + kWidgetsEnd, }; // clang-format on @@ -712,7 +712,7 @@ public: Widget* date_widget = &window_loadsave_widgets[WIDX_SORT_DATE]; date_widget->right = width - 5; - date_widget->left = date_widget->right - (maxDateWidth + maxTimeWidth + (4 * DATE_TIME_GAP) + (SCROLLBAR_WIDTH + 1)); + date_widget->left = date_widget->right - (maxDateWidth + maxTimeWidth + (4 * DATE_TIME_GAP) + (kScrollBarWidth + 1)); window_loadsave_widgets[WIDX_SORT_NAME].left = 4; window_loadsave_widgets[WIDX_SORT_NAME].right = window_loadsave_widgets[WIDX_SORT_DATE].left - 1; @@ -1093,7 +1093,7 @@ static Widget window_overwrite_prompt_widgets[] = { { WindowWidgetType::Button, 0, 10, 94, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_FILEBROWSER_OVERWRITE_TITLE, STR_NONE }, { WindowWidgetType::Button, 0, OVERWRITE_WW - 95, OVERWRITE_WW - 11, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_SAVE_PROMPT_CANCEL, STR_NONE }, - WIDGETS_END, + kWidgetsEnd, }; class OverwritePromptWindow final : public Window diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 3484275922..b61bb7b880 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -18,7 +18,7 @@ // clang-format off static Widget _mainWidgets[] = { MakeWidget({0, 0}, {0, 0}, WindowWidgetType::Viewport, WindowColour::Primary, STR_VIEWPORT), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index e4fe618391..296fdc8a07 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -125,7 +125,7 @@ static Widget window_map_widgets[] = { MakeWidget ({ 58, 197}, {174, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_CONSTRUCTION_RIGHTS_SALE, STR_SET_CONSTRUCTION_RIGHTS_TO_BE_AVAILABLE_TIP), MakeWidget ({218, 45}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_ROTATE_ARROW), STR_ROTATE_OBJECTS_90 ), MakeWidget ({110, 189}, {131, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_MAPGEN_WINDOW_TITLE, STR_MAP_GENERATOR_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // used in transforming viewport view coordinates to minimap coordinates diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 2945a9fad2..f8bae95d8e 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -142,7 +142,7 @@ static Widget MapWidgets[] = { MakeSpinnerWidgets({104, 88}, {95, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // NB: 3 widgets MakeWidget ({104, 106}, {47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP ), MakeWidget ({151, 106}, {47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget RandomWidgets[] = { @@ -150,7 +150,7 @@ static Widget RandomWidgets[] = { MakeWidget({155, 255}, { 90, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_MAPGEN_ACTION_GENERATE ), MakeWidget({ 4, 52}, {195, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_MAPGEN_OPTION_RANDOM_TERRAIN), MakeWidget({ 4, 70}, {195, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_MAPGEN_OPTION_PLACE_TREES ), - WIDGETS_END, + kWidgetsEnd, }; static Widget SimplexWidgets[] = { @@ -169,7 +169,7 @@ static Widget SimplexWidgets[] = { MakeWidget ({102, 202}, { 47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_BASE_LAND_TIP ), // WIDX_SIMPLEX_FLOOR_TEXTURE MakeWidget ({150, 202}, { 47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP ), // WIDX_SIMPLEX_WALL_TEXTURE MakeWidget ({104, 239}, { 95, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary ), // WIDX_SIMPLEX_PLACE_TREES_CHECKBOX - WIDGETS_END, + kWidgetsEnd, }; static Widget HeightmapWidgets[] = { @@ -182,7 +182,7 @@ static Widget HeightmapWidgets[] = { MakeSpinnerWidgets({104, 124}, { 95, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // WIDX_HEIGHTMAP_LOW{,_UP,_DOWN} MakeSpinnerWidgets({104, 142}, { 95, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // WIDX_HEIGHTMAP_HIGH{,_UP,_DOWN} MakeSpinnerWidgets({104, 160}, { 95, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // WIDX_HEIGHTMAP_WATER_LEVEL{,_UP,_DOWN} - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 3cfdb68c5a..0361c3e6b3 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -20,7 +20,7 @@ // clang-format off static Widget window_map_tooltip_widgets[] = { MakeWidget({0, 0}, {200, 30}, WindowWidgetType::ImgBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 527df8e5ad..48ba5c9832 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -87,7 +87,7 @@ static Widget window_maze_construction_widgets[] = { MakeWidget({87, 178}, { 70, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_RIDE_CONSTRUCTION_EXIT, STR_RIDE_CONSTRUCTION_EXIT_TIP ), MakeWidget({ 0, 0}, { 1, 1}, WindowWidgetType::Empty, WindowColour::Primary ), MakeWidget({ 0, 0}, { 1, 1}, WindowWidgetType::Empty, WindowColour::Primary ), - WIDGETS_END, + kWidgetsEnd, }; #pragma endregion diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 328e86fdde..7be9caed98 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -70,7 +70,7 @@ enum WindowMultiplayerWidgetIdx { static Widget window_multiplayer_information_widgets[] = { MAIN_MULTIPLAYER_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget window_multiplayer_players_widgets[] = { @@ -80,7 +80,7 @@ static Widget window_multiplayer_players_widgets[] = { MakeWidget({259, 46}, {100, 15}, WindowWidgetType::TableHeader, WindowColour::Primary , STR_LAST_ACTION), // Player name MakeWidget({359, 46}, { 42, 15}, WindowWidgetType::TableHeader, WindowColour::Primary , STR_PING ), // Player name MakeWidget({ 3, 60}, {334, 177}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), // list - WIDGETS_END, + kWidgetsEnd, }; static Widget window_multiplayer_groups_widgets[] = { @@ -93,7 +93,7 @@ static Widget window_multiplayer_groups_widgets[] = { MakeWidget({ 72, 80}, {175, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // selected group MakeWidget({236, 81}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH), MakeWidget({ 3, 94}, {314, 207}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL ), // permissions list - WIDGETS_END, + kWidgetsEnd, }; static Widget window_multiplayer_options_widgets[] = { @@ -101,7 +101,7 @@ static Widget window_multiplayer_options_widgets[] = { MakeWidget({3, 50}, {295, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_LOG_CHAT, STR_LOG_CHAT_TIP ), MakeWidget({3, 64}, {295, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_LOG_SERVER_ACTIONS, STR_LOG_SERVER_ACTIONS_TIP ), MakeWidget({3, 78}, {295, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_ALLOW_KNOWN_KEYS_ONLY, STR_ALLOW_KNOWN_KEYS_ONLY_TIP), - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_multiplayer_page_widgets[] = { diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index d93fc5edc8..29dc11758b 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -26,7 +26,7 @@ static Widget window_network_status_widgets[] = { MakeWidget({ 0, 0}, {441, 91}, WindowWidgetType::Frame, WindowColour::Primary ), // panel / background MakeWidget({ 1, 1}, {438, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_NONE, STR_WINDOW_TITLE_TIP), // title bar MakeWidget({427, 2}, { 11, 12}, WindowWidgetType::CloseBox, WindowColour::Primary, STR_CLOSE_X, STR_CLOSE_WINDOW_TIP), // close x button - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 295885fbfb..bdb372bfd6 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -52,7 +52,7 @@ static Widget window_new_campaign_widgets[] = { 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) MakeWidget ({ 14, 89}, {322, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN), // start button - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index a2bda0caae..65099ed86c 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -223,7 +223,7 @@ static Widget window_new_ride_widgets[] = { MakeWidget({ 4, 46}, {211, 14}, WindowWidgetType::TextBox, WindowColour::Secondary ), MakeWidget({218, 46}, { 70, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_OBJECT_SEARCH_CLEAR ), MakeWidget(GroupByTrackTypeOrigin, GroupTrackTypeSize, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_GROUP_BY_TRACK_TYPE, STR_GROUP_BY_TRACK_TYPE_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 0765f8c96f..13431bd0e6 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -42,7 +42,7 @@ static Widget window_news_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({372, 18}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary, ImageId(SPR_TAB_GEARS_0)), // settings MakeWidget({ 4, 44}, {392, 252}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_VERTICAL), // scroll - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index c138cef81c..1a2a140869 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -83,7 +83,7 @@ static Widget WindowNewsOptionsWidgets[] = { MakeWidget({ 0, 0}, {343, 14}, WindowWidgetType::Checkbox, WindowColour::Tertiary ), MakeWidget({ 0, 0}, {343, 14}, WindowWidgetType::Checkbox, WindowColour::Tertiary ), MakeWidget({ 0, 0}, {343, 14}, WindowWidgetType::Checkbox, WindowColour::Tertiary ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index b3ce56655a..88ca2b2a72 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -285,7 +285,7 @@ static Widget window_object_load_error_widgets[] = { #ifndef DISABLE_HTTP MakeWidget({ 300, 377}, {146, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_DOWNLOAD_ALL, STR_DOWNLOAD_ALL_TIP ), // Download all button #endif - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index e9acc5492f..3d12d0ec13 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -249,7 +249,7 @@ static Widget window_options_display_widgets[] = { MakeWidget ({ 11, 176}, {143, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_USE_VSYNC, STR_USE_VSYNC_TIP ), // Use vsync MakeWidget ({ 11, 191}, {280, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_MINIMISE_FULLSCREEN_ON_FOCUS_LOSS, STR_MINIMISE_FULLSCREEN_ON_FOCUS_LOSS_TIP), // Minimise fullscreen focus loss MakeWidget ({ 11, 206}, {280, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_DISABLE_SCREENSAVER, STR_DISABLE_SCREENSAVER_TIP ), // Disable screensaver - WIDGETS_END, + kWidgetsEnd, }; static Widget window_options_rendering_widgets[] = { @@ -273,7 +273,7 @@ static Widget window_options_rendering_widgets[] = { MakeWidget({10, FRAME_EFFECTS_START + 60}, {281, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_RENDER_WEATHER_EFFECTS, STR_RENDER_WEATHER_EFFECTS_TIP ), // Render weather effects MakeWidget({25, FRAME_EFFECTS_START + 75}, {266, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_DISABLE_LIGHTNING_EFFECT, STR_DISABLE_LIGHTNING_EFFECT_TIP), // Disable lightning effect #undef FRAME_EFFECTS_START - WIDGETS_END, + kWidgetsEnd, }; static Widget window_options_culture_widgets[] = { @@ -296,7 +296,7 @@ static Widget window_options_culture_widgets[] = { MakeWidget({ 10, 128}, {145, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_DATE_FORMAT, STR_DATE_FORMAT_TIP ), // Date format MakeWidget({155, 128}, {145, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), MakeWidget({288, 129}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DATE_FORMAT_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget window_options_audio_widgets[] = { @@ -313,7 +313,7 @@ static Widget window_options_audio_widgets[] = { MakeWidget({155, 68}, {145, 13}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_HORIZONTAL ), // Master volume MakeWidget({155, 83}, {145, 13}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_HORIZONTAL ), // Sound effect volume MakeWidget({155, 98}, {145, 13}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_HORIZONTAL ), // Music volume - WIDGETS_END, + kWidgetsEnd, }; static Widget window_options_controls_and_interface_widgets[] = { @@ -344,7 +344,7 @@ static Widget window_options_controls_and_interface_widgets[] = { MakeWidget({ 24, TOOLBAR_GROUP_START + 61}, {162, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_MUTE_BUTTON_ON_TOOLBAR, STR_MUTE_BUTTON_ON_TOOLBAR_TIP ), // Mute MakeWidget({155, TOOLBAR_GROUP_START + 61}, {145, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_CHAT_BUTTON_ON_TOOLBAR, STR_CHAT_BUTTON_ON_TOOLBAR_TIP ), // Chat MakeWidget({ 24, TOOLBAR_GROUP_START + 76}, {122, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_ZOOM_BUTTON_ON_TOOLBAR, STR_ZOOM_BUTTON_ON_TOOLBAR_TIP ), // Zoom - WIDGETS_END, + kWidgetsEnd, #undef TOOLBAR_GROUP_START }; @@ -374,7 +374,7 @@ static Widget window_options_misc_widgets[] = { MakeWidget({ 10, TWEAKS_START + 62}, {165, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_DEFAULT_INSPECTION_INTERVAL, STR_DEFAULT_INSPECTION_INTERVAL_TIP), MakeWidget({175, TWEAKS_START + 61}, {125, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Default inspection time dropdown MakeWidget({288, TWEAKS_START + 62}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_DEFAULT_INSPECTION_INTERVAL_TIP ), // Default inspection time dropdown button - WIDGETS_END, + kWidgetsEnd, }; #undef TWEAKS_START @@ -397,7 +397,7 @@ static Widget window_options_advanced_widgets[] = { MakeWidget ({ 24, 184}, {266, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_NONE, STR_STRING_TOOLTIP ), // RCT 1 path button MakeWidget ({289, 184}, { 11, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_CLOSE_X, STR_PATH_TO_RCT1_CLEAR_TIP ), // RCT 1 path clear button MakeWidget ({ 24, 200}, {140, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_ASSET_PACKS, STR_NONE ), // Asset packs - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_options_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index c7312ad288..c5eaf575d7 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -105,40 +105,40 @@ static Widget _entranceWidgets[] = { MakeWidget({205, 121}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_RENAME), STR_NAME_PARK_TIP ), // rename MakeWidget({210, 51}, { 14, 15}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_RCT1_CLOSE_BUTTON_0), STR_CLOSE_PARK_TIP ), MakeWidget({210, 66}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0), STR_OPEN_PARK_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget _ratingWidgets[] = { MAIN_PARK_WIDGETS(255), - WIDGETS_END, + kWidgetsEnd, }; static Widget _guestsWidgets[] = { MAIN_PARK_WIDGETS(255), - WIDGETS_END, + kWidgetsEnd, }; static Widget _priceWidgets[] = { MAIN_PARK_WIDGETS(230), MakeWidget ({ 21, 50}, {126, 14}, WindowWidgetType::Label, WindowColour::Secondary, STR_ADMISSION_PRICE), MakeSpinnerWidgets({147, 50}, { 76, 14}, WindowWidgetType::Spinner, WindowColour::Secondary ), // Price (3 widgets) - WIDGETS_END, + kWidgetsEnd, }; static Widget _statsWidgets[] = { MAIN_PARK_WIDGETS(230), - WIDGETS_END, + kWidgetsEnd, }; static Widget _objectiveWidgets[] = { MAIN_PARK_WIDGETS(230), MakeWidget({7, 207}, {216, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_ENTER_NAME_INTO_SCENARIO_CHART), // enter name - WIDGETS_END, + kWidgetsEnd, }; static Widget _awardsWidgets[] = { MAIN_PARK_WIDGETS(230), - WIDGETS_END, + kWidgetsEnd, }; static std::array _pagedWidgets = { diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 75e70d9834..3a096aa865 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -45,7 +45,7 @@ static Widget PatrolAreaWidgets[] = { MakeWidget ({27, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0) ), // preview box MakeRemapWidget({28, 18}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_DECREASE, STR_ADJUST_SMALLER_PATROL_AREA_TIP), // decrement size MakeRemapWidget({54, 32}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_PATROL_AREA_TIP ), // increment size - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 9ca72b6dc2..a9d2f50957 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -59,12 +59,12 @@ static Widget window_player_overview_widgets[] = { MakeWidget({179, 45}, { 12, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_LOCATE), STR_LOCATE_PLAYER_TIP), // Locate button MakeWidget({179, 69}, { 12, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_KICK_PLAYER_TIP ), // Kick button MakeWidget({ 3, 60}, {175, 61}, WindowWidgetType::Viewport, WindowColour::Secondary ), // Viewport - WIDGETS_END, + kWidgetsEnd, }; static Widget window_player_statistics_widgets[] = { WINDOW_PLAYER_COMMON_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_player_page_widgets[] = { diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index 07a854f109..a98dca1d61 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -38,7 +38,7 @@ static Widget window_ride_refurbish_widgets[] = WINDOW_SHIM_WHITE(STR_REFURBISH_RIDE, WW, WH), MakeWidget({ 10, WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_REFURBISH), MakeWidget({ WW - 95, WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 9d6e591a03..7ae443680a 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -73,7 +73,7 @@ static Widget window_research_development_widgets[] = { MakeWidget({ 3, 47}, {WW_DEVELOPMENT - 10, 70}, WindowWidgetType::Groupbox, WindowColour::Tertiary , STR_CURRENTLY_IN_DEVELOPMENT ), MakeWidget({ 3, 124}, {WW_DEVELOPMENT - 10, 65}, WindowWidgetType::Groupbox, WindowColour::Tertiary , STR_LAST_DEVELOPMENT ), MakeWidget({265, 161}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary , 0xFFFFFFFF, STR_RESEARCH_SHOW_DETAILS_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget window_research_funding_widgets[] = { @@ -92,7 +92,7 @@ static Widget window_research_funding_widgets[] = { MakeWidget({ 8, 160}, {WW_FUNDING - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_RESEARCH_NEW_WATER_RIDES, STR_RESEARCH_NEW_WATER_RIDES_TIP ), MakeWidget({ 8, 173}, {WW_FUNDING - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_RESEARCH_NEW_SHOPS_AND_STALLS, STR_RESEARCH_NEW_SHOPS_AND_STALLS_TIP ), MakeWidget({ 8, 186}, {WW_FUNDING - 16, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary , STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static Widget *window_research_page_widgets[] = { diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 5a20dcde4f..e55227c195 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -257,7 +257,7 @@ static Widget _mainWidgets[] = { MakeWidget({296, 76}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0), STR_OPEN_RIDE_TIP ), MakeWidget({ 3, 180}, {305, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary, STR_ARG_6_STRINGID ), MakeWidget({297, 180}, { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), - WIDGETS_END, + kWidgetsEnd, }; // 0x009ADDA8 @@ -269,7 +269,7 @@ static Widget _vehicleWidgets[] = { MakeWidget ({ 7, 154}, {302, 43}, WindowWidgetType::Scroll, WindowColour::Secondary, STR_EMPTY ), 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), - WIDGETS_END, + kWidgetsEnd, }; // 0x009ADEFC @@ -292,7 +292,7 @@ static Widget _operatingWidgets[] = { MakeWidget ({297, 110}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH ), MakeWidget ({ 21, 89}, {129, 12}, WindowWidgetType::Label, WindowColour::Secondary, STR_NUMBER_OF_CIRCUITS, STR_NUMBER_OF_CIRCUITS_TIP ), MakeSpinnerWidgets({157, 89}, {152, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_NUMBER_OF_CIRCUITS_VALUE ), // NB: 3 widgets - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE190 @@ -303,7 +303,7 @@ static Widget _maintenanceWidgets[] = { 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 ), MakeWidget({241, 108}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_NO_ENTRY), STR_DEBUG_FORCE_BREAKDOWN_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE2A4 @@ -330,7 +330,7 @@ static Widget _colourWidgets[] = { MakeWidget({ 99, 190}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_1_TIP ), MakeWidget({119, 190}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_ADDITIONAL_COLOUR_2_TIP ), MakeWidget({100, 74}, {239, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_RANDOM_COLOUR ), - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE4C8 @@ -339,7 +339,7 @@ static Widget _musicWidgets[] = { 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({297, 63}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_MUSIC_STYLE_TIP), - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE5DC @@ -350,7 +350,7 @@ static Widget _measurementWidgets[] = { MakeWidget({158, 127}, {154, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RESET_SELECTION ), MakeWidget({ 4, 177}, {154, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_DESIGN_SAVE ), MakeWidget({158, 177}, {154, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_DESIGN_CANCEL ), - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE710 @@ -361,7 +361,7 @@ static Widget _graphsWidgets[] = { MakeWidget({ 76, 163}, { 73, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RIDE_STATS_ALTITUDE, STR_SHOW_GRAPH_OF_ALTITUDE_AGAINST_TIME_TIP ), MakeWidget({149, 163}, { 73, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RIDE_STATS_VERT_G, STR_SHOW_GRAPH_OF_VERTICAL_ACCELERATION_AGAINST_TIME_TIP), MakeWidget({222, 163}, { 73, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RIDE_STATS_LAT_G, STR_SHOW_GRAPH_OF_LATERAL_ACCELERATION_AGAINST_TIME_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE844 @@ -373,7 +373,7 @@ static Widget _incomeWidgets[] = { MakeWidget ({ 19, 94}, {126, 14}, WindowWidgetType::Label, WindowColour::Secondary ), MakeSpinnerWidgets({147, 94}, {162, 14}, WindowWidgetType::Spinner, WindowColour::Secondary, STR_RIDE_SECONDARY_PRICE_VALUE ), // NB: 3 widgets MakeWidget ({ 5, 106}, {306, 13}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_SAME_PRICE_THROUGHOUT_PARK, STR_SAME_PRICE_THROUGHOUT_PARK_TIP), - WIDGETS_END, + kWidgetsEnd, }; // 0x009AE9C8 @@ -382,7 +382,7 @@ static Widget _customerWidgets[] = { MakeWidget({289, 54}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_SHOW_GUESTS_THOUGHTS_ABOUT_THIS_RIDE_ATTRACTION), STR_SHOW_GUESTS_THOUGHTS_ABOUT_THIS_RIDE_ATTRACTION_TIP), MakeWidget({289, 78}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_SHOW_GUESTS_ON_THIS_RIDE_ATTRACTION), STR_SHOW_GUESTS_ON_THIS_RIDE_ATTRACTION_TIP ), MakeWidget({289, 102}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_SHOW_GUESTS_QUEUING_FOR_THIS_RIDE_ATTRACTION), STR_SHOW_GUESTS_QUEUING_FOR_THIS_RIDE_ATTRACTION_TIP ), - WIDGETS_END, + kWidgetsEnd, }; static const std::array PageWidgets = { @@ -3631,9 +3631,9 @@ private: void MaintenanceDrawBar(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour) const { GfxFillRectInset(dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, colours[1], INSET_RECT_F_30); - if (colour & BAR_BLINK) + if (colour & kBarBlink) { - colour &= ~BAR_BLINK; + colour &= ~kBarBlink; if (GameIsNotPaused() && (gCurrentRealTimeTicks & 8)) return; } diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 446055c5a4..8fd3259692 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -151,7 +151,7 @@ static Widget _rideConstructionWidgets[] = { MakeWidget ({118, 120}, { 89, 41}, WindowWidgetType::Groupbox, WindowColour::Primary , STR_RIDE_CONSTRUCTION_SEAT_ROT ), MakeSpinnerWidgets({123, 138}, { 58, 12}, WindowWidgetType::Spinner, WindowColour::Secondary, 0, STR_RIDE_CONSTRUCTION_SELECT_SEAT_ROTATION_ANGLE_TIP), MakeWidget ({161, 338}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_SIMULATE), STR_SIMULATE_RIDE_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 3c580f9b9d..2d7692e76d 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -77,7 +77,7 @@ static Widget _rideListWidgets[] = { MakeWidget({320, 62}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_RCT1_CLOSE_BUTTON_0) ), MakeWidget({320, 76}, { 14, 14}, WindowWidgetType::ImgBtn, WindowColour::Secondary, ImageId(SPR_G2_RCT1_OPEN_BUTTON_0) ), MakeWidget({315, 90}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_QUICK_DEMOLISH_RIDE ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 8f0d7d1b58..ffd9039d66 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -45,7 +45,7 @@ static Widget _savePromptWidgets[] = { 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 - WIDGETS_END, + kWidgetsEnd, }; enum WindowQuitPromptWidgetIdx { @@ -60,7 +60,7 @@ static Widget _quitPromptWidgets[] = { WINDOW_SHIM_WHITE(STR_QUIT_GAME_PROMPT_TITLE, WW_QUIT, WH_QUIT), MakeWidget({ 8, 19}, {78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_OK ), // ok MakeWidget({91, 19}, {78, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_CANCEL), // cancel - WIDGETS_END, + kWidgetsEnd, }; static constexpr StringId window_save_prompt_labels[][2] = { diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index d7d4f10bbb..6a13c831e3 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -104,7 +104,7 @@ static Widget _scenarioSelectWidgets[] = { MakeRemapWidget({ 3, TabsStart + (TabHeight * 8) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 09 MakeRemapWidget({ 3, TabsStart + (TabHeight * 8) }, { TabWidth, TabHeight}, WindowWidgetType::Tab, WindowColour::Secondary, SPR_G2_SIDEWAYS_TAB), // tab 10 MakeWidget({ TabWidth + 3, WidgetsStart + 1 }, { WW - SidebarWidth, 362 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), // level list - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 806a82cd5d..75250faffc 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -94,7 +94,7 @@ static Widget WindowSceneryBaseWidgets[] = { MakeWidget ({ 4, 46}, {211, 14}, WindowWidgetType::TextBox, WindowColour::Secondary ), MakeWidget ({218, 46}, { 70, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_OBJECT_SEARCH_CLEAR ), MakeWidget ({539, 46}, { 70, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RESTRICT_SCENERY, STR_RESTRICT_SCENERY_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on @@ -1009,7 +1009,7 @@ private: int32_t GetNumColumns() const { const auto& listWidget = widgets[WIDX_SCENERY_LIST]; - const auto contentWidth = listWidget.width() - SCROLLBAR_WIDTH; + const auto contentWidth = listWidget.width() - kScrollBarWidth; return contentWidth / SCENERY_BUTTON_WIDTH; } diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index ad8107368a..d067c39b3e 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -48,7 +48,7 @@ static Widget _sceneryScatterWidgets[] = { MakeRemapWidget({ 7, 68}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_SCENERY_SCATTER_LOW, STR_SCATTER_TOOL_DENSITY_LOW ), // low amount MakeRemapWidget({31, 68}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_SCENERY_SCATTER_MEDIUM, STR_SCATTER_TOOL_DENSITY_MEDIUM), // medium amount MakeRemapWidget({55, 68}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_SCENERY_SCATTER_HIGH, STR_SCATTER_TOOL_DENSITY_HIGH ), // high amount - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index febf8bc89a..be342dcb81 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -69,7 +69,7 @@ static Widget _serverListWidgets[] = { MakeWidget({ 6, 53}, {101, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_FETCH_SERVERS ), // fetch servers button MakeWidget({112, 53}, {101, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_ADD_SERVER ), // add server button MakeWidget({218, 53}, {101, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_START_SERVER ), // start server button - WIDGETS_END, + kWidgetsEnd, }; // clang-format on @@ -252,7 +252,7 @@ public: } else { - const int32_t iconX = listWidget.width() - SCROLLBAR_WIDTH - 7 - 10; + const int32_t iconX = listWidget.width() - kScrollBarWidth - 7 - 10; showNetworkVersionTooltip = screenCoords.x > iconX; } @@ -376,7 +376,7 @@ public: const int16_t numPlayersStringWidth = GfxGetStringWidth(players, FontStyle::Medium); // How much space we have for the server info depends on the size of everything rendered after. - const int16_t spaceAvailableForInfo = listWidgetWidth - numPlayersStringWidth - SCROLLBAR_WIDTH - 35; + const int16_t spaceAvailableForInfo = listWidgetWidth - numPlayersStringWidth - kScrollBarWidth - 35; // Are we showing the server's name or description? const char* serverInfoToShow = serverDetails.Name.c_str(); @@ -390,7 +390,7 @@ public: ft.Add(serverInfoToShow); DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour }); - int32_t right = listWidgetWidth - 7 - SCROLLBAR_WIDTH; + int32_t right = listWidgetWidth - 7 - kScrollBarWidth; // Draw compatibility icon right -= 10; diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index a5e5bb6a62..c8bddae320 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -58,7 +58,7 @@ static Widget _windowServerStartWidgets[] = { MakeWidget({ 6, 117 }, { 287, 14 }, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_ADVERTISE,STR_ADVERTISE_SERVER_TIP), // advertise checkbox MakeWidget({ 6, WH - 6 - 13 }, { 101, 14 }, WindowWidgetType::Button, WindowColour::Secondary,STR_NEW_GAME), // start server button MakeWidget({ 112, WH - 6 - 13 }, { 101, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_LOAD_GAME), // None - WIDGETS_END, + kWidgetsEnd, }; // clang-format on class ServerStartWindow final : public Window diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index fcc7ad0f46..9d9360c094 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -45,7 +45,7 @@ static Widget _shortcutWidgets[] = { MakeWidget({0, 43}, {350, 287}, WindowWidgetType::Resize, WindowColour::Secondary), MakeWidget({4, 47}, {412, 215}, WindowWidgetType::Scroll, WindowColour::Primary, SCROLL_VERTICAL, STR_SHORTCUT_LIST_TIP ), MakeWidget({4, WH-15}, {150, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_SHORTCUT_ACTION_RESET, STR_SHORTCUT_ACTION_RESET_TIP), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on @@ -62,7 +62,7 @@ enum static Widget window_shortcut_change_widgets[] = { WINDOW_SHIM(CHANGE_WINDOW_TITLE, CHANGE_WW, CHANGE_WH), MakeWidget({ 75, 56 }, { 100, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_SHORTCUT_REMOVE, STR_SHORTCUT_REMOVE_TIP), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on @@ -310,7 +310,7 @@ public: // TODO: the line below is a workaround for what is presumably a bug with dpi->width // see https://github.com/OpenRCT2/OpenRCT2/issues/11238 for details - const auto scrollWidth = width - SCROLLBAR_WIDTH - 10; + const auto scrollWidth = width - kScrollBarWidth - 10; for (size_t i = 0; i < _list.size(); ++i) { @@ -457,7 +457,7 @@ private: x += 31; } - _widgets.push_back(WIDGETS_END); + _widgets.push_back(kWidgetsEnd); widgets = _widgets.data(); WindowInitScrollWidgets(*this); @@ -584,7 +584,7 @@ static Widget WindowResetShortcutKeysPromptWidgets[] = { MakeWidget( { RESET_PROMPT_WW - 95, RESET_PROMPT_WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL), - WIDGETS_END, + kWidgetsEnd, }; class ResetShortcutKeysPrompt final : public Window diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 79926b55b3..107205ce71 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -51,7 +51,7 @@ static Widget _signWidgets[] = { MakeWidget({WW - 25, 67}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_DEMOLISH_SIGN_TIP ), // demolish button MakeWidget({ 5, WH - 16}, {12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_MAIN_SIGN_COLOUR_TIP), // Main colour MakeWidget({ 17, WH - 16}, {12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_TEXT_COLOUR_TIP ), // Text colour - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index 5285b571fa..ba50504a93 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -96,7 +96,7 @@ static Widget _staffOverviewWidgets[] = { MakeWidget ({WW - 25, 93}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_RENAME), STR_NAME_STAFF_TIP ), // Rename Button MakeWidget ({WW - 25, 117}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // Locate Button MakeWidget ({WW - 25, 141}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_FIRE_STAFF_TIP ), // Fire Button - WIDGETS_END, + kWidgetsEnd, }; //0x9AF910 @@ -108,14 +108,14 @@ static Widget _staffOptionsWidgets[] = { MakeWidget ({ 5, 101}, {180, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary ), // Checkbox 4 MakeWidget ({ 5, 50}, {180, 12}, WindowWidgetType::DropdownMenu, WindowColour::Secondary ), // Costume Dropdown MakeWidget ({WW - 17, 51}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_COSTUME_TIP), // Costume Dropdown Button - WIDGETS_END, + kWidgetsEnd, }; // clang-format on // 0x9AF9F4 static Widget _staffStatsWidgets[] = { MAIN_STAFF_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; static Widget* window_staff_page_widgets[] = { @@ -1041,7 +1041,7 @@ private: return; } - for (WidgetIndex widgetIndex = WIDX_TAB_1; widgets[widgetIndex].type != WIDGETS_END.type; widgetIndex++) + for (WidgetIndex widgetIndex = WIDX_TAB_1; widgets[widgetIndex].type != kWidgetsEnd.type; widgetIndex++) { SetWidgetDisabled(widgetIndex, false); } diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index d27e527d47..7a5529026d 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -36,7 +36,7 @@ static Widget _staffFireWidgets[] = { WINDOW_SHIM_WHITE(WINDOW_TITLE, WW, WH), MakeWidget({ 10, WH - 20}, {85, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_YES ), MakeWidget({WW - 95, WH - 20}, {85, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 300ef4fa10..7003384afc 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -84,7 +84,7 @@ static Widget _staffListWidgets[] = { 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 - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index b2e4639156..dda0e23ce7 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -37,7 +37,7 @@ static Widget _textInputWidgets[] = { WINDOW_SHIM(STR_NONE, WW, WH), MakeWidget({ 170, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_CANCEL), MakeWidget({ 10, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_OK), - WIDGETS_END, + kWidgetsEnd, }; class TextInputWindow final : public Window diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 25bfb7928f..32d727632d 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -96,7 +96,7 @@ static Widget _themesWidgets[] = { MakeWidget({ 10, 69}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_THEMES_OPTION_RCT1_PARK_CONTROLS ), // rct1 park lights MakeWidget({ 10, 84}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_THEMES_OPTION_RCT1_SCENARIO_SELECTION_FONT ), // rct1 scenario font MakeWidget({ 10, 99}, {290, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_THEMES_OPTION_RCT1_BOTTOM_TOOLBAR ), // rct1 bottom toolbar - WIDGETS_END, + kWidgetsEnd, }; #pragma region Tabs diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index b85e714e2b..25192c5958 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -271,7 +271,7 @@ constexpr ScreenCoordsXY CheckboxGroupOffset( static Widget DefaultWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumSurfaceProperties = 4; @@ -288,7 +288,7 @@ static Widget SurfaceWidgets[] = { MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 3, 1), 1, 2), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_SURFACE_CHECK_CORNER_S MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 3, 1), 0, 1), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_SURFACE_CHECK_CORNER_W MakeWidget(PropertyRowCol({ 12, 0 }, 4, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_SURFACE_DIAGONAL), // WIDX_SURFACE_CHECK_DIAGONAL - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumPathProperties = 6; @@ -309,7 +309,7 @@ static Widget PathWidgets[] = { MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 4, 1), 0, 2), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_PATH_CHECK_EDGE_W MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 4, 1), 1, 1), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_PATH_CHECK_EDGE_NW MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 4, 1), 2, 0), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_PATH_CHECK_EDGE_N - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumTrackProperties = 5; @@ -323,7 +323,7 @@ static Widget TrackWidgets[] = { MakeWidget(PropertyRowCol({ 12, 0}, 2, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_CHAIN_LIFT), // WIDX_TRACK_CHECK_CHAIN_LIFT MakeWidget(PropertyRowCol({ 12, 0}, 3, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED), // WIDX_TRACK_CHECK_BRAKE_CLOSED MakeWidget(PropertyRowCol({ 12, 0}, 4, 0), PropertyFullWidth, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_TILE_INSPECTOR_TRACK_IS_INDESTRUCTIBLE), // WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumSceneryProperties = 4; // The checkbox groups both count for 2 rows @@ -341,7 +341,7 @@ static Widget SceneryWidgets[] = { MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 2, 1), 2, 1), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_SCENERY_CHECK_COLLISION_E MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 2, 1), 1, 2), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_SCENERY_CHECK_COLLISION_S MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 2, 1), 0, 1), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_SCENERY_CHECK_COLLISION_W - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumEntranceProperties = 2; @@ -352,7 +352,7 @@ static Widget EntranceWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, MakeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WindowWidgetType::Spinner, WindowColour::Secondary), // WIDX_ENTRANCE_SPINNER_HEIGHT{,_INCREASE,_DECREASE} MakeWidget(PropertyRowCol({ 12, 0 }, 1, 0), PropertyButtonSize, WindowWidgetType::Button, WindowColour::Secondary, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE, STR_TILE_INSPECTOR_ENTRANCE_MAKE_USABLE_TIP), // WIDX_ENTRANCE_BUTTON_MAKE_USABLE - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumWallProperties = 3; @@ -365,7 +365,7 @@ static Widget WallWidgets[] = { MakeWidget(PropertyRowCol({ 12, 0 }, 1, 1), PropertyButtonSize, WindowWidgetType::DropdownMenu, WindowColour::Secondary), // WIDX_WALL_DROPDOWN_SLOPE MakeWidget(PropertyRowCol({ 12 + PropertyButtonSize.width - 12, 0 }, 1, 1), { 11, 12}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH), // WIDX_WALL_DROPDOWN_SLOPE_BUTTON MakeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 2, 1), PropertyButtonSize, WindowWidgetType::Spinner, WindowColour::Secondary), // WIDX_WALL_SPINNER_ANIMATION_FRAME{,_INCREASE,_DECREASE} - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumLargeSceneryProperties = 1; @@ -375,7 +375,7 @@ constexpr int32_t LargeSceneryDetailsHeight = 20 + NumLargeSceneryDetails * 11; static Widget LargeSceneryWidgets[] = { MAIN_TILE_INSPECTOR_WIDGETS, MakeSpinnerWidgets(PropertyRowCol({ 12, 0 }, 0, 1), PropertyButtonSize, WindowWidgetType::Spinner, WindowColour::Secondary), // WIDX_LARGE_SCENERY_SPINNER_HEIGHT{,_INCREASE,_DECREASE} - WIDGETS_END, + kWidgetsEnd, }; constexpr int32_t NumBannerProperties = 3; @@ -390,7 +390,7 @@ static Widget BannerWidgets[] = { MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 1, 3), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_BANNER_CHECK_BLOCK_SW MakeWidget(CheckboxGroupOffset(PropertyRowCol({ 12, 0 }, 1, 1), 1, 1), { 12, 12 }, WindowWidgetType::Checkbox, WindowColour::Secondary), // WIDX_BANNER_CHECK_BLOCK_NW - WIDGETS_END, + kWidgetsEnd, }; static Widget *PageWidgets[] = { diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index d6d42bd495..17870cdf4a 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -22,7 +22,7 @@ enum WindowTitleExitWidgetIdx { static Widget _titleExitWidgets[] = { MakeWidget({0, 0}, {40, 64}, WindowWidgetType::ImgBtn, WindowColour::Tertiary, ImageId(SPR_MENU_EXIT), STR_EXIT), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 629cd78ed6..d70897312d 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -24,7 +24,7 @@ enum static Widget _titleLogoWidgets[] = { MakeWidget({ 0, 0 }, { WW + 1, WH + 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; class TitleLogoWindow final : public Window diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 8b7a8d4482..eadabe6888 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -51,7 +51,7 @@ static Widget _titleMenuWidgets[] = { MakeWidget({0, UpdateButtonDims.height}, MenuButtonDims, WindowWidgetType::ImgBtn, WindowColour::Tertiary, ImageId(SPR_G2_MENU_MULTIPLAYER), STR_SHOW_MULTIPLAYER_TIP), MakeWidget({0, UpdateButtonDims.height}, MenuButtonDims, WindowWidgetType::ImgBtn, WindowColour::Tertiary, ImageId(SPR_MENU_TOOLBOX), STR_GAME_TOOLS_TIP), MakeWidget({0, 0}, UpdateButtonDims, WindowWidgetType::Empty, WindowColour::Secondary, STR_UPDATE_AVAILABLE), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index bb8cd90211..fee3b088db 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -21,7 +21,7 @@ enum WindowTitleOptionsWidgetIdx { static Widget _windowTitleOptionsWidgets[] = { MakeWidget({0, 0}, {80, 15}, WindowWidgetType::Button, WindowColour::Tertiary, STR_OPTIONS, STR_OPTIONS_TIP), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index cb9fd93b61..2517e1046a 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -25,7 +25,7 @@ enum { static Widget _tooltipWidgets[] = { MakeWidget({0, 0}, {200, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index 0abd720470..ec93fe72da 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -280,7 +280,7 @@ static Widget _topToolbarWidgets[] = { MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_G2_TOOLBAR_MULTIPLAYER, STR_SHOW_MULTIPLAYER_STATUS_TIP ), // Network MakeRemapWidget({ 30, 0}, {30, TOP_TOOLBAR_HEIGHT + 1}, WindowWidgetType::TrnBtn, WindowColour::Primary , SPR_TAB_TOOLBAR, STR_TOOLBAR_CHAT_TIP ), // Chat MakeWidget ({ 0, 0}, {10, 1}, WindowWidgetType::Empty, WindowColour::Primary ), // Artificial widget separator - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 74d1b1ec8a..d6ddb2561b 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -42,14 +42,14 @@ static Widget _trackManageWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 10, 24}, {110, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_TRACK_MANAGE_RENAME), MakeWidget({130, 24}, {110, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_TRACK_MANAGE_DELETE), - WIDGETS_END, + kWidgetsEnd, }; static Widget _trackDeletePromptWidgets[] = { WINDOW_SHIM(STR_DELETE_FILE, WW_DELETE_PROMPT, WH_DELETE_PROMPT), MakeWidget({ 10, 54}, {110, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_TRACK_MANAGE_DELETE), MakeWidget({130, 54}, {110, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_CANCEL ), - WIDGETS_END, + kWidgetsEnd, }; #pragma endregion diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index d110128d88..446b274cfd 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -68,7 +68,7 @@ static Widget _trackPlaceWidgets[] = { MakeWidget({173, 59}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Primary, ImageId(SPR_MIRROR_ARROW), STR_MIRROR_IMAGE_TIP ), MakeWidget({ 4, 109}, {192, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_SELECT_A_DIFFERENT_DESIGN, STR_GO_BACK_TO_DESIGN_SELECTION_WINDOW_TIP), MakeWidget({ 0, 0}, { 1, 1}, WindowWidgetType::Empty, WindowColour::Primary), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 4ccc770762..5274e79342 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -60,7 +60,7 @@ static Widget _trackListWidgets[] = { MakeWidget({224, 18}, {372, 219}, WindowWidgetType::FlatBtn, WindowColour::Primary ), MakeWidget({572, 405}, { ROTATE_AND_SCENERY_BUTTON_SIZE, ROTATE_AND_SCENERY_BUTTON_SIZE}, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_ROTATE_ARROW), STR_ROTATE_90_TIP ), MakeWidget({572, 381}, { ROTATE_AND_SCENERY_BUTTON_SIZE, ROTATE_AND_SCENERY_BUTTON_SIZE}, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_SCENERY), STR_TOGGLE_SCENERY_TIP ), - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index cca5bcf0a2..76e158d4f6 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -85,7 +85,7 @@ static Widget _transparancyWidgets[] = 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), - { WIDGETS_END }, + { kWidgetsEnd }, }; // clang-format on diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index 1823af5531..c3a7e8513a 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -58,7 +58,7 @@ static Widget _viewClippingWidgets[] = { MakeWidget ({ 11, 105}, { 158, 17}, WindowWidgetType::Button, WindowColour::Primary, STR_VIEW_CLIPPING_SELECT_AREA ), // selector MakeWidget ({ 11, 126}, { 158, 18}, WindowWidgetType::Button, WindowColour::Primary, STR_VIEW_CLIPPING_CLEAR_SELECTION ), // clear - WIDGETS_END, + kWidgetsEnd, }; #pragma endregion diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 6a5599c45b..9ddcaa4072 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -50,7 +50,7 @@ static Widget _viewportWidgets[] = MakeWidget({WW - 25, 41}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_G2_ZOOM_OUT), STR_ZOOM_OUT_TIP ), // zoom out MakeWidget({WW - 25, 65}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_LOCATE), STR_LOCATE_SUBJECT_TIP), // locate MakeWidget({WW - 25, 89}, VIEWPORT_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Primary , ImageId(SPR_ROTATE_ARROW),STR_LOCATE_SUBJECT_TIP), // rotate - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 9eeab3ff87..28355ed396 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -39,7 +39,7 @@ static Widget _waterWidgets[] = { MakeWidget ({16, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0), STR_NONE), // 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 - WIDGETS_END, + kWidgetsEnd, }; // clang-format on diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 65eb269a9a..5e05f2c3b9 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -76,6 +76,11 @@ InteractionInfo::InteractionInfo(const PaintStruct* ps) static void ViewportPaintWeatherGloom(DrawPixelInfo& dpi); static void ViewportPaint(const Viewport* viewport, DrawPixelInfo& dpi, const ScreenRect& screenRect); +static void ViewportUpdateFollowSprite(WindowBase* window); +static void ViewportUpdateSmartFollowEntity(WindowBase* window); +static void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff& peep); +static void ViewportUpdateSmartFollowVehicle(WindowBase* window); +static void ViewportInvalidate(const Viewport* viewport, const ScreenRect& screenRect); /** * This is not a viewport function. It is used to setup many variables for @@ -228,7 +233,7 @@ void ViewportRemove(Viewport* viewport) _viewports.erase(it); } -Viewport* ViewportGetMain() +static Viewport* ViewportGetMain() { auto mainWindow = WindowGetMain(); if (mainWindow == nullptr) @@ -754,13 +759,25 @@ void ViewportUpdateSmartFollowEntity(WindowBase* window) break; case EntityType::Guest: - ViewportUpdateSmartFollowGuest(window, entity->As()); + { + auto* guest = entity->As(); + if (guest == nullptr) + { + return; + } + ViewportUpdateSmartFollowGuest(window, *guest); break; - + } case EntityType::Staff: - ViewportUpdateSmartFollowStaff(window, entity->As()); + { + auto* staff = entity->As(); + if (staff == nullptr) + { + return; + } + ViewportUpdateSmartFollowStaff(window, *staff); break; - + } default: // All other types don't need any "smart" following; steam particle, duck, money effect, etc. window->focus = Focus(window->viewport_smart_follow_sprite); window->viewport_target_sprite = window->viewport_smart_follow_sprite; @@ -768,12 +785,12 @@ void ViewportUpdateSmartFollowEntity(WindowBase* window) } } -void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep) +void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest& peep) { - Focus focus = Focus(peep->Id); - window->viewport_target_sprite = peep->Id; + Focus focus = Focus(peep.Id); + window->viewport_target_sprite = peep.Id; - if (peep->State == PeepState::Picked) + if (peep.State == PeepState::Picked) { window->viewport_smart_follow_sprite = EntityId::GetNull(); window->viewport_target_sprite = EntityId::GetNull(); @@ -782,16 +799,16 @@ void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep) } bool overallFocus = true; - if (peep->State == PeepState::OnRide || peep->State == PeepState::EnteringRide - || (peep->State == PeepState::LeavingRide && peep->x == LOCATION_NULL)) + if (peep.State == PeepState::OnRide || peep.State == PeepState::EnteringRide + || (peep.State == PeepState::LeavingRide && peep.x == LOCATION_NULL)) { - auto ride = GetRide(peep->CurrentRide); + auto ride = GetRide(peep.CurrentRide); if (ride != nullptr && (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) { - auto train = GetEntity(ride->vehicles[peep->CurrentTrain]); + auto train = GetEntity(ride->vehicles[peep.CurrentTrain]); if (train != nullptr) { - const auto car = train->GetCar(peep->CurrentCar); + const auto car = train->GetCar(peep.CurrentCar); if (car != nullptr) { focus = Focus(car->Id); @@ -802,9 +819,9 @@ void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep) } } - if (peep->x == LOCATION_NULL && overallFocus) + if (peep.x == LOCATION_NULL && overallFocus) { - auto ride = GetRide(peep->CurrentRide); + auto ride = GetRide(peep.CurrentRide); if (ride != nullptr) { auto xy = ride->overall_view.ToTileCentre(); @@ -820,9 +837,9 @@ void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep) window->focus = focus; } -void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff* peep) +void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff& peep) { - if (peep->State == PeepState::Picked) + if (peep.State == PeepState::Picked) { window->viewport_smart_follow_sprite = EntityId::GetNull(); window->viewport_target_sprite = EntityId::GetNull(); diff --git a/src/openrct2/interface/Viewport.h b/src/openrct2/interface/Viewport.h index 904ab8ddf9..5287e2bb4d 100644 --- a/src/openrct2/interface/Viewport.h +++ b/src/openrct2/interface/Viewport.h @@ -131,16 +131,12 @@ void ViewportInitAll(); std::optional centre_2d_coordinates(const CoordsXYZ& loc, Viewport* viewport); void ViewportCreate(WindowBase* w, const ScreenCoordsXY& screenCoords, int32_t width, int32_t height, const Focus& focus); void ViewportRemove(Viewport* viewport); -Viewport* ViewportGetMain(); + void ViewportsInvalidate(int32_t x, int32_t y, int32_t z0, int32_t z1, ZoomLevel maxZoom); void ViewportsInvalidate(const CoordsXYZ& pos, int32_t width, int32_t minHeight, int32_t maxHeight, ZoomLevel maxZoom); void ViewportsInvalidate(const ScreenRect& screenRect, ZoomLevel maxZoom = ZoomLevel{ -1 }); void ViewportUpdatePosition(WindowBase* window); -void ViewportUpdateFollowSprite(WindowBase* window); -void ViewportUpdateSmartFollowEntity(WindowBase* window); -void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest* peep); -void ViewportUpdateSmartFollowStaff(WindowBase* window, const Staff* peep); -void ViewportUpdateSmartFollowVehicle(WindowBase* window); +void ViewportUpdateSmartFollowGuest(WindowBase* window, const Guest& peep); void ViewportRotateSingle(WindowBase* window, int32_t direction); void ViewportRotateAll(int32_t direction); void ViewportRender(DrawPixelInfo& dpi, const Viewport* viewport, const ScreenRect& screenRect); @@ -162,17 +158,13 @@ InteractionInfo GetMapCoordinatesFromPos(const ScreenCoordsXY& screenCoords, int InteractionInfo GetMapCoordinatesFromPosWindow(WindowBase* window, const ScreenCoordsXY& screenCoords, int32_t flags); InteractionInfo SetInteractionInfoFromPaintSession(PaintSession* session, uint32_t viewFlags, uint16_t filter); -InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoords); bool ViewportInteractionLeftOver(const ScreenCoordsXY& screenCoords); bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords); -InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoords); bool ViewportInteractionRightOver(const ScreenCoordsXY& screenCoords); bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords); CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords); -void ViewportInvalidate(const Viewport* viewport, const ScreenRect& screenRect); - std::optional ScreenGetMapXY(const ScreenCoordsXY& screenCoords, Viewport** viewport); std::optional ScreenGetMapXYWithZ(const ScreenCoordsXY& screenCoords, int32_t z); std::optional ScreenGetMapXYQuadrant(const ScreenCoordsXY& screenCoords, uint8_t* quadrant); diff --git a/src/openrct2/interface/Widget.h b/src/openrct2/interface/Widget.h index 73bd1149f9..2f387ee342 100644 --- a/src/openrct2/interface/Widget.h +++ b/src/openrct2/interface/Widget.h @@ -9,8 +9,6 @@ #pragma once -#include "../drawing/Drawing.h" -#include "../localisation/StringIds.h" #include "Window.h" enum class WindowWidgetType : uint8_t @@ -41,9 +39,6 @@ enum class WindowWidgetType : uint8_t Last = 26, }; -constexpr auto WIDGETS_END = Widget{ WindowWidgetType::Last, 0, 0, 0, 0, 0, 0, 0 }; -#define BAR_BLINK (1u << 31) - enum { SCROLL_HORIZONTAL = (1 << 0), @@ -51,133 +46,4 @@ enum SCROLL_BOTH = SCROLL_HORIZONTAL | SCROLL_VERTICAL }; -enum class WindowColour : uint8_t -{ - Primary, - Secondary, - Tertiary, - Quaternary, -}; - -constexpr uint8_t SCROLLBAR_WIDTH = 10; - -constexpr ScreenSize TAB_SIZE = { 31, 27 }; - -constexpr Widget MakeWidget( - const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, - uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) -{ - Widget out = {}; - out.left = origin.x; - out.right = origin.x + size.width - 1; - out.top = origin.y; - out.bottom = origin.y + size.height - 1; - out.type = type; - out.colour = static_cast(colour); - out.content = content; - out.tooltip = tooltip; - - return out; -} - -constexpr Widget MakeWidget( - const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageId image, - StringId tooltip = STR_NONE) -{ - Widget out = {}; - out.left = origin.x; - out.right = origin.x + size.width - 1; - out.top = origin.y; - out.bottom = origin.y + size.height - 1; - out.type = type; - out.colour = static_cast(colour); - out.image = image; - out.tooltip = tooltip; - - return out; -} - -constexpr Widget MakeRemapWidget( - const ScreenCoordsXY& origin, const ScreenSize& size, WindowWidgetType type, WindowColour colour, ImageIndex content, - StringId tooltip = STR_NONE) -{ - return MakeWidget(origin, size, type, colour, ImageId(content, FilterPaletteID::PaletteNull), tooltip); -} - -constexpr Widget MakeTab(const ScreenCoordsXY& origin, StringId tooltip = STR_NONE) -{ - const ScreenSize size = TAB_SIZE; - const WindowWidgetType type = WindowWidgetType::Tab; - const WindowColour colour = WindowColour::Secondary; - const auto content = ImageId(ImageIndexUndefined); - - return MakeWidget(origin, size, type, colour, content, tooltip); -} - -#define MakeSpinnerWidgets(...) \ - MakeWidget(__VA_ARGS__), MakeSpinnerIncreaseWidget(__VA_ARGS__), MakeSpinnerDecreaseWidget(__VA_ARGS__) - -constexpr Widget MakeSpinnerDecreaseWidget( - const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) -{ - const int16_t xPos = origin.x + size.width - 26; - const int16_t yPos = origin.y + 1; - const uint16_t width = 13; - const uint16_t height = size.height - 2; - - return MakeWidget({ xPos, yPos }, { width, height }, WindowWidgetType::Button, colour, STR_NUMERIC_DOWN, tooltip); -} - -constexpr Widget MakeSpinnerIncreaseWidget( - const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) -{ - const int16_t xPos = origin.x + size.width - 13; - const int16_t yPos = origin.y + 1; - const uint16_t width = 12; - const uint16_t height = size.height - 2; - - return MakeWidget({ xPos, yPos }, { width, height }, WindowWidgetType::Button, colour, STR_NUMERIC_UP, tooltip); -} - -#define MakeDropdownWidgets(...) MakeDropdownBoxWidget(__VA_ARGS__), MakeDropdownButtonWidget(__VA_ARGS__) - -constexpr Widget MakeDropdownBoxWidget( - const ScreenCoordsXY& origin, const ScreenSize& size, [[maybe_unused]] WindowWidgetType type, WindowColour colour, - [[maybe_unused]] uint32_t content = 0xFFFFFFFF, StringId tooltip = STR_NONE) -{ - 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 = 0xFFFFFFFF, StringId tooltip = STR_NONE) -{ - const int16_t xPos = origin.x + size.width - 11; - const int16_t yPos = origin.y + 1; - const uint16_t width = 11; - const uint16_t height = 10; - - return MakeWidget({ xPos, yPos }, { width, height }, WindowWidgetType::Button, colour, STR_DROPDOWN_GLYPH, tooltip); -} - void WidgetScrollUpdateThumbs(WindowBase& w, WidgetIndex widget_index); -void WidgetDraw(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widgetIndex); - -bool WidgetIsDisabled(const WindowBase& w, WidgetIndex widgetIndex); -bool WidgetIsHoldable(const WindowBase& w, WidgetIndex widgetIndex); -bool WidgetIsVisible(const WindowBase& w, WidgetIndex widgetIndex); -bool WidgetIsPressed(const WindowBase& w, WidgetIndex widgetIndex); -bool WidgetIsHighlighted(const WindowBase& w, WidgetIndex widgetIndex); -bool WidgetIsActiveTool(const WindowBase& w, WidgetIndex widgetIndex); -void WidgetScrollGetPart( - WindowBase& w, const Widget* widget, const ScreenCoordsXY& screenCoords, ScreenCoordsXY& retScreenCoords, - int32_t* output_scroll_area, int32_t* scroll_id); - -void WidgetSetEnabled(WindowBase& w, WidgetIndex widgetIndex, bool enabled); -void WidgetSetDisabled(WindowBase& w, WidgetIndex widgetIndex, bool value); -void WidgetSetHoldable(WindowBase& w, WidgetIndex widgetIndex, bool value); -void WidgetSetVisible(WindowBase& w, WidgetIndex widgetIndex, bool value); -void WidgetSetPressed(WindowBase& w, WidgetIndex widgetIndex, bool value); -void WidgetSetCheckboxValue(WindowBase& w, WidgetIndex widgetIndex, bool value); From 7634dfb6a3ebc2fba9af7a930a4cea87c39376f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sat, 9 Mar 2024 20:03:36 +0100 Subject: [PATCH 051/191] Android: Enable plugins (#21561) --- src/openrct2-android/app/src/main/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index 53d5228a6f..8c8327e36c 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -130,7 +130,10 @@ include_directories(SYSTEM "${CMAKE_BINARY_DIR}/libs/include/freetype2") include_directories(SYSTEM "${CMAKE_BINARY_DIR}/libs/include/SDL2") # now build app's shared lib -add_definitions(-DDISABLE_HTTP -DDISABLE_DISCORD_RPC -DDISABLE_HTTP -DDISABLE_NETWORK -DDISABLE_FLAC -DDISABLE_VORBIS -DDISABLE_OPENGL -DGL_GLEXT_PROTOTYPES -D__STDC_LIMIT_MACROS -DNO_TTF -DSDL_MAIN_HANDLED) +add_definitions(-DDISABLE_DISCORD_RPC -DDISABLE_HTTP -DDISABLE_NETWORK -DDISABLE_FLAC -DDISABLE_VORBIS -DDISABLE_OPENGL -DGL_GLEXT_PROTOTYPES -D__STDC_LIMIT_MACROS -DNO_TTF -DSDL_MAIN_HANDLED) + +# Enable scripting +add_definitions(-DENABLE_SCRIPTING) # Fix SpeexDSP compilation add_definitions(-DHAVE_STDINT_H) @@ -159,6 +162,7 @@ if (CCache_FOUND) endif (CCache_FOUND) file(GLOB_RECURSE LIBOPENRCT2_SOURCES + "${ORCT2_ROOT}/src/thirdparty/duktape/duktape.cpp" "${ORCT2_ROOT}/src/openrct2/*.cpp" "${ORCT2_ROOT}/src/openrct2/*.h" "${ORCT2_ROOT}/src/openrct2/*.hpp") @@ -187,7 +191,9 @@ target_link_libraries(openrct2-ui openrct2 android stdc++ GLESv1_CM GLESv2 SDL2m add_executable(openrct2-cli ${OPENRCT2_CLI_SOURCES}) target_link_libraries(openrct2-cli openrct2 android stdc++ GLESv1_CM GLESv2) +target_include_directories(openrct2 PRIVATE "${ORCT2_ROOT}/src/thirdparty/duktape/") target_include_directories(openrct2 SYSTEM PRIVATE "${ORCT2_ROOT}/src/thirdparty") +target_include_directories(openrct2-ui PRIVATE "${ORCT2_ROOT}/src/thirdparty/duktape/") target_include_directories(openrct2-ui PRIVATE "${ORCT2_ROOT}/src") target_include_directories(openrct2-ui SYSTEM PRIVATE "${ORCT2_ROOT}/src/thirdparty") target_include_directories(openrct2-cli PRIVATE "${ORCT2_ROOT}/src") From 7a60e7f2e09e002c13765380636e108cd2249a08 Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 10 Mar 2024 13:52:35 +0000 Subject: [PATCH 052/191] OpenRCT2::Ui::Windows namespace for OpenRCT2 Ui Windows (#21559) * Move all the windows into OpenRCT2::Ui::Windows namespace * Fix missing symbol * Clang format * Call the correct FormatStringID --- src/openrct2-ui/WindowManager.cpp | 1 + src/openrct2-ui/input/InputManager.cpp | 2 +- src/openrct2-ui/input/MouseInput.cpp | 2 + src/openrct2-ui/input/Shortcuts.cpp | 1 + src/openrct2-ui/interface/Dropdown.h | 50 +- src/openrct2-ui/interface/LandTool.cpp | 1 + .../interface/ViewportInteraction.cpp | 1 + src/openrct2-ui/interface/Window.cpp | 3 +- src/openrct2-ui/interface/Window.h | 31 + src/openrct2-ui/windows/About.cpp | 382 +- src/openrct2-ui/windows/AssetPacks.cpp | 529 +- src/openrct2-ui/windows/Banner.cpp | 431 +- src/openrct2-ui/windows/Changelog.cpp | 543 +- src/openrct2-ui/windows/Cheats.cpp | 1456 +- src/openrct2-ui/windows/ClearScenery.cpp | 367 +- src/openrct2-ui/windows/CustomCurrency.cpp | 334 +- src/openrct2-ui/windows/DebugPaint.cpp | 188 +- .../windows/DemolishRidePrompt.cpp | 148 +- src/openrct2-ui/windows/Dropdown.cpp | 865 +- .../windows/EditorBottomToolbar.cpp | 631 +- .../windows/EditorInventionsList.cpp | 1110 +- .../windows/EditorObjectSelection.cpp | 2776 ++-- .../windows/EditorObjectiveOptions.cpp | 1923 +-- .../windows/EditorScenarioOptions.cpp | 1966 +-- src/openrct2-ui/windows/Error.cpp | 261 +- src/openrct2-ui/windows/Finances.cpp | 1489 +- src/openrct2-ui/windows/Footpath.cpp | 2547 ++-- src/openrct2-ui/windows/GameBottomToolbar.cpp | 1151 +- src/openrct2-ui/windows/Guest.cpp | 3362 ++--- src/openrct2-ui/windows/GuestList.cpp | 1690 +-- src/openrct2-ui/windows/InstallTrack.cpp | 647 +- src/openrct2-ui/windows/Land.cpp | 563 +- src/openrct2-ui/windows/LandRights.cpp | 683 +- src/openrct2-ui/windows/LoadSave.cpp | 2075 +-- src/openrct2-ui/windows/Main.cpp | 102 +- src/openrct2-ui/windows/Map.cpp | 2635 ++-- src/openrct2-ui/windows/MapGen.cpp | 2227 +-- src/openrct2-ui/windows/MapTooltip.cpp | 185 +- src/openrct2-ui/windows/MazeConstruction.cpp | 710 +- src/openrct2-ui/windows/Multiplayer.cpp | 1515 +- src/openrct2-ui/windows/NetworkStatus.cpp | 223 +- src/openrct2-ui/windows/NewCampaign.cpp | 644 +- src/openrct2-ui/windows/NewRide.cpp | 1862 +-- src/openrct2-ui/windows/News.cpp | 508 +- src/openrct2-ui/windows/NewsOptions.cpp | 349 +- src/openrct2-ui/windows/ObjectLoadError.cpp | 971 +- src/openrct2-ui/windows/Options.cpp | 3189 ++-- src/openrct2-ui/windows/Park.cpp | 2025 +-- src/openrct2-ui/windows/PatrolArea.cpp | 458 +- src/openrct2-ui/windows/Player.cpp | 1019 +- .../windows/RefurbishRidePrompt.cpp | 148 +- src/openrct2-ui/windows/Research.cpp | 826 +- src/openrct2-ui/windows/Ride.cpp | 12251 ++++++++-------- src/openrct2-ui/windows/RideConstruction.cpp | 8183 ++++++----- src/openrct2-ui/windows/RideList.cpp | 1741 +-- src/openrct2-ui/windows/SavePrompt.cpp | 303 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 1287 +- src/openrct2-ui/windows/Scenery.cpp | 3157 ++-- src/openrct2-ui/windows/SceneryScatter.cpp | 299 +- src/openrct2-ui/windows/ServerList.cpp | 925 +- src/openrct2-ui/windows/ServerStart.cpp | 417 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 988 +- src/openrct2-ui/windows/Sign.cpp | 589 +- src/openrct2-ui/windows/Staff.cpp | 2094 +-- src/openrct2-ui/windows/StaffFirePrompt.cpp | 115 +- src/openrct2-ui/windows/StaffList.cpp | 1264 +- src/openrct2-ui/windows/TextInput.cpp | 726 +- src/openrct2-ui/windows/Themes.cpp | 1278 +- src/openrct2-ui/windows/TileInspector.cpp | 3998 ++--- src/openrct2-ui/windows/TitleExit.cpp | 73 +- src/openrct2-ui/windows/TitleLogo.cpp | 103 +- src/openrct2-ui/windows/TitleMenu.cpp | 405 +- src/openrct2-ui/windows/TitleOptions.cpp | 72 +- src/openrct2-ui/windows/Tooltip.cpp | 320 +- src/openrct2-ui/windows/TopToolbar.cpp | 6528 ++++---- src/openrct2-ui/windows/TrackDesignManage.cpp | 313 +- src/openrct2-ui/windows/TrackDesignPlace.cpp | 1008 +- src/openrct2-ui/windows/TrackList.cpp | 1290 +- src/openrct2-ui/windows/Transparency.cpp | 319 +- src/openrct2-ui/windows/ViewClipping.cpp | 597 +- src/openrct2-ui/windows/Viewport.cpp | 333 +- src/openrct2-ui/windows/Water.cpp | 300 +- src/openrct2-ui/windows/Window.h | 330 +- src/openrct2/interface/Window.h | 25 - src/openrct2/ride/Ride.h | 4 - 85 files changed, 49912 insertions(+), 49528 deletions(-) diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 16466cb4a2..5d47c35b3f 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -28,6 +28,7 @@ #include using namespace OpenRCT2::Ui; +using namespace OpenRCT2::Ui::Windows; class WindowManager final : public IWindowManager { diff --git a/src/openrct2-ui/input/InputManager.cpp b/src/openrct2-ui/input/InputManager.cpp index cf0c612ec6..8c4b32fec6 100644 --- a/src/openrct2-ui/input/InputManager.cpp +++ b/src/openrct2-ui/input/InputManager.cpp @@ -202,7 +202,7 @@ void InputManager::Process(const InputEvent& e) { if (e.State == InputEventState::Release) { - WindowTextInputKey(w, e.Button); + OpenRCT2::Ui::Windows::WindowTextInputKey(w, e.Button); } return; } diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index af5cf6be10..6c55f56e16 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -34,6 +34,8 @@ #include #include +using namespace OpenRCT2::Ui::Windows; + struct RCTMouseData { uint32_t x; diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 8081c03527..1f457247e7 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -47,6 +47,7 @@ using namespace OpenRCT2; using namespace OpenRCT2::Ui; +using namespace OpenRCT2::Ui::Windows; #pragma region Shortcut Commands diff --git a/src/openrct2-ui/interface/Dropdown.h b/src/openrct2-ui/interface/Dropdown.h index 38a52af3d3..d902d37dcc 100644 --- a/src/openrct2-ui/interface/Dropdown.h +++ b/src/openrct2-ui/interface/Dropdown.h @@ -37,29 +37,33 @@ namespace Dropdown void SetImage(int32_t index, ImageId image); } // namespace Dropdown -extern int32_t gDropdownNumItems; -extern Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; -extern bool gDropdownIsColour; -extern int32_t gDropdownLastColourHover; -extern int32_t gDropdownHighlightedIndex; -extern int32_t gDropdownDefaultIndex; +namespace OpenRCT2::Ui::Windows +{ + extern int32_t gDropdownNumItems; + extern Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; + extern bool gDropdownIsColour; + extern int32_t gDropdownLastColourHover; + extern int32_t gDropdownHighlightedIndex; + extern int32_t gDropdownDefaultIndex; -void WindowDropdownShowText(const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t flags, size_t num_items); -void WindowDropdownShowTextCustomWidth( - const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t custom_height, uint8_t flags, size_t num_items, - int32_t width); -void WindowDropdownShowImage( - int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth, - int32_t itemHeight, int32_t numColumns); -void WindowDropdownClose(); -int32_t DropdownIndexFromPoint(const ScreenCoordsXY& loc, WindowBase* w); -void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownColour, uint8_t selectedColour); -void WindowDropdownShowColourAvailable( - WindowBase* w, Widget* widget, uint8_t dropdownColour, uint8_t selectedColour, uint32_t availableColours); -uint32_t DropdownGetAppropriateImageDropdownItemsPerRow(uint32_t numItems); -bool WindowDropDownHasMultipleColumns(size_t numItems); + void WindowDropdownShowText( + const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t flags, size_t num_items); + void WindowDropdownShowTextCustomWidth( + const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t custom_height, uint8_t flags, size_t num_items, + int32_t width); + void WindowDropdownShowImage( + int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth, + int32_t itemHeight, int32_t numColumns); + void WindowDropdownClose(); + int32_t DropdownIndexFromPoint(const ScreenCoordsXY& loc, WindowBase* w); + void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownColour, uint8_t selectedColour); + void WindowDropdownShowColourAvailable( + WindowBase* w, Widget* widget, uint8_t dropdownColour, uint8_t selectedColour, uint32_t availableColours); + uint32_t DropdownGetAppropriateImageDropdownItemsPerRow(uint32_t numItems); + bool WindowDropDownHasMultipleColumns(size_t numItems); -colour_t ColourDropDownIndexToColour(uint8_t ddidx); + colour_t ColourDropDownIndexToColour(uint8_t ddidx); +} // namespace OpenRCT2::Ui::Windows namespace Dropdown { @@ -120,8 +124,8 @@ namespace Dropdown for (int i = 0; i < N; ++i) { const ItemExt& item = items[i]; - gDropdownItems[i].Format = item.itemFormat; - gDropdownItems[i].Args = item.stringId; + OpenRCT2::Ui::Windows::gDropdownItems[i].Format = item.itemFormat; + OpenRCT2::Ui::Windows::gDropdownItems[i].Args = item.stringId; } } diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 35a224adf9..8298660472 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -22,6 +22,7 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::Ui::Windows; // clang-format off static uint16_t toolSizeSpriteIndices[] = diff --git a/src/openrct2-ui/interface/ViewportInteraction.cpp b/src/openrct2-ui/interface/ViewportInteraction.cpp index 1d08323064..7c763eab7b 100644 --- a/src/openrct2-ui/interface/ViewportInteraction.cpp +++ b/src/openrct2-ui/interface/ViewportInteraction.cpp @@ -53,6 +53,7 @@ #include using namespace OpenRCT2; +using namespace OpenRCT2::Ui::Windows; static void ViewportInteractionRemoveScenery(const SmallSceneryElement& smallSceneryElement, const CoordsXY& mapCoords); static void ViewportInteractionRemoveFootpath(const PathElement& pathElement, const CoordsXY& mapCoords); diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 9f0ee0c34f..006d09f793 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -807,7 +807,8 @@ void Window::TextInputOpen( WidgetIndex callWidget, StringId title, StringId description, const Formatter& descriptionArgs, StringId existingText, uintptr_t existingArgs, int32_t maxLength) { - WindowTextInputOpen(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength); + OpenRCT2::Ui::Windows::WindowTextInputOpen( + this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength); } void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id) diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index c3a3d18d7e..4bc771e920 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -41,3 +41,34 @@ void WindowAllWheelInput(); void ApplyScreenSaverLockSetting(); void WindowAlignTabs(WindowBase* w, WidgetIndex start_tab_id, WidgetIndex end_tab_id); ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w); + +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]; +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index 500dd9afcf..d5b358aaa2 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -19,14 +19,14 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WW = 400; + static constexpr int32_t WH = 450; + static constexpr StringId WINDOW_TITLE = STR_ABOUT; + static constexpr int32_t TABHEIGHT = 50; -static constexpr int32_t WW = 400; -static constexpr int32_t WH = 450; -static constexpr StringId WINDOW_TITLE = STR_ABOUT; -static constexpr int32_t TABHEIGHT = 50; - -// clang-format off + // clang-format off enum { WINDOW_ABOUT_PAGE_OPENRCT2, @@ -83,205 +83,207 @@ static Widget *_windowAboutPageWidgets[] = { _windowAboutRCT2Widgets, }; -// clang-format on + // clang-format on -class AboutWindow final : public Window -{ -public: - void OnOpen() override + class AboutWindow final : public Window { - widgets = _windowAboutOpenRCT2Widgets; - - WindowInitScrollWidgets(*this); - SetPage(WINDOW_ABOUT_PAGE_OPENRCT2); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB_ABOUT_OPENRCT2: - case WIDX_TAB_ABOUT_RCT2: - SetPage(widgetIndex - WIDX_TAB_ABOUT_OPENRCT2); - break; - case WIDX_JOIN_DISCORD: - OpenRCT2::GetContext()->GetUiContext()->OpenURL("https://discord.gg/ZXZd8D8"); - break; - case WIDX_CHANGELOG: - ContextOpenWindow(WindowClass::Changelog); - break; - case WIDX_NEW_VERSION: - ContextOpenWindowView(WV_NEW_VERSION_INFO); - break; - case WIDX_COPY_BUILD_INFO: - SDL_SetClipboardText(gVersionInfoFull); - break; - case WIDX_CONTRIBUTORS_BUTTON: - ContextOpenWindowView(WV_CONTRIBUTORS); - break; + widgets = _windowAboutOpenRCT2Widgets; + + WindowInitScrollWidgets(*this); + SetPage(WINDOW_ABOUT_PAGE_OPENRCT2); } - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - const auto& aboutOpenRCT2 = widgets[WIDX_TAB_ABOUT_OPENRCT2]; - const auto& aboutRCT2 = widgets[WIDX_TAB_ABOUT_RCT2]; - - int32_t y = windowPos.y + aboutOpenRCT2.midY() - 3; - ScreenCoordsXY aboutOpenRCT2Coords(windowPos.x + aboutOpenRCT2.left + 45, y); - ScreenCoordsXY aboutRCT2Coords(windowPos.x + aboutRCT2.left + 45, y); - - // Draw tab names + void OnMouseUp(WidgetIndex widgetIndex) override { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB_ABOUT_OPENRCT2: + case WIDX_TAB_ABOUT_RCT2: + SetPage(widgetIndex - WIDX_TAB_ABOUT_OPENRCT2); + break; + case WIDX_JOIN_DISCORD: + OpenRCT2::GetContext()->GetUiContext()->OpenURL("https://discord.gg/ZXZd8D8"); + break; + case WIDX_CHANGELOG: + ContextOpenWindow(WindowClass::Changelog); + break; + case WIDX_NEW_VERSION: + ContextOpenWindowView(WV_NEW_VERSION_INFO); + break; + case WIDX_COPY_BUILD_INFO: + SDL_SetClipboardText(gVersionInfoFull); + break; + case WIDX_CONTRIBUTORS_BUTTON: + ContextOpenWindowView(WV_CONTRIBUTORS); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + const auto& aboutOpenRCT2 = widgets[WIDX_TAB_ABOUT_OPENRCT2]; + const auto& aboutRCT2 = widgets[WIDX_TAB_ABOUT_RCT2]; + + int32_t y = windowPos.y + aboutOpenRCT2.midY() - 3; + ScreenCoordsXY aboutOpenRCT2Coords(windowPos.x + aboutOpenRCT2.left + 45, y); + ScreenCoordsXY aboutRCT2Coords(windowPos.x + aboutRCT2.left + 45, y); + + // Draw tab names + { + auto ft = Formatter(); + ft.Add(STR_TITLE_SEQUENCE_OPENRCT2); + DrawTextWrapped( + dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, + { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); + } + { + auto ft = Formatter(); + ft.Add(STR_TITLE_SEQUENCE_RCT2); + DrawTextWrapped( + dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); + } + + if (page == WINDOW_ABOUT_PAGE_OPENRCT2) + { + DrawOpenRCT2Info(dpi); + } + else if (page == WINDOW_ABOUT_PAGE_RCT2) + { + DrawRCT2Info(dpi); + } + } + + private: + /** + * @brief Set which tab to show + */ + void SetPage(int32_t p) + { + page = p; + frame_no = 0; + pressed_widgets = 0; + widgets = _windowAboutPageWidgets[p]; + + switch (p) + { + case WINDOW_ABOUT_PAGE_OPENRCT2: + pressed_widgets |= (1uLL << WIDX_TAB_ABOUT_OPENRCT2); + break; + case WINDOW_ABOUT_PAGE_RCT2: + pressed_widgets |= (1uLL << WIDX_TAB_ABOUT_RCT2); + break; + } + + WindowInitScrollWidgets(*this); + Invalidate(); + } + + /** + * @brief Draw OpenRCT2 info on open tab + */ + void DrawOpenRCT2Info(DrawPixelInfo& dpi) + { + // Draw logo on placeholder widget + ScreenCoordsXY logoCoords = windowPos + + ScreenCoordsXY(widgets[WIDX_OPENRCT2_LOGO].left, widgets[WIDX_OPENRCT2_LOGO].top); + GfxDrawSprite(dpi, ImageId(SPR_G2_LOGO), logoCoords); + // Version info + utf8 buffer[256]; + utf8* ch = buffer; + OpenRCT2WriteFullVersionInfo(ch, sizeof(buffer) - (ch - buffer)); auto ft = Formatter(); - ft.Add(STR_TITLE_SEQUENCE_OPENRCT2); - DrawTextWrapped( - dpi, aboutOpenRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); - } - { - auto ft = Formatter(); - ft.Add(STR_TITLE_SEQUENCE_RCT2); - DrawTextWrapped( - dpi, aboutRCT2Coords, 87, STR_WINDOW_COLOUR_2_STRINGID, ft, { COLOUR_AQUAMARINE, TextAlignment::CENTRE }); + ft.Add(buffer); + + auto const& versionPlaceholder = widgets[WIDX_VERSION]; + auto versionPlaceHolderWidth = versionPlaceholder.right - versionPlaceholder.left; + auto centreX = versionPlaceholder.left + versionPlaceHolderWidth / 2; + auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - FontGetLineHeight(FontStyle::Medium)) / 2; + auto centrePos = windowPos + ScreenCoordsXY(centreX, centreY); + DrawTextWrapped(dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); + + // Shows the update available button + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + { + widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; + _windowAboutOpenRCT2Widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; + } + + // Draw the rest of the text + Formatter ft2{}; + TextPaint tp{ colours[1], TextAlignment::CENTRE }; + auto textCoords = windowPos + ScreenCoordsXY((width / 2) - 1, 240); + auto textWidth = WW - 20; + + textCoords += ScreenCoordsXY( + 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_OPENRCT2_DESCRIPTION_2, ft2, tp) + 5); // More info + textCoords += ScreenCoordsXY( + 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_OPENRCT2_DESCRIPTION_3, ft2, tp) + 5); // Copyright + textCoords += ScreenCoordsXY( + 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_OPENRCT2_TITLE, ft2, tp) + 5); // Title Theme + textCoords += ScreenCoordsXY( + 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_FAIRGROUND_ORGAN, ft2, tp) + 5); // Fairground organ + textCoords += ScreenCoordsXY( + 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_SPECIAL_THANKS_1, ft2, tp)); // Special Thanks + textCoords += ScreenCoordsXY( + 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_SPECIAL_THANKS_2, ft2, tp)); // Company names } - if (page == WINDOW_ABOUT_PAGE_OPENRCT2) + /** + * @brief Draw RCT2 info on open tab + */ + void DrawRCT2Info(DrawPixelInfo& dpi) { - DrawOpenRCT2Info(dpi); - } - else if (page == WINDOW_ABOUT_PAGE_RCT2) - { - DrawRCT2Info(dpi); - } - } + int32_t yPage = windowPos.y + widgets[WIDX_PAGE_BACKGROUND].top + 5; -private: - /** - * @brief Set which tab to show - */ - void SetPage(int32_t p) - { - page = p; - frame_no = 0; - pressed_widgets = 0; - widgets = _windowAboutPageWidgets[p]; + auto screenCoords = ScreenCoordsXY{ windowPos.x + 200, yPage + 5 }; - switch (p) - { - case WINDOW_ABOUT_PAGE_OPENRCT2: - pressed_widgets |= (1uLL << WIDX_TAB_ABOUT_OPENRCT2); - break; - case WINDOW_ABOUT_PAGE_RCT2: - pressed_widgets |= (1uLL << WIDX_TAB_ABOUT_RCT2); - break; + int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); + + // Credits + DrawTextBasic(dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE }); + screenCoords.y += lineHeight + 74; + DrawTextBasic(dpi, screenCoords, STR_DESIGNED_AND_PROGRAMMED_BY_CS, {}, { TextAlignment::CENTRE }); + screenCoords.y += lineHeight; + DrawTextBasic(dpi, screenCoords, STR_GRAPHICS_BY_SF, {}, { TextAlignment::CENTRE }); + screenCoords.y += lineHeight; + DrawTextBasic(dpi, screenCoords, STR_SOUND_AND_MUSIC_BY_AB, {}, { TextAlignment::CENTRE }); + screenCoords.y += lineHeight; + DrawTextBasic(dpi, screenCoords, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, {}, { TextAlignment::CENTRE }); + screenCoords.y += lineHeight + 3; + DrawTextBasic(dpi, screenCoords, STR_REPRESENTATION_BY_JL, {}, { TextAlignment::CENTRE }); + screenCoords.y += 2 * lineHeight + 5; + DrawTextBasic(dpi, screenCoords, STR_THANKS_TO, {}, { TextAlignment::CENTRE }); + screenCoords.y += lineHeight; + DrawTextBasic(dpi, screenCoords, STR_THANKS_TO_PEOPLE, {}, { TextAlignment::CENTRE }); + screenCoords.y += 2 * lineHeight + 5; + DrawTextBasic(dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE }); + + // Images + GfxDrawSprite(dpi, ImageId(SPR_CREDITS_CHRIS_SAWYER_SMALL), { windowPos.x + 92, yPage + 24 }); + + // Licence } - WindowInitScrollWidgets(*this); - Invalidate(); - } + void OnResize() override + { + ResizeFrameWithPage(); + } + }; /** - * @brief Draw OpenRCT2 info on open tab + * + * rct2: 0x0066D2AC */ - void DrawOpenRCT2Info(DrawPixelInfo& dpi) + WindowBase* WindowAboutOpen() { - // Draw logo on placeholder widget - ScreenCoordsXY logoCoords = windowPos - + ScreenCoordsXY(widgets[WIDX_OPENRCT2_LOGO].left, widgets[WIDX_OPENRCT2_LOGO].top); - GfxDrawSprite(dpi, ImageId(SPR_G2_LOGO), logoCoords); - // Version info - utf8 buffer[256]; - utf8* ch = buffer; - OpenRCT2WriteFullVersionInfo(ch, sizeof(buffer) - (ch - buffer)); - auto ft = Formatter(); - ft.Add(buffer); - - auto const& versionPlaceholder = widgets[WIDX_VERSION]; - auto versionPlaceHolderWidth = versionPlaceholder.right - versionPlaceholder.left; - auto centreX = versionPlaceholder.left + versionPlaceHolderWidth / 2; - auto centreY = (versionPlaceholder.top + versionPlaceholder.bottom - FontGetLineHeight(FontStyle::Medium)) / 2; - auto centrePos = windowPos + ScreenCoordsXY(centreX, centreY); - DrawTextWrapped(dpi, centrePos, versionPlaceHolderWidth, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); - - // Shows the update available button - if (OpenRCT2::GetContext()->HasNewVersionInfo()) - { - widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; - _windowAboutOpenRCT2Widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; - } - - // Draw the rest of the text - Formatter ft2{}; - TextPaint tp{ colours[1], TextAlignment::CENTRE }; - auto textCoords = windowPos + ScreenCoordsXY((width / 2) - 1, 240); - auto textWidth = WW - 20; - - textCoords += ScreenCoordsXY( - 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_OPENRCT2_DESCRIPTION_2, ft2, tp) + 5); // More info - textCoords += ScreenCoordsXY( - 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_OPENRCT2_DESCRIPTION_3, ft2, tp) + 5); // Copyright - textCoords += ScreenCoordsXY( - 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_OPENRCT2_TITLE, ft2, tp) + 5); // Title Theme - textCoords += ScreenCoordsXY( - 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_FAIRGROUND_ORGAN, ft2, tp) + 5); // Fairground organ - textCoords += ScreenCoordsXY( - 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_SPECIAL_THANKS_1, ft2, tp)); // Special Thanks - textCoords += ScreenCoordsXY( - 0, DrawTextWrapped(dpi, textCoords, textWidth, STR_ABOUT_SPECIAL_THANKS_2, ft2, tp)); // Company names + return WindowFocusOrCreate(WindowClass::About, WW, WH, WF_CENTRE_SCREEN); } - - /** - * @brief Draw RCT2 info on open tab - */ - void DrawRCT2Info(DrawPixelInfo& dpi) - { - int32_t yPage = windowPos.y + widgets[WIDX_PAGE_BACKGROUND].top + 5; - - auto screenCoords = ScreenCoordsXY{ windowPos.x + 200, yPage + 5 }; - - int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); - - // Credits - DrawTextBasic(dpi, screenCoords, STR_COPYRIGHT_CS, {}, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight + 74; - DrawTextBasic(dpi, screenCoords, STR_DESIGNED_AND_PROGRAMMED_BY_CS, {}, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - DrawTextBasic(dpi, screenCoords, STR_GRAPHICS_BY_SF, {}, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - DrawTextBasic(dpi, screenCoords, STR_SOUND_AND_MUSIC_BY_AB, {}, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - DrawTextBasic(dpi, screenCoords, STR_ADDITIONAL_SOUNDS_RECORDED_BY_DE, {}, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight + 3; - DrawTextBasic(dpi, screenCoords, STR_REPRESENTATION_BY_JL, {}, { TextAlignment::CENTRE }); - screenCoords.y += 2 * lineHeight + 5; - DrawTextBasic(dpi, screenCoords, STR_THANKS_TO, {}, { TextAlignment::CENTRE }); - screenCoords.y += lineHeight; - DrawTextBasic(dpi, screenCoords, STR_THANKS_TO_PEOPLE, {}, { TextAlignment::CENTRE }); - screenCoords.y += 2 * lineHeight + 5; - DrawTextBasic(dpi, screenCoords, STR_LICENSED_TO_INFOGRAMES_INTERACTIVE_INC, {}, { TextAlignment::CENTRE }); - - // Images - GfxDrawSprite(dpi, ImageId(SPR_CREDITS_CHRIS_SAWYER_SMALL), { windowPos.x + 92, yPage + 24 }); - - // Licence - } - - void OnResize() override - { - ResizeFrameWithPage(); - } -}; - -/** - * - * rct2: 0x0066D2AC - */ -WindowBase* WindowAboutOpen() -{ - return WindowFocusOrCreate(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 6114257720..812c87c31c 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -18,13 +18,13 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_ASSET_PACKS; + static constexpr int32_t WW = 400; + static constexpr int32_t WH = 200; -static constexpr StringId WINDOW_TITLE = STR_ASSET_PACKS; -static constexpr int32_t WW = 400; -static constexpr int32_t WH = 200; - -// clang-format off + // clang-format off enum WindowAssetPacksWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -47,298 +47,301 @@ static Widget WindowAssetPacksWidgets[] = { MakeWidget({ 0, 0 }, { 0, 0 }, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_RELOAD), STR_RELOAD_ASSET_PACKS_TIP), kWidgetsEnd, }; -// clang-format on + // clang-format on -class AssetPacksWindow final : public Window -{ -private: - static constexpr int32_t ItemHeight = SCROLLABLE_ROW_HEIGHT + 1; - static constexpr int32_t ItemCheckBoxSize = ItemHeight - 3; - std::optional _highlightedIndex; - std::optional _selectedIndex; - -public: - void OnOpen() override + class AssetPacksWindow final : public Window { - widgets = WindowAssetPacksWidgets; - WindowInitScrollWidgets(*this); - } + private: + static constexpr int32_t ItemHeight = SCROLLABLE_ROW_HEIGHT + 1; + static constexpr int32_t ItemCheckBoxSize = ItemHeight - 3; + std::optional _highlightedIndex; + std::optional _selectedIndex; - void OnClose() override - { - Apply(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_MOVE_UP: - ReorderSelectedAssetPack(-1); - break; - case WIDX_MOVE_DOWN: - ReorderSelectedAssetPack(1); - break; - case WIDX_APPLY: - Apply(); - break; - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - ScreenSize result; - auto assetPackManager = GetContext()->GetAssetPackManager(); - if (assetPackManager != nullptr) - { - auto numAssetPacks = assetPackManager->GetCount() + 1; // +1 for the base assets item - result.height = static_cast(numAssetPacks * ItemHeight); + widgets = WindowAssetPacksWidgets; + WindowInitScrollWidgets(*this); } - if (_highlightedIndex) + void OnClose() override { - _highlightedIndex = {}; - Invalidate(); + Apply(); } - return result; - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto isCheckBox = false; - auto index = GetAssetPackIndexFromPosition(screenCoords, isCheckBox); - - // Click on checkbox - if (index && isCheckBox) + void OnMouseUp(WidgetIndex widgetIndex) override { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_MOVE_UP: + ReorderSelectedAssetPack(-1); + break; + case WIDX_MOVE_DOWN: + ReorderSelectedAssetPack(1); + break; + case WIDX_APPLY: + Apply(); + break; + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + ScreenSize result; auto assetPackManager = GetContext()->GetAssetPackManager(); if (assetPackManager != nullptr) { - auto assetPack = assetPackManager->GetAssetPack(*index); - if (assetPack != nullptr) + auto numAssetPacks = assetPackManager->GetCount() + 1; // +1 for the base assets item + result.height = static_cast(numAssetPacks * ItemHeight); + } + + if (_highlightedIndex) + { + _highlightedIndex = {}; + Invalidate(); + } + + return result; + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + auto isCheckBox = false; + auto index = GetAssetPackIndexFromPosition(screenCoords, isCheckBox); + + // Click on checkbox + if (index && isCheckBox) + { + auto assetPackManager = GetContext()->GetAssetPackManager(); + if (assetPackManager != nullptr) { - assetPack->SetEnabled(!assetPack->IsEnabled()); - Invalidate(); + auto assetPack = assetPackManager->GetAssetPack(*index); + if (assetPack != nullptr) + { + assetPack->SetEnabled(!assetPack->IsEnabled()); + Invalidate(); + } } } - } - // Select item - if (_selectedIndex != index) - { - _selectedIndex = index; - Invalidate(); - } - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto isCheckBox = false; - auto index = GetAssetPackIndexFromPosition(screenCoords, isCheckBox); - if (_highlightedIndex != index) - { - _highlightedIndex = index; - Invalidate(); - } - } - - void OnPrepareDraw() override - { - ResizeFrame(); - - auto& list = widgets[WIDX_LIST]; - list.left = 6; - list.top = 20 + 11 + 3; - list.right = width - 2 - 24 - 1; - list.bottom = height - 6 - 11 - 3; - - widgets[WIDX_HIGH_LABEL].bottom = list.top - 1; - widgets[WIDX_HIGH_LABEL].top = widgets[WIDX_HIGH_LABEL].bottom - 11 - 3; - widgets[WIDX_HIGH_LABEL].left = list.left; - widgets[WIDX_HIGH_LABEL].right = list.right; - widgets[WIDX_LOW_LABEL].top = list.bottom + 1 + 3; - widgets[WIDX_LOW_LABEL].bottom = widgets[WIDX_LOW_LABEL].top + 11 + 3; - widgets[WIDX_LOW_LABEL].left = list.left; - widgets[WIDX_LOW_LABEL].right = list.right; - - auto toolstripY = 20; - auto toolstripRight = width - 2; - auto toolstripLeft = toolstripRight - 24; - for (WidgetIndex i = WIDX_MOVE_UP; i <= WIDX_APPLY; i++) - { - widgets[i].top = toolstripY; - widgets[i].bottom = toolstripY + 24; - widgets[i].left = toolstripLeft; - widgets[i].right = toolstripRight; - toolstripY += 24; - } - - SetWidgetDisabled(WIDX_MOVE_UP, !_selectedIndex || _selectedIndex == 0u); - SetWidgetDisabled(WIDX_MOVE_DOWN, !_selectedIndex || _selectedIndex >= GetNumAssetPacks() - 1); - - widgets[WIDX_APPLY].bottom = widgets[WIDX_LIST].bottom; - widgets[WIDX_APPLY].top = widgets[WIDX_APPLY].bottom - 24; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; - GfxFillRect( - dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - - auto assetPackManager = GetContext()->GetAssetPackManager(); - if (assetPackManager == nullptr) - return; - - auto numAssetPacks = assetPackManager->GetCount(); - auto y = 0; - for (size_t i = 0; i <= numAssetPacks; i++) - { - if (y > dpi.y + dpi.height) - break; - if (y + 11 < dpi.y) - continue; - - auto isSelected = i == _selectedIndex; - auto isHighlighted = i == _highlightedIndex; - if (i == numAssetPacks) + // Select item + if (_selectedIndex != index) { - auto ft = Formatter(); - ft.Add(STR_BASE_GRAPHICS_MUSIC_SOUND); - PaintItem(dpi, y, ft, true, isSelected, isHighlighted); + _selectedIndex = index; + Invalidate(); } - else + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + auto isCheckBox = false; + auto index = GetAssetPackIndexFromPosition(screenCoords, isCheckBox); + if (_highlightedIndex != index) { - auto assetPack = assetPackManager->GetAssetPack(i); - if (assetPack != nullptr) + _highlightedIndex = index; + Invalidate(); + } + } + + void OnPrepareDraw() override + { + ResizeFrame(); + + auto& list = widgets[WIDX_LIST]; + list.left = 6; + list.top = 20 + 11 + 3; + list.right = width - 2 - 24 - 1; + list.bottom = height - 6 - 11 - 3; + + widgets[WIDX_HIGH_LABEL].bottom = list.top - 1; + widgets[WIDX_HIGH_LABEL].top = widgets[WIDX_HIGH_LABEL].bottom - 11 - 3; + widgets[WIDX_HIGH_LABEL].left = list.left; + widgets[WIDX_HIGH_LABEL].right = list.right; + widgets[WIDX_LOW_LABEL].top = list.bottom + 1 + 3; + widgets[WIDX_LOW_LABEL].bottom = widgets[WIDX_LOW_LABEL].top + 11 + 3; + widgets[WIDX_LOW_LABEL].left = list.left; + widgets[WIDX_LOW_LABEL].right = list.right; + + auto toolstripY = 20; + auto toolstripRight = width - 2; + auto toolstripLeft = toolstripRight - 24; + for (WidgetIndex i = WIDX_MOVE_UP; i <= WIDX_APPLY; i++) + { + widgets[i].top = toolstripY; + widgets[i].bottom = toolstripY + 24; + widgets[i].left = toolstripLeft; + widgets[i].right = toolstripRight; + toolstripY += 24; + } + + SetWidgetDisabled(WIDX_MOVE_UP, !_selectedIndex || _selectedIndex == 0u); + SetWidgetDisabled(WIDX_MOVE_DOWN, !_selectedIndex || _selectedIndex >= GetNumAssetPacks() - 1); + + widgets[WIDX_APPLY].bottom = widgets[WIDX_LIST].bottom; + widgets[WIDX_APPLY].top = widgets[WIDX_APPLY].bottom - 24; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + GfxFillRect( + dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, + ColourMapA[colours[1]].mid_light); + + auto assetPackManager = GetContext()->GetAssetPackManager(); + if (assetPackManager == nullptr) + return; + + auto numAssetPacks = assetPackManager->GetCount(); + auto y = 0; + for (size_t i = 0; i <= numAssetPacks; i++) + { + if (y > dpi.y + dpi.height) + break; + if (y + 11 < dpi.y) + continue; + + auto isSelected = i == _selectedIndex; + auto isHighlighted = i == _highlightedIndex; + if (i == numAssetPacks) { - auto isChecked = assetPack->IsEnabled(); auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(assetPack->Name.c_str()); - PaintItem(dpi, y, ft, isChecked, isSelected, isHighlighted); + ft.Add(STR_BASE_GRAPHICS_MUSIC_SOUND); + PaintItem(dpi, y, ft, true, isSelected, isHighlighted); + } + else + { + auto assetPack = assetPackManager->GetAssetPack(i); + if (assetPack != nullptr) + { + auto isChecked = assetPack->IsEnabled(); + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(assetPack->Name.c_str()); + PaintItem(dpi, y, ft, isChecked, isSelected, isHighlighted); + } + } + y += ItemHeight; + } + } + + private: + void PaintItem(DrawPixelInfo& dpi, int32_t y, Formatter& ft, bool isChecked, bool isSelected, bool isHighlighted) + { + auto listWidth = dpi.width - 1; + auto stringId = STR_BLACK_STRING; + auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } }; + if (isSelected) + { + GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); + stringId = STR_WINDOW_COLOUR_2_STRINGID; + } + else if (isHighlighted) + { + GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); + } + + DrawTextEllipsised(dpi, { 16, y + 1 }, listWidth, stringId, ft); + + auto checkboxSize = ItemHeight - 3; + PaintCheckbox(dpi, { { 2, y + 1 }, { 2 + checkboxSize + 1, y + 1 + checkboxSize } }, isChecked); + } + + void PaintCheckbox(DrawPixelInfo& dpi, const ScreenRect& rect, bool checked) + { + GfxFillRectInset(dpi, rect, colours[1], INSET_RECT_F_E0); + if (checked) + { + auto checkmark = Formatter(); + checkmark.Add(STR_STRING); + checkmark.Add(CheckBoxMarkString); + DrawTextBasic( + dpi, ScreenCoordsXY{ rect.GetLeft() + 1, rect.GetTop() }, STR_WINDOW_COLOUR_2_STRINGID, checkmark); + } + } + + std::optional GetAssetPackIndexFromPosition(const ScreenCoordsXY& pos, bool& isCheckBox) + { + const auto index = pos.y / ItemHeight; + if (index < 0 || static_cast(index) >= GetNumAssetPacks()) + return std::nullopt; + + isCheckBox = pos.x >= 2 && pos.x <= 2 + ItemCheckBoxSize + 1; + return static_cast(index); + } + + size_t GetNumAssetPacks() const + { + auto assetPackManager = GetContext()->GetAssetPackManager(); + if (assetPackManager == nullptr) + return 0; + return assetPackManager->GetCount(); + } + + bool IsSelectedAssetPackEnabled() const + { + if (_selectedIndex) + { + auto assetPackManager = GetContext()->GetAssetPackManager(); + if (assetPackManager != nullptr) + { + auto assetPack = assetPackManager->GetAssetPack(*_selectedIndex); + if (assetPack != nullptr) + { + return assetPack->IsEnabled(); + } } } - y += ItemHeight; - } - } - -private: - void PaintItem(DrawPixelInfo& dpi, int32_t y, Formatter& ft, bool isChecked, bool isSelected, bool isHighlighted) - { - auto listWidth = dpi.width - 1; - auto stringId = STR_BLACK_STRING; - auto fillRectangle = ScreenRect{ { 0, y }, { listWidth, y + ItemHeight - 1 } }; - if (isSelected) - { - GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); - stringId = STR_WINDOW_COLOUR_2_STRINGID; - } - else if (isHighlighted) - { - GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); + return false; } - DrawTextEllipsised(dpi, { 16, y + 1 }, listWidth, stringId, ft); - - auto checkboxSize = ItemHeight - 3; - PaintCheckbox(dpi, { { 2, y + 1 }, { 2 + checkboxSize + 1, y + 1 + checkboxSize } }, isChecked); - } - - void PaintCheckbox(DrawPixelInfo& dpi, const ScreenRect& rect, bool checked) - { - GfxFillRectInset(dpi, rect, colours[1], INSET_RECT_F_E0); - if (checked) + void ReorderSelectedAssetPack(int32_t direction) { - auto checkmark = Formatter(); - checkmark.Add(STR_STRING); - checkmark.Add(CheckBoxMarkString); - DrawTextBasic(dpi, ScreenCoordsXY{ rect.GetLeft() + 1, rect.GetTop() }, STR_WINDOW_COLOUR_2_STRINGID, checkmark); + if (!_selectedIndex) + return; + + auto assetPackManager = GetContext()->GetAssetPackManager(); + if (assetPackManager == nullptr) + return; + + if (direction < 0 && *_selectedIndex > 0) + { + assetPackManager->Swap(*_selectedIndex, *_selectedIndex - 1); + (*_selectedIndex)--; + Invalidate(); + } + else if (direction > 0 && *_selectedIndex < assetPackManager->GetCount() - 1) + { + assetPackManager->Swap(*_selectedIndex, *_selectedIndex + 1); + (*_selectedIndex)++; + Invalidate(); + } } - } - std::optional GetAssetPackIndexFromPosition(const ScreenCoordsXY& pos, bool& isCheckBox) - { - const auto index = pos.y / ItemHeight; - if (index < 0 || static_cast(index) >= GetNumAssetPacks()) - return std::nullopt; - - isCheckBox = pos.x >= 2 && pos.x <= 2 + ItemCheckBoxSize + 1; - return static_cast(index); - } - - size_t GetNumAssetPacks() const - { - auto assetPackManager = GetContext()->GetAssetPackManager(); - if (assetPackManager == nullptr) - return 0; - return assetPackManager->GetCount(); - } - - bool IsSelectedAssetPackEnabled() const - { - if (_selectedIndex) + void Apply() { + auto& objectManager = GetContext()->GetObjectManager(); + objectManager.ResetObjects(); + auto assetPackManager = GetContext()->GetAssetPackManager(); if (assetPackManager != nullptr) { - auto assetPack = assetPackManager->GetAssetPack(*_selectedIndex); - if (assetPack != nullptr) - { - return assetPack->IsEnabled(); - } + assetPackManager->SaveEnabledAssetPacks(); } } - return false; - } + }; - void ReorderSelectedAssetPack(int32_t direction) + WindowBase* WindowAssetPacksOpen() { - if (!_selectedIndex) - return; - - auto assetPackManager = GetContext()->GetAssetPackManager(); - if (assetPackManager == nullptr) - return; - - if (direction < 0 && *_selectedIndex > 0) - { - assetPackManager->Swap(*_selectedIndex, *_selectedIndex - 1); - (*_selectedIndex)--; - Invalidate(); - } - else if (direction > 0 && *_selectedIndex < assetPackManager->GetCount() - 1) - { - assetPackManager->Swap(*_selectedIndex, *_selectedIndex + 1); - (*_selectedIndex)++; - Invalidate(); - } + auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN; + return WindowFocusOrCreate(WindowClass::AssetPacks, WW, WH, flags); } - - void Apply() - { - auto& objectManager = GetContext()->GetObjectManager(); - objectManager.ResetObjects(); - - auto assetPackManager = GetContext()->GetAssetPackManager(); - if (assetPackManager != nullptr) - { - assetPackManager->SaveEnabledAssetPacks(); - } - } -}; - -WindowBase* WindowAssetPacksOpen() -{ - auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN; - return WindowFocusOrCreate(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 7662621e06..948d39b76f 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -22,12 +22,13 @@ #include #include #include +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WW = 113; + static constexpr int32_t WH = 96; + static constexpr StringId WINDOW_TITLE = STR_BANNER_WINDOW_TITLE; -static constexpr int32_t WW = 113; -static constexpr int32_t WH = 96; -static constexpr StringId WINDOW_TITLE = STR_BANNER_WINDOW_TITLE; - -// clang-format off + // clang-format off enum WindowBannerWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -70,253 +71,255 @@ static Widget window_banner_widgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class BannerWindow final : public Window -{ -private: - CoordsXYZ _bannerViewPos; - - void CreateViewport() + class BannerWindow final : public Window { - Widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT]; - ViewportCreate( - this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, - (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, Focus(_bannerViewPos)); + private: + CoordsXYZ _bannerViewPos; - if (viewport != nullptr) - viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; - Invalidate(); - } - - BannerIndex GetBannerIndex() const - { - return BannerIndex::FromUnderlying(number); - } - - BannerElement* GetBannerElement() - { - auto* banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) + void CreateViewport() { - return nullptr; + Widget* viewportWidget = &window_banner_widgets[WIDX_VIEWPORT]; + ViewportCreate( + this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, + (viewportWidget->width()) - 1, (viewportWidget->height()) - 1, Focus(_bannerViewPos)); + + if (viewport != nullptr) + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + Invalidate(); } - TileElement* tileElement = MapGetFirstElementAt(banner->position); - if (tileElement == nullptr) + BannerIndex GetBannerIndex() const { - return nullptr; + return BannerIndex::FromUnderlying(number); } - do + BannerElement* GetBannerElement() { - auto* bannerElement = tileElement->AsBanner(); - if (bannerElement == nullptr) + auto* banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) { - continue; + return nullptr; } - if (bannerElement->GetIndex() == GetBannerIndex()) + + TileElement* tileElement = MapGetFirstElementAt(banner->position); + if (tileElement == nullptr) { - return bannerElement; + return nullptr; } - } while (!(tileElement++)->IsLastForTile()); - return nullptr; - } - -public: - void OnOpen() override - { - widgets = window_banner_widgets; - WindowInitScrollWidgets(*this); - } - - void Initialise(rct_windownumber _number) - { - number = _number; - auto* banner = GetBanner(BannerIndex::FromUnderlying(number)); - - auto* bannerElement = GetBannerElement(); - if (bannerElement == nullptr) - return; - - _bannerViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), bannerElement->GetBaseZ() }; - CreateViewport(); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - Widget* widget = &widgets[widgetIndex]; - auto* banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) - { - Close(); - return; - } - switch (widgetIndex) - { - case WIDX_MAIN_COLOUR: - WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), banner->colour); - break; - case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON: - - for (int32_t i = 0; i < 13; ++i) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = BannerColouredTextFormats[i + 1]; - } - - // Switch to the dropdown box widget. - widget--; - - WindowDropdownShowTextCustomWidth( - { widget->left + windowPos.x, widget->top + windowPos.y }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, 13, widget->width() - 3); - - Dropdown::SetChecked(banner->text_colour - 1, true); - break; - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - auto* banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) - { - Close(); - return; - } - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_BANNER_DEMOLISH: + do { - auto* bannerElement = GetBannerElement(); + auto* bannerElement = tileElement->AsBanner(); if (bannerElement == nullptr) - break; + { + continue; + } + if (bannerElement->GetIndex() == GetBannerIndex()) + { + return bannerElement; + } + } while (!(tileElement++)->IsLastForTile()); - auto bannerRemoveAction = BannerRemoveAction( - { banner->position.ToCoordsXY(), bannerElement->GetBaseZ(), bannerElement->GetPosition() }); - GameActions::Execute(&bannerRemoveAction); - break; - } - case WIDX_BANNER_TEXT: - WindowTextInputRawOpen( - this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, {}, banner->GetText().c_str(), 32); - break; - case WIDX_BANNER_NO_ENTRY: + return nullptr; + } + + public: + void OnOpen() override + { + widgets = window_banner_widgets; + WindowInitScrollWidgets(*this); + } + + void Initialise(rct_windownumber _number) + { + number = _number; + auto* banner = GetBanner(BannerIndex::FromUnderlying(number)); + + auto* bannerElement = GetBannerElement(); + if (bannerElement == nullptr) + return; + + _bannerViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), bannerElement->GetBaseZ() }; + CreateViewport(); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + Widget* widget = &widgets[widgetIndex]; + auto* banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) { - TextinputCancel(); - auto bannerSetStyle = BannerSetStyleAction( - BannerSetStyleType::NoEntry, GetBannerIndex(), banner->flags ^ BANNER_FLAG_NO_ENTRY); - GameActions::Execute(&bannerSetStyle); - break; + Close(); + return; } - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - switch (widgetIndex) - { - case WIDX_MAIN_COLOUR: + switch (widgetIndex) { - if (dropdownIndex == -1) + case WIDX_MAIN_COLOUR: + WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), banner->colour); break; + case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON: - auto bannerSetStyle = BannerSetStyleAction( - BannerSetStyleType::PrimaryColour, GetBannerIndex(), ColourDropDownIndexToColour(dropdownIndex)); - GameActions::Execute(&bannerSetStyle); - break; + for (int32_t i = 0; i < 13; ++i) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = BannerColouredTextFormats[i + 1]; + } + + // Switch to the dropdown box widget. + widget--; + + WindowDropdownShowTextCustomWidth( + { widget->left + windowPos.x, widget->top + windowPos.y }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, 13, widget->width() - 3); + + Dropdown::SetChecked(banner->text_colour - 1, true); + break; } - case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON: + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + auto* banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) { - if (dropdownIndex == -1) + Close(); + return; + } + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); break; - auto bannerSetStyle = BannerSetStyleAction(BannerSetStyleType::TextColour, GetBannerIndex(), dropdownIndex + 1); - GameActions::Execute(&bannerSetStyle); - break; + case WIDX_BANNER_DEMOLISH: + { + auto* bannerElement = GetBannerElement(); + if (bannerElement == nullptr) + break; + + auto bannerRemoveAction = BannerRemoveAction( + { banner->position.ToCoordsXY(), bannerElement->GetBaseZ(), bannerElement->GetPosition() }); + GameActions::Execute(&bannerRemoveAction); + break; + } + case WIDX_BANNER_TEXT: + WindowTextInputRawOpen( + this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, {}, banner->GetText().c_str(), 32); + break; + case WIDX_BANNER_NO_ENTRY: + { + TextinputCancel(); + auto bannerSetStyle = BannerSetStyleAction( + BannerSetStyleType::NoEntry, GetBannerIndex(), banner->flags ^ BANNER_FLAG_NO_ENTRY); + GameActions::Execute(&bannerSetStyle); + break; + } } } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex == WIDX_BANNER_TEXT) + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override { - auto bannerSetNameAction = BannerSetNameAction(GetBannerIndex(), std::string(text)); - GameActions::Execute(&bannerSetNameAction); + switch (widgetIndex) + { + case WIDX_MAIN_COLOUR: + { + if (dropdownIndex == -1) + break; + + auto bannerSetStyle = BannerSetStyleAction( + BannerSetStyleType::PrimaryColour, GetBannerIndex(), ColourDropDownIndexToColour(dropdownIndex)); + GameActions::Execute(&bannerSetStyle); + break; + } + case WIDX_TEXT_COLOUR_DROPDOWN_BUTTON: + { + if (dropdownIndex == -1) + break; + auto bannerSetStyle = BannerSetStyleAction( + BannerSetStyleType::TextColour, GetBannerIndex(), dropdownIndex + 1); + GameActions::Execute(&bannerSetStyle); + break; + } + } } - } - void OnViewportRotate() override - { - RemoveViewport(); - CreateViewport(); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - if (viewport != nullptr) + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - WindowDrawViewport(dpi, *this); + if (widgetIndex == WIDX_BANNER_TEXT) + { + auto bannerSetNameAction = BannerSetNameAction(GetBannerIndex(), std::string(text)); + GameActions::Execute(&bannerSetNameAction); + } } - } - void OnPrepareDraw() override + void OnViewportRotate() override + { + RemoveViewport(); + CreateViewport(); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + if (viewport != nullptr) + { + WindowDrawViewport(dpi, *this); + } + } + + void OnPrepareDraw() override + { + auto* banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) + { + return; + } + Widget* colourBtn = &window_banner_widgets[WIDX_MAIN_COLOUR]; + colourBtn->type = WindowWidgetType::Empty; + + auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); + if (bannerEntry != nullptr && (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)) + { + colourBtn->type = WindowWidgetType::ColourBtn; + } + pressed_widgets &= ~(1uLL << WIDX_BANNER_NO_ENTRY); + disabled_widgets &= ~( + (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON)); + if (banner->flags & BANNER_FLAG_NO_ENTRY) + { + pressed_widgets |= (1uLL << WIDX_BANNER_NO_ENTRY); + disabled_widgets |= (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) + | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON); + } + colourBtn->image = GetColourButtonImage(banner->colour); + Widget* dropDownWidget = &window_banner_widgets[WIDX_TEXT_COLOUR_DROPDOWN]; + dropDownWidget->text = BannerColouredTextFormats[banner->text_colour]; + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + /** + * + * rct2: 0x006BA305 + */ + WindowBase* WindowBannerOpen(rct_windownumber number) { - auto* banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) - { - return; - } - Widget* colourBtn = &window_banner_widgets[WIDX_MAIN_COLOUR]; - colourBtn->type = WindowWidgetType::Empty; + auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); - auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); - if (bannerEntry != nullptr && (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR)) - { - colourBtn->type = WindowWidgetType::ColourBtn; - } - pressed_widgets &= ~(1uLL << WIDX_BANNER_NO_ENTRY); - disabled_widgets &= ~( - (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON)); - if (banner->flags & BANNER_FLAG_NO_ENTRY) - { - pressed_widgets |= (1uLL << WIDX_BANNER_NO_ENTRY); - disabled_widgets |= (1uLL << WIDX_BANNER_TEXT) | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN) - | (1uLL << WIDX_TEXT_COLOUR_DROPDOWN_BUTTON); - } - colourBtn->image = GetColourButtonImage(banner->colour); - Widget* dropDownWidget = &window_banner_widgets[WIDX_TEXT_COLOUR_DROPDOWN]; - dropDownWidget->text = BannerColouredTextFormats[banner->text_colour]; - } + if (w != nullptr) + return w; - void OnResize() override - { - ResizeFrame(); - } -}; + w = WindowCreate(WindowClass::Banner, WW, WH, 0); -/** - * - * rct2: 0x006BA305 - */ -WindowBase* WindowBannerOpen(rct_windownumber number) -{ - auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + if (w != nullptr) + w->Initialise(number); - if (w != nullptr) return w; - - w = WindowCreate(WindowClass::Banner, WW, WH, 0); - - if (w != nullptr) - w->Initialise(number); - - return w; -} + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 5f51a4c71b..79dbd31113 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -25,9 +25,9 @@ #include #include -using namespace OpenRCT2; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -51,289 +51,290 @@ static Widget _windowChangelogWidgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class ChangelogWindow final : public Window -{ - const NewVersionInfo* _newVersionInfo; - std::vector _changelogLines; - int32_t _changelogLongestLineWidth = 0; - int _personality = 0; - -public: - /** - * @brief Retrieves the changelog contents. - */ - const std::string GetText(PATHID pathId) + class ChangelogWindow final : public Window { - auto env = GetContext()->GetPlatformEnvironment(); - auto path = env->GetFilePath(pathId); - auto fs = std::ifstream(fs::u8path(path), std::ios::in); - if (!fs.is_open()) + const NewVersionInfo* _newVersionInfo; + std::vector _changelogLines; + int32_t _changelogLongestLineWidth = 0; + int _personality = 0; + + public: + /** + * @brief Retrieves the changelog contents. + */ + const std::string GetText(PATHID pathId) { - throw std::runtime_error("Unable to open " + path); + auto env = GetContext()->GetPlatformEnvironment(); + auto path = env->GetFilePath(pathId); + auto fs = std::ifstream(fs::u8path(path), std::ios::in); + if (!fs.is_open()) + { + throw std::runtime_error("Unable to open " + path); + } + fs.seekg(0, fs.end); + auto length = fs.tellg(); + fs.seekg(0, fs.beg); + std::unique_ptr buffer = std::make_unique(length); + fs.read(buffer.get(), length); + auto result = std::string(buffer.get(), buffer.get() + length); + return result; } - fs.seekg(0, fs.end); - auto length = fs.tellg(); - fs.seekg(0, fs.beg); - std::unique_ptr buffer = std::make_unique(length); - fs.read(buffer.get(), length); - auto result = std::string(buffer.get(), buffer.get() + length); - return result; - } - /** - * @brief Set the Changelog Window's Personality, should be called just after creation. Returns true on success - * - * @param personality - */ - bool SetPersonality(int personality) - { - switch (personality) + /** + * @brief Set the Changelog Window's Personality, should be called just after creation. Returns true on success + * + * @param personality + */ + bool SetPersonality(int personality) { - case WV_NEW_VERSION_INFO: - if (!GetContext()->HasNewVersionInfo()) - { - return false; - } - _personality = WV_NEW_VERSION_INFO; - NewVersionProcessInfo(); - widgets[WIDX_OPEN_URL].type = WindowWidgetType::Button; - return true; + switch (personality) + { + case WV_NEW_VERSION_INFO: + if (!GetContext()->HasNewVersionInfo()) + { + return false; + } + _personality = WV_NEW_VERSION_INFO; + NewVersionProcessInfo(); + widgets[WIDX_OPEN_URL].type = WindowWidgetType::Button; + return true; - case WV_CHANGELOG: - if (!ReadFile(PATHID::CHANGELOG)) - { - return false; - } - _personality = WV_CHANGELOG; - widgets[WIDX_TITLE].text = STR_CHANGELOG_TITLE; - return true; + case WV_CHANGELOG: + if (!ReadFile(PATHID::CHANGELOG)) + { + return false; + } + _personality = WV_CHANGELOG; + widgets[WIDX_TITLE].text = STR_CHANGELOG_TITLE; + return true; - case WV_CONTRIBUTORS: - if (!ReadFile(PATHID::CONTRIBUTORS)) - { - return false; - } - _personality = WV_CONTRIBUTORS; - widgets[WIDX_TITLE].text = STR_CONTRIBUTORS_WINDOW; - return true; + case WV_CONTRIBUTORS: + if (!ReadFile(PATHID::CONTRIBUTORS)) + { + return false; + } + _personality = WV_CONTRIBUTORS; + widgets[WIDX_TITLE].text = STR_CONTRIBUTORS_WINDOW; + return true; - default: - LOG_ERROR("Invalid personality for changelog window: %d", personality); + default: + LOG_ERROR("Invalid personality for changelog window: %d", personality); + return false; + } + } + + void OnOpen() override + { + widgets = _windowChangelogWidgets; + + WindowInitScrollWidgets(*this); + min_width = MIN_WW; + min_height = MIN_WH; + max_width = MIN_WW; + max_height = MIN_WH; + } + + void OnResize() override + { + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + + max_width = (screenWidth * 4) / 5; + max_height = (screenHeight * 4) / 5; + + min_width = MIN_WW; + min_height = MIN_WH; + + auto download_button_width = widgets[WIDX_OPEN_URL].width(); + widgets[WIDX_OPEN_URL].left = (width - download_button_width) / 2; + widgets[WIDX_OPEN_URL].right = widgets[WIDX_OPEN_URL].left + download_button_width; + + if (width < min_width) + { + Invalidate(); + width = min_width; + } + if (height < min_height) + { + Invalidate(); + height = min_height; + } + } + + void OnPrepareDraw() override + { + ResizeFrameWithPage(); + widgets[WIDX_SCROLL].right = width - 3; + widgets[WIDX_SCROLL].bottom = height - 22; + widgets[WIDX_OPEN_URL].bottom = height - 5; + widgets[WIDX_OPEN_URL].top = height - 19; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_OPEN_URL: + if (_newVersionInfo != nullptr) + { + GetContext()->GetUiContext()->OpenURL(_newVersionInfo->url); + } + else + { + LOG_ERROR("Cannot open URL: NewVersionInfo for ChangelogWindow is undefined!"); + } + break; + } + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + const int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); + + ScreenCoordsXY screenCoords(3, 3 - lineHeight); + for (const auto& line : _changelogLines) + { + screenCoords.y += lineHeight; + if (screenCoords.y + lineHeight < dpi.y || screenCoords.y >= dpi.y + dpi.height) + continue; + + GfxDrawString(dpi, screenCoords, line.c_str(), { colours[0] }); + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + return ScreenSize( + _changelogLongestLineWidth + 4, + static_cast(_changelogLines.size()) * FontGetLineHeight(FontStyle::Medium)); + } + + // TODO: This probably should be a utility function defined elsewhere for reusability + /** + * @brief Reimplementation of Window's GetCentrePositionForNewWindow for ChangelogWindow. + * + * @return ScreenCoordsXY + */ + 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(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2) }; + } + + private: + /** + * @brief Converts NewVersionInfo into changelog lines + * + */ + void NewVersionProcessInfo() + { + _newVersionInfo = GetContext()->GetNewVersionInfo(); + if (_newVersionInfo != nullptr) + { + char version_info[256]; + + const char* version_info_ptr = _newVersionInfo->name.c_str(); + FormatStringLegacy(version_info, 256, STR_NEW_RELEASE_VERSION_INFO, &version_info_ptr); + + _changelogLines.emplace_back(version_info); + _changelogLines.emplace_back(""); + + ProcessText(_newVersionInfo->changelog); + } + else + { + LOG_ERROR("ChangelogWindow: Could not process NewVersionInfo, result was undefined"); + } + } + + /** + * @brief Get the absolute path for the changelog file + * + * @return std::string + */ + std::string GetChangelogPath() + { + auto env = GetContext()->GetPlatformEnvironment(); + return env->GetFilePath(PATHID::CHANGELOG); + } + + /** + * @brief Attempts to read the changelog file, returns true on success + * + */ + bool ReadFile(PATHID pathId) + { + std::string _text; + try + { + _text = GetText(pathId); + } + catch (const std::bad_alloc&) + { + LOG_ERROR("Unable to allocate memory for text file"); return false; + } + catch (const std::exception&) + { + LOG_ERROR("Unable to read text file"); + return false; + } + + ProcessText(_text); + return true; } - } - void OnOpen() override - { - widgets = _windowChangelogWidgets; - - WindowInitScrollWidgets(*this); - min_width = MIN_WW; - min_height = MIN_WH; - max_width = MIN_WW; - max_height = MIN_WH; - } - - void OnResize() override - { - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - - max_width = (screenWidth * 4) / 5; - max_height = (screenHeight * 4) / 5; - - min_width = MIN_WW; - min_height = MIN_WH; - - auto download_button_width = widgets[WIDX_OPEN_URL].width(); - widgets[WIDX_OPEN_URL].left = (width - download_button_width) / 2; - widgets[WIDX_OPEN_URL].right = widgets[WIDX_OPEN_URL].left + download_button_width; - - if (width < min_width) + /** + * @brief Ingests a string of text and splits it into lines for the changelog and updates the longest line width for + * scrolling purposes + * + * @param text + */ + void ProcessText(const std::string& text) { - Invalidate(); - width = min_width; - } - if (height < min_height) - { - Invalidate(); - height = min_height; - } - } + std::string::size_type pos = 0; + std::string::size_type prev = 0; + while ((pos = text.find('\n', prev)) != std::string::npos) + { + _changelogLines.push_back(text.substr(prev, pos - prev)); + prev = pos + 1; + } - void OnPrepareDraw() override + // To get the last substring (or only, if delimiter is not found) + _changelogLines.push_back(text.substr(prev)); + + _changelogLongestLineWidth = 0; + for (const auto& line : _changelogLines) + { + int32_t linewidth = GfxGetStringWidth(line.c_str(), FontStyle::Medium); + _changelogLongestLineWidth = std::max(linewidth, _changelogLongestLineWidth); + } + } + }; + + WindowBase* WindowChangelogOpen(int personality) { - ResizeFrameWithPage(); - widgets[WIDX_SCROLL].right = width - 3; - widgets[WIDX_SCROLL].bottom = height - 22; - widgets[WIDX_OPEN_URL].bottom = height - 5; - widgets[WIDX_OPEN_URL].top = height - 19; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + auto* window = WindowBringToFrontByClass(WindowClass::Changelog); + if (window == nullptr) { - case WIDX_CLOSE: - Close(); - break; - case WIDX_OPEN_URL: - if (_newVersionInfo != nullptr) - { - GetContext()->GetUiContext()->OpenURL(_newVersionInfo->url); - } - else - { - LOG_ERROR("Cannot open URL: NewVersionInfo for ChangelogWindow is undefined!"); - } - break; + // Create a new centred window + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + int32_t width = (screenWidth * 4) / 5; + int32_t height = (screenHeight * 4) / 5; + + auto pos = ChangelogWindow::GetCentrePositionForNewWindow(width, height); + auto* newWindow = WindowCreate(WindowClass::Changelog, pos, width, height, WF_RESIZABLE); + newWindow->SetPersonality(personality); + return newWindow; } + return window; } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - const int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); - - ScreenCoordsXY screenCoords(3, 3 - lineHeight); - for (const auto& line : _changelogLines) - { - screenCoords.y += lineHeight; - if (screenCoords.y + lineHeight < dpi.y || screenCoords.y >= dpi.y + dpi.height) - continue; - - GfxDrawString(dpi, screenCoords, line.c_str(), { colours[0] }); - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - return ScreenSize( - _changelogLongestLineWidth + 4, - static_cast(_changelogLines.size()) * FontGetLineHeight(FontStyle::Medium)); - } - - // TODO: This probably should be a utility function defined elsewhere for reusability - /** - * @brief Reimplementation of Window's GetCentrePositionForNewWindow for ChangelogWindow. - * - * @return ScreenCoordsXY - */ - 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(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - height) / 2) }; - } - -private: - /** - * @brief Converts NewVersionInfo into changelog lines - * - */ - void NewVersionProcessInfo() - { - _newVersionInfo = GetContext()->GetNewVersionInfo(); - if (_newVersionInfo != nullptr) - { - char version_info[256]; - - const char* version_info_ptr = _newVersionInfo->name.c_str(); - FormatStringLegacy(version_info, 256, STR_NEW_RELEASE_VERSION_INFO, &version_info_ptr); - - _changelogLines.emplace_back(version_info); - _changelogLines.emplace_back(""); - - ProcessText(_newVersionInfo->changelog); - } - else - { - LOG_ERROR("ChangelogWindow: Could not process NewVersionInfo, result was undefined"); - } - } - - /** - * @brief Get the absolute path for the changelog file - * - * @return std::string - */ - std::string GetChangelogPath() - { - auto env = GetContext()->GetPlatformEnvironment(); - return env->GetFilePath(PATHID::CHANGELOG); - } - - /** - * @brief Attempts to read the changelog file, returns true on success - * - */ - bool ReadFile(PATHID pathId) - { - std::string _text; - try - { - _text = GetText(pathId); - } - catch (const std::bad_alloc&) - { - LOG_ERROR("Unable to allocate memory for text file"); - return false; - } - catch (const std::exception&) - { - LOG_ERROR("Unable to read text file"); - return false; - } - - ProcessText(_text); - return true; - } - - /** - * @brief Ingests a string of text and splits it into lines for the changelog and updates the longest line width for - * scrolling purposes - * - * @param text - */ - void ProcessText(const std::string& text) - { - std::string::size_type pos = 0; - std::string::size_type prev = 0; - while ((pos = text.find('\n', prev)) != std::string::npos) - { - _changelogLines.push_back(text.substr(prev, pos - prev)); - prev = pos + 1; - } - - // To get the last substring (or only, if delimiter is not found) - _changelogLines.push_back(text.substr(prev)); - - _changelogLongestLineWidth = 0; - for (const auto& line : _changelogLines) - { - int32_t linewidth = GfxGetStringWidth(line.c_str(), FontStyle::Medium); - _changelogLongestLineWidth = std::max(linewidth, _changelogLongestLineWidth); - } - } -}; - -WindowBase* WindowChangelogOpen(int personality) -{ - auto* window = WindowBringToFrontByClass(WindowClass::Changelog); - if (window == nullptr) - { - // Create a new centred window - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - int32_t width = (screenWidth * 4) / 5; - int32_t height = (screenHeight * 4) / 5; - - auto pos = ChangelogWindow::GetCentrePositionForNewWindow(width, height); - auto* newWindow = WindowCreate(WindowClass::Changelog, pos, width, height, WF_RESIZABLE); - newWindow->SetPersonality(personality); - return newWindow; - } - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 4d05f99762..80d4c536bf 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -28,13 +28,13 @@ #include #include -using namespace OpenRCT2; using OpenRCT2::Date; +namespace OpenRCT2::Ui::Windows +{ + constexpr auto CHEATS_MONEY_DEFAULT = 10000.00_GBP; + constexpr auto CHEATS_MONEY_INCREMENT_DIV = 5000.00_GBP; -constexpr auto CHEATS_MONEY_DEFAULT = 10000.00_GBP; -constexpr auto CHEATS_MONEY_INCREMENT_DIV = 5000.00_GBP; - -// clang-format off + // clang-format off enum { WINDOW_CHEATS_PAGE_MONEY, @@ -355,797 +355,807 @@ static StringId window_cheats_page_titles[] = { STR_CHEAT_TITLE_PARK, STR_CHEAT_TITLE_RIDE, }; -// clang-format on + // clang-format on -class CheatsWindow final : public Window -{ -private: - char _moneySpinnerText[MONEY_STRING_MAXLENGTH]{}; - money64 _moneySpinnerValue = CHEATS_MONEY_DEFAULT; - int32_t _parkRatingSpinnerValue{}; - int32_t _yearSpinnerValue = 1; - int32_t _monthSpinnerValue = 1; - int32_t _daySpinnerValue = 1; - -public: - void OnOpen() override + class CheatsWindow final : public Window { - SetPage(WINDOW_CHEATS_PAGE_MONEY); - _parkRatingSpinnerValue = ParkGetForcedRating() >= 0 ? ParkGetForcedRating() : 999; - } + private: + char _moneySpinnerText[MONEY_STRING_MAXLENGTH]{}; + money64 _moneySpinnerValue = CHEATS_MONEY_DEFAULT; + int32_t _parkRatingSpinnerValue{}; + int32_t _yearSpinnerValue = 1; + int32_t _monthSpinnerValue = 1; + int32_t _daySpinnerValue = 1; - void OnUpdate() override - { - frame_no++; - InvalidateWidget(WIDX_TAB_1 + page); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) + public: + void OnOpen() override { - case WINDOW_CHEATS_PAGE_MONEY: - OnMouseDownMoney(widgetIndex); - break; - case WINDOW_CHEATS_PAGE_MISC: - OnMouseDownMisc(widgetIndex); - break; + SetPage(WINDOW_CHEATS_PAGE_MONEY); + _parkRatingSpinnerValue = ParkGetForcedRating() >= 0 ? ParkGetForcedRating() : 999; } - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnUpdate() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - SetPage(widgetIndex - WIDX_TAB_1); - break; - default: - switch (page) + frame_no++; + InvalidateWidget(WIDX_TAB_1 + page); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (page) + { + case WINDOW_CHEATS_PAGE_MONEY: + OnMouseDownMoney(widgetIndex); + break; + case WINDOW_CHEATS_PAGE_MISC: + OnMouseDownMisc(widgetIndex); + break; + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + SetPage(widgetIndex - WIDX_TAB_1); + break; + default: + switch (page) + { + case WINDOW_CHEATS_PAGE_MONEY: + OnMouseUpMoney(widgetIndex); + break; + case WINDOW_CHEATS_PAGE_GUESTS: + OnMouseUpGuests(widgetIndex); + break; + case WINDOW_CHEATS_PAGE_MISC: + OnMouseUpMisc(widgetIndex); + break; + case WINDOW_CHEATS_PAGE_RIDES: + OnMouseUpRides(widgetIndex); + break; + } + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (page == WINDOW_CHEATS_PAGE_MISC) + { + OnDropdownMisc(widgetIndex, selectedIndex); + } + } + + void OnPrepareDraw() override + { + auto* targetWidgets = window_cheats_page_widgets[page]; + if (widgets != targetWidgets) + { + widgets = targetWidgets; + WindowInitScrollWidgets(*this); + } + + pressed_widgets = 0; + disabled_widgets = 0; + + // Set correct active tab + for (auto i = 0; i < WINDOW_CHEATS_PAGE_COUNT; i++) + SetWidgetPressed(WIDX_TAB_1 + i, false); + SetWidgetPressed(WIDX_TAB_1 + page, true); + + // Set title + widgets[WIDX_TITLE].text = window_cheats_page_titles[page]; + + auto& gameState = GetGameState(); + switch (page) + { + case WINDOW_CHEATS_PAGE_MONEY: { - case WINDOW_CHEATS_PAGE_MONEY: - OnMouseUpMoney(widgetIndex); - break; - case WINDOW_CHEATS_PAGE_GUESTS: - OnMouseUpGuests(widgetIndex); - break; - case WINDOW_CHEATS_PAGE_MISC: - OnMouseUpMisc(widgetIndex); - break; - case WINDOW_CHEATS_PAGE_RIDES: - OnMouseUpRides(widgetIndex); - break; + auto moneyDisabled = (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) != 0; + SetCheckboxValue(WIDX_NO_MONEY, moneyDisabled); + SetWidgetDisabled(WIDX_ADD_SET_MONEY_GROUP, moneyDisabled); + SetWidgetDisabled(WIDX_MONEY_SPINNER, moneyDisabled); + SetWidgetDisabled(WIDX_MONEY_SPINNER_INCREMENT, moneyDisabled); + SetWidgetDisabled(WIDX_MONEY_SPINNER_DECREMENT, moneyDisabled); + SetWidgetDisabled(WIDX_ADD_MONEY, moneyDisabled); + SetWidgetDisabled(WIDX_SET_MONEY, moneyDisabled); + SetWidgetDisabled(WIDX_CLEAR_LOAN, moneyDisabled); + break; } - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (page == WINDOW_CHEATS_PAGE_MISC) - { - OnDropdownMisc(widgetIndex, selectedIndex); - } - } - - void OnPrepareDraw() override - { - auto* targetWidgets = window_cheats_page_widgets[page]; - if (widgets != targetWidgets) - { - widgets = targetWidgets; - WindowInitScrollWidgets(*this); - } - - pressed_widgets = 0; - disabled_widgets = 0; - - // Set correct active tab - for (auto i = 0; i < WINDOW_CHEATS_PAGE_COUNT; i++) - SetWidgetPressed(WIDX_TAB_1 + i, false); - SetWidgetPressed(WIDX_TAB_1 + page, true); - - // Set title - widgets[WIDX_TITLE].text = window_cheats_page_titles[page]; - - auto& gameState = GetGameState(); - switch (page) - { - case WINDOW_CHEATS_PAGE_MONEY: - { - auto moneyDisabled = (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) != 0; - SetCheckboxValue(WIDX_NO_MONEY, moneyDisabled); - SetWidgetDisabled(WIDX_ADD_SET_MONEY_GROUP, moneyDisabled); - SetWidgetDisabled(WIDX_MONEY_SPINNER, moneyDisabled); - SetWidgetDisabled(WIDX_MONEY_SPINNER_INCREMENT, moneyDisabled); - SetWidgetDisabled(WIDX_MONEY_SPINNER_DECREMENT, moneyDisabled); - SetWidgetDisabled(WIDX_ADD_MONEY, moneyDisabled); - SetWidgetDisabled(WIDX_SET_MONEY, moneyDisabled); - SetWidgetDisabled(WIDX_CLEAR_LOAN, moneyDisabled); - break; - } - case WINDOW_CHEATS_PAGE_GUESTS: - { - auto ft = Formatter::Common(); - ft.Add(1000.00_GBP); - SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gameState.Cheats.IgnoreRideIntensity); - SetCheckboxValue(WIDX_DISABLE_VANDALISM, gameState.Cheats.DisableVandalism); - SetCheckboxValue(WIDX_DISABLE_LITTERING, gameState.Cheats.DisableLittering); - break; - } - case WINDOW_CHEATS_PAGE_MISC: - widgets[WIDX_OPEN_CLOSE_PARK].text = (gameState.ParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK - : STR_CHEAT_OPEN_PARK; - SetCheckboxValue(WIDX_FORCE_PARK_RATING, ParkGetForcedRating() >= 0); - SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.FreezeWeather); - SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.NeverendingMarketing); - SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.DisablePlantAging); - SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.AllowRegularPathAsQueue); - SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.Cheats.AllowSpecialColourSchemes); - break; - case WINDOW_CHEATS_PAGE_RIDES: - SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gameState.Cheats.UnlockOperatingLimits); - SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gameState.Cheats.DisableBrakesFailure); - SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gameState.Cheats.DisableAllBreakdowns); - SetCheckboxValue(WIDX_BUILD_IN_PAUSE_MODE, gameState.Cheats.BuildInPauseMode); - SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gameState.Cheats.ShowAllOperatingModes); - SetCheckboxValue(WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gameState.Cheats.ShowVehiclesFromOtherTrackTypes); - SetCheckboxValue(WIDX_DISABLE_TRAIN_LENGTH_LIMITS, gameState.Cheats.DisableTrainLengthLimit); - SetCheckboxValue(WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, gameState.Cheats.EnableChainLiftOnAllTrack); - SetCheckboxValue(WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, gameState.Cheats.AllowArbitraryRideTypeChanges); - SetCheckboxValue(WIDX_DISABLE_RIDE_VALUE_AGING, gameState.Cheats.DisableRideValueAging); - SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gameState.Cheats.IgnoreResearchStatus); - SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gameState.Cheats.EnableAllDrawableTrackPieces); - SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.Cheats.AllowTrackPlaceInvalidHeights); - SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.Cheats.MakeAllDestructible); - break; - } - - // Current weather - window_cheats_misc_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.ClimateCurrent.Weather)]; - // Staff speed - window_cheats_misc_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue(gameState.Cheats.SelectedStaffSpeed)]; - - if (gScreenFlags & SCREEN_FLAGS_EDITOR) - { - SetWidgetDisabled(WIDX_TAB_2, true); - SetWidgetDisabled(WIDX_TAB_3, true); - SetWidgetDisabled(WIDX_NO_MONEY, true); - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - UpdateTabPositions(); - DrawWidgets(dpi); - DrawTabImages(dpi); - - static constexpr int16_t _xLcol = 14; - static constexpr int16_t _xRcol = 208; - - if (page == WINDOW_CHEATS_PAGE_MONEY) - { - auto colour = colours[1]; - auto ft = Formatter(); - ft.Add(_moneySpinnerValue); - if (IsWidgetDisabled(WIDX_MONEY_SPINNER)) - { - colour |= COLOUR_FLAG_INSET; - } - int32_t actual_month = _monthSpinnerValue - 1; - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour }); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY); - ft = Formatter(); - ft.Add(_yearSpinnerValue); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); - ft = Formatter(); - ft.Add(actual_month); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT }); - ft = Formatter(); - ft.Add(_daySpinnerValue); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); - } - else if (page == WINDOW_CHEATS_PAGE_MISC) - { - { - auto& widget = widgets[WIDX_WEATHER]; - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER); + case WINDOW_CHEATS_PAGE_GUESTS: + { + auto ft = Formatter::Common(); + ft.Add(1000.00_GBP); + SetCheckboxValue(WIDX_GUEST_IGNORE_RIDE_INTENSITY, gameState.Cheats.IgnoreRideIntensity); + SetCheckboxValue(WIDX_DISABLE_VANDALISM, gameState.Cheats.DisableVandalism); + SetCheckboxValue(WIDX_DISABLE_LITTERING, gameState.Cheats.DisableLittering); + break; + } + case WINDOW_CHEATS_PAGE_MISC: + widgets[WIDX_OPEN_CLOSE_PARK].text = (gameState.ParkFlags & PARK_FLAGS_PARK_OPEN) ? STR_CHEAT_CLOSE_PARK + : STR_CHEAT_OPEN_PARK; + SetCheckboxValue(WIDX_FORCE_PARK_RATING, ParkGetForcedRating() >= 0); + SetCheckboxValue(WIDX_FREEZE_WEATHER, gameState.Cheats.FreezeWeather); + SetCheckboxValue(WIDX_NEVERENDING_MARKETING, gameState.Cheats.NeverendingMarketing); + SetCheckboxValue(WIDX_DISABLE_PLANT_AGING, gameState.Cheats.DisablePlantAging); + SetCheckboxValue(WIDX_ALLOW_REGULAR_PATH_AS_QUEUE, gameState.Cheats.AllowRegularPathAsQueue); + SetCheckboxValue(WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES, gameState.Cheats.AllowSpecialColourSchemes); + break; + case WINDOW_CHEATS_PAGE_RIDES: + SetCheckboxValue(WIDX_UNLOCK_OPERATING_LIMITS, gameState.Cheats.UnlockOperatingLimits); + SetCheckboxValue(WIDX_DISABLE_BRAKES_FAILURE, gameState.Cheats.DisableBrakesFailure); + SetCheckboxValue(WIDX_DISABLE_ALL_BREAKDOWNS, gameState.Cheats.DisableAllBreakdowns); + SetCheckboxValue(WIDX_BUILD_IN_PAUSE_MODE, gameState.Cheats.BuildInPauseMode); + SetCheckboxValue(WIDX_SHOW_ALL_OPERATING_MODES, gameState.Cheats.ShowAllOperatingModes); + SetCheckboxValue( + WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES, gameState.Cheats.ShowVehiclesFromOtherTrackTypes); + SetCheckboxValue(WIDX_DISABLE_TRAIN_LENGTH_LIMITS, gameState.Cheats.DisableTrainLengthLimit); + SetCheckboxValue(WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK, gameState.Cheats.EnableChainLiftOnAllTrack); + SetCheckboxValue(WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES, gameState.Cheats.AllowArbitraryRideTypeChanges); + SetCheckboxValue(WIDX_DISABLE_RIDE_VALUE_AGING, gameState.Cheats.DisableRideValueAging); + SetCheckboxValue(WIDX_IGNORE_RESEARCH_STATUS, gameState.Cheats.IgnoreResearchStatus); + SetCheckboxValue(WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES, gameState.Cheats.EnableAllDrawableTrackPieces); + SetCheckboxValue(WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS, gameState.Cheats.AllowTrackPlaceInvalidHeights); + SetCheckboxValue(WIDX_MAKE_DESTRUCTIBLE, gameState.Cheats.MakeAllDestructible); + break; } + // Current weather + window_cheats_misc_widgets[WIDX_WEATHER].text = WeatherTypes[EnumValue(gameState.ClimateCurrent.Weather)]; + // Staff speed + window_cheats_misc_widgets[WIDX_STAFF_SPEED].text = _staffSpeedNames[EnumValue( + gameState.Cheats.SelectedStaffSpeed)]; + + if (gScreenFlags & SCREEN_FLAGS_EDITOR) { + SetWidgetDisabled(WIDX_TAB_2, true); + SetWidgetDisabled(WIDX_TAB_3, true); + SetWidgetDisabled(WIDX_NO_MONEY, true); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + UpdateTabPositions(); + DrawWidgets(dpi); + DrawTabImages(dpi); + + static constexpr int16_t _xLcol = 14; + static constexpr int16_t _xRcol = 208; + + if (page == WINDOW_CHEATS_PAGE_MONEY) + { + auto colour = colours[1]; auto ft = Formatter(); - ft.Add(_parkRatingSpinnerValue); - - auto& widget = widgets[WIDX_PARK_RATING_SPINNER]; + ft.Add(_moneySpinnerValue); + if (IsWidgetDisabled(WIDX_MONEY_SPINNER)) + { + colour |= COLOUR_FLAG_INSET; + } + int32_t actual_month = _monthSpinnerValue - 1; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_BOTTOM_TOOLBAR_CASH, ft, { colour }); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_YEAR); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_MONTH); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 240 }, STR_DAY); + ft = Formatter(); + ft.Add(_yearSpinnerValue); DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft, { colours[1] }); + dpi, windowPos + ScreenCoordsXY{ _xRcol, 198 }, STR_FORMAT_INTEGER, ft, + { colours[1], TextAlignment::RIGHT }); + ft = Formatter(); + ft.Add(actual_month); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ _xRcol, 219 }, STR_FORMAT_MONTH, ft, { colours[1], TextAlignment::RIGHT }); + ft = Formatter(); + ft.Add(_daySpinnerValue); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ _xRcol, 240 }, STR_FORMAT_INTEGER, ft, + { colours[1], TextAlignment::RIGHT }); } - + else if (page == WINDOW_CHEATS_PAGE_MISC) { - auto& widget = widgets[WIDX_STAFF_SPEED]; - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED); + { + auto& widget = widgets[WIDX_WEATHER]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHANGE_WEATHER); + } + + { + auto ft = Formatter(); + ft.Add(_parkRatingSpinnerValue); + + auto& widget = widgets[WIDX_PARK_RATING_SPINNER]; + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 2 }, STR_FORMAT_INTEGER, ft, + { colours[1] }); + } + + { + auto& widget = widgets[WIDX_STAFF_SPEED]; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol - 3, widget.top + 1 }, STR_CHEAT_STAFF_SPEED); + } + } + else if (page == WINDOW_CHEATS_PAGE_GUESTS) + { + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); } } - else if (page == WINDOW_CHEATS_PAGE_GUESTS) - { - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 72 }, STR_CHEAT_GUEST_HAPPINESS); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 93 }, STR_CHEAT_GUEST_ENERGY); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 114 }, STR_CHEAT_GUEST_HUNGER); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 135 }, STR_CHEAT_GUEST_THIRST); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 156 }, STR_CHEAT_GUEST_NAUSEA); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 177 }, STR_CHEAT_GUEST_NAUSEA_TOLERANCE); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 198 }, STR_CHEAT_GUEST_TOILET); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ _xLcol, 219 }, STR_CHEAT_GUEST_PREFERRED_INTENSITY); - } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (page == WINDOW_CHEATS_PAGE_MONEY && widgetIndex == WIDX_MONEY_SPINNER) + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - auto val = StringToMoney(std::string(text).c_str()); - if (val != kMoney64Undefined) + if (page == WINDOW_CHEATS_PAGE_MONEY && widgetIndex == WIDX_MONEY_SPINNER) { - _moneySpinnerValue = val; + auto val = StringToMoney(std::string(text).c_str()); + if (val != kMoney64Undefined) + { + _moneySpinnerValue = val; + } + Invalidate(); } + } + + OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override + { + if (page == WINDOW_CHEATS_PAGE_RIDES && widgetIndex == WIDX_UNLOCK_OPERATING_LIMITS) + { + auto ft = Formatter{}; + ft.Add(255); + return { fallback, ft }; + } + return { fallback, {} }; + } + + private: + void SetPage(int32_t p) + { + page = p; + frame_no = 0; + + hold_down_widgets = window_cheats_page_hold_down_widgets[p]; + pressed_widgets = 0; + widgets = window_cheats_page_widgets[p]; + + auto maxY = 0; + auto* widget = &widgets[WIDX_TAB_CONTENT]; + while (widget->type != WindowWidgetType::Last) + { + maxY = std::max(maxY, widget->bottom); + widget++; + } + maxY += 6; + + Invalidate(); + height = maxY; + widgets[WIDX_BACKGROUND].bottom = maxY - 1; + widgets[WIDX_PAGE_BACKGROUND].bottom = maxY - 1; Invalidate(); } - } - OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override - { - if (page == WINDOW_CHEATS_PAGE_RIDES && widgetIndex == WIDX_UNLOCK_OPERATING_LIMITS) + void UpdateTabPositions() { - auto ft = Formatter{}; - ft.Add(255); - return { fallback, ft }; - } - return { fallback, {} }; - } + constexpr uint16_t tabs[] = { + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_TAB_4, + }; -private: - void SetPage(int32_t p) - { - page = p; - frame_no = 0; - - hold_down_widgets = window_cheats_page_hold_down_widgets[p]; - pressed_widgets = 0; - widgets = window_cheats_page_widgets[p]; - - auto maxY = 0; - auto* widget = &widgets[WIDX_TAB_CONTENT]; - while (widget->type != WindowWidgetType::Last) - { - maxY = std::max(maxY, widget->bottom); - widget++; - } - maxY += 6; - - Invalidate(); - height = maxY; - widgets[WIDX_BACKGROUND].bottom = maxY - 1; - widgets[WIDX_PAGE_BACKGROUND].bottom = maxY - 1; - Invalidate(); - } - - void UpdateTabPositions() - { - constexpr uint16_t tabs[] = { - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_TAB_4, - }; - - auto left = TAB_START; - for (auto tab : tabs) - { - widgets[tab].left = left; - if (!IsWidgetDisabled(tab)) + auto left = TAB_START; + for (auto tab : tabs) { - left += TAB_WIDTH; + widgets[tab].left = left; + if (!IsWidgetDisabled(tab)) + { + left += TAB_WIDTH; + } } } - } - void DrawTabImages(DrawPixelInfo& dpi) - { - // Money tab - if (!IsWidgetDisabled(WIDX_TAB_1)) + void DrawTabImages(DrawPixelInfo& dpi) { - uint32_t sprite_idx = SPR_TAB_FINANCES_SUMMARY_0; - if (page == WINDOW_CHEATS_PAGE_MONEY) - sprite_idx += (frame_no / 2) % 8; - GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); - } - - // Guests tab - if (!IsWidgetDisabled(WIDX_TAB_2)) - { - uint32_t sprite_idx = SPR_TAB_GUESTS_0; - if (page == WINDOW_CHEATS_PAGE_GUESTS) - sprite_idx += (frame_no / 3) % 8; - GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); - } - - // Misc tab - if (!IsWidgetDisabled(WIDX_TAB_3)) - { - GfxDrawSprite( - dpi, ImageId(SPR_TAB_PARK), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); - } - - // Rides tab - if (!IsWidgetDisabled(WIDX_TAB_4)) - { - uint32_t sprite_idx = SPR_TAB_RIDE_0; - if (page == WINDOW_CHEATS_PAGE_RIDES) - sprite_idx += (frame_no / 4) % 16; - GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); - } - } - - void OnMouseDownMoney(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_MONEY_SPINNER_INCREMENT: - _moneySpinnerValue = AddClamp_money64( - CHEATS_MONEY_INCREMENT_DIV * (_moneySpinnerValue / CHEATS_MONEY_INCREMENT_DIV), CHEATS_MONEY_INCREMENT_DIV); - InvalidateWidget(WIDX_MONEY_SPINNER); - break; - case WIDX_MONEY_SPINNER_DECREMENT: - _moneySpinnerValue = AddClamp_money64( - CHEATS_MONEY_INCREMENT_DIV * (_moneySpinnerValue / CHEATS_MONEY_INCREMENT_DIV), - -CHEATS_MONEY_INCREMENT_DIV); - InvalidateWidget(WIDX_MONEY_SPINNER); - break; - case WIDX_ADD_MONEY: - CheatsSet(CheatType::AddMoney, _moneySpinnerValue); - break; - case WIDX_YEAR_UP: - _yearSpinnerValue++; - _yearSpinnerValue = std::clamp(_yearSpinnerValue, 1, kMaxYear); - InvalidateWidget(WIDX_YEAR_BOX); - break; - case WIDX_YEAR_DOWN: - _yearSpinnerValue--; - _yearSpinnerValue = std::clamp(_yearSpinnerValue, 1, kMaxYear); - InvalidateWidget(WIDX_YEAR_BOX); - break; - case WIDX_MONTH_UP: - _monthSpinnerValue++; - _monthSpinnerValue = std::clamp(_monthSpinnerValue, 1, static_cast(MONTH_COUNT)); - _daySpinnerValue = std::clamp( - _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); - InvalidateWidget(WIDX_MONTH_BOX); - InvalidateWidget(WIDX_DAY_BOX); - break; - case WIDX_MONTH_DOWN: - _monthSpinnerValue--; - _monthSpinnerValue = std::clamp(_monthSpinnerValue, 1, static_cast(MONTH_COUNT)); - _daySpinnerValue = std::clamp( - _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); - InvalidateWidget(WIDX_MONTH_BOX); - InvalidateWidget(WIDX_DAY_BOX); - break; - case WIDX_DAY_UP: - _daySpinnerValue++; - _daySpinnerValue = std::clamp( - _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); - InvalidateWidget(WIDX_DAY_BOX); - break; - case WIDX_DAY_DOWN: - _daySpinnerValue--; - _daySpinnerValue = std::clamp( - _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); - InvalidateWidget(WIDX_DAY_BOX); - break; - case WIDX_DATE_SET: + // Money tab + if (!IsWidgetDisabled(WIDX_TAB_1)) { - auto setDateAction = ParkSetDateAction(_yearSpinnerValue - 1, _monthSpinnerValue - 1, _daySpinnerValue - 1); - GameActions::Execute(&setDateAction); - WindowInvalidateByClass(WindowClass::BottomToolbar); - break; + uint32_t sprite_idx = SPR_TAB_FINANCES_SUMMARY_0; + if (page == WINDOW_CHEATS_PAGE_MONEY) + sprite_idx += (frame_no / 2) % 8; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); } - case WIDX_DATE_RESET: + + // Guests tab + if (!IsWidgetDisabled(WIDX_TAB_2)) { - auto setDateAction = ParkSetDateAction(0, 0, 0); - GameActions::Execute(&setDateAction); - WindowInvalidateByClass(WindowClass::BottomToolbar); - InvalidateWidget(WIDX_YEAR_BOX); - InvalidateWidget(WIDX_MONTH_BOX); - InvalidateWidget(WIDX_DAY_BOX); - break; + uint32_t sprite_idx = SPR_TAB_GUESTS_0; + if (page == WINDOW_CHEATS_PAGE_GUESTS) + sprite_idx += (frame_no / 3) % 8; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); + } + + // Misc tab + if (!IsWidgetDisabled(WIDX_TAB_3)) + { + GfxDrawSprite( + dpi, ImageId(SPR_TAB_PARK), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); + } + + // Rides tab + if (!IsWidgetDisabled(WIDX_TAB_4)) + { + uint32_t sprite_idx = SPR_TAB_RIDE_0; + if (page == WINDOW_CHEATS_PAGE_RIDES) + sprite_idx += (frame_no / 4) % 16; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); } } - } - void OnMouseUpMoney(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void OnMouseDownMoney(WidgetIndex widgetIndex) { - case WIDX_NO_MONEY: - CheatsSet(CheatType::NoMoney, GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY ? 0 : 1); - break; - case WIDX_MONEY_SPINNER: - MoneyToString(_moneySpinnerValue, _moneySpinnerText, MONEY_STRING_MAXLENGTH, false); - WindowTextInputRawOpen( - this, WIDX_MONEY_SPINNER, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneySpinnerText, - MONEY_STRING_MAXLENGTH); - break; - case WIDX_SET_MONEY: - CheatsSet(CheatType::SetMoney, _moneySpinnerValue); - break; - case WIDX_CLEAR_LOAN: - CheatsSet(CheatType::ClearLoan); - break; - } - } - - void OnMouseDownMisc(WidgetIndex widgetIndex) - { - auto* widget = &widgets[widgetIndex]; - auto& gameState = GetGameState(); - switch (widgetIndex) - { - case WIDX_INCREASE_PARK_RATING: - _parkRatingSpinnerValue = std::min(999, 10 * (_parkRatingSpinnerValue / 10 + 1)); - InvalidateWidget(WIDX_PARK_RATING_SPINNER); - if (ParkGetForcedRating() >= 0) - { - auto cheatSetAction = CheatSetAction(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); - GameActions::Execute(&cheatSetAction); - } - break; - case WIDX_DECREASE_PARK_RATING: - _parkRatingSpinnerValue = std::max(0, 10 * (_parkRatingSpinnerValue / 10 - 1)); - InvalidateWidget(WIDX_PARK_RATING_SPINNER); - if (ParkGetForcedRating() >= 0) - { - CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); - } - break; - case WIDX_WEATHER_DROPDOWN_BUTTON: + switch (widgetIndex) { - Widget* dropdownWidget = widget - 1; - - for (size_t i = 0; i < std::size(WeatherTypes); i++) + case WIDX_MONEY_SPINNER_INCREMENT: + _moneySpinnerValue = AddClamp_money64( + CHEATS_MONEY_INCREMENT_DIV * (_moneySpinnerValue / CHEATS_MONEY_INCREMENT_DIV), + CHEATS_MONEY_INCREMENT_DIV); + InvalidateWidget(WIDX_MONEY_SPINNER); + break; + case WIDX_MONEY_SPINNER_DECREMENT: + _moneySpinnerValue = AddClamp_money64( + CHEATS_MONEY_INCREMENT_DIV * (_moneySpinnerValue / CHEATS_MONEY_INCREMENT_DIV), + -CHEATS_MONEY_INCREMENT_DIV); + InvalidateWidget(WIDX_MONEY_SPINNER); + break; + case WIDX_ADD_MONEY: + CheatsSet(CheatType::AddMoney, _moneySpinnerValue); + break; + case WIDX_YEAR_UP: + _yearSpinnerValue++; + _yearSpinnerValue = std::clamp(_yearSpinnerValue, 1, kMaxYear); + InvalidateWidget(WIDX_YEAR_BOX); + break; + case WIDX_YEAR_DOWN: + _yearSpinnerValue--; + _yearSpinnerValue = std::clamp(_yearSpinnerValue, 1, kMaxYear); + InvalidateWidget(WIDX_YEAR_BOX); + break; + case WIDX_MONTH_UP: + _monthSpinnerValue++; + _monthSpinnerValue = std::clamp(_monthSpinnerValue, 1, static_cast(MONTH_COUNT)); + _daySpinnerValue = std::clamp( + _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); + InvalidateWidget(WIDX_MONTH_BOX); + InvalidateWidget(WIDX_DAY_BOX); + break; + case WIDX_MONTH_DOWN: + _monthSpinnerValue--; + _monthSpinnerValue = std::clamp(_monthSpinnerValue, 1, static_cast(MONTH_COUNT)); + _daySpinnerValue = std::clamp( + _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); + InvalidateWidget(WIDX_MONTH_BOX); + InvalidateWidget(WIDX_DAY_BOX); + break; + case WIDX_DAY_UP: + _daySpinnerValue++; + _daySpinnerValue = std::clamp( + _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); + InvalidateWidget(WIDX_DAY_BOX); + break; + case WIDX_DAY_DOWN: + _daySpinnerValue--; + _daySpinnerValue = std::clamp( + _daySpinnerValue, 1, static_cast(Date::GetDaysInMonth(_monthSpinnerValue - 1))); + InvalidateWidget(WIDX_DAY_BOX); + break; + case WIDX_DATE_SET: { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = WeatherTypes[i]; + auto setDateAction = ParkSetDateAction(_yearSpinnerValue - 1, _monthSpinnerValue - 1, _daySpinnerValue - 1); + GameActions::Execute(&setDateAction); + WindowInvalidateByClass(WindowClass::BottomToolbar); + break; } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, std::size(WeatherTypes), dropdownWidget->width() - 3); - - auto currentWeather = gameState.ClimateCurrent.Weather; - Dropdown::SetChecked(EnumValue(currentWeather), true); - } - break; - case WIDX_STAFF_SPEED_DROPDOWN_BUTTON: - { - Widget* dropdownWidget; - - dropdownWidget = widget - 1; - - for (size_t i = 0; i < std::size(_staffSpeedNames); i++) + case WIDX_DATE_RESET: { - gDropdownItems[i].Args = _staffSpeedNames[i]; - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + auto setDateAction = ParkSetDateAction(0, 0, 0); + GameActions::Execute(&setDateAction); + WindowInvalidateByClass(WindowClass::BottomToolbar); + InvalidateWidget(WIDX_YEAR_BOX); + InvalidateWidget(WIDX_MONTH_BOX); + InvalidateWidget(WIDX_DAY_BOX); + break; } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3); - Dropdown::SetChecked(EnumValue(gameState.Cheats.SelectedStaffSpeed), true); } } - } - void OnMouseUpMisc(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void OnMouseUpMoney(WidgetIndex widgetIndex) { - case WIDX_FREEZE_WEATHER: - CheatsSet(CheatType::FreezeWeather, !gameState.Cheats.FreezeWeather); - break; - case WIDX_OPEN_CLOSE_PARK: - CheatsSet(CheatType::OpenClosePark); - break; - case WIDX_CREATE_DUCKS: - CheatsSet(CheatType::CreateDucks, kCheatsDuckIncrement); - break; - case WIDX_REMOVE_DUCKS: - CheatsSet(CheatType::RemoveDucks); - break; - case WIDX_CLEAR_GRASS: - CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_CLEAR_0); - break; - case WIDX_MOWED_GRASS: - CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_MOWED); - break; - case WIDX_WATER_PLANTS: - CheatsSet(CheatType::WaterPlants); - break; - case WIDX_FIX_VANDALISM: - CheatsSet(CheatType::FixVandalism); - break; - case WIDX_REMOVE_LITTER: - CheatsSet(CheatType::RemoveLitter); - break; - case WIDX_DISABLE_PLANT_AGING: - CheatsSet(CheatType::DisablePlantAging, !gameState.Cheats.DisablePlantAging); - break; - case WIDX_WIN_SCENARIO: - CheatsSet(CheatType::WinScenario); - break; - case WIDX_HAVE_FUN: - CheatsSet(CheatType::HaveFun); - break; - case WIDX_OWN_ALL_LAND: - CheatsSet(CheatType::OwnAllLand); - break; - case WIDX_NEVERENDING_MARKETING: - CheatsSet(CheatType::NeverEndingMarketing, !gameState.Cheats.NeverendingMarketing); - break; - case WIDX_FORCE_PARK_RATING: - if (ParkGetForcedRating() >= 0) - { - CheatsSet(CheatType::SetForcedParkRating, -1); - } - else - { - CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); - } - break; - case WIDX_ALLOW_REGULAR_PATH_AS_QUEUE: - CheatsSet(CheatType::AllowRegularPathAsQueue, !gameState.Cheats.AllowRegularPathAsQueue); - break; - case WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES: - CheatsSet(CheatType::AllowSpecialColourSchemes, !gameState.Cheats.AllowSpecialColourSchemes); - break; - } - } - - void OnDropdownMisc(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (dropdownIndex == -1) - { - return; + switch (widgetIndex) + { + case WIDX_NO_MONEY: + CheatsSet(CheatType::NoMoney, GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY ? 0 : 1); + break; + case WIDX_MONEY_SPINNER: + MoneyToString(_moneySpinnerValue, _moneySpinnerText, MONEY_STRING_MAXLENGTH, false); + WindowTextInputRawOpen( + this, WIDX_MONEY_SPINNER, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneySpinnerText, + MONEY_STRING_MAXLENGTH); + break; + case WIDX_SET_MONEY: + CheatsSet(CheatType::SetMoney, _moneySpinnerValue); + break; + case WIDX_CLEAR_LOAN: + CheatsSet(CheatType::ClearLoan); + break; + } } - if (widgetIndex == WIDX_WEATHER_DROPDOWN_BUTTON) + void OnMouseDownMisc(WidgetIndex widgetIndex) { - CheatsSet(CheatType::ForceWeather, dropdownIndex); - } - if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON) - { - int32_t speed = kCheatsStaffNormalSpeed; + auto* widget = &widgets[widgetIndex]; auto& gameState = GetGameState(); - switch (dropdownIndex) + switch (widgetIndex) { - case 0: - gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::None; - speed = kCheatsStaffNormalSpeed; + case WIDX_INCREASE_PARK_RATING: + _parkRatingSpinnerValue = std::min(999, 10 * (_parkRatingSpinnerValue / 10 + 1)); + InvalidateWidget(WIDX_PARK_RATING_SPINNER); + if (ParkGetForcedRating() >= 0) + { + auto cheatSetAction = CheatSetAction(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); + GameActions::Execute(&cheatSetAction); + } break; - - case 1: - gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::Frozen; - speed = kCheatsStaffFreezeSpeed; + case WIDX_DECREASE_PARK_RATING: + _parkRatingSpinnerValue = std::max(0, 10 * (_parkRatingSpinnerValue / 10 - 1)); + InvalidateWidget(WIDX_PARK_RATING_SPINNER); + if (ParkGetForcedRating() >= 0) + { + CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); + } break; + case WIDX_WEATHER_DROPDOWN_BUTTON: + { + Widget* dropdownWidget = widget - 1; - case 2: - gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::Fast; - speed = kCheatsStaffFastSpeed; + for (size_t i = 0; i < std::size(WeatherTypes); i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = WeatherTypes[i]; + } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, std::size(WeatherTypes), dropdownWidget->width() - 3); + + auto currentWeather = gameState.ClimateCurrent.Weather; + Dropdown::SetChecked(EnumValue(currentWeather), true); + } + break; + case WIDX_STAFF_SPEED_DROPDOWN_BUTTON: + { + Widget* dropdownWidget; + + dropdownWidget = widget - 1; + + for (size_t i = 0; i < std::size(_staffSpeedNames); i++) + { + gDropdownItems[i].Args = _staffSpeedNames[i]; + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3); + Dropdown::SetChecked(EnumValue(gameState.Cheats.SelectedStaffSpeed), true); + } } - CheatsSet(CheatType::SetStaffSpeed, speed); } - } - void OnMouseUpGuests(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void OnMouseUpMisc(WidgetIndex widgetIndex) { - case WIDX_GUEST_HAPPINESS_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HAPPINESS, PEEP_MAX_HAPPINESS); - break; - case WIDX_GUEST_HAPPINESS_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HAPPINESS, 0); - break; - case WIDX_GUEST_ENERGY_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, PEEP_MAX_ENERGY); - break; - case WIDX_GUEST_ENERGY_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, PEEP_MIN_ENERGY); - break; - case WIDX_GUEST_HUNGER_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HUNGER, 0); - break; - case WIDX_GUEST_HUNGER_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HUNGER, PEEP_MAX_HUNGER); - break; - case WIDX_GUEST_THIRST_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_THIRST, 0); - break; - case WIDX_GUEST_THIRST_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_THIRST, PEEP_MAX_THIRST); - break; - case WIDX_GUEST_NAUSEA_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA, PEEP_MAX_NAUSEA); - break; - case WIDX_GUEST_NAUSEA_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA, 0); - break; - case WIDX_GUEST_NAUSEA_TOLERANCE_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA_TOLERANCE, EnumValue(PeepNauseaTolerance::High)); - break; - case WIDX_GUEST_NAUSEA_TOLERANCE_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA_TOLERANCE, EnumValue(PeepNauseaTolerance::None)); - break; - case WIDX_GUEST_TOILET_MAX: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_TOILET, PEEP_MAX_TOILET); - break; - case WIDX_GUEST_TOILET_MIN: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_TOILET, 0); - break; - case WIDX_GUEST_RIDE_INTENSITY_MORE_THAN_1: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY, 1); - break; - case WIDX_GUEST_RIDE_INTENSITY_LESS_THAN_15: - CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY, 0); - break; - case WIDX_TRAM_GUESTS: - CheatsSet(CheatType::GenerateGuests, kCheatsTramIncrement); - break; - case WIDX_REMOVE_ALL_GUESTS: - CheatsSet(CheatType::RemoveAllGuests); - break; - case WIDX_GIVE_GUESTS_MONEY: - CheatsSet(CheatType::GiveAllGuests, OBJECT_MONEY); - break; - case WIDX_GIVE_GUESTS_PARK_MAPS: - CheatsSet(CheatType::GiveAllGuests, OBJECT_PARK_MAP); - break; - case WIDX_GIVE_GUESTS_BALLOONS: - CheatsSet(CheatType::GiveAllGuests, OBJECT_BALLOON); - break; - case WIDX_GIVE_GUESTS_UMBRELLAS: - CheatsSet(CheatType::GiveAllGuests, OBJECT_UMBRELLA); - break; - case WIDX_GUEST_IGNORE_RIDE_INTENSITY: - CheatsSet(CheatType::IgnoreRideIntensity, !gameState.Cheats.IgnoreRideIntensity); - break; - case WIDX_DISABLE_VANDALISM: - CheatsSet(CheatType::DisableVandalism, !gameState.Cheats.DisableVandalism); - break; - case WIDX_DISABLE_LITTERING: - CheatsSet(CheatType::DisableLittering, !gameState.Cheats.DisableLittering); - break; + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_FREEZE_WEATHER: + CheatsSet(CheatType::FreezeWeather, !gameState.Cheats.FreezeWeather); + break; + case WIDX_OPEN_CLOSE_PARK: + CheatsSet(CheatType::OpenClosePark); + break; + case WIDX_CREATE_DUCKS: + CheatsSet(CheatType::CreateDucks, kCheatsDuckIncrement); + break; + case WIDX_REMOVE_DUCKS: + CheatsSet(CheatType::RemoveDucks); + break; + case WIDX_CLEAR_GRASS: + CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_CLEAR_0); + break; + case WIDX_MOWED_GRASS: + CheatsSet(CheatType::SetGrassLength, GRASS_LENGTH_MOWED); + break; + case WIDX_WATER_PLANTS: + CheatsSet(CheatType::WaterPlants); + break; + case WIDX_FIX_VANDALISM: + CheatsSet(CheatType::FixVandalism); + break; + case WIDX_REMOVE_LITTER: + CheatsSet(CheatType::RemoveLitter); + break; + case WIDX_DISABLE_PLANT_AGING: + CheatsSet(CheatType::DisablePlantAging, !gameState.Cheats.DisablePlantAging); + break; + case WIDX_WIN_SCENARIO: + CheatsSet(CheatType::WinScenario); + break; + case WIDX_HAVE_FUN: + CheatsSet(CheatType::HaveFun); + break; + case WIDX_OWN_ALL_LAND: + CheatsSet(CheatType::OwnAllLand); + break; + case WIDX_NEVERENDING_MARKETING: + CheatsSet(CheatType::NeverEndingMarketing, !gameState.Cheats.NeverendingMarketing); + break; + case WIDX_FORCE_PARK_RATING: + if (ParkGetForcedRating() >= 0) + { + CheatsSet(CheatType::SetForcedParkRating, -1); + } + else + { + CheatsSet(CheatType::SetForcedParkRating, _parkRatingSpinnerValue); + } + break; + case WIDX_ALLOW_REGULAR_PATH_AS_QUEUE: + CheatsSet(CheatType::AllowRegularPathAsQueue, !gameState.Cheats.AllowRegularPathAsQueue); + break; + case WIDX_ALLOW_SPECIAL_COLOUR_SCHEMES: + CheatsSet(CheatType::AllowSpecialColourSchemes, !gameState.Cheats.AllowSpecialColourSchemes); + break; + } } - } - void OnMouseUpRides(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void OnDropdownMisc(WidgetIndex widgetIndex, int32_t dropdownIndex) { - case WIDX_RENEW_RIDES: - CheatsSet(CheatType::RenewRides); - break; - case WIDX_MAKE_DESTRUCTIBLE: - CheatsSet(CheatType::MakeDestructible, !gameState.Cheats.MakeAllDestructible); - break; - case WIDX_FIX_ALL: - CheatsSet(CheatType::FixRides); - break; - case WIDX_UNLOCK_OPERATING_LIMITS: - CheatsSet(CheatType::FastLiftHill, !gameState.Cheats.UnlockOperatingLimits); - break; - case WIDX_DISABLE_BRAKES_FAILURE: - CheatsSet(CheatType::DisableBrakesFailure, !gameState.Cheats.DisableBrakesFailure); - break; - case WIDX_DISABLE_ALL_BREAKDOWNS: - CheatsSet(CheatType::DisableAllBreakdowns, !gameState.Cheats.DisableAllBreakdowns); - break; - case WIDX_BUILD_IN_PAUSE_MODE: - CheatsSet(CheatType::BuildInPauseMode, !gameState.Cheats.BuildInPauseMode); - break; - case WIDX_RESET_CRASH_STATUS: - CheatsSet(CheatType::ResetCrashStatus); - break; - case WIDX_10_MINUTE_INSPECTIONS: - CheatsSet(CheatType::TenMinuteInspections); - break; - case WIDX_SHOW_ALL_OPERATING_MODES: + if (dropdownIndex == -1) { - if (!gameState.Cheats.ShowAllOperatingModes) - { - ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); - } - CheatsSet(CheatType::ShowAllOperatingModes, !gameState.Cheats.ShowAllOperatingModes); + return; } - break; - case WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES: + + if (widgetIndex == WIDX_WEATHER_DROPDOWN_BUTTON) { - if (!gameState.Cheats.ShowVehiclesFromOtherTrackTypes) - { - ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); - } - CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gameState.Cheats.ShowVehiclesFromOtherTrackTypes); + CheatsSet(CheatType::ForceWeather, dropdownIndex); } - break; - case WIDX_DISABLE_TRAIN_LENGTH_LIMITS: + if (widgetIndex == WIDX_STAFF_SPEED_DROPDOWN_BUTTON) { - if (!gameState.Cheats.DisableTrainLengthLimit) + int32_t speed = kCheatsStaffNormalSpeed; + auto& gameState = GetGameState(); + switch (dropdownIndex) { - ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + case 0: + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::None; + speed = kCheatsStaffNormalSpeed; + break; + + case 1: + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::Frozen; + speed = kCheatsStaffFreezeSpeed; + break; + + case 2: + gameState.Cheats.SelectedStaffSpeed = StaffSpeedCheat::Fast; + speed = kCheatsStaffFastSpeed; } - CheatsSet(CheatType::DisableTrainLengthLimit, !gameState.Cheats.DisableTrainLengthLimit); + CheatsSet(CheatType::SetStaffSpeed, speed); } - break; - case WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK: - CheatsSet(CheatType::EnableChainLiftOnAllTrack, !gameState.Cheats.EnableChainLiftOnAllTrack); - break; - case WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES: - { - if (!gameState.Cheats.AllowArbitraryRideTypeChanges) - { - ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); - } - CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gameState.Cheats.AllowArbitraryRideTypeChanges); - } - break; - case WIDX_DISABLE_RIDE_VALUE_AGING: - CheatsSet(CheatType::DisableRideValueAging, !gameState.Cheats.DisableRideValueAging); - break; - case WIDX_IGNORE_RESEARCH_STATUS: - CheatsSet(CheatType::IgnoreResearchStatus, !gameState.Cheats.IgnoreResearchStatus); - break; - case WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES: - CheatsSet(CheatType::EnableAllDrawableTrackPieces, !gameState.Cheats.EnableAllDrawableTrackPieces); - break; - case WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS: - { - if (!gameState.Cheats.AllowTrackPlaceInvalidHeights) - { - ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); - } - CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gameState.Cheats.AllowTrackPlaceInvalidHeights); - } - break; } - } - void OnResize() override - { - ResizeFrameWithPage(); - } -}; + void OnMouseUpGuests(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_GUEST_HAPPINESS_MAX: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HAPPINESS, PEEP_MAX_HAPPINESS); + break; + case WIDX_GUEST_HAPPINESS_MIN: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HAPPINESS, 0); + break; + case WIDX_GUEST_ENERGY_MAX: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, PEEP_MAX_ENERGY); + break; + case WIDX_GUEST_ENERGY_MIN: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_ENERGY, PEEP_MIN_ENERGY); + break; + case WIDX_GUEST_HUNGER_MAX: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HUNGER, 0); + break; + case WIDX_GUEST_HUNGER_MIN: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_HUNGER, PEEP_MAX_HUNGER); + break; + case WIDX_GUEST_THIRST_MAX: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_THIRST, 0); + break; + case WIDX_GUEST_THIRST_MIN: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_THIRST, PEEP_MAX_THIRST); + break; + case WIDX_GUEST_NAUSEA_MAX: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA, PEEP_MAX_NAUSEA); + break; + case WIDX_GUEST_NAUSEA_MIN: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA, 0); + break; + case WIDX_GUEST_NAUSEA_TOLERANCE_MAX: + CheatsSet( + CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA_TOLERANCE, EnumValue(PeepNauseaTolerance::High)); + break; + case WIDX_GUEST_NAUSEA_TOLERANCE_MIN: + CheatsSet( + CheatType::SetGuestParameter, GUEST_PARAMETER_NAUSEA_TOLERANCE, EnumValue(PeepNauseaTolerance::None)); + break; + case WIDX_GUEST_TOILET_MAX: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_TOILET, PEEP_MAX_TOILET); + break; + case WIDX_GUEST_TOILET_MIN: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_TOILET, 0); + break; + case WIDX_GUEST_RIDE_INTENSITY_MORE_THAN_1: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY, 1); + break; + case WIDX_GUEST_RIDE_INTENSITY_LESS_THAN_15: + CheatsSet(CheatType::SetGuestParameter, GUEST_PARAMETER_PREFERRED_RIDE_INTENSITY, 0); + break; + case WIDX_TRAM_GUESTS: + CheatsSet(CheatType::GenerateGuests, kCheatsTramIncrement); + break; + case WIDX_REMOVE_ALL_GUESTS: + CheatsSet(CheatType::RemoveAllGuests); + break; + case WIDX_GIVE_GUESTS_MONEY: + CheatsSet(CheatType::GiveAllGuests, OBJECT_MONEY); + break; + case WIDX_GIVE_GUESTS_PARK_MAPS: + CheatsSet(CheatType::GiveAllGuests, OBJECT_PARK_MAP); + break; + case WIDX_GIVE_GUESTS_BALLOONS: + CheatsSet(CheatType::GiveAllGuests, OBJECT_BALLOON); + break; + case WIDX_GIVE_GUESTS_UMBRELLAS: + CheatsSet(CheatType::GiveAllGuests, OBJECT_UMBRELLA); + break; + case WIDX_GUEST_IGNORE_RIDE_INTENSITY: + CheatsSet(CheatType::IgnoreRideIntensity, !gameState.Cheats.IgnoreRideIntensity); + break; + case WIDX_DISABLE_VANDALISM: + CheatsSet(CheatType::DisableVandalism, !gameState.Cheats.DisableVandalism); + break; + case WIDX_DISABLE_LITTERING: + CheatsSet(CheatType::DisableLittering, !gameState.Cheats.DisableLittering); + break; + } + } -WindowBase* WindowCheatsOpen() -{ - auto* window = WindowBringToFrontByClass(WindowClass::Cheats); - if (window == nullptr) + void OnMouseUpRides(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_RENEW_RIDES: + CheatsSet(CheatType::RenewRides); + break; + case WIDX_MAKE_DESTRUCTIBLE: + CheatsSet(CheatType::MakeDestructible, !gameState.Cheats.MakeAllDestructible); + break; + case WIDX_FIX_ALL: + CheatsSet(CheatType::FixRides); + break; + case WIDX_UNLOCK_OPERATING_LIMITS: + CheatsSet(CheatType::FastLiftHill, !gameState.Cheats.UnlockOperatingLimits); + break; + case WIDX_DISABLE_BRAKES_FAILURE: + CheatsSet(CheatType::DisableBrakesFailure, !gameState.Cheats.DisableBrakesFailure); + break; + case WIDX_DISABLE_ALL_BREAKDOWNS: + CheatsSet(CheatType::DisableAllBreakdowns, !gameState.Cheats.DisableAllBreakdowns); + break; + case WIDX_BUILD_IN_PAUSE_MODE: + CheatsSet(CheatType::BuildInPauseMode, !gameState.Cheats.BuildInPauseMode); + break; + case WIDX_RESET_CRASH_STATUS: + CheatsSet(CheatType::ResetCrashStatus); + break; + case WIDX_10_MINUTE_INSPECTIONS: + CheatsSet(CheatType::TenMinuteInspections); + break; + case WIDX_SHOW_ALL_OPERATING_MODES: + { + if (!gameState.Cheats.ShowAllOperatingModes) + { + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + } + CheatsSet(CheatType::ShowAllOperatingModes, !gameState.Cheats.ShowAllOperatingModes); + } + break; + case WIDX_SHOW_VEHICLES_FROM_OTHER_TRACK_TYPES: + { + if (!gameState.Cheats.ShowVehiclesFromOtherTrackTypes) + { + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + } + CheatsSet(CheatType::ShowVehiclesFromOtherTrackTypes, !gameState.Cheats.ShowVehiclesFromOtherTrackTypes); + } + break; + case WIDX_DISABLE_TRAIN_LENGTH_LIMITS: + { + if (!gameState.Cheats.DisableTrainLengthLimit) + { + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + } + CheatsSet(CheatType::DisableTrainLengthLimit, !gameState.Cheats.DisableTrainLengthLimit); + } + break; + case WIDX_ENABLE_CHAIN_LIFT_ON_ALL_TRACK: + CheatsSet(CheatType::EnableChainLiftOnAllTrack, !gameState.Cheats.EnableChainLiftOnAllTrack); + break; + case WIDX_ENABLE_ARBITRARY_RIDE_TYPE_CHANGES: + { + if (!gameState.Cheats.AllowArbitraryRideTypeChanges) + { + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + } + CheatsSet(CheatType::AllowArbitraryRideTypeChanges, !gameState.Cheats.AllowArbitraryRideTypeChanges); + } + break; + case WIDX_DISABLE_RIDE_VALUE_AGING: + CheatsSet(CheatType::DisableRideValueAging, !gameState.Cheats.DisableRideValueAging); + break; + case WIDX_IGNORE_RESEARCH_STATUS: + CheatsSet(CheatType::IgnoreResearchStatus, !gameState.Cheats.IgnoreResearchStatus); + break; + case WIDX_ENABLE_ALL_DRAWABLE_TRACK_PIECES: + CheatsSet(CheatType::EnableAllDrawableTrackPieces, !gameState.Cheats.EnableAllDrawableTrackPieces); + break; + case WIDX_ALLOW_TRACK_PLACE_INVALID_HEIGHTS: + { + if (!gameState.Cheats.AllowTrackPlaceInvalidHeights) + { + ContextShowError(STR_WARNING_IN_CAPS, STR_THIS_FEATURE_IS_CURRENTLY_UNSTABLE, {}); + } + CheatsSet(CheatType::AllowTrackPlaceInvalidHeights, !gameState.Cheats.AllowTrackPlaceInvalidHeights); + } + break; + } + } + + void OnResize() override + { + ResizeFrameWithPage(); + } + }; + + WindowBase* WindowCheatsOpen() { - window = WindowCreate(WindowClass::Cheats, ScreenCoordsXY(32, 32), WW, WH); + auto* window = WindowBringToFrontByClass(WindowClass::Cheats); + if (window == nullptr) + { + window = WindowCreate(WindowClass::Cheats, ScreenCoordsXY(32, 32), WW, WH); + } + return window; } - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 0eff932f74..9909bda483 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -18,205 +18,208 @@ #include #include -using namespace OpenRCT2; - -enum WindowClearSceneryWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PREVIEW, - WIDX_DECREMENT, - WIDX_INCREMENT, - WIDX_SMALL_SCENERY, - WIDX_LARGE_SCENERY, - WIDX_FOOTPATH -}; -// clang-format on -static constexpr StringId WINDOW_TITLE = STR_CLEAR_SCENERY; -static constexpr int32_t WW = 98; -static constexpr int32_t WH = 94; - -static constexpr ScreenSize CLEAR_SCENERY_BUTTON = { 24, 24 }; - -static Widget window_clear_scenery_widgets[] = { - WINDOW_SHIM(WINDOW_TITLE, WW, WH), - MakeWidget( - { 27, 17 }, { 44, 32 }, WindowWidgetType::ImgBtn, WindowColour::Primary, SPR_LAND_TOOL_SIZE_0, STR_NONE), // preview box - MakeRemapWidget( - { 28, 18 }, { 16, 16 }, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_DECREASE, - STR_ADJUST_SMALLER_LAND_TIP), // decrement size - MakeRemapWidget( - { 54, 32 }, { 16, 16 }, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_INCREASE, - STR_ADJUST_LARGER_LAND_TIP), // increment size - MakeRemapWidget( - { 7, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_TREES, - STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery - MakeRemapWidget( - { 37, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_LARGE_SCENERY, - STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery - MakeRemapWidget( - { 67, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_FOOTPATH, - STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP), // footpaths - kWidgetsEnd, -}; - -class CleanSceneryWindow final : public Window -{ -public: - void OnOpen() override + enum WindowClearSceneryWidgetIdx { - widgets = window_clear_scenery_widgets; - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); - WindowInitScrollWidgets(*this); - WindowPushOthersBelow(*this); + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PREVIEW, + WIDX_DECREMENT, + WIDX_INCREMENT, + WIDX_SMALL_SCENERY, + WIDX_LARGE_SCENERY, + WIDX_FOOTPATH + }; + // clang-format on + static constexpr StringId WINDOW_TITLE = STR_CLEAR_SCENERY; + static constexpr int32_t WW = 98; + static constexpr int32_t WH = 94; - gLandToolSize = 2; - gClearSceneryCost = kMoney64Undefined; + static constexpr ScreenSize CLEAR_SCENERY_BUTTON = { 24, 24 }; - gClearSmallScenery = true; - gClearLargeScenery = false; - gClearFootpath = false; + static Widget window_clear_scenery_widgets[] = { + WINDOW_SHIM(WINDOW_TITLE, WW, WH), + MakeWidget( + { 27, 17 }, { 44, 32 }, WindowWidgetType::ImgBtn, WindowColour::Primary, SPR_LAND_TOOL_SIZE_0, + STR_NONE), // preview box + MakeRemapWidget( + { 28, 18 }, { 16, 16 }, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_DECREASE, + STR_ADJUST_SMALLER_LAND_TIP), // decrement size + MakeRemapWidget( + { 54, 32 }, { 16, 16 }, WindowWidgetType::TrnBtn, WindowColour::Secondary, SPR_LAND_TOOL_INCREASE, + STR_ADJUST_LARGER_LAND_TIP), // increment size + MakeRemapWidget( + { 7, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_TREES, + STR_CLEAR_SCENERY_REMOVE_SMALL_SCENERY_TIP), // small scenery + MakeRemapWidget( + { 37, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_LARGE_SCENERY, + STR_CLEAR_SCENERY_REMOVE_LARGE_SCENERY_TIP), // large scenery + MakeRemapWidget( + { 67, 53 }, CLEAR_SCENERY_BUTTON, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_BUTTON_FOOTPATH, + STR_CLEAR_SCENERY_REMOVE_FOOTPATHS_TIP), // footpaths + kWidgetsEnd, + }; - Invalidate(); - } - - void OnClose() override + class CleanSceneryWindow final : public Window { - if (ClearSceneryToolIsActive()) - ToolCancel(); - } - - void OnMouseUp(const WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_PREVIEW: - { - Formatter ft; - ft.Add(kLandToolMinimumSize); - ft.Add(kLandToolMaximumSize); - TextInputOpen(WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); - break; - } - case WIDX_SMALL_SCENERY: - gClearSmallScenery ^= 1; - Invalidate(); - break; - case WIDX_LARGE_SCENERY: - gClearLargeScenery ^= 1; - Invalidate(); - break; - case WIDX_FOOTPATH: - gClearFootpath ^= 1; - Invalidate(); - break; - } - } + widgets = window_clear_scenery_widgets; + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + WindowInitScrollWidgets(*this); + WindowPushOthersBelow(*this); - void OnMouseDown(const WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_DECREMENT: - // Decrement land tool size, if it stays within the limit - gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); + gLandToolSize = 2; + gClearSceneryCost = kMoney64Undefined; - // Invalidate the window - Invalidate(); - break; - case WIDX_INCREMENT: - // Increment land tool size, if it stays within the limit - gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); + gClearSmallScenery = true; + gClearLargeScenery = false; + gClearFootpath = false; - // Invalidate the window - Invalidate(); - break; - } - } - - void OnTextInput(const WidgetIndex widgetIndex, const std::string_view text) override - { - if (widgetIndex != WIDX_PREVIEW || text.empty()) - return; - - try - { - int32_t size = std::stol(std::string(text)); - size = std::clamp(size, kLandToolMinimumSize, kLandToolMaximumSize); - gLandToolSize = size; Invalidate(); } - catch (const std::logic_error&) + + void OnClose() override { - // std::stol can throw std::out_of_range or std::invalid_argument - } - } - - void OnUpdate() override - { - frame_no++; - // Close window if another tool is open - if (!ClearSceneryToolIsActive()) - Close(); - } - - void Invalidate() - { - // Set the preview image button to be pressed down - pressed_widgets = (1uLL << WIDX_PREVIEW) | (gClearSmallScenery ? (1uLL << WIDX_SMALL_SCENERY) : 0) - | (gClearLargeScenery ? (1uLL << WIDX_LARGE_SCENERY) : 0) | (gClearFootpath ? (1uLL << WIDX_FOOTPATH) : 0); - - // Update the preview image (for tool sizes up to 7) - window_clear_scenery_widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - // Draw number for tool sizes bigger than 7 - ScreenCoordsXY screenCoords = { windowPos.x + window_clear_scenery_widgets[WIDX_PREVIEW].midX(), - windowPos.y + window_clear_scenery_widgets[WIDX_PREVIEW].midY() }; - if (gLandToolSize > kLandToolMaximumSizeWithSprite) - { - auto ft = Formatter(); - ft.Add(gLandToolSize); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + if (ClearSceneryToolIsActive()) + ToolCancel(); } - // Draw cost amount - if (gClearSceneryCost != kMoney64Undefined && gClearSceneryCost != 0 - && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + void OnMouseUp(const WidgetIndex widgetIndex) override { - auto ft = Formatter(); - ft.Add(gClearSceneryCost); - screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + windowPos.x; - screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 27; - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_PREVIEW: + { + Formatter ft; + ft.Add(kLandToolMinimumSize); + ft.Add(kLandToolMaximumSize); + TextInputOpen(WIDX_PREVIEW, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + break; + } + case WIDX_SMALL_SCENERY: + gClearSmallScenery ^= 1; + Invalidate(); + break; + case WIDX_LARGE_SCENERY: + gClearLargeScenery ^= 1; + Invalidate(); + break; + case WIDX_FOOTPATH: + gClearFootpath ^= 1; + Invalidate(); + break; + } } - } - void OnResize() override + void OnMouseDown(const WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_DECREMENT: + // Decrement land tool size, if it stays within the limit + gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); + + // Invalidate the window + Invalidate(); + break; + case WIDX_INCREMENT: + // Increment land tool size, if it stays within the limit + gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); + + // Invalidate the window + Invalidate(); + break; + } + } + + void OnTextInput(const WidgetIndex widgetIndex, const std::string_view text) override + { + if (widgetIndex != WIDX_PREVIEW || text.empty()) + return; + + try + { + int32_t size = std::stol(std::string(text)); + size = std::clamp(size, kLandToolMinimumSize, kLandToolMaximumSize); + gLandToolSize = size; + Invalidate(); + } + catch (const std::logic_error&) + { + // std::stol can throw std::out_of_range or std::invalid_argument + } + } + + void OnUpdate() override + { + frame_no++; + // Close window if another tool is open + if (!ClearSceneryToolIsActive()) + Close(); + } + + void Invalidate() + { + // Set the preview image button to be pressed down + pressed_widgets = (1uLL << WIDX_PREVIEW) | (gClearSmallScenery ? (1uLL << WIDX_SMALL_SCENERY) : 0) + | (gClearLargeScenery ? (1uLL << WIDX_LARGE_SCENERY) : 0) | (gClearFootpath ? (1uLL << WIDX_FOOTPATH) : 0); + + // Update the preview image (for tool sizes up to 7) + window_clear_scenery_widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + // Draw number for tool sizes bigger than 7 + ScreenCoordsXY screenCoords = { windowPos.x + window_clear_scenery_widgets[WIDX_PREVIEW].midX(), + windowPos.y + window_clear_scenery_widgets[WIDX_PREVIEW].midY() }; + if (gLandToolSize > kLandToolMaximumSizeWithSprite) + { + auto ft = Formatter(); + ft.Add(gLandToolSize); + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + + // Draw cost amount + if (gClearSceneryCost != kMoney64Undefined && gClearSceneryCost != 0 + && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(gClearSceneryCost); + screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + windowPos.x; + screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 27; + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowClearSceneryOpen() { - ResizeFrame(); + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::ClearScenery)); + + if (w != nullptr) + return w; + + w = WindowCreate(WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + + if (w != nullptr) + return w; + + return nullptr; } -}; - -WindowBase* WindowClearSceneryOpen() -{ - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::ClearScenery)); - - if (w != nullptr) - return w; - - w = WindowCreate(WindowClass::ClearScenery, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); - - if (w != nullptr) - return w; - - return nullptr; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index a7a03f73a1..6f58f25074 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -18,11 +18,13 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE; -static constexpr int32_t WH = 100; -static constexpr int32_t WW = 400; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_CUSTOM_CURRENCY_WINDOW_TITLE; + static constexpr int32_t WH = 100; + static constexpr int32_t WW = 400; -// clang-format off + // clang-format off enum WindowCustomCurrencyWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -44,188 +46,190 @@ static Widget window_custom_currency_widgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class CustomCurrencyWindow final : public Window -{ -public: - void OnOpen() override + class CustomCurrencyWindow final : public Window { - widgets = window_custom_currency_widgets; - hold_down_widgets = (1uLL << WIDX_RATE_UP) | (1uLL << WIDX_RATE_DOWN); - WindowInitScrollWidgets(*this); - colours[0] = COLOUR_LIGHT_BROWN; - colours[1] = COLOUR_LIGHT_BROWN; - colours[2] = COLOUR_LIGHT_BROWN; - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - auto* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_RATE_UP: - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1; - gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; - ConfigSaveDefault(); - WindowInvalidateAll(); - break; - case WIDX_RATE_DOWN: - if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1) - { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1; + widgets = window_custom_currency_widgets; + hold_down_widgets = (1uLL << WIDX_RATE_UP) | (1uLL << WIDX_RATE_DOWN); + WindowInitScrollWidgets(*this); + colours[0] = COLOUR_LIGHT_BROWN; + colours[1] = COLOUR_LIGHT_BROWN; + colours[2] = COLOUR_LIGHT_BROWN; + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + auto* widget = &widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_RATE_UP: + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate += 1; gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; ConfigSaveDefault(); WindowInvalidateAll(); - } - break; - case WIDX_AFFIX_DROPDOWN_BUTTON: - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_PREFIX; + break; + case WIDX_RATE_DOWN: + if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate > 1) + { + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate -= 1; + gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + ConfigSaveDefault(); + WindowInvalidateAll(); + } + break; + case WIDX_AFFIX_DROPDOWN_BUTTON: + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_PREFIX; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Args = STR_SUFFIX; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Args = STR_SUFFIX; - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, 2, widget->width() - 3); + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, 2, widget->width() - 3); - if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) - { - Dropdown::SetChecked(0, true); - } - else - { - Dropdown::SetChecked(1, true); - } + if (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) + { + Dropdown::SetChecked(0, true); + } + else + { + Dropdown::SetChecked(1, true); + } - break; - case WIDX_SYMBOL_TEXT: - WindowTextInputRawOpen( - this, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC, {}, - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, CURRENCY_SYMBOL_MAX_SIZE); - break; - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_RATE: - WindowTextInputOpen( - this, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, {}, STR_FORMAT_INTEGER, - static_cast(CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate), - CURRENCY_RATE_MAX_NUM_DIGITS); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - return; - - if (widgetIndex == WIDX_AFFIX_DROPDOWN_BUTTON) - { - if (dropdownIndex == 0) - { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Prefix; - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Prefix; + break; + case WIDX_SYMBOL_TEXT: + WindowTextInputRawOpen( + this, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC, + {}, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, CURRENCY_SYMBOL_MAX_SIZE); + break; } - else if (dropdownIndex == 1) - { - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Suffix; - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Suffix; - } - - gConfigGeneral.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode; - ConfigSaveDefault(); - - WindowInvalidateAll(); } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - int32_t rate; - - switch (widgetIndex) + void OnMouseUp(WidgetIndex widgetIndex) override { - case WIDX_SYMBOL_TEXT: - SafeStrCpy( - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, std::string(text).c_str(), - CURRENCY_SYMBOL_MAX_SIZE); + switch (widgetIndex) + { + case WIDX_RATE: + WindowTextInputOpen( + this, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, {}, STR_FORMAT_INTEGER, + static_cast(CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate), + CURRENCY_RATE_MAX_NUM_DIGITS); + break; + } + } - gConfigGeneral.CustomCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode; + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (dropdownIndex == -1) + return; + if (widgetIndex == WIDX_AFFIX_DROPDOWN_BUTTON) + { + if (dropdownIndex == 0) + { + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Prefix; + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Prefix; + } + else if (dropdownIndex == 1) + { + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_ascii = CurrencyAffix::Suffix; + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode = CurrencyAffix::Suffix; + } + + gConfigGeneral.CustomCurrencyAffix = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode; ConfigSaveDefault(); - WindowInvalidateAll(); - break; - case WIDX_RATE: - const auto res = String::Parse(text); - if (res.has_value()) - { - rate = res.value(); - CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate; - gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + WindowInvalidateAll(); + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (text.empty()) + return; + + int32_t rate; + + switch (widgetIndex) + { + case WIDX_SYMBOL_TEXT: + SafeStrCpy( + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, std::string(text).c_str(), + CURRENCY_SYMBOL_MAX_SIZE); + + gConfigGeneral.CustomCurrencySymbol = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode; + ConfigSaveDefault(); WindowInvalidateAll(); - } - break; + break; + + case WIDX_RATE: + const auto res = String::Parse(text); + if (res.has_value()) + { + rate = res.value(); + CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate = rate; + gConfigGeneral.CustomCurrencyRate = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate; + ConfigSaveDefault(); + WindowInvalidateAll(); + } + break; + } } - } - void OnDraw(DrawPixelInfo& dpi) override + void OnDraw(DrawPixelInfo& dpi) override + { + auto ft = Formatter::Common(); + ft.Add(10.00_GBP); + + DrawWidgets(dpi); + + auto screenCoords = windowPos + ScreenCoordsXY{ 10, 30 }; + + DrawTextBasic(dpi, screenCoords, STR_RATE, {}, { colours[1] }); + + int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::Pounds)].rate; + ft = Formatter(); + ft.Add(baseExchange); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] }); + + screenCoords.y += 20; + + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_SYMBOL_TEXT, {}, { colours[1] }); + + screenCoords = windowPos + + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1, + window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top }; + + GfxDrawString( + dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] }); + + auto drawPos = windowPos + + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1, + window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top }; + StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) + ? STR_PREFIX + : STR_SUFFIX; + DrawTextBasic(dpi, drawPos, stringId, {}, { colours[1] }); + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* CustomCurrencyWindowOpen() { - auto ft = Formatter::Common(); - ft.Add(10.00_GBP); - - DrawWidgets(dpi); - - auto screenCoords = windowPos + ScreenCoordsXY{ 10, 30 }; - - DrawTextBasic(dpi, screenCoords, STR_RATE, {}, { colours[1] }); - - int32_t baseExchange = CurrencyDescriptors[EnumValue(CurrencyType::Pounds)].rate; - ft = Formatter(); - ft.Add(baseExchange); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 200, 0 }, STR_CUSTOM_CURRENCY_EQUIVALENCY, ft, { colours[1] }); - - screenCoords.y += 20; - - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_SYMBOL_TEXT, {}, { colours[1] }); - - screenCoords = windowPos - + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_SYMBOL_TEXT].left + 1, - window_custom_currency_widgets[WIDX_SYMBOL_TEXT].top }; - - GfxDrawString(dpi, screenCoords, CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, { colours[1] }); - - auto drawPos = windowPos - + ScreenCoordsXY{ window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].left + 1, - window_custom_currency_widgets[WIDX_AFFIX_DROPDOWN].top }; - StringId stringId = (CurrencyDescriptors[EnumValue(CurrencyType::Custom)].affix_unicode == CurrencyAffix::Prefix) - ? STR_PREFIX - : STR_SUFFIX; - DrawTextBasic(dpi, drawPos, stringId, {}, { colours[1] }); + return WindowFocusOrCreate(WindowClass::CustomCurrencyConfig, WW, WH, WF_CENTRE_SCREEN); } - - void OnResize() override - { - ResizeFrame(); - } -}; - -WindowBase* CustomCurrencyWindowOpen() -{ - return WindowFocusOrCreate(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 d7b6434325..383df00ee1 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -19,7 +19,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowDebugPaintWidgetIdx { WIDX_BACKGROUND, @@ -42,112 +44,114 @@ static Widget window_debug_paint_widgets[] = { MakeWidget({8, 8 + 15 * 4}, { 185, 12}, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_DEBUG_PAINT_SHOW_DIRTY_VISUALS ), kWidgetsEnd, }; -// clang-format on + // clang-format on -class DebugPaintWindow final : public Window -{ -private: - int32_t ResizeLanguage = LANGUAGE_UNDEFINED; - -public: - void OnOpen() override + class DebugPaintWindow final : public Window { - widgets = window_debug_paint_widgets; + private: + int32_t ResizeLanguage = LANGUAGE_UNDEFINED; - InitScrollWidgets(); - WindowPushOthersBelow(*this); - - colours[0] = TRANSLUCENT(COLOUR_BLACK); - colours[1] = COLOUR_GREY; - - ResizeLanguage = LANGUAGE_UNDEFINED; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_TOGGLE_SHOW_WIDE_PATHS: - gPaintWidePathsAsGhost = !gPaintWidePathsAsGhost; - GfxInvalidateScreen(); - break; + widgets = window_debug_paint_widgets; - case WIDX_TOGGLE_SHOW_BLOCKED_TILES: - gPaintBlockedTiles = !gPaintBlockedTiles; - GfxInvalidateScreen(); - break; + InitScrollWidgets(); + WindowPushOthersBelow(*this); - case WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS: - gShowSupportSegmentHeights = !gShowSupportSegmentHeights; - GfxInvalidateScreen(); - break; + colours[0] = TRANSLUCENT(COLOUR_BLACK); + colours[1] = COLOUR_GREY; - case WIDX_TOGGLE_SHOW_BOUND_BOXES: - gPaintBoundingBoxes = !gPaintBoundingBoxes; - GfxInvalidateScreen(); - break; - - case WIDX_TOGGLE_SHOW_DIRTY_VISUALS: - gShowDirtyVisuals = !gShowDirtyVisuals; - GfxInvalidateScreen(); - break; + ResizeLanguage = LANGUAGE_UNDEFINED; } - } - void OnPrepareDraw() override - { - const auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - const auto currentLanguage = ls.GetCurrentLanguage(); - if (ResizeLanguage != currentLanguage) + void OnMouseUp(WidgetIndex widgetIndex) override { - ResizeLanguage = currentLanguage; - Invalidate(); - - // Find the width of the longest string - int16_t newWidth = 0; - for (size_t widgetIndex = WIDX_TOGGLE_SHOW_WIDE_PATHS; widgetIndex <= WIDX_TOGGLE_SHOW_DIRTY_VISUALS; widgetIndex++) + switch (widgetIndex) { - const auto& stringIdx = widgets[widgetIndex].text; - auto string = ls.GetString(stringIdx); - Guard::ArgumentNotNull(string); - const auto strWidth = GfxGetStringWidth(string, FontStyle::Medium); - newWidth = std::max(strWidth, newWidth); + case WIDX_TOGGLE_SHOW_WIDE_PATHS: + gPaintWidePathsAsGhost = !gPaintWidePathsAsGhost; + GfxInvalidateScreen(); + break; + + case WIDX_TOGGLE_SHOW_BLOCKED_TILES: + gPaintBlockedTiles = !gPaintBlockedTiles; + GfxInvalidateScreen(); + break; + + case WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS: + gShowSupportSegmentHeights = !gShowSupportSegmentHeights; + GfxInvalidateScreen(); + break; + + case WIDX_TOGGLE_SHOW_BOUND_BOXES: + gPaintBoundingBoxes = !gPaintBoundingBoxes; + GfxInvalidateScreen(); + break; + + case WIDX_TOGGLE_SHOW_DIRTY_VISUALS: + gShowDirtyVisuals = !gShowDirtyVisuals; + GfxInvalidateScreen(); + break; + } + } + + void OnPrepareDraw() override + { + const auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); + const auto currentLanguage = ls.GetCurrentLanguage(); + if (ResizeLanguage != currentLanguage) + { + ResizeLanguage = currentLanguage; + Invalidate(); + + // Find the width of the longest string + int16_t newWidth = 0; + for (size_t widgetIndex = WIDX_TOGGLE_SHOW_WIDE_PATHS; widgetIndex <= WIDX_TOGGLE_SHOW_DIRTY_VISUALS; + widgetIndex++) + { + const auto& stringIdx = widgets[widgetIndex].text; + auto string = ls.GetString(stringIdx); + Guard::ArgumentNotNull(string); + const auto strWidth = GfxGetStringWidth(string, FontStyle::Medium); + newWidth = std::max(strWidth, newWidth); + } + + // Add padding for both sides (8) and the offset for the text after the checkbox (15) + newWidth += 8 * 2 + 15; + + width = newWidth; + max_width = newWidth; + min_width = newWidth; + widgets[WIDX_BACKGROUND].right = newWidth - 1; + widgets[WIDX_TOGGLE_SHOW_WIDE_PATHS].right = newWidth - 8; + widgets[WIDX_TOGGLE_SHOW_BLOCKED_TILES].right = newWidth - 8; + widgets[WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS].right = newWidth - 8; + widgets[WIDX_TOGGLE_SHOW_BOUND_BOXES].right = newWidth - 8; + widgets[WIDX_TOGGLE_SHOW_DIRTY_VISUALS].right = newWidth - 8; + + Invalidate(); } - // Add padding for both sides (8) and the offset for the text after the checkbox (15) - newWidth += 8 * 2 + 15; - - width = newWidth; - max_width = newWidth; - min_width = newWidth; - widgets[WIDX_BACKGROUND].right = newWidth - 1; - widgets[WIDX_TOGGLE_SHOW_WIDE_PATHS].right = newWidth - 8; - widgets[WIDX_TOGGLE_SHOW_BLOCKED_TILES].right = newWidth - 8; - widgets[WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS].right = newWidth - 8; - widgets[WIDX_TOGGLE_SHOW_BOUND_BOXES].right = newWidth - 8; - widgets[WIDX_TOGGLE_SHOW_DIRTY_VISUALS].right = newWidth - 8; - - Invalidate(); + WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_WIDE_PATHS, gPaintWidePathsAsGhost); + WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_BLOCKED_TILES, gPaintBlockedTiles); + WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS, gShowSupportSegmentHeights); + WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_BOUND_BOXES, gPaintBoundingBoxes); + WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_DIRTY_VISUALS, gShowDirtyVisuals); } - WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_WIDE_PATHS, gPaintWidePathsAsGhost); - WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_BLOCKED_TILES, gPaintBlockedTiles); - WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_SEGMENT_HEIGHTS, gShowSupportSegmentHeights); - WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_BOUND_BOXES, gPaintBoundingBoxes); - WidgetSetCheckboxValue(*this, WIDX_TOGGLE_SHOW_DIRTY_VISUALS, gShowDirtyVisuals); - } + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + } + }; - void OnDraw(DrawPixelInfo& dpi) override + WindowBase* WindowDebugPaintOpen() { - DrawWidgets(dpi); + auto* window = WindowFocusOrCreate( + WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, + WF_STICK_TO_FRONT | WF_TRANSPARENT); + + return window; } -}; - -WindowBase* WindowDebugPaintOpen() -{ - auto* window = WindowFocusOrCreate( - WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, - WF_STICK_TO_FRONT | WF_TRANSPARENT); - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 9e47e3fde7..8d8dc2d0d1 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -19,12 +19,12 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WW = 200; + static constexpr int32_t WH = 100; -static constexpr int32_t WW = 200; -static constexpr int32_t WH = 100; - -// clang-format off + // clang-format off enum WindowRideDemolishWidgetIdx { WIDX_BACKGROUND, @@ -41,85 +41,87 @@ static Widget window_ride_demolish_widgets[] = MakeWidget({WW - 95, WH - 22}, {85, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL), kWidgetsEnd, }; -// clang-format on + // clang-format on -class DemolishRidePromptWindow final : public Window -{ - money64 _demolishRideCost; - -public: - void SetRide(const Ride& currentRide) + class DemolishRidePromptWindow final : public Window { - rideId = currentRide.id; - _demolishRideCost = -RideGetRefundPrice(currentRide); - } + money64 _demolishRideCost; - void OnOpen() override - { - widgets = window_ride_demolish_widgets; - WindowInitScrollWidgets(*this); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void SetRide(const Ride& currentRide) { - case WIDX_DEMOLISH: + rideId = currentRide.id; + _demolishRideCost = -RideGetRefundPrice(currentRide); + } + + void OnOpen() override + { + widgets = window_ride_demolish_widgets; + WindowInitScrollWidgets(*this); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) { - auto gameAction = RideDemolishAction(rideId, RIDE_MODIFY_DEMOLISH); - GameActions::Execute(&gameAction); - break; + case WIDX_DEMOLISH: + { + auto gameAction = RideDemolishAction(rideId, RIDE_MODIFY_DEMOLISH); + GameActions::Execute(&gameAction); + break; + } + case WIDX_CANCEL: + case WIDX_CLOSE: + Close(); + break; } - case WIDX_CANCEL: - case WIDX_CLOSE: - Close(); - break; } - } - void OnDraw(DrawPixelInfo& dpi) override - { - WindowDrawWidgets(*this, dpi); - - auto currentRide = GetRide(rideId); - if (currentRide != nullptr) + void OnDraw(DrawPixelInfo& dpi) override { - auto stringId = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID - : STR_DEMOLISH_RIDE_ID_MONEY; - auto ft = Formatter(); - currentRide->FormatNameTo(ft); - ft.Add(_demolishRideCost); + WindowDrawWidgets(*this, dpi); - ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); - DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); + auto currentRide = GetRide(rideId); + if (currentRide != nullptr) + { + auto stringId = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? STR_DEMOLISH_RIDE_ID + : STR_DEMOLISH_RIDE_ID_MONEY; + auto ft = Formatter(); + currentRide->FormatNameTo(ft); + ft.Add(_demolishRideCost); + + ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); + DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); + } } - } - void OnResize() override + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowRideDemolishPromptOpen(const Ride& ride) { - ResizeFrame(); + WindowBase* w; + DemolishRidePromptWindow* newWindow; + + w = WindowFindByClass(WindowClass::DemolishRidePrompt); + if (w != nullptr) + { + auto windowPos = w->windowPos; + WindowClose(*w); + newWindow = WindowCreate( + WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); + } + else + { + newWindow = WindowCreate( + WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + } + + newWindow->SetRide(ride); + + return newWindow; } -}; - -WindowBase* WindowRideDemolishPromptOpen(const Ride& ride) -{ - WindowBase* w; - DemolishRidePromptWindow* newWindow; - - w = WindowFindByClass(WindowClass::DemolishRidePrompt); - if (w != nullptr) - { - auto windowPos = w->windowPos; - WindowClose(*w); - newWindow = WindowCreate(WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); - } - else - { - newWindow = WindowCreate( - WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); - } - - newWindow->SetRide(ride); - - return newWindow; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Dropdown.cpp b/src/openrct2-ui/windows/Dropdown.cpp index 7cf3e40a78..1d796f5390 100644 --- a/src/openrct2-ui/windows/Dropdown.cpp +++ b/src/openrct2-ui/windows/Dropdown.cpp @@ -22,431 +22,381 @@ #include #include -using namespace OpenRCT2; - -// The maximum number of rows to list before items overflow into new columns -constexpr int32_t DROPDOWN_TEXT_MAX_ROWS = 32; - -constexpr int32_t DROPDOWN_ITEM_HEIGHT = 12; - -static constexpr std::array _appropriateImageDropdownItemsPerRow = { - 1, 1, 1, 1, 2, 2, 3, 3, 4, 3, // 10 - 5, 4, 4, 5, 5, 5, 4, 5, 6, 5, // 20 - 5, 7, 4, 5, 6, 5, 6, 6, 6, 6, // 30 - 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, // 40 - 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 50 - 9, 9, 9, 9, 9, 9, 9, // 56 -}; - -enum +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, -}; + // The maximum number of rows to list before items overflow into new columns + constexpr int32_t DROPDOWN_TEXT_MAX_ROWS = 32; -static Widget window_dropdown_widgets[] = { - MakeWidget({ 0, 0 }, { 1, 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), - kWidgetsEnd, -}; + constexpr int32_t DROPDOWN_ITEM_HEIGHT = 12; -int32_t gDropdownNumItems; -Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; -static ImageId _dropdownItemsImages[Dropdown::ItemsMaxSize]; -bool gDropdownIsColour; -int32_t gDropdownLastColourHover; -int32_t gDropdownHighlightedIndex; -int32_t gDropdownDefaultIndex; -static bool _dropdownPrepareUseImages; + static constexpr std::array _appropriateImageDropdownItemsPerRow = { + 1, 1, 1, 1, 2, 2, 3, 3, 4, 3, // 10 + 5, 4, 4, 5, 5, 5, 4, 5, 6, 5, // 20 + 5, 7, 4, 5, 6, 5, 6, 6, 6, 6, // 30 + 6, 8, 8, 8, 9, 9, 9, 9, 9, 9, // 40 + 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, // 50 + 9, 9, 9, 9, 9, 9, 9, // 56 + }; -static void ResetDropdownFlags() -{ - for (size_t i = 0; i < std::size(gDropdownItems); i++) + enum { - gDropdownItems[i].Flags = 0; - } -} + WIDX_BACKGROUND, + }; -bool Dropdown::IsChecked(int32_t index) -{ - if (index < 0 || index >= static_cast(std::size(gDropdownItems))) + static Widget window_dropdown_widgets[] = { + MakeWidget({ 0, 0 }, { 1, 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), + kWidgetsEnd, + }; + + int32_t gDropdownNumItems; + Dropdown::Item gDropdownItems[Dropdown::ItemsMaxSize]; + static ImageId _dropdownItemsImages[Dropdown::ItemsMaxSize]; + bool gDropdownIsColour; + int32_t gDropdownLastColourHover; + int32_t gDropdownHighlightedIndex; + int32_t gDropdownDefaultIndex; + static bool _dropdownPrepareUseImages; + + static void ResetDropdownFlags() { - return false; - } - return gDropdownItems[index].IsChecked(); -} - -bool Dropdown::IsDisabled(int32_t index) -{ - if (index < 0 || index >= static_cast(std::size(gDropdownItems))) - { - return true; - } - return gDropdownItems[index].IsDisabled(); -} - -void Dropdown::SetChecked(int32_t index, bool value) -{ - if (index < 0 || index >= static_cast(std::size(gDropdownItems))) - { - return; - } - if (value) - gDropdownItems[index].Flags |= EnumValue(Dropdown::ItemFlag::IsChecked); - else - gDropdownItems[index].Flags &= ~EnumValue(Dropdown::ItemFlag::IsChecked); -} - -void Dropdown::SetDisabled(int32_t index, bool value) -{ - if (index < 0 || index >= static_cast(std::size(gDropdownItems))) - { - return; - } - if (value) - gDropdownItems[index].Flags |= EnumValue(Dropdown::ItemFlag::IsDisabled); - else - gDropdownItems[index].Flags &= ~EnumValue(Dropdown::ItemFlag::IsDisabled); -} - -void Dropdown::SetImage(int32_t index, ImageId image) -{ - if (index < 0 || index >= static_cast(std::size(_dropdownItemsImages))) - { - return; - } - _dropdownItemsImages[index] = image; - _dropdownPrepareUseImages = true; -} - -class DropdownWindow final : public Window -{ - bool UseImages; - int32_t NumColumns; - int32_t NumRows; - int32_t ItemWidth; - int32_t ItemHeight; - bool ListVertically; - -public: - void OnOpen() override - { - widgets = window_dropdown_widgets; - - // Input state - gDropdownHighlightedIndex = -1; - ResetDropdownFlags(); - gDropdownIsColour = false; - gDropdownDefaultIndex = -1; - InputSetState(InputState::DropdownActive); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - int32_t highlightedIndex = gDropdownHighlightedIndex; - for (int32_t i = 0; i < gDropdownNumItems; i++) + for (size_t i = 0; i < std::size(gDropdownItems); i++) { - ScreenCoordsXY cellCoords; - if (ListVertically) - cellCoords = { i / NumRows, i % NumRows }; - else - cellCoords = { i % NumColumns, i / NumColumns }; + gDropdownItems[i].Flags = 0; + } + } - ScreenCoordsXY screenCoords = windowPos - + ScreenCoordsXY{ 2 + (cellCoords.x * ItemWidth), 2 + (cellCoords.y * ItemHeight) }; + class DropdownWindow final : public Window + { + bool UseImages; + int32_t NumColumns; + int32_t NumRows; + int32_t ItemWidth; + int32_t ItemHeight; + bool ListVertically; - if (gDropdownItems[i].IsSeparator()) + public: + void OnOpen() override + { + widgets = window_dropdown_widgets; + + // Input state + gDropdownHighlightedIndex = -1; + ResetDropdownFlags(); + gDropdownIsColour = false; + gDropdownDefaultIndex = -1; + InputSetState(InputState::DropdownActive); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + int32_t highlightedIndex = gDropdownHighlightedIndex; + for (int32_t i = 0; i < gDropdownNumItems; i++) { - const ScreenCoordsXY leftTop = screenCoords + ScreenCoordsXY{ 0, (ItemHeight / 2) }; - const ScreenCoordsXY rightBottom = leftTop + ScreenCoordsXY{ ItemWidth - 1, 0 }; - const ScreenCoordsXY shadowOffset{ 0, 1 }; + ScreenCoordsXY cellCoords; + if (ListVertically) + cellCoords = { i / NumRows, i % NumRows }; + else + cellCoords = { i % NumColumns, i / NumColumns }; - if (colours[0] & COLOUR_FLAG_TRANSLUCENT) + ScreenCoordsXY screenCoords = windowPos + + ScreenCoordsXY{ 2 + (cellCoords.x * ItemWidth), 2 + (cellCoords.y * ItemHeight) }; + + if (gDropdownItems[i].IsSeparator()) { - TranslucentWindowPalette palette = TranslucentWindowPalettes[BASE_COLOUR(colours[0])]; - GfxFilterRect(dpi, { leftTop, rightBottom }, palette.highlight); - GfxFilterRect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow); + const ScreenCoordsXY leftTop = screenCoords + ScreenCoordsXY{ 0, (ItemHeight / 2) }; + const ScreenCoordsXY rightBottom = leftTop + ScreenCoordsXY{ ItemWidth - 1, 0 }; + const ScreenCoordsXY shadowOffset{ 0, 1 }; + + if (colours[0] & COLOUR_FLAG_TRANSLUCENT) + { + TranslucentWindowPalette palette = TranslucentWindowPalettes[BASE_COLOUR(colours[0])]; + GfxFilterRect(dpi, { leftTop, rightBottom }, palette.highlight); + GfxFilterRect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, palette.shadow); + } + else + { + GfxFillRect(dpi, { leftTop, rightBottom }, ColourMapA[colours[0]].mid_dark); + GfxFillRect( + dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0]].lightest); + } } else { - GfxFillRect(dpi, { leftTop, rightBottom }, ColourMapA[colours[0]].mid_dark); - GfxFillRect(dpi, { leftTop + shadowOffset, rightBottom + shadowOffset }, ColourMapA[colours[0]].lightest); - } - } - else - { - if (i == highlightedIndex) - { - // Darken the cell's background slightly when highlighted - const ScreenCoordsXY rightBottom = screenCoords + ScreenCoordsXY{ ItemWidth - 1, ItemHeight - 1 }; - GfxFilterRect(dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3); - } - - StringId item = gDropdownItems[i].Format; - if (item == Dropdown::FormatLandPicker || item == Dropdown::FormatColourPicker) - { - // Image item - auto image = UseImages ? _dropdownItemsImages[i] - : ImageId::FromUInt32(static_cast(gDropdownItems[i].Args)); - if (item == Dropdown::FormatColourPicker && highlightedIndex == i) - image = image.WithIndexOffset(1); - GfxDrawSprite(dpi, image, screenCoords); - } - else - { - // Text item - if (i < Dropdown::ItemsMaxSize && Dropdown::IsChecked(i)) - item++; - - // Calculate colour - colour_t colour = NOT_TRANSLUCENT(colours[0]); if (i == highlightedIndex) - colour = COLOUR_WHITE; - if (i < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(i)) - colour = NOT_TRANSLUCENT(colours[0]) | COLOUR_FLAG_INSET; + { + // Darken the cell's background slightly when highlighted + const ScreenCoordsXY rightBottom = screenCoords + ScreenCoordsXY{ ItemWidth - 1, ItemHeight - 1 }; + GfxFilterRect(dpi, { screenCoords, rightBottom }, FilterPaletteID::PaletteDarken3); + } - // Draw item string - Formatter ft(reinterpret_cast(&gDropdownItems[i].Args)); - DrawTextEllipsised(dpi, screenCoords, width - 5, item, ft, { colour }); + StringId item = gDropdownItems[i].Format; + if (item == Dropdown::FormatLandPicker || item == Dropdown::FormatColourPicker) + { + // Image item + auto image = UseImages ? _dropdownItemsImages[i] + : ImageId::FromUInt32(static_cast(gDropdownItems[i].Args)); + if (item == Dropdown::FormatColourPicker && highlightedIndex == i) + image = image.WithIndexOffset(1); + GfxDrawSprite(dpi, image, screenCoords); + } + else + { + // Text item + if (i < Dropdown::ItemsMaxSize && Dropdown::IsChecked(i)) + item++; + + // Calculate colour + colour_t colour = NOT_TRANSLUCENT(colours[0]); + if (i == highlightedIndex) + colour = COLOUR_WHITE; + if (i < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(i)) + colour = NOT_TRANSLUCENT(colours[0]) | COLOUR_FLAG_INSET; + + // Draw item string + Formatter ft(reinterpret_cast(&gDropdownItems[i].Args)); + DrawTextEllipsised(dpi, screenCoords, width - 5, item, ft, { colour }); + } } } } - } - void SetTextItems( - const ScreenCoordsXY& screenPos, int32_t extraY, uint8_t colour, uint8_t customHeight, uint8_t txtFlags, - size_t numItems, int32_t itemWidth) + void SetTextItems( + const ScreenCoordsXY& screenPos, int32_t extraY, uint8_t colour, uint8_t customHeight, uint8_t txtFlags, + size_t numItems, int32_t itemWidth) + { + // Set and calculate num items, rows and columns + ItemWidth = itemWidth; + ItemHeight = (txtFlags & Dropdown::Flag::CustomHeight) ? customHeight : DROPDOWN_ITEM_HEIGHT; + gDropdownNumItems = static_cast(numItems); + // There must always be at least one column to prevent dividing by zero + if (gDropdownNumItems == 0) + { + NumColumns = 1; + NumRows = 1; + } + else + { + NumColumns = (gDropdownNumItems + DROPDOWN_TEXT_MAX_ROWS - 1) / DROPDOWN_TEXT_MAX_ROWS; + NumRows = (gDropdownNumItems + NumColumns - 1) / NumColumns; + } + + // Text dropdowns are listed horizontally + ListVertically = true; + + UpdateSizeAndPosition(screenPos, extraY); + + if (colour & COLOUR_FLAG_TRANSLUCENT) + flags |= WF_TRANSPARENT; + colours[0] = colour; + } + + void SetImageItems( + const ScreenCoordsXY& screenPos, int32_t extraY, uint8_t colour, int32_t numItems, int32_t itemWidth, + int32_t itemHeight, int32_t numColumns) + { + UseImages = _dropdownPrepareUseImages; + _dropdownPrepareUseImages = false; + + // Set and calculate num items, rows and columns + ItemWidth = itemWidth; + ItemHeight = itemHeight; + gDropdownNumItems = numItems; + // There must always be at least one column and row to prevent dividing by zero + if (gDropdownNumItems == 0) + { + NumColumns = 1; + NumRows = 1; + } + else + { + NumColumns = std::max(1, numColumns); + NumRows = gDropdownNumItems / NumColumns; + if (gDropdownNumItems % NumColumns != 0) + NumRows++; + } + + // image dropdowns are listed horizontally + ListVertically = false; + + UpdateSizeAndPosition(screenPos, extraY); + + if (colour & COLOUR_FLAG_TRANSLUCENT) + flags |= WF_TRANSPARENT; + colours[0] = colour; + } + + int32_t GetIndexFromPoint(const ScreenCoordsXY& loc) + { + int32_t top = loc.y - windowPos.y - 2; + if (top < 0) + return -1; + + int32_t left = loc.x - windowPos.x; + if (left >= width) + return -1; + left -= 2; + if (left < 0) + return -1; + + int32_t columnNum = left / ItemWidth; + if (columnNum >= NumColumns) + return -1; + + int32_t rowNum = top / ItemHeight; + if (rowNum >= NumRows) + return -1; + + int32_t dropdownIndex; + if (ListVertically) + dropdownIndex = columnNum * NumRows + rowNum; + else + dropdownIndex = rowNum * NumColumns + columnNum; + + if (dropdownIndex >= gDropdownNumItems) + return -1; + + return dropdownIndex; + } + + private: + void UpdateSizeAndPosition(const ScreenCoordsXY& screenPos, const int32_t extraY) + { + // Calculate position and size + const auto ddWidth = ItemWidth * NumColumns + 3; + const auto ddHeight = ItemHeight * NumRows + 3; + + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + auto boundedScreenPos = screenPos; + if (screenPos.x + ddWidth > screenWidth) + boundedScreenPos.x = std::max(0, screenWidth - ddWidth); + if (screenPos.y + ddHeight > screenHeight) + boundedScreenPos.y = std::max(0, screenHeight - ddHeight); + window_dropdown_widgets[WIDX_BACKGROUND].right = ddWidth; + window_dropdown_widgets[WIDX_BACKGROUND].bottom = ddHeight; + + Invalidate(); + width = ddWidth + 1; + height = ddHeight + 1; + windowPos = boundedScreenPos + ScreenCoordsXY{ 0, extraY }; + Invalidate(); + } + }; + + /** + * Shows a text dropdown menu. + * rct2: 0x006ECFB9 + * + * @param x (cx) + * @param y (dx) + * @param extray (di) + * @param flags (bh) + * @param num_items (bx) + * @param colour (al) + */ + void WindowDropdownShowText( + const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t flags, size_t num_items) { - // Set and calculate num items, rows and columns - ItemWidth = itemWidth; - ItemHeight = (txtFlags & Dropdown::Flag::CustomHeight) ? customHeight : DROPDOWN_ITEM_HEIGHT; - gDropdownNumItems = static_cast(numItems); - // There must always be at least one column to prevent dividing by zero - if (gDropdownNumItems == 0) + int32_t string_width, max_string_width; + char buffer[256]; + + // Calculate the longest string width + max_string_width = 0; + for (size_t i = 0; i < num_items; i++) { - NumColumns = 1; - NumRows = 1; - } - else - { - NumColumns = (gDropdownNumItems + DROPDOWN_TEXT_MAX_ROWS - 1) / DROPDOWN_TEXT_MAX_ROWS; - NumRows = (gDropdownNumItems + NumColumns - 1) / NumColumns; + FormatStringLegacy(buffer, 256, gDropdownItems[i].Format, static_cast(&gDropdownItems[i].Args)); + string_width = GfxGetStringWidth(buffer, FontStyle::Medium); + max_string_width = std::max(string_width, max_string_width); } - // Text dropdowns are listed horizontally - ListVertically = true; - - UpdateSizeAndPosition(screenPos, extraY); - - if (colour & COLOUR_FLAG_TRANSLUCENT) - flags |= WF_TRANSPARENT; - colours[0] = colour; + WindowDropdownShowTextCustomWidth(screenPos, extray, colour, 0, flags, num_items, max_string_width + 3); } - void SetImageItems( - const ScreenCoordsXY& screenPos, int32_t extraY, uint8_t colour, int32_t numItems, int32_t itemWidth, + /** + * Shows a text dropdown menu. + * rct2: 0x006ECFB9, although 0x006ECE50 is real version + * + * @param x (cx) + * @param y (dx) + * @param extray (di) + * @param flags (bh) + * @param num_items (bx) + * @param colour (al) + * @param custom_height (ah) requires flag set as well + */ + void WindowDropdownShowTextCustomWidth( + const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t custom_height, uint8_t flags, size_t num_items, + int32_t width) + { + InputSetFlag(static_cast(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false); + if (flags & Dropdown::Flag::StayOpen) + InputSetFlag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true); + + WindowDropdownClose(); + + // Create the window (width/height position are set later) + auto* w = WindowCreate(WindowClass::Dropdown, width, custom_height, WF_STICK_TO_FRONT); + if (w != nullptr) + { + w->SetTextItems(screenPos, extray, colour, custom_height, flags, num_items, width); + } + } + + /** + * Shows an image dropdown menu. + * rct2: 0x006ECFB9 + * + * @param x (cx) + * @param y (dx) + * @param extray (di) + * @param flags (bh) + * @param numItems (bx) + * @param colour (al) + * @param itemWidth (bp) + * @param itemHeight (ah) + * @param numColumns (bl) + */ + void WindowDropdownShowImage( + int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth, int32_t itemHeight, int32_t numColumns) { - UseImages = _dropdownPrepareUseImages; - _dropdownPrepareUseImages = false; + InputSetFlag(static_cast(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false); + if (flags & Dropdown::Flag::StayOpen) + InputSetFlag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true); - // Set and calculate num items, rows and columns - ItemWidth = itemWidth; - ItemHeight = itemHeight; - gDropdownNumItems = numItems; - // There must always be at least one column and row to prevent dividing by zero - if (gDropdownNumItems == 0) + // Close existing dropdown + WindowDropdownClose(); + + // Create the window (width/height position are set later) + auto* w = WindowCreate(WindowClass::Dropdown, itemWidth, itemHeight, WF_STICK_TO_FRONT); + if (w != nullptr) { - NumColumns = 1; - NumRows = 1; + w->SetImageItems({ x, y }, extray, colour, numItems, itemWidth, itemHeight, numColumns); } - else + } + + void WindowDropdownClose() + { + WindowCloseByClass(WindowClass::Dropdown); + } + + /** + * New function based on 6e914e + * returns -1 if index is invalid + */ + int32_t DropdownIndexFromPoint(const ScreenCoordsXY& loc, WindowBase* w) + { + if (w->classification == WindowClass::Dropdown) { - NumColumns = std::max(1, numColumns); - NumRows = gDropdownNumItems / NumColumns; - if (gDropdownNumItems % NumColumns != 0) - NumRows++; + auto* ddWnd = static_cast(w); + return ddWnd->GetIndexFromPoint(loc); } - - // image dropdowns are listed horizontally - ListVertically = false; - - UpdateSizeAndPosition(screenPos, extraY); - - if (colour & COLOUR_FLAG_TRANSLUCENT) - flags |= WF_TRANSPARENT; - colours[0] = colour; + return -1; } - int32_t GetIndexFromPoint(const ScreenCoordsXY& loc) - { - int32_t top = loc.y - windowPos.y - 2; - if (top < 0) - return -1; - - int32_t left = loc.x - windowPos.x; - if (left >= width) - return -1; - left -= 2; - if (left < 0) - return -1; - - int32_t columnNum = left / ItemWidth; - if (columnNum >= NumColumns) - return -1; - - int32_t rowNum = top / ItemHeight; - if (rowNum >= NumRows) - return -1; - - int32_t dropdownIndex; - if (ListVertically) - dropdownIndex = columnNum * NumRows + rowNum; - else - dropdownIndex = rowNum * NumColumns + columnNum; - - if (dropdownIndex >= gDropdownNumItems) - return -1; - - return dropdownIndex; - } - -private: - void UpdateSizeAndPosition(const ScreenCoordsXY& screenPos, const int32_t extraY) - { - // Calculate position and size - const auto ddWidth = ItemWidth * NumColumns + 3; - const auto ddHeight = ItemHeight * NumRows + 3; - - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - auto boundedScreenPos = screenPos; - if (screenPos.x + ddWidth > screenWidth) - boundedScreenPos.x = std::max(0, screenWidth - ddWidth); - if (screenPos.y + ddHeight > screenHeight) - boundedScreenPos.y = std::max(0, screenHeight - ddHeight); - window_dropdown_widgets[WIDX_BACKGROUND].right = ddWidth; - window_dropdown_widgets[WIDX_BACKGROUND].bottom = ddHeight; - - Invalidate(); - width = ddWidth + 1; - height = ddHeight + 1; - windowPos = boundedScreenPos + ScreenCoordsXY{ 0, extraY }; - Invalidate(); - } -}; - -/** - * Shows a text dropdown menu. - * rct2: 0x006ECFB9 - * - * @param x (cx) - * @param y (dx) - * @param extray (di) - * @param flags (bh) - * @param num_items (bx) - * @param colour (al) - */ -void WindowDropdownShowText(const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t flags, size_t num_items) -{ - int32_t string_width, max_string_width; - char buffer[256]; - - // Calculate the longest string width - max_string_width = 0; - for (size_t i = 0; i < num_items; i++) - { - FormatStringLegacy(buffer, 256, gDropdownItems[i].Format, static_cast(&gDropdownItems[i].Args)); - string_width = GfxGetStringWidth(buffer, FontStyle::Medium); - max_string_width = std::max(string_width, max_string_width); - } - - WindowDropdownShowTextCustomWidth(screenPos, extray, colour, 0, flags, num_items, max_string_width + 3); -} - -/** - * Shows a text dropdown menu. - * rct2: 0x006ECFB9, although 0x006ECE50 is real version - * - * @param x (cx) - * @param y (dx) - * @param extray (di) - * @param flags (bh) - * @param num_items (bx) - * @param colour (al) - * @param custom_height (ah) requires flag set as well - */ -void WindowDropdownShowTextCustomWidth( - const ScreenCoordsXY& screenPos, int32_t extray, uint8_t colour, uint8_t custom_height, uint8_t flags, size_t num_items, - int32_t width) -{ - InputSetFlag(static_cast(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false); - if (flags & Dropdown::Flag::StayOpen) - InputSetFlag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true); - - WindowDropdownClose(); - - // Create the window (width/height position are set later) - auto* w = WindowCreate(WindowClass::Dropdown, width, custom_height, WF_STICK_TO_FRONT); - if (w != nullptr) - { - w->SetTextItems(screenPos, extray, colour, custom_height, flags, num_items, width); - } -} - -/** - * Shows an image dropdown menu. - * rct2: 0x006ECFB9 - * - * @param x (cx) - * @param y (dx) - * @param extray (di) - * @param flags (bh) - * @param numItems (bx) - * @param colour (al) - * @param itemWidth (bp) - * @param itemHeight (ah) - * @param numColumns (bl) - */ -void WindowDropdownShowImage( - int32_t x, int32_t y, int32_t extray, uint8_t colour, uint8_t flags, int32_t numItems, int32_t itemWidth, - int32_t itemHeight, int32_t numColumns) -{ - InputSetFlag(static_cast(INPUT_FLAG_DROPDOWN_STAY_OPEN | INPUT_FLAG_DROPDOWN_MOUSE_UP), false); - if (flags & Dropdown::Flag::StayOpen) - InputSetFlag(INPUT_FLAG_DROPDOWN_STAY_OPEN, true); - - // Close existing dropdown - WindowDropdownClose(); - - // Create the window (width/height position are set later) - auto* w = WindowCreate(WindowClass::Dropdown, itemWidth, itemHeight, WF_STICK_TO_FRONT); - if (w != nullptr) - { - w->SetImageItems({ x, y }, extray, colour, numItems, itemWidth, itemHeight, numColumns); - } -} - -void WindowDropdownClose() -{ - WindowCloseByClass(WindowClass::Dropdown); -} - -/** - * New function based on 6e914e - * returns -1 if index is invalid - */ -int32_t DropdownIndexFromPoint(const ScreenCoordsXY& loc, WindowBase* w) -{ - if (w->classification == WindowClass::Dropdown) - { - auto* ddWnd = static_cast(w); - return ddWnd->GetIndexFromPoint(loc); - } - return -1; -} - -// clang-format off + // clang-format off // colour_t ordered for use in color dropdown static constexpr colour_t kColoursDropdownOrder[] = { COLOUR_BLACK, @@ -512,56 +462,111 @@ static constexpr colour_t kColoursDropdownOrder[] = { COLOUR_INVISIBLE, COLOUR_VOID }; -// clang-format on + // clang-format on -colour_t ColourDropDownIndexToColour(uint8_t ddidx) -{ - return kColoursDropdownOrder[ddidx]; -} - -/** - * rct2: 0x006ED43D - */ -void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownColour, uint8_t selectedColour) -{ - int32_t defaultIndex = -1; - - auto numColours = (GetGameState().Cheats.AllowSpecialColourSchemes) ? static_cast(COLOUR_COUNT) - : COLOUR_NUM_NORMAL; - // Set items - for (uint64_t i = 0; i < numColours; i++) + colour_t ColourDropDownIndexToColour(uint8_t ddidx) { - auto orderedColour = ColourDropDownIndexToColour(i); - if (selectedColour == orderedColour) - defaultIndex = i; - - // Use special graphic for Invisible colour - 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].Args = (i << 32) | imageId.ToUInt32(); + return kColoursDropdownOrder[ddidx]; } - // Show dropdown - WindowDropdownShowImage( - w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height() + 1, dropdownColour, - Dropdown::Flag::StayOpen, numColours, 12, 12, - DropdownGetAppropriateImageDropdownItemsPerRow(static_cast(numColours))); + /** + * rct2: 0x006ED43D + */ + void WindowDropdownShowColour(WindowBase* w, Widget* widget, uint8_t dropdownColour, uint8_t selectedColour) + { + int32_t defaultIndex = -1; - gDropdownIsColour = true; - gDropdownLastColourHover = -1; - gDropdownDefaultIndex = defaultIndex; -} + auto numColours = (GetGameState().Cheats.AllowSpecialColourSchemes) ? static_cast(COLOUR_COUNT) + : COLOUR_NUM_NORMAL; + // Set items + for (uint64_t i = 0; i < numColours; i++) + { + auto orderedColour = ColourDropDownIndexToColour(i); + if (selectedColour == orderedColour) + defaultIndex = i; -uint32_t DropdownGetAppropriateImageDropdownItemsPerRow(uint32_t numItems) + // Use special graphic for Invisible colour + 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].Args = (i << 32) | imageId.ToUInt32(); + } + + // Show dropdown + WindowDropdownShowImage( + w->windowPos.x + widget->left, w->windowPos.y + widget->top, widget->height() + 1, dropdownColour, + Dropdown::Flag::StayOpen, numColours, 12, 12, + DropdownGetAppropriateImageDropdownItemsPerRow(static_cast(numColours))); + + gDropdownIsColour = true; + gDropdownLastColourHover = -1; + gDropdownDefaultIndex = defaultIndex; + } + + uint32_t DropdownGetAppropriateImageDropdownItemsPerRow(uint32_t numItems) + { + // If above the table size return the last element + return _appropriateImageDropdownItemsPerRow[std::min( + numItems, static_cast(std::size(_appropriateImageDropdownItemsPerRow) - 1))]; + } + + bool WindowDropDownHasMultipleColumns(size_t numItems) + { + return numItems > DROPDOWN_TEXT_MAX_ROWS; + } +} // namespace OpenRCT2::Ui::Windows + +using namespace OpenRCT2::Ui::Windows; + +bool Dropdown::IsChecked(int32_t index) { - // If above the table size return the last element - return _appropriateImageDropdownItemsPerRow[std::min( - numItems, static_cast(std::size(_appropriateImageDropdownItemsPerRow) - 1))]; + if (index < 0 || index >= static_cast(std::size(gDropdownItems))) + { + return false; + } + return gDropdownItems[index].IsChecked(); } -bool WindowDropDownHasMultipleColumns(size_t numItems) +bool Dropdown::IsDisabled(int32_t index) { - return numItems > DROPDOWN_TEXT_MAX_ROWS; + if (index < 0 || index >= static_cast(std::size(gDropdownItems))) + { + return true; + } + return gDropdownItems[index].IsDisabled(); +} + +void Dropdown::SetChecked(int32_t index, bool value) +{ + if (index < 0 || index >= static_cast(std::size(gDropdownItems))) + { + return; + } + if (value) + gDropdownItems[index].Flags |= EnumValue(Dropdown::ItemFlag::IsChecked); + else + gDropdownItems[index].Flags &= ~EnumValue(Dropdown::ItemFlag::IsChecked); +} + +void Dropdown::SetDisabled(int32_t index, bool value) +{ + if (index < 0 || index >= static_cast(std::size(gDropdownItems))) + { + return; + } + if (value) + gDropdownItems[index].Flags |= EnumValue(Dropdown::ItemFlag::IsDisabled); + else + gDropdownItems[index].Flags &= ~EnumValue(Dropdown::ItemFlag::IsDisabled); +} + +void Dropdown::SetImage(int32_t index, ImageId image) +{ + if (index < 0 || index >= static_cast(std::size(_dropdownItemsImages))) + { + return; + } + _dropdownItemsImages[index] = image; + _dropdownPrepareUseImages = true; } diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 99c30208f5..238ed308e8 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -28,9 +28,9 @@ #include #include -using namespace OpenRCT2; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_PREVIOUS_IMAGE, // 1 WIDX_PREVIOUS_STEP_BUTTON, // 2 @@ -45,363 +45,366 @@ static Widget _editorBottomToolbarWidgets[] = { MakeWidget({442, 2}, {196, 30}, WindowWidgetType::FlatBtn, WindowColour::Primary), kWidgetsEnd, }; -// clang-format on + // clang-format on -class EditorBottomToolbarWindow final : public Window -{ -private: - using FuncPtr = void (EditorBottomToolbarWindow::*)() const; - - static constexpr StringId _editorStepNames[] = { - STR_EDITOR_STEP_OBJECT_SELECTION, STR_EDITOR_STEP_LANDSCAPE_EDITOR, STR_EDITOR_STEP_INVENTIONS_LIST_SET_UP, - STR_EDITOR_STEP_OPTIONS_SELECTION, STR_EDITOR_STEP_OBJECTIVE_SELECTION, STR_EDITOR_STEP_SAVE_SCENARIO, - STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER, STR_EDITOR_STEP_TRACK_DESIGNS_MANAGER, - }; - -public: - void OnOpen() override + class EditorBottomToolbarWindow final : public Window { - widgets = _editorBottomToolbarWidgets; + private: + using FuncPtr = void (EditorBottomToolbarWindow::*)() const; - InitScrollWidgets(); - SetAllSceneryItemsInvented(); - } + static constexpr StringId _editorStepNames[] = { + STR_EDITOR_STEP_OBJECT_SELECTION, STR_EDITOR_STEP_LANDSCAPE_EDITOR, + STR_EDITOR_STEP_INVENTIONS_LIST_SET_UP, STR_EDITOR_STEP_OPTIONS_SELECTION, + STR_EDITOR_STEP_OBJECTIVE_SELECTION, STR_EDITOR_STEP_SAVE_SCENARIO, + STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER, STR_EDITOR_STEP_TRACK_DESIGNS_MANAGER, + }; - void OnPrepareDraw() override - { - ColourSchemeUpdateByClass( - this, - (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowClass::EditorScenarioBottomToolbar - : WindowClass::EditorTrackBottomToolbar); - - uint16_t screenWidth = ContextGetWidth(); - widgets[WIDX_NEXT_IMAGE].left = screenWidth - 200; - widgets[WIDX_NEXT_IMAGE].right = screenWidth - 1; - widgets[WIDX_NEXT_STEP_BUTTON].left = screenWidth - 198; - widgets[WIDX_NEXT_STEP_BUTTON].right = screenWidth - 3; - - widgets[WIDX_PREVIOUS_STEP_BUTTON].type = WindowWidgetType::FlatBtn; - widgets[WIDX_NEXT_STEP_BUTTON].type = WindowWidgetType::FlatBtn; - widgets[WIDX_PREVIOUS_IMAGE].type = WindowWidgetType::ImgBtn; - widgets[WIDX_NEXT_IMAGE].type = WindowWidgetType::ImgBtn; - - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + public: + void OnOpen() override { - HidePreviousStepButton(); - HideNextStepButton(); + widgets = _editorBottomToolbarWidgets; + + InitScrollWidgets(); + SetAllSceneryItemsInvented(); } - else - { - auto& gameState = GetGameState(); - if (gameState.EditorStep == EditorStep::ObjectSelection) + void OnPrepareDraw() override + { + ColourSchemeUpdateByClass( + this, + (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowClass::EditorScenarioBottomToolbar + : WindowClass::EditorTrackBottomToolbar); + + uint16_t screenWidth = ContextGetWidth(); + widgets[WIDX_NEXT_IMAGE].left = screenWidth - 200; + widgets[WIDX_NEXT_IMAGE].right = screenWidth - 1; + widgets[WIDX_NEXT_STEP_BUTTON].left = screenWidth - 198; + widgets[WIDX_NEXT_STEP_BUTTON].right = screenWidth - 3; + + widgets[WIDX_PREVIOUS_STEP_BUTTON].type = WindowWidgetType::FlatBtn; + widgets[WIDX_NEXT_STEP_BUTTON].type = WindowWidgetType::FlatBtn; + widgets[WIDX_PREVIOUS_IMAGE].type = WindowWidgetType::ImgBtn; + widgets[WIDX_NEXT_IMAGE].type = WindowWidgetType::ImgBtn; + + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { HidePreviousStepButton(); - } - else if (gameState.EditorStep == EditorStep::RollercoasterDesigner) - { HideNextStepButton(); } - else if (!(gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)) + else { - if (GetNumFreeEntities() != MAX_ENTITIES || GetGameState().ParkFlags & PARK_FLAGS_SPRITES_INITIALISED) + auto& gameState = GetGameState(); + + if (gameState.EditorStep == EditorStep::ObjectSelection) { HidePreviousStepButton(); } + else if (gameState.EditorStep == EditorStep::RollercoasterDesigner) + { + HideNextStepButton(); + } + else if (!(gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER)) + { + if (GetNumFreeEntities() != MAX_ENTITIES || GetGameState().ParkFlags & PARK_FLAGS_SPRITES_INITIALISED) + { + HidePreviousStepButton(); + } + } } } - } - void OnDraw(DrawPixelInfo& dpi) override - { - auto drawPreviousButton = widgets[WIDX_PREVIOUS_STEP_BUTTON].type != WindowWidgetType::Empty; - auto drawNextButton = widgets[WIDX_NEXT_STEP_BUTTON].type != WindowWidgetType::Empty; - - if (drawPreviousButton) - DrawLeftButtonBack(dpi); - - if (drawNextButton) - DrawRightButtonBack(dpi); - - DrawWidgets(dpi); - - if (drawPreviousButton) - DrawLeftButton(dpi); - - if (drawNextButton) - DrawRightButton(dpi); - - DrawStepText(dpi); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - auto& gameState = GetGameState(); - if (widgetIndex == WIDX_PREVIOUS_STEP_BUTTON) + void OnDraw(DrawPixelInfo& dpi) override { - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - || (GetNumFreeEntities() == MAX_ENTITIES && !(GetGameState().ParkFlags & PARK_FLAGS_SPRITES_INITIALISED))) + auto drawPreviousButton = widgets[WIDX_PREVIOUS_STEP_BUTTON].type != WindowWidgetType::Empty; + auto drawNextButton = widgets[WIDX_NEXT_STEP_BUTTON].type != WindowWidgetType::Empty; + + if (drawPreviousButton) + DrawLeftButtonBack(dpi); + + if (drawNextButton) + DrawRightButtonBack(dpi); + + DrawWidgets(dpi); + + if (drawPreviousButton) + DrawLeftButton(dpi); + + if (drawNextButton) + DrawRightButton(dpi); + + DrawStepText(dpi); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + auto& gameState = GetGameState(); + if (widgetIndex == WIDX_PREVIOUS_STEP_BUTTON) { - ((this)->*(_previousButtonMouseUp[EnumValue(gameState.EditorStep)]))(); + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + || (GetNumFreeEntities() == MAX_ENTITIES && !(GetGameState().ParkFlags & PARK_FLAGS_SPRITES_INITIALISED))) + { + ((this)->*(_previousButtonMouseUp[EnumValue(gameState.EditorStep)]))(); + } + } + else if (widgetIndex == WIDX_NEXT_STEP_BUTTON) + { + ((this)->*(_nextButtonMouseUp[EnumValue(gameState.EditorStep)]))(); } } - else if (widgetIndex == WIDX_NEXT_STEP_BUTTON) + + private: + void JumpBackToObjectSelection() const { - ((this)->*(_nextButtonMouseUp[EnumValue(gameState.EditorStep)]))(); - } - } - -private: - void JumpBackToObjectSelection() const - { - WindowCloseAll(); - GetGameState().EditorStep = EditorStep::ObjectSelection; - GfxInvalidateScreen(); - } - - void JumpBackToLandscapeEditor() const - { - WindowCloseAll(); - SetAllSceneryItemsInvented(); - ScenerySetDefaultPlacementConfiguration(); - GetGameState().EditorStep = EditorStep::LandscapeEditor; - ContextOpenWindow(WindowClass::Map); - GfxInvalidateScreen(); - } - - void JumpBackToInventionListSetUp() const - { - WindowCloseAll(); - ContextOpenWindow(WindowClass::EditorInventionList); - GetGameState().EditorStep = EditorStep::InventionsListSetUp; - GfxInvalidateScreen(); - } - - void JumpBackToOptionsSelection() const - { - WindowCloseAll(); - ContextOpenWindow(WindowClass::EditorScenarioOptions); - GetGameState().EditorStep = EditorStep::OptionsSelection; - GfxInvalidateScreen(); - } - - bool CheckObjectSelection() const - { - WindowBase* w; - - auto [missingObjectType, errorString] = Editor::CheckObjectSelection(); - if (missingObjectType == ObjectType::None) - { - WindowCloseByClass(WindowClass::EditorObjectSelection); - return true; + WindowCloseAll(); + GetGameState().EditorStep = EditorStep::ObjectSelection; + GfxInvalidateScreen(); } - ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); - w = WindowFindByClass(WindowClass::EditorObjectSelection); - if (w != nullptr) - { - // Click tab with missing object - w->OnMouseUp(WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); - } - return false; - } - - void JumpForwardFromObjectSelection() const - { - if (!CheckObjectSelection()) - return; - - FinishObjectSelection(); - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - { - ContextOpenWindow(WindowClass::ConstructRide); - } - else + void JumpBackToLandscapeEditor() const { + WindowCloseAll(); + SetAllSceneryItemsInvented(); + ScenerySetDefaultPlacementConfiguration(); + GetGameState().EditorStep = EditorStep::LandscapeEditor; ContextOpenWindow(WindowClass::Map); + GfxInvalidateScreen(); } - } - void JumpForwardToInventionListSetUp() const - { - auto [checksPassed, errorString] = Editor::CheckPark(); - if (checksPassed) + void JumpBackToInventionListSetUp() const { WindowCloseAll(); ContextOpenWindow(WindowClass::EditorInventionList); GetGameState().EditorStep = EditorStep::InventionsListSetUp; - } - else - { - ContextShowError(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, errorString, {}); - } - - GfxInvalidateScreen(); - } - - void JumpForwardToOptionsSelection() const - { - WindowCloseAll(); - ContextOpenWindow(WindowClass::EditorScenarioOptions); - GetGameState().EditorStep = EditorStep::OptionsSelection; - GfxInvalidateScreen(); - } - - void JumpForwardToObjectiveSelection() const - { - WindowCloseAll(); - ContextOpenWindow(WindowClass::EditorObjectiveOptions); - GetGameState().EditorStep = EditorStep::ObjectiveSelection; - GfxInvalidateScreen(); - } - - void JumpForwardToSaveScenario() const - { - auto& gameState = GetGameState(); - const auto savePrepareResult = ScenarioPrepareForSave(gameState); - if (!savePrepareResult.Successful) - { - ContextShowError(STR_UNABLE_TO_SAVE_SCENARIO_FILE, savePrepareResult.Message, {}); GfxInvalidateScreen(); - return; } - WindowCloseAll(); - auto intent = Intent(WindowClass::Loadsave); - intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); - intent.PutExtra(INTENT_EXTRA_PATH, gameState.ScenarioName); - ContextOpenIntent(&intent); - } - - void HidePreviousStepButton() - { - widgets[WIDX_PREVIOUS_STEP_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_PREVIOUS_IMAGE].type = WindowWidgetType::Empty; - } - - void HideNextStepButton() - { - widgets[WIDX_NEXT_STEP_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_NEXT_IMAGE].type = WindowWidgetType::Empty; - } - - void DrawLeftButtonBack(DrawPixelInfo& dpi) - { - auto previousWidget = widgets[WIDX_PREVIOUS_IMAGE]; - auto leftTop = windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top }; - auto rightBottom = windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom }; - GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); - } - - void DrawLeftButton(DrawPixelInfo& dpi) - { - const auto topLeft = windowPos - + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 1, widgets[WIDX_PREVIOUS_IMAGE].top + 1 }; - const auto bottomRight = windowPos - + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 }; - GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); - - GfxDrawSprite( - dpi, ImageId(SPR_PREVIOUS), - windowPos + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 6, widgets[WIDX_PREVIOUS_IMAGE].top + 6 }); - - colour_t textColour = NOT_TRANSLUCENT(colours[1]); - if (gHoverWidget.window_classification == WindowClass::BottomToolbar - && gHoverWidget.widget_index == WIDX_PREVIOUS_STEP_BUTTON) + void JumpBackToOptionsSelection() const { - textColour = COLOUR_WHITE; + WindowCloseAll(); + ContextOpenWindow(WindowClass::EditorScenarioOptions); + GetGameState().EditorStep = EditorStep::OptionsSelection; + GfxInvalidateScreen(); } - int16_t textX = (widgets[WIDX_PREVIOUS_IMAGE].left + 30 + widgets[WIDX_PREVIOUS_IMAGE].right) / 2 + windowPos.x; - int16_t textY = widgets[WIDX_PREVIOUS_IMAGE].top + 6 + windowPos.y; - - StringId stringId = _editorStepNames[EnumValue(GetGameState().EditorStep) - 1]; - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - stringId = STR_EDITOR_STEP_OBJECT_SELECTION; - - DrawTextBasic(dpi, { textX, textY }, STR_BACK_TO_PREVIOUS_STEP, {}, { textColour, TextAlignment::CENTRE }); - DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); - } - - void DrawRightButtonBack(DrawPixelInfo& dpi) - { - auto nextWidget = widgets[WIDX_NEXT_IMAGE]; - auto leftTop = windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top }; - auto rightBottom = windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom }; - GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); - } - - void DrawRightButton(DrawPixelInfo& dpi) - { - const auto topLeft = windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].left + 1, widgets[WIDX_NEXT_IMAGE].top + 1 }; - const auto bottomRight = windowPos - + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 }; - GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); - - GfxDrawSprite( - dpi, ImageId(SPR_NEXT), - windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 29, widgets[WIDX_NEXT_IMAGE].top + 6 }); - - colour_t textColour = NOT_TRANSLUCENT(colours[1]); - - if (gHoverWidget.window_classification == WindowClass::BottomToolbar - && gHoverWidget.widget_index == WIDX_NEXT_STEP_BUTTON) + bool CheckObjectSelection() const { - textColour = COLOUR_WHITE; + WindowBase* w; + + auto [missingObjectType, errorString] = Editor::CheckObjectSelection(); + if (missingObjectType == ObjectType::None) + { + WindowCloseByClass(WindowClass::EditorObjectSelection); + return true; + } + + ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); + w = WindowFindByClass(WindowClass::EditorObjectSelection); + if (w != nullptr) + { + // Click tab with missing object + w->OnMouseUp(WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); + } + return false; } - int16_t textX = (widgets[WIDX_NEXT_IMAGE].left + widgets[WIDX_NEXT_IMAGE].right - 30) / 2 + windowPos.x; - int16_t textY = widgets[WIDX_NEXT_IMAGE].top + 6 + windowPos.y; + void JumpForwardFromObjectSelection() const + { + if (!CheckObjectSelection()) + return; - StringId stringId = _editorStepNames[EnumValue(GetGameState().EditorStep) + 1]; - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER; + FinishObjectSelection(); + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + { + ContextOpenWindow(WindowClass::ConstructRide); + } + else + { + ContextOpenWindow(WindowClass::Map); + } + } - DrawTextBasic(dpi, { textX, textY }, STR_FORWARD_TO_NEXT_STEP, {}, { textColour, TextAlignment::CENTRE }); - DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); - } + void JumpForwardToInventionListSetUp() const + { + auto [checksPassed, errorString] = Editor::CheckPark(); + if (checksPassed) + { + WindowCloseAll(); + ContextOpenWindow(WindowClass::EditorInventionList); + GetGameState().EditorStep = EditorStep::InventionsListSetUp; + } + else + { + ContextShowError(STR_CANT_ADVANCE_TO_NEXT_EDITOR_STAGE, errorString, {}); + } - void DrawStepText(DrawPixelInfo& dpi) - { - int16_t stateX = (widgets[WIDX_PREVIOUS_IMAGE].right + widgets[WIDX_NEXT_IMAGE].left) / 2 + windowPos.x; - int16_t stateY = height - 0x0C + windowPos.y; - DrawTextBasic( - dpi, { stateX, stateY }, _editorStepNames[EnumValue(GetGameState().EditorStep)], {}, - { static_cast(NOT_TRANSLUCENT(colours[2]) | COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE }); - } + GfxInvalidateScreen(); + } - static constexpr FuncPtr _previousButtonMouseUp[] = { - nullptr, - &EditorBottomToolbarWindow::JumpBackToObjectSelection, - &EditorBottomToolbarWindow::JumpBackToLandscapeEditor, - &EditorBottomToolbarWindow::JumpBackToInventionListSetUp, - &EditorBottomToolbarWindow::JumpBackToOptionsSelection, - nullptr, - &EditorBottomToolbarWindow::JumpBackToObjectSelection, - nullptr, + void JumpForwardToOptionsSelection() const + { + WindowCloseAll(); + ContextOpenWindow(WindowClass::EditorScenarioOptions); + GetGameState().EditorStep = EditorStep::OptionsSelection; + GfxInvalidateScreen(); + } + + void JumpForwardToObjectiveSelection() const + { + WindowCloseAll(); + ContextOpenWindow(WindowClass::EditorObjectiveOptions); + GetGameState().EditorStep = EditorStep::ObjectiveSelection; + GfxInvalidateScreen(); + } + + void JumpForwardToSaveScenario() const + { + auto& gameState = GetGameState(); + const auto savePrepareResult = ScenarioPrepareForSave(gameState); + if (!savePrepareResult.Successful) + { + ContextShowError(STR_UNABLE_TO_SAVE_SCENARIO_FILE, savePrepareResult.Message, {}); + GfxInvalidateScreen(); + return; + } + + WindowCloseAll(); + auto intent = Intent(WindowClass::Loadsave); + intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO); + intent.PutExtra(INTENT_EXTRA_PATH, gameState.ScenarioName); + ContextOpenIntent(&intent); + } + + void HidePreviousStepButton() + { + widgets[WIDX_PREVIOUS_STEP_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_PREVIOUS_IMAGE].type = WindowWidgetType::Empty; + } + + void HideNextStepButton() + { + widgets[WIDX_NEXT_STEP_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_NEXT_IMAGE].type = WindowWidgetType::Empty; + } + + void DrawLeftButtonBack(DrawPixelInfo& dpi) + { + auto previousWidget = widgets[WIDX_PREVIOUS_IMAGE]; + auto leftTop = windowPos + ScreenCoordsXY{ previousWidget.left, previousWidget.top }; + auto rightBottom = windowPos + ScreenCoordsXY{ previousWidget.right, previousWidget.bottom }; + GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); + } + + void DrawLeftButton(DrawPixelInfo& dpi) + { + const auto topLeft = windowPos + + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 1, widgets[WIDX_PREVIOUS_IMAGE].top + 1 }; + const auto bottomRight = windowPos + + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].right - 1, widgets[WIDX_PREVIOUS_IMAGE].bottom - 1 }; + GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + + GfxDrawSprite( + dpi, ImageId(SPR_PREVIOUS), + windowPos + ScreenCoordsXY{ widgets[WIDX_PREVIOUS_IMAGE].left + 6, widgets[WIDX_PREVIOUS_IMAGE].top + 6 }); + + colour_t textColour = NOT_TRANSLUCENT(colours[1]); + if (gHoverWidget.window_classification == WindowClass::BottomToolbar + && gHoverWidget.widget_index == WIDX_PREVIOUS_STEP_BUTTON) + { + textColour = COLOUR_WHITE; + } + + int16_t textX = (widgets[WIDX_PREVIOUS_IMAGE].left + 30 + widgets[WIDX_PREVIOUS_IMAGE].right) / 2 + windowPos.x; + int16_t textY = widgets[WIDX_PREVIOUS_IMAGE].top + 6 + windowPos.y; + + StringId stringId = _editorStepNames[EnumValue(GetGameState().EditorStep) - 1]; + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + stringId = STR_EDITOR_STEP_OBJECT_SELECTION; + + DrawTextBasic(dpi, { textX, textY }, STR_BACK_TO_PREVIOUS_STEP, {}, { textColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); + } + + void DrawRightButtonBack(DrawPixelInfo& dpi) + { + auto nextWidget = widgets[WIDX_NEXT_IMAGE]; + auto leftTop = windowPos + ScreenCoordsXY{ nextWidget.left, nextWidget.top }; + auto rightBottom = windowPos + ScreenCoordsXY{ nextWidget.right, nextWidget.bottom }; + GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); + } + + void DrawRightButton(DrawPixelInfo& dpi) + { + const auto topLeft = windowPos + + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].left + 1, widgets[WIDX_NEXT_IMAGE].top + 1 }; + const auto bottomRight = windowPos + + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 1, widgets[WIDX_NEXT_IMAGE].bottom - 1 }; + GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + + GfxDrawSprite( + dpi, ImageId(SPR_NEXT), + windowPos + ScreenCoordsXY{ widgets[WIDX_NEXT_IMAGE].right - 29, widgets[WIDX_NEXT_IMAGE].top + 6 }); + + colour_t textColour = NOT_TRANSLUCENT(colours[1]); + + if (gHoverWidget.window_classification == WindowClass::BottomToolbar + && gHoverWidget.widget_index == WIDX_NEXT_STEP_BUTTON) + { + textColour = COLOUR_WHITE; + } + + int16_t textX = (widgets[WIDX_NEXT_IMAGE].left + widgets[WIDX_NEXT_IMAGE].right - 30) / 2 + windowPos.x; + int16_t textY = widgets[WIDX_NEXT_IMAGE].top + 6 + windowPos.y; + + StringId stringId = _editorStepNames[EnumValue(GetGameState().EditorStep) + 1]; + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + stringId = STR_EDITOR_STEP_ROLLERCOASTER_DESIGNER; + + DrawTextBasic(dpi, { textX, textY }, STR_FORWARD_TO_NEXT_STEP, {}, { textColour, TextAlignment::CENTRE }); + DrawTextBasic(dpi, { textX, textY + 10 }, stringId, {}, { textColour, TextAlignment::CENTRE }); + } + + void DrawStepText(DrawPixelInfo& dpi) + { + int16_t stateX = (widgets[WIDX_PREVIOUS_IMAGE].right + widgets[WIDX_NEXT_IMAGE].left) / 2 + windowPos.x; + int16_t stateY = height - 0x0C + windowPos.y; + DrawTextBasic( + dpi, { stateX, stateY }, _editorStepNames[EnumValue(GetGameState().EditorStep)], {}, + { static_cast(NOT_TRANSLUCENT(colours[2]) | COLOUR_FLAG_OUTLINE), TextAlignment::CENTRE }); + } + + static constexpr FuncPtr _previousButtonMouseUp[] = { + nullptr, + &EditorBottomToolbarWindow::JumpBackToObjectSelection, + &EditorBottomToolbarWindow::JumpBackToLandscapeEditor, + &EditorBottomToolbarWindow::JumpBackToInventionListSetUp, + &EditorBottomToolbarWindow::JumpBackToOptionsSelection, + nullptr, + &EditorBottomToolbarWindow::JumpBackToObjectSelection, + nullptr, + }; + + static constexpr FuncPtr _nextButtonMouseUp[] = { + &EditorBottomToolbarWindow::JumpForwardFromObjectSelection, + &EditorBottomToolbarWindow::JumpForwardToInventionListSetUp, + &EditorBottomToolbarWindow::JumpForwardToOptionsSelection, + &EditorBottomToolbarWindow::JumpForwardToObjectiveSelection, + &EditorBottomToolbarWindow::JumpForwardToSaveScenario, + nullptr, + nullptr, + nullptr, + }; }; - static constexpr FuncPtr _nextButtonMouseUp[] = { - &EditorBottomToolbarWindow::JumpForwardFromObjectSelection, - &EditorBottomToolbarWindow::JumpForwardToInventionListSetUp, - &EditorBottomToolbarWindow::JumpForwardToOptionsSelection, - &EditorBottomToolbarWindow::JumpForwardToObjectiveSelection, - &EditorBottomToolbarWindow::JumpForwardToSaveScenario, - nullptr, - nullptr, - nullptr, - }; -}; + /** + * Creates the main editor top toolbar window. + * rct2: 0x0066F052 (part of 0x0066EF38) + */ + WindowBase* WindowEditorBottomToolbarOpen() + { + auto* window = WindowCreate( + WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32, + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); -/** - * Creates the main editor top toolbar window. - * rct2: 0x0066F052 (part of 0x0066EF38) - */ -WindowBase* WindowEditorBottomToolbarOpen() -{ - auto* window = WindowCreate( - WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); - - return window; -} + return window; + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index cce7f2ac2c..2b292e5efb 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -26,15 +26,15 @@ #include #include +namespace OpenRCT2::Ui::Windows +{ #pragma region Widgets -using namespace OpenRCT2; + static constexpr int32_t WW = 600; + static constexpr int32_t WH = 400; + static constexpr StringId WINDOW_TITLE = STR_INVENTION_LIST; -static constexpr int32_t WW = 600; -static constexpr int32_t WH = 400; -static constexpr StringId WINDOW_TITLE = STR_INVENTION_LIST; - -// clang-format off + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -66,636 +66,640 @@ static Widget _inventionListDragWidgets[] = { MakeWidget({0, 0}, {150, 14}, WindowWidgetType::ImgBtn, WindowColour::Primary), kWidgetsEnd, }; -// clang-format on + // clang-format on #pragma endregion -static void WindowEditorInventionsListDragOpen( - ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth); -static const ResearchItem* WindowEditorInventionsListDragGetItem(); + static void WindowEditorInventionsListDragOpen( + ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth); + static const ResearchItem* WindowEditorInventionsListDragGetItem(); -/** - * - * rct2: 0x0068596F - * Sets rides that are in use to be always researched - */ -static void ResearchRidesSetup() -{ - // Reset all objects to not required - for (auto objectType : TransientObjectTypes) + /** + * + * rct2: 0x0068596F + * Sets rides that are in use to be always researched + */ + static void ResearchRidesSetup() { - auto maxObjects = object_entry_group_counts[EnumValue(objectType)]; - for (int32_t i = 0; i < maxObjects; i++) + // Reset all objects to not required + for (auto objectType : TransientObjectTypes) { - Editor::ClearSelectedObject(objectType, i, ObjectSelectionFlags::AllFlags); + auto maxObjects = object_entry_group_counts[EnumValue(objectType)]; + for (int32_t i = 0; i < maxObjects; i++) + { + Editor::ClearSelectedObject(objectType, i, ObjectSelectionFlags::AllFlags); + } + } + + // Set research required for rides in use + for (const auto& ride : GetRideManager()) + { + Editor::SetSelectedObject( + ObjectType::Ride, ride.subtype, ObjectSelectionFlags::Selected | ObjectSelectionFlags::InUse); } } - // Set research required for rides in use - for (const auto& ride : GetRideManager()) + static void DrawResearchItem( + DrawPixelInfo& dpi, const ResearchItem& researchItem, const int16_t& width, const ScreenCoordsXY& screenCoords, + StringId format, TextPaint textPaint) { - Editor::SetSelectedObject(ObjectType::Ride, ride.subtype, ObjectSelectionFlags::Selected | ObjectSelectionFlags::InUse); + const StringId itemNameId = researchItem.GetName(); + int16_t columnSplitOffset = width / 2; + + if (researchItem.type == Research::EntryType::Ride + && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + const StringId rideTypeName = GetRideNaming( + researchItem.baseRideType, *GetRideEntryByIndex(researchItem.entryIndex)) + .Name; + + // Draw group name + auto ft = Formatter(); + ft.Add(rideTypeName); + DrawTextEllipsised(dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint); + + // Draw vehicle name + ft = Formatter(); + ft.Add(itemNameId); + DrawTextEllipsised( + dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint); + } + else + { + // Scenery group, flat ride or shopdis + auto ft = Formatter(); + ft.Add(itemNameId); + DrawTextEllipsised(dpi, screenCoords, width, format, ft, textPaint); + } } -} - -static void DrawResearchItem( - DrawPixelInfo& dpi, const ResearchItem& researchItem, const int16_t& width, const ScreenCoordsXY& screenCoords, - StringId format, TextPaint textPaint) -{ - const StringId itemNameId = researchItem.GetName(); - int16_t columnSplitOffset = width / 2; - - if (researchItem.type == Research::EntryType::Ride - && !GetRideTypeDescriptor(researchItem.baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - const StringId rideTypeName = GetRideNaming(researchItem.baseRideType, *GetRideEntryByIndex(researchItem.entryIndex)) - .Name; - - // Draw group name - auto ft = Formatter(); - ft.Add(rideTypeName); - DrawTextEllipsised(dpi, screenCoords, columnSplitOffset - 11, format, ft, textPaint); - - // Draw vehicle name - ft = Formatter(); - ft.Add(itemNameId); - DrawTextEllipsised( - dpi, { screenCoords + ScreenCoordsXY{ columnSplitOffset, 0 } }, columnSplitOffset - 11, format, ft, textPaint); - } - else - { - // Scenery group, flat ride or shopdis - auto ft = Formatter(); - ft.Add(itemNameId); - DrawTextEllipsised(dpi, screenCoords, width, format, ft, textPaint); - } -} #pragma region Invention List Window -struct InventionListItem -{ - ResearchItem* research = nullptr; - bool isInvented = true; -}; - -class InventionListWindow final : public Window -{ - ResearchItem* _selectedResearchItem; - -public: - void OnOpen() override + struct InventionListItem { - ResearchRidesSetup(); + ResearchItem* research = nullptr; + bool isInvented = true; + }; - widgets = _inventionListWidgets; - InitScrollWidgets(); - selected_tab = 0; - _selectedResearchItem = nullptr; - - min_width = WW; - min_height = WH; - max_width = WW * 2; - max_height = WH * 2; - } - - void OnClose() override + class InventionListWindow final : public Window { - ResearchRemoveFlags(); + ResearchItem* _selectedResearchItem; - // When used in-game (as a cheat) - if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) + public: + void OnOpen() override { - gSilentResearch = true; - ResearchResetCurrentItem(); - gSilentResearch = false; + ResearchRidesSetup(); + + widgets = _inventionListWidgets; + InitScrollWidgets(); + selected_tab = 0; + _selectedResearchItem = nullptr; + + min_width = WW; + min_height = WH; + max_width = WW * 2; + max_height = WH * 2; } - } - void OnMouseUp(WidgetIndex widx) override - { - switch (widx) + void OnClose() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_RANDOM_SHUFFLE: - ResearchItemsShuffle(); - Invalidate(); - break; - case WIDX_MOVE_ITEMS_TO_TOP: - ResearchItemsMakeAllResearched(); - InitScrollWidgets(); - Invalidate(); - break; - case WIDX_MOVE_ITEMS_TO_BOTTOM: - ResearchItemsMakeAllUnresearched(); - InitScrollWidgets(); - Invalidate(); - break; + ResearchRemoveFlags(); + + // When used in-game (as a cheat) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) + { + gSilentResearch = true; + ResearchResetCurrentItem(); + gSilentResearch = false; + } } - } - void OnResize() override - { - if (width < min_width) + void OnMouseUp(WidgetIndex widx) override { + switch (widx) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_RANDOM_SHUFFLE: + ResearchItemsShuffle(); + Invalidate(); + break; + case WIDX_MOVE_ITEMS_TO_TOP: + ResearchItemsMakeAllResearched(); + InitScrollWidgets(); + Invalidate(); + break; + case WIDX_MOVE_ITEMS_TO_BOTTOM: + ResearchItemsMakeAllUnresearched(); + InitScrollWidgets(); + Invalidate(); + break; + } + } + + void OnResize() override + { + if (width < min_width) + { + Invalidate(); + width = min_width; + } + if (height < min_height) + { + Invalidate(); + height = min_height; + } + } + + void OnUpdate() override + { + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_1); + + if (WindowEditorInventionsListDragGetItem() != nullptr) + return; + Invalidate(); - width = min_width; } - if (height < min_height) + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - Invalidate(); - height = min_height; + const auto& gameState = GetGameState(); + ScreenSize size{}; + if (scrollIndex == 0) + { + size.height = static_cast(gameState.ResearchItemsInvented.size()) * SCROLLABLE_ROW_HEIGHT; + } + else + { + size.height = static_cast(gameState.ResearchItemsUninvented.size()) * SCROLLABLE_ROW_HEIGHT; + } + return size; } - } - void OnUpdate() override - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_1); - - if (WindowEditorInventionsListDragGetItem() != nullptr) - return; - - Invalidate(); - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - const auto& gameState = GetGameState(); - ScreenSize size{}; - if (scrollIndex == 0) + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - size.height = static_cast(gameState.ResearchItemsInvented.size()) * SCROLLABLE_ROW_HEIGHT; + auto* researchItem = GetItemFromScrollY(scrollIndex == 0, screenCoords.y); + if (researchItem != _selectedResearchItem) + { + _selectedResearchItem = researchItem; + Invalidate(); + + // Prevent always-researched items from being highlighted when hovered over + if (researchItem != nullptr && researchItem->IsAlwaysResearched()) + { + _selectedResearchItem = nullptr; + } + } } - else - { - size.height = static_cast(gameState.ResearchItemsUninvented.size()) * SCROLLABLE_ROW_HEIGHT; - } - return size; - } - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto* researchItem = GetItemFromScrollY(scrollIndex == 0, screenCoords.y); - if (researchItem != _selectedResearchItem) + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - _selectedResearchItem = researchItem; + auto* researchItem = GetItemFromScrollY(scrollIndex == 0, screenCoords.y); + if (researchItem == nullptr) + return; + + // Disallow picking up always-researched items + if (researchItem->IsAlwaysResearched()) + return; + Invalidate(); - // Prevent always-researched items from being highlighted when hovered over - if (researchItem != nullptr && researchItem->IsAlwaysResearched()) - { - _selectedResearchItem = nullptr; - } + WindowEditorInventionsListDragOpen(researchItem, windowPos, widgets[WIDX_PRE_RESEARCHED_SCROLL].right); } - } - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto* researchItem = GetItemFromScrollY(scrollIndex == 0, screenCoords.y); - if (researchItem == nullptr) - return; - - // Disallow picking up always-researched items - if (researchItem->IsAlwaysResearched()) - return; - - Invalidate(); - - WindowEditorInventionsListDragOpen(researchItem, windowPos, widgets[WIDX_PRE_RESEARCHED_SCROLL].right); - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - const auto& gameState = GetGameState(); - - // Draw background - uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); - - int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width(); - int32_t itemY = -SCROLLABLE_ROW_HEIGHT; - auto* dragItem = WindowEditorInventionsListDragGetItem(); - - const auto& researchList = scrollIndex == 0 ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; - for (const auto& researchItem : researchList) + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - itemY += SCROLLABLE_ROW_HEIGHT; - if (itemY + SCROLLABLE_ROW_HEIGHT < dpi.y || itemY >= dpi.y + dpi.height) - continue; + const auto& gameState = GetGameState(); - if (_selectedResearchItem == &researchItem) + // Draw background + uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; + GfxClear(&dpi, paletteIndex); + + int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width(); + int32_t itemY = -SCROLLABLE_ROW_HEIGHT; + auto* dragItem = WindowEditorInventionsListDragGetItem(); + + const auto& researchList = scrollIndex == 0 ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; + for (const auto& researchItem : researchList) { - int32_t top, bottom; - if (dragItem == nullptr) + itemY += SCROLLABLE_ROW_HEIGHT; + if (itemY + SCROLLABLE_ROW_HEIGHT < dpi.y || itemY >= dpi.y + dpi.height) + continue; + + if (_selectedResearchItem == &researchItem) { - // Highlight - top = itemY; - bottom = itemY + SCROLLABLE_ROW_HEIGHT - 1; - } - else - { - // Drop horizontal rule - top = itemY - 1; - bottom = itemY; + int32_t top, bottom; + if (dragItem == nullptr) + { + // Highlight + top = itemY; + bottom = itemY + SCROLLABLE_ROW_HEIGHT - 1; + } + else + { + // Drop horizontal rule + top = itemY - 1; + bottom = itemY; + } + + GfxFilterRect(dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1); } - GfxFilterRect(dpi, { 0, top, boxWidth, bottom }, FilterPaletteID::PaletteDarken1); - } + if (dragItem != nullptr && researchItem == *dragItem) + continue; - if (dragItem != nullptr && researchItem == *dragItem) - continue; + // TODO: this parameter by itself produces very light text. + // It needs a {BLACK} token in the string to work properly. + colour_t colour = COLOUR_BLACK; + FontStyle fontStyle = FontStyle::Medium; + auto darkness = TextDarkness::Regular; - // TODO: this parameter by itself produces very light text. - // It needs a {BLACK} token in the string to work properly. - colour_t colour = COLOUR_BLACK; - FontStyle fontStyle = FontStyle::Medium; - auto darkness = TextDarkness::Regular; - - if (researchItem.IsAlwaysResearched()) - { - if (_selectedResearchItem == &researchItem && dragItem == nullptr) - darkness = TextDarkness::ExtraDark; - else - darkness = TextDarkness::Dark; - colour = colours[1] | COLOUR_FLAG_INSET; - } - - DrawResearchItem(dpi, researchItem, boxWidth, { 1, itemY }, STR_BLACK_STRING, { colour, fontStyle, darkness }); - } - } - - CursorID OnCursor(WidgetIndex widx, const ScreenCoordsXY& screenCoords, CursorID fallback) override - { - bool isInvented = false; - - switch (widx) - { - case WIDX_PRE_RESEARCHED_SCROLL: - isInvented = true; - break; - case WIDX_RESEARCH_ORDER_SCROLL: - isInvented = false; - break; - default: - return fallback; - } - - // Use the open hand as cursor for items that can be picked up - auto* researchItem = GetItemFromScrollY(isInvented, screenCoords.y); - if (researchItem != nullptr && !researchItem->IsAlwaysResearched()) - { - return CursorID::HandOpen; - } - return fallback; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - // Tab image - auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }; - GfxDrawSprite(dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0 + (frame_no / 2) % 8), screenPos); - - // Pre-researched items label - screenPos = windowPos - + ScreenCoordsXY{ widgets[WIDX_PRE_RESEARCHED_SCROLL].left, widgets[WIDX_PRE_RESEARCHED_SCROLL].top - 11 }; - DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_PREINVENTED_ITEMS); - - // Research order label - screenPos = windowPos - + ScreenCoordsXY{ widgets[WIDX_RESEARCH_ORDER_SCROLL].left, widgets[WIDX_RESEARCH_ORDER_SCROLL].top - 11 }; - DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_TO_BE_INVENTED_ITEMS); - - // Preview background - auto& bkWidget = widgets[WIDX_PREVIEW]; - GfxFillRect( - dpi, - { windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 }, - windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } }, - ColourMapA[colours[1]].darkest); - - auto* researchItem = WindowEditorInventionsListDragGetItem(); - if (researchItem == nullptr || researchItem->IsNull()) - researchItem = _selectedResearchItem; - // If the research item is null or a list separator. - if (researchItem == nullptr || researchItem->IsNull()) - return; - - // Preview image - ObjectType objectEntryType = ObjectType::SceneryGroup; - if (researchItem->type == Research::EntryType::Ride) - objectEntryType = ObjectType::Ride; - - auto chunk = ObjectEntryGetChunk(objectEntryType, researchItem->entryIndex); - if (chunk == nullptr) - return; - - // Draw preview - const auto* object = ObjectEntryGetObject(objectEntryType, researchItem->entryIndex); - if (object != nullptr) - { - DrawPixelInfo clipDPI; - screenPos = windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 }; - const auto clipWidth = bkWidget.width() - 1; - const auto clipHeight = bkWidget.height() - 1; - if (ClipDrawPixelInfo(clipDPI, dpi, screenPos, clipWidth, clipHeight)) - { - object->DrawPreview(clipDPI, clipWidth, clipHeight); - } - } - - // Item name - screenPos = windowPos + ScreenCoordsXY{ bkWidget.midX() + 1, bkWidget.bottom + 3 }; - const auto itemWidth = width - widgets[WIDX_RESEARCH_ORDER_SCROLL].right - 6; - - StringId drawString = STR_WINDOW_COLOUR_2_STRINGID; - StringId stringId = researchItem->GetName(); - auto ft = Formatter(); - - if (researchItem->type == Research::EntryType::Ride - && !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - drawString = STR_WINDOW_COLOUR_2_STRINGID_STRINGID; - StringId rideTypeName = GetRideNaming(researchItem->baseRideType, *GetRideEntryByIndex(researchItem->entryIndex)) - .Name; - ft.Add(rideTypeName); - ft.Add(stringId); - } - else - { - ft.Add(stringId); - } - - DrawTextEllipsised(dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE }); - screenPos.y += 15; - - // Item category - screenPos.x = windowPos.x + widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4; - ft = Formatter(); - ft.Add(researchItem->GetCategoryInventionString()); - DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft); - } - - void OnPrepareDraw() override - { - pressed_widgets |= 1uLL << WIDX_PREVIEW; - pressed_widgets |= 1uLL << WIDX_TAB_1; - - widgets[WIDX_CLOSE].type = gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR ? WindowWidgetType::Empty - : WindowWidgetType::CloseBox; - - ResizeFrameWithPage(); - - int16_t scrollListHeight = (height - 88) / 2; - - widgets[WIDX_PRE_RESEARCHED_SCROLL].bottom = 60 + scrollListHeight; - widgets[WIDX_PRE_RESEARCHED_SCROLL].right = width - 229; - - widgets[WIDX_RESEARCH_ORDER_SCROLL].top = widgets[WIDX_PRE_RESEARCHED_SCROLL].bottom + 15; - widgets[WIDX_RESEARCH_ORDER_SCROLL].bottom = widgets[WIDX_RESEARCH_ORDER_SCROLL].top + scrollListHeight; - widgets[WIDX_RESEARCH_ORDER_SCROLL].right = width - 229; - - widgets[WIDX_PREVIEW].left = width - 169; - widgets[WIDX_PREVIEW].right = width - 56; - - widgets[WIDX_MOVE_ITEMS_TO_TOP].top = height - 57; - widgets[WIDX_MOVE_ITEMS_TO_TOP].bottom = height - 44; - widgets[WIDX_MOVE_ITEMS_TO_TOP].left = width - 225; - widgets[WIDX_MOVE_ITEMS_TO_TOP].right = width - 6; - - widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].top = height - 42; - widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].bottom = height - 29; - widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].left = width - 225; - widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].right = width - 6; - - widgets[WIDX_RANDOM_SHUFFLE].top = height - 27; - widgets[WIDX_RANDOM_SHUFFLE].bottom = height - 14; - widgets[WIDX_RANDOM_SHUFFLE].left = width - 225; - widgets[WIDX_RANDOM_SHUFFLE].right = width - 6; - } - - // Get Research Item and Scroll Id (scroll id represents invented(0)/not invented(1)/failure(-1) - std::optional GetResearchItemAt(const ScreenCoordsXY& screenCoords) - { - if (windowPos.x <= screenCoords.x && windowPos.y < screenCoords.y && windowPos.x + width > screenCoords.x - && windowPos.y + height > screenCoords.y) - { - WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, screenCoords); - auto& widget = widgets[widgetIndex]; - if (widgetIndex == WIDX_PRE_RESEARCHED_SCROLL || widgetIndex == WIDX_RESEARCH_ORDER_SCROLL) - { - gPressedWidget.widget_index = widgetIndex; - int32_t outScrollArea{}; - ScreenCoordsXY outScrollCoords{}; - int32_t outScrollId{}; - WidgetScrollGetPart(*this, &widget, screenCoords, outScrollCoords, &outScrollArea, &outScrollId); - if (outScrollArea == SCROLL_PART_VIEW) + if (researchItem.IsAlwaysResearched()) { - const auto isInvented = outScrollId == 0; - int32_t scrollY = outScrollCoords.y + 6; - return InventionListItem{ GetItemFromScrollYIncludeSeps(isInvented, scrollY), isInvented }; + if (_selectedResearchItem == &researchItem && dragItem == nullptr) + darkness = TextDarkness::ExtraDark; + else + darkness = TextDarkness::Dark; + colour = colours[1] | COLOUR_FLAG_INSET; + } + + DrawResearchItem(dpi, researchItem, boxWidth, { 1, itemY }, STR_BLACK_STRING, { colour, fontStyle, darkness }); + } + } + + CursorID OnCursor(WidgetIndex widx, const ScreenCoordsXY& screenCoords, CursorID fallback) override + { + bool isInvented = false; + + switch (widx) + { + case WIDX_PRE_RESEARCHED_SCROLL: + isInvented = true; + break; + case WIDX_RESEARCH_ORDER_SCROLL: + isInvented = false; + break; + default: + return fallback; + } + + // Use the open hand as cursor for items that can be picked up + auto* researchItem = GetItemFromScrollY(isInvented, screenCoords.y); + if (researchItem != nullptr && !researchItem->IsAlwaysResearched()) + { + return CursorID::HandOpen; + } + return fallback; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + // Tab image + auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }; + GfxDrawSprite(dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0 + (frame_no / 2) % 8), screenPos); + + // Pre-researched items label + screenPos = windowPos + + ScreenCoordsXY{ widgets[WIDX_PRE_RESEARCHED_SCROLL].left, widgets[WIDX_PRE_RESEARCHED_SCROLL].top - 11 }; + DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_PREINVENTED_ITEMS); + + // Research order label + screenPos = windowPos + + ScreenCoordsXY{ widgets[WIDX_RESEARCH_ORDER_SCROLL].left, widgets[WIDX_RESEARCH_ORDER_SCROLL].top - 11 }; + DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 0, 1 }, STR_INVENTION_TO_BE_INVENTED_ITEMS); + + // Preview background + auto& bkWidget = widgets[WIDX_PREVIEW]; + GfxFillRect( + dpi, + { windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 }, + windowPos + ScreenCoordsXY{ bkWidget.right - 1, bkWidget.bottom - 1 } }, + ColourMapA[colours[1]].darkest); + + auto* researchItem = WindowEditorInventionsListDragGetItem(); + if (researchItem == nullptr || researchItem->IsNull()) + researchItem = _selectedResearchItem; + // If the research item is null or a list separator. + if (researchItem == nullptr || researchItem->IsNull()) + return; + + // Preview image + ObjectType objectEntryType = ObjectType::SceneryGroup; + if (researchItem->type == Research::EntryType::Ride) + objectEntryType = ObjectType::Ride; + + auto chunk = ObjectEntryGetChunk(objectEntryType, researchItem->entryIndex); + if (chunk == nullptr) + return; + + // Draw preview + const auto* object = ObjectEntryGetObject(objectEntryType, researchItem->entryIndex); + if (object != nullptr) + { + DrawPixelInfo clipDPI; + screenPos = windowPos + ScreenCoordsXY{ bkWidget.left + 1, bkWidget.top + 1 }; + const auto clipWidth = bkWidget.width() - 1; + const auto clipHeight = bkWidget.height() - 1; + if (ClipDrawPixelInfo(clipDPI, dpi, screenPos, clipWidth, clipHeight)) + { + object->DrawPreview(clipDPI, clipWidth, clipHeight); } } + + // Item name + screenPos = windowPos + ScreenCoordsXY{ bkWidget.midX() + 1, bkWidget.bottom + 3 }; + const auto itemWidth = width - widgets[WIDX_RESEARCH_ORDER_SCROLL].right - 6; + + StringId drawString = STR_WINDOW_COLOUR_2_STRINGID; + StringId stringId = researchItem->GetName(); + auto ft = Formatter(); + + if (researchItem->type == Research::EntryType::Ride + && !GetRideTypeDescriptor(researchItem->baseRideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + drawString = STR_WINDOW_COLOUR_2_STRINGID_STRINGID; + StringId rideTypeName = GetRideNaming( + researchItem->baseRideType, *GetRideEntryByIndex(researchItem->entryIndex)) + .Name; + ft.Add(rideTypeName); + ft.Add(stringId); + } + else + { + ft.Add(stringId); + } + + DrawTextEllipsised(dpi, screenPos, itemWidth, drawString, ft, { TextAlignment::CENTRE }); + screenPos.y += 15; + + // Item category + screenPos.x = windowPos.x + widgets[WIDX_RESEARCH_ORDER_SCROLL].right + 4; + ft = Formatter(); + ft.Add(researchItem->GetCategoryInventionString()); + DrawTextBasic(dpi, screenPos, STR_INVENTION_RESEARCH_GROUP, ft); } - return std::nullopt; - } - - bool IsResearchItemSelected(ResearchItem* item) const - { - return item == _selectedResearchItem; - } - - // hack to fix #17544: OnScrollMouseOver never gets called while dragging - void SetSelectedResearchItem(ResearchItem* item) - { - _selectedResearchItem = item; - } - - void MoveResearchItem(const ResearchItem& item, ResearchItem* beforeItem, bool isInvented) - { - auto& gameState = GetGameState(); - _selectedResearchItem = nullptr; - Invalidate(); - - uint32_t beforeItemRawValue = 0; - if (beforeItem != nullptr) - beforeItemRawValue = beforeItem->rawValue; - - if (item.rawValue == beforeItemRawValue) - return; - - ResearchRemove(item); - - auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; - if (beforeItem != nullptr) + void OnPrepareDraw() override { - for (size_t i = 0; i < researchList.size(); i++) + pressed_widgets |= 1uLL << WIDX_PREVIEW; + pressed_widgets |= 1uLL << WIDX_TAB_1; + + widgets[WIDX_CLOSE].type = gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR ? WindowWidgetType::Empty + : WindowWidgetType::CloseBox; + + ResizeFrameWithPage(); + + int16_t scrollListHeight = (height - 88) / 2; + + widgets[WIDX_PRE_RESEARCHED_SCROLL].bottom = 60 + scrollListHeight; + widgets[WIDX_PRE_RESEARCHED_SCROLL].right = width - 229; + + widgets[WIDX_RESEARCH_ORDER_SCROLL].top = widgets[WIDX_PRE_RESEARCHED_SCROLL].bottom + 15; + widgets[WIDX_RESEARCH_ORDER_SCROLL].bottom = widgets[WIDX_RESEARCH_ORDER_SCROLL].top + scrollListHeight; + widgets[WIDX_RESEARCH_ORDER_SCROLL].right = width - 229; + + widgets[WIDX_PREVIEW].left = width - 169; + widgets[WIDX_PREVIEW].right = width - 56; + + widgets[WIDX_MOVE_ITEMS_TO_TOP].top = height - 57; + widgets[WIDX_MOVE_ITEMS_TO_TOP].bottom = height - 44; + widgets[WIDX_MOVE_ITEMS_TO_TOP].left = width - 225; + widgets[WIDX_MOVE_ITEMS_TO_TOP].right = width - 6; + + widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].top = height - 42; + widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].bottom = height - 29; + widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].left = width - 225; + widgets[WIDX_MOVE_ITEMS_TO_BOTTOM].right = width - 6; + + widgets[WIDX_RANDOM_SHUFFLE].top = height - 27; + widgets[WIDX_RANDOM_SHUFFLE].bottom = height - 14; + widgets[WIDX_RANDOM_SHUFFLE].left = width - 225; + widgets[WIDX_RANDOM_SHUFFLE].right = width - 6; + } + + // Get Research Item and Scroll Id (scroll id represents invented(0)/not invented(1)/failure(-1) + std::optional GetResearchItemAt(const ScreenCoordsXY& screenCoords) + { + if (windowPos.x <= screenCoords.x && windowPos.y < screenCoords.y && windowPos.x + width > screenCoords.x + && windowPos.y + height > screenCoords.y) { - if (researchList[i].rawValue == beforeItemRawValue) + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, screenCoords); + auto& widget = widgets[widgetIndex]; + if (widgetIndex == WIDX_PRE_RESEARCHED_SCROLL || widgetIndex == WIDX_RESEARCH_ORDER_SCROLL) { - researchList.insert((researchList.begin() + i), item); - return; + gPressedWidget.widget_index = widgetIndex; + int32_t outScrollArea{}; + ScreenCoordsXY outScrollCoords{}; + int32_t outScrollId{}; + WidgetScrollGetPart(*this, &widget, screenCoords, outScrollCoords, &outScrollArea, &outScrollId); + if (outScrollArea == SCROLL_PART_VIEW) + { + const auto isInvented = outScrollId == 0; + int32_t scrollY = outScrollCoords.y + 6; + return InventionListItem{ GetItemFromScrollYIncludeSeps(isInvented, scrollY), isInvented }; + } } } + + return std::nullopt; } - // Still not found? Append to end of list. - researchList.push_back(item); - } - -private: - ResearchItem* GetItemFromScrollY(bool isInvented, int32_t y) const - { - auto& gameState = GetGameState(); - auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; - for (auto& researchItem : researchList) + bool IsResearchItemSelected(ResearchItem* item) const { - y -= SCROLLABLE_ROW_HEIGHT; - if (y < 0) - { - return &researchItem; - } + return item == _selectedResearchItem; } - return nullptr; - } - - ResearchItem* GetItemFromScrollYIncludeSeps(bool isInvented, int32_t y) const - { - auto& gameState = GetGameState(); - auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; - for (auto& researchItem : researchList) + // hack to fix #17544: OnScrollMouseOver never gets called while dragging + void SetSelectedResearchItem(ResearchItem* item) { - y -= SCROLLABLE_ROW_HEIGHT; - if (y < 0) - { - return &researchItem; - } + _selectedResearchItem = item; } - return nullptr; - } -}; -/** - * - * rct2: 0x00684E04 - */ -WindowBase* WindowEditorInventionsListOpen() -{ - return WindowFocusOrCreate( - WindowClass::EditorInventionList, WW, WH, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN); -} + void MoveResearchItem(const ResearchItem& item, ResearchItem* beforeItem, bool isInvented) + { + auto& gameState = GetGameState(); + _selectedResearchItem = nullptr; + Invalidate(); + + uint32_t beforeItemRawValue = 0; + if (beforeItem != nullptr) + beforeItemRawValue = beforeItem->rawValue; + + if (item.rawValue == beforeItemRawValue) + return; + + ResearchRemove(item); + + auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; + if (beforeItem != nullptr) + { + for (size_t i = 0; i < researchList.size(); i++) + { + if (researchList[i].rawValue == beforeItemRawValue) + { + researchList.insert((researchList.begin() + i), item); + return; + } + } + } + + // Still not found? Append to end of list. + researchList.push_back(item); + } + + private: + ResearchItem* GetItemFromScrollY(bool isInvented, int32_t y) const + { + auto& gameState = GetGameState(); + auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; + for (auto& researchItem : researchList) + { + y -= SCROLLABLE_ROW_HEIGHT; + if (y < 0) + { + return &researchItem; + } + } + + return nullptr; + } + + ResearchItem* GetItemFromScrollYIncludeSeps(bool isInvented, int32_t y) const + { + auto& gameState = GetGameState(); + auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented; + for (auto& researchItem : researchList) + { + y -= SCROLLABLE_ROW_HEIGHT; + if (y < 0) + { + return &researchItem; + } + } + return nullptr; + } + }; + + /** + * + * rct2: 0x00684E04 + */ + WindowBase* WindowEditorInventionsListOpen() + { + return WindowFocusOrCreate( + WindowClass::EditorInventionList, WW, WH, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN); + } #pragma endregion #pragma region Drag item -class InventionDragWindow final : public Window -{ - ResearchItem _draggedItem; - -public: - void OnOpen() override + class InventionDragWindow final : public Window { - widgets = _inventionListDragWidgets; - colours[1] = COLOUR_WHITE; - } + ResearchItem _draggedItem; - CursorID OnCursor(const WidgetIndex widx, const ScreenCoordsXY& screenCoords, const CursorID defaultCursor) override - { - auto* inventionListWindow = static_cast(WindowFindByClass(WindowClass::EditorInventionList)); - if (inventionListWindow != nullptr) + public: + void OnOpen() override { - auto res = inventionListWindow->GetResearchItemAt(screenCoords); - auto* research = res.has_value() ? res->research : nullptr; - if (!inventionListWindow->IsResearchItemSelected(research)) + widgets = _inventionListDragWidgets; + colours[1] = COLOUR_WHITE; + } + + CursorID OnCursor(const WidgetIndex widx, const ScreenCoordsXY& screenCoords, const CursorID defaultCursor) override + { + auto* inventionListWindow = static_cast(WindowFindByClass(WindowClass::EditorInventionList)); + if (inventionListWindow != nullptr) { - inventionListWindow->SetSelectedResearchItem(research); - inventionListWindow->Invalidate(); + auto res = inventionListWindow->GetResearchItemAt(screenCoords); + auto* research = res.has_value() ? res->research : nullptr; + if (!inventionListWindow->IsResearchItemSelected(research)) + { + inventionListWindow->SetSelectedResearchItem(research); + inventionListWindow->Invalidate(); + } } + + return CursorID::HandClosed; } - return CursorID::HandClosed; - } - - void OnMoved(const ScreenCoordsXY& screenCoords) override - { - auto* inventionListWindow = static_cast(WindowFindByClass(WindowClass::EditorInventionList)); - if (inventionListWindow == nullptr) + void OnMoved(const ScreenCoordsXY& screenCoords) override { + auto* inventionListWindow = static_cast(WindowFindByClass(WindowClass::EditorInventionList)); + if (inventionListWindow == nullptr) + { + Close(); + return; + } + std::optional res; + // Skip always researched items, so that the dragged item gets placed underneath them + auto newScreenCoords = screenCoords; + do + { + res = inventionListWindow->GetResearchItemAt(newScreenCoords); + newScreenCoords.y += LIST_ROW_HEIGHT; + } while (res.has_value() && res->research != nullptr && res->research->IsAlwaysResearched()); + + if (res.has_value()) + { + inventionListWindow->MoveResearchItem(_draggedItem, res->research, res->isInvented); + } + + WindowInvalidateByClass(WindowClass::EditorInventionList); Close(); - return; - } - std::optional res; - // Skip always researched items, so that the dragged item gets placed underneath them - auto newScreenCoords = screenCoords; - do - { - res = inventionListWindow->GetResearchItemAt(newScreenCoords); - newScreenCoords.y += LIST_ROW_HEIGHT; - } while (res.has_value() && res->research != nullptr && res->research->IsAlwaysResearched()); - - if (res.has_value()) - { - inventionListWindow->MoveResearchItem(_draggedItem, res->research, res->isInvented); } - WindowInvalidateByClass(WindowClass::EditorInventionList); - Close(); - } + void OnDraw(DrawPixelInfo& dpi) override + { + auto screenCoords = windowPos + ScreenCoordsXY{ 0, 2 }; - void OnDraw(DrawPixelInfo& dpi) override + DrawResearchItem( + dpi, _draggedItem, width, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, + { COLOUR_BLACK | static_cast(COLOUR_FLAG_OUTLINE) }); + } + + void Init(ResearchItem& researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) + { + _draggedItem = researchItem; + + widgets[0].right = objectSelectionScrollWidth; + Invalidate(); + windowPos = ScreenCoordsXY{ editorPos.x, gTooltipCursor.y - 7 }; + width = objectSelectionScrollWidth; + Invalidate(); + + InputWindowPositionBegin(*this, 0, gTooltipCursor); + } + + const ResearchItem& GetItem() const + { + return _draggedItem; + } + }; + + static void WindowEditorInventionsListDragOpen( + ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) { - auto screenCoords = windowPos + ScreenCoordsXY{ 0, 2 }; - - DrawResearchItem( - dpi, _draggedItem, width, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, - { COLOUR_BLACK | static_cast(COLOUR_FLAG_OUTLINE) }); + WindowCloseByClass(WindowClass::EditorInventionListDrag); + auto* wnd = WindowCreate( + WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); + if (wnd != nullptr) + { + wnd->Init(*researchItem, editorPos, objectSelectionScrollWidth); + } } - void Init(ResearchItem& researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) + static const ResearchItem* WindowEditorInventionsListDragGetItem() { - _draggedItem = researchItem; - - widgets[0].right = objectSelectionScrollWidth; - Invalidate(); - windowPos = ScreenCoordsXY{ editorPos.x, gTooltipCursor.y - 7 }; - width = objectSelectionScrollWidth; - Invalidate(); - - InputWindowPositionBegin(*this, 0, gTooltipCursor); + auto* wnd = static_cast(WindowFindByClass(WindowClass::EditorInventionListDrag)); + if (wnd == nullptr) + { + return nullptr; + } + return &wnd->GetItem(); } - const ResearchItem& GetItem() const - { - return _draggedItem; - } -}; - -static void WindowEditorInventionsListDragOpen( - ResearchItem* researchItem, const ScreenCoordsXY& editorPos, int objectSelectionScrollWidth) -{ - WindowCloseByClass(WindowClass::EditorInventionListDrag); - auto* wnd = WindowCreate( - WindowClass::EditorInventionListDrag, 10, 14, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_SNAPPING); - if (wnd != nullptr) - { - wnd->Init(*researchItem, editorPos, objectSelectionScrollWidth); - } -} - -static const ResearchItem* WindowEditorInventionsListDragGetItem() -{ - auto* wnd = static_cast(WindowFindByClass(WindowClass::EditorInventionListDrag)); - if (wnd == nullptr) - { - return nullptr; - } - return &wnd->GetItem(); -} - #pragma endregion +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index b94649d3d9..3aa91da3df 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -42,69 +42,69 @@ #include #include -using namespace OpenRCT2; - -enum +namespace OpenRCT2::Ui::Windows { - FILTER_RCT1 = (1 << 0), - FILTER_AA = (1 << 1), - FILTER_LL = (1 << 2), - FILTER_RCT2 = (1 << 3), - FILTER_WW = (1 << 4), - FILTER_TT = (1 << 5), - FILTER_OO = (1 << 6), - FILTER_CUSTOM = (1 << 7), + enum + { + FILTER_RCT1 = (1 << 0), + FILTER_AA = (1 << 1), + FILTER_LL = (1 << 2), + FILTER_RCT2 = (1 << 3), + FILTER_WW = (1 << 4), + FILTER_TT = (1 << 5), + FILTER_OO = (1 << 6), + FILTER_CUSTOM = (1 << 7), - FILTER_RIDE_TRANSPORT = (1 << 8), - FILTER_RIDE_GENTLE = (1 << 9), - FILTER_RIDE_COASTER = (1 << 10), - FILTER_RIDE_THRILL = (1 << 11), - FILTER_RIDE_WATER = (1 << 12), - FILTER_RIDE_STALL = (1 << 13), + FILTER_RIDE_TRANSPORT = (1 << 8), + FILTER_RIDE_GENTLE = (1 << 9), + FILTER_RIDE_COASTER = (1 << 10), + FILTER_RIDE_THRILL = (1 << 11), + FILTER_RIDE_WATER = (1 << 12), + FILTER_RIDE_STALL = (1 << 13), - FILTER_SELECTED = (1 << 14), - FILTER_NONSELECTED = (1 << 15), + FILTER_SELECTED = (1 << 14), + FILTER_NONSELECTED = (1 << 15), - FILTER_RIDES = FILTER_RIDE_TRANSPORT | FILTER_RIDE_GENTLE | FILTER_RIDE_COASTER | FILTER_RIDE_THRILL | FILTER_RIDE_WATER - | FILTER_RIDE_STALL, - FILTER_ALL = FILTER_RIDES | FILTER_RCT1 | FILTER_AA | FILTER_LL | FILTER_RCT2 | FILTER_WW | FILTER_TT | FILTER_OO - | FILTER_CUSTOM | FILTER_SELECTED | FILTER_NONSELECTED, -}; + FILTER_RIDES = FILTER_RIDE_TRANSPORT | FILTER_RIDE_GENTLE | FILTER_RIDE_COASTER | FILTER_RIDE_THRILL | FILTER_RIDE_WATER + | FILTER_RIDE_STALL, + FILTER_ALL = FILTER_RIDES | FILTER_RCT1 | FILTER_AA | FILTER_LL | FILTER_RCT2 | FILTER_WW | FILTER_TT | FILTER_OO + | FILTER_CUSTOM | FILTER_SELECTED | FILTER_NONSELECTED, + }; -enum -{ - RIDE_SORT_TYPE, - RIDE_SORT_RIDE -}; + enum + { + RIDE_SORT_TYPE, + RIDE_SORT_RIDE + }; -enum -{ - DDIX_FILTER_RCT1, - DDIX_FILTER_AA, - DDIX_FILTER_LL, - DDIX_FILTER_RCT2, - DDIX_FILTER_WW, - DDIX_FILTER_TT, - DDIX_FILTER_OO, - DDIX_FILTER_CUSTOM, - DDIX_FILTER_SEPARATOR, - DDIX_FILTER_SELECTED, - DDIX_FILTER_NONSELECTED, -}; + enum + { + DDIX_FILTER_RCT1, + DDIX_FILTER_AA, + DDIX_FILTER_LL, + DDIX_FILTER_RCT2, + DDIX_FILTER_WW, + DDIX_FILTER_TT, + DDIX_FILTER_OO, + DDIX_FILTER_CUSTOM, + DDIX_FILTER_SEPARATOR, + DDIX_FILTER_SELECTED, + DDIX_FILTER_NONSELECTED, + }; -struct ObjectListItem -{ - const ObjectRepositoryItem* repositoryItem; - std::unique_ptr filter; - uint8_t* flags; -}; + struct ObjectListItem + { + const ObjectRepositoryItem* repositoryItem; + std::unique_ptr filter; + uint8_t* flags; + }; -static constexpr uint8_t _numSourceGameItems = 8; + static constexpr uint8_t _numSourceGameItems = 8; -static uint32_t _filter_flags; -static uint16_t _filter_object_counts[EnumValue(ObjectType::Count)]; + static uint32_t _filter_flags; + static uint16_t _filter_object_counts[EnumValue(ObjectType::Count)]; -static char _filter_string[MAX_PATH]; + static char _filter_string[MAX_PATH]; #define _FILTER_ALL ((_filter_flags & FILTER_ALL) == FILTER_ALL) #define _FILTER_RCT1 (_filter_flags & FILTER_RCT1) @@ -118,18 +118,18 @@ static char _filter_string[MAX_PATH]; #define _FILTER_SELECTED (_filter_flags & FILTER_SELECTED) #define _FILTER_NONSELECTED (_filter_flags & FILTER_NONSELECTED) -static constexpr StringId WINDOW_TITLE = STR_OBJECT_SELECTION; -static constexpr int32_t WH = 400; -static constexpr int32_t WW = 755; + static constexpr StringId WINDOW_TITLE = STR_OBJECT_SELECTION; + static constexpr int32_t WH = 400; + static constexpr int32_t WW = 755; -struct ObjectPageDesc -{ - StringId Caption; - uint32_t Image; - bool IsAdvanced; -}; + struct ObjectPageDesc + { + StringId Caption; + uint32_t Image; + bool IsAdvanced; + }; -// clang-format off + // clang-format off // Order of which the object tabs are displayed. static constexpr ObjectPageDesc ObjectSelectionPages[] = { { STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS, SPR_TAB_RIDE_16, false }, @@ -149,52 +149,52 @@ static constexpr ObjectPageDesc ObjectSelectionPages[] = { { STR_OBJECT_SELECTION_TERRAIN_EDGES, SPR_G2_TERRAIN_EDGE_TAB, true }, { STR_OBJECT_SELECTION_WATER, SPR_TAB_WATER, false }, }; -// clang-format on + // clang-format on -// Order of which the contents of each tab is displayed. -ObjectType static TabOrder[] = { - ObjectType::Ride, ObjectType::Station, ObjectType::Music, - ObjectType::SceneryGroup, ObjectType::SmallScenery, ObjectType::LargeScenery, - ObjectType::Walls, ObjectType::FootpathSurface, ObjectType::FootpathRailings, - ObjectType::Paths, ObjectType::PathAdditions, ObjectType::Banners, - ObjectType::ParkEntrance, ObjectType::TerrainSurface, ObjectType::TerrainEdge, - ObjectType::Water, -}; + // Order of which the contents of each tab is displayed. + ObjectType static TabOrder[] = { + ObjectType::Ride, ObjectType::Station, ObjectType::Music, + ObjectType::SceneryGroup, ObjectType::SmallScenery, ObjectType::LargeScenery, + ObjectType::Walls, ObjectType::FootpathSurface, ObjectType::FootpathRailings, + ObjectType::Paths, ObjectType::PathAdditions, ObjectType::Banners, + ObjectType::ParkEntrance, ObjectType::TerrainSurface, ObjectType::TerrainEdge, + ObjectType::Water, + }; #pragma region Widgets -enum WINDOW_EDITOR_OBJECT_SELECTION_WIDGET_IDX -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_TAB_CONTENT_PANEL, - WIDX_ADVANCED, - WIDX_LIST, - WIDX_PREVIEW, - WIDX_INSTALL_TRACK, - WIDX_FILTER_DROPDOWN, - WIDX_FILTER_TEXT_BOX, - WIDX_FILTER_CLEAR_BUTTON, - WIDX_FILTER_RIDE_TAB_FRAME, - WIDX_FILTER_RIDE_TAB_ALL, - WIDX_FILTER_RIDE_TAB_TRANSPORT, - WIDX_FILTER_RIDE_TAB_GENTLE, - WIDX_FILTER_RIDE_TAB_COASTER, - WIDX_FILTER_RIDE_TAB_THRILL, - WIDX_FILTER_RIDE_TAB_WATER, - WIDX_FILTER_RIDE_TAB_STALL, - WIDX_LIST_SORT_TYPE, - WIDX_LIST_SORT_RIDE, - WIDX_RELOAD_OBJECT, - WIDX_TAB_1, -}; + enum WINDOW_EDITOR_OBJECT_SELECTION_WIDGET_IDX + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_TAB_CONTENT_PANEL, + WIDX_ADVANCED, + WIDX_LIST, + WIDX_PREVIEW, + WIDX_INSTALL_TRACK, + WIDX_FILTER_DROPDOWN, + WIDX_FILTER_TEXT_BOX, + WIDX_FILTER_CLEAR_BUTTON, + WIDX_FILTER_RIDE_TAB_FRAME, + WIDX_FILTER_RIDE_TAB_ALL, + WIDX_FILTER_RIDE_TAB_TRANSPORT, + WIDX_FILTER_RIDE_TAB_GENTLE, + WIDX_FILTER_RIDE_TAB_COASTER, + WIDX_FILTER_RIDE_TAB_THRILL, + WIDX_FILTER_RIDE_TAB_WATER, + WIDX_FILTER_RIDE_TAB_STALL, + WIDX_LIST_SORT_TYPE, + WIDX_LIST_SORT_RIDE, + WIDX_RELOAD_OBJECT, + WIDX_TAB_1, + }; -validate_global_widx(WC_EDITOR_OBJECT_SELECTION, WIDX_TAB_1); + validate_global_widx(WC_EDITOR_OBJECT_SELECTION, WIDX_TAB_1); -static bool _window_editor_object_selection_widgets_initialised; + static bool _window_editor_object_selection_widgets_initialised; -// clang-format off + // clang-format off static std::vector _window_editor_object_selection_widgets = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, {WW, 357}, WindowWidgetType::Resize, WindowColour::Secondary ), @@ -221,1206 +221,1207 @@ static std::vector _window_editor_object_selection_widgets = { kWidgetsEnd, }; -// clang-format on + // clang-format on #pragma endregion -static constexpr int32_t window_editor_object_selection_animation_loops[] = { - 20, // All - 32, // Transport - 10, // Gentle - 72, // Coaster - 24, // Thrill - 28, // Water - 16, // Stall -}; -static constexpr int32_t window_editor_object_selection_animation_divisor[] = { - 4, // All - 8, // Transport - 2, // Gentle - 4, // Coaster - 4, // Thrill - 4, // Water - 2, // Stall -}; + static constexpr int32_t window_editor_object_selection_animation_loops[] = { + 20, // All + 32, // Transport + 10, // Gentle + 72, // Coaster + 24, // Thrill + 28, // Water + 16, // Stall + }; + static constexpr int32_t window_editor_object_selection_animation_divisor[] = { + 4, // All + 8, // Transport + 2, // Gentle + 4, // Coaster + 4, // Thrill + 4, // Water + 2, // Stall + }; -static StringId GetRideTypeStringId(const ObjectRepositoryItem* item); -static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListItem& b); -static bool VisibleListSortRideName(const ObjectListItem& a, const ObjectListItem& b); -void EditorLoadSelectedObjects(); + static StringId GetRideTypeStringId(const ObjectRepositoryItem* item); + static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListItem& b); + static bool VisibleListSortRideName(const ObjectListItem& a, const ObjectListItem& b); + void EditorLoadSelectedObjects(); -class EditorObjectSelectionWindow final : public Window -{ - using sortFunc_t = bool (*)(const ObjectListItem&, const ObjectListItem&); - -private: - std::vector _listItems; - int32_t _listSortType = RIDE_SORT_TYPE; - bool _listSortDescending = false; - std::unique_ptr _loadedObject; - -public: - /** - * - * rct2: 0x006AA64E - */ - void OnOpen() override + class EditorObjectSelectionWindow final : public Window { - InitWidgets(); + using sortFunc_t = bool (*)(const ObjectListItem&, const ObjectListItem&); - Sub6AB211(); - ResetSelectedObjectCountAndSize(); + private: + std::vector _listItems; + int32_t _listSortType = RIDE_SORT_TYPE; + bool _listSortDescending = false; + std::unique_ptr _loadedObject; - widgets[WIDX_FILTER_TEXT_BOX].string = _filter_string; - - _filter_flags = gConfigInterface.ObjectSelectionFilterFlags; - std::fill_n(_filter_string, sizeof(_filter_string), 0x00); - - WindowInitScrollWidgets(*this); - - selected_tab = 0; - selected_list_item = -1; - min_width = WW; - min_height = WH; - max_width = 1200; - max_height = 1000; - - _listSortType = RIDE_SORT_TYPE; - _listSortDescending = false; - - VisibleListRefresh(); - } - - /** - * - * rct2: 0x006AB199 - */ - void OnClose() override - { - UnloadUnselectedObjects(); - EditorLoadSelectedObjects(); - EditorObjectFlagsFree(); - - if (_loadedObject != nullptr) - _loadedObject->Unload(); - - if (gScreenFlags & SCREEN_FLAGS_EDITOR) + public: + /** + * + * rct2: 0x006AA64E + */ + void OnOpen() override { - ResearchPopulateListRandom(); - } - else - { - // Used for in-game object selection cheat - // This resets the ride selection list and resets research to 0 on current item - gSilentResearch = true; - ResearchResetCurrentItem(); - gSilentResearch = false; + InitWidgets(); + + Sub6AB211(); + ResetSelectedObjectCountAndSize(); + + widgets[WIDX_FILTER_TEXT_BOX].string = _filter_string; + + _filter_flags = gConfigInterface.ObjectSelectionFilterFlags; + std::fill_n(_filter_string, sizeof(_filter_string), 0x00); + + WindowInitScrollWidgets(*this); + + selected_tab = 0; + selected_list_item = -1; + min_width = WW; + min_height = WH; + max_width = 1200; + max_height = 1000; + + _listSortType = RIDE_SORT_TYPE; + _listSortDescending = false; + + VisibleListRefresh(); } - auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); - ContextBroadcastIntent(&intent); - - VisibleListDispose(); - - intent = Intent(INTENT_ACTION_REFRESH_SCENERY); - ContextBroadcastIntent(&intent); - } - - void OnUpdate() override - { - if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + /** + * + * rct2: 0x006AB199 + */ + void OnClose() override { - WindowUpdateTextboxCaret(); - WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); - } - - for (WidgetIndex i = WIDX_FILTER_RIDE_TAB_TRANSPORT; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) - { - if (!IsWidgetPressed(i)) - continue; - - frame_no++; - if (frame_no >= window_editor_object_selection_animation_loops[i - WIDX_FILTER_RIDE_TAB_TRANSPORT]) - frame_no = 0; - - WidgetInvalidate(*this, i); - break; - } - } - - /** - * - * rct2: 0x006AAFAB - */ - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - WindowClose(*this); - if (gScreenFlags & SCREEN_FLAGS_EDITOR) - { - FinishObjectSelection(); - } - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - GameNotifyMapChange(); - GameUnloadScripts(); - TitleLoad(); - } - break; - case WIDX_FILTER_RIDE_TAB_ALL: - _filter_flags |= FILTER_RIDES; - gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; - ConfigSaveDefault(); - - FilterUpdateCounts(); - VisibleListRefresh(); - - selected_list_item = -1; - scrolls[0].v_top = 0; - Invalidate(); - break; - case WIDX_FILTER_RIDE_TAB_TRANSPORT: - case WIDX_FILTER_RIDE_TAB_GENTLE: - case WIDX_FILTER_RIDE_TAB_COASTER: - case WIDX_FILTER_RIDE_TAB_THRILL: - case WIDX_FILTER_RIDE_TAB_WATER: - case WIDX_FILTER_RIDE_TAB_STALL: - _filter_flags &= ~FILTER_RIDES; - _filter_flags |= (1 << (widgetIndex - WIDX_FILTER_RIDE_TAB_TRANSPORT + _numSourceGameItems)); - gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; - ConfigSaveDefault(); - - FilterUpdateCounts(); - VisibleListRefresh(); - - selected_list_item = -1; - scrolls[0].v_top = 0; - frame_no = 0; - Invalidate(); - break; - - case WIDX_ADVANCED: - list_information_type ^= 1; - Invalidate(); - break; - - case WIDX_INSTALL_TRACK: - { - if (selected_list_item != -1) - { - selected_list_item = -1; - } - Invalidate(); - - auto intent = Intent(WindowClass::Loadsave); - intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK); - ContextOpenIntent(&intent); - break; - } - case WIDX_FILTER_TEXT_BOX: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter_string, sizeof(_filter_string)); - break; - case WIDX_FILTER_CLEAR_BUTTON: - std::fill_n(_filter_string, sizeof(_filter_string), 0x00); - FilterUpdateCounts(); - scrolls->v_top = 0; - VisibleListRefresh(); - Invalidate(); - break; - case WIDX_LIST_SORT_TYPE: - if (_listSortType == RIDE_SORT_TYPE) - { - _listSortDescending = !_listSortDescending; - } - else - { - _listSortType = RIDE_SORT_TYPE; - _listSortDescending = false; - } - VisibleListRefresh(); - break; - case WIDX_LIST_SORT_RIDE: - if (_listSortType == RIDE_SORT_RIDE) - { - _listSortDescending = !_listSortDescending; - } - else - { - _listSortType = RIDE_SORT_RIDE; - _listSortDescending = false; - } - VisibleListRefresh(); - break; - case WIDX_RELOAD_OBJECT: - if (_loadedObject != nullptr) - { - auto descriptor = _loadedObject->GetDescriptor(); - auto& objectManager = GetContext()->GetObjectManager(); - auto entryIndex = objectManager.GetLoadedObjectEntryIndex(descriptor); - if (entryIndex != OBJECT_ENTRY_INDEX_NULL) - { - objectManager.UnloadObjects({ descriptor }); - objectManager.LoadObject(descriptor, entryIndex); - } - } - break; - default: - if (widgetIndex >= WIDX_TAB_1 - && static_cast(widgetIndex) < WIDX_TAB_1 + std::size(ObjectSelectionPages)) - { - SetPage(widgetIndex - WIDX_TAB_1); - } - break; - } - } - - void OnResize() override - { - WindowSetResize(*this, WW, WH, 1200, 1000); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - int32_t numSelectionItems = 0; - - switch (widgetIndex) - { - case WIDX_FILTER_DROPDOWN: - - gDropdownItems[DDIX_FILTER_RCT1].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_AA].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_LL].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_RCT2].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_WW].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_TT].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_OO].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIX_FILTER_CUSTOM].Format = STR_TOGGLE_OPTION; - - gDropdownItems[DDIX_FILTER_RCT1].Args = STR_SCENARIO_CATEGORY_RCT1; - gDropdownItems[DDIX_FILTER_AA].Args = STR_SCENARIO_CATEGORY_RCT1_AA; - gDropdownItems[DDIX_FILTER_LL].Args = STR_SCENARIO_CATEGORY_RCT1_LL; - gDropdownItems[DDIX_FILTER_RCT2].Args = STR_ROLLERCOASTER_TYCOON_2_DROPDOWN; - gDropdownItems[DDIX_FILTER_WW].Args = STR_OBJECT_FILTER_WW; - gDropdownItems[DDIX_FILTER_TT].Args = STR_OBJECT_FILTER_TT; - gDropdownItems[DDIX_FILTER_OO].Args = STR_OBJECT_FILTER_OPENRCT2_OFFICIAL; - gDropdownItems[DDIX_FILTER_CUSTOM].Args = STR_OBJECT_FILTER_CUSTOM; - - // Track manager cannot select multiple, so only show selection filters if not in track manager - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - numSelectionItems = 3; - 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_SELECTED].Args = STR_SELECTED_ONLY; - gDropdownItems[DDIX_FILTER_NONSELECTED].Args = STR_NON_SELECTED_ONLY; - } - - WindowDropdownShowText( - { windowPos.x + widgets[widgetIndex].left, windowPos.y + widgets[widgetIndex].top }, - widgets[widgetIndex].height() + 1, colours[widgets[widgetIndex].colour], Dropdown::Flag::StayOpen, - _numSourceGameItems + numSelectionItems); - - for (int32_t i = 0; i < _numSourceGameItems; i++) - { - if (_filter_flags & (1 << i)) - { - Dropdown::SetChecked(i, true); - } - } - - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - Dropdown::SetChecked(DDIX_FILTER_SELECTED, _FILTER_SELECTED != 0); - Dropdown::SetChecked(DDIX_FILTER_NONSELECTED, _FILTER_NONSELECTED != 0); - } - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_FILTER_DROPDOWN: - if (dropdownIndex == DDIX_FILTER_SELECTED) - { - _filter_flags ^= FILTER_SELECTED; - _filter_flags &= ~FILTER_NONSELECTED; - } - else if (dropdownIndex == DDIX_FILTER_NONSELECTED) - { - _filter_flags ^= FILTER_NONSELECTED; - _filter_flags &= ~FILTER_SELECTED; - } - else - { - _filter_flags ^= (1 << dropdownIndex); - } - gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; - ConfigSaveDefault(); - - FilterUpdateCounts(); - scrolls->v_top = 0; - - VisibleListRefresh(); - Invalidate(); - break; - } - } - - /** - * - * rct2: 0x006AB031 - */ - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - const auto newHeight = static_cast(_listItems.size() * SCROLLABLE_ROW_HEIGHT); - return { 0, newHeight }; - } - - /** - * - * rct2: 0x006AB0B6 - */ - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - // 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); - - int32_t selected_object = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y); - if (selected_object == -1) - return; - - ObjectListItem* listItem = &_listItems[selected_object]; - uint8_t object_selection_flags = *listItem->flags; - if (object_selection_flags & ObjectSelectionFlags::Flag6) - return; - - Invalidate(); - - const CursorState* state = ContextGetCursorState(); - Audio::Play(Audio::SoundId::Click1, 0, state->position.x); - - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - const auto objectSelectResult = WindowEditorObjectSelectionSelectObject( - 0, INPUT_FLAG_EDITOR_OBJECT_SELECT, listItem->repositoryItem); - if (!objectSelectResult.Successful) - return; + UnloadUnselectedObjects(); + EditorLoadSelectedObjects(); + EditorObjectFlagsFree(); if (_loadedObject != nullptr) - { _loadedObject->Unload(); - _loadedObject = nullptr; + + if (gScreenFlags & SCREEN_FLAGS_EDITOR) + { + ResearchPopulateListRandom(); + } + else + { + // Used for in-game object selection cheat + // This resets the ride selection list and resets research to 0 on current item + gSilentResearch = true; + ResearchResetCurrentItem(); + gSilentResearch = false; } - auto& objRepository = GetContext()->GetObjectRepository(); - _loadedObject = objRepository.LoadObject(listItem->repositoryItem); - auto& objManager = GetContext()->GetObjectManager(); - objManager.LoadObject(_loadedObject.get()->GetIdentifier()); + auto intent = Intent(INTENT_ACTION_REFRESH_NEW_RIDES); + ContextBroadcastIntent(&intent); - // This function calls window_track_list_open - ManageTracks(); - Close(); - return; + VisibleListDispose(); + + intent = Intent(INTENT_ACTION_REFRESH_SCENERY); + ContextBroadcastIntent(&intent); } - uint32_t inputFlags = INPUT_FLAG_EDITOR_OBJECT_1 | INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP; - // If already selected - if (!(object_selection_flags & ObjectSelectionFlags::Selected)) - inputFlags |= INPUT_FLAG_EDITOR_OBJECT_SELECT; - - _gSceneryGroupPartialSelectError = std::nullopt; - const auto objectSelectResult = WindowEditorObjectSelectionSelectObject(0, inputFlags, listItem->repositoryItem); - if (!objectSelectResult.Successful) + void OnUpdate() override { - StringId error_title = (inputFlags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT - : STR_UNABLE_TO_DE_SELECT_THIS_OBJECT; + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + { + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); + } - ContextShowError(error_title, objectSelectResult.Message, {}); - return; + for (WidgetIndex i = WIDX_FILTER_RIDE_TAB_TRANSPORT; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) + { + if (!IsWidgetPressed(i)) + continue; + + frame_no++; + if (frame_no >= window_editor_object_selection_animation_loops[i - WIDX_FILTER_RIDE_TAB_TRANSPORT]) + frame_no = 0; + + WidgetInvalidate(*this, i); + break; + } } - if (_FILTER_SELECTED || _FILTER_NONSELECTED) + /** + * + * rct2: 0x006AAFAB + */ + void OnMouseUp(WidgetIndex widgetIndex) override { + switch (widgetIndex) + { + case WIDX_CLOSE: + WindowClose(*this); + if (gScreenFlags & SCREEN_FLAGS_EDITOR) + { + FinishObjectSelection(); + } + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + GameNotifyMapChange(); + GameUnloadScripts(); + TitleLoad(); + } + break; + case WIDX_FILTER_RIDE_TAB_ALL: + _filter_flags |= FILTER_RIDES; + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; + ConfigSaveDefault(); + + FilterUpdateCounts(); + VisibleListRefresh(); + + selected_list_item = -1; + scrolls[0].v_top = 0; + Invalidate(); + break; + case WIDX_FILTER_RIDE_TAB_TRANSPORT: + case WIDX_FILTER_RIDE_TAB_GENTLE: + case WIDX_FILTER_RIDE_TAB_COASTER: + case WIDX_FILTER_RIDE_TAB_THRILL: + case WIDX_FILTER_RIDE_TAB_WATER: + case WIDX_FILTER_RIDE_TAB_STALL: + _filter_flags &= ~FILTER_RIDES; + _filter_flags |= (1 << (widgetIndex - WIDX_FILTER_RIDE_TAB_TRANSPORT + _numSourceGameItems)); + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; + ConfigSaveDefault(); + + FilterUpdateCounts(); + VisibleListRefresh(); + + selected_list_item = -1; + scrolls[0].v_top = 0; + frame_no = 0; + Invalidate(); + break; + + case WIDX_ADVANCED: + list_information_type ^= 1; + Invalidate(); + break; + + case WIDX_INSTALL_TRACK: + { + if (selected_list_item != -1) + { + selected_list_item = -1; + } + Invalidate(); + + auto intent = Intent(WindowClass::Loadsave); + intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK); + ContextOpenIntent(&intent); + break; + } + case WIDX_FILTER_TEXT_BOX: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter_string, sizeof(_filter_string)); + break; + case WIDX_FILTER_CLEAR_BUTTON: + std::fill_n(_filter_string, sizeof(_filter_string), 0x00); + FilterUpdateCounts(); + scrolls->v_top = 0; + VisibleListRefresh(); + Invalidate(); + break; + case WIDX_LIST_SORT_TYPE: + if (_listSortType == RIDE_SORT_TYPE) + { + _listSortDescending = !_listSortDescending; + } + else + { + _listSortType = RIDE_SORT_TYPE; + _listSortDescending = false; + } + VisibleListRefresh(); + break; + case WIDX_LIST_SORT_RIDE: + if (_listSortType == RIDE_SORT_RIDE) + { + _listSortDescending = !_listSortDescending; + } + else + { + _listSortType = RIDE_SORT_RIDE; + _listSortDescending = false; + } + VisibleListRefresh(); + break; + case WIDX_RELOAD_OBJECT: + if (_loadedObject != nullptr) + { + auto descriptor = _loadedObject->GetDescriptor(); + auto& objectManager = GetContext()->GetObjectManager(); + auto entryIndex = objectManager.GetLoadedObjectEntryIndex(descriptor); + if (entryIndex != OBJECT_ENTRY_INDEX_NULL) + { + objectManager.UnloadObjects({ descriptor }); + objectManager.LoadObject(descriptor, entryIndex); + } + } + break; + default: + if (widgetIndex >= WIDX_TAB_1 + && static_cast(widgetIndex) < WIDX_TAB_1 + std::size(ObjectSelectionPages)) + { + SetPage(widgetIndex - WIDX_TAB_1); + } + break; + } + } + + void OnResize() override + { + WindowSetResize(*this, WW, WH, 1200, 1000); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + int32_t numSelectionItems = 0; + + switch (widgetIndex) + { + case WIDX_FILTER_DROPDOWN: + + gDropdownItems[DDIX_FILTER_RCT1].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_AA].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_LL].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_RCT2].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_WW].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_TT].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_OO].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIX_FILTER_CUSTOM].Format = STR_TOGGLE_OPTION; + + gDropdownItems[DDIX_FILTER_RCT1].Args = STR_SCENARIO_CATEGORY_RCT1; + gDropdownItems[DDIX_FILTER_AA].Args = STR_SCENARIO_CATEGORY_RCT1_AA; + gDropdownItems[DDIX_FILTER_LL].Args = STR_SCENARIO_CATEGORY_RCT1_LL; + gDropdownItems[DDIX_FILTER_RCT2].Args = STR_ROLLERCOASTER_TYCOON_2_DROPDOWN; + gDropdownItems[DDIX_FILTER_WW].Args = STR_OBJECT_FILTER_WW; + gDropdownItems[DDIX_FILTER_TT].Args = STR_OBJECT_FILTER_TT; + gDropdownItems[DDIX_FILTER_OO].Args = STR_OBJECT_FILTER_OPENRCT2_OFFICIAL; + gDropdownItems[DDIX_FILTER_CUSTOM].Args = STR_OBJECT_FILTER_CUSTOM; + + // Track manager cannot select multiple, so only show selection filters if not in track manager + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + numSelectionItems = 3; + 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_SELECTED].Args = STR_SELECTED_ONLY; + gDropdownItems[DDIX_FILTER_NONSELECTED].Args = STR_NON_SELECTED_ONLY; + } + + WindowDropdownShowText( + { windowPos.x + widgets[widgetIndex].left, windowPos.y + widgets[widgetIndex].top }, + widgets[widgetIndex].height() + 1, colours[widgets[widgetIndex].colour], Dropdown::Flag::StayOpen, + _numSourceGameItems + numSelectionItems); + + for (int32_t i = 0; i < _numSourceGameItems; i++) + { + if (_filter_flags & (1 << i)) + { + Dropdown::SetChecked(i, true); + } + } + + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + Dropdown::SetChecked(DDIX_FILTER_SELECTED, _FILTER_SELECTED != 0); + Dropdown::SetChecked(DDIX_FILTER_NONSELECTED, _FILTER_NONSELECTED != 0); + } + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_FILTER_DROPDOWN: + if (dropdownIndex == DDIX_FILTER_SELECTED) + { + _filter_flags ^= FILTER_SELECTED; + _filter_flags &= ~FILTER_NONSELECTED; + } + else if (dropdownIndex == DDIX_FILTER_NONSELECTED) + { + _filter_flags ^= FILTER_NONSELECTED; + _filter_flags &= ~FILTER_SELECTED; + } + else + { + _filter_flags ^= (1 << dropdownIndex); + } + gConfigInterface.ObjectSelectionFilterFlags = _filter_flags; + ConfigSaveDefault(); + + FilterUpdateCounts(); + scrolls->v_top = 0; + + VisibleListRefresh(); + Invalidate(); + break; + } + } + + /** + * + * rct2: 0x006AB031 + */ + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + const auto newHeight = static_cast(_listItems.size() * SCROLLABLE_ROW_HEIGHT); + return { 0, newHeight }; + } + + /** + * + * rct2: 0x006AB0B6 + */ + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + // 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); + + int32_t selected_object = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y); + if (selected_object == -1) + return; + + ObjectListItem* listItem = &_listItems[selected_object]; + uint8_t object_selection_flags = *listItem->flags; + if (object_selection_flags & ObjectSelectionFlags::Flag6) + return; + + Invalidate(); + + const CursorState* state = ContextGetCursorState(); + Audio::Play(Audio::SoundId::Click1, 0, state->position.x); + + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + const auto objectSelectResult = WindowEditorObjectSelectionSelectObject( + 0, INPUT_FLAG_EDITOR_OBJECT_SELECT, listItem->repositoryItem); + if (!objectSelectResult.Successful) + return; + + if (_loadedObject != nullptr) + { + _loadedObject->Unload(); + _loadedObject = nullptr; + } + + auto& objRepository = GetContext()->GetObjectRepository(); + _loadedObject = objRepository.LoadObject(listItem->repositoryItem); + auto& objManager = GetContext()->GetObjectManager(); + objManager.LoadObject(_loadedObject.get()->GetIdentifier()); + + // This function calls window_track_list_open + ManageTracks(); + Close(); + return; + } + + uint32_t inputFlags = INPUT_FLAG_EDITOR_OBJECT_1 | INPUT_FLAG_EDITOR_OBJECT_SELECT_OBJECTS_IN_SCENERY_GROUP; + // If already selected + if (!(object_selection_flags & ObjectSelectionFlags::Selected)) + inputFlags |= INPUT_FLAG_EDITOR_OBJECT_SELECT; + + _gSceneryGroupPartialSelectError = std::nullopt; + const auto objectSelectResult = WindowEditorObjectSelectionSelectObject(0, inputFlags, listItem->repositoryItem); + if (!objectSelectResult.Successful) + { + StringId error_title = (inputFlags & INPUT_FLAG_EDITOR_OBJECT_SELECT) ? STR_UNABLE_TO_SELECT_THIS_OBJECT + : STR_UNABLE_TO_DE_SELECT_THIS_OBJECT; + + ContextShowError(error_title, objectSelectResult.Message, {}); + return; + } + + if (_FILTER_SELECTED || _FILTER_NONSELECTED) + { + FilterUpdateCounts(); + VisibleListRefresh(); + Invalidate(); + } + + if (_gSceneryGroupPartialSelectError.has_value()) + { + const auto errorMessage = _gSceneryGroupPartialSelectError.value(); + if (errorMessage == STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED) + { + ContextShowError( + STR_WARNING_TOO_MANY_OBJECTS_SELECTED, STR_NOT_ALL_OBJECTS_IN_THIS_SCENERY_GROUP_COULD_BE_SELECTED, {}); + } + else + { + ContextShowError( + errorMessage, STR_NOT_ALL_OBJECTS_IN_THIS_SCENERY_GROUP_COULD_BE_SELECTED, Formatter::Common()); + } + } + } + + /** + * + * rct2: 0x006AB079 + */ + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t selectedObject = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y); + if (selectedObject != -1) + { + ObjectListItem* listItem = &_listItems[selectedObject]; + uint8_t objectSelectionFlags = *listItem->flags; + if (objectSelectionFlags & ObjectSelectionFlags::Flag6) + { + selectedObject = -1; + } + } + if (selectedObject != selected_list_item) + { + selected_list_item = selectedObject; + + if (_loadedObject != nullptr) + { + _loadedObject->Unload(); + _loadedObject = nullptr; + } + + if (selectedObject != -1) + { + auto listItem = &_listItems[selectedObject]; + auto& objRepository = GetContext()->GetObjectRepository(); + _loadedObject = objRepository.LoadObject(listItem->repositoryItem); + if (_loadedObject != nullptr) + { + _loadedObject->Load(); + } + } + + Invalidate(); + } + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + // ScrollPaint + ScreenCoordsXY screenCoords; + bool ridePage = (GetSelectedObjectType() == ObjectType::Ride); + + uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; + GfxClear(&dpi, paletteIndex); + + screenCoords.y = 0; + for (size_t i = 0; i < _listItems.size(); i++) + { + const auto& listItem = _listItems[i]; + if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y <= dpi.y + dpi.height) + { + // Draw checkbox + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20)) + GfxFillRectInset( + dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0); + + // Highlight background + auto highlighted = i == static_cast(selected_list_item) + && !(*listItem.flags & ObjectSelectionFlags::Flag6); + if (highlighted) + { + auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1); + GfxFilterRect(dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1); + } + + // Draw checkmark + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && (*listItem.flags & ObjectSelectionFlags::Selected)) + { + screenCoords.x = 2; + auto darkness = highlighted ? TextDarkness::ExtraDark : TextDarkness::Dark; + colour_t colour2 = NOT_TRANSLUCENT(colours[1]); + if (*listItem.flags & (ObjectSelectionFlags::InUse | ObjectSelectionFlags::AlwaysRequired)) + colour2 |= COLOUR_FLAG_INSET; + + GfxDrawString( + dpi, screenCoords, static_cast(CheckBoxMarkString), + { static_cast(colour2), FontStyle::Medium, darkness }); + } + + screenCoords.x = gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER ? 0 : 15; + + auto bufferWithColour = strcpy(gCommonStringFormatBuffer, highlighted ? "{WINDOW_COLOUR_2}" : "{BLACK}"); + auto buffer = strchr(bufferWithColour, '\0'); + + colour_t colour = COLOUR_BLACK; + auto darkness = TextDarkness::Regular; + if (*listItem.flags & ObjectSelectionFlags::Flag6) + { + colour = colours[1] & 0x7F; + darkness = TextDarkness::Dark; + } + + int32_t width_limit = widgets[WIDX_LIST].width() - screenCoords.x; + + if (ridePage) + { + width_limit /= 2; + // Draw ride type + StringId rideTypeStringId = GetRideTypeStringId(listItem.repositoryItem); + SafeStrCpy(buffer, LanguageGetString(rideTypeStringId), 256 - (buffer - bufferWithColour)); + auto ft = Formatter(); + ft.Add(gCommonStringFormatBuffer); + DrawTextEllipsised( + dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); + screenCoords.x = widgets[WIDX_LIST_SORT_RIDE].left - widgets[WIDX_LIST].left; + } + + // Draw text + SafeStrCpy(buffer, listItem.repositoryItem->Name.c_str(), 256 - (buffer - bufferWithColour)); + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + while (*buffer != 0 && *buffer != 9) + buffer++; + + *buffer = 0; + } + auto ft = Formatter(); + ft.Add(gCommonStringFormatBuffer); + DrawTextEllipsised(dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); + } + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + } + } + + /** + * + * rct2: 0x006AB058 + */ + OpenRCT2String OnTooltip(const WidgetIndex widgetIndex, const StringId fallback) override + { + if (widgetIndex >= WIDX_TAB_1 && static_cast(widgetIndex) < WIDX_TAB_1 + std::size(ObjectSelectionPages)) + { + auto ft = Formatter(); + ft.Add(ObjectSelectionPages[(widgetIndex - WIDX_TAB_1)].Caption); + return { fallback, ft }; + } + return { fallback, {} }; + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_FILTER_TEXT_BOX) + return; + + std::string tempText = text.data(); + const char* c = tempText.c_str(); + + if (strcmp(_filter_string, c) == 0) + return; + + SafeStrCpy(_filter_string, c, sizeof(_filter_string)); + FilterUpdateCounts(); + + scrolls->v_top = 0; + VisibleListRefresh(); Invalidate(); } - if (_gSceneryGroupPartialSelectError.has_value()) + void OnPrepareDraw() override { - const auto errorMessage = _gSceneryGroupPartialSelectError.value(); - if (errorMessage == STR_OBJECT_SELECTION_ERR_TOO_MANY_OF_TYPE_SELECTED) + // Resize widgets + ResizeFrameWithPage(); + widgets[WIDX_ADVANCED].left = width - 130; + widgets[WIDX_ADVANCED].right = width - 9; + widgets[WIDX_LIST].right = width - 309; + widgets[WIDX_LIST].bottom = height - 14; + widgets[WIDX_PREVIEW].left = width - 209; + widgets[WIDX_PREVIEW].right = width - 96; + widgets[WIDX_INSTALL_TRACK].left = width - 130; + widgets[WIDX_INSTALL_TRACK].right = width - 9; + widgets[WIDX_FILTER_DROPDOWN].left = width - 250; + widgets[WIDX_FILTER_DROPDOWN].right = width - 137; + widgets[WIDX_RELOAD_OBJECT].left = width - 9 - 24; + widgets[WIDX_RELOAD_OBJECT].right = width - 9; + + // Set pressed widgets + pressed_widgets |= 1uLL << WIDX_PREVIEW; + SetPressedTab(); + if (list_information_type & 1) + pressed_widgets |= (1uLL << WIDX_ADVANCED); + else + pressed_widgets &= ~(1uLL << WIDX_ADVANCED); + + // Set window title and buttons + auto ft = Formatter::Common(); + ft.Add(ObjectSelectionPages[selected_tab].Caption); + auto& titleWidget = widgets[WIDX_TITLE]; + auto& installTrackWidget = widgets[WIDX_INSTALL_TRACK]; + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { - ContextShowError( - STR_WARNING_TOO_MANY_OBJECTS_SELECTED, STR_NOT_ALL_OBJECTS_IN_THIS_SCENERY_GROUP_COULD_BE_SELECTED, {}); + titleWidget.text = STR_TRACK_DESIGNS_MANAGER_SELECT_RIDE_TYPE; + installTrackWidget.type = WindowWidgetType::Button; + } + else if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + { + titleWidget.text = STR_ROLLER_COASTER_DESIGNER_SELECT_RIDE_TYPES_VEHICLES; + installTrackWidget.type = WindowWidgetType::Empty; } else { - ContextShowError( - errorMessage, STR_NOT_ALL_OBJECTS_IN_THIS_SCENERY_GROUP_COULD_BE_SELECTED, Formatter::Common()); - } - } - } - - /** - * - * rct2: 0x006AB079 - */ - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t selectedObject = GetObjectFromObjectSelection(GetSelectedObjectType(), screenCoords.y); - if (selectedObject != -1) - { - ObjectListItem* listItem = &_listItems[selectedObject]; - uint8_t objectSelectionFlags = *listItem->flags; - if (objectSelectionFlags & ObjectSelectionFlags::Flag6) - { - selectedObject = -1; - } - } - if (selectedObject != selected_list_item) - { - selected_list_item = selectedObject; - - if (_loadedObject != nullptr) - { - _loadedObject->Unload(); - _loadedObject = nullptr; + titleWidget.text = STR_OBJECT_SELECTION; + installTrackWidget.type = WindowWidgetType::Empty; } - if (selectedObject != -1) + // Align tabs, hide advanced ones + bool advancedMode = (list_information_type & 1) != 0; + int32_t x = 3; + for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) { - auto listItem = &_listItems[selectedObject]; - auto& objRepository = GetContext()->GetObjectRepository(); - _loadedObject = objRepository.LoadObject(listItem->repositoryItem); - if (_loadedObject != nullptr) + auto& widget = widgets[WIDX_TAB_1 + i]; + if ((!advancedMode && ObjectSelectionPages[i].IsAdvanced) + || ObjectSelectionPages[i].Image == static_cast(SPR_NONE)) { - _loadedObject->Load(); + widget.type = WindowWidgetType::Empty; + } + else + { + widget.type = WindowWidgetType::Tab; + widget.left = x; + widget.right = x + 30; + x += 31; } } - Invalidate(); - } - } + if (gConfigGeneral.DebuggingTools) + widgets[WIDX_RELOAD_OBJECT].type = WindowWidgetType::ImgBtn; + else + widgets[WIDX_RELOAD_OBJECT].type = WindowWidgetType::Empty; - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - // ScrollPaint - ScreenCoordsXY screenCoords; - bool ridePage = (GetSelectedObjectType() == ObjectType::Ride); - - uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); - - screenCoords.y = 0; - for (size_t i = 0; i < _listItems.size(); i++) - { - const auto& listItem = _listItems[i]; - if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y <= dpi.y + dpi.height) + if (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TRACK_DESIGNER)) { - // Draw checkbox - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20)) - GfxFillRectInset(dpi, { { 2, screenCoords.y }, { 11, screenCoords.y + 10 } }, colours[1], INSET_RECT_F_E0); - - // Highlight background - auto highlighted = i == static_cast(selected_list_item) - && !(*listItem.flags & ObjectSelectionFlags::Flag6); - if (highlighted) + widgets[WIDX_ADVANCED].type = WindowWidgetType::Empty; + for (size_t i = 1; i < std::size(ObjectSelectionPages); i++) { - auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1); - GfxFilterRect(dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1); + widgets[WIDX_TAB_1 + i].type = WindowWidgetType::Empty; } - - // Draw checkmark - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && (*listItem.flags & ObjectSelectionFlags::Selected)) - { - screenCoords.x = 2; - auto darkness = highlighted ? TextDarkness::ExtraDark : TextDarkness::Dark; - colour_t colour2 = NOT_TRANSLUCENT(colours[1]); - if (*listItem.flags & (ObjectSelectionFlags::InUse | ObjectSelectionFlags::AlwaysRequired)) - colour2 |= COLOUR_FLAG_INSET; - - GfxDrawString( - dpi, screenCoords, static_cast(CheckBoxMarkString), - { static_cast(colour2), FontStyle::Medium, darkness }); - } - - screenCoords.x = gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER ? 0 : 15; - - auto bufferWithColour = strcpy(gCommonStringFormatBuffer, highlighted ? "{WINDOW_COLOUR_2}" : "{BLACK}"); - auto buffer = strchr(bufferWithColour, '\0'); - - colour_t colour = COLOUR_BLACK; - auto darkness = TextDarkness::Regular; - if (*listItem.flags & ObjectSelectionFlags::Flag6) - { - colour = colours[1] & 0x7F; - darkness = TextDarkness::Dark; - } - - int32_t width_limit = widgets[WIDX_LIST].width() - screenCoords.x; - - if (ridePage) - { - width_limit /= 2; - // Draw ride type - StringId rideTypeStringId = GetRideTypeStringId(listItem.repositoryItem); - SafeStrCpy(buffer, LanguageGetString(rideTypeStringId), 256 - (buffer - bufferWithColour)); - auto ft = Formatter(); - ft.Add(gCommonStringFormatBuffer); - DrawTextEllipsised( - dpi, screenCoords, width_limit - 15, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); - screenCoords.x = widgets[WIDX_LIST_SORT_RIDE].left - widgets[WIDX_LIST].left; - } - - // Draw text - SafeStrCpy(buffer, listItem.repositoryItem->Name.c_str(), 256 - (buffer - bufferWithColour)); - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - while (*buffer != 0 && *buffer != 9) - buffer++; - - *buffer = 0; - } - auto ft = Formatter(); - ft.Add(gCommonStringFormatBuffer); - DrawTextEllipsised(dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness }); - } - screenCoords.y += SCROLLABLE_ROW_HEIGHT; - } - } - - /** - * - * rct2: 0x006AB058 - */ - OpenRCT2String OnTooltip(const WidgetIndex widgetIndex, const StringId fallback) override - { - if (widgetIndex >= WIDX_TAB_1 && static_cast(widgetIndex) < WIDX_TAB_1 + std::size(ObjectSelectionPages)) - { - auto ft = Formatter(); - ft.Add(ObjectSelectionPages[(widgetIndex - WIDX_TAB_1)].Caption); - return { fallback, ft }; - } - return { fallback, {} }; - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex != WIDX_FILTER_TEXT_BOX) - return; - - std::string tempText = text.data(); - const char* c = tempText.c_str(); - - if (strcmp(_filter_string, c) == 0) - return; - - SafeStrCpy(_filter_string, c, sizeof(_filter_string)); - - FilterUpdateCounts(); - - scrolls->v_top = 0; - - VisibleListRefresh(); - Invalidate(); - } - - void OnPrepareDraw() override - { - // Resize widgets - ResizeFrameWithPage(); - widgets[WIDX_ADVANCED].left = width - 130; - widgets[WIDX_ADVANCED].right = width - 9; - widgets[WIDX_LIST].right = width - 309; - widgets[WIDX_LIST].bottom = height - 14; - widgets[WIDX_PREVIEW].left = width - 209; - widgets[WIDX_PREVIEW].right = width - 96; - widgets[WIDX_INSTALL_TRACK].left = width - 130; - widgets[WIDX_INSTALL_TRACK].right = width - 9; - widgets[WIDX_FILTER_DROPDOWN].left = width - 250; - widgets[WIDX_FILTER_DROPDOWN].right = width - 137; - widgets[WIDX_RELOAD_OBJECT].left = width - 9 - 24; - widgets[WIDX_RELOAD_OBJECT].right = width - 9; - - // Set pressed widgets - pressed_widgets |= 1uLL << WIDX_PREVIEW; - SetPressedTab(); - if (list_information_type & 1) - pressed_widgets |= (1uLL << WIDX_ADVANCED); - else - pressed_widgets &= ~(1uLL << WIDX_ADVANCED); - - // Set window title and buttons - auto ft = Formatter::Common(); - ft.Add(ObjectSelectionPages[selected_tab].Caption); - auto& titleWidget = widgets[WIDX_TITLE]; - auto& installTrackWidget = widgets[WIDX_INSTALL_TRACK]; - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - titleWidget.text = STR_TRACK_DESIGNS_MANAGER_SELECT_RIDE_TYPE; - installTrackWidget.type = WindowWidgetType::Button; - } - else if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - { - titleWidget.text = STR_ROLLER_COASTER_DESIGNER_SELECT_RIDE_TYPES_VEHICLES; - installTrackWidget.type = WindowWidgetType::Empty; - } - else - { - titleWidget.text = STR_OBJECT_SELECTION; - installTrackWidget.type = WindowWidgetType::Empty; - } - - // Align tabs, hide advanced ones - bool advancedMode = (list_information_type & 1) != 0; - int32_t x = 3; - for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) - { - auto& widget = widgets[WIDX_TAB_1 + i]; - if ((!advancedMode && ObjectSelectionPages[i].IsAdvanced) - || ObjectSelectionPages[i].Image == static_cast(SPR_NONE)) - { - widget.type = WindowWidgetType::Empty; + x = 150; } else { - widget.type = WindowWidgetType::Tab; - widget.left = x; - widget.right = x + 30; - x += 31; + widgets[WIDX_ADVANCED].type = WindowWidgetType::Button; + x = 300; } - } - if (gConfigGeneral.DebuggingTools) - widgets[WIDX_RELOAD_OBJECT].type = WindowWidgetType::ImgBtn; - else - widgets[WIDX_RELOAD_OBJECT].type = WindowWidgetType::Empty; + widgets[WIDX_FILTER_DROPDOWN].type = WindowWidgetType::Button; + widgets[WIDX_LIST].right = width - (WW - 587) - x; + widgets[WIDX_PREVIEW].left = width - (WW - 537) - (x / 2); + widgets[WIDX_PREVIEW].right = widgets[WIDX_PREVIEW].left + 113; + widgets[WIDX_FILTER_RIDE_TAB_FRAME].right = widgets[WIDX_LIST].right; - if (gScreenFlags & (SCREEN_FLAGS_TRACK_MANAGER | SCREEN_FLAGS_TRACK_DESIGNER)) - { - widgets[WIDX_ADVANCED].type = WindowWidgetType::Empty; - for (size_t i = 1; i < std::size(ObjectSelectionPages); i++) + bool ridePage = (GetSelectedObjectType() == ObjectType::Ride); + widgets[WIDX_LIST].top = (ridePage ? 118 : 60); + widgets[WIDX_FILTER_TEXT_BOX].right = widgets[WIDX_LIST].right - 77; + widgets[WIDX_FILTER_TEXT_BOX].top = (ridePage ? 79 : 45); + widgets[WIDX_FILTER_TEXT_BOX].bottom = (ridePage ? 92 : 58); + widgets[WIDX_FILTER_CLEAR_BUTTON].left = widgets[WIDX_LIST].right - 73; + widgets[WIDX_FILTER_CLEAR_BUTTON].right = widgets[WIDX_LIST].right; + widgets[WIDX_FILTER_CLEAR_BUTTON].top = (ridePage ? 79 : 45); + widgets[WIDX_FILTER_CLEAR_BUTTON].bottom = (ridePage ? 92 : 58); + + if (ridePage) { - widgets[WIDX_TAB_1 + i].type = WindowWidgetType::Empty; + for (int32_t i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) + pressed_widgets &= ~(1 << i); + + if ((_filter_flags & FILTER_RIDES) == FILTER_RIDES) + pressed_widgets |= (1uLL << WIDX_FILTER_RIDE_TAB_ALL); + else + { + for (int32_t i = 0; i < 6; i++) + { + if (_filter_flags & (1 << (_numSourceGameItems + i))) + pressed_widgets |= 1uLL << (WIDX_FILTER_RIDE_TAB_TRANSPORT + i); + } + } + + widgets[WIDX_FILTER_RIDE_TAB_FRAME].type = WindowWidgetType::ImgBtn; + for (int32_t i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) + widgets[i].type = WindowWidgetType::Tab; + + int32_t width_limit = (widgets[WIDX_LIST].width() - 15) / 2; + + widgets[WIDX_LIST_SORT_TYPE].type = WindowWidgetType::TableHeader; + widgets[WIDX_LIST_SORT_TYPE].top = widgets[WIDX_FILTER_TEXT_BOX].bottom + 3; + widgets[WIDX_LIST_SORT_TYPE].bottom = widgets[WIDX_LIST_SORT_TYPE].top + 13; + widgets[WIDX_LIST_SORT_TYPE].left = 4; + widgets[WIDX_LIST_SORT_TYPE].right = widgets[WIDX_LIST_SORT_TYPE].left + width_limit; + + widgets[WIDX_LIST_SORT_RIDE].type = WindowWidgetType::TableHeader; + widgets[WIDX_LIST_SORT_RIDE].top = widgets[WIDX_LIST_SORT_TYPE].top; + widgets[WIDX_LIST_SORT_RIDE].bottom = widgets[WIDX_LIST_SORT_TYPE].bottom; + widgets[WIDX_LIST_SORT_RIDE].left = widgets[WIDX_LIST_SORT_TYPE].right + 1; + widgets[WIDX_LIST_SORT_RIDE].right = widgets[WIDX_LIST].right; + + widgets[WIDX_LIST].top = widgets[WIDX_LIST_SORT_TYPE].bottom + 2; } - x = 150; - } - else - { - widgets[WIDX_ADVANCED].type = WindowWidgetType::Button; - x = 300; - } - - widgets[WIDX_FILTER_DROPDOWN].type = WindowWidgetType::Button; - widgets[WIDX_LIST].right = width - (WW - 587) - x; - widgets[WIDX_PREVIEW].left = width - (WW - 537) - (x / 2); - widgets[WIDX_PREVIEW].right = widgets[WIDX_PREVIEW].left + 113; - widgets[WIDX_FILTER_RIDE_TAB_FRAME].right = widgets[WIDX_LIST].right; - - bool ridePage = (GetSelectedObjectType() == ObjectType::Ride); - widgets[WIDX_LIST].top = (ridePage ? 118 : 60); - widgets[WIDX_FILTER_TEXT_BOX].right = widgets[WIDX_LIST].right - 77; - widgets[WIDX_FILTER_TEXT_BOX].top = (ridePage ? 79 : 45); - widgets[WIDX_FILTER_TEXT_BOX].bottom = (ridePage ? 92 : 58); - widgets[WIDX_FILTER_CLEAR_BUTTON].left = widgets[WIDX_LIST].right - 73; - widgets[WIDX_FILTER_CLEAR_BUTTON].right = widgets[WIDX_LIST].right; - widgets[WIDX_FILTER_CLEAR_BUTTON].top = (ridePage ? 79 : 45); - widgets[WIDX_FILTER_CLEAR_BUTTON].bottom = (ridePage ? 92 : 58); - - if (ridePage) - { - for (int32_t i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) - pressed_widgets &= ~(1 << i); - - if ((_filter_flags & FILTER_RIDES) == FILTER_RIDES) - pressed_widgets |= (1uLL << WIDX_FILTER_RIDE_TAB_ALL); else { - for (int32_t i = 0; i < 6; i++) + for (int32_t i = WIDX_FILTER_RIDE_TAB_FRAME; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) + widgets[i].type = WindowWidgetType::Empty; + + widgets[WIDX_LIST_SORT_TYPE].type = WindowWidgetType::Empty; + widgets[WIDX_LIST_SORT_RIDE].type = WindowWidgetType::Empty; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + int32_t _width; + + DrawWidgets(dpi); + + // Draw tabs + for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) + { + const auto& widget = widgets[WIDX_TAB_1 + i]; + if (widget.type != WindowWidgetType::Empty) { - if (_filter_flags & (1 << (_numSourceGameItems + i))) - pressed_widgets |= 1uLL << (WIDX_FILTER_RIDE_TAB_TRANSPORT + i); + auto image = ImageId(ObjectSelectionPages[i].Image); + auto screenPos = windowPos + ScreenCoordsXY{ widget.left, widget.top }; + GfxDrawSprite(dpi, image, screenPos); } } - widgets[WIDX_FILTER_RIDE_TAB_FRAME].type = WindowWidgetType::ImgBtn; - for (int32_t i = WIDX_FILTER_RIDE_TAB_ALL; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) - widgets[i].type = WindowWidgetType::Tab; + const int32_t ride_tabs[] = { + SPR_TAB_RIDE_16, SPR_TAB_RIDES_TRANSPORT_0, SPR_TAB_RIDES_GENTLE_0, SPR_TAB_RIDES_ROLLER_COASTERS_0, + SPR_TAB_RIDES_THRILL_0, SPR_TAB_RIDES_WATER_0, SPR_TAB_RIDES_SHOP_0, SPR_TAB_FINANCES_RESEARCH_0, + }; + const int32_t ThrillRidesTabAnimationSequence[] = { + 5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, + }; - int32_t width_limit = (widgets[WIDX_LIST].width() - 15) / 2; - - widgets[WIDX_LIST_SORT_TYPE].type = WindowWidgetType::TableHeader; - widgets[WIDX_LIST_SORT_TYPE].top = widgets[WIDX_FILTER_TEXT_BOX].bottom + 3; - widgets[WIDX_LIST_SORT_TYPE].bottom = widgets[WIDX_LIST_SORT_TYPE].top + 13; - widgets[WIDX_LIST_SORT_TYPE].left = 4; - widgets[WIDX_LIST_SORT_TYPE].right = widgets[WIDX_LIST_SORT_TYPE].left + width_limit; - - widgets[WIDX_LIST_SORT_RIDE].type = WindowWidgetType::TableHeader; - widgets[WIDX_LIST_SORT_RIDE].top = widgets[WIDX_LIST_SORT_TYPE].top; - widgets[WIDX_LIST_SORT_RIDE].bottom = widgets[WIDX_LIST_SORT_TYPE].bottom; - widgets[WIDX_LIST_SORT_RIDE].left = widgets[WIDX_LIST_SORT_TYPE].right + 1; - widgets[WIDX_LIST_SORT_RIDE].right = widgets[WIDX_LIST].right; - - widgets[WIDX_LIST].top = widgets[WIDX_LIST_SORT_TYPE].bottom + 2; - } - else - { - for (int32_t i = WIDX_FILTER_RIDE_TAB_FRAME; i <= WIDX_FILTER_RIDE_TAB_STALL; i++) - widgets[i].type = WindowWidgetType::Empty; - - widgets[WIDX_LIST_SORT_TYPE].type = WindowWidgetType::Empty; - widgets[WIDX_LIST_SORT_RIDE].type = WindowWidgetType::Empty; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - int32_t _width; - - DrawWidgets(dpi); - - // Draw tabs - for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) - { - const auto& widget = widgets[WIDX_TAB_1 + i]; - if (widget.type != WindowWidgetType::Empty) + // Draw ride tabs + if (GetSelectedObjectType() == ObjectType::Ride) { - auto image = ImageId(ObjectSelectionPages[i].Image); - auto screenPos = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - GfxDrawSprite(dpi, image, screenPos); - } - } - - const int32_t ride_tabs[] = { - SPR_TAB_RIDE_16, SPR_TAB_RIDES_TRANSPORT_0, SPR_TAB_RIDES_GENTLE_0, SPR_TAB_RIDES_ROLLER_COASTERS_0, - SPR_TAB_RIDES_THRILL_0, SPR_TAB_RIDES_WATER_0, SPR_TAB_RIDES_SHOP_0, SPR_TAB_FINANCES_RESEARCH_0, - }; - const int32_t ThrillRidesTabAnimationSequence[] = { - 5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, - }; - - // Draw ride tabs - if (GetSelectedObjectType() == ObjectType::Ride) - { - for (int32_t i = 0; i < 7; i++) - { - const auto& widget = widgets[WIDX_FILTER_RIDE_TAB_ALL + i]; - if (widget.type == WindowWidgetType::Empty) - continue; - - int32_t spriteIndex = ride_tabs[i]; - int32_t frame = 0; - if (i != 0 && IsWidgetPressed(WIDX_FILTER_RIDE_TAB_ALL + i)) + for (int32_t i = 0; i < 7; i++) { - frame = frame_no / window_editor_object_selection_animation_divisor[i - 1]; - } - spriteIndex += (i == 4 ? ThrillRidesTabAnimationSequence[frame] : frame); - - auto screenPos = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - GfxDrawSprite(dpi, ImageId(spriteIndex, colours[1]), screenPos); - } - } - - // Preview background - const auto& previewWidget = widgets[WIDX_PREVIEW]; - GfxFillRect( - dpi, - { windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }, - windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } }, - ColourMapA[colours[1]].darkest); - - // Draw number of selected items - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - auto screenPos = windowPos + ScreenCoordsXY{ 3, height - 13 }; - - int32_t numSelected = _numSelectedObjectsForType[EnumValue(GetSelectedObjectType())]; - int32_t totalSelectable = object_entry_group_counts[EnumValue(GetSelectedObjectType())]; - - auto ft = Formatter(); - ft.Add(numSelected); - ft.Add(totalSelectable); - DrawTextBasic(dpi, screenPos, STR_OBJECT_SELECTION_SELECTION_SIZE, ft); - } - - // Draw sort button text - const auto& listSortTypeWidget = widgets[WIDX_LIST_SORT_TYPE]; - if (listSortTypeWidget.type != WindowWidgetType::Empty) - { - auto ft = Formatter(); - auto stringId = _listSortType == RIDE_SORT_TYPE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; - 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] }); - } - const auto& listSortRideWidget = widgets[WIDX_LIST_SORT_RIDE]; - if (listSortRideWidget.type != WindowWidgetType::Empty) - { - auto ft = Formatter(); - auto stringId = _listSortType == RIDE_SORT_RIDE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) - : STR_NONE; - 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] }); - } - - if (selected_list_item == -1 || _loadedObject == nullptr) - return; - - ObjectListItem* listItem = &_listItems[selected_list_item]; - - // Draw preview - { - DrawPixelInfo clipDPI; - auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }; - _width = previewWidget.width() - 1; - int32_t _height = previewWidget.height() - 1; - if (ClipDrawPixelInfo(clipDPI, dpi, screenPos, _width, _height)) - { - _loadedObject->DrawPreview(clipDPI, _width, _height); - } - } - - // Draw name of object - { - auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.midX() + 1, previewWidget.bottom + 3 }; - _width = this->width - widgets[WIDX_LIST].right - 6; - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(listItem->repositoryItem->Name.c_str()); - DrawTextEllipsised(dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); - } - - DrawDescriptions(dpi); - DrawDebugData(dpi); - } - -private: - void InitWidgets() - { - auto& targetWidgets = _window_editor_object_selection_widgets; - if (!_window_editor_object_selection_widgets_initialised) - { - _window_editor_object_selection_widgets_initialised = true; - auto tabWidget = targetWidgets[targetWidgets.size() - 2]; - for (size_t i = 1; i < std::size(ObjectSelectionPages); i++) - { - targetWidgets.insert(targetWidgets.end() - 1, tabWidget); - } - } - - widgets = targetWidgets.data(); - } - - void SetPage(int32_t _page) - { - if (selected_tab == _page) - return; - - selected_tab = _page; - selected_list_item = -1; - scrolls[0].v_top = 0; - frame_no = 0; - - if (_page == EnumValue(ObjectType::Ride)) - { - _listSortType = RIDE_SORT_TYPE; - _listSortDescending = false; - } - else - { - _listSortType = RIDE_SORT_RIDE; - _listSortDescending = false; - } - - VisibleListRefresh(); - Invalidate(); - } - - void VisibleListRefresh() - { - int32_t numObjects = static_cast(ObjectRepositoryGetItemsCount()); - - VisibleListDispose(); - selected_list_item = -1; - - const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); - for (int32_t i = 0; i < numObjects; i++) - { - uint8_t selectionFlags = _objectSelectionFlags[i]; - const ObjectRepositoryItem* item = &items[i]; - if (item->Type == GetSelectedObjectType() && !(selectionFlags & ObjectSelectionFlags::Flag6) && FilterSource(item) - && FilterString(*item) && FilterChunks(item) && FilterSelected(selectionFlags) - && FilterCompatibilityObject(*item, selectionFlags)) - { - auto filter = std::make_unique(); - filter->category[0] = 0; - filter->category[1] = 0; - filter->ride_type = 0; - - ObjectListItem currentListItem; - currentListItem.repositoryItem = item; - currentListItem.filter = std::move(filter); - currentListItem.flags = &_objectSelectionFlags[i]; - _listItems.push_back(std::move(currentListItem)); - } - } - - if (_listItems.empty()) - { - VisibleListDispose(); - } - else - { - sortFunc_t sortFunc = nullptr; - switch (_listSortType) - { - case RIDE_SORT_TYPE: - sortFunc = VisibleListSortRideType; - break; - case RIDE_SORT_RIDE: - sortFunc = VisibleListSortRideName; - break; - default: - LOG_WARNING("Wrong sort type %d, leaving list as-is.", _listSortType); - break; - } - if (sortFunc != nullptr) - { - std::sort(_listItems.begin(), _listItems.end(), sortFunc); - if (_listSortDescending) - { - std::reverse(_listItems.begin(), _listItems.end()); - } - } - } - Invalidate(); - } - - void VisibleListDispose() - { - _listItems.clear(); - _listItems.shrink_to_fit(); - } - - void DrawDescriptions(DrawPixelInfo& dpi) - { - const auto& widget = widgets[WIDX_PREVIEW]; - auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_LIST].right + 4, widget.bottom + 23 }; - auto _width2 = windowPos.x + this->width - screenPos.x - 4; - - if (_loadedObject->IsCompatibilityObject()) - { - screenPos.y += DrawTextWrapped( - dpi, screenPos, _width2, STR_OBJECT_SELECTION_COMPAT_OBJECT_DESCRIPTION, {}, - { COLOUR_BRIGHT_RED }) - + LIST_ROW_HEIGHT; - } - - auto description = ObjectGetDescription(_loadedObject.get()); - if (!description.empty()) - { - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(description.c_str()); - - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT; - } - if (GetSelectedObjectType() == ObjectType::Ride) - { - auto* rideObject = reinterpret_cast(_loadedObject.get()); - const auto* rideEntry = reinterpret_cast(rideObject->GetLegacyData()); - if (rideEntry->shop_item[0] != ShopItem::None) - { - std::string sells = ""; - for (size_t i = 0; i < std::size(rideEntry->shop_item); i++) - { - if (rideEntry->shop_item[i] == ShopItem::None) + const auto& widget = widgets[WIDX_FILTER_RIDE_TAB_ALL + i]; + if (widget.type == WindowWidgetType::Empty) continue; - if (!sells.empty()) - sells += ", "; + int32_t spriteIndex = ride_tabs[i]; + int32_t frame = 0; + if (i != 0 && IsWidgetPressed(WIDX_FILTER_RIDE_TAB_ALL + i)) + { + frame = frame_no / window_editor_object_selection_animation_divisor[i - 1]; + } + spriteIndex += (i == 4 ? ThrillRidesTabAnimationSequence[frame] : frame); - sells += LanguageGetString(GetShopItemDescriptor(rideEntry->shop_item[i]).Naming.Plural); + auto screenPos = windowPos + ScreenCoordsXY{ widget.left, widget.top }; + GfxDrawSprite(dpi, ImageId(spriteIndex, colours[1]), screenPos); } - auto ft = Formatter(); - ft.Add(sells.c_str()); - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_RIDE_OBJECT_SHOP_SELLS, ft) + 2; } - } - else if (GetSelectedObjectType() == ObjectType::SceneryGroup) - { - const auto* sceneryGroupObject = reinterpret_cast(_loadedObject.get()); - auto ft = Formatter(); - ft.Add(sceneryGroupObject->GetNumIncludedObjects()); - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_INCLUDES_X_OBJECTS, ft) + 2; - } - else if (GetSelectedObjectType() == ObjectType::Music) - { - screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_MUSIC_OBJECT_TRACK_HEADER) + 2; - const auto* musicObject = reinterpret_cast(_loadedObject.get()); - for (size_t i = 0; i < musicObject->GetTrackCount(); i++) - { - const auto* track = musicObject->GetTrack(i); - if (track->Name.empty()) - continue; - auto stringId = track->Composer.empty() ? STR_MUSIC_OBJECT_TRACK_LIST_ITEM - : STR_MUSIC_OBJECT_TRACK_LIST_ITEM_WITH_COMPOSER; + // Preview background + const auto& previewWidget = widgets[WIDX_PREVIEW]; + GfxFillRect( + dpi, + { windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }, + windowPos + ScreenCoordsXY{ previewWidget.right - 1, previewWidget.bottom - 1 } }, + ColourMapA[colours[1]].darkest); + + // Draw number of selected items + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + auto screenPos = windowPos + ScreenCoordsXY{ 3, height - 13 }; + + int32_t numSelected = _numSelectedObjectsForType[EnumValue(GetSelectedObjectType())]; + int32_t totalSelectable = object_entry_group_counts[EnumValue(GetSelectedObjectType())]; + auto ft = Formatter(); - ft.Add(track->Name.c_str()); - ft.Add(track->Composer.c_str()); - screenPos.y += DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 10, 0 }, _width2, stringId, ft); + ft.Add(numSelected); + ft.Add(totalSelectable); + DrawTextBasic(dpi, screenPos, STR_OBJECT_SELECTION_SELECTION_SIZE, ft); } - } - } - void DrawDebugData(DrawPixelInfo& dpi) - { - ObjectListItem* listItem = &_listItems[selected_list_item]; - auto screenPos = windowPos + ScreenCoordsXY{ width - 5, height - (LIST_ROW_HEIGHT * 6) }; - - // Draw fallback image warning - if (_loadedObject && _loadedObject->UsesFallbackImages()) - { - DrawTextBasic(dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); - } - screenPos.y += LIST_ROW_HEIGHT; - - // Draw ride type. - if (GetSelectedObjectType() == ObjectType::Ride) - { - auto stringId = GetRideTypeStringId(listItem->repositoryItem); - DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); - } - - screenPos.y += LIST_ROW_HEIGHT; - - // Draw object source - auto stringId = ObjectManagerGetSourceGameString(listItem->repositoryItem->GetFirstSourceGame()); - DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); - screenPos.y += LIST_ROW_HEIGHT; - - // Draw object filename - { - auto path = Path::GetFileName(listItem->repositoryItem->Path); - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(path.c_str()); - DrawTextBasic( - dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft, - { COLOUR_BLACK, TextAlignment::RIGHT }); - screenPos.y += LIST_ROW_HEIGHT; - } - - // Draw object author (will be blank space if no author in file or a non JSON object) - { - auto ft = Formatter(); - std::string authorsString; - for (size_t i = 0; i < listItem->repositoryItem->Authors.size(); i++) + // Draw sort button text + const auto& listSortTypeWidget = widgets[WIDX_LIST_SORT_TYPE]; + if (listSortTypeWidget.type != WindowWidgetType::Empty) { - if (i > 0) + auto ft = Formatter(); + auto stringId = _listSortType == RIDE_SORT_TYPE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) + : STR_NONE; + 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] }); + } + const auto& listSortRideWidget = widgets[WIDX_LIST_SORT_RIDE]; + if (listSortRideWidget.type != WindowWidgetType::Empty) + { + auto ft = Formatter(); + auto stringId = _listSortType == RIDE_SORT_RIDE ? static_cast(_listSortDescending ? STR_DOWN : STR_UP) + : STR_NONE; + 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] }); + } + + if (selected_list_item == -1 || _loadedObject == nullptr) + return; + + ObjectListItem* listItem = &_listItems[selected_list_item]; + + // Draw preview + { + DrawPixelInfo clipDPI; + auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.left + 1, previewWidget.top + 1 }; + _width = previewWidget.width() - 1; + int32_t _height = previewWidget.height() - 1; + if (ClipDrawPixelInfo(clipDPI, dpi, screenPos, _width, _height)) { - authorsString.append(", "); + _loadedObject->DrawPreview(clipDPI, _width, _height); } - authorsString.append(listItem->repositoryItem->Authors[i]); } - ft.Add(STR_STRING); - ft.Add(authorsString.c_str()); - DrawTextEllipsised( - dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4, - STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::RIGHT }); - } - } - bool FilterSelected(uint8_t objectFlag) - { - // Track Manager has no concept of selection filtering, so always return true - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - return true; - } - if (_FILTER_SELECTED == _FILTER_NONSELECTED) - { - return true; - } - if (_FILTER_SELECTED && objectFlag & ObjectSelectionFlags::Selected) - { - return true; - } - if (_FILTER_NONSELECTED && !(objectFlag & ObjectSelectionFlags::Selected)) - { - return true; + // Draw name of object + { + auto screenPos = windowPos + ScreenCoordsXY{ previewWidget.midX() + 1, previewWidget.bottom + 3 }; + _width = this->width - widgets[WIDX_LIST].right - 6; + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(listItem->repositoryItem->Name.c_str()); + DrawTextEllipsised(dpi, screenPos, _width, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); + } + + DrawDescriptions(dpi); + DrawDebugData(dpi); } - return false; - } - - bool FilterCompatibilityObject(const ObjectRepositoryItem& item, uint8_t objectFlag) - { - // Only show compat objects if they are not selected already. - return !(item.Flags & ObjectItemFlags::IsCompatibilityObject) || (objectFlag & ObjectSelectionFlags::Selected); - } - - static bool IsFilterInName(const ObjectRepositoryItem& item, std::string_view filter) - { - return String::Contains(item.Name, filter, true); - } - - static bool IsFilterInRideType(const ObjectRepositoryItem& item, std::string_view filter) - { - if (item.Type == ObjectType::Ride) + private: + void InitWidgets() { - auto rideTypeName = LanguageGetString(GetRideTypeStringId(&item)); - if (String::Contains(rideTypeName, filter, true)) - return true; + auto& targetWidgets = _window_editor_object_selection_widgets; + if (!_window_editor_object_selection_widgets_initialised) + { + _window_editor_object_selection_widgets_initialised = true; + auto tabWidget = targetWidgets[targetWidgets.size() - 2]; + for (size_t i = 1; i < std::size(ObjectSelectionPages); i++) + { + targetWidgets.insert(targetWidgets.end() - 1, tabWidget); + } + } + + widgets = targetWidgets.data(); } - return false; - } - static bool IsFilterInFilename(const ObjectRepositoryItem& item, std::string_view filter) - { - return String::Contains(item.Path, filter, true); - } - - static bool IsFilterInAuthor(const ObjectRepositoryItem& item, std::string_view filter) - { - for (auto& author : item.Authors) + void SetPage(int32_t _page) { - if (String::Contains(author, filter, true)) + if (selected_tab == _page) + return; + + selected_tab = _page; + selected_list_item = -1; + scrolls[0].v_top = 0; + frame_no = 0; + + if (_page == EnumValue(ObjectType::Ride)) + { + _listSortType = RIDE_SORT_TYPE; + _listSortDescending = false; + } + else + { + _listSortType = RIDE_SORT_RIDE; + _listSortDescending = false; + } + + VisibleListRefresh(); + Invalidate(); + } + + void VisibleListRefresh() + { + int32_t numObjects = static_cast(ObjectRepositoryGetItemsCount()); + + VisibleListDispose(); + selected_list_item = -1; + + const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); + for (int32_t i = 0; i < numObjects; i++) + { + uint8_t selectionFlags = _objectSelectionFlags[i]; + const ObjectRepositoryItem* item = &items[i]; + if (item->Type == GetSelectedObjectType() && !(selectionFlags & ObjectSelectionFlags::Flag6) + && FilterSource(item) && FilterString(*item) && FilterChunks(item) && FilterSelected(selectionFlags) + && FilterCompatibilityObject(*item, selectionFlags)) + { + auto filter = std::make_unique(); + filter->category[0] = 0; + filter->category[1] = 0; + filter->ride_type = 0; + + ObjectListItem currentListItem; + currentListItem.repositoryItem = item; + currentListItem.filter = std::move(filter); + currentListItem.flags = &_objectSelectionFlags[i]; + _listItems.push_back(std::move(currentListItem)); + } + } + + if (_listItems.empty()) + { + VisibleListDispose(); + } + else + { + sortFunc_t sortFunc = nullptr; + switch (_listSortType) + { + case RIDE_SORT_TYPE: + sortFunc = VisibleListSortRideType; + break; + case RIDE_SORT_RIDE: + sortFunc = VisibleListSortRideName; + break; + default: + LOG_WARNING("Wrong sort type %d, leaving list as-is.", _listSortType); + break; + } + if (sortFunc != nullptr) + { + std::sort(_listItems.begin(), _listItems.end(), sortFunc); + if (_listSortDescending) + { + std::reverse(_listItems.begin(), _listItems.end()); + } + } + } + Invalidate(); + } + + void VisibleListDispose() + { + _listItems.clear(); + _listItems.shrink_to_fit(); + } + + void DrawDescriptions(DrawPixelInfo& dpi) + { + const auto& widget = widgets[WIDX_PREVIEW]; + auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_LIST].right + 4, widget.bottom + 23 }; + auto _width2 = windowPos.x + this->width - screenPos.x - 4; + + if (_loadedObject->IsCompatibilityObject()) + { + screenPos.y += DrawTextWrapped( + dpi, screenPos, _width2, STR_OBJECT_SELECTION_COMPAT_OBJECT_DESCRIPTION, {}, + { COLOUR_BRIGHT_RED }) + + LIST_ROW_HEIGHT; + } + + auto description = ObjectGetDescription(_loadedObject.get()); + if (!description.empty()) + { + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(description.c_str()); + + screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_WINDOW_COLOUR_2_STRINGID, ft) + LIST_ROW_HEIGHT; + } + if (GetSelectedObjectType() == ObjectType::Ride) + { + auto* rideObject = reinterpret_cast(_loadedObject.get()); + const auto* rideEntry = reinterpret_cast(rideObject->GetLegacyData()); + if (rideEntry->shop_item[0] != ShopItem::None) + { + std::string sells = ""; + for (size_t i = 0; i < std::size(rideEntry->shop_item); i++) + { + if (rideEntry->shop_item[i] == ShopItem::None) + continue; + + if (!sells.empty()) + sells += ", "; + + sells += LanguageGetString(GetShopItemDescriptor(rideEntry->shop_item[i]).Naming.Plural); + } + auto ft = Formatter(); + ft.Add(sells.c_str()); + screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_RIDE_OBJECT_SHOP_SELLS, ft) + 2; + } + } + else if (GetSelectedObjectType() == ObjectType::SceneryGroup) + { + const auto* sceneryGroupObject = reinterpret_cast(_loadedObject.get()); + auto ft = Formatter(); + ft.Add(sceneryGroupObject->GetNumIncludedObjects()); + screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_INCLUDES_X_OBJECTS, ft) + 2; + } + else if (GetSelectedObjectType() == ObjectType::Music) + { + screenPos.y += DrawTextWrapped(dpi, screenPos, _width2, STR_MUSIC_OBJECT_TRACK_HEADER) + 2; + const auto* musicObject = reinterpret_cast(_loadedObject.get()); + for (size_t i = 0; i < musicObject->GetTrackCount(); i++) + { + const auto* track = musicObject->GetTrack(i); + if (track->Name.empty()) + continue; + + auto stringId = track->Composer.empty() ? STR_MUSIC_OBJECT_TRACK_LIST_ITEM + : STR_MUSIC_OBJECT_TRACK_LIST_ITEM_WITH_COMPOSER; + auto ft = Formatter(); + ft.Add(track->Name.c_str()); + ft.Add(track->Composer.c_str()); + screenPos.y += DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 10, 0 }, _width2, stringId, ft); + } + } + } + + void DrawDebugData(DrawPixelInfo& dpi) + { + ObjectListItem* listItem = &_listItems[selected_list_item]; + auto screenPos = windowPos + ScreenCoordsXY{ width - 5, height - (LIST_ROW_HEIGHT * 6) }; + + // Draw fallback image warning + if (_loadedObject && _loadedObject->UsesFallbackImages()) + { + DrawTextBasic(dpi, screenPos, STR_OBJECT_USES_FALLBACK_IMAGES, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); + } + screenPos.y += LIST_ROW_HEIGHT; + + // Draw ride type. + if (GetSelectedObjectType() == ObjectType::Ride) + { + auto stringId = GetRideTypeStringId(listItem->repositoryItem); + DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); + } + + screenPos.y += LIST_ROW_HEIGHT; + + // Draw object source + auto stringId = ObjectManagerGetSourceGameString(listItem->repositoryItem->GetFirstSourceGame()); + DrawTextBasic(dpi, screenPos, stringId, {}, { COLOUR_WHITE, TextAlignment::RIGHT }); + screenPos.y += LIST_ROW_HEIGHT; + + // Draw object filename + { + auto path = Path::GetFileName(listItem->repositoryItem->Path); + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(path.c_str()); + DrawTextBasic( + dpi, { windowPos.x + this->width - 5, screenPos.y }, STR_WINDOW_COLOUR_2_STRINGID, ft, + { COLOUR_BLACK, TextAlignment::RIGHT }); + screenPos.y += LIST_ROW_HEIGHT; + } + + // Draw object author (will be blank space if no author in file or a non JSON object) + { + auto ft = Formatter(); + std::string authorsString; + for (size_t i = 0; i < listItem->repositoryItem->Authors.size(); i++) + { + if (i > 0) + { + authorsString.append(", "); + } + authorsString.append(listItem->repositoryItem->Authors[i]); + } + ft.Add(STR_STRING); + ft.Add(authorsString.c_str()); + DrawTextEllipsised( + dpi, { windowPos.x + width - 5, screenPos.y }, width - widgets[WIDX_LIST].right - 4, + STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::RIGHT }); + } + } + + bool FilterSelected(uint8_t objectFlag) + { + // Track Manager has no concept of selection filtering, so always return true + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { return true; } + if (_FILTER_SELECTED == _FILTER_NONSELECTED) + { + return true; + } + if (_FILTER_SELECTED && objectFlag & ObjectSelectionFlags::Selected) + { + return true; + } + if (_FILTER_NONSELECTED && !(objectFlag & ObjectSelectionFlags::Selected)) + { + return true; + } + + return false; } - return false; - } - bool FilterString(const ObjectRepositoryItem& item) - { - // Nothing to search for - std::string_view filter = _filter_string; - if (filter.empty()) - return true; + bool FilterCompatibilityObject(const ObjectRepositoryItem& item, uint8_t objectFlag) + { + // Only show compat objects if they are not selected already. + return !(item.Flags & ObjectItemFlags::IsCompatibilityObject) || (objectFlag & ObjectSelectionFlags::Selected); + } - return IsFilterInName(item, filter) || IsFilterInRideType(item, filter) || IsFilterInFilename(item, filter) - || IsFilterInAuthor(item, filter); - } + static bool IsFilterInName(const ObjectRepositoryItem& item, std::string_view filter) + { + return String::Contains(item.Name, filter, true); + } - bool SourcesMatch(ObjectSourceGame source) - { - // clang-format off + static bool IsFilterInRideType(const ObjectRepositoryItem& item, std::string_view filter) + { + if (item.Type == ObjectType::Ride) + { + auto rideTypeName = LanguageGetString(GetRideTypeStringId(&item)); + if (String::Contains(rideTypeName, filter, true)) + return true; + } + return false; + } + + static bool IsFilterInFilename(const ObjectRepositoryItem& item, std::string_view filter) + { + return String::Contains(item.Path, filter, true); + } + + static bool IsFilterInAuthor(const ObjectRepositoryItem& item, std::string_view filter) + { + for (auto& author : item.Authors) + { + if (String::Contains(author, filter, true)) + { + return true; + } + } + return false; + } + + bool FilterString(const ObjectRepositoryItem& item) + { + // Nothing to search for + std::string_view filter = _filter_string; + if (filter.empty()) + return true; + + return IsFilterInName(item, filter) || IsFilterInRideType(item, filter) || IsFilterInFilename(item, filter) + || IsFilterInAuthor(item, filter); + } + + bool SourcesMatch(ObjectSourceGame source) + { + // clang-format off return (_FILTER_RCT1 && source == ObjectSourceGame::RCT1) || (_FILTER_AA && source == ObjectSourceGame::AddedAttractions) || (_FILTER_LL && source == ObjectSourceGame::LoopyLandscapes) || @@ -1436,226 +1437,227 @@ private: source != ObjectSourceGame::WackyWorlds && source != ObjectSourceGame::TimeTwister && source != ObjectSourceGame::OpenRCT2Official); - // clang-format on - } + // clang-format on + } - bool FilterSource(const ObjectRepositoryItem* item) - { - if (_FILTER_ALL) - return true; - - for (auto source : item->Sources) + bool FilterSource(const ObjectRepositoryItem* item) { - if (SourcesMatch(source)) + if (_FILTER_ALL) return true; - } - return false; - } - - bool FilterChunks(const ObjectRepositoryItem* item) - { - if (item->Type == ObjectType::Ride) - { - ride_type_t rideType = 0; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) + for (auto source : item->Sources) { - if (item->RideInfo.RideType[i] != RIDE_TYPE_NULL) - { - rideType = item->RideInfo.RideType[i]; - break; - } + if (SourcesMatch(source)) + return true; } - return (_filter_flags & (1 << (GetRideTypeDescriptor(rideType).Category + _numSourceGameItems))) != 0; + + return false; } - return true; - } - void FilterUpdateCounts() - { - if (!_FILTER_ALL || _filter_string[0] != '\0') + bool FilterChunks(const ObjectRepositoryItem* item) { - const auto& selectionFlags = _objectSelectionFlags; - std::fill(std::begin(_filter_object_counts), std::end(_filter_object_counts), 0); - - size_t numObjects = ObjectRepositoryGetItemsCount(); - const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); - for (size_t i = 0; i < numObjects; i++) + if (item->Type == ObjectType::Ride) { - const ObjectRepositoryItem* item = &items[i]; - if (FilterSource(item) && FilterString(*item) && FilterChunks(item) && FilterSelected(selectionFlags[i]) - && FilterCompatibilityObject(*item, selectionFlags[i])) + ride_type_t rideType = 0; + for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) { - _filter_object_counts[EnumValue(item->Type)]++; + if (item->RideInfo.RideType[i] != RIDE_TYPE_NULL) + { + rideType = item->RideInfo.RideType[i]; + break; + } + } + return (_filter_flags & (1 << (GetRideTypeDescriptor(rideType).Category + _numSourceGameItems))) != 0; + } + return true; + } + + void FilterUpdateCounts() + { + if (!_FILTER_ALL || _filter_string[0] != '\0') + { + const auto& selectionFlags = _objectSelectionFlags; + std::fill(std::begin(_filter_object_counts), std::end(_filter_object_counts), 0); + + size_t numObjects = ObjectRepositoryGetItemsCount(); + const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); + for (size_t i = 0; i < numObjects; i++) + { + const ObjectRepositoryItem* item = &items[i]; + if (FilterSource(item) && FilterString(*item) && FilterChunks(item) && FilterSelected(selectionFlags[i]) + && FilterCompatibilityObject(*item, selectionFlags[i])) + { + _filter_object_counts[EnumValue(item->Type)]++; + } } } } - } - std::string ObjectGetDescription(const Object* object) - { - switch (object->GetObjectType()) + std::string ObjectGetDescription(const Object* object) { - case ObjectType::Ride: + switch (object->GetObjectType()) { - const RideObject* rideObject = static_cast(object); - return rideObject->GetDescription(); + case ObjectType::Ride: + { + const RideObject* rideObject = static_cast(object); + return rideObject->GetDescription(); + } + default: + return ""; } - default: - return ""; } - } - ObjectType GetSelectedObjectType() - { - const bool inBounds = selected_tab >= 0 && selected_tab < static_cast(std::size(TabOrder)); - return inBounds ? TabOrder[selected_tab] : ObjectType::Ride; - } + ObjectType GetSelectedObjectType() + { + const bool inBounds = selected_tab >= 0 && selected_tab < static_cast(std::size(TabOrder)); + return inBounds ? TabOrder[selected_tab] : ObjectType::Ride; + } + + /** + * Takes the y coordinate of the clicked on scroll list + * and converts this into an object selection. + * Returns the position in the list. + * Object_selection_flags, installed_entry also populated + * + * rct2: 0x006AA703 + */ + int32_t GetObjectFromObjectSelection(ObjectType object_type, int32_t y) + { + int32_t listItemIndex = y / SCROLLABLE_ROW_HEIGHT; + if (listItemIndex < 0 || static_cast(listItemIndex) >= _listItems.size()) + return -1; + + return listItemIndex; + } + + void SetPressedTab() + { + for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) + { + pressed_widgets &= ~(1ull << (WIDX_TAB_1 + i)); + } + pressed_widgets |= 1LL << (WIDX_TAB_1 + selected_tab); + } + + /** + * + * rct2: 0x006D33E2 + */ + void ManageTracks() + { + SetEveryRideTypeInvented(); + SetEveryRideEntryInvented(); + + GetGameState().EditorStep = EditorStep::DesignsManager; + + int32_t entry_index = 0; + for (; ObjectEntryGetChunk(ObjectType::Ride, entry_index) == nullptr; entry_index++) + ; + + const auto* rideEntry = GetRideEntryByIndex(entry_index); + auto rideType = rideEntry->GetFirstNonNullRideType(); + + auto intent = Intent(WindowClass::TrackDesignList); + intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, rideType); + intent.PutExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, entry_index); + ContextOpenIntent(&intent); + } + }; /** - * Takes the y coordinate of the clicked on scroll list - * and converts this into an object selection. - * Returns the position in the list. - * Object_selection_flags, installed_entry also populated * - * rct2: 0x006AA703 + * rct2: 0x006AA64E */ - int32_t GetObjectFromObjectSelection(ObjectType object_type, int32_t y) + WindowBase* WindowEditorObjectSelectionOpen() { - int32_t listItemIndex = y / SCROLLABLE_ROW_HEIGHT; - if (listItemIndex < 0 || static_cast(listItemIndex) >= _listItems.size()) - return -1; - - return listItemIndex; + return WindowFocusOrCreate( + WindowClass::EditorObjectSelection, 755, 400, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); } - void SetPressedTab() + static bool VisibleListSortRideName(const ObjectListItem& a, const ObjectListItem& b) { - for (size_t i = 0; i < std::size(ObjectSelectionPages); i++) + auto nameA = a.repositoryItem->Name.c_str(); + auto nameB = b.repositoryItem->Name.c_str(); + return strcmp(nameA, nameB) < 0; + } + + static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListItem& b) + { + auto rideTypeA = LanguageGetString(GetRideTypeStringId(a.repositoryItem)); + auto rideTypeB = LanguageGetString(GetRideTypeStringId(b.repositoryItem)); + int32_t result = String::Compare(rideTypeA, rideTypeB); + return result != 0 ? result < 0 : VisibleListSortRideName(a, b); + } + + static StringId GetRideTypeStringId(const ObjectRepositoryItem* item) + { + StringId result = STR_NONE; + for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) { - pressed_widgets &= ~(1ull << (WIDX_TAB_1 + i)); + auto rideType = item->RideInfo.RideType[i]; + if (rideType != RIDE_TYPE_NULL) + { + result = GetRideTypeDescriptor(rideType).Naming.Name; + break; + } } - pressed_widgets |= 1LL << (WIDX_TAB_1 + selected_tab); + return result; } /** * - * rct2: 0x006D33E2 + * rct2: 0x006ABBBE */ - void ManageTracks() + void EditorLoadSelectedObjects() { - SetEveryRideTypeInvented(); - SetEveryRideEntryInvented(); - - GetGameState().EditorStep = EditorStep::DesignsManager; - - int32_t entry_index = 0; - for (; ObjectEntryGetChunk(ObjectType::Ride, entry_index) == nullptr; entry_index++) - ; - - const auto* rideEntry = GetRideEntryByIndex(entry_index); - auto rideType = rideEntry->GetFirstNonNullRideType(); - - auto intent = Intent(WindowClass::TrackDesignList); - intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, rideType); - intent.PutExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, entry_index); - ContextOpenIntent(&intent); - } -}; - -/** - * - * rct2: 0x006AA64E - */ -WindowBase* WindowEditorObjectSelectionOpen() -{ - return WindowFocusOrCreate( - WindowClass::EditorObjectSelection, 755, 400, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); -} - -static bool VisibleListSortRideName(const ObjectListItem& a, const ObjectListItem& b) -{ - auto nameA = a.repositoryItem->Name.c_str(); - auto nameB = b.repositoryItem->Name.c_str(); - return strcmp(nameA, nameB) < 0; -} - -static bool VisibleListSortRideType(const ObjectListItem& a, const ObjectListItem& b) -{ - auto rideTypeA = LanguageGetString(GetRideTypeStringId(a.repositoryItem)); - auto rideTypeB = LanguageGetString(GetRideTypeStringId(b.repositoryItem)); - int32_t result = String::Compare(rideTypeA, rideTypeB); - return result != 0 ? result < 0 : VisibleListSortRideName(a, b); -} - -static StringId GetRideTypeStringId(const ObjectRepositoryItem* item) -{ - StringId result = STR_NONE; - for (int32_t i = 0; i < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; i++) - { - auto rideType = item->RideInfo.RideType[i]; - if (rideType != RIDE_TYPE_NULL) + auto& objManager = GetContext()->GetObjectManager(); + int32_t numItems = static_cast(ObjectRepositoryGetItemsCount()); + const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); + bool showFallbackWarning = false; + for (int32_t i = 0; i < numItems; i++) { - result = GetRideTypeDescriptor(rideType).Naming.Name; - break; - } - } - return result; -} - -/** - * - * rct2: 0x006ABBBE - */ -void EditorLoadSelectedObjects() -{ - auto& objManager = GetContext()->GetObjectManager(); - int32_t numItems = static_cast(ObjectRepositoryGetItemsCount()); - const ObjectRepositoryItem* items = ObjectRepositoryGetItems(); - bool showFallbackWarning = false; - for (int32_t i = 0; i < numItems; i++) - { - if (_objectSelectionFlags[i] & ObjectSelectionFlags::Selected) - { - const auto* item = &items[i]; - auto descriptor = ObjectEntryDescriptor(*item); - const auto* loadedObject = objManager.GetLoadedObject(descriptor); - if (loadedObject == nullptr) + if (_objectSelectionFlags[i] & ObjectSelectionFlags::Selected) { - loadedObject = objManager.LoadObject(descriptor); + const auto* item = &items[i]; + auto descriptor = ObjectEntryDescriptor(*item); + const auto* loadedObject = objManager.GetLoadedObject(descriptor); if (loadedObject == nullptr) { - LOG_ERROR("Failed to load entry %s", std::string(descriptor.GetName()).c_str()); - } - else if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) - { - // Defaults selected items to researched (if in-game) - auto objectType = loadedObject->GetObjectType(); - auto entryIndex = ObjectManagerGetLoadedObjectEntryIndex(loadedObject); - if (objectType == ObjectType::Ride) + loadedObject = objManager.LoadObject(descriptor); + if (loadedObject == nullptr) { - const auto* rideEntry = GetRideEntryByIndex(entryIndex); - auto rideType = rideEntry->GetFirstNonNullRideType(); - ResearchCategory category = static_cast(GetRideTypeDescriptor(rideType).Category); - ResearchInsertRideEntry(rideType, entryIndex, category, true); + LOG_ERROR("Failed to load entry %s", std::string(descriptor.GetName()).c_str()); } - else if (objectType == ObjectType::SceneryGroup) + else if (!(gScreenFlags & SCREEN_FLAGS_EDITOR)) { - ResearchInsertSceneryGroupEntry(entryIndex, true); - } - if (loadedObject->UsesFallbackImages()) - { - showFallbackWarning = true; + // Defaults selected items to researched (if in-game) + auto objectType = loadedObject->GetObjectType(); + auto entryIndex = ObjectManagerGetLoadedObjectEntryIndex(loadedObject); + if (objectType == ObjectType::Ride) + { + const auto* rideEntry = GetRideEntryByIndex(entryIndex); + auto rideType = rideEntry->GetFirstNonNullRideType(); + ResearchCategory category = static_cast(GetRideTypeDescriptor(rideType).Category); + ResearchInsertRideEntry(rideType, entryIndex, category, true); + } + else if (objectType == ObjectType::SceneryGroup) + { + ResearchInsertSceneryGroupEntry(entryIndex, true); + } + if (loadedObject->UsesFallbackImages()) + { + showFallbackWarning = true; + } } } } } + if (_numSelectedObjectsForType[EnumValue(ObjectType::Water)] == 0) + { + // Reloads the default cyan water palette if no palette was selected. + LoadPalette(); + } + if (showFallbackWarning) + ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); } - if (_numSelectedObjectsForType[EnumValue(ObjectType::Water)] == 0) - { - // Reloads the default cyan water palette if no palette was selected. - LoadPalette(); - } - if (showFallbackWarning) - ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index da18273156..48703f40f0 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -29,40 +29,40 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_OBJECTIVE_SELECTION; + static constexpr int32_t WH = 229; + static constexpr int32_t WW = 450; -static constexpr StringId WINDOW_TITLE = STR_OBJECTIVE_SELECTION; -static constexpr int32_t WH = 229; -static constexpr int32_t WW = 450; + static constexpr money64 ObjectiveCurrencyLoanAndValueMax = 2000000.00_GBP; + static constexpr money64 ObjectiveCurrencyLoanAndValueMin = 1000.00_GBP; + static constexpr money64 ObjectiveCurrencyLoanAndValueAdjustment = 1000.00_GBP; -static constexpr money64 ObjectiveCurrencyLoanAndValueMax = 2000000.00_GBP; -static constexpr money64 ObjectiveCurrencyLoanAndValueMin = 1000.00_GBP; -static constexpr money64 ObjectiveCurrencyLoanAndValueAdjustment = 1000.00_GBP; + static constexpr money64 ObjectiveCurrencyFoodMax = 2000000.00_GBP; + static constexpr money64 ObjectiveCurrencyFoodMin = 1000.00_GBP; + static constexpr money64 ObjectiveCurrencyFoodAdjustment = 100.00_GBP; -static constexpr money64 ObjectiveCurrencyFoodMax = 2000000.00_GBP; -static constexpr money64 ObjectiveCurrencyFoodMin = 1000.00_GBP; -static constexpr money64 ObjectiveCurrencyFoodAdjustment = 100.00_GBP; + static constexpr uint16_t ObjectiveLengthMax = 5000; + static constexpr uint16_t ObjectiveLengthMin = 1000; + static constexpr uint16_t ObjectiveLengthAdjustment = 100; -static constexpr uint16_t ObjectiveLengthMax = 5000; -static constexpr uint16_t ObjectiveLengthMin = 1000; -static constexpr uint16_t ObjectiveLengthAdjustment = 100; + static constexpr uint16_t ObjectiveExcitementMax = FIXED_2DP(9, 90); + static constexpr uint16_t ObjectiveExcitementMin = FIXED_2DP(4, 00); + static constexpr uint16_t ObjectiveExcitementAdjustment = FIXED_2DP(0, 10); -static constexpr uint16_t ObjectiveExcitementMax = FIXED_2DP(9, 90); -static constexpr uint16_t ObjectiveExcitementMin = FIXED_2DP(4, 00); -static constexpr uint16_t ObjectiveExcitementAdjustment = FIXED_2DP(0, 10); + // The number has to leave a bit of room for other entities like vehicles, litter and balloons. + static constexpr uint16_t ObjectiveGuestsMax = 50000; + static constexpr uint16_t ObjectiveGuestsMin = 250; + static constexpr uint16_t ObjectiveGuestsAdjustment = 50; -// The number has to leave a bit of room for other entities like vehicles, litter and balloons. -static constexpr uint16_t ObjectiveGuestsMax = 50000; -static constexpr uint16_t ObjectiveGuestsMin = 250; -static constexpr uint16_t ObjectiveGuestsAdjustment = 50; - -static constexpr uint8_t ObjectiveYearMax = 25; -static constexpr uint8_t ObjectiveYearMin = 1; -static constexpr uint8_t ObjectiveYearAdjustment = 1; + static constexpr uint8_t ObjectiveYearMax = 25; + static constexpr uint8_t ObjectiveYearMin = 1; + static constexpr uint8_t ObjectiveYearAdjustment = 1; #pragma region Widgets -// clang-format off + // clang-format off enum { WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN, WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES, @@ -152,1053 +152,1056 @@ static uint64_t window_editor_objective_options_page_hold_down_widgets[] = { 0, }; -// clang-format on + // clang-format on #pragma endregion -class EditorObjectiveOptionsWindow final : public Window -{ -private: - // Not shops or facilities - std::vector _rideableRides; - -public: - void OnOpen() override + class EditorObjectiveOptionsWindow final : public Window { - widgets = window_editor_objective_options_main_widgets; - pressed_widgets = 0; - hold_down_widgets = window_editor_objective_options_page_hold_down_widgets[WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN]; - InitScrollWidgets(); - selected_tab = WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN; - selected_list_item = -1; - UpdateDisabledWidgets(); - } + private: + // Not shops or facilities + std::vector _rideableRides; - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - SetPage(widgetIndex - WIDX_TAB_1); - return; + widgets = window_editor_objective_options_main_widgets; + pressed_widgets = 0; + hold_down_widgets = window_editor_objective_options_page_hold_down_widgets + [WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN]; + InitScrollWidgets(); + selected_tab = WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN; + selected_list_item = -1; + UpdateDisabledWidgets(); } - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) + void OnMouseUp(WidgetIndex widgetIndex) override { - OnMouseUpMain(widgetIndex); - } - } + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + SetPage(widgetIndex - WIDX_TAB_1); + return; + } - void OnResize() override - { - switch (page) - { - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: - OnResizeMain(); - break; - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: - OnResizeRides(); - break; - } - } - - void OnPrepareDraw() override - { - switch (page) - { - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: - OnPrepareDrawMain(); - break; - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: - OnPrepareDrawRides(); - break; - } - } - - void OnUpdate() override - { - switch (page) - { - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: - OnUpdateMain(); - break; - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: - OnUpdateRides(); - break; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: - OnDrawMain(dpi); - break; - case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: - OnDrawRides(dpi); - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) - { - OnMouseDownMain(widgetIndex); - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) - { - OnDropdownMain(widgetIndex, selectedIndex); - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) - { - OnTextInputMain(widgetIndex, text); - } - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) - { - OnScrollMouseDownRides(scrollIndex, screenCoords); - } - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) - { - OnScrollMouseOverRides(scrollIndex, screenCoords); - } - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) - { - OnScrollDrawRides(dpi, scrollIndex); - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) - { - return OnScrollGetSizeRides(scrollIndex); + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) + { + OnMouseUpMain(widgetIndex); + } } - return {}; - } - -private: - /** - * - * rct2: 0x00668496 - */ - void SetPage(int32_t newPage) - { - if (page == newPage) - return; - - page = newPage; - frame_no = 0; - _rideableRides.clear(); - selected_list_item = -1; - hold_down_widgets = window_editor_objective_options_page_hold_down_widgets[newPage]; - widgets = window_editor_objective_options_widgets[newPage]; - Invalidate(); - UpdateDisabledWidgets(); - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - Invalidate(); - } - - /** - * - * rct2: 0x00672609 - */ - void UpdateDisabledWidgets() - { - // Check if there are any rides (not shops or facilities) - const auto& rideManager = GetRideManager(); - if (std::any_of(rideManager.begin(), rideManager.end(), [](const Ride& rideToCheck) { return rideToCheck.IsRide(); })) + void OnResize() override { - disabled_widgets &= ~(1uLL << WIDX_TAB_2); + switch (page) + { + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: + OnResizeMain(); + break; + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: + OnResizeRides(); + break; + } } - else + + void OnPrepareDraw() override { - disabled_widgets |= (1uLL << WIDX_TAB_2); + switch (page) + { + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: + OnPrepareDrawMain(); + break; + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: + OnPrepareDrawRides(); + break; + } } - } - void SetPressedTab() - { - int32_t i; - for (i = WIDX_TAB_1; i <= WIDX_TAB_2; i++) - pressed_widgets &= ~(1 << i); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); - } + void OnUpdate() override + { + switch (page) + { + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: + OnUpdateMain(); + break; + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: + OnUpdateRides(); + break; + } + } - void AnchorBorderWidgets() - { - ResizeFrameWithPage(); - } + void OnDraw(DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN: + OnDrawMain(dpi); + break; + case WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES: + OnDrawRides(dpi); + break; + } + } - void DrawTabImages(DrawPixelInfo& dpi) - { - Widget* widget; - int32_t spriteIndex; + void OnMouseDown(WidgetIndex widgetIndex) override + { + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) + { + OnMouseDownMain(widgetIndex); + } + } - // Tab 1 - widget = &widgets[WIDX_TAB_1]; + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) + { + OnDropdownMain(widgetIndex, selectedIndex); + } + } - spriteIndex = SPR_TAB_OBJECTIVE_0; - if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 16; + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) + { + OnTextInputMain(widgetIndex, text); + } + } - GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); - - // Tab 2 - if (!IsWidgetDisabled(WIDX_TAB_2)) + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - widget = &widgets[WIDX_TAB_2]; - spriteIndex = SPR_TAB_RIDE_0; if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) + { + OnScrollMouseDownRides(scrollIndex, screenCoords); + } + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) + { + OnScrollMouseOverRides(scrollIndex, screenCoords); + } + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) + { + OnScrollDrawRides(dpi, scrollIndex); + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) + { + return OnScrollGetSizeRides(scrollIndex); + } + + return {}; + } + + private: + /** + * + * rct2: 0x00668496 + */ + void SetPage(int32_t newPage) + { + if (page == newPage) + return; + + page = newPage; + frame_no = 0; + _rideableRides.clear(); + selected_list_item = -1; + hold_down_widgets = window_editor_objective_options_page_hold_down_widgets[newPage]; + widgets = window_editor_objective_options_widgets[newPage]; + Invalidate(); + UpdateDisabledWidgets(); + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + Invalidate(); + } + + /** + * + * rct2: 0x00672609 + */ + void UpdateDisabledWidgets() + { + // Check if there are any rides (not shops or facilities) + const auto& rideManager = GetRideManager(); + if (std::any_of( + rideManager.begin(), rideManager.end(), [](const Ride& rideToCheck) { return rideToCheck.IsRide(); })) + { + disabled_widgets &= ~(1uLL << WIDX_TAB_2); + } + else + { + disabled_widgets |= (1uLL << WIDX_TAB_2); + } + } + + void SetPressedTab() + { + int32_t i; + for (i = WIDX_TAB_1; i <= WIDX_TAB_2; i++) + pressed_widgets &= ~(1 << i); + pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + } + + void AnchorBorderWidgets() + { + ResizeFrameWithPage(); + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + Widget* widget; + int32_t spriteIndex; + + // Tab 1 + widget = &widgets[WIDX_TAB_1]; + + spriteIndex = SPR_TAB_OBJECTIVE_0; + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_MAIN) spriteIndex += (frame_no / 4) % 16; GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); - } - } - /** - * - * rct2: 0x0067201D - */ - void SetObjective(int32_t objective) - { - auto& gameState = GetGameState(); - gameState.ScenarioObjective.Type = objective; - Invalidate(); - - // Set default objective arguments - switch (objective) - { - case OBJECTIVE_NONE: - case OBJECTIVE_HAVE_FUN: - case OBJECTIVE_BUILD_THE_BEST: - case OBJECTIVE_10_ROLLERCOASTERS: - break; - case OBJECTIVE_GUESTS_BY: - gameState.ScenarioObjective.Year = 3; - gameState.ScenarioObjective.NumGuests = 1500; - break; - case OBJECTIVE_PARK_VALUE_BY: - gameState.ScenarioObjective.Year = 3; - gameState.ScenarioObjective.Currency = 50000.00_GBP; - break; - case OBJECTIVE_GUESTS_AND_RATING: - gameState.ScenarioObjective.NumGuests = 2000; - break; - case OBJECTIVE_MONTHLY_RIDE_INCOME: - gameState.ScenarioObjective.Currency = 10000.00_GBP; - break; - case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: - gameState.ScenarioObjective.MinimumLength = 1200; - break; - case OBJECTIVE_FINISH_5_ROLLERCOASTERS: - gameState.ScenarioObjective.MinimumExcitement = FIXED_2DP(6, 70); - break; - case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: - gameState.ScenarioObjective.Currency = 50000.00_GBP; - break; - case OBJECTIVE_MONTHLY_FOOD_INCOME: - gameState.ScenarioObjective.Currency = 1000.00_GBP; - break; - } - } - - void ShowObjectiveDropdown() - { - const auto& gameState = GetGameState(); - int32_t numItems = 0, objectiveType; - Widget* dropdownWidget; - - dropdownWidget = &widgets[WIDX_OBJECTIVE]; - - for (auto i = 0; i < OBJECTIVE_COUNT; i++) - { - if (i == OBJECTIVE_NONE || i == OBJECTIVE_BUILD_THE_BEST) - continue; - - const bool objectiveAllowedByMoneyUsage = !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) - || !ObjectiveNeedsMoney(i); - // This objective can only work if the player can ask money for rides. - const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME) || ParkRidePricesUnlocked(); - if (objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings) + // Tab 2 + if (!IsWidgetDisabled(WIDX_TAB_2)) { - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numItems].Args = ObjectiveDropdownOptionNames[i]; - numItems++; + widget = &widgets[WIDX_TAB_2]; + spriteIndex = SPR_TAB_RIDE_0; + if (page == WINDOW_EDITOR_OBJECTIVE_OPTIONS_PAGE_RIDES) + spriteIndex += (frame_no / 4) % 16; + + GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); } } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, numItems, dropdownWidget->width() - 3); - - objectiveType = gameState.ScenarioObjective.Type; - for (int32_t j = 0; j < numItems; j++) + /** + * + * rct2: 0x0067201D + */ + void SetObjective(int32_t objective) { - if (gDropdownItems[j].Args - STR_OBJECTIVE_DROPDOWN_NONE == objectiveType) + auto& gameState = GetGameState(); + gameState.ScenarioObjective.Type = objective; + Invalidate(); + + // Set default objective arguments + switch (objective) { - Dropdown::SetChecked(j, true); - break; + case OBJECTIVE_NONE: + case OBJECTIVE_HAVE_FUN: + case OBJECTIVE_BUILD_THE_BEST: + case OBJECTIVE_10_ROLLERCOASTERS: + break; + case OBJECTIVE_GUESTS_BY: + gameState.ScenarioObjective.Year = 3; + gameState.ScenarioObjective.NumGuests = 1500; + break; + case OBJECTIVE_PARK_VALUE_BY: + gameState.ScenarioObjective.Year = 3; + gameState.ScenarioObjective.Currency = 50000.00_GBP; + break; + case OBJECTIVE_GUESTS_AND_RATING: + gameState.ScenarioObjective.NumGuests = 2000; + break; + case OBJECTIVE_MONTHLY_RIDE_INCOME: + gameState.ScenarioObjective.Currency = 10000.00_GBP; + break; + case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: + gameState.ScenarioObjective.MinimumLength = 1200; + break; + case OBJECTIVE_FINISH_5_ROLLERCOASTERS: + gameState.ScenarioObjective.MinimumExcitement = FIXED_2DP(6, 70); + break; + case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: + gameState.ScenarioObjective.Currency = 50000.00_GBP; + break; + case OBJECTIVE_MONTHLY_FOOD_INCOME: + gameState.ScenarioObjective.Currency = 1000.00_GBP; + break; } } - } - void ShowCategoryDropdown() - { - int32_t i; - Widget* dropdownWidget; + void ShowObjectiveDropdown() + { + const auto& gameState = GetGameState(); + int32_t numItems = 0, objectiveType; + Widget* dropdownWidget; - dropdownWidget = &widgets[WIDX_CATEGORY]; + dropdownWidget = &widgets[WIDX_OBJECTIVE]; - for (i = SCENARIO_CATEGORY_BEGINNER; i <= SCENARIO_CATEGORY_OTHER; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = ScenarioCategoryStringIds[i]; - } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, 5, dropdownWidget->width() - 3); - Dropdown::SetChecked(GetGameState().ScenarioCategory, true); - } + for (auto i = 0; i < OBJECTIVE_COUNT; i++) + { + if (i == OBJECTIVE_NONE || i == OBJECTIVE_BUILD_THE_BEST) + continue; - void Arg1Increase() - { - auto& gameState = GetGameState(); - switch (gameState.ScenarioObjective.Type) - { - case OBJECTIVE_PARK_VALUE_BY: - case OBJECTIVE_MONTHLY_RIDE_INCOME: - case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: - if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyLoanAndValueMax) + const bool objectiveAllowedByMoneyUsage = !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) + || !ObjectiveNeedsMoney(i); + // This objective can only work if the player can ask money for rides. + const bool objectiveAllowedByPaymentSettings = (i != OBJECTIVE_MONTHLY_RIDE_INCOME) || ParkRidePricesUnlocked(); + if (objectiveAllowedByMoneyUsage && objectiveAllowedByPaymentSettings) { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numItems].Args = ObjectiveDropdownOptionNames[i]; + numItems++; } - else - { - gameState.ScenarioObjective.Currency += ObjectiveCurrencyLoanAndValueAdjustment; - Invalidate(); - } - break; - case OBJECTIVE_MONTHLY_FOOD_INCOME: - if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyFoodMax) - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.Currency += ObjectiveCurrencyFoodAdjustment; - Invalidate(); - } - break; - case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: - if (gameState.ScenarioObjective.MinimumLength >= ObjectiveLengthMax) - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.MinimumLength += ObjectiveLengthAdjustment; - Invalidate(); - } - break; - case OBJECTIVE_FINISH_5_ROLLERCOASTERS: - if (gameState.ScenarioObjective.MinimumExcitement >= ObjectiveExcitementMax) - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.MinimumExcitement += ObjectiveExcitementAdjustment; - Invalidate(); - } - break; - default: - if (gameState.ScenarioObjective.NumGuests >= ObjectiveGuestsMax) - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.NumGuests += ObjectiveGuestsAdjustment; - Invalidate(); - } - break; - } - } + } - void Arg1Decrease() - { - auto& gameState = GetGameState(); - switch (gameState.ScenarioObjective.Type) - { - case OBJECTIVE_PARK_VALUE_BY: - case OBJECTIVE_MONTHLY_RIDE_INCOME: - case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: - if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyLoanAndValueMin) - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.Currency -= ObjectiveCurrencyLoanAndValueAdjustment; - Invalidate(); - } - break; - case OBJECTIVE_MONTHLY_FOOD_INCOME: - if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyFoodMin) - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.Currency -= ObjectiveCurrencyFoodAdjustment; - Invalidate(); - } - break; - case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: - if (gameState.ScenarioObjective.MinimumLength <= ObjectiveLengthMin) - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.MinimumLength -= ObjectiveLengthAdjustment; - Invalidate(); - } - break; - case OBJECTIVE_FINISH_5_ROLLERCOASTERS: - if (gameState.ScenarioObjective.MinimumExcitement <= ObjectiveExcitementMin) - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.MinimumExcitement -= ObjectiveExcitementAdjustment; - Invalidate(); - } - break; - default: - if (gameState.ScenarioObjective.NumGuests <= ObjectiveGuestsMin) - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - else - { - gameState.ScenarioObjective.NumGuests -= ObjectiveGuestsAdjustment; - Invalidate(); - } - break; - } - } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, numItems, dropdownWidget->width() - 3); - void Arg2Increase() - { - auto& gameState = GetGameState(); - if (gameState.ScenarioObjective.Year >= ObjectiveYearMax) - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + objectiveType = gameState.ScenarioObjective.Type; + for (int32_t j = 0; j < numItems; j++) + { + if (gDropdownItems[j].Args - STR_OBJECTIVE_DROPDOWN_NONE == objectiveType) + { + Dropdown::SetChecked(j, true); + break; + } + } } - else - { - gameState.ScenarioObjective.Year += ObjectiveYearAdjustment; - Invalidate(); - } - } - void Arg2Decrease() - { - auto& gameState = GetGameState(); - if (gameState.ScenarioObjective.Year <= ObjectiveYearMin) + void ShowCategoryDropdown() { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + int32_t i; + Widget* dropdownWidget; + + dropdownWidget = &widgets[WIDX_CATEGORY]; + + for (i = SCENARIO_CATEGORY_BEGINNER; i <= SCENARIO_CATEGORY_OTHER; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = ScenarioCategoryStringIds[i]; + } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, 5, dropdownWidget->width() - 3); + Dropdown::SetChecked(GetGameState().ScenarioCategory, true); } - else + + void Arg1Increase() { - gameState.ScenarioObjective.Year -= ObjectiveYearAdjustment; - Invalidate(); + auto& gameState = GetGameState(); + switch (gameState.ScenarioObjective.Type) + { + case OBJECTIVE_PARK_VALUE_BY: + case OBJECTIVE_MONTHLY_RIDE_INCOME: + case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: + if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyLoanAndValueMax) + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.Currency += ObjectiveCurrencyLoanAndValueAdjustment; + Invalidate(); + } + break; + case OBJECTIVE_MONTHLY_FOOD_INCOME: + if (gameState.ScenarioObjective.Currency >= ObjectiveCurrencyFoodMax) + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.Currency += ObjectiveCurrencyFoodAdjustment; + Invalidate(); + } + break; + case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: + if (gameState.ScenarioObjective.MinimumLength >= ObjectiveLengthMax) + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.MinimumLength += ObjectiveLengthAdjustment; + Invalidate(); + } + break; + case OBJECTIVE_FINISH_5_ROLLERCOASTERS: + if (gameState.ScenarioObjective.MinimumExcitement >= ObjectiveExcitementMax) + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.MinimumExcitement += ObjectiveExcitementAdjustment; + Invalidate(); + } + break; + default: + if (gameState.ScenarioObjective.NumGuests >= ObjectiveGuestsMax) + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.NumGuests += ObjectiveGuestsAdjustment; + Invalidate(); + } + break; + } + } + + void Arg1Decrease() + { + auto& gameState = GetGameState(); + switch (gameState.ScenarioObjective.Type) + { + case OBJECTIVE_PARK_VALUE_BY: + case OBJECTIVE_MONTHLY_RIDE_INCOME: + case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: + if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyLoanAndValueMin) + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.Currency -= ObjectiveCurrencyLoanAndValueAdjustment; + Invalidate(); + } + break; + case OBJECTIVE_MONTHLY_FOOD_INCOME: + if (gameState.ScenarioObjective.Currency <= ObjectiveCurrencyFoodMin) + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.Currency -= ObjectiveCurrencyFoodAdjustment; + Invalidate(); + } + break; + case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: + if (gameState.ScenarioObjective.MinimumLength <= ObjectiveLengthMin) + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.MinimumLength -= ObjectiveLengthAdjustment; + Invalidate(); + } + break; + case OBJECTIVE_FINISH_5_ROLLERCOASTERS: + if (gameState.ScenarioObjective.MinimumExcitement <= ObjectiveExcitementMin) + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.MinimumExcitement -= ObjectiveExcitementAdjustment; + Invalidate(); + } + break; + default: + if (gameState.ScenarioObjective.NumGuests <= ObjectiveGuestsMin) + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.NumGuests -= ObjectiveGuestsAdjustment; + Invalidate(); + } + break; + } + } + + void Arg2Increase() + { + auto& gameState = GetGameState(); + if (gameState.ScenarioObjective.Year >= ObjectiveYearMax) + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.Year += ObjectiveYearAdjustment; + Invalidate(); + } + } + + void Arg2Decrease() + { + auto& gameState = GetGameState(); + if (gameState.ScenarioObjective.Year <= ObjectiveYearMin) + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + else + { + gameState.ScenarioObjective.Year -= ObjectiveYearAdjustment; + Invalidate(); + } } - } #pragma region Main - /** - * - * rct2: 0x006719CA - */ - void OnMouseUpMain(WidgetIndex widgetIndex) - { - const auto& gameState = GetGameState(); - switch (widgetIndex) + /** + * + * rct2: 0x006719CA + */ + void OnMouseUpMain(WidgetIndex widgetIndex) { - case WIDX_PARK_NAME: + const auto& gameState = GetGameState(); + switch (widgetIndex) { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - WindowTextInputRawOpen( - this, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), ParkNameMaxLength); - break; - } - case WIDX_SCENARIO_NAME: - WindowTextInputRawOpen( - this, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, {}, gameState.ScenarioName.c_str(), - ScenarioNameMaxLength); - break; - case WIDX_DETAILS: - WindowTextInputRawOpen( - this, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, {}, - gameState.ScenarioDetails.c_str(), ScenarioDetailsNameMaxLength); - break; - } - } - - /** - * - * rct2: 0x00672254 - */ - void OnResizeMain() - { - WindowSetResize(*this, 450, 229, 450, 229); - } - - /** - * - * rct2: 0x00671A0D - */ - void OnMouseDownMain(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_OBJECTIVE_DROPDOWN: - ShowObjectiveDropdown(); - break; - case WIDX_OBJECTIVE_ARG_1_INCREASE: - Arg1Increase(); - break; - case WIDX_OBJECTIVE_ARG_1_DECREASE: - Arg1Decrease(); - break; - case WIDX_OBJECTIVE_ARG_2_INCREASE: - Arg2Increase(); - break; - case WIDX_OBJECTIVE_ARG_2_DECREASE: - Arg2Decrease(); - break; - case WIDX_CATEGORY_DROPDOWN: - ShowCategoryDropdown(); - break; - } - } - - /** - * - * rct2: 0x00671A54 - */ - void OnDropdownMain(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - auto& gameState = GetGameState(); - uint8_t newObjectiveType; - - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_OBJECTIVE_DROPDOWN: - // TODO: Don't rely on string ID order - newObjectiveType = static_cast(gDropdownItems[dropdownIndex].Args - STR_OBJECTIVE_DROPDOWN_NONE); - if (gameState.ScenarioObjective.Type != newObjectiveType) - SetObjective(newObjectiveType); - break; - case WIDX_CATEGORY_DROPDOWN: - if (gameState.ScenarioCategory != static_cast(dropdownIndex)) - { - gameState.ScenarioCategory = static_cast(dropdownIndex); - Invalidate(); - } - break; - } - } - - /** - * - * rct2: 0x006721E7 - */ - void OnUpdateMain() - { - uint8_t objectiveType; - - frame_no++; - OnPrepareDraw(); - InvalidateWidget(WIDX_TAB_1); - - objectiveType = GetGameState().ScenarioObjective.Type; - - // Check if objective is allowed by money and pay-per-ride settings. - const bool objectiveAllowedByMoneyUsage = !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) - || !ObjectiveNeedsMoney(objectiveType); - // This objective can only work if the player can ask money for rides. - const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME) - || ParkRidePricesUnlocked(); - if (!objectiveAllowedByMoneyUsage || !objectiveAllowedByPaymentSettings) - { - // Reset objective - SetObjective(OBJECTIVE_GUESTS_AND_RATING); - } - } - - /** - * - * rct2: 0x00671A73 - */ - void OnTextInputMain(WidgetIndex widgetIndex, std::string_view text) - { - if (text.empty()) - return; - - auto& gameState = GetGameState(); - switch (widgetIndex) - { - case WIDX_PARK_NAME: - { - auto action = ParkSetNameAction(std::string(text)); - GameActions::Execute(&action); - - if (gameState.ScenarioName.empty()) + case WIDX_PARK_NAME: { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - gameState.ScenarioName = park.Name; + WindowTextInputRawOpen( + this, WIDX_PARK_NAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), ParkNameMaxLength); + break; } - break; + case WIDX_SCENARIO_NAME: + WindowTextInputRawOpen( + this, WIDX_SCENARIO_NAME, STR_SCENARIO_NAME, STR_ENTER_SCENARIO_NAME, {}, + gameState.ScenarioName.c_str(), ScenarioNameMaxLength); + break; + case WIDX_DETAILS: + WindowTextInputRawOpen( + this, WIDX_DETAILS, STR_PARK_SCENARIO_DETAILS, STR_ENTER_SCENARIO_DESCRIPTION, {}, + gameState.ScenarioDetails.c_str(), ScenarioDetailsNameMaxLength); + break; } - case WIDX_SCENARIO_NAME: - gameState.ScenarioName = text; - Invalidate(); - break; - case WIDX_DETAILS: - gameState.ScenarioDetails = text; - Invalidate(); - break; - } - } - - /** - * - * rct2: 0x0067161C - */ - void OnPrepareDrawMain() - { - auto& gameState = GetGameState(); - auto widgetsToSet = window_editor_objective_options_widgets[page]; - if (widgets != widgetsToSet) - { - widgets = widgetsToSet; - InitScrollWidgets(); } - SetPressedTab(); - - switch (gameState.ScenarioObjective.Type) + /** + * + * rct2: 0x00672254 + */ + void OnResizeMain() { - case OBJECTIVE_GUESTS_BY: - case OBJECTIVE_PARK_VALUE_BY: - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1].type = WindowWidgetType::Spinner; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WindowWidgetType::Button; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_DECREASE].type = WindowWidgetType::Button; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2].type = WindowWidgetType::Spinner; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WindowWidgetType::Button; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WindowWidgetType::Button; - break; - case OBJECTIVE_GUESTS_AND_RATING: - case OBJECTIVE_MONTHLY_RIDE_INCOME: - case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: - case OBJECTIVE_FINISH_5_ROLLERCOASTERS: - case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: - case OBJECTIVE_MONTHLY_FOOD_INCOME: - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1].type = WindowWidgetType::Spinner; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WindowWidgetType::Button; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_DECREASE].type = WindowWidgetType::Button; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WindowWidgetType::Empty; - break; - default: - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_DECREASE].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WindowWidgetType::Empty; - window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WindowWidgetType::Empty; - break; + WindowSetResize(*this, 450, 229, 450, 229); } - window_editor_objective_options_main_widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - ? WindowWidgetType::Empty - : WindowWidgetType::CloseBox; - - AnchorBorderWidgets(); - } - - /** - * - * rct2: 0x0067161C - */ - void OnDrawMain(DrawPixelInfo& dpi) - { - const auto& gameState = GetGameState(); - int32_t widthToSet; - StringId stringId; - - DrawWidgets(dpi); - DrawTabImages(dpi); - - // Objective label - auto screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_OBJECTIVE].top }; - DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_WINDOW); - - // Objective value - screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE].left + 1, widgets[WIDX_OBJECTIVE].top }; - auto ft = Formatter(); - ft.Add(ObjectiveDropdownOptionNames[gameState.ScenarioObjective.Type]); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); - - if (widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty) + /** + * + * rct2: 0x00671A0D + */ + void OnMouseDownMain(WidgetIndex widgetIndex) { - // Objective argument 1 label - screenCoords = windowPos + ScreenCoordsXY{ 28, widgets[WIDX_OBJECTIVE_ARG_1].top }; + switch (widgetIndex) + { + case WIDX_OBJECTIVE_DROPDOWN: + ShowObjectiveDropdown(); + break; + case WIDX_OBJECTIVE_ARG_1_INCREASE: + Arg1Increase(); + break; + case WIDX_OBJECTIVE_ARG_1_DECREASE: + Arg1Decrease(); + break; + case WIDX_OBJECTIVE_ARG_2_INCREASE: + Arg2Increase(); + break; + case WIDX_OBJECTIVE_ARG_2_DECREASE: + Arg2Decrease(); + break; + case WIDX_CATEGORY_DROPDOWN: + ShowCategoryDropdown(); + break; + } + } + + /** + * + * rct2: 0x00671A54 + */ + void OnDropdownMain(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + auto& gameState = GetGameState(); + uint8_t newObjectiveType; + + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_OBJECTIVE_DROPDOWN: + // TODO: Don't rely on string ID order + newObjectiveType = static_cast(gDropdownItems[dropdownIndex].Args - STR_OBJECTIVE_DROPDOWN_NONE); + if (gameState.ScenarioObjective.Type != newObjectiveType) + SetObjective(newObjectiveType); + break; + case WIDX_CATEGORY_DROPDOWN: + if (gameState.ScenarioCategory != static_cast(dropdownIndex)) + { + gameState.ScenarioCategory = static_cast(dropdownIndex); + Invalidate(); + } + break; + } + } + + /** + * + * rct2: 0x006721E7 + */ + void OnUpdateMain() + { + uint8_t objectiveType; + + frame_no++; + OnPrepareDraw(); + InvalidateWidget(WIDX_TAB_1); + + objectiveType = GetGameState().ScenarioObjective.Type; + + // Check if objective is allowed by money and pay-per-ride settings. + const bool objectiveAllowedByMoneyUsage = !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) + || !ObjectiveNeedsMoney(objectiveType); + // This objective can only work if the player can ask money for rides. + const bool objectiveAllowedByPaymentSettings = (objectiveType != OBJECTIVE_MONTHLY_RIDE_INCOME) + || ParkRidePricesUnlocked(); + if (!objectiveAllowedByMoneyUsage || !objectiveAllowedByPaymentSettings) + { + // Reset objective + SetObjective(OBJECTIVE_GUESTS_AND_RATING); + } + } + + /** + * + * rct2: 0x00671A73 + */ + void OnTextInputMain(WidgetIndex widgetIndex, std::string_view text) + { + if (text.empty()) + return; + + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_PARK_NAME: + { + auto action = ParkSetNameAction(std::string(text)); + GameActions::Execute(&action); + + if (gameState.ScenarioName.empty()) + { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + gameState.ScenarioName = park.Name; + } + break; + } + case WIDX_SCENARIO_NAME: + gameState.ScenarioName = text; + Invalidate(); + break; + case WIDX_DETAILS: + gameState.ScenarioDetails = text; + Invalidate(); + break; + } + } + + /** + * + * rct2: 0x0067161C + */ + void OnPrepareDrawMain() + { + auto& gameState = GetGameState(); + auto widgetsToSet = window_editor_objective_options_widgets[page]; + if (widgets != widgetsToSet) + { + widgets = widgetsToSet; + InitScrollWidgets(); + } + + SetPressedTab(); + switch (gameState.ScenarioObjective.Type) { case OBJECTIVE_GUESTS_BY: - case OBJECTIVE_GUESTS_AND_RATING: - stringId = STR_WINDOW_OBJECTIVE_GUEST_COUNT; - break; case OBJECTIVE_PARK_VALUE_BY: - case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: - stringId = STR_WINDOW_OBJECTIVE_PARK_VALUE; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1].type = WindowWidgetType::Spinner; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WindowWidgetType::Button; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_DECREASE].type = WindowWidgetType::Button; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2].type = WindowWidgetType::Spinner; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WindowWidgetType::Button; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WindowWidgetType::Button; break; - case OBJECTIVE_MONTHLY_RIDE_INCOME: - stringId = STR_WINDOW_OBJECTIVE_MONTHLY_INCOME; - break; - case OBJECTIVE_MONTHLY_FOOD_INCOME: - stringId = STR_WINDOW_OBJECTIVE_MONTHLY_PROFIT; - break; - case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: - stringId = STR_WINDOW_OBJECTIVE_MINIMUM_LENGTH; - break; - default: - stringId = STR_WINDOW_OBJECTIVE_EXCITEMENT_RATING; - break; - } - DrawTextBasic(dpi, screenCoords, stringId); - - // Objective argument 1 value - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_1].left + 1, widgets[WIDX_OBJECTIVE_ARG_1].top }; - ft = Formatter(); - switch (gameState.ScenarioObjective.Type) - { - case OBJECTIVE_GUESTS_BY: case OBJECTIVE_GUESTS_AND_RATING: - stringId = STR_WINDOW_COLOUR_2_COMMA16; - ft.Add(gameState.ScenarioObjective.NumGuests); - break; - case OBJECTIVE_PARK_VALUE_BY: - case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: case OBJECTIVE_MONTHLY_RIDE_INCOME: - case OBJECTIVE_MONTHLY_FOOD_INCOME: - stringId = STR_CURRENCY_FORMAT_LABEL; - ft.Add(gameState.ScenarioObjective.Currency); - break; case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: - stringId = STR_WINDOW_COLOUR_2_LENGTH; - ft.Add(gameState.ScenarioObjective.MinimumLength); - break; case OBJECTIVE_FINISH_5_ROLLERCOASTERS: - stringId = STR_WINDOW_COLOUR_2_COMMA2DP32; - ft.Add(gameState.ScenarioObjective.MinimumExcitement); + case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: + case OBJECTIVE_MONTHLY_FOOD_INCOME: + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1].type = WindowWidgetType::Spinner; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WindowWidgetType::Button; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_DECREASE].type = WindowWidgetType::Button; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WindowWidgetType::Empty; break; default: - stringId = STR_WINDOW_COLOUR_2_COMMA2DP32; - ft.Add(gameState.ScenarioObjective.Currency); + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_INCREASE].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_1_DECREASE].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_INCREASE].type = WindowWidgetType::Empty; + window_editor_objective_options_main_widgets[WIDX_OBJECTIVE_ARG_2_DECREASE].type = WindowWidgetType::Empty; break; } - DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK); + + window_editor_objective_options_main_widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + ? WindowWidgetType::Empty + : WindowWidgetType::CloseBox; + + AnchorBorderWidgets(); } - if (widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty) + /** + * + * rct2: 0x0067161C + */ + void OnDrawMain(DrawPixelInfo& dpi) { - // Objective argument 2 label - screenCoords = windowPos + ScreenCoordsXY{ 28, widgets[WIDX_OBJECTIVE_ARG_2].top }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_DATE); + const auto& gameState = GetGameState(); + int32_t widthToSet; + StringId stringId; - // Objective argument 2 value - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_2].left + 1, widgets[WIDX_OBJECTIVE_ARG_2].top }; - ft = Formatter(); - ft.Add((gameState.ScenarioObjective.Year * MONTH_COUNT) - 1); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft); - } + DrawWidgets(dpi); + DrawTabImages(dpi); - // Park name - screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_PARK_NAME].top }; - widthToSet = widgets[WIDX_PARK_NAME].left - 16; + // Objective label + auto screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_OBJECTIVE].top }; + DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_WINDOW); - { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - auto parkName = park.Name.c_str(); + // Objective value + screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE].left + 1, widgets[WIDX_OBJECTIVE].top }; + auto ft = Formatter(); + ft.Add(ObjectiveDropdownOptionNames[gameState.ScenarioObjective.Type]); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + + if (widgets[WIDX_OBJECTIVE_ARG_1].type != WindowWidgetType::Empty) + { + // Objective argument 1 label + screenCoords = windowPos + ScreenCoordsXY{ 28, widgets[WIDX_OBJECTIVE_ARG_1].top }; + switch (gameState.ScenarioObjective.Type) + { + case OBJECTIVE_GUESTS_BY: + case OBJECTIVE_GUESTS_AND_RATING: + stringId = STR_WINDOW_OBJECTIVE_GUEST_COUNT; + break; + case OBJECTIVE_PARK_VALUE_BY: + case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: + stringId = STR_WINDOW_OBJECTIVE_PARK_VALUE; + break; + case OBJECTIVE_MONTHLY_RIDE_INCOME: + stringId = STR_WINDOW_OBJECTIVE_MONTHLY_INCOME; + break; + case OBJECTIVE_MONTHLY_FOOD_INCOME: + stringId = STR_WINDOW_OBJECTIVE_MONTHLY_PROFIT; + break; + case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: + stringId = STR_WINDOW_OBJECTIVE_MINIMUM_LENGTH; + break; + default: + stringId = STR_WINDOW_OBJECTIVE_EXCITEMENT_RATING; + break; + } + DrawTextBasic(dpi, screenCoords, stringId); + + // Objective argument 1 value + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_1].left + 1, widgets[WIDX_OBJECTIVE_ARG_1].top }; + ft = Formatter(); + switch (gameState.ScenarioObjective.Type) + { + case OBJECTIVE_GUESTS_BY: + case OBJECTIVE_GUESTS_AND_RATING: + stringId = STR_WINDOW_COLOUR_2_COMMA16; + ft.Add(gameState.ScenarioObjective.NumGuests); + break; + case OBJECTIVE_PARK_VALUE_BY: + case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: + case OBJECTIVE_MONTHLY_RIDE_INCOME: + case OBJECTIVE_MONTHLY_FOOD_INCOME: + stringId = STR_CURRENCY_FORMAT_LABEL; + ft.Add(gameState.ScenarioObjective.Currency); + break; + case OBJECTIVE_10_ROLLERCOASTERS_LENGTH: + stringId = STR_WINDOW_COLOUR_2_LENGTH; + ft.Add(gameState.ScenarioObjective.MinimumLength); + break; + case OBJECTIVE_FINISH_5_ROLLERCOASTERS: + stringId = STR_WINDOW_COLOUR_2_COMMA2DP32; + ft.Add(gameState.ScenarioObjective.MinimumExcitement); + break; + default: + stringId = STR_WINDOW_COLOUR_2_COMMA2DP32; + ft.Add(gameState.ScenarioObjective.Currency); + break; + } + DrawTextBasic(dpi, screenCoords, stringId, ft, COLOUR_BLACK); + } + + if (widgets[WIDX_OBJECTIVE_ARG_2].type != WindowWidgetType::Empty) + { + // Objective argument 2 label + screenCoords = windowPos + ScreenCoordsXY{ 28, widgets[WIDX_OBJECTIVE_ARG_2].top }; + DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_DATE); + + // Objective argument 2 value + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_OBJECTIVE_ARG_2].left + 1, widgets[WIDX_OBJECTIVE_ARG_2].top }; + ft = Formatter(); + ft.Add((gameState.ScenarioObjective.Year * MONTH_COUNT) - 1); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_OBJECTIVE_VALUE_DATE, ft); + } + + // Park name + screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_PARK_NAME].top }; + widthToSet = widgets[WIDX_PARK_NAME].left - 16; + + { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + auto parkName = park.Name.c_str(); + + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(parkName); + DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_PARK_NAME, ft); + } + + // Scenario name + screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_SCENARIO_NAME].top }; + widthToSet = widgets[WIDX_SCENARIO_NAME].left - 16; ft = Formatter(); ft.Add(STR_STRING); - ft.Add(parkName); - DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_PARK_NAME, ft); + ft.Add(gameState.ScenarioName.c_str()); + DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_SCENARIO_NAME, ft); + + // Scenario details label + screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_DETAILS].top }; + DrawTextBasic(dpi, screenCoords, STR_WINDOW_PARK_DETAILS); + + // Scenario details value + screenCoords = windowPos + ScreenCoordsXY{ 16, widgets[WIDX_DETAILS].top + 10 }; + widthToSet = widgets[WIDX_DETAILS].left - 4; + + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(gameState.ScenarioDetails.c_str()); + DrawTextWrapped(dpi, screenCoords, widthToSet, STR_BLACK_STRING, ft); + + // Scenario category label + screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_CATEGORY].top }; + DrawTextBasic(dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP); + + // Scenario category value + screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_CATEGORY].left + 1, widgets[WIDX_CATEGORY].top }; + ft = Formatter(); + ft.Add(ScenarioCategoryStringIds[gameState.ScenarioCategory]); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } - // Scenario name - screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_SCENARIO_NAME].top }; - widthToSet = widgets[WIDX_SCENARIO_NAME].left - 16; - - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(gameState.ScenarioName.c_str()); - DrawTextEllipsised(dpi, screenCoords, widthToSet, STR_WINDOW_SCENARIO_NAME, ft); - - // Scenario details label - screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_DETAILS].top }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_PARK_DETAILS); - - // Scenario details value - screenCoords = windowPos + ScreenCoordsXY{ 16, widgets[WIDX_DETAILS].top + 10 }; - widthToSet = widgets[WIDX_DETAILS].left - 4; - - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(gameState.ScenarioDetails.c_str()); - DrawTextWrapped(dpi, screenCoords, widthToSet, STR_BLACK_STRING, ft); - - // Scenario category label - screenCoords = windowPos + ScreenCoordsXY{ 8, widgets[WIDX_CATEGORY].top }; - DrawTextBasic(dpi, screenCoords, STR_WINDOW_SCENARIO_GROUP); - - // Scenario category value - screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_CATEGORY].left + 1, widgets[WIDX_CATEGORY].top }; - ft = Formatter(); - ft.Add(ScenarioCategoryStringIds[gameState.ScenarioCategory]); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); - } - #pragma endregion #pragma region Rides - /** - * - * rct2: 0x006725A8 - */ - void OnResizeRides() - { - WindowSetResize(*this, 380, 224, 380, 224); - } - - /** - * - * rct2: 0x00672544 - */ - void OnUpdateRides() - { - frame_no++; - OnPrepareDraw(); - OnResize(); - InvalidateWidget(WIDX_TAB_2); - - const auto oldSize = _rideableRides.size(); - _rideableRides.clear(); - for (auto& currentRide : GetRideManager()) + /** + * + * rct2: 0x006725A8 + */ + void OnResizeRides() { - if (currentRide.IsRide()) + WindowSetResize(*this, 380, 224, 380, 224); + } + + /** + * + * rct2: 0x00672544 + */ + void OnUpdateRides() + { + frame_no++; + OnPrepareDraw(); + OnResize(); + InvalidateWidget(WIDX_TAB_2); + + const auto oldSize = _rideableRides.size(); + _rideableRides.clear(); + for (auto& currentRide : GetRideManager()) { - _rideableRides.push_back(currentRide.id); + if (currentRide.IsRide()) + { + _rideableRides.push_back(currentRide.id); + } + } + + if (oldSize != _rideableRides.size()) + { + Invalidate(); } } - if (oldSize != _rideableRides.size()) + /** + * + * rct2: 0x006724BF + */ + ScreenSize OnScrollGetSizeRides(int32_t scrollIndex) { - Invalidate(); - } - } + ScreenSize newSize; + newSize.height = static_cast(_rideableRides.size()) * 10; - /** - * - * rct2: 0x006724BF - */ - ScreenSize OnScrollGetSizeRides(int32_t scrollIndex) - { - ScreenSize newSize; - newSize.height = static_cast(_rideableRides.size()) * 10; - - return newSize; - } - - /** - * - * rct2: 0x006724FC - */ - void OnScrollMouseDownRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) - { - auto i = screenCoords.y / 12; - if (i < 0 || i >= static_cast(_rideableRides.size())) - return; - - auto* currentRide = GetRide(_rideableRides[i]); - if (currentRide != nullptr) - { - currentRide->lifecycle_flags ^= RIDE_LIFECYCLE_INDESTRUCTIBLE; - } - Invalidate(); - } - - /** - * - * rct2: 0x006724CC - */ - void OnScrollMouseOverRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) - { - int32_t i; - - i = screenCoords.y / 12; - if (i < 0 || i >= static_cast(_rideableRides.size())) - return; - - if (selected_list_item != i) - { - selected_list_item = i; - Invalidate(); - } - } - - /** - * - * rct2: 0x006722B5 - */ - void OnPrepareDrawRides() - { - Widget* widgetsToSet = window_editor_objective_options_widgets[page]; - if (widgets != widgetsToSet) - { - widgets = widgetsToSet; - InitScrollWidgets(); + return newSize; } - SetPressedTab(); - - window_editor_objective_options_main_widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - ? WindowWidgetType::Empty - : WindowWidgetType::CloseBox; - - AnchorBorderWidgets(); - } - - /** - * - * rct2: 0x00672340 - */ - void OnDrawRides(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER); - } - - /** - * - * rct2: 0x0067236F - */ - void OnScrollDrawRides(DrawPixelInfo& dpi, int32_t scrollIndex) - { - int32_t colour = ColourMapA[colours[1]].mid_light; - GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour); - - for (int32_t i = 0; i < static_cast(_rideableRides.size()); i++) + /** + * + * rct2: 0x006724FC + */ + void OnScrollMouseDownRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) { - int32_t y = i * 12; + auto i = screenCoords.y / 12; + if (i < 0 || i >= static_cast(_rideableRides.size())) + return; - if (y + 12 < dpi.y || y >= dpi.y + dpi.height) - continue; - - // Checkbox - GfxFillRectInset(dpi, { { 2, y }, { 11, y + 10 } }, colours[1], INSET_RECT_F_E0); - - // Highlighted - auto stringId = STR_BLACK_STRING; - if (i == selected_list_item) - { - stringId = STR_WINDOW_COLOUR_2_STRINGID; - GfxFilterRect(dpi, { 0, y, width, y + 11 }, FilterPaletteID::PaletteDarken1); - } - - // Checkbox mark auto* currentRide = GetRide(_rideableRides[i]); if (currentRide != nullptr) { - if (currentRide->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) - { - auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark; - GfxDrawString( - dpi, { 2, y }, static_cast(CheckBoxMarkString), - { static_cast(colours[1] & 0x7F), FontStyle::Medium, darkness }); - } + currentRide->lifecycle_flags ^= RIDE_LIFECYCLE_INDESTRUCTIBLE; + } + Invalidate(); + } - // Ride name + /** + * + * rct2: 0x006724CC + */ + void OnScrollMouseOverRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) + { + int32_t i; - Formatter ft; - currentRide->FormatNameTo(ft); - DrawTextBasic(dpi, { 15, y }, stringId, ft); + i = screenCoords.y / 12; + if (i < 0 || i >= static_cast(_rideableRides.size())) + return; + + if (selected_list_item != i) + { + selected_list_item = i; + Invalidate(); + } + } + + /** + * + * rct2: 0x006722B5 + */ + void OnPrepareDrawRides() + { + Widget* widgetsToSet = window_editor_objective_options_widgets[page]; + if (widgets != widgetsToSet) + { + widgets = widgetsToSet; + InitScrollWidgets(); + } + + SetPressedTab(); + + window_editor_objective_options_main_widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + ? WindowWidgetType::Empty + : WindowWidgetType::CloseBox; + + AnchorBorderWidgets(); + } + + /** + * + * rct2: 0x00672340 + */ + void OnDrawRides(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PAGE_BACKGROUND].top + 3 }, STR_WINDOW_PRESERVATION_ORDER); + } + + /** + * + * rct2: 0x0067236F + */ + void OnScrollDrawRides(DrawPixelInfo& dpi, int32_t scrollIndex) + { + int32_t colour = ColourMapA[colours[1]].mid_light; + GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour); + + for (int32_t i = 0; i < static_cast(_rideableRides.size()); i++) + { + int32_t y = i * 12; + + if (y + 12 < dpi.y || y >= dpi.y + dpi.height) + continue; + + // Checkbox + GfxFillRectInset(dpi, { { 2, y }, { 11, y + 10 } }, colours[1], INSET_RECT_F_E0); + + // Highlighted + auto stringId = STR_BLACK_STRING; + if (i == selected_list_item) + { + stringId = STR_WINDOW_COLOUR_2_STRINGID; + GfxFilterRect(dpi, { 0, y, width, y + 11 }, FilterPaletteID::PaletteDarken1); + } + + // Checkbox mark + auto* currentRide = GetRide(_rideableRides[i]); + if (currentRide != nullptr) + { + if (currentRide->lifecycle_flags & RIDE_LIFECYCLE_INDESTRUCTIBLE) + { + auto darkness = stringId == STR_WINDOW_COLOUR_2_STRINGID ? TextDarkness::ExtraDark : TextDarkness::Dark; + GfxDrawString( + dpi, { 2, y }, static_cast(CheckBoxMarkString), + { static_cast(colours[1] & 0x7F), FontStyle::Medium, darkness }); + } + + // Ride name + + Formatter ft; + currentRide->FormatNameTo(ft); + DrawTextBasic(dpi, { 15, y }, stringId, ft); + } } } - } #pragma endregion -}; + }; + + /** + * + * rct2: 0x0067137D + */ + WindowBase* WindowEditorObjectiveOptionsOpen() + { + auto window = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions); + if (window != nullptr) + return window; + + window = WindowCreate( + WindowClass::EditorObjectiveOptions, 450, 225, WF_10 | WF_CENTRE_SCREEN); -/** - * - * rct2: 0x0067137D - */ -WindowBase* WindowEditorObjectiveOptionsOpen() -{ - auto window = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions); - if (window != nullptr) return window; - - window = WindowCreate( - WindowClass::EditorObjectiveOptions, 450, 225, WF_10 | WF_CENTRE_SCREEN); - - return window; -} + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index d923c7079d..dc4101f236 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -30,20 +30,20 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WW_FINANCIAL = 280; + static constexpr int32_t WH_FINANCIAL = 149; -static constexpr int32_t WW_FINANCIAL = 280; -static constexpr int32_t WH_FINANCIAL = 149; + static constexpr int32_t WW_GUESTS = 380; + static constexpr int32_t WH_GUESTS = 149; -static constexpr int32_t WW_GUESTS = 380; -static constexpr int32_t WH_GUESTS = 149; - -static constexpr int32_t WW_PARK = 400; -static constexpr int32_t WH_PARK = 200; + static constexpr int32_t WW_PARK = 400; + static constexpr int32_t WH_PARK = 200; #pragma region Widgets -// clang-format off + // clang-format off enum { WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL, WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS, @@ -208,1080 +208,1082 @@ static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = { (1uLL << WIDX_ENTRY_PRICE_INCREASE) | (1uLL << WIDX_ENTRY_PRICE_DECREASE), }; -// clang-format on + // clang-format on #pragma endregion -class EditorScenarioOptionsWindow final : public Window -{ -public: - void OnOpen() override + class EditorScenarioOptionsWindow final : public Window { - widgets = window_editor_scenario_options_widgets[WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL]; - hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets - [WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL]; - WindowInitScrollWidgets(*this); - page = 0; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (page) + public: + void OnOpen() override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: - return FinancialMouseUp(widgetIndex); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: - return GuestsMouseUp(widgetIndex); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkMouseUp(widgetIndex); + widgets = window_editor_scenario_options_widgets[WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL]; + hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets + [WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL]; + WindowInitScrollWidgets(*this); + page = 0; } - } - void OnResize() override - { - switch (page) + void OnMouseUp(WidgetIndex widgetIndex) override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: - return FinancialResize(); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: - return GuestsResize(); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkResize(); + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: + return FinancialMouseUp(widgetIndex); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: + return GuestsMouseUp(widgetIndex); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkMouseUp(widgetIndex); + } } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) + void OnResize() override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: - return FinancialMouseDown(widgetIndex); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: - return GuestsMouseDown(widgetIndex); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkMouseDown(widgetIndex); + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: + return FinancialResize(); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: + return GuestsResize(); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkResize(); + } } - } - void OnUpdate() override - { - switch (page) + void OnMouseDown(WidgetIndex widgetIndex) override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: - return FinancialUpdate(); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: - return GuestsUpdate(); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkUpdate(); + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: + return FinancialMouseDown(widgetIndex); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: + return GuestsMouseDown(widgetIndex); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkMouseDown(widgetIndex); + } } - } - void OnPrepareDraw() override - { - switch (page) + void OnUpdate() override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: - return FinancialPrepareDraw(); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: - return GuestsPrepareDraw(); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkPrepareDraw(); + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: + return FinancialUpdate(); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: + return GuestsUpdate(); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkUpdate(); + } } - } - void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) + void OnPrepareDraw() override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: - return FinancialDraw(dpi); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: - return GuestsDraw(dpi); - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkDraw(dpi); + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: + return FinancialPrepareDraw(); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: + return GuestsPrepareDraw(); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkPrepareDraw(); + } } - } - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - switch (page) + void OnDraw(DrawPixelInfo& dpi) override { - case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: - return ParkDropdown(widgetIndex, selectedIndex); + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL: + return FinancialDraw(dpi); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS: + return GuestsDraw(dpi); + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkDraw(dpi); + } } - } -private: - void SetPressedTab() - { - int32_t i; - for (i = 0; i < WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT; i++) - SetWidgetPressed(WIDX_TAB_1 + i, false); - SetWidgetPressed(WIDX_TAB_1 + page, true); - } + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + switch (page) + { + case WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_PARK: + return ParkDropdown(widgetIndex, selectedIndex); + } + } - void AnchorBorderWidgets() - { - ResizeFrameWithPage(); - } + private: + void SetPressedTab() + { + int32_t i; + for (i = 0; i < WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_COUNT; i++) + SetWidgetPressed(WIDX_TAB_1 + i, false); + SetWidgetPressed(WIDX_TAB_1 + page, true); + } - void DrawTabImages(DrawPixelInfo& dpi) - { - Widget* widget; - int32_t spriteIndex; + void AnchorBorderWidgets() + { + ResizeFrameWithPage(); + } - // Tab 1 - widget = &widgets[WIDX_TAB_1]; - spriteIndex = SPR_TAB_FINANCES_SUMMARY_0; - if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL) - spriteIndex += (frame_no / 2) % 8; + void DrawTabImages(DrawPixelInfo& dpi) + { + Widget* widget; + int32_t spriteIndex; - GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); + // Tab 1 + widget = &widgets[WIDX_TAB_1]; + spriteIndex = SPR_TAB_FINANCES_SUMMARY_0; + if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_FINANCIAL) + spriteIndex += (frame_no / 2) % 8; - // Tab 2 - widget = &widgets[WIDX_TAB_2]; - spriteIndex = SPR_TAB_GUESTS_0; - if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS) - spriteIndex += (frame_no / 4) % 8; + GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); - GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); + // Tab 2 + widget = &widgets[WIDX_TAB_2]; + spriteIndex = SPR_TAB_GUESTS_0; + if (page == WINDOW_EDITOR_SCENARIO_OPTIONS_PAGE_GUESTS) + spriteIndex += (frame_no / 4) % 8; - // Tab 3 - widget = &widgets[WIDX_TAB_3]; - spriteIndex = SPR_TAB_PARK; - GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); - } + GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); - void SetPage(int32_t newPage) - { - if (page == newPage) - return; + // Tab 3 + widget = &widgets[WIDX_TAB_3]; + spriteIndex = SPR_TAB_PARK; + GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget->left, widget->top }); + } - page = newPage; - frame_no = 0; - hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets[page]; - widgets = window_editor_scenario_options_widgets[page]; - Invalidate(); - OnResize(); - OnPrepareDraw(); - WindowInitScrollWidgets(*this); - Invalidate(); - } + void SetPage(int32_t newPage) + { + if (page == newPage) + return; + + page = newPage; + frame_no = 0; + hold_down_widgets = window_editor_scenario_options_page_hold_down_widgets[page]; + widgets = window_editor_scenario_options_widgets[page]; + Invalidate(); + OnResize(); + OnPrepareDraw(); + WindowInitScrollWidgets(*this); + Invalidate(); + } #pragma region Financial - void FinancialMouseUp(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void FinancialMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - WindowClose(*this); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_NO_MONEY: + auto& gameState = GetGameState(); + switch (widgetIndex) { - auto newMoneySetting = (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) ? 0 : 1; - auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::NoMoney, newMoneySetting); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_FORBID_MARKETING: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ForbidMarketingCampaigns, - gameState.ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_RCT1_INTEREST: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::UseRCT1Interest, gameState.ParkFlags & PARK_FLAGS_RCT1_INTEREST ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; + case WIDX_CLOSE: + WindowClose(*this); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_NO_MONEY: + { + auto newMoneySetting = (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) ? 0 : 1; + auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::NoMoney, newMoneySetting); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_FORBID_MARKETING: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ForbidMarketingCampaigns, + gameState.ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_RCT1_INTEREST: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::UseRCT1Interest, gameState.ParkFlags & PARK_FLAGS_RCT1_INTEREST ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } } } - } - void FinancialResize() - { - WindowSetResize(*this, 280, 149, 280, 149); - } - - void ShowClimateDropdown() - { - int32_t i; - - const auto& dropdownWidget = widgets[WIDX_CLIMATE]; - - for (i = 0; i < static_cast(ClimateType::Count); i++) + void FinancialResize() { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = ClimateNames[i]; - } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget.left, windowPos.y + dropdownWidget.top }, dropdownWidget.height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, static_cast(ClimateType::Count), dropdownWidget.width() - 3); - Dropdown::SetChecked(static_cast(GetGameState().Climate), true); - } - - void FinancialMouseDown(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) - { - case WIDX_INITIAL_CASH_INCREASE: - if (gameState.InitialCash < 1000000.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::InitialCash, gameState.InitialCash + 500.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_CASH, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_INITIAL_CASH_DECREASE: - if (gameState.InitialCash > 0.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::InitialCash, gameState.InitialCash - 500.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_CASH, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_INITIAL_LOAN_INCREASE: - if (gameState.BankLoan < 5000000.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::InitialLoan, gameState.BankLoan + 1000.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_INIT_LOAN, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_INITIAL_LOAN_DECREASE: - if (gameState.BankLoan > 0.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::InitialLoan, gameState.BankLoan - 1000.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_INIT_LOAN, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_MAXIMUM_LOAN_INCREASE: - if (gameState.MaxBankLoan < 5000000.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::MaximumLoanSize, gameState.MaxBankLoan + 1000.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_MAX_LOAN, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_MAXIMUM_LOAN_DECREASE: - if (gameState.MaxBankLoan > 0.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::MaximumLoanSize, gameState.MaxBankLoan - 1000.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_MAX_LOAN, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_INTEREST_RATE_INCREASE: - if (gameState.BankLoanInterestRate < MaxBankLoanInterestRate) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::AnnualInterestRate, gameState.BankLoanInterestRate + 1); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_INTEREST_RATE_DECREASE: - if (gameState.BankLoanInterestRate > 0) - { - auto interest = std::min(MaxBankLoanInterestRate, gameState.BankLoanInterestRate - 1); - auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::AnnualInterestRate, interest); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE, {}); - } - Invalidate(); - break; + WindowSetResize(*this, 280, 149, 280, 149); } - if (gScreenFlags == SCREEN_FLAGS_PLAYING) + void ShowClimateDropdown() { - WindowInvalidateByClass(WindowClass::Finances); - WindowInvalidateByClass(WindowClass::BottomToolbar); - } - } + int32_t i; - void FinancialUpdate() - { - frame_no++; - FinancialPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_1); - } + const auto& dropdownWidget = widgets[WIDX_CLIMATE]; - void FinancialPrepareDraw() - { - Widget* newWidgets = window_editor_scenario_options_widgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - WindowInitScrollWidgets(*this); - } - - SetPressedTab(); - - auto& gameState = GetGameState(); - if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) - { - SetWidgetPressed(WIDX_NO_MONEY, true); - for (int32_t i = WIDX_INITIAL_CASH; i <= WIDX_RCT1_INTEREST; i++) - widgets[i].type = WindowWidgetType::Empty; - } - else - { - SetWidgetPressed(WIDX_NO_MONEY, false); - widgets[WIDX_INITIAL_CASH].type = WindowWidgetType::Spinner; - widgets[WIDX_INITIAL_CASH_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_INITIAL_CASH_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_INITIAL_LOAN].type = WindowWidgetType::Spinner; - widgets[WIDX_INITIAL_LOAN_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_INITIAL_LOAN_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_MAXIMUM_LOAN].type = WindowWidgetType::Spinner; - widgets[WIDX_MAXIMUM_LOAN_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_MAXIMUM_LOAN_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_FORBID_MARKETING].type = WindowWidgetType::Checkbox; - - if (gameState.ParkFlags & PARK_FLAGS_RCT1_INTEREST) + for (i = 0; i < static_cast(ClimateType::Count); i++) { - widgets[WIDX_INTEREST_RATE].type = WindowWidgetType::Empty; - widgets[WIDX_INTEREST_RATE_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_INTEREST_RATE_DECREASE].type = WindowWidgetType::Empty; - widgets[WIDX_RCT1_INTEREST].type = WindowWidgetType::Checkbox; - SetWidgetPressed(WIDX_RCT1_INTEREST, true); + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = ClimateNames[i]; + } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget.left, windowPos.y + dropdownWidget.top }, dropdownWidget.height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, static_cast(ClimateType::Count), dropdownWidget.width() - 3); + Dropdown::SetChecked(static_cast(GetGameState().Climate), true); + } + + void FinancialMouseDown(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_INITIAL_CASH_INCREASE: + if (gameState.InitialCash < 1000000.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::InitialCash, gameState.InitialCash + 500.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_CASH, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_INITIAL_CASH_DECREASE: + if (gameState.InitialCash > 0.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::InitialCash, gameState.InitialCash - 500.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_CASH, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_INITIAL_LOAN_INCREASE: + if (gameState.BankLoan < 5000000.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::InitialLoan, gameState.BankLoan + 1000.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_INIT_LOAN, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_INITIAL_LOAN_DECREASE: + if (gameState.BankLoan > 0.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::InitialLoan, gameState.BankLoan - 1000.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_INIT_LOAN, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_MAXIMUM_LOAN_INCREASE: + if (gameState.MaxBankLoan < 5000000.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::MaximumLoanSize, gameState.MaxBankLoan + 1000.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_MAX_LOAN, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_MAXIMUM_LOAN_DECREASE: + if (gameState.MaxBankLoan > 0.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::MaximumLoanSize, gameState.MaxBankLoan - 1000.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_MAX_LOAN, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_INTEREST_RATE_INCREASE: + if (gameState.BankLoanInterestRate < MaxBankLoanInterestRate) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::AnnualInterestRate, gameState.BankLoanInterestRate + 1); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_INTEREST_RATE, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_INTEREST_RATE_DECREASE: + if (gameState.BankLoanInterestRate > 0) + { + auto interest = std::min(MaxBankLoanInterestRate, gameState.BankLoanInterestRate - 1); + auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::AnnualInterestRate, interest); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_INTEREST_RATE, STR_NONE, {}); + } + Invalidate(); + break; + } + + if (gScreenFlags == SCREEN_FLAGS_PLAYING) + { + WindowInvalidateByClass(WindowClass::Finances); + WindowInvalidateByClass(WindowClass::BottomToolbar); + } + } + + void FinancialUpdate() + { + frame_no++; + FinancialPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_1); + } + + void FinancialPrepareDraw() + { + Widget* newWidgets = window_editor_scenario_options_widgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + WindowInitScrollWidgets(*this); + } + + SetPressedTab(); + + auto& gameState = GetGameState(); + if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) + { + SetWidgetPressed(WIDX_NO_MONEY, true); + for (int32_t i = WIDX_INITIAL_CASH; i <= WIDX_RCT1_INTEREST; i++) + widgets[i].type = WindowWidgetType::Empty; } else { - widgets[WIDX_INTEREST_RATE].type = WindowWidgetType::Spinner; - widgets[WIDX_INTEREST_RATE_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_INTEREST_RATE_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_RCT1_INTEREST].type = WindowWidgetType::Empty; + SetWidgetPressed(WIDX_NO_MONEY, false); + widgets[WIDX_INITIAL_CASH].type = WindowWidgetType::Spinner; + widgets[WIDX_INITIAL_CASH_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_INITIAL_CASH_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_INITIAL_LOAN].type = WindowWidgetType::Spinner; + widgets[WIDX_INITIAL_LOAN_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_INITIAL_LOAN_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_MAXIMUM_LOAN].type = WindowWidgetType::Spinner; + widgets[WIDX_MAXIMUM_LOAN_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_MAXIMUM_LOAN_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_FORBID_MARKETING].type = WindowWidgetType::Checkbox; + + if (gameState.ParkFlags & PARK_FLAGS_RCT1_INTEREST) + { + widgets[WIDX_INTEREST_RATE].type = WindowWidgetType::Empty; + widgets[WIDX_INTEREST_RATE_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_INTEREST_RATE_DECREASE].type = WindowWidgetType::Empty; + widgets[WIDX_RCT1_INTEREST].type = WindowWidgetType::Checkbox; + SetWidgetPressed(WIDX_RCT1_INTEREST, true); + } + else + { + widgets[WIDX_INTEREST_RATE].type = WindowWidgetType::Spinner; + widgets[WIDX_INTEREST_RATE_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_INTEREST_RATE_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_RCT1_INTEREST].type = WindowWidgetType::Empty; + } + } + + SetWidgetPressed(WIDX_FORBID_MARKETING, gameState.ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN); + + widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowWidgetType::Empty + : WindowWidgetType::CloseBox; + + AnchorBorderWidgets(); + } + + void FinancialDraw(DrawPixelInfo& dpi) + { + ScreenCoordsXY screenCoords{}; + + WindowDrawWidgets(*this, dpi); + DrawTabImages(dpi); + + auto& gameState = GetGameState(); + + const auto& initialCashWidget = widgets[WIDX_INITIAL_CASH]; + if (initialCashWidget.type != WindowWidgetType::Empty) + { + screenCoords = windowPos + ScreenCoordsXY{ 8, initialCashWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_INIT_CASH_LABEL); + + screenCoords = windowPos + ScreenCoordsXY{ initialCashWidget.left + 1, initialCashWidget.top }; + auto ft = Formatter(); + ft.Add(GetGameState().InitialCash); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + } + + const auto& initialLoanWidget = widgets[WIDX_INITIAL_LOAN]; + if (initialLoanWidget.type != WindowWidgetType::Empty) + { + screenCoords = windowPos + ScreenCoordsXY{ 8, initialLoanWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_INIT_LOAN_LABEL); + + screenCoords = windowPos + ScreenCoordsXY{ initialLoanWidget.left + 1, initialLoanWidget.top }; + auto ft = Formatter(); + ft.Add(gameState.BankLoan); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + } + + const auto& maximumLoanWidget = widgets[WIDX_MAXIMUM_LOAN]; + if (maximumLoanWidget.type != WindowWidgetType::Empty) + { + screenCoords = windowPos + ScreenCoordsXY{ 8, maximumLoanWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_MAX_LOAN_LABEL); + + screenCoords = windowPos + ScreenCoordsXY{ maximumLoanWidget.left + 1, maximumLoanWidget.top }; + auto ft = Formatter(); + ft.Add(GetGameState().MaxBankLoan); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + } + + const auto& interestRateWidget = widgets[WIDX_INTEREST_RATE]; + if (interestRateWidget.type != WindowWidgetType::Empty) + { + screenCoords = windowPos + ScreenCoordsXY{ 8, interestRateWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_INTEREST_RATE_LABEL); + + screenCoords = windowPos + ScreenCoordsXY{ interestRateWidget.left + 1, interestRateWidget.top }; + + auto ft = Formatter(); + ft.Add( + std::clamp(static_cast(gameState.BankLoanInterestRate), INT16_MIN, INT16_MAX)); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); } } - SetWidgetPressed(WIDX_FORBID_MARKETING, gameState.ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN); - - widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowWidgetType::Empty - : WindowWidgetType::CloseBox; - - AnchorBorderWidgets(); - } - - void FinancialDraw(DrawPixelInfo& dpi) - { - ScreenCoordsXY screenCoords{}; - - WindowDrawWidgets(*this, dpi); - DrawTabImages(dpi); - - auto& gameState = GetGameState(); - - const auto& initialCashWidget = widgets[WIDX_INITIAL_CASH]; - if (initialCashWidget.type != WindowWidgetType::Empty) - { - screenCoords = windowPos + ScreenCoordsXY{ 8, initialCashWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_INIT_CASH_LABEL); - - screenCoords = windowPos + ScreenCoordsXY{ initialCashWidget.left + 1, initialCashWidget.top }; - auto ft = Formatter(); - ft.Add(GetGameState().InitialCash); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); - } - - const auto& initialLoanWidget = widgets[WIDX_INITIAL_LOAN]; - if (initialLoanWidget.type != WindowWidgetType::Empty) - { - screenCoords = windowPos + ScreenCoordsXY{ 8, initialLoanWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_INIT_LOAN_LABEL); - - screenCoords = windowPos + ScreenCoordsXY{ initialLoanWidget.left + 1, initialLoanWidget.top }; - auto ft = Formatter(); - ft.Add(gameState.BankLoan); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); - } - - const auto& maximumLoanWidget = widgets[WIDX_MAXIMUM_LOAN]; - if (maximumLoanWidget.type != WindowWidgetType::Empty) - { - screenCoords = windowPos + ScreenCoordsXY{ 8, maximumLoanWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_MAX_LOAN_LABEL); - - screenCoords = windowPos + ScreenCoordsXY{ maximumLoanWidget.left + 1, maximumLoanWidget.top }; - auto ft = Formatter(); - ft.Add(GetGameState().MaxBankLoan); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); - } - - const auto& interestRateWidget = widgets[WIDX_INTEREST_RATE]; - if (interestRateWidget.type != WindowWidgetType::Empty) - { - screenCoords = windowPos + ScreenCoordsXY{ 8, interestRateWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_INTEREST_RATE_LABEL); - - screenCoords = windowPos + ScreenCoordsXY{ interestRateWidget.left + 1, interestRateWidget.top }; - - auto ft = Formatter(); - ft.Add(std::clamp(static_cast(gameState.BankLoanInterestRate), INT16_MIN, INT16_MAX)); - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); - } - } - #pragma endregion #pragma region Guests - void GuestsMouseUp(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void GuestsMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - WindowClose(*this); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_GUEST_PREFER_LESS_INTENSE_RIDES: + auto& gameState = GetGameState(); + switch (widgetIndex) { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestsPreferLessIntenseRides, - gameState.ParkFlags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_GUEST_PREFER_MORE_INTENSE_RIDES: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestsPreferMoreIntenseRides, - gameState.ParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; + case WIDX_CLOSE: + WindowClose(*this); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_GUEST_PREFER_LESS_INTENSE_RIDES: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestsPreferLessIntenseRides, + gameState.ParkFlags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_GUEST_PREFER_MORE_INTENSE_RIDES: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestsPreferMoreIntenseRides, + gameState.ParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } } } - } - void GuestsResize() - { - WindowSetResize(*this, 380, 149, 380, 149); - } - - void GuestsMouseDown(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - - switch (widgetIndex) + void GuestsResize() { - case WIDX_CASH_PER_GUEST_INCREASE: - if (gameState.GuestInitialCash < 1000.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::AverageCashPerGuest, gameState.GuestInitialCash + 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_CASH_PER_GUEST_DECREASE: - if (gameState.GuestInitialCash > 0.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::AverageCashPerGuest, gameState.GuestInitialCash - 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_GUEST_INITIAL_HAPPINESS_INCREASE: - if (gameState.GuestInitialHappiness < 250) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialHappiness, gameState.GuestInitialHappiness + 4); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_GUEST_INITIAL_HAPPINESS_DECREASE: - if (gameState.GuestInitialHappiness > 40) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialHappiness, gameState.GuestInitialHappiness - 4); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_GUEST_INITIAL_HUNGER_INCREASE: - if (gameState.GuestInitialHunger > 40) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialHunger, gameState.GuestInitialHunger - 4); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_GUEST_INITIAL_HUNGER_DECREASE: - if (gameState.GuestInitialHunger < 250) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialHunger, gameState.GuestInitialHunger + 4); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_GUEST_INITIAL_THIRST_INCREASE: - if (gameState.GuestInitialThirst > 40) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialThirst, gameState.GuestInitialThirst - 4); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_GUEST_INITIAL_THIRST_DECREASE: - if (gameState.GuestInitialThirst < 250) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestInitialThirst, gameState.GuestInitialThirst + 4); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - } - } - - void GuestsUpdate() - { - frame_no++; - GuestsPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_2); - } - - void GuestsPrepareDraw() - { - Widget* newWidgets = window_editor_scenario_options_widgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - WindowInitScrollWidgets(*this); + WindowSetResize(*this, 380, 149, 380, 149); } - SetPressedTab(); + void GuestsMouseDown(WidgetIndex widgetIndex) + { + auto& gameState = GetGameState(); - auto& gameState = GetGameState(); - if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) - { - widgets[WIDX_CASH_PER_GUEST].type = WindowWidgetType::Empty; - widgets[WIDX_CASH_PER_GUEST_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_CASH_PER_GUEST_DECREASE].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_CASH_PER_GUEST].type = WindowWidgetType::Spinner; - widgets[WIDX_CASH_PER_GUEST_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_CASH_PER_GUEST_DECREASE].type = WindowWidgetType::Button; + switch (widgetIndex) + { + case WIDX_CASH_PER_GUEST_INCREASE: + if (gameState.GuestInitialCash < 1000.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::AverageCashPerGuest, gameState.GuestInitialCash + 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_CASH_PER_GUEST_DECREASE: + if (gameState.GuestInitialCash > 0.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::AverageCashPerGuest, gameState.GuestInitialCash - 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_GUEST_INITIAL_HAPPINESS_INCREASE: + if (gameState.GuestInitialHappiness < 250) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestInitialHappiness, gameState.GuestInitialHappiness + 4); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_GUEST_INITIAL_HAPPINESS_DECREASE: + if (gameState.GuestInitialHappiness > 40) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestInitialHappiness, gameState.GuestInitialHappiness - 4); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_GUEST_INITIAL_HUNGER_INCREASE: + if (gameState.GuestInitialHunger > 40) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestInitialHunger, gameState.GuestInitialHunger - 4); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_GUEST_INITIAL_HUNGER_DECREASE: + if (gameState.GuestInitialHunger < 250) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestInitialHunger, gameState.GuestInitialHunger + 4); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_GUEST_INITIAL_THIRST_INCREASE: + if (gameState.GuestInitialThirst > 40) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestInitialThirst, gameState.GuestInitialThirst - 4); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_GUEST_INITIAL_THIRST_DECREASE: + if (gameState.GuestInitialThirst < 250) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestInitialThirst, gameState.GuestInitialThirst + 4); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + } } - SetWidgetPressed(WIDX_GUEST_PREFER_LESS_INTENSE_RIDES, gameState.ParkFlags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES); - SetWidgetPressed(WIDX_GUEST_PREFER_MORE_INTENSE_RIDES, gameState.ParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES); - - widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowWidgetType::Empty - : WindowWidgetType::CloseBox; - - AnchorBorderWidgets(); - } - - void GuestsDraw(DrawPixelInfo& dpi) - { - ScreenCoordsXY screenCoords{}; - - WindowDrawWidgets(*this, dpi); - DrawTabImages(dpi); - auto& gameState = GetGameState(); - - const auto& cashPerGuestWidget = widgets[WIDX_CASH_PER_GUEST]; - if (cashPerGuestWidget.type != WindowWidgetType::Empty) + void GuestsUpdate() { - // Cash per guest label - screenCoords = windowPos + ScreenCoordsXY{ 8, cashPerGuestWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_CASH_PER_GUEST_LABEL); + frame_no++; + GuestsPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_2); + } - // Cash per guest value - screenCoords = windowPos + ScreenCoordsXY{ cashPerGuestWidget.left + 1, cashPerGuestWidget.top }; + void GuestsPrepareDraw() + { + Widget* newWidgets = window_editor_scenario_options_widgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + WindowInitScrollWidgets(*this); + } + + SetPressedTab(); + + auto& gameState = GetGameState(); + if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) + { + widgets[WIDX_CASH_PER_GUEST].type = WindowWidgetType::Empty; + widgets[WIDX_CASH_PER_GUEST_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_CASH_PER_GUEST_DECREASE].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_CASH_PER_GUEST].type = WindowWidgetType::Spinner; + widgets[WIDX_CASH_PER_GUEST_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_CASH_PER_GUEST_DECREASE].type = WindowWidgetType::Button; + } + + SetWidgetPressed(WIDX_GUEST_PREFER_LESS_INTENSE_RIDES, gameState.ParkFlags & PARK_FLAGS_PREF_LESS_INTENSE_RIDES); + SetWidgetPressed(WIDX_GUEST_PREFER_MORE_INTENSE_RIDES, gameState.ParkFlags & PARK_FLAGS_PREF_MORE_INTENSE_RIDES); + + widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowWidgetType::Empty + : WindowWidgetType::CloseBox; + + AnchorBorderWidgets(); + } + + void GuestsDraw(DrawPixelInfo& dpi) + { + ScreenCoordsXY screenCoords{}; + + WindowDrawWidgets(*this, dpi); + DrawTabImages(dpi); + auto& gameState = GetGameState(); + + const auto& cashPerGuestWidget = widgets[WIDX_CASH_PER_GUEST]; + if (cashPerGuestWidget.type != WindowWidgetType::Empty) + { + // Cash per guest label + screenCoords = windowPos + ScreenCoordsXY{ 8, cashPerGuestWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_CASH_PER_GUEST_LABEL); + + // Cash per guest value + screenCoords = windowPos + ScreenCoordsXY{ cashPerGuestWidget.left + 1, cashPerGuestWidget.top }; + auto ft = Formatter(); + ft.Add(gameState.GuestInitialCash); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + } + + // Guest initial happiness label + const auto& initialHappinessWidget = widgets[WIDX_GUEST_INITIAL_HAPPINESS]; + screenCoords = windowPos + ScreenCoordsXY{ 8, initialHappinessWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HAPPINESS); + + // Guest initial happiness value + screenCoords = windowPos + ScreenCoordsXY{ initialHappinessWidget.left + 1, initialHappinessWidget.top }; auto ft = Formatter(); - ft.Add(gameState.GuestInitialCash); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + ft.Add((gameState.GuestInitialHappiness * 100) / 255); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); + + // Guest initial hunger label + const auto& initialHungerWidget = widgets[WIDX_GUEST_INITIAL_HUNGER]; + screenCoords = windowPos + ScreenCoordsXY{ 8, initialHungerWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HUNGER); + + // Guest initial hunger value + screenCoords = windowPos + ScreenCoordsXY{ initialHungerWidget.left + 1, initialHungerWidget.top }; + ft = Formatter(); + ft.Add(((255 - gameState.GuestInitialHunger) * 100) / 255); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); + + // Guest initial thirst label + const auto& initialThirstWidget = widgets[WIDX_GUEST_INITIAL_THIRST]; + screenCoords = windowPos + ScreenCoordsXY{ 8, initialThirstWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_THIRST); + + // Guest initial thirst value + screenCoords = windowPos + ScreenCoordsXY{ initialThirstWidget.left + 1, initialThirstWidget.top }; + ft = Formatter(); + ft.Add(((255 - gameState.GuestInitialThirst) * 100) / 255); + DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); } - // Guest initial happiness label - const auto& initialHappinessWidget = widgets[WIDX_GUEST_INITIAL_HAPPINESS]; - screenCoords = windowPos + ScreenCoordsXY{ 8, initialHappinessWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HAPPINESS); - - // Guest initial happiness value - screenCoords = windowPos + ScreenCoordsXY{ initialHappinessWidget.left + 1, initialHappinessWidget.top }; - auto ft = Formatter(); - ft.Add((gameState.GuestInitialHappiness * 100) / 255); - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); - - // Guest initial hunger label - const auto& initialHungerWidget = widgets[WIDX_GUEST_INITIAL_HUNGER]; - screenCoords = windowPos + ScreenCoordsXY{ 8, initialHungerWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_HUNGER); - - // Guest initial hunger value - screenCoords = windowPos + ScreenCoordsXY{ initialHungerWidget.left + 1, initialHungerWidget.top }; - ft = Formatter(); - ft.Add(((255 - gameState.GuestInitialHunger) * 100) / 255); - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); - - // Guest initial thirst label - const auto& initialThirstWidget = widgets[WIDX_GUEST_INITIAL_THIRST]; - screenCoords = windowPos + ScreenCoordsXY{ 8, initialThirstWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_GUEST_INIT_THIRST); - - // Guest initial thirst value - screenCoords = windowPos + ScreenCoordsXY{ initialThirstWidget.left + 1, initialThirstWidget.top }; - ft = Formatter(); - ft.Add(((255 - gameState.GuestInitialThirst) * 100) / 255); - DrawTextBasic(dpi, screenCoords, STR_PERCENT_FORMAT_LABEL, ft); - } - #pragma endregion #pragma region Park - void ParkMouseUp(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void ParkMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - WindowClose(*this); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_FORBID_TREE_REMOVAL: + auto& gameState = GetGameState(); + switch (widgetIndex) { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ForbidTreeRemoval, gameState.ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_FORBID_LANDSCAPE_CHANGES: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ForbidLandscapeChanges, - gameState.ParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_FORBID_HIGH_CONSTRUCTION: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ForbidHighConstruction, - gameState.ParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_HARD_PARK_RATING: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ParkRatingHigherDifficultyLevel, - gameState.ParkFlags & PARK_FLAGS_DIFFICULT_PARK_RATING ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; - } - case WIDX_HARD_GUEST_GENERATION: - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::GuestGenerationHigherDifficultyLevel, - gameState.ParkFlags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION ? 0 : 1); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; + case WIDX_CLOSE: + WindowClose(*this); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_FORBID_TREE_REMOVAL: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ForbidTreeRemoval, gameState.ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_FORBID_LANDSCAPE_CHANGES: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ForbidLandscapeChanges, + gameState.ParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_FORBID_HIGH_CONSTRUCTION: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ForbidHighConstruction, + gameState.ParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_HARD_PARK_RATING: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ParkRatingHigherDifficultyLevel, + gameState.ParkFlags & PARK_FLAGS_DIFFICULT_PARK_RATING ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_HARD_GUEST_GENERATION: + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::GuestGenerationHigherDifficultyLevel, + gameState.ParkFlags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION ? 0 : 1); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } } } - } - void ParkResize() - { - WindowSetResize(*this, 400, 200, 400, 200); - } - - void ParkMouseDown(WidgetIndex widgetIndex) - { - Widget* dropdownWidget; - Widget* widget = &widgets[widgetIndex]; - - auto& gameState = GetGameState(); - switch (widgetIndex) + void ParkResize() { - case WIDX_LAND_COST_INCREASE: - if (gameState.LandPrice < 200.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::CostToBuyLand, gameState.LandPrice + 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_LAND_COST_DECREASE: - if (gameState.LandPrice > 5.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::CostToBuyLand, gameState.LandPrice - 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE: - if (gameState.ConstructionRightsPrice < 200.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::CostToBuyConstructionRights, gameState.ConstructionRightsPrice + 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE: - if (gameState.ConstructionRightsPrice > 5.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::CostToBuyConstructionRights, gameState.ConstructionRightsPrice - 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_ENTRY_PRICE_INCREASE: - if (gameState.ParkEntranceFee < MAX_ENTRANCE_FEE) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ParkChargeEntryFee, gameState.ParkEntranceFee + 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_ENTRY_PRICE_DECREASE: - if (gameState.ParkEntranceFee > 0.00_GBP) - { - auto scenarioSetSetting = ScenarioSetSettingAction( - ScenarioSetSetting::ParkChargeEntryFee, gameState.ParkEntranceFee - 1.00_GBP); - GameActions::Execute(&scenarioSetSetting); - } - else - { - ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); - } - Invalidate(); - break; - case WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN: - dropdownWidget = widget - 1; + WindowSetResize(*this, 400, 200, 400, 200); + } - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_FREE_PARK_ENTER; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Args = STR_PAY_PARK_ENTER; - gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[2].Args = STR_PAID_ENTRY_PAID_RIDES; + void ParkMouseDown(WidgetIndex widgetIndex) + { + Widget* dropdownWidget; + Widget* widget = &widgets[widgetIndex]; - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() - 1, - colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3); + auto& gameState = GetGameState(); + switch (widgetIndex) + { + case WIDX_LAND_COST_INCREASE: + if (gameState.LandPrice < 200.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::CostToBuyLand, gameState.LandPrice + 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_LAND_COST_DECREASE: + if (gameState.LandPrice > 5.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::CostToBuyLand, gameState.LandPrice - 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE: + if (gameState.ConstructionRightsPrice < 200.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::CostToBuyConstructionRights, gameState.ConstructionRightsPrice + 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE: + if (gameState.ConstructionRightsPrice > 5.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::CostToBuyConstructionRights, gameState.ConstructionRightsPrice - 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_ENTRY_PRICE_INCREASE: + if (gameState.ParkEntranceFee < MAX_ENTRANCE_FEE) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ParkChargeEntryFee, gameState.ParkEntranceFee + 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_INCREASE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_ENTRY_PRICE_DECREASE: + if (gameState.ParkEntranceFee > 0.00_GBP) + { + auto scenarioSetSetting = ScenarioSetSettingAction( + ScenarioSetSetting::ParkChargeEntryFee, gameState.ParkEntranceFee - 1.00_GBP); + GameActions::Execute(&scenarioSetSetting); + } + else + { + ContextShowError(STR_CANT_REDUCE_FURTHER, STR_NONE, {}); + } + Invalidate(); + break; + case WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN: + dropdownWidget = widget - 1; + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_FREE_PARK_ENTER; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Args = STR_PAY_PARK_ENTER; + gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[2].Args = STR_PAID_ENTRY_PAID_RIDES; + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() - 1, + colours[1], 0, Dropdown::Flag::StayOpen, 3, dropdownWidget->width() - 3); + + if (gameState.ParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) + Dropdown::SetChecked(2, true); + else if (gameState.ParkFlags & PARK_FLAGS_PARK_FREE_ENTRY) + Dropdown::SetChecked(0, true); + else + Dropdown::SetChecked(1, true); + + break; + case WIDX_CLIMATE_DROPDOWN: + ShowClimateDropdown(); + break; + } + } + + void ParkDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + { + return; + } + + switch (widgetIndex) + { + case WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN: + { + auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ParkChargeMethod, dropdownIndex); + GameActions::Execute(&scenarioSetSetting); + Invalidate(); + break; + } + case WIDX_CLIMATE_DROPDOWN: + if (static_cast(GetGameState().Climate) != static_cast(dropdownIndex)) + { + auto gameAction = ClimateSetAction(ClimateType{ static_cast(dropdownIndex) }); + GameActions::Execute(&gameAction); + } + break; + } + } + + void ParkUpdate() + { + frame_no++; + ParkPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_3); + } + + void ParkPrepareDraw() + { + Widget* newWidgets = window_editor_scenario_options_widgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + WindowInitScrollWidgets(*this); + } + + SetPressedTab(); + + auto& gameState = GetGameState(); + if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) + { + for (int32_t i = WIDX_LAND_COST; i <= WIDX_ENTRY_PRICE_DECREASE; i++) + widgets[i].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_LAND_COST].type = WindowWidgetType::Spinner; + widgets[WIDX_LAND_COST_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_LAND_COST_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type = WindowWidgetType::Spinner; + widgets[WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN].type = WindowWidgetType::Button; + + if (!ParkEntranceFeeUnlocked()) + { + widgets[WIDX_ENTRY_PRICE].type = WindowWidgetType::Empty; + widgets[WIDX_ENTRY_PRICE_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_ENTRY_PRICE_DECREASE].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_ENTRY_PRICE].type = WindowWidgetType::Spinner; + widgets[WIDX_ENTRY_PRICE_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_ENTRY_PRICE_DECREASE].type = WindowWidgetType::Button; + } + } + + SetWidgetPressed(WIDX_FORBID_TREE_REMOVAL, gameState.ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL); + SetWidgetPressed(WIDX_FORBID_LANDSCAPE_CHANGES, gameState.ParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES); + SetWidgetPressed(WIDX_FORBID_HIGH_CONSTRUCTION, gameState.ParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION); + SetWidgetPressed(WIDX_HARD_PARK_RATING, gameState.ParkFlags & PARK_FLAGS_DIFFICULT_PARK_RATING); + SetWidgetPressed(WIDX_HARD_GUEST_GENERATION, gameState.ParkFlags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION); + + widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowWidgetType::Empty + : WindowWidgetType::CloseBox; + + AnchorBorderWidgets(); + } + + void ParkDraw(DrawPixelInfo& dpi) + { + ScreenCoordsXY screenCoords{}; + + WindowDrawWidgets(*this, dpi); + DrawTabImages(dpi); + + const auto& gameState = GetGameState(); + const auto& landCostWidget = widgets[WIDX_LAND_COST]; + if (landCostWidget.type != WindowWidgetType::Empty) + { + // Cost to buy land label + screenCoords = windowPos + ScreenCoordsXY{ 8, landCostWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_LAND_COST_LABEL); + + // Cost to buy land value + screenCoords = windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top }; + auto ft = Formatter(); + ft.Add(gameState.LandPrice); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + } + + const auto& constructionRightsCostWidget = widgets[WIDX_CONSTRUCTION_RIGHTS_COST]; + if (constructionRightsCostWidget.type != WindowWidgetType::Empty) + { + // Cost to buy construction rights label + screenCoords = windowPos + ScreenCoordsXY{ 8, constructionRightsCostWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_RIGHTS_COST_LABEL); + + // Cost to buy construction rights value + screenCoords = windowPos + + ScreenCoordsXY{ constructionRightsCostWidget.left + 1, constructionRightsCostWidget.top }; + auto ft = Formatter(); + ft.Add(gameState.ConstructionRightsPrice); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); + } + + const auto& payForParkOrRidesWidget = widgets[WIDX_PAY_FOR_PARK_OR_RIDES]; + if (payForParkOrRidesWidget.type != WindowWidgetType::Empty) + { + // Pay for park or rides label + screenCoords = windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.left + 1, payForParkOrRidesWidget.top }; + + auto ft = Formatter(); + // Pay for park and/or rides value if (gameState.ParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) - Dropdown::SetChecked(2, true); + ft.Add(STR_PAID_ENTRY_PAID_RIDES); else if (gameState.ParkFlags & PARK_FLAGS_PARK_FREE_ENTRY) - Dropdown::SetChecked(0, true); + ft.Add(STR_FREE_PARK_ENTER); else - Dropdown::SetChecked(1, true); + ft.Add(STR_PAY_PARK_ENTER); - break; - case WIDX_CLIMATE_DROPDOWN: - ShowClimateDropdown(); - break; - } - } - - void ParkDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (dropdownIndex == -1) - { - return; - } - - switch (widgetIndex) - { - case WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN: - { - auto scenarioSetSetting = ScenarioSetSettingAction(ScenarioSetSetting::ParkChargeMethod, dropdownIndex); - GameActions::Execute(&scenarioSetSetting); - Invalidate(); - break; + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } - case WIDX_CLIMATE_DROPDOWN: - if (static_cast(GetGameState().Climate) != static_cast(dropdownIndex)) - { - auto gameAction = ClimateSetAction(ClimateType{ static_cast(dropdownIndex) }); - GameActions::Execute(&gameAction); - } - break; - } - } - void ParkUpdate() - { - frame_no++; - ParkPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_3); - } - - void ParkPrepareDraw() - { - Widget* newWidgets = window_editor_scenario_options_widgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - WindowInitScrollWidgets(*this); - } - - SetPressedTab(); - - auto& gameState = GetGameState(); - if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) - { - for (int32_t i = WIDX_LAND_COST; i <= WIDX_ENTRY_PRICE_DECREASE; i++) - widgets[i].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_LAND_COST].type = WindowWidgetType::Spinner; - widgets[WIDX_LAND_COST_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_LAND_COST_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_CONSTRUCTION_RIGHTS_COST].type = WindowWidgetType::Spinner; - widgets[WIDX_CONSTRUCTION_RIGHTS_COST_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_CONSTRUCTION_RIGHTS_COST_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_PAY_FOR_PARK_OR_RIDES].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_PAY_FOR_PARK_OR_RIDES_DROPDOWN].type = WindowWidgetType::Button; - - if (!ParkEntranceFeeUnlocked()) + const auto& entryPriceWidget = widgets[WIDX_ENTRY_PRICE]; + if (entryPriceWidget.type != WindowWidgetType::Empty) { - widgets[WIDX_ENTRY_PRICE].type = WindowWidgetType::Empty; - widgets[WIDX_ENTRY_PRICE_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_ENTRY_PRICE_DECREASE].type = WindowWidgetType::Empty; + // Entry price label + screenCoords = windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.right + 8, entryPriceWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_ENTRY_PRICE_LABEL); + + // Entry price value + screenCoords = windowPos + ScreenCoordsXY{ entryPriceWidget.left + 1, entryPriceWidget.top }; + auto ft = Formatter(); + ft.Add(gameState.ParkEntranceFee); + DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); } - else - { - widgets[WIDX_ENTRY_PRICE].type = WindowWidgetType::Spinner; - widgets[WIDX_ENTRY_PRICE_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_ENTRY_PRICE_DECREASE].type = WindowWidgetType::Button; - } - } - SetWidgetPressed(WIDX_FORBID_TREE_REMOVAL, gameState.ParkFlags & PARK_FLAGS_FORBID_TREE_REMOVAL); - SetWidgetPressed(WIDX_FORBID_LANDSCAPE_CHANGES, gameState.ParkFlags & PARK_FLAGS_FORBID_LANDSCAPE_CHANGES); - SetWidgetPressed(WIDX_FORBID_HIGH_CONSTRUCTION, gameState.ParkFlags & PARK_FLAGS_FORBID_HIGH_CONSTRUCTION); - SetWidgetPressed(WIDX_HARD_PARK_RATING, gameState.ParkFlags & PARK_FLAGS_DIFFICULT_PARK_RATING); - SetWidgetPressed(WIDX_HARD_GUEST_GENERATION, gameState.ParkFlags & PARK_FLAGS_DIFFICULT_GUEST_GENERATION); + // Climate label + const auto& climateWidget = widgets[WIDX_CLIMATE]; + screenCoords = windowPos + ScreenCoordsXY{ 8, climateWidget.top }; + DrawTextBasic(dpi, screenCoords, STR_CLIMATE_LABEL); - widgets[WIDX_CLOSE].type = (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WindowWidgetType::Empty - : WindowWidgetType::CloseBox; - - AnchorBorderWidgets(); - } - - void ParkDraw(DrawPixelInfo& dpi) - { - ScreenCoordsXY screenCoords{}; - - WindowDrawWidgets(*this, dpi); - DrawTabImages(dpi); - - const auto& gameState = GetGameState(); - const auto& landCostWidget = widgets[WIDX_LAND_COST]; - if (landCostWidget.type != WindowWidgetType::Empty) - { - // Cost to buy land label - screenCoords = windowPos + ScreenCoordsXY{ 8, landCostWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_LAND_COST_LABEL); - - // Cost to buy land value - screenCoords = windowPos + ScreenCoordsXY{ landCostWidget.left + 1, landCostWidget.top }; + // Climate value + screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; auto ft = Formatter(); - ft.Add(gameState.LandPrice); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); - } - - const auto& constructionRightsCostWidget = widgets[WIDX_CONSTRUCTION_RIGHTS_COST]; - if (constructionRightsCostWidget.type != WindowWidgetType::Empty) - { - // Cost to buy construction rights label - screenCoords = windowPos + ScreenCoordsXY{ 8, constructionRightsCostWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_RIGHTS_COST_LABEL); - - // Cost to buy construction rights value - screenCoords = windowPos - + ScreenCoordsXY{ constructionRightsCostWidget.left + 1, constructionRightsCostWidget.top }; - auto ft = Formatter(); - ft.Add(gameState.ConstructionRightsPrice); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); - } - - const auto& payForParkOrRidesWidget = widgets[WIDX_PAY_FOR_PARK_OR_RIDES]; - if (payForParkOrRidesWidget.type != WindowWidgetType::Empty) - { - // Pay for park or rides label - screenCoords = windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.left + 1, payForParkOrRidesWidget.top }; - - auto ft = Formatter(); - // Pay for park and/or rides value - if (gameState.ParkFlags & PARK_FLAGS_UNLOCK_ALL_PRICES) - ft.Add(STR_PAID_ENTRY_PAID_RIDES); - else if (gameState.ParkFlags & PARK_FLAGS_PARK_FREE_ENTRY) - ft.Add(STR_FREE_PARK_ENTER); - else - ft.Add(STR_PAY_PARK_ENTER); - + ft.Add(ClimateNames[EnumValue(gameState.Climate)]); DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); } - const auto& entryPriceWidget = widgets[WIDX_ENTRY_PRICE]; - if (entryPriceWidget.type != WindowWidgetType::Empty) - { - // Entry price label - screenCoords = windowPos + ScreenCoordsXY{ payForParkOrRidesWidget.right + 8, entryPriceWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_ENTRY_PRICE_LABEL); - - // Entry price value - screenCoords = windowPos + ScreenCoordsXY{ entryPriceWidget.left + 1, entryPriceWidget.top }; - auto ft = Formatter(); - ft.Add(gameState.ParkEntranceFee); - DrawTextBasic(dpi, screenCoords, STR_CURRENCY_FORMAT_LABEL, ft); - } - - // Climate label - const auto& climateWidget = widgets[WIDX_CLIMATE]; - screenCoords = windowPos + ScreenCoordsXY{ 8, climateWidget.top }; - DrawTextBasic(dpi, screenCoords, STR_CLIMATE_LABEL); - - // Climate value - screenCoords = windowPos + ScreenCoordsXY{ climateWidget.left + 1, climateWidget.top }; - auto ft = Formatter(); - ft.Add(ClimateNames[EnumValue(gameState.Climate)]); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); - } - #pragma endregion -}; + }; -WindowBase* WindowEditorScenarioOptionsOpen() -{ - return WindowFocusOrCreate(WindowClass::EditorScenarioOptions, 280, 148, WF_NO_SCROLLING); -} + WindowBase* WindowEditorScenarioOptionsOpen() + { + return WindowFocusOrCreate(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 1dffdd6a9b..0ad3005c4a 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -18,7 +18,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_BACKGROUND }; @@ -27,146 +29,147 @@ static Widget window_error_widgets[] = { MakeWidget({0, 0}, {200, 42}, WindowWidgetType::ImgBtn, WindowColour::Primary), kWidgetsEnd, }; -// clang-format on + // clang-format on -class ErrorWindow final : public Window -{ -private: - std::string _text; - uint16_t _numLines; - uint8_t _staleCount; - -public: - ErrorWindow(std::string text, uint16_t numLines) - : _text(std::move(text)) - , _numLines(numLines) + class ErrorWindow final : public Window { - } + private: + std::string _text; + uint16_t _numLines; + uint8_t _staleCount; - void OnOpen() override - { - window_error_widgets[WIDX_BACKGROUND].right = width; - window_error_widgets[WIDX_BACKGROUND].bottom = height; - - widgets = window_error_widgets; - _staleCount = 0; - if (!gDisableErrorWindowSound) + public: + ErrorWindow(std::string text, uint16_t numLines) + : _text(std::move(text)) + , _numLines(numLines) { - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, windowPos.x + (width / 2)); } - } - void OnDraw(DrawPixelInfo& dpi) override - { - ScreenCoordsXY leftTop{ windowPos }; - ScreenCoordsXY rightBottom{ windowPos + ScreenCoordsXY{ width - 1, height - 1 } }; - ScreenCoordsXY leftBottom{ leftTop.x, rightBottom.y }; - ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y }; - - GfxFilterRect( - dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, - FilterPaletteID::Palette45); - GfxFilterRect(dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed); - - GfxFilterRect( - dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } }, - FilterPaletteID::PaletteDarken3); - GfxFilterRect( - dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } }, - FilterPaletteID::PaletteDarken3); - GfxFilterRect( - dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } }, - FilterPaletteID::PaletteDarken3); - GfxFilterRect( - dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } }, - FilterPaletteID::PaletteDarken3); - - GfxFilterRect( - dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } }, - FilterPaletteID::PaletteDarken3); - GfxFilterRect( - dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } }, - FilterPaletteID::PaletteDarken3); - GfxFilterRect( - dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } }, - FilterPaletteID::PaletteDarken3); - GfxFilterRect( - dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, - FilterPaletteID::PaletteDarken3); - - DrawStringCentredRaw( - dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium); - } - - void OnPeriodicUpdate() override - { - // Close the window after 8 seconds of showing - _staleCount++; - if (_staleCount >= 8) + void OnOpen() override { - Close(); + window_error_widgets[WIDX_BACKGROUND].right = width; + window_error_widgets[WIDX_BACKGROUND].bottom = height; + + widgets = window_error_widgets; + _staleCount = 0; + if (!gDisableErrorWindowSound) + { + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, windowPos.x + (width / 2)); + } } - } -}; -WindowBase* WindowErrorOpen(std::string_view title, std::string_view message) -{ - std::string buffer = "{BLACK}"; - buffer.append(title); + void OnDraw(DrawPixelInfo& dpi) override + { + ScreenCoordsXY leftTop{ windowPos }; + ScreenCoordsXY rightBottom{ windowPos + ScreenCoordsXY{ width - 1, height - 1 } }; + ScreenCoordsXY leftBottom{ leftTop.x, rightBottom.y }; + ScreenCoordsXY rightTop{ rightBottom.x, leftTop.y }; - // Format the message - if (!message.empty()) + GfxFilterRect( + dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, + FilterPaletteID::Palette45); + GfxFilterRect(dpi, ScreenRect{ leftTop, rightBottom }, FilterPaletteID::PaletteGlassSaturatedRed); + + GfxFilterRect( + dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 0, 2 }, leftBottom - ScreenCoordsXY{ 0, 2 } }, + FilterPaletteID::PaletteDarken3); + GfxFilterRect( + dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 0, 2 }, rightBottom - ScreenCoordsXY{ 0, 2 } }, + FilterPaletteID::PaletteDarken3); + GfxFilterRect( + dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 2, 0 }, rightBottom - ScreenCoordsXY{ 2, 0 } }, + FilterPaletteID::PaletteDarken3); + GfxFilterRect( + dpi, ScreenRect{ leftTop + ScreenCoordsXY{ 2, 0 }, rightTop - ScreenCoordsXY{ 2, 0 } }, + FilterPaletteID::PaletteDarken3); + + GfxFilterRect( + dpi, ScreenRect{ rightTop + ScreenCoordsXY{ 1, 1 }, rightTop + ScreenCoordsXY{ 1, 1 } }, + FilterPaletteID::PaletteDarken3); + GfxFilterRect( + dpi, ScreenRect{ rightTop + ScreenCoordsXY{ -1, 1 }, rightTop + ScreenCoordsXY{ -1, 1 } }, + FilterPaletteID::PaletteDarken3); + GfxFilterRect( + dpi, ScreenRect{ leftBottom + ScreenCoordsXY{ 1, -1 }, leftBottom + ScreenCoordsXY{ 1, -1 } }, + FilterPaletteID::PaletteDarken3); + GfxFilterRect( + dpi, ScreenRect{ rightBottom - ScreenCoordsXY{ 1, 1 }, rightBottom - ScreenCoordsXY{ 1, 1 } }, + FilterPaletteID::PaletteDarken3); + + DrawStringCentredRaw( + dpi, { leftTop + ScreenCoordsXY{ (width + 1) / 2 - 1, 1 } }, _numLines, _text.data(), FontStyle::Medium); + } + + void OnPeriodicUpdate() override + { + // Close the window after 8 seconds of showing + _staleCount++; + if (_staleCount >= 8) + { + Close(); + } + } + }; + + WindowBase* WindowErrorOpen(std::string_view title, std::string_view message) { - buffer.push_back('\n'); - buffer.append(message); + std::string buffer = "{BLACK}"; + buffer.append(title); + + // Format the message + if (!message.empty()) + { + buffer.push_back('\n'); + buffer.append(message); + } + + LOG_VERBOSE("show error, %s", buffer.c_str() + 1); + + // Don't do unnecessary work in headless. Also saves checking if cursor state is null. + if (gOpenRCT2Headless) + { + return nullptr; + } + + // Check if there is any text to display + if (buffer.size() <= 1) + { + return nullptr; + } + + // Close any existing error windows if they exist. + WindowCloseByClass(WindowClass::Error); + + int32_t width = GfxGetStringWidthNewLined(buffer.data(), FontStyle::Medium); + width = std::clamp(width, 64, 196); + + int32_t numLines{}; + GfxWrapString(buffer, width + 1, FontStyle::Medium, &buffer, &numLines); + + width = width + 3; + int32_t height = (numLines + 1) * FontGetLineHeight(FontStyle::Medium) + 4; + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + const CursorState* state = ContextGetCursorState(); + ScreenCoordsXY windowPosition = state->position - ScreenCoordsXY(width / 2, -26); + windowPosition.x = std::clamp(windowPosition.x, 0, screenWidth); + windowPosition.y = std::max(22, windowPosition.y); + int32_t maxY = screenHeight - height; + if (windowPosition.y > maxY) + { + windowPosition.y = std::min(windowPosition.y - height - 40, maxY); + } + + auto errorWindow = std::make_unique(std::move(buffer), numLines); + return WindowCreate( + std::move(errorWindow), WindowClass::Error, windowPosition, width, height, + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_RESIZABLE); } - LOG_VERBOSE("show error, %s", buffer.c_str() + 1); - - // Don't do unnecessary work in headless. Also saves checking if cursor state is null. - if (gOpenRCT2Headless) + WindowBase* WindowErrorOpen(StringId title, StringId message, const Formatter& args) { - return nullptr; + auto titlez = FormatStringID(title, args.Data()); + auto messagez = FormatStringID(message, args.Data()); + return WindowErrorOpen(titlez, messagez); } - - // Check if there is any text to display - if (buffer.size() <= 1) - { - return nullptr; - } - - // Close any existing error windows if they exist. - WindowCloseByClass(WindowClass::Error); - - int32_t width = GfxGetStringWidthNewLined(buffer.data(), FontStyle::Medium); - width = std::clamp(width, 64, 196); - - int32_t numLines{}; - GfxWrapString(buffer, width + 1, FontStyle::Medium, &buffer, &numLines); - - width = width + 3; - int32_t height = (numLines + 1) * FontGetLineHeight(FontStyle::Medium) + 4; - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - const CursorState* state = ContextGetCursorState(); - ScreenCoordsXY windowPosition = state->position - ScreenCoordsXY(width / 2, -26); - windowPosition.x = std::clamp(windowPosition.x, 0, screenWidth); - windowPosition.y = std::max(22, windowPosition.y); - int32_t maxY = screenHeight - height; - if (windowPosition.y > maxY) - { - windowPosition.y = std::min(windowPosition.y - height - 40, maxY); - } - - auto errorWindow = std::make_unique(std::move(buffer), numLines); - return WindowCreate( - std::move(errorWindow), WindowClass::Error, windowPosition, width, height, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_RESIZABLE); -} - -WindowBase* WindowErrorOpen(StringId title, StringId message, const Formatter& args) -{ - auto titlez = FormatStringID(title, args.Data()); - auto messagez = FormatStringID(message, args.Data()); - return WindowErrorOpen(titlez, messagez); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index d8a93935dc..5a192397cb 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -28,79 +28,79 @@ #include #include -using namespace OpenRCT2; - -enum +namespace OpenRCT2::Ui::Windows { - WINDOW_FINANCES_PAGE_SUMMARY, - WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH, - WINDOW_FINANCES_PAGE_VALUE_GRAPH, - WINDOW_FINANCES_PAGE_PROFIT_GRAPH, - WINDOW_FINANCES_PAGE_MARKETING, - WINDOW_FINANCES_PAGE_RESEARCH, - WINDOW_FINANCES_PAGE_COUNT -}; + enum + { + WINDOW_FINANCES_PAGE_SUMMARY, + WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH, + WINDOW_FINANCES_PAGE_VALUE_GRAPH, + WINDOW_FINANCES_PAGE_PROFIT_GRAPH, + WINDOW_FINANCES_PAGE_MARKETING, + WINDOW_FINANCES_PAGE_RESEARCH, + WINDOW_FINANCES_PAGE_COUNT + }; -enum -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PAGE_BACKGROUND, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_TAB_4, - WIDX_TAB_5, - WIDX_TAB_6, + enum + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PAGE_BACKGROUND, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_TAB_4, + WIDX_TAB_5, + WIDX_TAB_6, - WIDX_TAB_CONTENT, + WIDX_TAB_CONTENT, - WIDX_SUMMARY_SCROLL = WIDX_TAB_CONTENT, - WIDX_LOAN, - WIDX_LOAN_INCREASE, - WIDX_LOAN_DECREASE, + WIDX_SUMMARY_SCROLL = WIDX_TAB_CONTENT, + WIDX_LOAN, + WIDX_LOAN_INCREASE, + WIDX_LOAN_DECREASE, - WIDX_ACTIVE_CAMPAIGNS_GROUP = WIDX_TAB_CONTENT, - WIDX_CAMPAIGNS_AVAILABLE_GROUP, - WIDX_CAMPAIGN_1, - WIDX_CAMPAIGN_2, - WIDX_CAMPAIGN_3, - WIDX_CAMPAIGN_4, - WIDX_CAMPAIGN_5, - WIDX_CAMPAIGN_6, + WIDX_ACTIVE_CAMPAIGNS_GROUP = WIDX_TAB_CONTENT, + WIDX_CAMPAIGNS_AVAILABLE_GROUP, + WIDX_CAMPAIGN_1, + WIDX_CAMPAIGN_2, + WIDX_CAMPAIGN_3, + WIDX_CAMPAIGN_4, + WIDX_CAMPAIGN_5, + WIDX_CAMPAIGN_6, - WIDX_RESEARCH_FUNDING_GROUP = WIDX_TAB_CONTENT, - WIDX_RESEARCH_FUNDING, - WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON, - WIDX_RESEARCH_PRIORITIES_GROUP, - WIDX_TRANSPORT_RIDES, - WIDX_GENTLE_RIDES, - WIDX_ROLLER_COASTERS, - WIDX_THRILL_RIDES, - WIDX_WATER_RIDES, - WIDX_SHOPS_AND_STALLS, - WIDX_SCENERY_AND_THEMING, -}; + WIDX_RESEARCH_FUNDING_GROUP = WIDX_TAB_CONTENT, + WIDX_RESEARCH_FUNDING, + WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON, + WIDX_RESEARCH_PRIORITIES_GROUP, + WIDX_TRANSPORT_RIDES, + WIDX_GENTLE_RIDES, + WIDX_ROLLER_COASTERS, + WIDX_THRILL_RIDES, + WIDX_WATER_RIDES, + WIDX_SHOPS_AND_STALLS, + WIDX_SCENERY_AND_THEMING, + }; #pragma region Measurements -static constexpr int32_t WH_SUMMARY = 309; -static constexpr int32_t WH_RESEARCH = 207; -static constexpr int32_t WH_OTHER_TABS = 257; -static constexpr int32_t WW_RESEARCH = 320; -static constexpr int32_t WW_OTHER_TABS = 530; -static constexpr int32_t RSH_SUMMARY = 266; -static constexpr int32_t RSH_RESEARCH = 164; -static constexpr int32_t RSH_OTHER_TABS = 214; -static constexpr int32_t RSW_RESEARCH = WW_RESEARCH; -static constexpr int32_t RSW_OTHER_TABS = WW_OTHER_TABS; + static constexpr int32_t WH_SUMMARY = 309; + static constexpr int32_t WH_RESEARCH = 207; + static constexpr int32_t WH_OTHER_TABS = 257; + static constexpr int32_t WW_RESEARCH = 320; + static constexpr int32_t WW_OTHER_TABS = 530; + static constexpr int32_t RSH_SUMMARY = 266; + static constexpr int32_t RSH_RESEARCH = 164; + static constexpr int32_t RSH_OTHER_TABS = 214; + static constexpr int32_t RSW_RESEARCH = WW_RESEARCH; + static constexpr int32_t RSW_OTHER_TABS = WW_OTHER_TABS; #pragma endregion #pragma region Widgets -// clang-format off + // clang-format off #define MAIN_FINANCES_WIDGETS(TITLE, RSW, RSH, WW, WH) \ WINDOW_SHIM(TITLE, WW, WH), \ MakeWidget({0, 43}, {RSW, RSH}, WindowWidgetType::Resize, WindowColour::Secondary), \ @@ -167,814 +167,819 @@ static Widget _windowFinancesResearchWidgets[] = MakeWidget({ 8, 186}, {WW_RESEARCH - 14, 12}, WindowWidgetType::Checkbox, WindowColour::Tertiary, STR_RESEARCH_NEW_SCENERY_AND_THEMING, STR_RESEARCH_NEW_SCENERY_AND_THEMING_TIP ), kWidgetsEnd, }; -// clang-format on + // clang-format on -static Widget* _windowFinancesPageWidgets[] = { - _windowFinancesSummaryWidgets, // WINDOW_FINANCES_PAGE_SUMMARY - _windowFinancesCashWidgets, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH - _windowFinancesParkValueWidgets, // WINDOW_FINANCES_PAGE_VALUE_GRAPH - _windowFinancesProfitWidgets, // WINDOW_FINANCES_PAGE_PROFIT_GRAPH - _windowFinancesMarketingWidgets, // WINDOW_FINANCES_PAGE_MARKETING - _windowFinancesResearchWidgets, // WINDOW_FINANCES_PAGE_RESEARCH -}; -static_assert(std::size(_windowFinancesPageWidgets) == WINDOW_FINANCES_PAGE_COUNT); + static Widget* _windowFinancesPageWidgets[] = { + _windowFinancesSummaryWidgets, // WINDOW_FINANCES_PAGE_SUMMARY + _windowFinancesCashWidgets, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH + _windowFinancesParkValueWidgets, // WINDOW_FINANCES_PAGE_VALUE_GRAPH + _windowFinancesProfitWidgets, // WINDOW_FINANCES_PAGE_PROFIT_GRAPH + _windowFinancesMarketingWidgets, // WINDOW_FINANCES_PAGE_MARKETING + _windowFinancesResearchWidgets, // WINDOW_FINANCES_PAGE_RESEARCH + }; + static_assert(std::size(_windowFinancesPageWidgets) == WINDOW_FINANCES_PAGE_COUNT); #pragma endregion -static constexpr StringId _windowFinancesSummaryRowLabels[EnumValue(ExpenditureType::Count)] = { - STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION, - STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS, - STR_FINANCES_SUMMARY_LAND_PURCHASE, - STR_FINANCES_SUMMARY_LANDSCAPING, - STR_FINANCES_SUMMARY_PARK_ENTRANCE_TICKETS, - STR_FINANCES_SUMMARY_RIDE_TICKETS, - STR_FINANCES_SUMMARY_SHOP_SALES, - STR_FINANCES_SUMMARY_SHOP_STOCK, - STR_FINANCES_SUMMARY_FOOD_DRINK_SALES, - STR_FINANCES_SUMMARY_FOOD_DRINK_STOCK, - STR_FINANCES_SUMMARY_STAFF_WAGES, - STR_FINANCES_SUMMARY_MARKETING, - STR_FINANCES_SUMMARY_RESEARCH, - STR_FINANCES_SUMMARY_LOAN_INTEREST, -}; + static constexpr StringId _windowFinancesSummaryRowLabels[EnumValue(ExpenditureType::Count)] = { + STR_FINANCES_SUMMARY_RIDE_CONSTRUCTION, + STR_FINANCES_SUMMARY_RIDE_RUNNING_COSTS, + STR_FINANCES_SUMMARY_LAND_PURCHASE, + STR_FINANCES_SUMMARY_LANDSCAPING, + STR_FINANCES_SUMMARY_PARK_ENTRANCE_TICKETS, + STR_FINANCES_SUMMARY_RIDE_TICKETS, + STR_FINANCES_SUMMARY_SHOP_SALES, + STR_FINANCES_SUMMARY_SHOP_STOCK, + STR_FINANCES_SUMMARY_FOOD_DRINK_SALES, + STR_FINANCES_SUMMARY_FOOD_DRINK_STOCK, + STR_FINANCES_SUMMARY_STAFF_WAGES, + STR_FINANCES_SUMMARY_MARKETING, + STR_FINANCES_SUMMARY_RESEARCH, + STR_FINANCES_SUMMARY_LOAN_INTEREST, + }; -static constexpr int32_t _windowFinancesTabAnimationFrames[] = { - 8, // WINDOW_FINANCES_PAGE_SUMMARY - 16, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH - 16, // WINDOW_FINANCES_PAGE_VALUE_GRAPH - 16, // WINDOW_FINANCES_PAGE_PROFIT_GRAPH - 19, // WINDOW_FINANCES_PAGE_MARKETING - 8, // WINDOW_FINANCES_PAGE_RESEARCH -}; -static_assert(std::size(_windowFinancesTabAnimationFrames) == WINDOW_FINANCES_PAGE_COUNT); + static constexpr int32_t _windowFinancesTabAnimationFrames[] = { + 8, // WINDOW_FINANCES_PAGE_SUMMARY + 16, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH + 16, // WINDOW_FINANCES_PAGE_VALUE_GRAPH + 16, // WINDOW_FINANCES_PAGE_PROFIT_GRAPH + 19, // WINDOW_FINANCES_PAGE_MARKETING + 8, // WINDOW_FINANCES_PAGE_RESEARCH + }; + static_assert(std::size(_windowFinancesTabAnimationFrames) == WINDOW_FINANCES_PAGE_COUNT); -static constexpr int32_t EXPENDITURE_COLUMN_WIDTH = 80; + static constexpr int32_t EXPENDITURE_COLUMN_WIDTH = 80; -static constexpr uint32_t _windowFinancesPageHoldDownWidgets[] = { - (1uLL << WIDX_LOAN_INCREASE) | (1uLL << WIDX_LOAN_DECREASE), // WINDOW_FINANCES_PAGE_SUMMARY + static constexpr uint32_t _windowFinancesPageHoldDownWidgets[] = { + (1uLL << WIDX_LOAN_INCREASE) | (1uLL << WIDX_LOAN_DECREASE), // WINDOW_FINANCES_PAGE_SUMMARY - 0, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH - 0, // WINDOW_FINANCES_PAGE_VALUE_GRAPH - 0, // WINDOW_FINANCES_PAGE_PROFIT_GRAPH - 0, // WINDOW_FINANCES_PAGE_MARKETING - 0, // WINDOW_FINANCES_PAGE_RESEARCH -}; -static_assert(std::size(_windowFinancesPageHoldDownWidgets) == WINDOW_FINANCES_PAGE_COUNT); + 0, // WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH + 0, // WINDOW_FINANCES_PAGE_VALUE_GRAPH + 0, // WINDOW_FINANCES_PAGE_PROFIT_GRAPH + 0, // WINDOW_FINANCES_PAGE_MARKETING + 0, // WINDOW_FINANCES_PAGE_RESEARCH + }; + static_assert(std::size(_windowFinancesPageHoldDownWidgets) == WINDOW_FINANCES_PAGE_COUNT); #pragma endregion -class FinancesWindow final : public Window -{ -private: - uint32_t _lastPaintedMonth; - - void SetDisabledTabs() + class FinancesWindow final : public Window { - disabled_widgets = (GetGameState().ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0; - } + private: + uint32_t _lastPaintedMonth; -public: - void OnOpen() override - { - SetPage(WINDOW_FINANCES_PAGE_SUMMARY); - _lastPaintedMonth = std::numeric_limits::max(); - ResearchUpdateUncompletedTypes(); - } - - void OnUpdate() override - { - frame_no++; - InvalidateWidget(WIDX_TAB_1 + page); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) + void SetDisabledTabs() { - case WINDOW_FINANCES_PAGE_SUMMARY: - OnMouseDownSummary(widgetIndex); - break; - case WINDOW_FINANCES_PAGE_RESEARCH: - WindowResearchFundingMouseDown(this, widgetIndex, WIDX_RESEARCH_FUNDING); - break; - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - SetPage(widgetIndex - WIDX_TAB_1); - break; - default: - switch (page) - { - case WINDOW_FINANCES_PAGE_MARKETING: - OnMouseUpMarketing(widgetIndex); - break; - case WINDOW_FINANCES_PAGE_RESEARCH: - WindowResearchFundingMouseUp(widgetIndex, WIDX_RESEARCH_FUNDING); - } - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (page == WINDOW_FINANCES_PAGE_RESEARCH) - { - WindowResearchFundingDropdown(widgetIndex, selectedIndex, WIDX_RESEARCH_FUNDING); - } - } - - void OnPrepareDraw() override - { - auto* targetWidgets = _windowFinancesPageWidgets[page]; - - if (widgets != targetWidgets) - { - widgets = targetWidgets; - WindowInitScrollWidgets(*this); + disabled_widgets = (GetGameState().ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) ? (1uLL << WIDX_TAB_5) : 0; } - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_6); - - for (auto i = 0; i < WINDOW_FINANCES_PAGE_COUNT; i++) - SetWidgetPressed(WIDX_TAB_1 + i, false); - SetWidgetPressed(WIDX_TAB_1 + page, true); - switch (page) + public: + void OnOpen() override { - case WINDOW_FINANCES_PAGE_SUMMARY: - OnPrepareDrawSummary(); - break; - case WINDOW_FINANCES_PAGE_MARKETING: - OnPrepareDrawMarketing(); - break; - case WINDOW_FINANCES_PAGE_RESEARCH: - WindowResearchFundingPrepareDraw(this, WIDX_RESEARCH_FUNDING); - break; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - switch (page) - { - case WINDOW_FINANCES_PAGE_SUMMARY: - OnDrawSummary(dpi); - break; - case WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH: - OnDrawFinancialGraph(dpi); - break; - case WINDOW_FINANCES_PAGE_VALUE_GRAPH: - OnDrawParkValueGraph(dpi); - break; - case WINDOW_FINANCES_PAGE_PROFIT_GRAPH: - OnDrawProfitGraph(dpi); - break; - case WINDOW_FINANCES_PAGE_MARKETING: - OnDrawMarketing(dpi); - break; - case WINDOW_FINANCES_PAGE_RESEARCH: - WindowResearchFundingDraw(this, dpi); - break; - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - if (page == WINDOW_FINANCES_PAGE_SUMMARY) - { - return { EXPENDITURE_COLUMN_WIDTH * (SummaryMaxAvailableMonth() + 1), 0 }; + SetPage(WINDOW_FINANCES_PAGE_SUMMARY); + _lastPaintedMonth = std::numeric_limits::max(); + ResearchUpdateUncompletedTypes(); } - return {}; - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - if (page != WINDOW_FINANCES_PAGE_SUMMARY) - return; - - auto screenCoords = ScreenCoordsXY{ 0, TABLE_CELL_HEIGHT + 2 }; - - Widget self = widgets[WIDX_SUMMARY_SCROLL]; - int32_t row_width = std::max(scrolls[0].h_right, self.width()); - - // Expenditure / Income row labels - for (int32_t i = 0; i < static_cast(ExpenditureType::Count); i++) + void OnUpdate() override { - // Darken every even row - if (i % 2 == 0) - GfxFillRect( - dpi, - { screenCoords - ScreenCoordsXY{ 0, 1 }, - screenCoords + ScreenCoordsXY{ row_width, (TABLE_CELL_HEIGHT - 2) } }, - ColourMapA[colours[1]].lighter | 0x1000000); - - screenCoords.y += TABLE_CELL_HEIGHT; + frame_no++; + InvalidateWidget(WIDX_TAB_1 + page); } - auto& gameState = GetGameState(); - // Expenditure / Income values for each month - auto currentMonthYear = GetDate().GetMonthsElapsed(); - for (int32_t i = SummaryMaxAvailableMonth(); i >= 0; i--) + void OnMouseDown(WidgetIndex widgetIndex) override { - screenCoords.y = 0; - - uint16_t monthyear = currentMonthYear - i; - - // Month heading - auto ft = Formatter(); - ft.Add(STR_FINANCES_SUMMARY_MONTH_HEADING); - ft.Add(monthyear); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, - monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING, ft, - { TextUnderline::On, TextAlignment::RIGHT }); - screenCoords.y += 14; - - // Month expenditures - money64 profit = 0; - for (int32_t j = 0; j < static_cast(ExpenditureType::Count); j++) + switch (page) { - auto expenditure = gameState.ExpenditureTable[i][j]; - if (expenditure != 0) - { - profit += expenditure; - const StringId format = expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE - : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE; - ft = Formatter(); - ft.Add(expenditure); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, - { TextAlignment::RIGHT }); - } + case WINDOW_FINANCES_PAGE_SUMMARY: + OnMouseDownSummary(widgetIndex); + break; + case WINDOW_FINANCES_PAGE_RESEARCH: + WindowResearchFundingMouseDown(this, widgetIndex, WIDX_RESEARCH_FUNDING); + break; + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + SetPage(widgetIndex - WIDX_TAB_1); + break; + default: + switch (page) + { + case WINDOW_FINANCES_PAGE_MARKETING: + OnMouseUpMarketing(widgetIndex); + break; + case WINDOW_FINANCES_PAGE_RESEARCH: + WindowResearchFundingMouseUp(widgetIndex, WIDX_RESEARCH_FUNDING); + } + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (page == WINDOW_FINANCES_PAGE_RESEARCH) + { + WindowResearchFundingDropdown(widgetIndex, selectedIndex, WIDX_RESEARCH_FUNDING); + } + } + + void OnPrepareDraw() override + { + auto* targetWidgets = _windowFinancesPageWidgets[page]; + + if (widgets != targetWidgets) + { + widgets = targetWidgets; + WindowInitScrollWidgets(*this); + } + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_6); + + for (auto i = 0; i < WINDOW_FINANCES_PAGE_COUNT; i++) + SetWidgetPressed(WIDX_TAB_1 + i, false); + SetWidgetPressed(WIDX_TAB_1 + page, true); + switch (page) + { + case WINDOW_FINANCES_PAGE_SUMMARY: + OnPrepareDrawSummary(); + break; + case WINDOW_FINANCES_PAGE_MARKETING: + OnPrepareDrawMarketing(); + break; + case WINDOW_FINANCES_PAGE_RESEARCH: + WindowResearchFundingPrepareDraw(this, WIDX_RESEARCH_FUNDING); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + switch (page) + { + case WINDOW_FINANCES_PAGE_SUMMARY: + OnDrawSummary(dpi); + break; + case WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH: + OnDrawFinancialGraph(dpi); + break; + case WINDOW_FINANCES_PAGE_VALUE_GRAPH: + OnDrawParkValueGraph(dpi); + break; + case WINDOW_FINANCES_PAGE_PROFIT_GRAPH: + OnDrawProfitGraph(dpi); + break; + case WINDOW_FINANCES_PAGE_MARKETING: + OnDrawMarketing(dpi); + break; + case WINDOW_FINANCES_PAGE_RESEARCH: + WindowResearchFundingDraw(this, dpi); + break; + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + if (page == WINDOW_FINANCES_PAGE_SUMMARY) + { + return { EXPENDITURE_COLUMN_WIDTH * (SummaryMaxAvailableMonth() + 1), 0 }; + } + + return {}; + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + if (page != WINDOW_FINANCES_PAGE_SUMMARY) + return; + + auto screenCoords = ScreenCoordsXY{ 0, TABLE_CELL_HEIGHT + 2 }; + + Widget self = widgets[WIDX_SUMMARY_SCROLL]; + int32_t row_width = std::max(scrolls[0].h_right, self.width()); + + // Expenditure / Income row labels + for (int32_t i = 0; i < static_cast(ExpenditureType::Count); i++) + { + // Darken every even row + if (i % 2 == 0) + GfxFillRect( + dpi, + { screenCoords - ScreenCoordsXY{ 0, 1 }, + screenCoords + ScreenCoordsXY{ row_width, (TABLE_CELL_HEIGHT - 2) } }, + ColourMapA[colours[1]].lighter | 0x1000000); + screenCoords.y += TABLE_CELL_HEIGHT; } - screenCoords.y += 4; - // Month profit - const StringId format = profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE; - ft = Formatter(); - ft.Add(profit); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); + auto& gameState = GetGameState(); + // Expenditure / Income values for each month + auto currentMonthYear = GetDate().GetMonthsElapsed(); + for (int32_t i = SummaryMaxAvailableMonth(); i >= 0; i--) + { + screenCoords.y = 0; - GfxFillRect( - dpi, { screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, -2 } }, - PALETTE_INDEX_10); + uint16_t monthyear = currentMonthYear - i; - screenCoords.x += EXPENDITURE_COLUMN_WIDTH; + // Month heading + auto ft = Formatter(); + ft.Add(STR_FINANCES_SUMMARY_MONTH_HEADING); + ft.Add(monthyear); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, + monthyear == currentMonthYear ? STR_WINDOW_COLOUR_2_STRINGID : STR_BLACK_STRING, ft, + { TextUnderline::On, TextAlignment::RIGHT }); + screenCoords.y += 14; + + // Month expenditures + money64 profit = 0; + for (int32_t j = 0; j < static_cast(ExpenditureType::Count); j++) + { + auto expenditure = gameState.ExpenditureTable[i][j]; + if (expenditure != 0) + { + profit += expenditure; + const StringId format = expenditure >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE + : STR_FINANCES_SUMMARY_EXPENDITURE_VALUE; + ft = Formatter(); + ft.Add(expenditure); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, + { TextAlignment::RIGHT }); + } + screenCoords.y += TABLE_CELL_HEIGHT; + } + screenCoords.y += 4; + + // Month profit + const StringId format = profit >= 0 ? STR_FINANCES_SUMMARY_INCOME_VALUE : STR_FINANCES_SUMMARY_LOSS_VALUE; + ft = Formatter(); + ft.Add(profit); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, 0 }, format, ft, { TextAlignment::RIGHT }); + + GfxFillRect( + dpi, + { screenCoords + ScreenCoordsXY{ 10, -2 }, screenCoords + ScreenCoordsXY{ EXPENDITURE_COLUMN_WIDTH, -2 } }, + PALETTE_INDEX_10); + + screenCoords.x += EXPENDITURE_COLUMN_WIDTH; + } + + _lastPaintedMonth = currentMonthYear; } - _lastPaintedMonth = currentMonthYear; - } - - void SetPage(int32_t p) - { - page = p; - frame_no = 0; - - hold_down_widgets = _windowFinancesPageHoldDownWidgets[p]; - pressed_widgets = 0; - widgets = _windowFinancesPageWidgets[p]; - SetDisabledTabs(); - Invalidate(); - - if (p == WINDOW_FINANCES_PAGE_RESEARCH) + void SetPage(int32_t p) { - width = WW_RESEARCH; - height = WH_RESEARCH; - } - else if (p == WINDOW_FINANCES_PAGE_SUMMARY) - { - width = WW_OTHER_TABS; - height = WH_SUMMARY; - } - else - { - width = WW_OTHER_TABS; - height = WH_OTHER_TABS; - } - OnResize(); - OnPrepareDraw(); + page = p; + frame_no = 0; - WindowInitScrollWidgets(*this); + hold_down_widgets = _windowFinancesPageHoldDownWidgets[p]; + pressed_widgets = 0; + widgets = _windowFinancesPageWidgets[p]; + SetDisabledTabs(); + Invalidate(); - // Scroll summary all the way to the right, initially. - if (p == WINDOW_FINANCES_PAGE_SUMMARY) - InitialiseScrollPosition(WIDX_SUMMARY_SCROLL, 0); + if (p == WINDOW_FINANCES_PAGE_RESEARCH) + { + width = WW_RESEARCH; + height = WH_RESEARCH; + } + else if (p == WINDOW_FINANCES_PAGE_SUMMARY) + { + width = WW_OTHER_TABS; + height = WH_SUMMARY; + } + else + { + width = WW_OTHER_TABS; + height = WH_OTHER_TABS; + } + OnResize(); + OnPrepareDraw(); - Invalidate(); - } + WindowInitScrollWidgets(*this); + + // Scroll summary all the way to the right, initially. + if (p == WINDOW_FINANCES_PAGE_SUMMARY) + InitialiseScrollPosition(WIDX_SUMMARY_SCROLL, 0); + + Invalidate(); + } #pragma region Summary Events - void OnMouseDownSummary(WidgetIndex widgetIndex) - { - auto& gameState = GetGameState(); - switch (widgetIndex) + void OnMouseDownSummary(WidgetIndex widgetIndex) { - case WIDX_LOAN_INCREASE: + auto& gameState = GetGameState(); + switch (widgetIndex) { - // If loan can be increased, do so. - // If not, action shows error message. - auto newLoan = gameState.BankLoan + 1000.00_GBP; - if (gameState.BankLoan < gameState.MaxBankLoan) + case WIDX_LOAN_INCREASE: { - newLoan = std::min(gameState.MaxBankLoan, newLoan); - } - auto gameAction = ParkSetLoanAction(newLoan); - GameActions::Execute(&gameAction); - break; - } - case WIDX_LOAN_DECREASE: - { - // If loan is positive, decrease it. - // If loan is negative, action shows error message. - // If loan is exactly 0, prevent error message. - if (gameState.BankLoan != 0) - { - auto newLoan = gameState.BankLoan - 1000.00_GBP; - if (gameState.BankLoan > 0) + // If loan can be increased, do so. + // If not, action shows error message. + auto newLoan = gameState.BankLoan + 1000.00_GBP; + if (gameState.BankLoan < gameState.MaxBankLoan) { - newLoan = std::max(static_cast(0LL), newLoan); + newLoan = std::min(gameState.MaxBankLoan, newLoan); } auto gameAction = ParkSetLoanAction(newLoan); GameActions::Execute(&gameAction); + break; + } + case WIDX_LOAN_DECREASE: + { + // If loan is positive, decrease it. + // If loan is negative, action shows error message. + // If loan is exactly 0, prevent error message. + if (gameState.BankLoan != 0) + { + auto newLoan = gameState.BankLoan - 1000.00_GBP; + if (gameState.BankLoan > 0) + { + newLoan = std::max(static_cast(0LL), newLoan); + } + auto gameAction = ParkSetLoanAction(newLoan); + GameActions::Execute(&gameAction); + } + break; } - break; } } - } - void OnPrepareDrawSummary() - { - // Setting loan widget's format arguments here. - // Nothing else should use the global formatter until - // drawing has completed. - auto ft = Formatter::Common(); - ft.Increment(6); - ft.Add(GetGameState().BankLoan); - - // Keep up with new months being added in the first two years. - if (GetDate().GetMonthsElapsed() != _lastPaintedMonth) - InitialiseScrollPosition(WIDX_SUMMARY_SCROLL, 0); - } - - void OnDrawSummary(DrawPixelInfo& dpi) - { - auto screenCoords = windowPos + ScreenCoordsXY{ 8, 51 }; - auto& gameState = GetGameState(); - - // Expenditure / Income heading - DrawTextBasic( - dpi, screenCoords, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, {}, - { COLOUR_BLACK, TextUnderline::On, TextAlignment::LEFT }); - screenCoords.y += 14; - - // Expenditure / Income row labels - for (int32_t i = 0; i < static_cast(ExpenditureType::Count); i++) + void OnPrepareDrawSummary() { - // Darken every even row - if (i % 2 == 0) - GfxFillRect( - dpi, - { screenCoords - ScreenCoordsXY{ 0, 1 }, screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } }, - ColourMapA[colours[1]].lighter | 0x1000000); + // Setting loan widget's format arguments here. + // Nothing else should use the global formatter until + // drawing has completed. + auto ft = Formatter::Common(); + ft.Increment(6); + ft.Add(GetGameState().BankLoan); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]); - screenCoords.y += TABLE_CELL_HEIGHT; + // Keep up with new months being added in the first two years. + if (GetDate().GetMonthsElapsed() != _lastPaintedMonth) + InitialiseScrollPosition(WIDX_SUMMARY_SCROLL, 0); } - // Horizontal rule below expenditure / income table - GfxFillRectInset( - dpi, { windowPos + ScreenCoordsXY{ 8, 272 }, windowPos + ScreenCoordsXY{ 8 + 513, 272 + 1 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); - - // Loan and interest rate - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 279 }, STR_FINANCES_SUMMARY_LOAN); - if (!(gameState.ParkFlags & PARK_FLAGS_RCT1_INTEREST)) + void OnDrawSummary(DrawPixelInfo& dpi) { - auto ft = Formatter(); - ft.Add(gameState.BankLoanInterestRate); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft); - } + auto screenCoords = windowPos + ScreenCoordsXY{ 8, 51 }; + auto& gameState = GetGameState(); - // Current cash - auto ft = Formatter(); - ft.Add(gameState.Cash); - StringId stringId = gameState.Cash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft); - - // Objective related financial information - if (gameState.ScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) - { - auto lastMonthProfit = FinanceGetLastMonthShopProfit(); - ft = Formatter(); - ft.Add(lastMonthProfit); + // Expenditure / Income heading DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, ft); - } - else - { - // Park value and company value - ft = Formatter(); - ft.Add(gameState.ParkValue); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft); - ft = Formatter(); - ft.Add(gameState.CompanyValue); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft); - } - } + dpi, screenCoords, STR_FINANCES_SUMMARY_EXPENDITURE_INCOME, {}, + { COLOUR_BLACK, TextUnderline::On, TextAlignment::LEFT }); + screenCoords.y += 14; - uint16_t SummaryMaxAvailableMonth() - { - return std::min(GetDate().GetMonthsElapsed(), EXPENDITURE_TABLE_MONTH_COUNT - 1); - } + // Expenditure / Income row labels + for (int32_t i = 0; i < static_cast(ExpenditureType::Count); i++) + { + // Darken every even row + if (i % 2 == 0) + GfxFillRect( + dpi, + { screenCoords - ScreenCoordsXY{ 0, 1 }, + screenCoords + ScreenCoordsXY{ 121, (TABLE_CELL_HEIGHT - 2) } }, + ColourMapA[colours[1]].lighter | 0x1000000); + + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, _windowFinancesSummaryRowLabels[i]); + screenCoords.y += TABLE_CELL_HEIGHT; + } + + // Horizontal rule below expenditure / income table + GfxFillRectInset( + dpi, { windowPos + ScreenCoordsXY{ 8, 272 }, windowPos + ScreenCoordsXY{ 8 + 513, 272 + 1 } }, colours[1], + INSET_RECT_FLAG_BORDER_INSET); + + // Loan and interest rate + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 279 }, STR_FINANCES_SUMMARY_LOAN); + if (!(gameState.ParkFlags & PARK_FLAGS_RCT1_INTEREST)) + { + auto ft = Formatter(); + ft.Add(gameState.BankLoanInterestRate); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 167, 279 }, STR_FINANCES_SUMMARY_AT_X_PER_YEAR, ft); + } + + // Current cash + auto ft = Formatter(); + ft.Add(gameState.Cash); + StringId stringId = gameState.Cash >= 0 ? STR_CASH_LABEL : STR_CASH_NEGATIVE_LABEL; + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, 294 }, stringId, ft); + + // Objective related financial information + if (gameState.ScenarioObjective.Type == OBJECTIVE_MONTHLY_FOOD_INCOME) + { + auto lastMonthProfit = FinanceGetLastMonthShopProfit(); + ft = Formatter(); + ft.Add(lastMonthProfit); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_LAST_MONTH_PROFIT_FROM_FOOD_DRINK_MERCHANDISE_SALES_LABEL, + ft); + } + else + { + // Park value and company value + ft = Formatter(); + ft.Add(gameState.ParkValue); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 279 }, STR_PARK_VALUE_LABEL, ft); + ft = Formatter(); + ft.Add(gameState.CompanyValue); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 280, 294 }, STR_COMPANY_VALUE_LABEL, ft); + } + } + + uint16_t SummaryMaxAvailableMonth() + { + return std::min(GetDate().GetMonthsElapsed(), EXPENDITURE_TABLE_MONTH_COUNT - 1); + } #pragma endregion #pragma region Financial Graph Events - void OnDrawFinancialGraph(DrawPixelInfo& dpi) - { - Widget* pageWidget = &_windowFinancesCashWidgets[WIDX_PAGE_BACKGROUND]; - auto graphTopLeft = windowPos + ScreenCoordsXY{ pageWidget->left + 4, pageWidget->top + 15 }; - auto graphBottomRight = windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; - - const auto& gameState = GetGameState(); - - // Cash (less loan) - auto cashLessLoan = gameState.Cash - gameState.BankLoan; - auto ft = Formatter(); - ft.Add(cashLessLoan); - - DrawTextBasic( - dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, - cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE - : STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE, - ft); - - // Graph - GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); - - // Calculate the Y axis scale (log2 of highest [+/-]balance) - int32_t yAxisScale = 0; - for (int32_t i = 0; i < 64; i++) + void OnDrawFinancialGraph(DrawPixelInfo& dpi) { - auto balance = gameState.CashHistory[i]; - if (balance == kMoney64Undefined) - continue; + Widget* pageWidget = &_windowFinancesCashWidgets[WIDX_PAGE_BACKGROUND]; + auto graphTopLeft = windowPos + ScreenCoordsXY{ pageWidget->left + 4, pageWidget->top + 15 }; + auto graphBottomRight = windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; - // Modifier balance then keep halving until less than 127 pixels - balance = std::abs(balance) >> yAxisScale; - while (balance > 127) - { - balance /= 2; - yAxisScale++; - } - } + const auto& gameState = GetGameState(); + + // Cash (less loan) + auto cashLessLoan = gameState.Cash - gameState.BankLoan; + auto ft = Formatter(); + ft.Add(cashLessLoan); - // Y axis labels - auto coords = graphTopLeft + ScreenCoordsXY{ 18, 14 }; - money64 axisBase; - for (axisBase = 12.00_GBP; axisBase >= -12.00_GBP; axisBase -= 6.00_GBP) - { - auto axisValue = axisBase << yAxisScale; - ft = Formatter(); - ft.Add(axisValue); DrawTextBasic( - dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, - { FontStyle::Small, TextAlignment::RIGHT }); - GfxFillRectInset( - dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], - INSET_RECT_FLAG_BORDER_INSET); - coords.y += 39; - } + dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, + cashLessLoan >= 0 ? STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_POSITIVE + : STR_FINANCES_FINANCIAL_GRAPH_CASH_LESS_LOAN_NEGATIVE, + ft); - // X axis labels and values - coords = graphTopLeft + ScreenCoordsXY{ 98, 17 }; - Graph::Draw(dpi, gameState.CashHistory, 64, coords, yAxisScale, 128); - } + // Graph + GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); + + // Calculate the Y axis scale (log2 of highest [+/-]balance) + int32_t yAxisScale = 0; + for (int32_t i = 0; i < 64; i++) + { + auto balance = gameState.CashHistory[i]; + if (balance == kMoney64Undefined) + continue; + + // Modifier balance then keep halving until less than 127 pixels + balance = std::abs(balance) >> yAxisScale; + while (balance > 127) + { + balance /= 2; + yAxisScale++; + } + } + + // Y axis labels + auto coords = graphTopLeft + ScreenCoordsXY{ 18, 14 }; + money64 axisBase; + for (axisBase = 12.00_GBP; axisBase >= -12.00_GBP; axisBase -= 6.00_GBP) + { + auto axisValue = axisBase << yAxisScale; + ft = Formatter(); + ft.Add(axisValue); + DrawTextBasic( + dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, + { FontStyle::Small, TextAlignment::RIGHT }); + GfxFillRectInset( + dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], + INSET_RECT_FLAG_BORDER_INSET); + coords.y += 39; + } + + // X axis labels and values + coords = graphTopLeft + ScreenCoordsXY{ 98, 17 }; + Graph::Draw(dpi, gameState.CashHistory, 64, coords, yAxisScale, 128); + } #pragma endregion #pragma region Park Value Graph Events - void OnDrawParkValueGraph(DrawPixelInfo& dpi) - { - Widget* pageWidget = &_windowFinancesCashWidgets[WIDX_PAGE_BACKGROUND]; - auto graphTopLeft = windowPos + ScreenCoordsXY{ pageWidget->left + 4, pageWidget->top + 15 }; - auto graphBottomRight = windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; - - const auto& gameState = GetGameState(); - - // Park value - auto ft = Formatter(); - ft.Add(gameState.ParkValue); - DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft); - - // Graph - GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); - - // Calculate the Y axis scale (log2 of highest [+/-]balance) - int32_t yAxisScale = 0; - for (int32_t i = 0; i < 64; i++) + void OnDrawParkValueGraph(DrawPixelInfo& dpi) { - auto balance = gameState.ParkValueHistory[i]; - if (balance == kMoney64Undefined) - continue; + Widget* pageWidget = &_windowFinancesCashWidgets[WIDX_PAGE_BACKGROUND]; + auto graphTopLeft = windowPos + ScreenCoordsXY{ pageWidget->left + 4, pageWidget->top + 15 }; + auto graphBottomRight = windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; - // Modifier balance then keep halving until less than 255 pixels - balance = std::abs(balance) >> yAxisScale; - while (balance > 255) + const auto& gameState = GetGameState(); + + // Park value + auto ft = Formatter(); + ft.Add(gameState.ParkValue); + DrawTextBasic(dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, STR_FINANCES_PARK_VALUE, ft); + + // Graph + GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); + + // Calculate the Y axis scale (log2 of highest [+/-]balance) + int32_t yAxisScale = 0; + for (int32_t i = 0; i < 64; i++) { - balance /= 2; - yAxisScale++; + auto balance = gameState.ParkValueHistory[i]; + if (balance == kMoney64Undefined) + continue; + + // Modifier balance then keep halving until less than 255 pixels + balance = std::abs(balance) >> yAxisScale; + while (balance > 255) + { + balance /= 2; + yAxisScale++; + } } - } - // Y axis labels - auto coords = graphTopLeft + ScreenCoordsXY{ 18, 14 }; - money64 axisBase; - for (axisBase = 24.00_GBP; axisBase >= 0.00_GBP; axisBase -= 6.00_GBP) - { - auto axisValue = axisBase << yAxisScale; - ft = Formatter(); - ft.Add(axisValue); - DrawTextBasic( - dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, - { FontStyle::Small, TextAlignment::RIGHT }); - GfxFillRectInset( - dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], - INSET_RECT_FLAG_BORDER_INSET); - coords.y += 39; - } + // Y axis labels + auto coords = graphTopLeft + ScreenCoordsXY{ 18, 14 }; + money64 axisBase; + for (axisBase = 24.00_GBP; axisBase >= 0.00_GBP; axisBase -= 6.00_GBP) + { + auto axisValue = axisBase << yAxisScale; + ft = Formatter(); + ft.Add(axisValue); + DrawTextBasic( + dpi, coords + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, + { FontStyle::Small, TextAlignment::RIGHT }); + GfxFillRectInset( + dpi, { coords + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, coords.y + 5 } }, colours[2], + INSET_RECT_FLAG_BORDER_INSET); + coords.y += 39; + } - // X axis labels and values - coords = graphTopLeft + ScreenCoordsXY{ 98, 17 }; - Graph::Draw(dpi, gameState.ParkValueHistory, 64, coords, yAxisScale, 0); - } + // X axis labels and values + coords = graphTopLeft + ScreenCoordsXY{ 98, 17 }; + Graph::Draw(dpi, gameState.ParkValueHistory, 64, coords, yAxisScale, 0); + } #pragma endregion #pragma region Profit Graph Events - void OnDrawProfitGraph(DrawPixelInfo& dpi) - { - auto& gameState = GetGameState(); - Widget* pageWidget = &_windowFinancesCashWidgets[WIDX_PAGE_BACKGROUND]; - auto graphTopLeft = windowPos + ScreenCoordsXY{ pageWidget->left + 4, pageWidget->top + 15 }; - auto graphBottomRight = windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; - - // Weekly profit - auto ft = Formatter(); - ft.Add(gameState.CurrentProfit); - DrawTextBasic( - dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, - gameState.CurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft); - - // Graph - GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); - - // Calculate the Y axis scale (log2 of highest [+/-]balance) - int32_t yAxisScale = 0; - for (int32_t i = 0; i < 64; i++) + void OnDrawProfitGraph(DrawPixelInfo& dpi) { - auto balance = gameState.WeeklyProfitHistory[i]; - if (balance == kMoney64Undefined) - continue; + auto& gameState = GetGameState(); + Widget* pageWidget = &_windowFinancesCashWidgets[WIDX_PAGE_BACKGROUND]; + auto graphTopLeft = windowPos + ScreenCoordsXY{ pageWidget->left + 4, pageWidget->top + 15 }; + auto graphBottomRight = windowPos + ScreenCoordsXY{ pageWidget->right - 4, pageWidget->bottom - 4 }; - // Modifier balance then keep halving until less than 127 pixels - balance = std::abs(balance) >> yAxisScale; - while (balance > 127) - { - balance /= 2; - yAxisScale++; - } - } - - // Y axis labels - auto screenPos = graphTopLeft + ScreenCoordsXY{ 18, 14 }; - money64 axisBase; - for (axisBase = 12.00_GBP; axisBase >= -12.00_GBP; axisBase -= 6.00_GBP) - { - money64 axisValue = axisBase << yAxisScale; - ft = Formatter(); - ft.Add(axisValue); + // Weekly profit + auto ft = Formatter(); + ft.Add(gameState.CurrentProfit); DrawTextBasic( - dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, - { FontStyle::Small, TextAlignment::RIGHT }); - GfxFillRectInset( - dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2], - INSET_RECT_FLAG_BORDER_INSET); - screenPos.y += 39; - } + dpi, graphTopLeft - ScreenCoordsXY{ 0, 11 }, + gameState.CurrentProfit >= 0 ? STR_FINANCES_WEEKLY_PROFIT_POSITIVE : STR_FINANCES_WEEKLY_PROFIT_LOSS, ft); - // X axis labels and values - screenPos = graphTopLeft + ScreenCoordsXY{ 98, 17 }; - Graph::Draw(dpi, gameState.WeeklyProfitHistory, 64, screenPos, yAxisScale, 128); - } + // Graph + GfxFillRectInset(dpi, { graphTopLeft, graphBottomRight }, colours[1], INSET_RECT_F_30); + + // Calculate the Y axis scale (log2 of highest [+/-]balance) + int32_t yAxisScale = 0; + for (int32_t i = 0; i < 64; i++) + { + auto balance = gameState.WeeklyProfitHistory[i]; + if (balance == kMoney64Undefined) + continue; + + // Modifier balance then keep halving until less than 127 pixels + balance = std::abs(balance) >> yAxisScale; + while (balance > 127) + { + balance /= 2; + yAxisScale++; + } + } + + // Y axis labels + auto screenPos = graphTopLeft + ScreenCoordsXY{ 18, 14 }; + money64 axisBase; + for (axisBase = 12.00_GBP; axisBase >= -12.00_GBP; axisBase -= 6.00_GBP) + { + money64 axisValue = axisBase << yAxisScale; + ft = Formatter(); + ft.Add(axisValue); + DrawTextBasic( + dpi, screenPos + ScreenCoordsXY{ 70, 0 }, STR_FINANCES_FINANCIAL_GRAPH_CASH_VALUE, ft, + { FontStyle::Small, TextAlignment::RIGHT }); + GfxFillRectInset( + dpi, { screenPos + ScreenCoordsXY{ 70, 5 }, { graphTopLeft.x + 482, screenPos.y + 5 } }, colours[2], + INSET_RECT_FLAG_BORDER_INSET); + screenPos.y += 39; + } + + // X axis labels and values + screenPos = graphTopLeft + ScreenCoordsXY{ 98, 17 }; + Graph::Draw(dpi, gameState.WeeklyProfitHistory, 64, screenPos, yAxisScale, 128); + } #pragma endregion #pragma region Marketing Events - void OnMouseUpMarketing(WidgetIndex widgetIndex) - { - if (widgetIndex >= WIDX_CAMPAIGN_1 && widgetIndex <= WIDX_CAMPAIGN_6) + void OnMouseUpMarketing(WidgetIndex widgetIndex) { - ContextOpenDetailWindow(WD_NEW_CAMPAIGN, widgetIndex - WIDX_CAMPAIGN_1); - } - } - - void OnPrepareDrawMarketing() - { - // Count number of active campaigns - int32_t numActiveCampaigns = static_cast(gMarketingCampaigns.size()); - int32_t y = std::max(1, numActiveCampaigns) * LIST_ROW_HEIGHT + 92; - - // Update group box positions - _windowFinancesMarketingWidgets[WIDX_ACTIVE_CAMPAIGNS_GROUP].bottom = y - 22; - _windowFinancesMarketingWidgets[WIDX_CAMPAIGNS_AVAILABLE_GROUP].top = y - 13; - - // Update new campaign button visibility - y += 3; - for (int32_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) - { - auto campaignButton = &_windowFinancesMarketingWidgets[WIDX_CAMPAIGN_1 + i]; - auto marketingCampaign = MarketingGetCampaign(i); - if (marketingCampaign == nullptr && MarketingIsCampaignTypeApplicable(i)) + if (widgetIndex >= WIDX_CAMPAIGN_1 && widgetIndex <= WIDX_CAMPAIGN_6) { - campaignButton->type = WindowWidgetType::Button; - campaignButton->top = y; - campaignButton->bottom = y + BUTTON_FACE_HEIGHT + 1; - y += BUTTON_FACE_HEIGHT + 2; - } - else - { - campaignButton->type = WindowWidgetType::Empty; + ContextOpenDetailWindow(WD_NEW_CAMPAIGN, widgetIndex - WIDX_CAMPAIGN_1); } } - } - void OnDrawMarketing(DrawPixelInfo& dpi) - { - auto screenCoords = windowPos + ScreenCoordsXY{ 8, 62 }; - int32_t noCampaignsActive = 1; - for (int32_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) + void OnPrepareDrawMarketing() { - auto marketingCampaign = MarketingGetCampaign(i); - if (marketingCampaign == nullptr) - continue; + // Count number of active campaigns + int32_t numActiveCampaigns = static_cast(gMarketingCampaigns.size()); + int32_t y = std::max(1, numActiveCampaigns) * LIST_ROW_HEIGHT + 92; - noCampaignsActive = 0; - auto ft = Formatter(); + // Update group box positions + _windowFinancesMarketingWidgets[WIDX_ACTIVE_CAMPAIGNS_GROUP].bottom = y - 22; + _windowFinancesMarketingWidgets[WIDX_CAMPAIGNS_AVAILABLE_GROUP].top = y - 13; - // Set special parameters - switch (i) + // Update new campaign button visibility + y += 3; + for (int32_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) { - case ADVERTISING_CAMPAIGN_RIDE_FREE: - case ADVERTISING_CAMPAIGN_RIDE: + auto campaignButton = &_windowFinancesMarketingWidgets[WIDX_CAMPAIGN_1 + i]; + auto marketingCampaign = MarketingGetCampaign(i); + if (marketingCampaign == nullptr && MarketingIsCampaignTypeApplicable(i)) { - auto campaignRide = GetRide(marketingCampaign->RideId); - if (campaignRide != nullptr) - { - campaignRide->FormatNameTo(ft); - } - else - { - ft.Add(STR_NONE); - } - break; + campaignButton->type = WindowWidgetType::Button; + campaignButton->top = y; + campaignButton->bottom = y + BUTTON_FACE_HEIGHT + 1; + y += BUTTON_FACE_HEIGHT + 2; } - case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: - ft.Add(GetShopItemDescriptor(marketingCampaign->ShopItemType).Naming.Plural); - break; - default: + else { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - auto parkName = park.Name.c_str(); - ft.Add(STR_STRING); - ft.Add(parkName); + campaignButton->type = WindowWidgetType::Empty; } } - // Advertisement - DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft); - - // Duration - uint16_t weeksRemaining = marketingCampaign->WeeksLeft; - ft = Formatter(); - ft.Add(weeksRemaining); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, - weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, ft); - - screenCoords.y += LIST_ROW_HEIGHT; } - if (noCampaignsActive) + void OnDrawMarketing(DrawPixelInfo& dpi) { - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE); - screenCoords.y += LIST_ROW_HEIGHT; - } - screenCoords.y += 34; - - // Draw campaign button text - for (int32_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) - { - auto campaignButton = &_windowFinancesMarketingWidgets[WIDX_CAMPAIGN_1 + i]; - if (campaignButton->type != WindowWidgetType::Empty) + auto screenCoords = windowPos + ScreenCoordsXY{ 8, 62 }; + int32_t noCampaignsActive = 1; + for (int32_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) { - // Draw button text - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); + auto marketingCampaign = MarketingGetCampaign(i); + if (marketingCampaign == nullptr) + continue; + + noCampaignsActive = 0; auto ft = Formatter(); - ft.Add(AdvertisingCampaignPricePerWeek[i]); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft); - screenCoords.y += BUTTON_FACE_HEIGHT + 2; + // Set special parameters + switch (i) + { + case ADVERTISING_CAMPAIGN_RIDE_FREE: + case ADVERTISING_CAMPAIGN_RIDE: + { + auto campaignRide = GetRide(marketingCampaign->RideId); + if (campaignRide != nullptr) + { + campaignRide->FormatNameTo(ft); + } + else + { + ft.Add(STR_NONE); + } + break; + } + case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: + ft.Add(GetShopItemDescriptor(marketingCampaign->ShopItemType).Naming.Plural); + break; + default: + { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + auto parkName = park.Name.c_str(); + ft.Add(STR_STRING); + ft.Add(parkName); + } + } + // Advertisement + DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, 296, MarketingCampaignNames[i][1], ft); + + // Duration + uint16_t weeksRemaining = marketingCampaign->WeeksLeft; + ft = Formatter(); + ft.Add(weeksRemaining); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 304, 0 }, + weeksRemaining == 1 ? STR_1_WEEK_REMAINING : STR_X_WEEKS_REMAINING, ft); + + screenCoords.y += LIST_ROW_HEIGHT; + } + + if (noCampaignsActive) + { + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, STR_MARKETING_CAMPAIGNS_NONE); + screenCoords.y += LIST_ROW_HEIGHT; + } + screenCoords.y += 34; + + // Draw campaign button text + for (int32_t i = 0; i < ADVERTISING_CAMPAIGN_COUNT; i++) + { + auto campaignButton = &_windowFinancesMarketingWidgets[WIDX_CAMPAIGN_1 + i]; + if (campaignButton->type != WindowWidgetType::Empty) + { + // Draw button text + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, MarketingCampaignNames[i][0]); + auto ft = Formatter(); + ft.Add(AdvertisingCampaignPricePerWeek[i]); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ WH_SUMMARY, 0 }, STR_MARKETING_PER_WEEK, ft); + + screenCoords.y += BUTTON_FACE_HEIGHT + 2; + } } } - } #pragma endregion - void InitialiseScrollPosition(WidgetIndex widgetIndex, int32_t scrollId) - { - const auto& widget = this->widgets[widgetIndex]; - scrolls[scrollId].h_left = std::max(0, scrolls[scrollId].h_right - (widget.width() - 2)); - - WidgetScrollUpdateThumbs(*this, widgetIndex); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t tabPage, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + tabPage; - - if (!IsWidgetDisabled(widgetIndex)) + void InitialiseScrollPosition(WidgetIndex widgetIndex, int32_t scrollId) { - if (this->page == tabPage) - { - int32_t frame = frame_no / 2; - spriteIndex += (frame % _windowFinancesTabAnimationFrames[this->page]); - } + const auto& widget = this->widgets[widgetIndex]; + scrolls[scrollId].h_left = std::max(0, scrolls[scrollId].h_right - (widget.width() - 2)); - GfxDrawSprite( - dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + WidgetScrollUpdateThumbs(*this, widgetIndex); } - } - void DrawTabImages(DrawPixelInfo& dpi) + void DrawTabImage(DrawPixelInfo& dpi, int32_t tabPage, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + tabPage; + + if (!IsWidgetDisabled(widgetIndex)) + { + if (this->page == tabPage) + { + int32_t frame = frame_no / 2; + spriteIndex += (frame % _windowFinancesTabAnimationFrames[this->page]); + } + + GfxDrawSprite( + dpi, ImageId(spriteIndex), + windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + } + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawTabImage(dpi, WINDOW_FINANCES_PAGE_SUMMARY, SPR_TAB_FINANCES_SUMMARY_0); + DrawTabImage(dpi, WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH, SPR_TAB_FINANCES_FINANCIAL_GRAPH_0); + DrawTabImage(dpi, WINDOW_FINANCES_PAGE_VALUE_GRAPH, SPR_TAB_FINANCES_VALUE_GRAPH_0); + DrawTabImage(dpi, WINDOW_FINANCES_PAGE_PROFIT_GRAPH, SPR_TAB_FINANCES_PROFIT_GRAPH_0); + DrawTabImage(dpi, WINDOW_FINANCES_PAGE_MARKETING, SPR_TAB_FINANCES_MARKETING_0); + DrawTabImage(dpi, WINDOW_FINANCES_PAGE_RESEARCH, SPR_TAB_FINANCES_RESEARCH_0); + } + + void OnResize() override + { + ResizeFrameWithPage(); + } + }; + + static FinancesWindow* FinancesWindowOpen(uint8_t page) { - DrawTabImage(dpi, WINDOW_FINANCES_PAGE_SUMMARY, SPR_TAB_FINANCES_SUMMARY_0); - DrawTabImage(dpi, WINDOW_FINANCES_PAGE_FINANCIAL_GRAPH, SPR_TAB_FINANCES_FINANCIAL_GRAPH_0); - DrawTabImage(dpi, WINDOW_FINANCES_PAGE_VALUE_GRAPH, SPR_TAB_FINANCES_VALUE_GRAPH_0); - DrawTabImage(dpi, WINDOW_FINANCES_PAGE_PROFIT_GRAPH, SPR_TAB_FINANCES_PROFIT_GRAPH_0); - DrawTabImage(dpi, WINDOW_FINANCES_PAGE_MARKETING, SPR_TAB_FINANCES_MARKETING_0); - DrawTabImage(dpi, WINDOW_FINANCES_PAGE_RESEARCH, SPR_TAB_FINANCES_RESEARCH_0); + auto* window = WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); + + if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY) + window->SetPage(page); + + return window; } - void OnResize() override + WindowBase* WindowFinancesOpen() { - ResizeFrameWithPage(); + return WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); } -}; -static FinancesWindow* FinancesWindowOpen(uint8_t page) -{ - auto* window = WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); + WindowBase* WindowFinancesResearchOpen() + { + return FinancesWindowOpen(WINDOW_FINANCES_PAGE_RESEARCH); + } - if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY) - window->SetPage(page); - - return window; -} - -WindowBase* WindowFinancesOpen() -{ - return WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); -} - -WindowBase* WindowFinancesResearchOpen() -{ - return FinancesWindowOpen(WINDOW_FINANCES_PAGE_RESEARCH); -} - -WindowBase* WindowFinancesMarketingOpen() -{ - return FinancesWindowOpen(WINDOW_FINANCES_PAGE_MARKETING); -} + WindowBase* WindowFinancesMarketingOpen() + { + return FinancesWindowOpen(WINDOW_FINANCES_PAGE_MARKETING); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 94080b04ec..1f744ea857 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -34,10 +34,9 @@ #include #include -using namespace OpenRCT2; -using namespace OpenRCT2::Ui; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { PATH_CONSTRUCTION_MODE_LAND, @@ -143,695 +142,793 @@ static constexpr uint8_t ConstructionPreviewImages[][4] = { { 16, 17, 18, 19 }, // Upwards { 18, 19, 16, 17 }, // Downwards }; -// clang-format on + // clang-format on -class FootpathWindow final : public Window -{ -private: - const uint16_t ARROW_PULSE_DURATION = 200; + class FootpathWindow final : public Window + { + private: + const uint16_t ARROW_PULSE_DURATION = 200; - uint8_t _footpathConstructDirection; - uint8_t _footpathConstructValidDirections; - uint8_t _footpathConstructionMode; + uint8_t _footpathConstructDirection; + uint8_t _footpathConstructValidDirections; + uint8_t _footpathConstructionMode; - std::vector> _dropdownEntries; + std::vector> _dropdownEntries; - money64 _windowFootpathCost; - uint32_t _footpathConstructionNextArrowPulse = 0; - uint8_t _lastUpdatedCameraRotation = UINT8_MAX; - bool _footpathErrorOccured = false; + money64 _windowFootpathCost; + uint32_t _footpathConstructionNextArrowPulse = 0; + uint8_t _lastUpdatedCameraRotation = UINT8_MAX; + bool _footpathErrorOccured = false; -public: + public: #pragma region Window Override Events - void OnOpen() override - { - widgets = window_footpath_widgets; - - WindowInitScrollWidgets(*this); - WindowPushOthersRight(*this); - ShowGridlines(); - - ToolCancel(); - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; - ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); - InputSetFlag(INPUT_FLAG_6, true); - _footpathErrorOccured = false; - WindowFootpathSetEnabledAndPressedWidgets(); - } - - void OnClose() override - { - FootpathProvisionalUpdate(); - ViewportSetVisibility(ViewportVisibility::Default); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - WindowInvalidateByClass(WindowClass::TopToolbar); - HideGridlines(); - } - - void OnUpdate() override - { - WidgetInvalidate(*this, WIDX_CONSTRUCT); - WindowFootpathUpdateProvisionalPathForBridgeMode(); - - // #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed - uint8_t currentRotation = GetCurrentRotation(); - if (_lastUpdatedCameraRotation != currentRotation) + void OnOpen() override { - _lastUpdatedCameraRotation = currentRotation; + widgets = window_footpath_widgets; + + WindowInitScrollWidgets(*this); + WindowPushOthersRight(*this); + ShowGridlines(); + + ToolCancel(); + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; + ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); + InputSetFlag(INPUT_FLAG_6, true); + _footpathErrorOccured = false; WindowFootpathSetEnabledAndPressedWidgets(); } - // Check tool - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) + void OnClose() override { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - { - Close(); - } - else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) - { - Close(); - } - else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_ON_LAND) - { - Close(); - } - } - else if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) - { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - { - Close(); - } - else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) - { - Close(); - } - else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) - { - Close(); - } - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_FOOTPATH_TYPE: - WindowFootpathShowFootpathTypesDialog(&window_footpath_widgets[widgetIndex], false); - break; - case WIDX_QUEUELINE_TYPE: - WindowFootpathShowFootpathTypesDialog(&window_footpath_widgets[widgetIndex], true); - break; - case WIDX_RAILINGS_TYPE: - WindowFootpathShowRailingsTypesDialog(&window_footpath_widgets[widgetIndex]); - break; - case WIDX_DIRECTION_NW: - WindowFootpathMousedownDirection(0); - break; - case WIDX_DIRECTION_NE: - WindowFootpathMousedownDirection(1); - break; - case WIDX_DIRECTION_SW: - WindowFootpathMousedownDirection(2); - break; - case WIDX_DIRECTION_SE: - WindowFootpathMousedownDirection(3); - break; - case WIDX_SLOPEDOWN: - WindowFootpathMousedownSlope(6); - break; - case WIDX_LEVEL: - WindowFootpathMousedownSlope(0); - break; - case WIDX_SLOPEUP: - WindowFootpathMousedownSlope(2); - break; - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_CONSTRUCT: - WindowFootpathConstruct(); - break; - case WIDX_REMOVE: - WindowFootpathRemove(); - break; - case WIDX_CONSTRUCT_ON_LAND: - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) - { - break; - } - - _windowFootpathCost = kMoney64Undefined; - ToolCancel(); - FootpathProvisionalUpdate(); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; - ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); - InputSetFlag(INPUT_FLAG_6, true); - _footpathErrorOccured = false; - WindowFootpathSetEnabledAndPressedWidgets(); - break; - case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) - { - break; - } - - _windowFootpathCost = kMoney64Undefined; - ToolCancel(); - FootpathProvisionalUpdate(); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL; - ToolSet(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair); - InputSetFlag(INPUT_FLAG_6, true); - _footpathErrorOccured = false; - WindowFootpathSetEnabledAndPressedWidgets(); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (selectedIndex < 0 || static_cast(selectedIndex) >= _dropdownEntries.size()) - return; - - auto entryIndex = _dropdownEntries[selectedIndex]; - if (widgetIndex == WIDX_FOOTPATH_TYPE) - { - gFootpathSelection.IsQueueSelected = false; - if (entryIndex.first == ObjectType::Paths) - { - gFootpathSelection.LegacyPath = entryIndex.second; - } - else - { - gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; - gFootpathSelection.NormalSurface = entryIndex.second; - } - } - else if (widgetIndex == WIDX_QUEUELINE_TYPE) - { - gFootpathSelection.IsQueueSelected = true; - if (entryIndex.first == ObjectType::Paths) - { - gFootpathSelection.LegacyPath = entryIndex.second; - } - else - { - gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; - gFootpathSelection.QueueSurface = entryIndex.second; - } - } - else if (widgetIndex == WIDX_RAILINGS_TYPE) - { - gFootpathSelection.Railings = entryIndex.second; - } - else - { - return; - } - - FootpathProvisionalUpdate(); - _windowFootpathCost = kMoney64Undefined; - Invalidate(); - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - WindowFootpathSetProvisionalPathAtPoint(screenCoords); - } - else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) - { - WindowFootpathSetSelectionStartBridgeAtPoint(screenCoords); - } - } - - void OnToolUp(WidgetIndex widgetIndex, const ScreenCoordsXY&) override - { - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - _footpathErrorOccured = false; - } - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - WindowFootpathPlacePathAtPoint(screenCoords); - } - else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) - { - WindowFootpathStartBridgeAtPoint(screenCoords); - } - } - - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) - { - WindowFootpathPlacePathAtPoint(screenCoords); - } - } - - void OnPrepareDraw() override - { - // Press / unpress footpath and queue type buttons - pressed_widgets &= ~(1uLL << WIDX_FOOTPATH_TYPE); - pressed_widgets &= ~(1uLL << WIDX_QUEUELINE_TYPE); - pressed_widgets |= gFootpathSelection.IsQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) : (1uLL << WIDX_FOOTPATH_TYPE); - - // Enable / disable construct button - window_footpath_widgets[WIDX_CONSTRUCT].type = _footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL - ? WindowWidgetType::ImgBtn - : WindowWidgetType::Empty; - - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) - { - window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::FlatBtn; - } - else - { - window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::Empty; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - ScreenCoordsXY screenCoords; - WindowDrawWidgets(*this, dpi); - WindowFootpathDrawDropdownButtons(dpi); - - if (!IsWidgetDisabled(WIDX_CONSTRUCT)) - { - // Get construction image - uint8_t direction = (_footpathConstructDirection + GetCurrentRotation()) % 4; - uint8_t slope = 0; - if (gFootpathConstructSlope == 2) - { - slope = TILE_ELEMENT_SLOPE_N_CORNER_UP; - } - else if (gFootpathConstructSlope == 6) - { - slope = TILE_ELEMENT_SLOPE_E_CORNER_UP; - } - - std::optional baseImage; - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) - { - auto selectedPath = gFootpathSelection.GetSelectedSurface(); - const auto* pathType = GetPathSurfaceEntry(selectedPath); - if (pathType != nullptr) - { - baseImage = pathType->BaseImageId; - } - } - else - { - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - auto* pathObj = static_cast( - objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); - if (pathObj != nullptr) - { - auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - if (gFootpathSelection.IsQueueSelected) - baseImage = pathEntry->GetQueueImage(); - else - baseImage = pathEntry->image; - } - } - - if (baseImage) - { - auto image = *baseImage + ConstructionPreviewImages[slope][direction]; - - // Draw construction image - screenCoords = this->windowPos - + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), - window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 }; - GfxDrawSprite(dpi, ImageId(image), screenCoords); - } - - // Draw build this... label - screenCoords = this->windowPos - + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), - window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 }; - DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); - } - - // Draw cost - screenCoords = this->windowPos - + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), - window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12 }; - if (_windowFootpathCost != kMoney64Undefined) - { - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(_windowFootpathCost); - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); - } - } - } - -#pragma endregion - -private: - /** - * - * rct2: 0x006A7760 - */ - void WindowFootpathUpdateProvisionalPathForBridgeMode() - { - if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) - { - return; - } - - // Recheck area for construction. Set by ride_construction window - if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_2) - { - FootpathProvisionalRemove(); - gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_2; - } - - // Update provisional bridge mode path - if (!(gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)) - { - ObjectEntryIndex type; - ObjectEntryIndex railings = gFootpathSelection.Railings; - - CoordsXYZ footpathLoc; - int32_t slope; - FootpathGetNextPathInfo(&type, footpathLoc, &slope); - auto pathConstructFlags = FootpathCreateConstructFlags(type); - - _windowFootpathCost = FootpathProvisionalSet(type, railings, footpathLoc, slope, pathConstructFlags); - WidgetInvalidate(*this, WIDX_CONSTRUCT); - } - - auto curTime = Platform::GetTicks(); - - // Update little directional arrow on provisional bridge mode path - if (_footpathConstructionNextArrowPulse < curTime) - { - _footpathConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; - - gProvisionalFootpath.Flags ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW; - CoordsXYZ footpathLoc; - int32_t slope; - FootpathGetNextPathInfo(nullptr, footpathLoc, &slope); - gMapSelectArrowPosition = footpathLoc; - gMapSelectArrowDirection = _footpathConstructDirection; - if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - } - else - { - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - } - MapInvalidateTileFull(footpathLoc); - } - } - - void WindowFootpathDrawDropdownButtons(DrawPixelInfo& dpi) - { - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) - { - // Set footpath and queue type button images - auto pathImage = static_cast(SPR_NONE); - auto queueImage = static_cast(SPR_NONE); - auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.NormalSurface); - if (pathEntry != nullptr) - { - pathImage = pathEntry->PreviewImageId; - } - - pathEntry = GetPathSurfaceEntry(gFootpathSelection.QueueSurface); - if (pathEntry != nullptr) - { - queueImage = pathEntry->PreviewImageId; - } - - WindowFootpathDrawDropdownButton(dpi, WIDX_FOOTPATH_TYPE, pathImage); - WindowFootpathDrawDropdownButton(dpi, WIDX_QUEUELINE_TYPE, queueImage); - - // Set railing - auto railingsImage = static_cast(SPR_NONE); - auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.Railings); - if (railingsEntry != nullptr) - { - railingsImage = railingsEntry->PreviewImageId; - } - WindowFootpathDrawDropdownButton(dpi, WIDX_RAILINGS_TYPE, railingsImage); - } - else - { - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - - // Set footpath and queue type button images - auto pathImage = static_cast(SPR_NONE); - auto queueImage = static_cast(SPR_NONE); - auto pathObj = static_cast( - objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); - if (pathObj != nullptr) - { - auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - pathImage = pathEntry->GetPreviewImage(); - queueImage = pathEntry->GetQueuePreviewImage(); - } - - WindowFootpathDrawDropdownButton(dpi, WIDX_FOOTPATH_TYPE, pathImage); - WindowFootpathDrawDropdownButton(dpi, WIDX_QUEUELINE_TYPE, queueImage); - } - } - - void WindowFootpathDrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageIndex image) - { - const auto& widget = widgets[widgetIndex]; - GfxDrawSprite(dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top }); - } - - /** - * - * rct2: 0x006A7F88 - */ - void WindowFootpathShowFootpathTypesDialog(Widget* widget, bool showQueues) - { - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - - uint32_t numPathTypes = 0; - // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor - bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode); - - _dropdownEntries.clear(); - std::optional defaultIndex; - for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) - { - const auto* pathType = static_cast( - objManager.GetLoadedObject(ObjectType::FootpathSurface, i)); - if (pathType == nullptr) - { - continue; - } - if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) - { - continue; - } - // If regular paths can be used as queue, only hide the path if we’re _not_ looking at a queue, - // but the path surface is one. - if (GetGameState().Cheats.AllowRegularPathAsQueue && !showQueues - && ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) - { - continue; - } - // If the cheat is disabled, hide queues from the regular path view and vice versa. - else if ( - !GetGameState().Cheats.AllowRegularPathAsQueue - && showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) - { - continue; - } - - if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL - && i == (showQueues ? gFootpathSelection.QueueSurface : gFootpathSelection.NormalSurface)) - { - defaultIndex = numPathTypes; - } - - gDropdownItems[numPathTypes].Format = STR_NONE; - Dropdown::SetImage(numPathTypes, ImageId(pathType->PreviewImageId)); - _dropdownEntries.push_back({ ObjectType::FootpathSurface, i }); - numPathTypes++; - } - - for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) - { - auto* pathObj = static_cast(objManager.GetLoadedObject(ObjectType::Paths, i)); - if (pathObj == nullptr) - { - continue; - } - - auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); - if ((pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) - { - continue; - } - - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL && gFootpathSelection.LegacyPath == i) - { - defaultIndex = numPathTypes; - } - - gDropdownItems[numPathTypes].Format = STR_NONE; - Dropdown::SetImage( - numPathTypes, ImageId(showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage())); - _dropdownEntries.push_back({ ObjectType::Paths, i }); - numPathTypes++; - } - - auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numPathTypes); - WindowDropdownShowImage( - windowPos.x + widget->left, windowPos.y + widget->top, widget->height() + 1, colours[1], 0, numPathTypes, 47, 36, - itemsPerRow); - if (defaultIndex) - gDropdownDefaultIndex = static_cast(*defaultIndex); - } - - void WindowFootpathShowRailingsTypesDialog(Widget* widget) - { - uint32_t numRailingsTypes = 0; - // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor - - _dropdownEntries.clear(); - std::optional defaultIndex; - for (int32_t i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) - { - const auto* railingsEntry = GetPathRailingsEntry(i); - if (railingsEntry == nullptr) - { - continue; - } - if (i == gFootpathSelection.Railings) - { - defaultIndex = numRailingsTypes; - } - - gDropdownItems[numRailingsTypes].Format = STR_NONE; - Dropdown::SetImage(numRailingsTypes, ImageId(railingsEntry->PreviewImageId)); - _dropdownEntries.push_back({ ObjectType::FootpathRailings, i }); - numRailingsTypes++; - } - - auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numRailingsTypes); - WindowDropdownShowImage( - windowPos.x + widget->left, windowPos.y + widget->top, widget->height() + 1, colours[1], 0, numRailingsTypes, 47, - 36, itemsPerRow); - if (defaultIndex) - gDropdownDefaultIndex = static_cast(*defaultIndex); - } - - /** - * - * rct2: 0x006A8111 0x006A8135 0x006A815C 0x006A8183 - */ - void WindowFootpathMousedownDirection(int32_t direction) - { - FootpathProvisionalUpdate(); - _footpathConstructDirection = (direction - GetCurrentRotation()) & 3; - _windowFootpathCost = kMoney64Undefined; - WindowFootpathSetEnabledAndPressedWidgets(); - } - - /** - * - * rct2: 0x006A81AA 0x006A81C5 0x006A81E0 - */ - void WindowFootpathMousedownSlope(int32_t slope) - { - FootpathProvisionalUpdate(); - gFootpathConstructSlope = slope; - _windowFootpathCost = kMoney64Undefined; - WindowFootpathSetEnabledAndPressedWidgets(); - } - - /** - * - * rct2: 0x006A81FB - */ - void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords) - { - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - auto info = GetMapCoordinatesFromPos( - screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); - - if (info.SpriteType == ViewportInteractionItem::None || info.Element == nullptr) - { - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; FootpathProvisionalUpdate(); + ViewportSetVisibility(ViewportVisibility::Default); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + WindowInvalidateByClass(WindowClass::TopToolbar); + HideGridlines(); } - else + + void OnUpdate() override { - // Check for change - if ((gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) - && gProvisionalFootpath.Position == CoordsXYZ{ info.Loc, info.Element->GetBaseZ() }) + WidgetInvalidate(*this, WIDX_CONSTRUCT); + WindowFootpathUpdateProvisionalPathForBridgeMode(); + + // #2502: The camera might have changed rotation, so we need to update which directional buttons are pressed + uint8_t currentRotation = GetCurrentRotation(); + if (_lastUpdatedCameraRotation != currentRotation) + { + _lastUpdatedCameraRotation = currentRotation; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + // Check tool + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + { + Close(); + } + else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) + { + Close(); + } + else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_ON_LAND) + { + Close(); + } + } + else if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + { + Close(); + } + else if (gCurrentToolWidget.window_classification != WindowClass::Footpath) + { + Close(); + } + else if (gCurrentToolWidget.widget_index != WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) + { + Close(); + } + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_FOOTPATH_TYPE: + WindowFootpathShowFootpathTypesDialog(&window_footpath_widgets[widgetIndex], false); + break; + case WIDX_QUEUELINE_TYPE: + WindowFootpathShowFootpathTypesDialog(&window_footpath_widgets[widgetIndex], true); + break; + case WIDX_RAILINGS_TYPE: + WindowFootpathShowRailingsTypesDialog(&window_footpath_widgets[widgetIndex]); + break; + case WIDX_DIRECTION_NW: + WindowFootpathMousedownDirection(0); + break; + case WIDX_DIRECTION_NE: + WindowFootpathMousedownDirection(1); + break; + case WIDX_DIRECTION_SW: + WindowFootpathMousedownDirection(2); + break; + case WIDX_DIRECTION_SE: + WindowFootpathMousedownDirection(3); + break; + case WIDX_SLOPEDOWN: + WindowFootpathMousedownSlope(6); + break; + case WIDX_LEVEL: + WindowFootpathMousedownSlope(0); + break; + case WIDX_SLOPEUP: + WindowFootpathMousedownSlope(2); + break; + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_CONSTRUCT: + WindowFootpathConstruct(); + break; + case WIDX_REMOVE: + WindowFootpathRemove(); + break; + case WIDX_CONSTRUCT_ON_LAND: + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_LAND) + { + break; + } + + _windowFootpathCost = kMoney64Undefined; + ToolCancel(); + FootpathProvisionalUpdate(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_LAND; + ToolSet(*this, WIDX_CONSTRUCT_ON_LAND, Tool::PathDown); + InputSetFlag(INPUT_FLAG_6, true); + _footpathErrorOccured = false; + WindowFootpathSetEnabledAndPressedWidgets(); + break; + case WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL: + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL) + { + break; + } + + _windowFootpathCost = kMoney64Undefined; + ToolCancel(); + FootpathProvisionalUpdate(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL_TOOL; + ToolSet(*this, WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL, Tool::Crosshair); + InputSetFlag(INPUT_FLAG_6, true); + _footpathErrorOccured = false; + WindowFootpathSetEnabledAndPressedWidgets(); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (selectedIndex < 0 || static_cast(selectedIndex) >= _dropdownEntries.size()) + return; + + auto entryIndex = _dropdownEntries[selectedIndex]; + if (widgetIndex == WIDX_FOOTPATH_TYPE) + { + gFootpathSelection.IsQueueSelected = false; + if (entryIndex.first == ObjectType::Paths) + { + gFootpathSelection.LegacyPath = entryIndex.second; + } + else + { + gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; + gFootpathSelection.NormalSurface = entryIndex.second; + } + } + else if (widgetIndex == WIDX_QUEUELINE_TYPE) + { + gFootpathSelection.IsQueueSelected = true; + if (entryIndex.first == ObjectType::Paths) + { + gFootpathSelection.LegacyPath = entryIndex.second; + } + else + { + gFootpathSelection.LegacyPath = OBJECT_ENTRY_INDEX_NULL; + gFootpathSelection.QueueSurface = entryIndex.second; + } + } + else if (widgetIndex == WIDX_RAILINGS_TYPE) + { + gFootpathSelection.Railings = entryIndex.second; + } + else + { + return; + } + + FootpathProvisionalUpdate(); + _windowFootpathCost = kMoney64Undefined; + Invalidate(); + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + WindowFootpathSetProvisionalPathAtPoint(screenCoords); + } + else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) + { + WindowFootpathSetSelectionStartBridgeAtPoint(screenCoords); + } + } + + void OnToolUp(WidgetIndex widgetIndex, const ScreenCoordsXY&) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + _footpathErrorOccured = false; + } + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + WindowFootpathPlacePathAtPoint(screenCoords); + } + else if (widgetIndex == WIDX_CONSTRUCT_BRIDGE_OR_TUNNEL) + { + WindowFootpathStartBridgeAtPoint(screenCoords); + } + } + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_CONSTRUCT_ON_LAND) + { + WindowFootpathPlacePathAtPoint(screenCoords); + } + } + + void OnPrepareDraw() override + { + // Press / unpress footpath and queue type buttons + pressed_widgets &= ~(1uLL << WIDX_FOOTPATH_TYPE); + pressed_widgets &= ~(1uLL << WIDX_QUEUELINE_TYPE); + pressed_widgets |= gFootpathSelection.IsQueueSelected ? (1uLL << WIDX_QUEUELINE_TYPE) + : (1uLL << WIDX_FOOTPATH_TYPE); + + // Enable / disable construct button + window_footpath_widgets[WIDX_CONSTRUCT].type = _footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL + ? WindowWidgetType::ImgBtn + : WindowWidgetType::Empty; + + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::FlatBtn; + } + else + { + window_footpath_widgets[WIDX_RAILINGS_TYPE].type = WindowWidgetType::Empty; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + ScreenCoordsXY screenCoords; + WindowDrawWidgets(*this, dpi); + WindowFootpathDrawDropdownButtons(dpi); + + if (!IsWidgetDisabled(WIDX_CONSTRUCT)) + { + // Get construction image + uint8_t direction = (_footpathConstructDirection + GetCurrentRotation()) % 4; + uint8_t slope = 0; + if (gFootpathConstructSlope == 2) + { + slope = TILE_ELEMENT_SLOPE_N_CORNER_UP; + } + else if (gFootpathConstructSlope == 6) + { + slope = TILE_ELEMENT_SLOPE_E_CORNER_UP; + } + + std::optional baseImage; + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + auto selectedPath = gFootpathSelection.GetSelectedSurface(); + const auto* pathType = GetPathSurfaceEntry(selectedPath); + if (pathType != nullptr) + { + baseImage = pathType->BaseImageId; + } + } + else + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto* pathObj = static_cast( + objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); + if (pathObj != nullptr) + { + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + if (gFootpathSelection.IsQueueSelected) + baseImage = pathEntry->GetQueueImage(); + else + baseImage = pathEntry->image; + } + } + + if (baseImage) + { + auto image = *baseImage + ConstructionPreviewImages[slope][direction]; + + // Draw construction image + screenCoords = this->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 60 }; + GfxDrawSprite(dpi, ImageId(image), screenCoords); + } + + // Draw build this... label + screenCoords = this->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 23 }; + DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); + } + + // Draw cost + screenCoords = this->windowPos + + ScreenCoordsXY{ window_footpath_widgets[WIDX_CONSTRUCT].midX(), + window_footpath_widgets[WIDX_CONSTRUCT].bottom - 12 }; + if (_windowFootpathCost != kMoney64Undefined) + { + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(_windowFootpathCost); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); + } + } + } + +#pragma endregion + + private: + /** + * + * rct2: 0x006A7760 + */ + void WindowFootpathUpdateProvisionalPathForBridgeMode() + { + if (_footpathConstructionMode != PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + { + return; + } + + // Recheck area for construction. Set by ride_construction window + if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_2) + { + FootpathProvisionalRemove(); + gProvisionalFootpath.Flags &= ~PROVISIONAL_PATH_FLAG_2; + } + + // Update provisional bridge mode path + if (!(gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1)) + { + ObjectEntryIndex type; + ObjectEntryIndex railings = gFootpathSelection.Railings; + + CoordsXYZ footpathLoc; + int32_t slope; + FootpathGetNextPathInfo(&type, footpathLoc, &slope); + auto pathConstructFlags = FootpathCreateConstructFlags(type); + + _windowFootpathCost = FootpathProvisionalSet(type, railings, footpathLoc, slope, pathConstructFlags); + WidgetInvalidate(*this, WIDX_CONSTRUCT); + } + + auto curTime = Platform::GetTicks(); + + // Update little directional arrow on provisional bridge mode path + if (_footpathConstructionNextArrowPulse < curTime) + { + _footpathConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; + + gProvisionalFootpath.Flags ^= PROVISIONAL_PATH_FLAG_SHOW_ARROW; + CoordsXYZ footpathLoc; + int32_t slope; + FootpathGetNextPathInfo(nullptr, footpathLoc, &slope); + gMapSelectArrowPosition = footpathLoc; + gMapSelectArrowDirection = _footpathConstructDirection; + if (gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_SHOW_ARROW) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + } + else + { + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + } + MapInvalidateTileFull(footpathLoc); + } + } + + void WindowFootpathDrawDropdownButtons(DrawPixelInfo& dpi) + { + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL) + { + // Set footpath and queue type button images + auto pathImage = static_cast(SPR_NONE); + auto queueImage = static_cast(SPR_NONE); + auto pathEntry = GetPathSurfaceEntry(gFootpathSelection.NormalSurface); + if (pathEntry != nullptr) + { + pathImage = pathEntry->PreviewImageId; + } + + pathEntry = GetPathSurfaceEntry(gFootpathSelection.QueueSurface); + if (pathEntry != nullptr) + { + queueImage = pathEntry->PreviewImageId; + } + + WindowFootpathDrawDropdownButton(dpi, WIDX_FOOTPATH_TYPE, pathImage); + WindowFootpathDrawDropdownButton(dpi, WIDX_QUEUELINE_TYPE, queueImage); + + // Set railing + auto railingsImage = static_cast(SPR_NONE); + auto railingsEntry = GetPathRailingsEntry(gFootpathSelection.Railings); + if (railingsEntry != nullptr) + { + railingsImage = railingsEntry->PreviewImageId; + } + WindowFootpathDrawDropdownButton(dpi, WIDX_RAILINGS_TYPE, railingsImage); + } + else + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + + // Set footpath and queue type button images + auto pathImage = static_cast(SPR_NONE); + auto queueImage = static_cast(SPR_NONE); + auto pathObj = static_cast( + objManager.GetLoadedObject(ObjectType::Paths, gFootpathSelection.LegacyPath)); + if (pathObj != nullptr) + { + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + pathImage = pathEntry->GetPreviewImage(); + queueImage = pathEntry->GetQueuePreviewImage(); + } + + WindowFootpathDrawDropdownButton(dpi, WIDX_FOOTPATH_TYPE, pathImage); + WindowFootpathDrawDropdownButton(dpi, WIDX_QUEUELINE_TYPE, queueImage); + } + } + + void WindowFootpathDrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageIndex image) + { + const auto& widget = widgets[widgetIndex]; + GfxDrawSprite(dpi, ImageId(image), { windowPos.x + widget.left, windowPos.y + widget.top }); + } + + /** + * + * rct2: 0x006A7F88 + */ + void WindowFootpathShowFootpathTypesDialog(Widget* widget, bool showQueues) + { + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + + uint32_t numPathTypes = 0; + // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor + bool showEditorPaths = ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode); + + _dropdownEntries.clear(); + std::optional defaultIndex; + for (ObjectEntryIndex i = 0; i < MAX_FOOTPATH_SURFACE_OBJECTS; i++) + { + const auto* pathType = static_cast( + objManager.GetLoadedObject(ObjectType::FootpathSurface, i)); + if (pathType == nullptr) + { + continue; + } + if ((pathType->Flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + { + continue; + } + // If regular paths can be used as queue, only hide the path if we’re _not_ looking at a queue, + // but the path surface is one. + if (GetGameState().Cheats.AllowRegularPathAsQueue && !showQueues + && ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + continue; + } + // If the cheat is disabled, hide queues from the regular path view and vice versa. + else if ( + !GetGameState().Cheats.AllowRegularPathAsQueue + && showQueues != ((pathType->Flags & FOOTPATH_ENTRY_FLAG_IS_QUEUE) != 0)) + { + continue; + } + + if (gFootpathSelection.LegacyPath == OBJECT_ENTRY_INDEX_NULL + && i == (showQueues ? gFootpathSelection.QueueSurface : gFootpathSelection.NormalSurface)) + { + defaultIndex = numPathTypes; + } + + gDropdownItems[numPathTypes].Format = STR_NONE; + Dropdown::SetImage(numPathTypes, ImageId(pathType->PreviewImageId)); + _dropdownEntries.push_back({ ObjectType::FootpathSurface, i }); + numPathTypes++; + } + + for (ObjectEntryIndex i = 0; i < MAX_PATH_OBJECTS; i++) + { + auto* pathObj = static_cast(objManager.GetLoadedObject(ObjectType::Paths, i)); + if (pathObj == nullptr) + { + continue; + } + + auto pathEntry = reinterpret_cast(pathObj->GetLegacyData()); + if ((pathEntry->flags & FOOTPATH_ENTRY_FLAG_SHOW_ONLY_IN_SCENARIO_EDITOR) && !showEditorPaths) + { + continue; + } + + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL && gFootpathSelection.LegacyPath == i) + { + defaultIndex = numPathTypes; + } + + gDropdownItems[numPathTypes].Format = STR_NONE; + Dropdown::SetImage( + numPathTypes, ImageId(showQueues ? pathEntry->GetQueuePreviewImage() : pathEntry->GetPreviewImage())); + _dropdownEntries.push_back({ ObjectType::Paths, i }); + numPathTypes++; + } + + auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numPathTypes); + WindowDropdownShowImage( + windowPos.x + widget->left, windowPos.y + widget->top, widget->height() + 1, colours[1], 0, numPathTypes, 47, + 36, itemsPerRow); + if (defaultIndex) + gDropdownDefaultIndex = static_cast(*defaultIndex); + } + + void WindowFootpathShowRailingsTypesDialog(Widget* widget) + { + uint32_t numRailingsTypes = 0; + // If the game is in sandbox mode, also show paths that are normally restricted to the scenario editor + + _dropdownEntries.clear(); + std::optional defaultIndex; + for (int32_t i = 0; i < MAX_FOOTPATH_RAILINGS_OBJECTS; i++) + { + const auto* railingsEntry = GetPathRailingsEntry(i); + if (railingsEntry == nullptr) + { + continue; + } + if (i == gFootpathSelection.Railings) + { + defaultIndex = numRailingsTypes; + } + + gDropdownItems[numRailingsTypes].Format = STR_NONE; + Dropdown::SetImage(numRailingsTypes, ImageId(railingsEntry->PreviewImageId)); + _dropdownEntries.push_back({ ObjectType::FootpathRailings, i }); + numRailingsTypes++; + } + + auto itemsPerRow = DropdownGetAppropriateImageDropdownItemsPerRow(numRailingsTypes); + WindowDropdownShowImage( + windowPos.x + widget->left, windowPos.y + widget->top, widget->height() + 1, colours[1], 0, numRailingsTypes, + 47, 36, itemsPerRow); + if (defaultIndex) + gDropdownDefaultIndex = static_cast(*defaultIndex); + } + + /** + * + * rct2: 0x006A8111 0x006A8135 0x006A815C 0x006A8183 + */ + void WindowFootpathMousedownDirection(int32_t direction) + { + FootpathProvisionalUpdate(); + _footpathConstructDirection = (direction - GetCurrentRotation()) & 3; + _windowFootpathCost = kMoney64Undefined; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * + * rct2: 0x006A81AA 0x006A81C5 0x006A81E0 + */ + void WindowFootpathMousedownSlope(int32_t slope) + { + FootpathProvisionalUpdate(); + gFootpathConstructSlope = slope; + _windowFootpathCost = kMoney64Undefined; + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * + * rct2: 0x006A81FB + */ + void WindowFootpathSetProvisionalPathAtPoint(const ScreenCoordsXY& screenCoords) + { + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + auto info = GetMapCoordinatesFromPos( + screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); + + if (info.SpriteType == ViewportInteractionItem::None || info.Element == nullptr) + { + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + FootpathProvisionalUpdate(); + } + else + { + // Check for change + if ((gProvisionalFootpath.Flags & PROVISIONAL_PATH_FLAG_1) + && gProvisionalFootpath.Position == CoordsXYZ{ info.Loc, info.Element->GetBaseZ() }) + { + return; + } + + // Set map selection + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = info.Loc; + gMapSelectPositionB = info.Loc; + + FootpathProvisionalUpdate(); + + // Set provisional path + int32_t slope = 0; + switch (info.SpriteType) + { + case ViewportInteractionItem::Terrain: + { + auto surfaceElement = info.Element->AsSurface(); + if (surfaceElement != nullptr) + { + slope = DefaultPathSlope[surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; + } + break; + } + case ViewportInteractionItem::Footpath: + { + auto pathElement = info.Element->AsPath(); + if (pathElement != nullptr) + { + slope = pathElement->GetSlopeDirection(); + if (pathElement->IsSloped()) + { + slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; + } + } + break; + } + default: + break; + } + auto z = info.Element->GetBaseZ(); + if (slope & RAISE_FOOTPATH_FLAG) + { + slope &= ~RAISE_FOOTPATH_FLAG; + z += PATH_HEIGHT_STEP; + } + + auto pathType = gFootpathSelection.GetSelectedSurface(); + auto constructFlags = FootpathCreateConstructFlags(pathType); + _windowFootpathCost = FootpathProvisionalSet( + pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); + WindowInvalidateByClass(WindowClass::Footpath); + } + } + + /** + * + * rct2: 0x006A8388 + */ + void WindowFootpathSetSelectionStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) + { + int32_t direction; + TileElement* tileElement; + + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); + if (mapCoords.IsNull()) { return; } - // Set map selection gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = info.Loc; - gMapSelectPositionB = info.Loc; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords; + + int32_t z = tileElement->GetBaseZ(); + + if (tileElement->GetType() == TileElementType::Surface) + { + uint8_t slope = tileElement->AsSurface()->GetSlope(); + if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) + { + z += PATH_HEIGHT_STEP; + } // Add 2 for a slope + if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + z += PATH_HEIGHT_STEP; // Add another 2 for a steep slope + } + + gMapSelectArrowPosition = CoordsXYZ{ mapCoords, z }; + gMapSelectArrowDirection = direction; + + MapInvalidateSelectionRect(); + } + + /** + * + * rct2: 0x006A82C5 + */ + void WindowFootpathPlacePathAtPoint(const ScreenCoordsXY& screenCoords) + { + if (_footpathErrorOccured) + { + return; + } FootpathProvisionalUpdate(); - // Set provisional path - int32_t slope = 0; + const auto info = GetMapCoordinatesFromPos( + screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); + + if (info.SpriteType == ViewportInteractionItem::None) + { + return; + } + + // Set path + auto slope = 0; switch (info.SpriteType) { case ViewportInteractionItem::Terrain: - { - auto surfaceElement = info.Element->AsSurface(); - if (surfaceElement != nullptr) - { - slope = DefaultPathSlope[surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; - } + slope = DefaultPathSlope[info.Element->AsSurface()->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; break; - } case ViewportInteractionItem::Footpath: - { - auto pathElement = info.Element->AsPath(); - if (pathElement != nullptr) + slope = info.Element->AsPath()->GetSlopeDirection(); + if (info.Element->AsPath()->IsSloped()) { - slope = pathElement->GetSlopeDirection(); - if (pathElement->IsSloped()) - { - slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; - } + slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; } break; - } default: break; } @@ -842,680 +939,584 @@ private: z += PATH_HEIGHT_STEP; } - auto pathType = gFootpathSelection.GetSelectedSurface(); - auto constructFlags = FootpathCreateConstructFlags(pathType); - _windowFootpathCost = FootpathProvisionalSet( - pathType, gFootpathSelection.Railings, { info.Loc, z }, slope, constructFlags); - WindowInvalidateByClass(WindowClass::Footpath); - } - } + // Try and place path + auto selectedType = gFootpathSelection.GetSelectedSurface(); + PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); - /** - * - * rct2: 0x006A8388 - */ - void WindowFootpathSetSelectionStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) - { - int32_t direction; - TileElement* tileElement; - - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); - if (mapCoords.IsNull()) - { - return; - } - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords; - - int32_t z = tileElement->GetBaseZ(); - - if (tileElement->GetType() == TileElementType::Surface) - { - uint8_t slope = tileElement->AsSurface()->GetSlope(); - if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - z += PATH_HEIGHT_STEP; - } // Add 2 for a slope - if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - z += PATH_HEIGHT_STEP; // Add another 2 for a steep slope - } - - gMapSelectArrowPosition = CoordsXYZ{ mapCoords, z }; - gMapSelectArrowDirection = direction; - - MapInvalidateSelectionRect(); - } - - /** - * - * rct2: 0x006A82C5 - */ - void WindowFootpathPlacePathAtPoint(const ScreenCoordsXY& screenCoords) - { - if (_footpathErrorOccured) - { - return; - } - - FootpathProvisionalUpdate(); - - const auto info = GetMapCoordinatesFromPos( - screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Footpath)); - - if (info.SpriteType == ViewportInteractionItem::None) - { - return; - } - - // Set path - auto slope = 0; - switch (info.SpriteType) - { - case ViewportInteractionItem::Terrain: - slope = DefaultPathSlope[info.Element->AsSurface()->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; - break; - case ViewportInteractionItem::Footpath: - slope = info.Element->AsPath()->GetSlopeDirection(); - if (info.Element->AsPath()->IsSloped()) + auto footpathPlaceAction = FootpathPlaceAction( + { info.Loc, z }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags); + footpathPlaceAction.SetCallback([this](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) { - slope |= FOOTPATH_PROPERTIES_FLAG_IS_SLOPED; - } - break; - default: - break; - } - auto z = info.Element->GetBaseZ(); - if (slope & RAISE_FOOTPATH_FLAG) - { - slope &= ~RAISE_FOOTPATH_FLAG; - z += PATH_HEIGHT_STEP; - } - - // Try and place path - auto selectedType = gFootpathSelection.GetSelectedSurface(); - PathConstructFlags constructFlags = FootpathCreateConstructFlags(selectedType); - - auto footpathPlaceAction = FootpathPlaceAction( - { info.Loc, z }, slope, selectedType, gFootpathSelection.Railings, INVALID_DIRECTION, constructFlags); - footpathPlaceAction.SetCallback([this](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios - if (result->Cost != 0) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - } - } - else - { - _footpathErrorOccured = true; - } - }); - GameActions::Execute(&footpathPlaceAction); - } - - /** - * - * rct2: 0x006A840F - */ - void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) - { - int32_t z, direction; - TileElement* tileElement; - - auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); - if (mapCoords.IsNull()) - { - return; - } - - if (tileElement->GetType() == TileElementType::Surface) - { - // If we start the path on a slope, the arrow is slightly raised, so we - // expect the path to be slightly raised as well. - uint8_t slope = tileElement->AsSurface()->GetSlope(); - z = tileElement->GetBaseZ(); - if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - { - // Steep diagonal slope - z += 2 * PATH_HEIGHT_STEP; - } - else if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - // Normal slope - z += PATH_HEIGHT_STEP; - } - } - else - { - z = tileElement->GetBaseZ(); - if (tileElement->GetType() == TileElementType::Path) - { - if (tileElement->AsPath()->IsSloped()) - { - if (direction == (tileElement->AsPath()->GetSlopeDirection())) + // Don't play sound if it is no cost to prevent multiple sounds. TODO: make this work in no money scenarios + if (result->Cost != 0) { - z += PATH_HEIGHT_STEP; + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } } - } - } - - ToolCancel(); - gFootpathConstructFromPosition = { mapCoords, z }; - _footpathConstructDirection = direction; - gProvisionalFootpath.Flags = 0; - gFootpathConstructSlope = 0; - _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; - _footpathConstructValidDirections = INVALID_DIRECTION; - WindowFootpathSetEnabledAndPressedWidgets(); - } - - /** - * Construct a piece of footpath while in bridge building mode. - * rct2: 0x006A79B7 - */ - void WindowFootpathConstruct() - { - _windowFootpathCost = kMoney64Undefined; - FootpathProvisionalUpdate(); - - ObjectEntryIndex type; - int32_t slope; - CoordsXYZ footpathLoc; - FootpathGetNextPathInfo(&type, footpathLoc, &slope); - - PathConstructFlags constructFlags = FootpathCreateConstructFlags(type); - - auto footpathPlaceAction = FootpathPlaceAction( - footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); - - footpathPlaceAction.SetCallback([footpathLoc](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - } - - auto* self = static_cast(WindowFindByClass(WindowClass::Footpath)); - if (self == nullptr) - { - return; - } - - if (result->Error == GameActions::Status::Ok) - { - if (gFootpathConstructSlope == 0) - { - self->_footpathConstructValidDirections = INVALID_DIRECTION; - } else { - self->_footpathConstructValidDirections = self->_footpathConstructDirection; + _footpathErrorOccured = true; } - - if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND) - { - ViewportSetVisibility(ViewportVisibility::UndergroundViewOn); - } - - gFootpathConstructFromPosition = footpathLoc; - // If we have just built an upwards slope, the next path to construct is - // a bit higher. Note that the z returned by footpath_get_next_path_info - // already is lowered if we are building a downwards slope. - if (gFootpathConstructSlope == 2) - { - gFootpathConstructFromPosition.z += PATH_HEIGHT_STEP; - } - } - self->WindowFootpathSetEnabledAndPressedWidgets(); - }); - GameActions::Execute(&footpathPlaceAction); - } - - /** - * - * rct2: 0x006A78EF - */ - void FootpathRemoveTileElement(TileElement* tileElement) - { - auto z = tileElement->GetBaseZ(); - if (tileElement->AsPath()->IsSloped()) - { - uint8_t slopeDirection = tileElement->AsPath()->GetSlopeDirection(); - slopeDirection = DirectionReverse(slopeDirection); - if (slopeDirection == _footpathConstructDirection) - { - z += PATH_HEIGHT_STEP; - } + }); + GameActions::Execute(&footpathPlaceAction); } - // Find a connected edge - int32_t edge = DirectionReverse(_footpathConstructDirection); - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + /** + * + * rct2: 0x006A840F + */ + void WindowFootpathStartBridgeAtPoint(const ScreenCoordsXY& screenCoords) { - edge = (edge + 1) & 3; - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + int32_t z, direction; + TileElement* tileElement; + + auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); + if (mapCoords.IsNull()) { - edge = (edge + 2) & 3; - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) - { - edge = (edge - 1) & 3; - if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) - { - edge = DirectionReverse(edge); - } - } + return; } - } - gFootpathConstructFromPosition.z = tileElement->GetBaseZ(); - auto action = FootpathRemoveAction(gFootpathConstructFromPosition); - GameActions::Execute(&action); - - // Move selection - edge = DirectionReverse(edge); - gFootpathConstructFromPosition.x -= CoordsDirectionDelta[edge].x; - gFootpathConstructFromPosition.y -= CoordsDirectionDelta[edge].y; - gFootpathConstructFromPosition.z = z; - _footpathConstructDirection = edge; - _footpathConstructValidDirections = INVALID_DIRECTION; - } - - /** - * - * rct2: 0x006A7873 - */ - TileElement* FootpathGetTileElementToRemove() - { - TileElement* tileElement; - int32_t z, zLow; - - if (!MapIsLocationValid(gFootpathConstructFromPosition)) - { - return nullptr; - } - - z = std::min(255 * COORDS_Z_STEP, gFootpathConstructFromPosition.z); - zLow = z - PATH_HEIGHT_STEP; - - tileElement = MapGetFirstElementAt(gFootpathConstructFromPosition); - do - { - if (tileElement == nullptr) - break; - if (tileElement->GetType() == TileElementType::Path) + if (tileElement->GetType() == TileElementType::Surface) { - if (tileElement->GetBaseZ() == z) + // If we start the path on a slope, the arrow is slightly raised, so we + // expect the path to be slightly raised as well. + uint8_t slope = tileElement->AsSurface()->GetSlope(); + z = tileElement->GetBaseZ(); + if (slope & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) { - if (tileElement->AsPath()->IsSloped()) - { - if (DirectionReverse(tileElement->AsPath()->GetSlopeDirection()) != _footpathConstructDirection) - { - continue; - } - } - - return tileElement; + // Steep diagonal slope + z += 2 * PATH_HEIGHT_STEP; } - if (tileElement->GetBaseZ() == zLow) + else if (slope & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { - if (!tileElement->AsPath()->IsSloped()) - { - if ((tileElement->AsPath()->GetSlopeDirection()) == _footpathConstructDirection) - { - continue; - } - } - - return tileElement; + // Normal slope + z += PATH_HEIGHT_STEP; } } - } while (!(tileElement++)->IsLastForTile()); - - return nullptr; - } - - /** - * - * rct2: 0x006A7863 - */ - void WindowFootpathRemove() - { - TileElement* tileElement; - - _windowFootpathCost = kMoney64Undefined; - FootpathProvisionalUpdate(); - - tileElement = FootpathGetTileElementToRemove(); - if (tileElement != nullptr) - { - FootpathRemoveTileElement(tileElement); - } - - WindowFootpathSetEnabledAndPressedWidgets(); - } - - /** - * - * rct2: 0x006A855C - */ - void WindowFootpathSetEnabledAndPressedWidgets() - { - if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) - { - MapInvalidateMapSelectionTiles(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; - - int32_t direction = _footpathConstructDirection; - gMapSelectionTiles.clear(); - gMapSelectionTiles.push_back({ gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, - gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); - MapInvalidateMapSelectionTiles(); - } - - uint64_t pressedWidgets = pressed_widgets - & ~((1LL << WIDX_DIRECTION_NW) | (1LL << WIDX_DIRECTION_NE) | (1LL << WIDX_DIRECTION_SW) - | (1LL << WIDX_DIRECTION_SE) | (1LL << WIDX_SLOPEDOWN) | (1LL << WIDX_LEVEL) | (1LL << WIDX_SLOPEUP)); - uint64_t disabledWidgets = 0; - int32_t currentRotation = GetCurrentRotation(); - if (_footpathConstructionMode >= PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) - { - // Set pressed directional widget - int32_t direction = (_footpathConstructDirection + currentRotation) & 3; - pressedWidgets |= (1LL << (WIDX_DIRECTION_NW + direction)); - - // Set pressed slope widget - int32_t slope = gFootpathConstructSlope; - if (slope == TILE_ELEMENT_SLOPE_SE_SIDE_UP) - { - pressedWidgets |= (1uLL << WIDX_SLOPEDOWN); - } - else if (slope == TILE_ELEMENT_SLOPE_FLAT) - { - pressedWidgets |= (1uLL << WIDX_LEVEL); - } else { - pressedWidgets |= (1uLL << WIDX_SLOPEUP); + z = tileElement->GetBaseZ(); + if (tileElement->GetType() == TileElementType::Path) + { + if (tileElement->AsPath()->IsSloped()) + { + if (direction == (tileElement->AsPath()->GetSlopeDirection())) + { + z += PATH_HEIGHT_STEP; + } + } + } } - // Enable / disable directional widgets - direction = _footpathConstructValidDirections; - if (direction != INVALID_DIRECTION) - { - disabledWidgets |= (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) | (1uLL << WIDX_DIRECTION_SW) - | (1uLL << WIDX_DIRECTION_SE); - - direction = (direction + currentRotation) & 3; - disabledWidgets &= ~(1 << (WIDX_DIRECTION_NW + direction)); - } + ToolCancel(); + gFootpathConstructFromPosition = { mapCoords, z }; + _footpathConstructDirection = direction; + gProvisionalFootpath.Flags = 0; + gFootpathConstructSlope = 0; + _footpathConstructionMode = PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL; + _footpathConstructValidDirections = INVALID_DIRECTION; + WindowFootpathSetEnabledAndPressedWidgets(); } - else + + /** + * Construct a piece of footpath while in bridge building mode. + * rct2: 0x006A79B7 + */ + void WindowFootpathConstruct() { - // Disable all bridge mode widgets - disabledWidgets |= (1uLL << WIDX_DIRECTION_GROUP) | (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) - | (1uLL << WIDX_DIRECTION_SW) | (1uLL << WIDX_DIRECTION_SE) | (1uLL << WIDX_SLOPE_GROUP) - | (1uLL << WIDX_SLOPEDOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPEUP) | (1uLL << WIDX_CONSTRUCT) - | (1uLL << WIDX_REMOVE); + _windowFootpathCost = kMoney64Undefined; + FootpathProvisionalUpdate(); + + ObjectEntryIndex type; + int32_t slope; + CoordsXYZ footpathLoc; + FootpathGetNextPathInfo(&type, footpathLoc, &slope); + + PathConstructFlags constructFlags = FootpathCreateConstructFlags(type); + + auto footpathPlaceAction = FootpathPlaceAction( + footpathLoc, slope, type, gFootpathSelection.Railings, _footpathConstructDirection, constructFlags); + + footpathPlaceAction.SetCallback([footpathLoc](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + } + + auto* self = static_cast(WindowFindByClass(WindowClass::Footpath)); + if (self == nullptr) + { + return; + } + + if (result->Error == GameActions::Status::Ok) + { + if (gFootpathConstructSlope == 0) + { + self->_footpathConstructValidDirections = INVALID_DIRECTION; + } + else + { + self->_footpathConstructValidDirections = self->_footpathConstructDirection; + } + + if (gFootpathGroundFlags & ELEMENT_IS_UNDERGROUND) + { + ViewportSetVisibility(ViewportVisibility::UndergroundViewOn); + } + + gFootpathConstructFromPosition = footpathLoc; + // If we have just built an upwards slope, the next path to construct is + // a bit higher. Note that the z returned by footpath_get_next_path_info + // already is lowered if we are building a downwards slope. + if (gFootpathConstructSlope == 2) + { + gFootpathConstructFromPosition.z += PATH_HEIGHT_STEP; + } + } + self->WindowFootpathSetEnabledAndPressedWidgets(); + }); + GameActions::Execute(&footpathPlaceAction); } - pressed_widgets = pressedWidgets; - disabled_widgets = disabledWidgets; - Invalidate(); - } + /** + * + * rct2: 0x006A78EF + */ + void FootpathRemoveTileElement(TileElement* tileElement) + { + auto z = tileElement->GetBaseZ(); + if (tileElement->AsPath()->IsSloped()) + { + uint8_t slopeDirection = tileElement->AsPath()->GetSlopeDirection(); + slopeDirection = DirectionReverse(slopeDirection); + if (slopeDirection == _footpathConstructDirection) + { + z += PATH_HEIGHT_STEP; + } + } + + // Find a connected edge + int32_t edge = DirectionReverse(_footpathConstructDirection); + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = (edge + 1) & 3; + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = (edge + 2) & 3; + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = (edge - 1) & 3; + if (!(tileElement->AsPath()->GetEdges() & (1 << edge))) + { + edge = DirectionReverse(edge); + } + } + } + } + + gFootpathConstructFromPosition.z = tileElement->GetBaseZ(); + auto action = FootpathRemoveAction(gFootpathConstructFromPosition); + GameActions::Execute(&action); + + // Move selection + edge = DirectionReverse(edge); + gFootpathConstructFromPosition.x -= CoordsDirectionDelta[edge].x; + gFootpathConstructFromPosition.y -= CoordsDirectionDelta[edge].y; + gFootpathConstructFromPosition.z = z; + _footpathConstructDirection = edge; + _footpathConstructValidDirections = INVALID_DIRECTION; + } + + /** + * + * rct2: 0x006A7873 + */ + TileElement* FootpathGetTileElementToRemove() + { + TileElement* tileElement; + int32_t z, zLow; + + if (!MapIsLocationValid(gFootpathConstructFromPosition)) + { + return nullptr; + } + + z = std::min(255 * COORDS_Z_STEP, gFootpathConstructFromPosition.z); + zLow = z - PATH_HEIGHT_STEP; + + tileElement = MapGetFirstElementAt(gFootpathConstructFromPosition); + do + { + if (tileElement == nullptr) + break; + if (tileElement->GetType() == TileElementType::Path) + { + if (tileElement->GetBaseZ() == z) + { + if (tileElement->AsPath()->IsSloped()) + { + if (DirectionReverse(tileElement->AsPath()->GetSlopeDirection()) != _footpathConstructDirection) + { + continue; + } + } + + return tileElement; + } + if (tileElement->GetBaseZ() == zLow) + { + if (!tileElement->AsPath()->IsSloped()) + { + if ((tileElement->AsPath()->GetSlopeDirection()) == _footpathConstructDirection) + { + continue; + } + } + + return tileElement; + } + } + } while (!(tileElement++)->IsLastForTile()); + + return nullptr; + } + + /** + * + * rct2: 0x006A7863 + */ + void WindowFootpathRemove() + { + TileElement* tileElement; + + _windowFootpathCost = kMoney64Undefined; + FootpathProvisionalUpdate(); + + tileElement = FootpathGetTileElementToRemove(); + if (tileElement != nullptr) + { + FootpathRemoveTileElement(tileElement); + } + + WindowFootpathSetEnabledAndPressedWidgets(); + } + + /** + * + * rct2: 0x006A855C + */ + void WindowFootpathSetEnabledAndPressedWidgets() + { + if (_footpathConstructionMode == PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + { + MapInvalidateMapSelectionTiles(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; + + int32_t direction = _footpathConstructDirection; + gMapSelectionTiles.clear(); + gMapSelectionTiles.push_back({ gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x, + gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y }); + MapInvalidateMapSelectionTiles(); + } + + uint64_t pressedWidgets = pressed_widgets + & ~((1LL << WIDX_DIRECTION_NW) | (1LL << WIDX_DIRECTION_NE) | (1LL << WIDX_DIRECTION_SW) + | (1LL << WIDX_DIRECTION_SE) | (1LL << WIDX_SLOPEDOWN) | (1LL << WIDX_LEVEL) | (1LL << WIDX_SLOPEUP)); + uint64_t disabledWidgets = 0; + int32_t currentRotation = GetCurrentRotation(); + if (_footpathConstructionMode >= PATH_CONSTRUCTION_MODE_BRIDGE_OR_TUNNEL) + { + // Set pressed directional widget + int32_t direction = (_footpathConstructDirection + currentRotation) & 3; + pressedWidgets |= (1LL << (WIDX_DIRECTION_NW + direction)); + + // Set pressed slope widget + int32_t slope = gFootpathConstructSlope; + if (slope == TILE_ELEMENT_SLOPE_SE_SIDE_UP) + { + pressedWidgets |= (1uLL << WIDX_SLOPEDOWN); + } + else if (slope == TILE_ELEMENT_SLOPE_FLAT) + { + pressedWidgets |= (1uLL << WIDX_LEVEL); + } + else + { + pressedWidgets |= (1uLL << WIDX_SLOPEUP); + } + + // Enable / disable directional widgets + direction = _footpathConstructValidDirections; + if (direction != INVALID_DIRECTION) + { + disabledWidgets |= (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) | (1uLL << WIDX_DIRECTION_SW) + | (1uLL << WIDX_DIRECTION_SE); + + direction = (direction + currentRotation) & 3; + disabledWidgets &= ~(1 << (WIDX_DIRECTION_NW + direction)); + } + } + else + { + // Disable all bridge mode widgets + disabledWidgets |= (1uLL << WIDX_DIRECTION_GROUP) | (1uLL << WIDX_DIRECTION_NW) | (1uLL << WIDX_DIRECTION_NE) + | (1uLL << WIDX_DIRECTION_SW) | (1uLL << WIDX_DIRECTION_SE) | (1uLL << WIDX_SLOPE_GROUP) + | (1uLL << WIDX_SLOPEDOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPEUP) | (1uLL << WIDX_CONSTRUCT) + | (1uLL << WIDX_REMOVE); + } + + pressed_widgets = pressedWidgets; + disabled_widgets = disabledWidgets; + Invalidate(); + } + + /** + * + * rct2: 0x006A7B20 + */ + void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope) + { + auto direction = _footpathConstructDirection; + footpathLoc.x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x; + footpathLoc.y = gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y; + footpathLoc.z = gFootpathConstructFromPosition.z; + if (type != nullptr) + { + *type = gFootpathSelection.GetSelectedSurface(); + } + *slope = TILE_ELEMENT_SLOPE_FLAT; + if (gFootpathConstructSlope != 0) + { + *slope = _footpathConstructDirection | TILE_ELEMENT_SLOPE_S_CORNER_UP; + if (gFootpathConstructSlope != 2) + { + footpathLoc.z -= PATH_HEIGHT_STEP; + *slope ^= TILE_ELEMENT_SLOPE_E_CORNER_UP; + } + } + } + + PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type) + { + PathConstructFlags pathConstructFlags = 0; + if (gFootpathSelection.IsQueueSelected) + pathConstructFlags |= PathConstructFlag::IsQueue; + if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + { + pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; + type = gFootpathSelection.LegacyPath; + } + return pathConstructFlags; + } + +#pragma region Keyboard Shortcuts Events + public: + void KeyboardShortcutTurnLeft() + { + if (IsWidgetDisabled(WIDX_DIRECTION_NW) || IsWidgetDisabled(WIDX_DIRECTION_NE) + || IsWidgetDisabled(WIDX_DIRECTION_SW) || IsWidgetDisabled(WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) + { + return; + } + int32_t currentRotation = GetCurrentRotation(); + int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? 1 : -1); + WindowFootpathMousedownDirection(turnedRotation); + } + + void KeyboardShortcutTurnRight() + { + if (IsWidgetDisabled(WIDX_DIRECTION_NW) || IsWidgetDisabled(WIDX_DIRECTION_NE) + || IsWidgetDisabled(WIDX_DIRECTION_SW) || IsWidgetDisabled(WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) + { + return; + } + int32_t currentRotation = GetCurrentRotation(); + int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? -1 : 1); + WindowFootpathMousedownDirection(turnedRotation); + } + + void KeyboardShortcutShortcutSlopeDown() + { + if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) + || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + { + return; + } + + switch (gFootpathConstructSlope) + { + case 0: + OnMouseDown(WIDX_SLOPEDOWN); + break; + case 2: + OnMouseDown(WIDX_LEVEL); + break; + default: + case 6: + return; + } + } + + void KeyboardShortcutSlopeUp() + { + if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) + || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + { + return; + } + + switch (gFootpathConstructSlope) + { + case 6: + OnMouseDown(WIDX_LEVEL); + break; + case 0: + OnMouseDown(WIDX_SLOPEUP); + break; + default: + case 2: + return; + } + } + + void KeyboardShortcutSlopeLevel() + { + if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) + || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty || gFootpathConstructSlope == 0) + { + return; + } + + OnMouseDown(WIDX_LEVEL); + } + + void KeyboardShortcutDemolishCurrent() + { + if (IsWidgetDisabled(WIDX_REMOVE) || widgets[WIDX_REMOVE].type == WindowWidgetType::Empty + || (!GetGameState().Cheats.BuildInPauseMode && GameIsPaused())) + { + return; + } + + WindowFootpathRemove(); + } + + void KeyboardShortcutBuildCurrent() + { + if (IsWidgetDisabled(WIDX_CONSTRUCT) || widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) + { + return; + } + + OnMouseUp(WIDX_CONSTRUCT); + } + + void OnResize() override + { + ResizeFrame(); + } + +#pragma endregion + }; /** * - * rct2: 0x006A7B20 + * rct2: 0x006A7C43 */ - void FootpathGetNextPathInfo(ObjectEntryIndex* type, CoordsXYZ& footpathLoc, int32_t* slope) + WindowBase* WindowFootpathOpen() { - auto direction = _footpathConstructDirection; - footpathLoc.x = gFootpathConstructFromPosition.x + CoordsDirectionDelta[direction].x; - footpathLoc.y = gFootpathConstructFromPosition.y + CoordsDirectionDelta[direction].y; - footpathLoc.z = gFootpathConstructFromPosition.z; - if (type != nullptr) + if (!FootpathSelectDefault()) { - *type = gFootpathSelection.GetSelectedSurface(); + // No path objects to select from, don't open window + return nullptr; } - *slope = TILE_ELEMENT_SLOPE_FLAT; - if (gFootpathConstructSlope != 0) + + return WindowFocusOrCreate(WindowClass::Footpath, WW_WINDOW, WH_WINDOW, 0); + } + + void WindowFootpathResetSelectedPath() + { + gFootpathSelection = {}; + } + + void WindowFootpathKeyboardShortcutTurnLeft() + { + WindowBase* w = WindowFindByClass(WindowClass::Footpath); + if (w != nullptr) { - *slope = _footpathConstructDirection | TILE_ELEMENT_SLOPE_S_CORNER_UP; - if (gFootpathConstructSlope != 2) + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) { - footpathLoc.z -= PATH_HEIGHT_STEP; - *slope ^= TILE_ELEMENT_SLOPE_E_CORNER_UP; + footpathWindow->KeyboardShortcutTurnLeft(); } } } - PathConstructFlags FootpathCreateConstructFlags(ObjectEntryIndex& type) + void WindowFootpathKeyboardShortcutTurnRight() { - PathConstructFlags pathConstructFlags = 0; - if (gFootpathSelection.IsQueueSelected) - pathConstructFlags |= PathConstructFlag::IsQueue; - if (gFootpathSelection.LegacyPath != OBJECT_ENTRY_INDEX_NULL) + WindowBase* w = WindowFindByClass(WindowClass::Footpath); + if (w != nullptr) { - pathConstructFlags |= PathConstructFlag::IsLegacyPathObject; - type = gFootpathSelection.LegacyPath; - } - return pathConstructFlags; - } - -#pragma region Keyboard Shortcuts Events -public: - void KeyboardShortcutTurnLeft() - { - if (IsWidgetDisabled(WIDX_DIRECTION_NW) || IsWidgetDisabled(WIDX_DIRECTION_NE) || IsWidgetDisabled(WIDX_DIRECTION_SW) - || IsWidgetDisabled(WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) - { - return; - } - int32_t currentRotation = GetCurrentRotation(); - int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? 1 : -1); - WindowFootpathMousedownDirection(turnedRotation); - } - - void KeyboardShortcutTurnRight() - { - if (IsWidgetDisabled(WIDX_DIRECTION_NW) || IsWidgetDisabled(WIDX_DIRECTION_NE) || IsWidgetDisabled(WIDX_DIRECTION_SW) - || IsWidgetDisabled(WIDX_DIRECTION_SE) || _footpathConstructionMode != 2) - { - return; - } - int32_t currentRotation = GetCurrentRotation(); - int32_t turnedRotation = _footpathConstructDirection - currentRotation + (currentRotation % 2 == 1 ? -1 : 1); - WindowFootpathMousedownDirection(turnedRotation); - } - - void KeyboardShortcutShortcutSlopeDown() - { - if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) - || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) - { - return; - } - - switch (gFootpathConstructSlope) - { - case 0: - OnMouseDown(WIDX_SLOPEDOWN); - break; - case 2: - OnMouseDown(WIDX_LEVEL); - break; - default: - case 6: - return; + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutTurnRight(); + } } } - void KeyboardShortcutSlopeUp() + void WindowFootpathKeyboardShortcutSlopeDown() { - if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) - || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty) + WindowBase* w = WindowFindByClass(WindowClass::Footpath); + if (w != nullptr) { - return; - } - - switch (gFootpathConstructSlope) - { - case 6: - OnMouseDown(WIDX_LEVEL); - break; - case 0: - OnMouseDown(WIDX_SLOPEUP); - break; - default: - case 2: - return; + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutShortcutSlopeDown(); + } } } - void KeyboardShortcutSlopeLevel() + void WindowFootpathKeyboardShortcutSlopeUp() { - if (IsWidgetDisabled(WIDX_SLOPEDOWN) || IsWidgetDisabled(WIDX_LEVEL) || IsWidgetDisabled(WIDX_SLOPEUP) - || widgets[WIDX_LEVEL].type == WindowWidgetType::Empty || gFootpathConstructSlope == 0) + WindowBase* w = WindowFindByClass(WindowClass::Footpath); + if (w != nullptr) { - return; - } - - OnMouseDown(WIDX_LEVEL); - } - - void KeyboardShortcutDemolishCurrent() - { - if (IsWidgetDisabled(WIDX_REMOVE) || widgets[WIDX_REMOVE].type == WindowWidgetType::Empty - || (!GetGameState().Cheats.BuildInPauseMode && GameIsPaused())) - { - return; - } - - WindowFootpathRemove(); - } - - void KeyboardShortcutBuildCurrent() - { - if (IsWidgetDisabled(WIDX_CONSTRUCT) || widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) - { - return; - } - - OnMouseUp(WIDX_CONSTRUCT); - } - - void OnResize() override - { - ResizeFrame(); - } - -#pragma endregion -}; - -/** - * - * rct2: 0x006A7C43 - */ -WindowBase* WindowFootpathOpen() -{ - if (!FootpathSelectDefault()) - { - // No path objects to select from, don't open window - return nullptr; - } - - return WindowFocusOrCreate(WindowClass::Footpath, WW_WINDOW, WH_WINDOW, 0); -} - -void WindowFootpathResetSelectedPath() -{ - gFootpathSelection = {}; -} - -void WindowFootpathKeyboardShortcutTurnLeft() -{ - WindowBase* w = WindowFindByClass(WindowClass::Footpath); - if (w != nullptr) - { - auto* footpathWindow = static_cast(w); - if (footpathWindow != nullptr) - { - footpathWindow->KeyboardShortcutTurnLeft(); + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutSlopeUp(); + } } } -} -void WindowFootpathKeyboardShortcutTurnRight() -{ - WindowBase* w = WindowFindByClass(WindowClass::Footpath); - if (w != nullptr) + void WindowFootpathKeyboardShortcutDemolishCurrent() { - auto* footpathWindow = static_cast(w); - if (footpathWindow != nullptr) + WindowBase* w = WindowFindByClass(WindowClass::Footpath); + if (w != nullptr) { - footpathWindow->KeyboardShortcutTurnRight(); + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutDemolishCurrent(); + } } } -} -void WindowFootpathKeyboardShortcutSlopeDown() -{ - WindowBase* w = WindowFindByClass(WindowClass::Footpath); - if (w != nullptr) + void WindowFootpathKeyboardShortcutBuildCurrent() { - auto* footpathWindow = static_cast(w); - if (footpathWindow != nullptr) + WindowBase* w = WindowFindByClass(WindowClass::Footpath); + if (w != nullptr) { - footpathWindow->KeyboardShortcutShortcutSlopeDown(); + auto* footpathWindow = static_cast(w); + if (footpathWindow != nullptr) + { + footpathWindow->KeyboardShortcutBuildCurrent(); + } } } -} - -void WindowFootpathKeyboardShortcutSlopeUp() -{ - WindowBase* w = WindowFindByClass(WindowClass::Footpath); - if (w != nullptr) - { - auto* footpathWindow = static_cast(w); - if (footpathWindow != nullptr) - { - footpathWindow->KeyboardShortcutSlopeUp(); - } - } -} - -void WindowFootpathKeyboardShortcutDemolishCurrent() -{ - WindowBase* w = WindowFindByClass(WindowClass::Footpath); - if (w != nullptr) - { - auto* footpathWindow = static_cast(w); - if (footpathWindow != nullptr) - { - footpathWindow->KeyboardShortcutDemolishCurrent(); - } - } -} - -void WindowFootpathKeyboardShortcutBuildCurrent() -{ - WindowBase* w = WindowFindByClass(WindowClass::Footpath); - if (w != nullptr) - { - auto* footpathWindow = static_cast(w); - if (footpathWindow != nullptr) - { - footpathWindow->KeyboardShortcutBuildCurrent(); - } - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index 42453791d0..e78c49cfe3 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -29,9 +29,9 @@ #include #include -using namespace OpenRCT2; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowGameBottomToolbarWidgetIdx { WIDX_LEFT_OUTSET, @@ -68,630 +68,631 @@ static Widget window_game_bottom_toolbar_widgets[] = MakeWidget({500, 2}, {138, 12}, WindowWidgetType::FlatBtn, WindowColour::Primary ), // Date kWidgetsEnd, }; + // clang-format on -uint8_t gToolbarDirtyFlags; + uint8_t gToolbarDirtyFlags; -class GameBottomToolbar final : public Window -{ -private: - - void DrawLeftPanel(DrawPixelInfo &dpi) + class GameBottomToolbar final : public Window { - const auto topLeft = windowPos - + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1, - window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + 1 }; - const auto bottomRight = windowPos - + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1, - window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1 }; - // Draw green inset rectangle on panel - GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); - - // Figure out how much line height we have to work with. - uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - - auto& gameState = GetGameState(); - - // Draw money - if (!(gameState.ParkFlags & PARK_FLAGS_NO_MONEY)) + private: + void DrawLeftPanel(DrawPixelInfo& dpi) { - Widget widget = window_game_bottom_toolbar_widgets[WIDX_MONEY]; - auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(), - windowPos.y + widget.midY() - (line_height == 10 ? 5 : 6) }; + const auto topLeft = windowPos + + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].left + 1, + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].top + 1 }; + const auto bottomRight = windowPos + + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].right - 1, + window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET].bottom - 1 }; + // Draw green inset rectangle on panel + GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + + // Figure out how much line height we have to work with. + uint32_t line_height = FontGetLineHeight(FontStyle::Medium); + + auto& gameState = GetGameState(); + + // Draw money + if (!(gameState.ParkFlags & PARK_FLAGS_NO_MONEY)) + { + Widget widget = window_game_bottom_toolbar_widgets[WIDX_MONEY]; + auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(), + windowPos.y + widget.midY() - (line_height == 10 ? 5 : 6) }; + + colour_t colour + = (gHoverWidget.window_classification == WindowClass::BottomToolbar + && gHoverWidget.widget_index == WIDX_MONEY + ? COLOUR_WHITE + : NOT_TRANSLUCENT(colours[0])); + StringId stringId = gameState.Cash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH; + auto ft = Formatter(); + ft.Add(gameState.Cash); + DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); + } + + static constexpr StringId _guestCountFormats[] = { + STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE, + STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE, + STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE, + }; + + static constexpr StringId _guestCountFormatsSingular[] = { + STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE_SINGULAR, + STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE_SINGULAR, + STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE_SINGULAR, + }; + + // Draw guests + { + Widget widget = window_game_bottom_toolbar_widgets[WIDX_GUESTS]; + auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(), windowPos.y + widget.midY() - 6 }; + + StringId stringId = gameState.NumGuestsInPark == 1 ? _guestCountFormatsSingular[gameState.GuestChangeModifier] + : _guestCountFormats[gameState.GuestChangeModifier]; + colour_t colour + = (gHoverWidget.window_classification == WindowClass::BottomToolbar + && gHoverWidget.widget_index == WIDX_GUESTS + ? COLOUR_WHITE + : NOT_TRANSLUCENT(colours[0])); + auto ft = Formatter(); + ft.Add(gameState.NumGuestsInPark); + DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); + } + + // Draw park rating + { + Widget widget = window_game_bottom_toolbar_widgets[WIDX_PARK_RATING]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 11, widget.midY() - 5 }; + + DrawParkRating(dpi, colours[3], screenCoords, std::max(10, ((gameState.ParkRating / 4) * 263) / 256)); + } + } + + void DrawParkRating(DrawPixelInfo& dpi, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor) + { + int16_t bar_width = (factor * 114) / 255; + GfxFillRectInset( + dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, colours[1], INSET_RECT_F_30); + if (!(colour & kBarBlink) || GameIsPaused() || (gCurrentRealTimeTicks & 8)) + { + if (bar_width > 2) + { + GfxFillRectInset( + dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0); + } + } + + // Draw thumbs on the sides + GfxDrawSprite(dpi, ImageId(SPR_RATING_LOW), coords - ScreenCoordsXY{ 14, 0 }); + GfxDrawSprite(dpi, ImageId(SPR_RATING_HIGH), coords + ScreenCoordsXY{ 114, 0 }); + } + + void DrawRightPanel(DrawPixelInfo& dpi) + { + const auto topLeft = windowPos + + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1, + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + 1 }; + const auto bottomRight = windowPos + + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1, + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1 }; + // Draw green inset rectangle on panel + GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); + + auto screenCoords = ScreenCoordsXY{ (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right) + / 2 + + windowPos.x, + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + windowPos.y + 2 }; + + // Date + auto& date = GetDate(); + int32_t year = date.GetYear() + 1; + int32_t month = date.GetMonth(); + int32_t day = date.GetDay(); colour_t colour - = (gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == WIDX_MONEY + = (gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == WIDX_DATE ? COLOUR_WHITE : NOT_TRANSLUCENT(colours[0])); - StringId stringId = gameState.Cash < 0 ? STR_BOTTOM_TOOLBAR_CASH_NEGATIVE : STR_BOTTOM_TOOLBAR_CASH; + StringId stringId = DateFormatStringFormatIds[gConfigGeneral.DateFormat]; auto ft = Formatter(); - ft.Add(gameState.Cash); + ft.Add(DateDayNames[day]); + ft.Add(month); + ft.Add(year); DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); - } - static constexpr StringId _guestCountFormats[] = { - STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE, - STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE, - STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE, - }; + // Figure out how much line height we have to work with. + uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - static constexpr StringId _guestCountFormatsSingular[] = { - STR_BOTTOM_TOOLBAR_NUM_GUESTS_STABLE_SINGULAR, - STR_BOTTOM_TOOLBAR_NUM_GUESTS_DECREASE_SINGULAR, - STR_BOTTOM_TOOLBAR_NUM_GUESTS_INCREASE_SINGULAR, - }; + // Temperature + screenCoords = { windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 15, + static_cast(screenCoords.y + line_height + 1) }; - // Draw guests - { - Widget widget = window_game_bottom_toolbar_widgets[WIDX_GUESTS]; - auto screenCoords = ScreenCoordsXY{ windowPos.x + widget.midX(), windowPos.y + widget.midY() - 6 }; - - StringId stringId = gameState.NumGuestsInPark == 1 ? _guestCountFormatsSingular[gameState.GuestChangeModifier] - : _guestCountFormats[gameState.GuestChangeModifier]; - colour_t colour - = (gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == WIDX_GUESTS - ? COLOUR_WHITE - : NOT_TRANSLUCENT(colours[0])); - auto ft = Formatter(); - ft.Add(gameState.NumGuestsInPark); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); - } - - // Draw park rating - { - Widget widget = window_game_bottom_toolbar_widgets[WIDX_PARK_RATING]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 11, widget.midY() - 5 }; - - DrawParkRating( - dpi, colours[3], screenCoords, std::max(10, ((gameState.ParkRating / 4) * 263) / 256)); - } - } - - void DrawParkRating(DrawPixelInfo &dpi, int32_t colour, const ScreenCoordsXY& coords, uint8_t factor) - { - int16_t bar_width = (factor * 114) / 255; - GfxFillRectInset( - dpi, { coords + ScreenCoordsXY{ 1, 1 }, coords + ScreenCoordsXY{ 114, 9 } }, colours[1], INSET_RECT_F_30); - if (!(colour & kBarBlink) || GameIsPaused() || (gCurrentRealTimeTicks & 8)) - { - if (bar_width > 2) + int32_t temperature = OpenRCT2::GetGameState().ClimateCurrent.Temperature; + StringId format = STR_CELSIUS_VALUE; + if (gConfigGeneral.TemperatureFormat == TemperatureUnit::Fahrenheit) { - GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 2 }, coords + ScreenCoordsXY{ bar_width - 1, 8 } }, colour, 0); + temperature = ClimateCelsiusToFahrenheit(temperature); + format = STR_FAHRENHEIT_VALUE; + } + ft = Formatter(); + ft.Add(temperature); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft); + screenCoords.x += 30; + + // Current weather + auto currentWeatherSpriteId = ClimateGetWeatherSpriteId(OpenRCT2::GetGameState().ClimateCurrent); + GfxDrawSprite(dpi, ImageId(currentWeatherSpriteId), screenCoords); + + // Next weather + auto nextWeatherSpriteId = ClimateGetWeatherSpriteId(GetGameState().ClimateNext); + if (currentWeatherSpriteId != nextWeatherSpriteId) + { + if (GetGameState().ClimateUpdateTimer < 960) + { + GfxDrawSprite(dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 }); + GfxDrawSprite(dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 }); + } } } - // Draw thumbs on the sides - GfxDrawSprite(dpi, ImageId(SPR_RATING_LOW), coords - ScreenCoordsXY{ 14, 0 }); - GfxDrawSprite(dpi, ImageId(SPR_RATING_HIGH), coords + ScreenCoordsXY{ 114, 0 }); - } - - void DrawRightPanel(DrawPixelInfo &dpi) - { - const auto topLeft = windowPos - + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 1, - window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + 1 }; - const auto bottomRight = windowPos - + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 1, - window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom - 1 }; - // Draw green inset rectangle on panel - GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_30); - - auto screenCoords = ScreenCoordsXY{ (window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left - + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right) - / 2 - + windowPos.x, - window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].top + windowPos.y + 2 }; - - // Date - auto& date = GetDate(); - int32_t year = date.GetYear() + 1; - int32_t month = date.GetMonth(); - int32_t day = date.GetDay(); - - colour_t colour - = (gHoverWidget.window_classification == WindowClass::BottomToolbar && gHoverWidget.widget_index == WIDX_DATE - ? COLOUR_WHITE - : NOT_TRANSLUCENT(colours[0])); - StringId stringId = DateFormatStringFormatIds[gConfigGeneral.DateFormat]; - auto ft = Formatter(); - ft.Add(DateDayNames[day]); - ft.Add(month); - ft.Add(year); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colour, TextAlignment::CENTRE }); - - // Figure out how much line height we have to work with. - uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - - // Temperature - screenCoords = { windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 15, - static_cast(screenCoords.y + line_height + 1) }; - - int32_t temperature = OpenRCT2::GetGameState().ClimateCurrent.Temperature; - StringId format = STR_CELSIUS_VALUE; - if (gConfigGeneral.TemperatureFormat == TemperatureUnit::Fahrenheit) + void DrawNewsItem(DrawPixelInfo& dpi) { - temperature = ClimateCelsiusToFahrenheit(temperature); - format = STR_FAHRENHEIT_VALUE; - } - ft = Formatter(); - ft.Add(temperature); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 0, 6 }, format, ft); - screenCoords.x += 30; + auto* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET]; + auto* newsItem = News::GetItem(0); - // Current weather - auto currentWeatherSpriteId = ClimateGetWeatherSpriteId(OpenRCT2::GetGameState().ClimateCurrent); - GfxDrawSprite(dpi, ImageId(currentWeatherSpriteId), screenCoords); + // Current news item + GfxFillRectInset( + dpi, - // Next weather - auto nextWeatherSpriteId = ClimateGetWeatherSpriteId(GetGameState().ClimateNext); - if (currentWeatherSpriteId != nextWeatherSpriteId) - { - if (GetGameState().ClimateUpdateTimer < 960) + { windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 }, + windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } }, + colours[2], INSET_RECT_F_30); + + // Text + auto screenCoords = windowPos + ScreenCoordsXY{ middleOutsetWidget->midX(), middleOutsetWidget->top + 11 }; + int32_t itemWidth = middleOutsetWidget->width() - 62; + DrawNewsTicker( + dpi, screenCoords, itemWidth, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, + newsItem->Ticks); + + screenCoords = windowPos + + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].left, + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].top }; + switch (newsItem->Type) { - GfxDrawSprite(dpi, ImageId(SPR_NEXT_WEATHER), screenCoords + ScreenCoordsXY{ 27, 5 }); - GfxDrawSprite(dpi, ImageId(nextWeatherSpriteId), screenCoords + ScreenCoordsXY{ 40, 0 }); - } - } - } - - void DrawNewsItem(DrawPixelInfo &dpi) - { - auto* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET]; - auto* newsItem = News::GetItem(0); - - // Current news item - GfxFillRectInset( - dpi, - - { windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 }, - windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } }, - colours[2], INSET_RECT_F_30); - - // Text - auto screenCoords = windowPos + ScreenCoordsXY{ middleOutsetWidget->midX(), middleOutsetWidget->top + 11 }; - int32_t itemWidth = middleOutsetWidget->width() - 62; - DrawNewsTicker( - dpi, screenCoords, itemWidth, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, newsItem->Ticks); - - screenCoords = windowPos - + ScreenCoordsXY{ window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].left, - window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].top }; - switch (newsItem->Type) - { - case News::ItemType::Ride: - GfxDrawSprite(dpi, ImageId(SPR_RIDE), screenCoords); - break; - case News::ItemType::PeepOnRide: - case News::ItemType::Peep: - { - if (newsItem->HasButton()) + case News::ItemType::Ride: + GfxDrawSprite(dpi, ImageId(SPR_RIDE), screenCoords); break; - - DrawPixelInfo cliped_dpi; - if (!ClipDrawPixelInfo(cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22)) + case News::ItemType::PeepOnRide: + case News::ItemType::Peep: { - break; - } - - auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem->Assoc)); - if (peep == nullptr) - return; - - auto clipCoords = ScreenCoordsXY{ 10, 19 }; - auto* staff = peep->As(); - if (staff != nullptr && staff->AssignedStaffType == StaffType::Entertainer) - { - clipCoords.y += 3; - } - - uint32_t image_id_base = GetPeepAnimation(peep->SpriteType).base_image; - image_id_base += frame_no & 0xFFFFFFFC; - image_id_base++; - - auto image_id = ImageId(image_id_base, peep->TshirtColour, peep->TrousersColour); - GfxDrawSprite(cliped_dpi, image_id, clipCoords); - - auto* guest = peep->As(); - if (guest != nullptr) - { - if (image_id_base >= 0x2A1D && image_id_base < 0x2A3D) - { - GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords); - } - else if (image_id_base >= 0x2BBD && image_id_base < 0x2BDD) - { - GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords); - } - else if (image_id_base >= 0x29DD && image_id_base < 0x29FD) - { - GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords); - } - } - break; - } - case News::ItemType::Money: - case News::ItemType::Campaign: - GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenCoords); - break; - case News::ItemType::Research: - GfxDrawSprite(dpi, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); - break; - case News::ItemType::Peeps: - GfxDrawSprite(dpi, ImageId(SPR_GUESTS), screenCoords); - break; - case News::ItemType::Award: - GfxDrawSprite(dpi, ImageId(SPR_AWARD), screenCoords); - break; - case News::ItemType::Graph: - GfxDrawSprite(dpi, ImageId(SPR_GRAPH), screenCoords); - break; - case News::ItemType::Null: - case News::ItemType::Blank: - case News::ItemType::Count: - break; - } - } - - void DrawMiddlePanel(DrawPixelInfo &dpi) - { - Widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET]; - - GfxFillRectInset( - dpi, - { windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 }, - windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } }, - colours[1], INSET_RECT_F_30); - - // Figure out how much line height we have to work with. - uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - - ScreenCoordsXY middleWidgetCoords( - windowPos.x + middleOutsetWidget->midX(), windowPos.y + middleOutsetWidget->top + line_height + 1); - int32_t panelWidth = middleOutsetWidget->width() - 62; - - // Check if there is a map tooltip to draw - StringId stringId; - auto ft = GetMapTooltip(); - std::memcpy(&stringId, ft.Data(), sizeof(StringId)); - if (stringId == STR_NONE) - { - DrawTextWrapped( - dpi, middleWidgetCoords, panelWidth, STR_TITLE_SEQUENCE_OPENRCT2, ft, { colours[0], TextAlignment::CENTRE }); - } - else - { - // Show tooltip in bottom toolbar - DrawTextWrapped(dpi, middleWidgetCoords, panelWidth, STR_STRINGID, ft, { colours[0], TextAlignment::CENTRE }); - } - } - - void InvalidateDirtyWidgets() - { - if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_MONEY) - { - gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_MONEY; - InvalidateWidget(WIDX_LEFT_INSET); - } - - if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_DATE) - { - gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_DATE; - InvalidateWidget(WIDX_RIGHT_INSET); - } - - if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PEEP_COUNT) - { - gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PEEP_COUNT; - InvalidateWidget(WIDX_LEFT_INSET); - } - - if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_CLIMATE) - { - gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_CLIMATE; - InvalidateWidget(WIDX_RIGHT_INSET); - } - - if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PARK_RATING) - { - gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PARK_RATING; - InvalidateWidget(WIDX_LEFT_INSET); - } - } - - -public: - GameBottomToolbar() - { - widgets = window_game_bottom_toolbar_widgets; - - frame_no = 0; - InitScrollWidgets(); - - // Reset the middle widget to not show by default. - // If it is required to be shown news_update will reshow it. - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::Empty; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - - News::Item* newsItem; - - switch (widgetIndex) - { - case WIDX_LEFT_OUTSET: - case WIDX_MONEY: - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - ContextOpenWindow(WindowClass::Finances); - break; - case WIDX_GUESTS: - ContextOpenWindowView(WV_PARK_GUESTS); - break; - case WIDX_PARK_RATING: - ContextOpenWindowView(WV_PARK_RATING); - break; - case WIDX_MIDDLE_INSET: - if (News::IsQueueEmpty()) - { - ContextOpenWindow(WindowClass::RecentNews); - } - else - { - News::CloseCurrentItem(); - } - break; - case WIDX_NEWS_SUBJECT: - newsItem = News::GetItem(0); - News::OpenSubject(newsItem->Type, newsItem->Assoc); - break; - case WIDX_NEWS_LOCATE: - if (News::IsQueueEmpty()) - break; - - { - newsItem = News::GetItem(0); - - auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); - - if (!subjectLoc.has_value()) + if (newsItem->HasButton()) break; - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - WindowScrollToLocation(*mainWindow, subjectLoc.value()); + DrawPixelInfo cliped_dpi; + if (!ClipDrawPixelInfo(cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22)) + { + break; + } + + auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem->Assoc)); + if (peep == nullptr) + return; + + auto clipCoords = ScreenCoordsXY{ 10, 19 }; + auto* staff = peep->As(); + if (staff != nullptr && staff->AssignedStaffType == StaffType::Entertainer) + { + clipCoords.y += 3; + } + + uint32_t image_id_base = GetPeepAnimation(peep->SpriteType).base_image; + image_id_base += frame_no & 0xFFFFFFFC; + image_id_base++; + + auto image_id = ImageId(image_id_base, peep->TshirtColour, peep->TrousersColour); + GfxDrawSprite(cliped_dpi, image_id, clipCoords); + + auto* guest = peep->As(); + if (guest != nullptr) + { + if (image_id_base >= 0x2A1D && image_id_base < 0x2A3D) + { + GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords); + } + else if (image_id_base >= 0x2BBD && image_id_base < 0x2BDD) + { + GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords); + } + else if (image_id_base >= 0x29DD && image_id_base < 0x29FD) + { + GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords); + } + } + break; } - break; - case WIDX_RIGHT_OUTSET: - case WIDX_DATE: - ContextOpenWindow(WindowClass::RecentNews); - break; - } - } - - OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override - { - const auto& gameState = GetGameState(); - auto ft = Formatter(); - - switch (widgetIndex) - { - case WIDX_MONEY: - ft.Add(gameState.CurrentProfit); - ft.Add(gameState.ParkValue); - break; - case WIDX_PARK_RATING: - ft.Add(gameState.ParkRating); - break; - } - return { fallback, ft }; - } - - void OnPrepareDraw() override - { - // Figure out how much line height we have to work with. - uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - - // Reset dimensions as appropriate -- in case we're switching languages. - height = line_height * 2 + 12; - windowPos.y = ContextGetHeight() - height; - - // Change height of widgets in accordance with line height. - widgets[WIDX_LEFT_OUTSET].bottom = widgets[WIDX_MIDDLE_OUTSET].bottom = widgets[WIDX_RIGHT_OUTSET].bottom - = line_height * 3 + 3; - widgets[WIDX_LEFT_INSET].bottom = widgets[WIDX_MIDDLE_INSET].bottom = widgets[WIDX_RIGHT_INSET].bottom - = line_height * 3 + 1; - - // Reposition left widgets in accordance with line height... depending on whether there is money in play. - if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) - { - widgets[WIDX_MONEY].type = WindowWidgetType::Empty; - widgets[WIDX_GUESTS].top = 1; - widgets[WIDX_GUESTS].bottom = line_height + 7; - widgets[WIDX_PARK_RATING].top = line_height + 8; - widgets[WIDX_PARK_RATING].bottom = height - 1; - } - else - { - widgets[WIDX_MONEY].type = WindowWidgetType::FlatBtn; - widgets[WIDX_MONEY].bottom = widgets[WIDX_MONEY].top + line_height; - widgets[WIDX_GUESTS].top = widgets[WIDX_MONEY].bottom + 1; - widgets[WIDX_GUESTS].bottom = widgets[WIDX_GUESTS].top + line_height; - widgets[WIDX_PARK_RATING].top = widgets[WIDX_GUESTS].bottom - 1; - widgets[WIDX_PARK_RATING].bottom = height - 1; + case News::ItemType::Money: + case News::ItemType::Campaign: + GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenCoords); + break; + case News::ItemType::Research: + GfxDrawSprite(dpi, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); + break; + case News::ItemType::Peeps: + GfxDrawSprite(dpi, ImageId(SPR_GUESTS), screenCoords); + break; + case News::ItemType::Award: + GfxDrawSprite(dpi, ImageId(SPR_AWARD), screenCoords); + break; + case News::ItemType::Graph: + GfxDrawSprite(dpi, ImageId(SPR_GRAPH), screenCoords); + break; + case News::ItemType::Null: + case News::ItemType::Blank: + case News::ItemType::Count: + break; + } } - // Reposition right widgets in accordance with line height, too. - widgets[WIDX_DATE].bottom = line_height + 1; - - // Anchor the middle and right panel to the right - int32_t x = ContextGetWidth(); - width = x; - x--; - window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right = x; - x -= 2; - window_game_bottom_toolbar_widgets[WIDX_RIGHT_INSET].right = x; - x -= 137; - window_game_bottom_toolbar_widgets[WIDX_RIGHT_INSET].left = x; - x -= 2; - window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left = x; - x--; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right = x; - x -= 2; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].right = x; - x -= 3; - window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].right = x; - x -= 23; - window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].left = x; - window_game_bottom_toolbar_widgets[WIDX_DATE].left = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 2; - window_game_bottom_toolbar_widgets[WIDX_DATE].right = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right - 2; - - window_game_bottom_toolbar_widgets[WIDX_LEFT_INSET].type = WindowWidgetType::Empty; - window_game_bottom_toolbar_widgets[WIDX_RIGHT_INSET].type = WindowWidgetType::Empty; - - if (News::IsQueueEmpty()) + void DrawMiddlePanel(DrawPixelInfo& dpi) { - if (!(ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)) + Widget* middleOutsetWidget = &window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET]; + + GfxFillRectInset( + dpi, + { windowPos + ScreenCoordsXY{ middleOutsetWidget->left + 1, middleOutsetWidget->top + 1 }, + windowPos + ScreenCoordsXY{ middleOutsetWidget->right - 1, middleOutsetWidget->bottom - 1 } }, + colours[1], INSET_RECT_F_30); + + // Figure out how much line height we have to work with. + uint32_t line_height = FontGetLineHeight(FontStyle::Medium); + + ScreenCoordsXY middleWidgetCoords( + windowPos.x + middleOutsetWidget->midX(), windowPos.y + middleOutsetWidget->top + line_height + 1); + int32_t panelWidth = middleOutsetWidget->width() - 62; + + // Check if there is a map tooltip to draw + StringId stringId; + auto ft = GetMapTooltip(); + std::memcpy(&stringId, ft.Data(), sizeof(StringId)); + if (stringId == STR_NONE) { - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::Empty; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::Empty; - window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; - window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::Empty; + DrawTextWrapped( + dpi, middleWidgetCoords, panelWidth, STR_TITLE_SEQUENCE_OPENRCT2, ft, + { colours[0], TextAlignment::CENTRE }); } else { + // Show tooltip in bottom toolbar + DrawTextWrapped(dpi, middleWidgetCoords, panelWidth, STR_STRINGID, ft, { colours[0], TextAlignment::CENTRE }); + } + } + + void InvalidateDirtyWidgets() + { + if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_MONEY) + { + gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_MONEY; + InvalidateWidget(WIDX_LEFT_INSET); + } + + if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_DATE) + { + gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_DATE; + InvalidateWidget(WIDX_RIGHT_INSET); + } + + if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PEEP_COUNT) + { + gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PEEP_COUNT; + InvalidateWidget(WIDX_LEFT_INSET); + } + + if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_CLIMATE) + { + gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_CLIMATE; + InvalidateWidget(WIDX_RIGHT_INSET); + } + + if (gToolbarDirtyFlags & BTM_TB_DIRTY_FLAG_PARK_RATING) + { + gToolbarDirtyFlags &= ~BTM_TB_DIRTY_FLAG_PARK_RATING; + InvalidateWidget(WIDX_LEFT_INSET); + } + } + + public: + GameBottomToolbar() + { + widgets = window_game_bottom_toolbar_widgets; + + frame_no = 0; + InitScrollWidgets(); + + // Reset the middle widget to not show by default. + // If it is required to be shown news_update will reshow it. + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::Empty; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + News::Item* newsItem; + + switch (widgetIndex) + { + case WIDX_LEFT_OUTSET: + case WIDX_MONEY: + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + ContextOpenWindow(WindowClass::Finances); + break; + case WIDX_GUESTS: + ContextOpenWindowView(WV_PARK_GUESTS); + break; + case WIDX_PARK_RATING: + ContextOpenWindowView(WV_PARK_RATING); + break; + case WIDX_MIDDLE_INSET: + if (News::IsQueueEmpty()) + { + ContextOpenWindow(WindowClass::RecentNews); + } + else + { + News::CloseCurrentItem(); + } + break; + case WIDX_NEWS_SUBJECT: + newsItem = News::GetItem(0); + News::OpenSubject(newsItem->Type, newsItem->Assoc); + break; + case WIDX_NEWS_LOCATE: + if (News::IsQueueEmpty()) + break; + + { + newsItem = News::GetItem(0); + + auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); + + if (!subjectLoc.has_value()) + break; + + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + WindowScrollToLocation(*mainWindow, subjectLoc.value()); + } + break; + case WIDX_RIGHT_OUTSET: + case WIDX_DATE: + ContextOpenWindow(WindowClass::RecentNews); + break; + } + } + + OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override + { + const auto& gameState = GetGameState(); + auto ft = Formatter(); + + switch (widgetIndex) + { + case WIDX_MONEY: + ft.Add(gameState.CurrentProfit); + ft.Add(gameState.ParkValue); + break; + case WIDX_PARK_RATING: + ft.Add(gameState.ParkRating); + break; + } + return { fallback, ft }; + } + + void OnPrepareDraw() override + { + // Figure out how much line height we have to work with. + uint32_t line_height = FontGetLineHeight(FontStyle::Medium); + + // Reset dimensions as appropriate -- in case we're switching languages. + height = line_height * 2 + 12; + windowPos.y = ContextGetHeight() - height; + + // Change height of widgets in accordance with line height. + widgets[WIDX_LEFT_OUTSET].bottom = widgets[WIDX_MIDDLE_OUTSET].bottom = widgets[WIDX_RIGHT_OUTSET].bottom + = line_height * 3 + 3; + widgets[WIDX_LEFT_INSET].bottom = widgets[WIDX_MIDDLE_INSET].bottom = widgets[WIDX_RIGHT_INSET].bottom = line_height + * 3 + + 1; + + // Reposition left widgets in accordance with line height... depending on whether there is money in play. + if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) + { + widgets[WIDX_MONEY].type = WindowWidgetType::Empty; + widgets[WIDX_GUESTS].top = 1; + widgets[WIDX_GUESTS].bottom = line_height + 7; + widgets[WIDX_PARK_RATING].top = line_height + 8; + widgets[WIDX_PARK_RATING].bottom = height - 1; + } + else + { + widgets[WIDX_MONEY].type = WindowWidgetType::FlatBtn; + widgets[WIDX_MONEY].bottom = widgets[WIDX_MONEY].top + line_height; + widgets[WIDX_GUESTS].top = widgets[WIDX_MONEY].bottom + 1; + widgets[WIDX_GUESTS].bottom = widgets[WIDX_GUESTS].top + line_height; + widgets[WIDX_PARK_RATING].top = widgets[WIDX_GUESTS].bottom - 1; + widgets[WIDX_PARK_RATING].bottom = height - 1; + } + + // Reposition right widgets in accordance with line height, too. + widgets[WIDX_DATE].bottom = line_height + 1; + + // Anchor the middle and right panel to the right + int32_t x = ContextGetWidth(); + width = x; + x--; + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right = x; + x -= 2; + window_game_bottom_toolbar_widgets[WIDX_RIGHT_INSET].right = x; + x -= 137; + window_game_bottom_toolbar_widgets[WIDX_RIGHT_INSET].left = x; + x -= 2; + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left = x; + x--; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].right = x; + x -= 2; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].right = x; + x -= 3; + window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].right = x; + x -= 23; + window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].left = x; + window_game_bottom_toolbar_widgets[WIDX_DATE].left = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].left + 2; + window_game_bottom_toolbar_widgets[WIDX_DATE].right = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right + - 2; + + window_game_bottom_toolbar_widgets[WIDX_LEFT_INSET].type = WindowWidgetType::Empty; + window_game_bottom_toolbar_widgets[WIDX_RIGHT_INSET].type = WindowWidgetType::Empty; + + if (News::IsQueueEmpty()) + { + if (!(ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)) + { + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::Empty; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::Empty; + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; + window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::Empty; + } + else + { + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::ImgBtn; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::FlatBtn; + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; + window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::Empty; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].colour = 0; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].colour = 0; + } + } + else + { + News::Item* newsItem = News::GetItem(0); window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::ImgBtn; window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::FlatBtn; - window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; - window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::Empty; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].colour = 0; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].colour = 0; + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::FlatBtn; + window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::FlatBtn; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].colour = 2; + window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].colour = 2; + disabled_widgets &= ~(1uLL << WIDX_NEWS_SUBJECT); + disabled_widgets &= ~(1uLL << WIDX_NEWS_LOCATE); + + // Find out if the news item is no longer valid + auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); + + if (!subjectLoc.has_value()) + disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); + + if (!(newsItem->TypeHasSubject())) + { + disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); + window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; + } + + if (newsItem->HasButton()) + { + disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); + disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); + } } } - else + + void OnDraw(DrawPixelInfo& dpi) override { - News::Item* newsItem = News::GetItem(0); - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WindowWidgetType::ImgBtn; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WindowWidgetType::FlatBtn; - window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::FlatBtn; - window_game_bottom_toolbar_widgets[WIDX_NEWS_LOCATE].type = WindowWidgetType::FlatBtn; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].colour = 2; - window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].colour = 2; - disabled_widgets &= ~(1uLL << WIDX_NEWS_SUBJECT); - disabled_widgets &= ~(1uLL << WIDX_NEWS_LOCATE); + auto leftWidget = window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET]; + auto rightWidget = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET]; + auto middleWidget = window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET]; - // Find out if the news item is no longer valid - auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); - - if (!subjectLoc.has_value()) - disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); - - if (!(newsItem->TypeHasSubject())) - { - disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); - window_game_bottom_toolbar_widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; - } - - if (newsItem->HasButton()) - { - disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); - disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); - } - } - } - - void OnDraw(DrawPixelInfo &dpi) override - { - auto leftWidget = window_game_bottom_toolbar_widgets[WIDX_LEFT_OUTSET]; - auto rightWidget = window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET]; - auto middleWidget = window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET]; - - // Draw panel grey backgrounds - auto leftTop = windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top }; - auto rightBottom = windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom }; - GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); - - leftTop = windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top }; - rightBottom = windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom }; - GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); - - if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) - { - // Draw grey background - leftTop = windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top }; - rightBottom = windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom }; + // Draw panel grey backgrounds + auto leftTop = windowPos + ScreenCoordsXY{ leftWidget.left, leftWidget.top }; + auto rightBottom = windowPos + ScreenCoordsXY{ leftWidget.right, leftWidget.bottom }; GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); + + leftTop = windowPos + ScreenCoordsXY{ rightWidget.left, rightWidget.top }; + rightBottom = windowPos + ScreenCoordsXY{ rightWidget.right, rightWidget.bottom }; + GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); + + if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) + { + // Draw grey background + leftTop = windowPos + ScreenCoordsXY{ middleWidget.left, middleWidget.top }; + rightBottom = windowPos + ScreenCoordsXY{ middleWidget.right, middleWidget.bottom }; + GfxFilterRect(dpi, { leftTop, rightBottom }, FilterPaletteID::Palette51); + } + + DrawWidgets(dpi); + + DrawLeftPanel(dpi); + DrawRightPanel(dpi); + + if (!News::IsQueueEmpty()) + { + DrawNewsItem(dpi); + } + else if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) + { + DrawMiddlePanel(dpi); + } } - DrawWidgets(dpi); - - DrawLeftPanel(dpi); - DrawRightPanel(dpi); - - if (!News::IsQueueEmpty()) + void OnUpdate() override { - DrawNewsItem(dpi); + frame_no++; + if (frame_no >= 24) + frame_no = 0; + + InvalidateDirtyWidgets(); } - else if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) + + CursorID OnCursor(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, CursorID cursorId) override { - DrawMiddlePanel(dpi); + switch (widgetIndex) + { + case WIDX_MONEY: + case WIDX_GUESTS: + case WIDX_PARK_RATING: + case WIDX_DATE: + gTooltipCloseTimeout = gCurrentRealTimeTicks + 2000; + break; + } + return cursorId; } - } - void OnUpdate() override - { - frame_no++; - if (frame_no >= 24) - frame_no = 0; - - InvalidateDirtyWidgets(); - } - - CursorID OnCursor(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords, CursorID cursorId) override - { - switch (widgetIndex) + void OnPeriodicUpdate() override { - case WIDX_MONEY: - case WIDX_GUESTS: - case WIDX_PARK_RATING: - case WIDX_DATE: - gTooltipCloseTimeout = gCurrentRealTimeTicks + 2000; - break; + InvalidateDirtyWidgets(); } - return cursorId; - } + }; - void OnPeriodicUpdate() override + /** + * Creates the main game bottom toolbar window. + */ + WindowBase* WindowGameBottomToolbarOpen() { - InvalidateDirtyWidgets(); + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + + // Figure out how much line height we have to work with. + uint32_t line_height = FontGetLineHeight(FontStyle::Medium); + uint32_t toolbar_height = line_height * 2 + 12; + + GameBottomToolbar* window = WindowCreate( + WindowClass::BottomToolbar, ScreenCoordsXY(0, screenHeight - toolbar_height), screenWidth, toolbar_height, + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); + + return window; } -}; -/** - * Creates the main game bottom toolbar window. - */ -WindowBase* WindowGameBottomToolbarOpen() -{ - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - - // Figure out how much line height we have to work with. - uint32_t line_height = FontGetLineHeight(FontStyle::Medium); - uint32_t toolbar_height = line_height * 2 + 12; - - GameBottomToolbar* window = WindowCreate( - WindowClass::BottomToolbar, - ScreenCoordsXY(0, screenHeight - toolbar_height), - screenWidth, - toolbar_height, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); - - return window; -} - -void WindowGameBottomToolbarInvalidateNewsItem() -{ - if (gScreenFlags == SCREEN_FLAGS_PLAYING) + void WindowGameBottomToolbarInvalidateNewsItem() { - WidgetInvalidateByClass(WindowClass::BottomToolbar, WIDX_MIDDLE_OUTSET); + if (gScreenFlags == SCREEN_FLAGS_PLAYING) + { + WidgetInvalidateByClass(WindowClass::BottomToolbar, WIDX_MIDDLE_OUTSET); + } } -} - +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 35c4b58c63..8f2aaac172 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -36,52 +36,52 @@ #include #include -using namespace OpenRCT2; - -static constexpr StringId WINDOW_TITLE = STR_STRINGID; -static constexpr int32_t WH = 157; -static constexpr int32_t WW = 192; - -enum WindowGuestPage +namespace OpenRCT2::Ui::Windows { - WINDOW_GUEST_OVERVIEW, - WINDOW_GUEST_STATS, - WINDOW_GUEST_RIDES, - WINDOW_GUEST_FINANCE, - WINDOW_GUEST_THOUGHTS, - WINDOW_GUEST_INVENTORY, - WINDOW_GUEST_DEBUG, - WINDOW_GUEST_PAGE_COUNT, -}; + static constexpr StringId WINDOW_TITLE = STR_STRINGID; + static constexpr int32_t WH = 157; + static constexpr int32_t WW = 192; -enum WindowGuestWidgetIdx -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PAGE_BACKGROUND, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_TAB_4, - WIDX_TAB_5, - WIDX_TAB_6, - WIDX_TAB_7, + enum WindowGuestPage + { + WINDOW_GUEST_OVERVIEW, + WINDOW_GUEST_STATS, + WINDOW_GUEST_RIDES, + WINDOW_GUEST_FINANCE, + WINDOW_GUEST_THOUGHTS, + WINDOW_GUEST_INVENTORY, + WINDOW_GUEST_DEBUG, + WINDOW_GUEST_PAGE_COUNT, + }; - WIDX_MARQUEE = 11, - WIDX_VIEWPORT, - WIDX_ACTION_LBL, - WIDX_PICKUP, - WIDX_RENAME, - WIDX_LOCATE, - WIDX_TRACK, + enum WindowGuestWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PAGE_BACKGROUND, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_TAB_4, + WIDX_TAB_5, + WIDX_TAB_6, + WIDX_TAB_7, - WIDX_RIDE_SCROLL = 11 -}; + WIDX_MARQUEE = 11, + WIDX_VIEWPORT, + WIDX_ACTION_LBL, + WIDX_PICKUP, + WIDX_RENAME, + WIDX_LOCATE, + WIDX_TRACK, -validate_global_widx(WC_PEEP, WIDX_PICKUP); + WIDX_RIDE_SCROLL = 11 + }; -static constexpr int32_t TabWidth = 30; + validate_global_widx(WC_PEEP, WIDX_PICKUP); + + static constexpr int32_t TabWidth = 30; #define MAIN_GUEST_WIDGETS \ WINDOW_SHIM(WINDOW_TITLE, WW, WH), \ @@ -94,7 +94,7 @@ static constexpr int32_t TabWidth = 30; MakeTab({ 158, 17 }, STR_SHOW_GUEST_ITEMS_TIP), /* Tab 6 */ \ MakeTab({ 189, 17 }, STR_DEBUG_TIP) /* Tab 7 */ -// clang-format off + // clang-format off static Widget _guestWindowWidgetsOverview[] = { MAIN_GUEST_WIDGETS, MakeWidget({ 3, 45}, {164, 12}, WindowWidgetType::LabelCentred, WindowColour::Secondary ), // Label Thought marquee @@ -106,40 +106,40 @@ static Widget _guestWindowWidgetsOverview[] = { MakeWidget({167, 117}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_TRACK_PEEP), STR_TOGGLE_GUEST_TRACKING_TIP), // Track Button kWidgetsEnd, }; -// clang-format on + // clang-format on -static Widget _guestWindowWidgetsStats[] = { - MAIN_GUEST_WIDGETS, - kWidgetsEnd, -}; + static Widget _guestWindowWidgetsStats[] = { + MAIN_GUEST_WIDGETS, + kWidgetsEnd, + }; -static Widget _guestWindowWidgetsRides[] = { - MAIN_GUEST_WIDGETS, - MakeWidget({ 3, 57 }, { 186, 87 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), - kWidgetsEnd, -}; + static Widget _guestWindowWidgetsRides[] = { + MAIN_GUEST_WIDGETS, + MakeWidget({ 3, 57 }, { 186, 87 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), + kWidgetsEnd, + }; -static Widget _guestWindowWidgetsFinance[] = { - MAIN_GUEST_WIDGETS, - kWidgetsEnd, -}; + static Widget _guestWindowWidgetsFinance[] = { + MAIN_GUEST_WIDGETS, + kWidgetsEnd, + }; -static Widget _guestWindowWidgetsThoughts[] = { - MAIN_GUEST_WIDGETS, - kWidgetsEnd, -}; + static Widget _guestWindowWidgetsThoughts[] = { + MAIN_GUEST_WIDGETS, + kWidgetsEnd, + }; -static Widget _guestWindowWidgetsInventory[] = { - MAIN_GUEST_WIDGETS, - kWidgetsEnd, -}; + static Widget _guestWindowWidgetsInventory[] = { + MAIN_GUEST_WIDGETS, + kWidgetsEnd, + }; -static Widget _guestWindowWidgetsDebug[] = { - MAIN_GUEST_WIDGETS, - kWidgetsEnd, -}; + static Widget _guestWindowWidgetsDebug[] = { + MAIN_GUEST_WIDGETS, + kWidgetsEnd, + }; -// clang-format off + // clang-format off static constexpr std::array _guestWindowPageWidgets = { _guestWindowWidgetsOverview, _guestWindowWidgetsStats, @@ -150,1787 +150,1789 @@ static constexpr std::array _guestWindowPageWidgets = { _guestWindowWidgetsDebug, }; static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); -// clang-format on + // clang-format on -static constexpr std::array _guestWindowPageSizes = { - std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_OVERVIEW - std::array{ ScreenSize{ 192, 180 }, ScreenSize{ 192, 180 } }, // WINDOW_GUEST_STATS - std::array{ ScreenSize{ 192, 180 }, ScreenSize{ 500, 400 } }, // WINDOW_GUEST_RIDES - std::array{ ScreenSize{ 210, 148 }, ScreenSize{ 210, 148 } }, // WINDOW_GUEST_FINANCE - std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_THOUGHTS - std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_INVENTORY - std::array{ ScreenSize{ 192, 171 }, ScreenSize{ 192, 171 } }, // WINDOW_GUEST_DEBUG -}; -static_assert(_guestWindowPageSizes.size() == WINDOW_GUEST_PAGE_COUNT); + static constexpr std::array _guestWindowPageSizes = { + std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_OVERVIEW + std::array{ ScreenSize{ 192, 180 }, ScreenSize{ 192, 180 } }, // WINDOW_GUEST_STATS + std::array{ ScreenSize{ 192, 180 }, ScreenSize{ 500, 400 } }, // WINDOW_GUEST_RIDES + std::array{ ScreenSize{ 210, 148 }, ScreenSize{ 210, 148 } }, // WINDOW_GUEST_FINANCE + std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_THOUGHTS + std::array{ ScreenSize{ 192, 159 }, ScreenSize{ 500, 450 } }, // WINDOW_GUEST_INVENTORY + std::array{ ScreenSize{ 192, 171 }, ScreenSize{ 192, 171 } }, // WINDOW_GUEST_DEBUG + }; + static_assert(_guestWindowPageSizes.size() == WINDOW_GUEST_PAGE_COUNT); -class GuestWindow final : public Window -{ -private: - uint16_t _marqueePosition = 0; - uint16_t _beingWatchedTimer = 0; - uint16_t _guestAnimationFrame = 0; - int16_t _pickedPeepX = LOCATION_NULL; // entity->x gets set to 0x8000 on pickup, this is the old value - std::vector _riddenRides; - -public: - void OnOpen() override + class GuestWindow final : public Window { - widgets = _guestWindowWidgetsOverview; - page = WINDOW_GUEST_OVERVIEW; - frame_no = 0; - _marqueePosition = 0; - picked_peep_frame = 0; - min_width = width; - min_height = 157; - max_width = 500; - max_height = 450; - selected_list_item = -1; - } + private: + uint16_t _marqueePosition = 0; + uint16_t _beingWatchedTimer = 0; + uint16_t _guestAnimationFrame = 0; + int16_t _pickedPeepX = LOCATION_NULL; // entity->x gets set to 0x8000 on pickup, this is the old value + std::vector _riddenRides; - void Init(EntityId id) - { - number = id.ToUnderlying(); - page = -1; // Set Page to something invalid so that SetPage doesn't set audio on viewport - SetPage(WINDOW_GUEST_OVERVIEW); - } - - void OnClose() override - { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + public: + void OnOpen() override { - if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - ToolCancel(); - } - } - - void OnMouseUp(WidgetIndex widx) override - { - switch (widx) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - SetPage(widx - WIDX_TAB_1); - return; + widgets = _guestWindowWidgetsOverview; + page = WINDOW_GUEST_OVERVIEW; + frame_no = 0; + _marqueePosition = 0; + picked_peep_frame = 0; + min_width = width; + min_height = 157; + max_width = 500; + max_height = 450; + selected_list_item = -1; } - switch (page) + void Init(EntityId id) { - case WINDOW_GUEST_OVERVIEW: - OnMouseUpOverview(widx); - break; + number = id.ToUnderlying(); + page = -1; // Set Page to something invalid so that SetPage doesn't set audio on viewport + SetPage(WINDOW_GUEST_OVERVIEW); } - } - void OnMouseDown(WidgetIndex widx) override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnMouseDownOverview(widx); - } - } - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnDropdownOverview(widgetIndex, selectedIndex); - } - } - void OnResize() override - { - switch (page) - { - case WINDOW_GUEST_OVERVIEW: - OnResizeOverview(); - break; - case WINDOW_GUEST_STATS: - case WINDOW_GUEST_RIDES: - case WINDOW_GUEST_FINANCE: - case WINDOW_GUEST_THOUGHTS: - case WINDOW_GUEST_INVENTORY: - case WINDOW_GUEST_DEBUG: - OnResizeCommon(); - break; - } - } - void OnUpdate() override - { - switch (page) - { - case WINDOW_GUEST_OVERVIEW: - OnUpdateOverview(); - break; - case WINDOW_GUEST_STATS: - OnUpdateStats(); - break; - case WINDOW_GUEST_RIDES: - OnUpdateRides(); - break; - case WINDOW_GUEST_FINANCE: - OnUpdateFinance(); - break; - case WINDOW_GUEST_THOUGHTS: - OnUpdateThoughts(); - break; - case WINDOW_GUEST_INVENTORY: - OnUpdateInventory(); - break; - case WINDOW_GUEST_DEBUG: - OnUpdateDebug(); - break; - } - } - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnToolUpdateOverview(widgetIndex, screenCoords); - } - } - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnToolDownOverview(widgetIndex, screenCoords); - } - } - void OnToolAbort(WidgetIndex widgetIndex) override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnToolAbortOverview(widgetIndex); - } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnTextInputOverview(widgetIndex, text); - } - } - void OnViewportRotate() override - { - if (page == WINDOW_GUEST_OVERVIEW) - { - OnViewportRotateOverview(); - } - } - void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_GUEST_OVERVIEW: - OnDrawOverview(dpi); - break; - case WINDOW_GUEST_STATS: - OnDrawStats(dpi); - break; - case WINDOW_GUEST_RIDES: - OnDrawRides(dpi); - break; - case WINDOW_GUEST_FINANCE: - OnDrawFinance(dpi); - break; - case WINDOW_GUEST_THOUGHTS: - OnDrawThoughts(dpi); - break; - case WINDOW_GUEST_INVENTORY: - OnDrawInventory(dpi); - break; - case WINDOW_GUEST_DEBUG: - OnDrawDebug(dpi); - break; - } - } - void OnPrepareDraw() override - { - OnPrepareDrawCommon(); - switch (page) - { - case WINDOW_GUEST_OVERVIEW: - OnPrepareDrawOverview(); - break; - case WINDOW_GUEST_RIDES: - OnPrepareDrawRides(); - break; - } - } - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - if (page == WINDOW_GUEST_RIDES) - { - return OnScrollGetSizeRides(scrollIndex); - } - return {}; - } - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (page == WINDOW_GUEST_RIDES) + void OnClose() override { - OnScrollMouseOverRides(scrollIndex, screenCoords); - } - } - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (page == WINDOW_GUEST_RIDES) - { - OnScrollMouseDownRides(scrollIndex, screenCoords); - } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - if (page == WINDOW_GUEST_RIDES) - { - OnScrollDrawRides(scrollIndex, dpi); - } - } - -private: - Guest* GetGuest() - { - auto guest = GetEntity(EntityId::FromUnderlying(number)); - if (guest == nullptr) - { - Close(); - return nullptr; - } - return guest; - } - - void OnResizeCommon() - { - // Get page specific min and max size - int32_t minWidth = _guestWindowPageSizes[page][0].width; - int32_t minHeight = _guestWindowPageSizes[page][0].height; - int32_t maxWidth = _guestWindowPageSizes[page][1].width; - int32_t maxHeight = _guestWindowPageSizes[page][1].height; - - // Ensure min size is large enough for all tabs to fit - for (int32_t i = WIDX_TAB_1; i <= WIDX_TAB_7; i++) - { - if (!WidgetIsDisabled(*this, i)) + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) { - minWidth = std::max(minWidth, widgets[i].right + 3); + if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) + ToolCancel(); } } - maxWidth = std::max(minWidth, maxWidth); - WindowSetResize(*this, minWidth, minHeight, maxWidth, maxHeight); - } - - void OnPrepareDrawCommon() - { - if (_guestWindowPageWidgets[page] != widgets) + void OnMouseUp(WidgetIndex widx) override { + switch (widx) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + SetPage(widx - WIDX_TAB_1); + return; + } + + switch (page) + { + case WINDOW_GUEST_OVERVIEW: + OnMouseUpOverview(widx); + break; + } + } + void OnMouseDown(WidgetIndex widx) override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnMouseDownOverview(widx); + } + } + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnDropdownOverview(widgetIndex, selectedIndex); + } + } + void OnResize() override + { + switch (page) + { + case WINDOW_GUEST_OVERVIEW: + OnResizeOverview(); + break; + case WINDOW_GUEST_STATS: + case WINDOW_GUEST_RIDES: + case WINDOW_GUEST_FINANCE: + case WINDOW_GUEST_THOUGHTS: + case WINDOW_GUEST_INVENTORY: + case WINDOW_GUEST_DEBUG: + OnResizeCommon(); + break; + } + } + void OnUpdate() override + { + switch (page) + { + case WINDOW_GUEST_OVERVIEW: + OnUpdateOverview(); + break; + case WINDOW_GUEST_STATS: + OnUpdateStats(); + break; + case WINDOW_GUEST_RIDES: + OnUpdateRides(); + break; + case WINDOW_GUEST_FINANCE: + OnUpdateFinance(); + break; + case WINDOW_GUEST_THOUGHTS: + OnUpdateThoughts(); + break; + case WINDOW_GUEST_INVENTORY: + OnUpdateInventory(); + break; + case WINDOW_GUEST_DEBUG: + OnUpdateDebug(); + break; + } + } + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnToolUpdateOverview(widgetIndex, screenCoords); + } + } + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnToolDownOverview(widgetIndex, screenCoords); + } + } + void OnToolAbort(WidgetIndex widgetIndex) override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnToolAbortOverview(widgetIndex); + } + } + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnTextInputOverview(widgetIndex, text); + } + } + void OnViewportRotate() override + { + if (page == WINDOW_GUEST_OVERVIEW) + { + OnViewportRotateOverview(); + } + } + void OnDraw(DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_GUEST_OVERVIEW: + OnDrawOverview(dpi); + break; + case WINDOW_GUEST_STATS: + OnDrawStats(dpi); + break; + case WINDOW_GUEST_RIDES: + OnDrawRides(dpi); + break; + case WINDOW_GUEST_FINANCE: + OnDrawFinance(dpi); + break; + case WINDOW_GUEST_THOUGHTS: + OnDrawThoughts(dpi); + break; + case WINDOW_GUEST_INVENTORY: + OnDrawInventory(dpi); + break; + case WINDOW_GUEST_DEBUG: + OnDrawDebug(dpi); + break; + } + } + void OnPrepareDraw() override + { + OnPrepareDrawCommon(); + switch (page) + { + case WINDOW_GUEST_OVERVIEW: + OnPrepareDrawOverview(); + break; + case WINDOW_GUEST_RIDES: + OnPrepareDrawRides(); + break; + } + } + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + if (page == WINDOW_GUEST_RIDES) + { + return OnScrollGetSizeRides(scrollIndex); + } + return {}; + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (page == WINDOW_GUEST_RIDES) + { + OnScrollMouseOverRides(scrollIndex, screenCoords); + } + } + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (page == WINDOW_GUEST_RIDES) + { + OnScrollMouseDownRides(scrollIndex, screenCoords); + } + } + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + if (page == WINDOW_GUEST_RIDES) + { + OnScrollDrawRides(scrollIndex, dpi); + } + } + + private: + Guest* GetGuest() + { + auto guest = GetEntity(EntityId::FromUnderlying(number)); + if (guest == nullptr) + { + Close(); + return nullptr; + } + return guest; + } + + void OnResizeCommon() + { + // Get page specific min and max size + int32_t minWidth = _guestWindowPageSizes[page][0].width; + int32_t minHeight = _guestWindowPageSizes[page][0].height; + int32_t maxWidth = _guestWindowPageSizes[page][1].width; + int32_t maxHeight = _guestWindowPageSizes[page][1].height; + + // Ensure min size is large enough for all tabs to fit + for (int32_t i = WIDX_TAB_1; i <= WIDX_TAB_7; i++) + { + if (!WidgetIsDisabled(*this, i)) + { + minWidth = std::max(minWidth, widgets[i].right + 3); + } + } + maxWidth = std::max(minWidth, maxWidth); + + WindowSetResize(*this, minWidth, minHeight, maxWidth, maxHeight); + } + + void OnPrepareDrawCommon() + { + if (_guestWindowPageWidgets[page] != widgets) + { + widgets = _guestWindowPageWidgets[page]; + InitScrollWidgets(); + } + + pressed_widgets |= 1uLL << (page + WIDX_TAB_1); + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + auto ft = Formatter::Common(); + peep->FormatNameTo(ft); + + ResizeFrameWithPage(); + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + } + + void DisableWidgets() + { + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + uint64_t newDisabledWidgets = 0; + + if (peep->CanBePickedUp()) + { + if (WidgetIsDisabled(*this, WIDX_PICKUP)) + Invalidate(); + } + else + { + newDisabledWidgets = (1uLL << WIDX_PICKUP); + if (!WidgetIsDisabled(*this, WIDX_PICKUP)) + Invalidate(); + } + if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) + { + newDisabledWidgets |= (1uLL << WIDX_TAB_4); // Disable finance tab if no money + } + if (!gConfigGeneral.DebuggingTools) + { + newDisabledWidgets |= (1uLL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on + } + disabled_widgets = newDisabledWidgets; + } + + void SetPage(int32_t newPage) + { + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + { + if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification) + ToolCancel(); + } + int32_t listen = 0; + if (newPage == WINDOW_GUEST_OVERVIEW && page == WINDOW_GUEST_OVERVIEW && viewport != nullptr) + { + if (!(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) + listen = 1; + } + + page = newPage; + frame_no = 0; + _riddenRides.clear(); + selected_list_item = -1; + + RemoveViewport(); + + hold_down_widgets = 0; + pressed_widgets = 0; widgets = _guestWindowPageWidgets[page]; + DisableWidgets(); + Invalidate(); + OnResize(); + OnPrepareDraw(); InitScrollWidgets(); + Invalidate(); + + if (listen && viewport != nullptr) + viewport->flags |= VIEWPORT_FLAG_SOUND_ON; } - pressed_widgets |= 1uLL << (page + WIDX_TAB_1); - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - auto ft = Formatter::Common(); - peep->FormatNameTo(ft); - - ResizeFrameWithPage(); - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - } - - void DisableWidgets() - { - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - uint64_t newDisabledWidgets = 0; - - if (peep->CanBePickedUp()) - { - if (WidgetIsDisabled(*this, WIDX_PICKUP)) - Invalidate(); - } - else - { - newDisabledWidgets = (1uLL << WIDX_PICKUP); - if (!WidgetIsDisabled(*this, WIDX_PICKUP)) - Invalidate(); - } - if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) - { - newDisabledWidgets |= (1uLL << WIDX_TAB_4); // Disable finance tab if no money - } - if (!gConfigGeneral.DebuggingTools) - { - newDisabledWidgets |= (1uLL << WIDX_TAB_7); // Disable debug tab when debug tools not turned on - } - disabled_widgets = newDisabledWidgets; - } - - void SetPage(int32_t newPage) - { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - { - if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification) - ToolCancel(); - } - int32_t listen = 0; - if (newPage == WINDOW_GUEST_OVERVIEW && page == WINDOW_GUEST_OVERVIEW && viewport != nullptr) - { - if (!(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) - listen = 1; - } - - page = newPage; - frame_no = 0; - _riddenRides.clear(); - selected_list_item = -1; - - RemoveViewport(); - - hold_down_widgets = 0; - pressed_widgets = 0; - widgets = _guestWindowPageWidgets[page]; - DisableWidgets(); - Invalidate(); - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - Invalidate(); - - if (listen && viewport != nullptr) - viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - } - #pragma region Overview - void OverviewTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_1)) - return; - - const auto& widget = widgets[WIDX_TAB_1]; - int32_t widgWidth = widget.width() - 1; - int32_t widgHeight = widget.height() - 1; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; - if (page == WINDOW_GUEST_OVERVIEW) - widgHeight++; - - DrawPixelInfo clipDpi; - if (!ClipDrawPixelInfo(clipDpi, dpi, screenCoords, widgWidth, widgHeight)) + void OverviewTabDraw(DrawPixelInfo& dpi) { - return; - } - - screenCoords = ScreenCoordsXY{ 14, 20 }; - - const auto* peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - int32_t animationFrame = GetPeepAnimation(peep->SpriteType).base_image + 1; - - int32_t animationFrameOffset = 0; - - if (page == WINDOW_GUEST_OVERVIEW) - { - animationFrameOffset = _guestAnimationFrame; - animationFrameOffset &= 0xFFFC; - } - animationFrame += animationFrameOffset; - - auto spriteId = ImageId(animationFrame, peep->TshirtColour, peep->TrousersColour); - GfxDrawSprite(clipDpi, spriteId, screenCoords); - - auto* guest = peep->As(); - if (guest != nullptr) - { - // If holding a balloon - if (animationFrame >= 0x2A1D && animationFrame < 0x2A3D) - { - GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->BalloonColour), screenCoords); - } - - // If holding umbrella - if (animationFrame >= 0x2BBD && animationFrame < 0x2BDD) - { - GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->UmbrellaColour), screenCoords); - } - - // If wearing hat - if (animationFrame >= 0x29DD && animationFrame < 0x29FD) - { - GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->HatColour), screenCoords); - } - } - } - - void OnResizeOverview() - { - DisableWidgets(); - OnPrepareDraw(); - - WidgetInvalidate(*this, WIDX_MARQUEE); - - OnResizeCommon(); - - if (viewport != nullptr) - { - auto reqViewportWidth = width - 30; - auto reqViewportHeight = height - 72; - if (viewport->width != reqViewportWidth || viewport->height != reqViewportHeight) - { - viewport->width = reqViewportWidth; - viewport->height = reqViewportHeight; - viewport->view_width = viewport->zoom.ApplyInversedTo(viewport->width); - viewport->view_height = viewport->zoom.ApplyInversedTo(viewport->height); - } - } - OnViewportRotate(); - } - - void OnMouseUpOverview(WidgetIndex widgetIndex) - { - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - switch (widgetIndex) - { - case WIDX_PICKUP: - { - if (!peep->CanBePickedUp()) - { - return; - } - _pickedPeepX = peep->x; - CoordsXYZ nullLoc{}; - nullLoc.SetNull(); - PeepPickupAction pickupAction{ PeepPickupType::Pickup, EntityId::FromUnderlying(number), nullLoc, - NetworkGetCurrentPlayerId() }; - pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - return; - WindowBase* wind = WindowFindByNumber(WindowClass::Peep, peepnum); - if (wind != nullptr) - { - ToolSet(*wind, WC_PEEP__WIDX_PICKUP, Tool::Picker); - } - }); - GameActions::Execute(&pickupAction); - } - break; - case WIDX_RENAME: - { - auto peepName = peep->GetName(); - WindowTextInputRawOpen( - this, widgetIndex, STR_GUEST_RENAME_TITLE, STR_GUEST_RENAME_PROMPT, {}, peepName.c_str(), 32); - break; - } - case WIDX_TRACK: - { - uint32_t guestFlags = peep->PeepFlags ^ PEEP_FLAGS_TRACKING; - - auto guestSetFlagsAction = GuestSetFlagsAction(EntityId::FromUnderlying(number), guestFlags); - GameActions::Execute(&guestSetFlagsAction); - } - break; - } - } - - void OnMouseDownOverview(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_LOCATE: - ShowLocateDropdown(widgets[widgetIndex]); - break; - } - } - - void OnDropdownOverview(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_LOCATE: - { - if (dropdownIndex == 0) - { - ScrollToViewport(); - } - else if (dropdownIndex == 1) - { - GuestFollow(); - } - break; - } - } - } - - void ShowLocateDropdown(Widget& widget) - { - gDropdownItems[0].Format = STR_LOCATE_SUBJECT_TIP; - gDropdownItems[1].Format = STR_FOLLOW_SUBJECT_TIP; - - WindowDropdownShowText({ windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2); - gDropdownDefaultIndex = 0; - } - - void GuestFollow() - { - WindowBase* main = WindowGetMain(); - WindowFollowSprite(*main, EntityId::FromUnderlying(number)); - } - - void OnViewportRotateOverview() - { - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - ViewportUpdateSmartFollowGuest(this, *peep); - bool reCreateViewport = false; - uint16_t origViewportFlags{}; - if (viewport != nullptr) - { - if (focus.has_value()) + if (WidgetIsDisabled(*this, WIDX_TAB_1)) return; - origViewportFlags = viewport->flags; + const auto& widget = widgets[WIDX_TAB_1]; + int32_t widgWidth = widget.width() - 1; + int32_t widgHeight = widget.height() - 1; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; + if (page == WINDOW_GUEST_OVERVIEW) + widgHeight++; - reCreateViewport = true; - RemoveViewport(); + DrawPixelInfo clipDpi; + if (!ClipDrawPixelInfo(clipDpi, dpi, screenCoords, widgWidth, widgHeight)) + { + return; + } + + screenCoords = ScreenCoordsXY{ 14, 20 }; + + const auto* peep = GetGuest(); + if (peep == nullptr) + { + return; + } + + int32_t animationFrame = GetPeepAnimation(peep->SpriteType).base_image + 1; + + int32_t animationFrameOffset = 0; + + if (page == WINDOW_GUEST_OVERVIEW) + { + animationFrameOffset = _guestAnimationFrame; + animationFrameOffset &= 0xFFFC; + } + animationFrame += animationFrameOffset; + + auto spriteId = ImageId(animationFrame, peep->TshirtColour, peep->TrousersColour); + GfxDrawSprite(clipDpi, spriteId, screenCoords); + + auto* guest = peep->As(); + if (guest != nullptr) + { + // If holding a balloon + if (animationFrame >= 0x2A1D && animationFrame < 0x2A3D) + { + GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->BalloonColour), screenCoords); + } + + // If holding umbrella + if (animationFrame >= 0x2BBD && animationFrame < 0x2BDD) + { + GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->UmbrellaColour), screenCoords); + } + + // If wearing hat + if (animationFrame >= 0x29DD && animationFrame < 0x29FD) + { + GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->HatColour), screenCoords); + } + } } - OnPrepareDraw(); - - if (peep->State != PeepState::Picked && viewport == nullptr) + void OnResizeOverview() { - const auto& viewWidget = widgets[WIDX_VIEWPORT]; - auto screenPos = ScreenCoordsXY{ viewWidget.left + 1 + windowPos.x, viewWidget.top + 1 + windowPos.y }; - int32_t widgWidth = viewWidget.width() - 1; - int32_t widgHeight = viewWidget.height() - 1; + DisableWidgets(); + OnPrepareDraw(); - ViewportCreate(this, screenPos, widgWidth, widgHeight, focus.value()); - if (viewport != nullptr && reCreateViewport) + WidgetInvalidate(*this, WIDX_MARQUEE); + + OnResizeCommon(); + + if (viewport != nullptr) { - viewport->flags = origViewportFlags; + auto reqViewportWidth = width - 30; + auto reqViewportHeight = height - 72; + if (viewport->width != reqViewportWidth || viewport->height != reqViewportHeight) + { + viewport->width = reqViewportWidth; + viewport->height = reqViewportHeight; + viewport->view_width = viewport->zoom.ApplyInversedTo(viewport->width); + viewport->view_height = viewport->zoom.ApplyInversedTo(viewport->height); + } + } + OnViewportRotate(); + } + + void OnMouseUpOverview(WidgetIndex widgetIndex) + { + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + + switch (widgetIndex) + { + case WIDX_PICKUP: + { + if (!peep->CanBePickedUp()) + { + return; + } + _pickedPeepX = peep->x; + CoordsXYZ nullLoc{}; + nullLoc.SetNull(); + PeepPickupAction pickupAction{ PeepPickupType::Pickup, EntityId::FromUnderlying(number), nullLoc, + NetworkGetCurrentPlayerId() }; + pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + WindowBase* wind = WindowFindByNumber(WindowClass::Peep, peepnum); + if (wind != nullptr) + { + ToolSet(*wind, WC_PEEP__WIDX_PICKUP, Tool::Picker); + } + }); + GameActions::Execute(&pickupAction); + } + break; + case WIDX_RENAME: + { + auto peepName = peep->GetName(); + WindowTextInputRawOpen( + this, widgetIndex, STR_GUEST_RENAME_TITLE, STR_GUEST_RENAME_PROMPT, {}, peepName.c_str(), 32); + break; + } + case WIDX_TRACK: + { + uint32_t guestFlags = peep->PeepFlags ^ PEEP_FLAGS_TRACKING; + + auto guestSetFlagsAction = GuestSetFlagsAction(EntityId::FromUnderlying(number), guestFlags); + GameActions::Execute(&guestSetFlagsAction); + } + break; + } + } + + void OnMouseDownOverview(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_LOCATE: + ShowLocateDropdown(widgets[widgetIndex]); + break; + } + } + + void OnDropdownOverview(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_LOCATE: + { + if (dropdownIndex == 0) + { + ScrollToViewport(); + } + else if (dropdownIndex == 1) + { + GuestFollow(); + } + break; + } + } + } + + void ShowLocateDropdown(Widget& widget) + { + gDropdownItems[0].Format = STR_LOCATE_SUBJECT_TIP; + gDropdownItems[1].Format = STR_FOLLOW_SUBJECT_TIP; + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2); + gDropdownDefaultIndex = 0; + } + + void GuestFollow() + { + WindowBase* main = WindowGetMain(); + WindowFollowSprite(*main, EntityId::FromUnderlying(number)); + } + + void OnViewportRotateOverview() + { + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + + ViewportUpdateSmartFollowGuest(this, *peep); + bool reCreateViewport = false; + uint16_t origViewportFlags{}; + if (viewport != nullptr) + { + if (focus.has_value()) + return; + + origViewportFlags = viewport->flags; + + reCreateViewport = true; + RemoveViewport(); + } + + OnPrepareDraw(); + + if (peep->State != PeepState::Picked && viewport == nullptr) + { + const auto& viewWidget = widgets[WIDX_VIEWPORT]; + auto screenPos = ScreenCoordsXY{ viewWidget.left + 1 + windowPos.x, viewWidget.top + 1 + windowPos.y }; + int32_t widgWidth = viewWidget.width() - 1; + int32_t widgHeight = viewWidget.height() - 1; + + ViewportCreate(this, screenPos, widgWidth, widgHeight, focus.value()); + if (viewport != nullptr && reCreateViewport) + { + viewport->flags = origViewportFlags; + } + flags |= WF_NO_SCROLLING; + Invalidate(); } - flags |= WF_NO_SCROLLING; Invalidate(); } - Invalidate(); - } - void OnDrawOverview(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - // Draw the viewport no sound sprite - if (viewport != nullptr) + void OnDrawOverview(DrawPixelInfo& dpi) { - WindowDrawViewport(dpi, *this); - if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + // Draw the viewport no sound sprite + if (viewport != nullptr) { - GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); + WindowDrawViewport(dpi, *this); + if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + { + GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); + } } - } - // Draw the centred label - const auto* peep = GetGuest(); - if (peep == nullptr) - { - return; - } + // Draw the centred label + const auto* peep = GetGuest(); + if (peep == nullptr) + { + return; + } - const auto& actionLabelWidget = widgets[WIDX_ACTION_LBL]; - auto screenPos = windowPos + ScreenCoordsXY{ actionLabelWidget.midX(), actionLabelWidget.top - 1 }; + const auto& actionLabelWidget = widgets[WIDX_ACTION_LBL]; + auto screenPos = windowPos + ScreenCoordsXY{ actionLabelWidget.midX(), actionLabelWidget.top - 1 }; - { - auto ft = Formatter(); - peep->FormatActionTo(ft); - int32_t textWidth = actionLabelWidget.width(); - DrawTextEllipsised(dpi, screenPos, textWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); - } + { + auto ft = Formatter(); + peep->FormatActionTo(ft); + int32_t textWidth = actionLabelWidget.width(); + DrawTextEllipsised(dpi, screenPos, textWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); + } - // Draw the marquee thought - const auto& marqueeWidget = widgets[WIDX_MARQUEE]; - auto marqWidth = marqueeWidget.width() - 3; - int32_t left = marqueeWidget.left + 2 + windowPos.x; - int32_t top = marqueeWidget.top + windowPos.y; - int32_t marqHeight = marqueeWidget.height(); - DrawPixelInfo dpiMarquee; - if (!ClipDrawPixelInfo(dpiMarquee, dpi, { left, top }, marqWidth, marqHeight)) - { - return; - } + // Draw the marquee thought + const auto& marqueeWidget = widgets[WIDX_MARQUEE]; + auto marqWidth = marqueeWidget.width() - 3; + int32_t left = marqueeWidget.left + 2 + windowPos.x; + int32_t top = marqueeWidget.top + windowPos.y; + int32_t marqHeight = marqueeWidget.height(); + DrawPixelInfo dpiMarquee; + if (!ClipDrawPixelInfo(dpiMarquee, dpi, { left, top }, marqWidth, marqHeight)) + { + return; + } - int32_t i = 0; - for (; i < PEEP_MAX_THOUGHTS; ++i) - { - if (peep->Thoughts[i].type == PeepThoughtType::None) + int32_t i = 0; + for (; i < PEEP_MAX_THOUGHTS; ++i) + { + if (peep->Thoughts[i].type == PeepThoughtType::None) + { + _marqueePosition = 0; + return; + } + if (peep->Thoughts[i].freshness == 1) + { // If a fresh thought + break; + } + } + if (i == PEEP_MAX_THOUGHTS) { _marqueePosition = 0; return; } - if (peep->Thoughts[i].freshness == 1) - { // If a fresh thought - break; + + screenPos.x = marqueeWidget.width() - _marqueePosition; + { + auto ft = Formatter(); + PeepThoughtSetFormatArgs(&peep->Thoughts[i], ft); + DrawTextBasic(dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small }); } } - if (i == PEEP_MAX_THOUGHTS) + + void OnPrepareDrawOverview() { - _marqueePosition = 0; - return; - } - - screenPos.x = marqueeWidget.width() - _marqueePosition; - { - auto ft = Formatter(); - PeepThoughtSetFormatArgs(&peep->Thoughts[i], ft); - DrawTextBasic(dpiMarquee, { screenPos.x, 0 }, STR_WINDOW_COLOUR_2_STRINGID, ft, { FontStyle::Small }); - } - } - - void OnPrepareDrawOverview() - { - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - pressed_widgets &= ~(1uLL << WIDX_TRACK); - if (peep->PeepFlags & PEEP_FLAGS_TRACKING) - { - pressed_widgets |= (1uLL << WIDX_TRACK); - } - - widgets[WIDX_VIEWPORT].right = width - 26; - widgets[WIDX_VIEWPORT].bottom = height - 14; - - widgets[WIDX_ACTION_LBL].top = height - 12; - widgets[WIDX_ACTION_LBL].bottom = height - 3; - widgets[WIDX_ACTION_LBL].right = width - 24; - - widgets[WIDX_MARQUEE].right = width - 24; - - widgets[WIDX_PICKUP].right = width - 2; - widgets[WIDX_RENAME].right = width - 2; - widgets[WIDX_LOCATE].right = width - 2; - widgets[WIDX_TRACK].right = width - 2; - - widgets[WIDX_PICKUP].left = width - 25; - widgets[WIDX_RENAME].left = width - 25; - widgets[WIDX_LOCATE].left = width - 25; - widgets[WIDX_TRACK].left = width - 25; - } - - void OnUpdateOverview() - { - _guestAnimationFrame++; - _guestAnimationFrame %= 24; - - // Update pickup animation, can only happen in this tab. - picked_peep_frame++; - picked_peep_frame %= 48; - - WidgetInvalidate(*this, WIDX_TAB_1); - WidgetInvalidate(*this, WIDX_TAB_2); - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_ACTION) - { - peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_ACTION; - WidgetInvalidate(*this, WIDX_ACTION_LBL); - } - - _marqueePosition += 2; - - _beingWatchedTimer++; - - // Disable peep watching thought for multiplayer as it's client specific - if (NetworkGetMode() == NETWORK_MODE_NONE) - { - // Create the "I have the strangest feeling I am being watched thought" - if (_beingWatchedTimer >= 3840) + const auto peep = GetGuest(); + if (peep == nullptr) { - if (!(_beingWatchedTimer & 0x3FF)) + return; + } + pressed_widgets &= ~(1uLL << WIDX_TRACK); + if (peep->PeepFlags & PEEP_FLAGS_TRACKING) + { + pressed_widgets |= (1uLL << WIDX_TRACK); + } + + widgets[WIDX_VIEWPORT].right = width - 26; + widgets[WIDX_VIEWPORT].bottom = height - 14; + + widgets[WIDX_ACTION_LBL].top = height - 12; + widgets[WIDX_ACTION_LBL].bottom = height - 3; + widgets[WIDX_ACTION_LBL].right = width - 24; + + widgets[WIDX_MARQUEE].right = width - 24; + + widgets[WIDX_PICKUP].right = width - 2; + widgets[WIDX_RENAME].right = width - 2; + widgets[WIDX_LOCATE].right = width - 2; + widgets[WIDX_TRACK].right = width - 2; + + widgets[WIDX_PICKUP].left = width - 25; + widgets[WIDX_RENAME].left = width - 25; + widgets[WIDX_LOCATE].left = width - 25; + widgets[WIDX_TRACK].left = width - 25; + } + + void OnUpdateOverview() + { + _guestAnimationFrame++; + _guestAnimationFrame %= 24; + + // Update pickup animation, can only happen in this tab. + picked_peep_frame++; + picked_peep_frame %= 48; + + WidgetInvalidate(*this, WIDX_TAB_1); + WidgetInvalidate(*this, WIDX_TAB_2); + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_ACTION) + { + peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_ACTION; + WidgetInvalidate(*this, WIDX_ACTION_LBL); + } + + _marqueePosition += 2; + + _beingWatchedTimer++; + + // Disable peep watching thought for multiplayer as it's client specific + if (NetworkGetMode() == NETWORK_MODE_NONE) + { + // Create the "I have the strangest feeling I am being watched thought" + if (_beingWatchedTimer >= 3840) { - int32_t random = UtilRand() & 0xFFFF; - if (random <= 0x2AAA) + if (!(_beingWatchedTimer & 0x3FF)) { - peep->InsertNewThought(PeepThoughtType::Watched); + int32_t random = UtilRand() & 0xFFFF; + if (random <= 0x2AAA) + { + peep->InsertNewThought(PeepThoughtType::Watched); + } } } } } - } - void OnTextInputOverview(WidgetIndex widgetIndex, std::string_view text) - { - if (widgetIndex != WIDX_RENAME) - return; - - if (text.empty()) - return; - std::string sText(text); - auto gameAction = GuestSetNameAction(EntityId::FromUnderlying(number), sText); - GameActions::Execute(&gameAction); - } - - void OnToolUpdateOverview(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (widgetIndex != WIDX_PICKUP) - return; - - MapInvalidateSelectionRect(); - - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); - if (!mapCoords.IsNull()) + void OnTextInputOverview(WidgetIndex widgetIndex, std::string_view text) { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords; - MapInvalidateSelectionRect(); - } - - gPickupPeepImage = ImageId(); - - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); - if (info.SpriteType == ViewportInteractionItem::None) - return; - - gPickupPeepX = screenCoords.x - 1; - gPickupPeepY = screenCoords.y + 16; - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - auto baseImageId = GetPeepAnimation(peep->SpriteType, PeepActionSpriteType::Ui).base_image; - baseImageId += picked_peep_frame >> 2; - gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour); - } - - void OnToolDownOverview(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (widgetIndex != WIDX_PICKUP) - return; - - TileElement* tileElement; - auto destCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); - - if (destCoords.IsNull()) - return; - - PeepPickupAction pickupAction{ PeepPickupType::Place, - EntityId::FromUnderlying(number), - { destCoords, tileElement->GetBaseZ() }, - NetworkGetCurrentPlayerId() }; - pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + if (widgetIndex != WIDX_RENAME) return; - ToolCancel(); + + if (text.empty()) + return; + std::string sText(text); + auto gameAction = GuestSetNameAction(EntityId::FromUnderlying(number), sText); + GameActions::Execute(&gameAction); + } + + void OnToolUpdateOverview(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetIndex != WIDX_PICKUP) + return; + + MapInvalidateSelectionRect(); + + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + + auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); + if (!mapCoords.IsNull()) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords; + MapInvalidateSelectionRect(); + } + gPickupPeepImage = ImageId(); - }); - GameActions::Execute(&pickupAction); - } - void OnToolAbortOverview(WidgetIndex widgetIndex) - { - if (widgetIndex != WIDX_PICKUP) - return; + auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); + if (info.SpriteType == ViewportInteractionItem::None) + return; - PeepPickupAction pickupAction{ - PeepPickupType::Cancel, EntityId::FromUnderlying(number), { _pickedPeepX, 0, 0 }, NetworkGetCurrentPlayerId() - }; - GameActions::Execute(&pickupAction); - } + gPickupPeepX = screenCoords.x - 1; + gPickupPeepY = screenCoords.y + 16; + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + + auto baseImageId = GetPeepAnimation(peep->SpriteType, PeepActionSpriteType::Ui).base_image; + baseImageId += picked_peep_frame >> 2; + gPickupPeepImage = ImageId(baseImageId, peep->TshirtColour, peep->TrousersColour); + } + + void OnToolDownOverview(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetIndex != WIDX_PICKUP) + return; + + TileElement* tileElement; + auto destCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); + + if (destCoords.IsNull()) + return; + + PeepPickupAction pickupAction{ PeepPickupType::Place, + EntityId::FromUnderlying(number), + { destCoords, tileElement->GetBaseZ() }, + NetworkGetCurrentPlayerId() }; + pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + ToolCancel(); + gPickupPeepImage = ImageId(); + }); + GameActions::Execute(&pickupAction); + } + + void OnToolAbortOverview(WidgetIndex widgetIndex) + { + if (widgetIndex != WIDX_PICKUP) + return; + + PeepPickupAction pickupAction{ + PeepPickupType::Cancel, EntityId::FromUnderlying(number), { _pickedPeepX, 0, 0 }, NetworkGetCurrentPlayerId() + }; + GameActions::Execute(&pickupAction); + } #pragma endregion #pragma region Stats - void StatsTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_2)) - return; - - const auto& widget = widgets[WIDX_TAB_2]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - - const auto peep = GetGuest(); - if (peep == nullptr) + void StatsTabDraw(DrawPixelInfo& dpi) { - return; - } - int32_t imageId = GetPeepFaceSpriteLarge(peep); - if (page == WINDOW_GUEST_STATS) - { - // If currently viewing this tab animate tab - // if it is very sick or angry. - switch (imageId) - { - case SPR_PEEP_LARGE_FACE_VERY_VERY_SICK_0: - imageId += (frame_no / 4) & 0xF; - break; - case SPR_PEEP_LARGE_FACE_VERY_SICK_0: - imageId += (frame_no / 8) & 0x3; - break; - case SPR_PEEP_LARGE_FACE_ANGRY_0: - imageId += (frame_no / 8) & 0x3; - break; - } - } - GfxDrawSprite(dpi, ImageId(imageId), screenCoords); - } - - void OnUpdateStats() - { - frame_no++; - auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_STATS; - - Invalidate(); - } - - void StatsBarsDraw(int32_t value, const ScreenCoordsXY& origCoords, DrawPixelInfo& dpi, int32_t colour, bool blinkFlag) - { - auto coords = origCoords; - if (FontGetLineHeight(FontStyle::Medium) > 10) - { - coords.y += 1; - } - - GfxFillRectInset( - dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30); - - if (!blinkFlag || GameIsPaused() || (gCurrentRealTimeTicks & 8) == 0) - { - value *= 118; - value >>= 8; - - if (value <= 2) + if (WidgetIsDisabled(*this, WIDX_TAB_2)) return; + const auto& widget = widgets[WIDX_TAB_2]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + int32_t imageId = GetPeepFaceSpriteLarge(peep); + if (page == WINDOW_GUEST_STATS) + { + // If currently viewing this tab animate tab + // if it is very sick or angry. + switch (imageId) + { + case SPR_PEEP_LARGE_FACE_VERY_VERY_SICK_0: + imageId += (frame_no / 4) & 0xF; + break; + case SPR_PEEP_LARGE_FACE_VERY_SICK_0: + imageId += (frame_no / 8) & 0x3; + break; + case SPR_PEEP_LARGE_FACE_ANGRY_0: + imageId += (frame_no / 8) & 0x3; + break; + } + } + GfxDrawSprite(dpi, ImageId(imageId), screenCoords); + } + + void OnUpdateStats() + { + frame_no++; + auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_STATS; + + Invalidate(); + } + + void StatsBarsDraw(int32_t value, const ScreenCoordsXY& origCoords, DrawPixelInfo& dpi, int32_t colour, bool blinkFlag) + { + auto coords = origCoords; + if (FontGetLineHeight(FontStyle::Medium) > 10) + { + coords.y += 1; + } + GfxFillRectInset( - dpi, { coords + ScreenCoordsXY{ 63, 2 }, coords + ScreenCoordsXY{ 63 + value - 1, 8 } }, colour, 0); - } - } + dpi, { coords + ScreenCoordsXY{ 61, 1 }, coords + ScreenCoordsXY{ 61 + 121, 9 } }, colours[1], INSET_RECT_F_30); - /** - * Takes a guest stat value (scaled to currMax) and adjusts it to be scaled out of 255. - * Then clamp the value to between newMin and 255. - */ - int32_t NormalizeGuestStatValue(int32_t value, int32_t currMax, int32_t newMin) const - { - int32_t newValue = (value * 255) / currMax; - return std::clamp(newValue, newMin, 255); - } - - void OnDrawStats(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - // ebx - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - // Not sure why this is not stats widgets - // cx dx - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - - // Happiness - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HAPPINESS_LABEL); - - int32_t happiness = NormalizeGuestStatValue(peep->Happiness, PEEP_MAX_HAPPINESS, 10); - int32_t barColour = COLOUR_BRIGHT_GREEN; - bool barBlink = happiness < 50; - StatsBarsDraw(happiness, screenCoords, dpi, barColour, barBlink); - - // Energy - screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL); - - int32_t energy = NormalizeGuestStatValue(peep->Energy - PEEP_MIN_ENERGY, PEEP_MAX_ENERGY - PEEP_MIN_ENERGY, 10); - barColour = COLOUR_BRIGHT_GREEN; - barBlink = energy < 50; - StatsBarsDraw(energy, screenCoords, dpi, barColour, barBlink); - - // Hunger - screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL); - - int32_t hunger = NormalizeGuestStatValue(peep->Hunger - 32, 158, 0); - hunger = 255 - hunger; // the bar should be longer when peep->Hunger is low - barColour = COLOUR_BRIGHT_RED; - barBlink = hunger > 170; - StatsBarsDraw(hunger, screenCoords, dpi, barColour, barBlink); - - // Thirst - screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL); - - int32_t thirst = NormalizeGuestStatValue(peep->Thirst - 32, 158, 0); - thirst = 255 - thirst; // the bar should be longer when peep->Thirst is low - barColour = COLOUR_BRIGHT_RED; - barBlink = thirst > 170; - StatsBarsDraw(thirst, screenCoords, dpi, barColour, barBlink); - - // Nausea - screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL); - - int32_t nausea = NormalizeGuestStatValue(peep->Nausea - 32, 223, 0); - barColour = COLOUR_BRIGHT_RED; - barBlink = nausea > 120; - StatsBarsDraw(nausea, screenCoords, dpi, barColour, barBlink); - - // Toilet - screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL); - - int32_t toilet = NormalizeGuestStatValue(peep->Toilet - 64, 178, 0); - barColour = COLOUR_BRIGHT_RED; - barBlink = toilet > 160; - StatsBarsDraw(toilet, screenCoords, dpi, barColour, barBlink); - - // Time in park - screenCoords.y += LIST_ROW_HEIGHT + 1; - int32_t guestEntryTime = peep->GetParkEntryTime(); - if (guestEntryTime != -1) - { - int32_t timeInPark = (GetGameState().CurrentTicks - guestEntryTime) >> 11; - auto ft = Formatter(); - ft.Add(timeInPark & 0xFFFF); - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft); - } - - screenCoords.y += LIST_ROW_HEIGHT + 9; - GfxFillRectInset( - dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); - - // Preferred Ride - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE); - screenCoords.y += LIST_ROW_HEIGHT; - - // Intensity - { - auto ft = Formatter(); - auto maxIntensity = peep->Intensity.GetMaximum(); - int32_t string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BELOW; - if (peep->Intensity.GetMinimum() != 0) + if (!blinkFlag || GameIsPaused() || (gCurrentRealTimeTicks & 8) == 0) { - ft.Add(peep->Intensity.GetMinimum()); - ft.Add(maxIntensity); - string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BETWEEN; - if (maxIntensity == 15) - string_id = STR_GUEST_STAT_PREFERRED_INTESITY_ABOVE; + value *= 118; + value >>= 8; + + if (value <= 2) + return; + + GfxFillRectInset( + dpi, { coords + ScreenCoordsXY{ 63, 2 }, coords + ScreenCoordsXY{ 63 + value - 1, 8 } }, colour, 0); } - else + } + + /** + * Takes a guest stat value (scaled to currMax) and adjusts it to be scaled out of 255. + * Then clamp the value to between newMin and 255. + */ + int32_t NormalizeGuestStatValue(int32_t value, int32_t currMax, int32_t newMin) const + { + int32_t newValue = (value * 255) / currMax; + return std::clamp(newValue, newMin, 255); + } + + void OnDrawStats(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + // ebx + const auto peep = GetGuest(); + if (peep == nullptr) { - ft.Add(maxIntensity); + return; } - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, string_id, ft); - } + // Not sure why this is not stats widgets + // cx dx + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - // Nausea tolerance - { - static constexpr StringId _nauseaTolerances[] = { - STR_PEEP_STAT_NAUSEA_TOLERANCE_NONE, - STR_PEEP_STAT_NAUSEA_TOLERANCE_LOW, - STR_PEEP_STAT_NAUSEA_TOLERANCE_AVERAGE, - STR_PEEP_STAT_NAUSEA_TOLERANCE_HIGH, - }; + // Happiness + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HAPPINESS_LABEL); + + int32_t happiness = NormalizeGuestStatValue(peep->Happiness, PEEP_MAX_HAPPINESS, 10); + int32_t barColour = COLOUR_BRIGHT_GREEN; + bool barBlink = happiness < 50; + StatsBarsDraw(happiness, screenCoords, dpi, barColour, barBlink); + + // Energy screenCoords.y += LIST_ROW_HEIGHT; - auto nausea_tolerance = EnumValue(peep->NauseaTolerance) & 0x3; - auto ft = Formatter(); - ft.Add(_nauseaTolerances[nausea_tolerance]); - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_ENERGY_LABEL); + + int32_t energy = NormalizeGuestStatValue(peep->Energy - PEEP_MIN_ENERGY, PEEP_MAX_ENERGY - PEEP_MIN_ENERGY, 10); + barColour = COLOUR_BRIGHT_GREEN; + barBlink = energy < 50; + StatsBarsDraw(energy, screenCoords, dpi, barColour, barBlink); + + // Hunger + screenCoords.y += LIST_ROW_HEIGHT; + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_HUNGER_LABEL); + + int32_t hunger = NormalizeGuestStatValue(peep->Hunger - 32, 158, 0); + hunger = 255 - hunger; // the bar should be longer when peep->Hunger is low + barColour = COLOUR_BRIGHT_RED; + barBlink = hunger > 170; + StatsBarsDraw(hunger, screenCoords, dpi, barColour, barBlink); + + // Thirst + screenCoords.y += LIST_ROW_HEIGHT; + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_THIRST_LABEL); + + int32_t thirst = NormalizeGuestStatValue(peep->Thirst - 32, 158, 0); + thirst = 255 - thirst; // the bar should be longer when peep->Thirst is low + barColour = COLOUR_BRIGHT_RED; + barBlink = thirst > 170; + StatsBarsDraw(thirst, screenCoords, dpi, barColour, barBlink); + + // Nausea + screenCoords.y += LIST_ROW_HEIGHT; + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_LABEL); + + int32_t nausea = NormalizeGuestStatValue(peep->Nausea - 32, 223, 0); + barColour = COLOUR_BRIGHT_RED; + barBlink = nausea > 120; + StatsBarsDraw(nausea, screenCoords, dpi, barColour, barBlink); + + // Toilet + screenCoords.y += LIST_ROW_HEIGHT; + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TOILET_LABEL); + + int32_t toilet = NormalizeGuestStatValue(peep->Toilet - 64, 178, 0); + barColour = COLOUR_BRIGHT_RED; + barBlink = toilet > 160; + StatsBarsDraw(toilet, screenCoords, dpi, barColour, barBlink); + + // Time in park + screenCoords.y += LIST_ROW_HEIGHT + 1; + int32_t guestEntryTime = peep->GetParkEntryTime(); + if (guestEntryTime != -1) + { + int32_t timeInPark = (GetGameState().CurrentTicks - guestEntryTime) >> 11; + auto ft = Formatter(); + ft.Add(timeInPark & 0xFFFF); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_TIME_IN_PARK, ft); + } + + screenCoords.y += LIST_ROW_HEIGHT + 9; + GfxFillRectInset( + dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1], + INSET_RECT_FLAG_BORDER_INSET); + + // Preferred Ride + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_PREFERRED_RIDE); + screenCoords.y += LIST_ROW_HEIGHT; + + // Intensity + { + auto ft = Formatter(); + auto maxIntensity = peep->Intensity.GetMaximum(); + int32_t string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BELOW; + if (peep->Intensity.GetMinimum() != 0) + { + ft.Add(peep->Intensity.GetMinimum()); + ft.Add(maxIntensity); + string_id = STR_GUEST_STAT_PREFERRED_INTESITY_BETWEEN; + if (maxIntensity == 15) + string_id = STR_GUEST_STAT_PREFERRED_INTESITY_ABOVE; + } + else + { + ft.Add(maxIntensity); + } + + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 4, 0 }, string_id, ft); + } + + // Nausea tolerance + { + static constexpr StringId _nauseaTolerances[] = { + STR_PEEP_STAT_NAUSEA_TOLERANCE_NONE, + STR_PEEP_STAT_NAUSEA_TOLERANCE_LOW, + STR_PEEP_STAT_NAUSEA_TOLERANCE_AVERAGE, + STR_PEEP_STAT_NAUSEA_TOLERANCE_HIGH, + }; + screenCoords.y += LIST_ROW_HEIGHT; + auto nausea_tolerance = EnumValue(peep->NauseaTolerance) & 0x3; + auto ft = Formatter(); + ft.Add(_nauseaTolerances[nausea_tolerance]); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_NAUSEA_TOLERANCE, ft); + } } - } #pragma endregion #pragma region Rides - void RidesTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_3)) - return; - - const auto& widget = widgets[WIDX_TAB_3]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - - int32_t imageId = SPR_TAB_RIDE_0; - - if (page == WINDOW_GUEST_RIDES) + void RidesTabDraw(DrawPixelInfo& dpi) { - imageId += (frame_no / 4) & 0xF; - } + if (WidgetIsDisabled(*this, WIDX_TAB_3)) + return; - GfxDrawSprite(dpi, ImageId(imageId), screenCoords); - } + const auto& widget = widgets[WIDX_TAB_3]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - void OnUpdateRides() - { - frame_no++; + int32_t imageId = SPR_TAB_RIDE_0; - WidgetInvalidate(*this, WIDX_TAB_2); - WidgetInvalidate(*this, WIDX_TAB_3); - - const auto guest = GetGuest(); - if (guest == nullptr) - { - return; - } - - // Every 2048 ticks do a full window_invalidate - int32_t numTicks = GetGameState().CurrentTicks - guest->GetParkEntryTime(); - if (!(numTicks & 0x7FF)) - Invalidate(); - - const auto oldSize = _riddenRides.size(); - _riddenRides.clear(); - for (const auto& r : GetRideManager()) - { - if (r.IsRide() && guest->HasRidden(r)) + if (page == WINDOW_GUEST_RIDES) { - _riddenRides.push_back(r.id); + imageId += (frame_no / 4) & 0xF; + } + + GfxDrawSprite(dpi, ImageId(imageId), screenCoords); + } + + void OnUpdateRides() + { + frame_no++; + + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_3); + + const auto guest = GetGuest(); + if (guest == nullptr) + { + return; + } + + // Every 2048 ticks do a full window_invalidate + int32_t numTicks = GetGameState().CurrentTicks - guest->GetParkEntryTime(); + if (!(numTicks & 0x7FF)) + Invalidate(); + + const auto oldSize = _riddenRides.size(); + _riddenRides.clear(); + for (const auto& r : GetRideManager()) + { + if (r.IsRide() && guest->HasRidden(r)) + { + _riddenRides.push_back(r.id); + } + } + + // If there are new items + if (oldSize != _riddenRides.size()) + { + Invalidate(); } } - // If there are new items - if (oldSize != _riddenRides.size()) + ScreenSize OnScrollGetSizeRides(int32_t scrollIndex) { - Invalidate(); - } - } + ScreenSize newSize; + newSize.height = static_cast(_riddenRides.size()) * 10; - ScreenSize OnScrollGetSizeRides(int32_t scrollIndex) - { - ScreenSize newSize; - newSize.height = static_cast(_riddenRides.size()) * 10; - - if (selected_list_item != -1) - { - selected_list_item = -1; - Invalidate(); - } - - int32_t visableHeight = newSize.height - widgets[WIDX_RIDE_SCROLL].bottom + widgets[WIDX_RIDE_SCROLL].top + 21; - - if (visableHeight < 0) - visableHeight = 0; - - if (visableHeight < scrolls[0].v_top) - { - scrolls[0].v_top = visableHeight; - Invalidate(); - } - return newSize; - } - - void OnScrollMouseDownRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) - { - auto index = screenCoords.y / 10; - if (index >= static_cast(_riddenRides.size())) - return; - - auto intent = Intent(WindowClass::Ride); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, _riddenRides[index]); - ContextOpenIntent(&intent); - } - - void OnScrollMouseOverRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) - { - auto index = screenCoords.y / 10; - if (index >= static_cast(_riddenRides.size())) - return; - - if (index == selected_list_item) - return; - selected_list_item = index; - - Invalidate(); - } - - void OnPrepareDrawRides() - { - widgets[WIDX_RIDE_SCROLL].right = width - 4; - widgets[WIDX_RIDE_SCROLL].bottom = height - 15; - } - - void OnDrawRides(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - // cx dx - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 2, widgets[WIDX_PAGE_BACKGROUND].top + 2 }; - - DrawTextBasic(dpi, screenCoords, STR_GUEST_LABEL_RIDES_BEEN_ON); - - screenCoords.y = windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 12; - - auto ft = Formatter(); - auto* r = GetRide(peep->FavouriteRide); - if (r != nullptr) - { - r->FormatNameTo(ft); - } - else - { - ft.Add(STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE); - } - - DrawTextEllipsised(dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft); - } - - void OnScrollDrawRides(int32_t scrollIndex, DrawPixelInfo& dpi) - { - auto colour = ColourMapA[colours[1]].mid_light; - GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour); - - for (int32_t listIndex = 0; listIndex < static_cast(_riddenRides.size()); listIndex++) - { - int32_t y = listIndex * 10; - StringId stringId = STR_BLACK_STRING; - if (listIndex == selected_list_item) + if (selected_list_item != -1) { - GfxFilterRect(dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1); - stringId = STR_WINDOW_COLOUR_2_STRINGID; + selected_list_item = -1; + Invalidate(); } - auto* r = GetRide(_riddenRides[listIndex]); + int32_t visableHeight = newSize.height - widgets[WIDX_RIDE_SCROLL].bottom + widgets[WIDX_RIDE_SCROLL].top + 21; + + if (visableHeight < 0) + visableHeight = 0; + + if (visableHeight < scrolls[0].v_top) + { + scrolls[0].v_top = visableHeight; + Invalidate(); + } + return newSize; + } + + void OnScrollMouseDownRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) + { + auto index = screenCoords.y / 10; + if (index >= static_cast(_riddenRides.size())) + return; + + auto intent = Intent(WindowClass::Ride); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, _riddenRides[index]); + ContextOpenIntent(&intent); + } + + void OnScrollMouseOverRides(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) + { + auto index = screenCoords.y / 10; + if (index >= static_cast(_riddenRides.size())) + return; + + if (index == selected_list_item) + return; + selected_list_item = index; + + Invalidate(); + } + + void OnPrepareDrawRides() + { + widgets[WIDX_RIDE_SCROLL].right = width - 4; + widgets[WIDX_RIDE_SCROLL].bottom = height - 15; + } + + void OnDrawRides(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + + // cx dx + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 2, widgets[WIDX_PAGE_BACKGROUND].top + 2 }; + + DrawTextBasic(dpi, screenCoords, STR_GUEST_LABEL_RIDES_BEEN_ON); + + screenCoords.y = windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 12; + + auto ft = Formatter(); + auto* r = GetRide(peep->FavouriteRide); if (r != nullptr) { - auto ft = Formatter(); r->FormatNameTo(ft); - DrawTextBasic(dpi, { 0, y - 1 }, stringId, ft); + } + else + { + ft.Add(STR_PEEP_FAVOURITE_RIDE_NOT_AVAILABLE); + } + + DrawTextEllipsised(dpi, screenCoords, width - 14, STR_FAVOURITE_RIDE, ft); + } + + void OnScrollDrawRides(int32_t scrollIndex, DrawPixelInfo& dpi) + { + auto colour = ColourMapA[colours[1]].mid_light; + GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, colour); + + for (int32_t listIndex = 0; listIndex < static_cast(_riddenRides.size()); listIndex++) + { + int32_t y = listIndex * 10; + StringId stringId = STR_BLACK_STRING; + if (listIndex == selected_list_item) + { + GfxFilterRect(dpi, { 0, y, 800, y + 9 }, FilterPaletteID::PaletteDarken1); + stringId = STR_WINDOW_COLOUR_2_STRINGID; + } + + auto* r = GetRide(_riddenRides[listIndex]); + if (r != nullptr) + { + auto ft = Formatter(); + r->FormatNameTo(ft); + DrawTextBasic(dpi, { 0, y - 1 }, stringId, ft); + } } } - } #pragma endregion #pragma region Finance - void FinanceTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_4)) - return; - - const auto& widget = widgets[WIDX_TAB_4]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - - int32_t imageId = SPR_TAB_FINANCES_SUMMARY_0; - - if (page == WINDOW_GUEST_FINANCE) + void FinanceTabDraw(DrawPixelInfo& dpi) { - imageId += (frame_no / 2) & 0x7; - } + if (WidgetIsDisabled(*this, WIDX_TAB_4)) + return; - GfxDrawSprite(dpi, ImageId(imageId), screenCoords); - } + const auto& widget = widgets[WIDX_TAB_4]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - void OnUpdateFinance() - { - frame_no++; + int32_t imageId = SPR_TAB_FINANCES_SUMMARY_0; - WidgetInvalidate(*this, WIDX_TAB_2); - WidgetInvalidate(*this, WIDX_TAB_4); - } - - void OnDrawFinance(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - // cx dx - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - - // Cash in pocket - { - auto ft = Formatter(); - ft.Add(peep->CashInPocket); - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - // Cash spent - { - auto ft = Formatter(); - ft.Add(peep->CashSpent); - DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft); - screenCoords.y += LIST_ROW_HEIGHT * 2; - } - - GfxFillRectInset( - dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); - - // Paid to enter - { - auto ft = Formatter(); - ft.Add(peep->PaidToEnter); - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - // Paid on rides - { - auto ft = Formatter(); - ft.Add(peep->PaidOnRides); - ft.Add(peep->GuestNumRides); - if (peep->GuestNumRides != 1) + if (page == WINDOW_GUEST_FINANCE) { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE_PLURAL, ft); + imageId += (frame_no / 2) & 0x7; } - else - { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; - } - // Paid on food - { - auto ft = Formatter(); - ft.Add(peep->PaidOnFood); - ft.Add(peep->AmountOfFood); - if (peep->AmountOfFood != 1) - { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD_PLURAL, ft); - } - else - { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; + + GfxDrawSprite(dpi, ImageId(imageId), screenCoords); } - // Paid on drinks + void OnUpdateFinance() { - auto ft = Formatter(); - ft.Add(peep->PaidOnDrink); - ft.Add(peep->AmountOfDrinks); - if (peep->AmountOfDrinks != 1) - { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK_PLURAL, ft); - } - else - { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; + frame_no++; + + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_4); } - // Paid on souvenirs + + void OnDrawFinance(DrawPixelInfo& dpi) { - auto ft = Formatter(); - ft.Add(peep->PaidOnSouvenirs); - ft.Add(peep->AmountOfSouvenirs); - if (peep->AmountOfSouvenirs != 1) + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + const auto peep = GetGuest(); + if (peep == nullptr) { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, ft); + return; } - else + + // cx dx + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + + // Cash in pocket { - DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR, ft); + auto ft = Formatter(); + ft.Add(peep->CashInPocket); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_IN_POCKET, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + // Cash spent + { + auto ft = Formatter(); + ft.Add(peep->CashSpent); + DrawTextBasic(dpi, screenCoords, STR_GUEST_STAT_CASH_SPENT, ft); + screenCoords.y += LIST_ROW_HEIGHT * 2; + } + + GfxFillRectInset( + dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 179, -5 } }, colours[1], + INSET_RECT_FLAG_BORDER_INSET); + + // Paid to enter + { + auto ft = Formatter(); + ft.Add(peep->PaidToEnter); + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_ENTRANCE_FEE, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + // Paid on rides + { + auto ft = Formatter(); + ft.Add(peep->PaidOnRides); + ft.Add(peep->GuestNumRides); + if (peep->GuestNumRides != 1) + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE_PLURAL, ft); + } + else + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_RIDE, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + } + // Paid on food + { + auto ft = Formatter(); + ft.Add(peep->PaidOnFood); + ft.Add(peep->AmountOfFood); + if (peep->AmountOfFood != 1) + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD_PLURAL, ft); + } + else + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_FOOD, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + } + + // Paid on drinks + { + auto ft = Formatter(); + ft.Add(peep->PaidOnDrink); + ft.Add(peep->AmountOfDrinks); + if (peep->AmountOfDrinks != 1) + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK_PLURAL, ft); + } + else + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_DRINK, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + } + // Paid on souvenirs + { + auto ft = Formatter(); + ft.Add(peep->PaidOnSouvenirs); + ft.Add(peep->AmountOfSouvenirs); + if (peep->AmountOfSouvenirs != 1) + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR_PLURAL, ft); + } + else + { + DrawTextBasic(dpi, screenCoords, STR_GUEST_EXPENSES_SOUVENIR, ft); + } } } - } #pragma endregion #pragma region Thoughts - void ThoughtsTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_5)) - return; - - const auto& widget = widgets[WIDX_TAB_5]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - - int32_t imageId = SPR_TAB_THOUGHTS_0; - - if (page == WINDOW_GUEST_THOUGHTS) + void ThoughtsTabDraw(DrawPixelInfo& dpi) { - imageId += (frame_no / 2) & 0x7; - } - - GfxDrawSprite(dpi, ImageId(imageId), screenCoords); - } - - void OnUpdateThoughts() - { - frame_no++; - - WidgetInvalidate(*this, WIDX_TAB_2); - WidgetInvalidate(*this, WIDX_TAB_5); - - auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_THOUGHTS) - { - peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_THOUGHTS; - Invalidate(); - } - } - - void OnDrawThoughts(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - - // cx dx - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - - DrawTextBasic(dpi, screenCoords, STR_GUEST_RECENT_THOUGHTS_LABEL); - - screenCoords.y += 10; - for (const auto& thought : peep->Thoughts) - { - if (thought.type == PeepThoughtType::None) + if (WidgetIsDisabled(*this, WIDX_TAB_5)) return; - if (thought.freshness == 0) - continue; - int32_t widgWidth = widgets[WIDX_PAGE_BACKGROUND].right - widgets[WIDX_PAGE_BACKGROUND].left - 8; + const auto& widget = widgets[WIDX_TAB_5]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - auto ft = Formatter(); - PeepThoughtSetFormatArgs(&thought, ft); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small }); + int32_t imageId = SPR_TAB_THOUGHTS_0; - // If this is the last visible line end drawing. - if (screenCoords.y > windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 32) + if (page == WINDOW_GUEST_THOUGHTS) + { + imageId += (frame_no / 2) & 0x7; + } + + GfxDrawSprite(dpi, ImageId(imageId), screenCoords); + } + + void OnUpdateThoughts() + { + frame_no++; + + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_5); + + auto peep = GetGuest(); + if (peep == nullptr) + { return; + } + if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_THOUGHTS) + { + peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_THOUGHTS; + Invalidate(); + } + } + + void OnDrawThoughts(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + + // cx dx + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + + DrawTextBasic(dpi, screenCoords, STR_GUEST_RECENT_THOUGHTS_LABEL); + + screenCoords.y += 10; + for (const auto& thought : peep->Thoughts) + { + if (thought.type == PeepThoughtType::None) + return; + if (thought.freshness == 0) + continue; + + int32_t widgWidth = widgets[WIDX_PAGE_BACKGROUND].right - widgets[WIDX_PAGE_BACKGROUND].left - 8; + + auto ft = Formatter(); + PeepThoughtSetFormatArgs(&thought, ft); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, widgWidth, STR_BLACK_STRING, ft, { FontStyle::Small }); + + // If this is the last visible line end drawing. + if (screenCoords.y > windowPos.y + widgets[WIDX_PAGE_BACKGROUND].bottom - 32) + return; + } } - } #pragma endregion #pragma region Inventory - void InventoryTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_6)) - return; - - const auto& widget = widgets[WIDX_TAB_6]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - - GfxDrawSprite(dpi, ImageId(SPR_TAB_GUEST_INVENTORY), screenCoords); - } - - void OnUpdateInventory() - { - frame_no++; - - WidgetInvalidate(*this, WIDX_TAB_2); - WidgetInvalidate(*this, WIDX_TAB_6); - - auto peep = GetGuest(); - if (peep == nullptr) + void InventoryTabDraw(DrawPixelInfo& dpi) { - return; + if (WidgetIsDisabled(*this, WIDX_TAB_6)) + return; + + const auto& widget = widgets[WIDX_TAB_6]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; + + GfxDrawSprite(dpi, ImageId(SPR_TAB_GUEST_INVENTORY), screenCoords); } - if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_INVENTORY) + + void OnUpdateInventory() { - peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_INVENTORY; - Invalidate(); + frame_no++; + + WidgetInvalidate(*this, WIDX_TAB_2); + WidgetInvalidate(*this, WIDX_TAB_6); + + auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + if (peep->WindowInvalidateFlags & PEEP_INVALIDATE_PEEP_INVENTORY) + { + peep->WindowInvalidateFlags &= ~PEEP_INVALIDATE_PEEP_INVENTORY; + Invalidate(); + } } - } - std::pair InventoryFormatItem(Guest& guest, ShopItem item) const - { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - auto parkName = park.Name.c_str(); - - // Default arguments - auto ft = Formatter(); - ft.Add(GetShopItemDescriptor(item).Image); - ft.Add(GetShopItemDescriptor(item).Naming.Display); - ft.Add(STR_STRING); - ft.Add(parkName); - - // Special overrides - Ride* invRide{}; - switch (item) + std::pair InventoryFormatItem(Guest& guest, ShopItem item) const { - case ShopItem::Balloon: - ft.Rewind(); - ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.BalloonColour)).ToUInt32()); - break; - case ShopItem::Photo: - invRide = GetRide(guest.Photo1RideRef); - if (invRide != nullptr) - { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + auto parkName = park.Name.c_str(); + + // Default arguments + auto ft = Formatter(); + ft.Add(GetShopItemDescriptor(item).Image); + ft.Add(GetShopItemDescriptor(item).Naming.Display); + ft.Add(STR_STRING); + ft.Add(parkName); + + // Special overrides + Ride* invRide{}; + switch (item) + { + case ShopItem::Balloon: ft.Rewind(); - ft.Increment(6); - invRide->FormatNameTo(ft); - } - - break; - case ShopItem::Umbrella: - ft.Rewind(); - ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.UmbrellaColour)).ToUInt32()); - break; - case ShopItem::Voucher: - switch (guest.VoucherType) - { - case VOUCHER_TYPE_PARK_ENTRY_FREE: + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.BalloonColour)).ToUInt32()); + break; + case ShopItem::Photo: + invRide = GetRide(guest.Photo1RideRef); + if (invRide != nullptr) + { ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_FREE); - ft.Add(STR_STRING); - ft.Add(parkName); - break; - case VOUCHER_TYPE_RIDE_FREE: - invRide = GetRide(guest.VoucherRideId); - if (invRide != nullptr) - { + invRide->FormatNameTo(ft); + } + + break; + case ShopItem::Umbrella: + ft.Rewind(); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.UmbrellaColour)).ToUInt32()); + break; + case ShopItem::Voucher: + switch (guest.VoucherType) + { + case VOUCHER_TYPE_PARK_ENTRY_FREE: ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_RIDE_FREE); - invRide->FormatNameTo(ft); - } - break; - case VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE: + ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_FREE); + ft.Add(STR_STRING); + ft.Add(parkName); + break; + case VOUCHER_TYPE_RIDE_FREE: + invRide = GetRide(guest.VoucherRideId); + if (invRide != nullptr) + { + ft.Rewind(); + ft.Increment(6); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_RIDE_FREE); + invRide->FormatNameTo(ft); + } + break; + case VOUCHER_TYPE_PARK_ENTRY_HALF_PRICE: + ft.Rewind(); + ft.Increment(6); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_HALF_PRICE); + ft.Add(STR_STRING); + ft.Add(parkName); + break; + case VOUCHER_TYPE_FOOD_OR_DRINK_FREE: + ft.Rewind(); + ft.Increment(6); + ft.Add(STR_PEEP_INVENTORY_VOUCHER_FOOD_OR_DRINK_FREE); + ft.Add(GetShopItemDescriptor(guest.VoucherShopItem).Naming.Singular); + break; + } + break; + case ShopItem::Hat: + ft.Rewind(); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.HatColour)).ToUInt32()); + break; + case ShopItem::TShirt: + ft.Rewind(); + ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.TshirtColour)).ToUInt32()); + break; + case ShopItem::Photo2: + invRide = GetRide(guest.Photo2RideRef); + if (invRide != nullptr) + { ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_PARK_ENTRY_HALF_PRICE); - ft.Add(STR_STRING); - ft.Add(parkName); - break; - case VOUCHER_TYPE_FOOD_OR_DRINK_FREE: + invRide->FormatNameTo(ft); + } + break; + case ShopItem::Photo3: + invRide = GetRide(guest.Photo3RideRef); + if (invRide != nullptr) + { ft.Rewind(); ft.Increment(6); - ft.Add(STR_PEEP_INVENTORY_VOUCHER_FOOD_OR_DRINK_FREE); - ft.Add(GetShopItemDescriptor(guest.VoucherShopItem).Naming.Singular); - break; - } - break; - case ShopItem::Hat: - ft.Rewind(); - ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.HatColour)).ToUInt32()); - break; - case ShopItem::TShirt: - ft.Rewind(); - ft.Add(ImageId(GetShopItemDescriptor(item).Image, (guest.TshirtColour)).ToUInt32()); - break; - case ShopItem::Photo2: - invRide = GetRide(guest.Photo2RideRef); - if (invRide != nullptr) - { - ft.Rewind(); - ft.Increment(6); - invRide->FormatNameTo(ft); - } - break; - case ShopItem::Photo3: - invRide = GetRide(guest.Photo3RideRef); - if (invRide != nullptr) - { - ft.Rewind(); - ft.Increment(6); - invRide->FormatNameTo(ft); - } - break; - case ShopItem::Photo4: - invRide = GetRide(guest.Photo4RideRef); - if (invRide != nullptr) - { - ft.Rewind(); - ft.Increment(6); - invRide->FormatNameTo(ft); - } - break; - default: - // This switch handles only items visible in peep window - break; + invRide->FormatNameTo(ft); + } + break; + case ShopItem::Photo4: + invRide = GetRide(guest.Photo4RideRef); + if (invRide != nullptr) + { + ft.Rewind(); + ft.Increment(6); + invRide->FormatNameTo(ft); + } + break; + default: + // This switch handles only items visible in peep window + break; + } + + return std::make_pair(STR_GUEST_ITEM_FORMAT, ft); } - return std::make_pair(STR_GUEST_ITEM_FORMAT, ft); - } - - void OnDrawInventory(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - const auto guest = GetGuest(); - if (guest == nullptr) + void OnDrawInventory(DrawPixelInfo& dpi) { - return; + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + const auto guest = GetGuest(); + if (guest == nullptr) + { + return; + } + + Widget* pageBackgroundWidget = &widgets[WIDX_PAGE_BACKGROUND]; + auto screenCoords = windowPos + ScreenCoordsXY{ pageBackgroundWidget->left + 4, pageBackgroundWidget->top + 2 }; + int32_t itemNameWidth = pageBackgroundWidget->width() - 8; + + int32_t maxY = windowPos.y + height - 22; + int32_t numItems = 0; + + DrawTextBasic(dpi, screenCoords, STR_CARRYING); + screenCoords.y += 10; + + for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item++) + { + if (screenCoords.y >= maxY) + break; + if (!guest->HasItem(item)) + continue; + + auto [stringId, ft] = InventoryFormatItem(*guest, item); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, itemNameWidth, stringId, ft); + numItems++; + } + + if (numItems == 0) + { + DrawTextBasic(dpi, screenCoords, STR_NOTHING); + } } - - Widget* pageBackgroundWidget = &widgets[WIDX_PAGE_BACKGROUND]; - auto screenCoords = windowPos + ScreenCoordsXY{ pageBackgroundWidget->left + 4, pageBackgroundWidget->top + 2 }; - int32_t itemNameWidth = pageBackgroundWidget->width() - 8; - - int32_t maxY = windowPos.y + height - 22; - int32_t numItems = 0; - - DrawTextBasic(dpi, screenCoords, STR_CARRYING); - screenCoords.y += 10; - - for (ShopItem item = ShopItem::Balloon; item < ShopItem::Count; item++) - { - if (screenCoords.y >= maxY) - break; - if (!guest->HasItem(item)) - continue; - - auto [stringId, ft] = InventoryFormatItem(*guest, item); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, itemNameWidth, stringId, ft); - numItems++; - } - - if (numItems == 0) - { - DrawTextBasic(dpi, screenCoords, STR_NOTHING); - } - } #pragma endregion #pragma region Debug - void DebugTabDraw(DrawPixelInfo& dpi) - { - if (WidgetIsDisabled(*this, WIDX_TAB_7)) - return; - - const auto& widget = widgets[WIDX_TAB_7]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - - int32_t imageId = SPR_TAB_GEARS_0; - if (page == WINDOW_GUEST_DEBUG) + void DebugTabDraw(DrawPixelInfo& dpi) { - imageId += (frame_no / 2) & 0x3; - } + if (WidgetIsDisabled(*this, WIDX_TAB_7)) + return; - GfxDrawSprite(dpi, ImageId(imageId), screenCoords); - } + const auto& widget = widgets[WIDX_TAB_7]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - void OnUpdateDebug() - { - frame_no++; - Invalidate(); - } - - void OnDrawDebug(DrawPixelInfo& dpi) - { - char buffer[512]{}; - char buffer2[512]{}; - - DrawWidgets(dpi); - OverviewTabDraw(dpi); - StatsTabDraw(dpi); - RidesTabDraw(dpi); - FinanceTabDraw(dpi); - ThoughtsTabDraw(dpi); - InventoryTabDraw(dpi); - DebugTabDraw(dpi); - - const auto peep = GetGuest(); - if (peep == nullptr) - { - return; - } - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - { - auto ft = Formatter(); - ft.Add(peep->Id); - DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; - { - auto ft = Formatter(); - ft.Add(peep->x); - ft.Add(peep->y); - ft.Add(peep->z); - DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; - { - auto ft = Formatter(); - ft.Add(peep->NextLoc.x); - ft.Add(peep->NextLoc.y); - ft.Add(peep->NextLoc.z); - OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), STR_PEEP_DEBUG_NEXT, ft.Data()); - if (peep->GetNextIsSurface()) + int32_t imageId = SPR_TAB_GEARS_0; + if (page == WINDOW_GUEST_DEBUG) { - OpenRCT2::FormatStringLegacy(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SURFACE, nullptr); - SafeStrCat(buffer, buffer2, sizeof(buffer)); + imageId += (frame_no / 2) & 0x3; } - if (peep->GetNextIsSloped()) - { - auto ft2 = Formatter(); - ft2.Add(peep->GetNextDirection()); - OpenRCT2::FormatStringLegacy(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SLOPE, ft2.Data()); - SafeStrCat(buffer, buffer2, sizeof(buffer)); - } - GfxDrawString(dpi, screenCoords, buffer, {}); - } - screenCoords.y += LIST_ROW_HEIGHT; - { - auto ft = Formatter(); - ft.Add(peep->DestinationX); - ft.Add(peep->DestinationY); - ft.Add(peep->DestinationTolerance); - DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; - { - auto ft = Formatter(); - ft.Add(peep->PathfindGoal.x); - ft.Add(peep->PathfindGoal.y); - ft.Add(peep->PathfindGoal.z); - ft.Add(peep->PathfindGoal.direction); - DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; - DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY); - screenCoords.y += LIST_ROW_HEIGHT; - screenCoords.x += 10; - for (auto& point : peep->PathfindHistory) + GfxDrawSprite(dpi, ImageId(imageId), screenCoords); + } + + void OnUpdateDebug() { - auto ft = Formatter(); - ft.Add(point.x); - ft.Add(point.y); - ft.Add(point.z); - ft.Add(point.direction); - DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft); + frame_no++; + Invalidate(); + } + + void OnDrawDebug(DrawPixelInfo& dpi) + { + char buffer[512]{}; + char buffer2[512]{}; + + DrawWidgets(dpi); + OverviewTabDraw(dpi); + StatsTabDraw(dpi); + RidesTabDraw(dpi); + FinanceTabDraw(dpi); + ThoughtsTabDraw(dpi); + InventoryTabDraw(dpi); + DebugTabDraw(dpi); + + const auto peep = GetGuest(); + if (peep == nullptr) + { + return; + } + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + { + auto ft = Formatter(); + ft.Add(peep->Id); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_SPRITE_INDEX, ft); + } screenCoords.y += LIST_ROW_HEIGHT; + { + auto ft = Formatter(); + ft.Add(peep->x); + ft.Add(peep->y); + ft.Add(peep->z); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_POSITION, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + { + auto ft = Formatter(); + ft.Add(peep->NextLoc.x); + ft.Add(peep->NextLoc.y); + ft.Add(peep->NextLoc.z); + OpenRCT2::FormatStringLegacy(buffer, sizeof(buffer), STR_PEEP_DEBUG_NEXT, ft.Data()); + if (peep->GetNextIsSurface()) + { + OpenRCT2::FormatStringLegacy(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SURFACE, nullptr); + SafeStrCat(buffer, buffer2, sizeof(buffer)); + } + if (peep->GetNextIsSloped()) + { + auto ft2 = Formatter(); + ft2.Add(peep->GetNextDirection()); + OpenRCT2::FormatStringLegacy(buffer2, sizeof(buffer2), STR_PEEP_DEBUG_NEXT_SLOPE, ft2.Data()); + SafeStrCat(buffer, buffer2, sizeof(buffer)); + } + GfxDrawString(dpi, screenCoords, buffer, {}); + } + screenCoords.y += LIST_ROW_HEIGHT; + { + auto ft = Formatter(); + ft.Add(peep->DestinationX); + ft.Add(peep->DestinationY); + ft.Add(peep->DestinationTolerance); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_DEST, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + { + auto ft = Formatter(); + ft.Add(peep->PathfindGoal.x); + ft.Add(peep->PathfindGoal.y); + ft.Add(peep->PathfindGoal.z); + ft.Add(peep->PathfindGoal.direction); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_GOAL, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY); + screenCoords.y += LIST_ROW_HEIGHT; + + screenCoords.x += 10; + for (auto& point : peep->PathfindHistory) + { + auto ft = Formatter(); + ft.Add(point.x); + ft.Add(point.y); + ft.Add(point.z); + ft.Add(point.direction); + DrawTextBasic(dpi, screenCoords, STR_PEEP_DEBUG_PATHFIND_HISTORY_ITEM, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + screenCoords.x -= 10; } - screenCoords.x -= 10; - } #pragma endregion -}; + }; -/** - * - * rct2: 0x006989E9 - * - */ -WindowBase* WindowGuestOpen(Peep* peep) -{ - if (peep == nullptr) + /** + * + * rct2: 0x006989E9 + * + */ + WindowBase* WindowGuestOpen(Peep* peep) { - return nullptr; - } - if (peep->Is()) - { - return WindowStaffOpen(peep); - } - - auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); - if (window == nullptr) - { - int32_t windowWidth = 192; - if (gConfigGeneral.DebuggingTools) - windowWidth += TabWidth; - - window = WindowCreate(WindowClass::Peep, windowWidth, 157, WF_RESIZABLE); - if (window == nullptr) + if (peep == nullptr) { return nullptr; } + if (peep->Is()) + { + return WindowStaffOpen(peep); + } + + auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); + if (window == nullptr) + { + int32_t windowWidth = 192; + if (gConfigGeneral.DebuggingTools) + windowWidth += TabWidth; + + window = WindowCreate(WindowClass::Peep, windowWidth, 157, WF_RESIZABLE); + if (window == nullptr) + { + return nullptr; + } + } + + window->Init(peep->Id); + + return window; } - - window->Init(peep->Id); - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 60e0515ef7..6ab7db86c1 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -29,31 +29,31 @@ #include #include -using namespace OpenRCT2; - -static constexpr StringId WINDOW_TITLE = STR_GUESTS; -static constexpr int32_t WH = 330; -static constexpr int32_t WW = 350; - -enum WindowGuestListWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_TAB_CONTENT_PANEL, - WIDX_PAGE_DROPDOWN, - WIDX_PAGE_DROPDOWN_BUTTON, - WIDX_INFO_TYPE_DROPDOWN, - WIDX_INFO_TYPE_DROPDOWN_BUTTON, - WIDX_MAP, - WIDX_FILTER_BY_NAME, - WIDX_TRACKING, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_GUEST_LIST -}; + static constexpr StringId WINDOW_TITLE = STR_GUESTS; + static constexpr int32_t WH = 330; + static constexpr int32_t WW = 350; -// clang-format off + enum WindowGuestListWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_TAB_CONTENT_PANEL, + WIDX_PAGE_DROPDOWN, + WIDX_PAGE_DROPDOWN_BUTTON, + WIDX_INFO_TYPE_DROPDOWN, + WIDX_INFO_TYPE_DROPDOWN_BUTTON, + WIDX_MAP, + WIDX_FILTER_BY_NAME, + WIDX_TRACKING, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_GUEST_LIST + }; + + // clang-format off static Widget window_guest_list_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, {350, 287}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab content panel @@ -69,927 +69,931 @@ static Widget window_guest_list_widgets[] = { MakeWidget({ 3, 72}, {344, 255}, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_BOTH ), // guest list kWidgetsEnd, }; -// clang-format on + // clang-format on -class GuestListWindow final : public Window -{ -private: - enum class TabId + class GuestListWindow final : public Window { - Individual, - Summarised - }; - - enum class GuestViewType - { - Actions, - Thoughts, - }; - - enum class GuestFilterType - { - Guests, - GuestsThinking, - GuestsThinkingAbout, - }; - - struct FilterArguments - { - uint8_t args[12]{}; - - StringId GetFirstStringId() + private: + enum class TabId { - StringId firstStrId{}; - std::memcpy(&firstStrId, args, sizeof(firstStrId)); - return firstStrId; - } + Individual, + Summarised + }; - bool operator==(const FilterArguments& other) const + enum class GuestViewType { - return std::memcmp(args, other.args, sizeof(args)) == 0; - } - bool operator!=(const FilterArguments& other) const + Actions, + Thoughts, + }; + + enum class GuestFilterType { - return !(*this == other); - } - }; + Guests, + GuestsThinking, + GuestsThinkingAbout, + }; - struct GuestGroup - { - size_t NumGuests{}; - FilterArguments Arguments; - uint8_t Faces[58]{}; - }; - - struct GuestItem - { - using CompareFunc = bool (*)(const GuestItem&, const GuestItem&); - - EntityId Id; - char Name[256]; - }; - - static constexpr uint8_t SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11; - static constexpr auto GUESTS_PER_PAGE = 2000; - static constexpr const auto GUEST_PAGE_HEIGHT = GUESTS_PER_PAGE * SCROLLABLE_ROW_HEIGHT; - static constexpr size_t MaxGroups = 240; - - TabId _selectedTab{}; - GuestViewType _selectedView{}; - bool _trackingOnly{}; - std::optional _selectedFilter; - FilterArguments _filterArguments; - std::string _filterName; - - size_t _numPages{}; - size_t _selectedPage{}; - - GuestViewType _lastFindGroupsSelectedView{}; - uint32_t _lastFindGroupsTick{}; - uint32_t _lastFindGroupsWait{}; - std::vector _groups; - - std::vector _guestList; - std::optional _highlightedIndex; - - uint32_t _tabAnimationIndex{}; - -public: - void OnOpen() override - { - widgets = window_guest_list_widgets; - WindowInitScrollWidgets(*this); - - _selectedTab = TabId::Summarised; - _selectedView = GuestViewType::Thoughts; - _numPages = 1; - widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; - widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; - widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; - min_width = 350; - min_height = 330; - max_width = 500; - max_height = 450; - RefreshList(); - } - - void SetFilter(GuestListFilterType type, int32_t index) - { - _selectedPage = 0; - _numPages = 1; - _trackingOnly = false; - _filterArguments = {}; - - Formatter ft(_filterArguments.args); - - switch (type) + struct FilterArguments { - case GuestListFilterType::GuestsOnRide: + uint8_t args[12]{}; + + StringId GetFirstStringId() { - auto guestRide = GetRide(RideId::FromUnderlying(index)); - if (guestRide != nullptr) - { - ft.Add( - guestRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE); - guestRide->FormatNameTo(ft); - - _selectedFilter = GuestFilterType::Guests; - _highlightedIndex = {}; - _selectedTab = TabId::Individual; - _selectedView = GuestViewType::Thoughts; - } - break; + StringId firstStrId{}; + std::memcpy(&firstStrId, args, sizeof(firstStrId)); + return firstStrId; } - case GuestListFilterType::GuestsInQueue: - { - auto guestRide = GetRide(RideId::FromUnderlying(index)); - if (guestRide != nullptr) - { - ft.Add(STR_QUEUING_FOR); - guestRide->FormatNameTo(ft); - _selectedFilter = GuestFilterType::Guests; - _highlightedIndex = {}; - _selectedTab = TabId::Individual; - _selectedView = GuestViewType::Thoughts; - } - break; - } - case GuestListFilterType::GuestsThinkingAboutRide: + bool operator==(const FilterArguments& other) const { - auto guestRide = GetRide(RideId::FromUnderlying(index)); - if (guestRide != nullptr) + return std::memcmp(args, other.args, sizeof(args)) == 0; + } + bool operator!=(const FilterArguments& other) const + { + return !(*this == other); + } + }; + + struct GuestGroup + { + size_t NumGuests{}; + FilterArguments Arguments; + uint8_t Faces[58]{}; + }; + + struct GuestItem + { + using CompareFunc = bool (*)(const GuestItem&, const GuestItem&); + + EntityId Id; + char Name[256]; + }; + + static constexpr uint8_t SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11; + static constexpr auto GUESTS_PER_PAGE = 2000; + static constexpr const auto GUEST_PAGE_HEIGHT = GUESTS_PER_PAGE * SCROLLABLE_ROW_HEIGHT; + static constexpr size_t MaxGroups = 240; + + TabId _selectedTab{}; + GuestViewType _selectedView{}; + bool _trackingOnly{}; + std::optional _selectedFilter; + FilterArguments _filterArguments; + std::string _filterName; + + size_t _numPages{}; + size_t _selectedPage{}; + + GuestViewType _lastFindGroupsSelectedView{}; + uint32_t _lastFindGroupsTick{}; + uint32_t _lastFindGroupsWait{}; + std::vector _groups; + + std::vector _guestList; + std::optional _highlightedIndex; + + uint32_t _tabAnimationIndex{}; + + public: + void OnOpen() override + { + widgets = window_guest_list_widgets; + WindowInitScrollWidgets(*this); + + _selectedTab = TabId::Summarised; + _selectedView = GuestViewType::Thoughts; + _numPages = 1; + widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; + widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; + widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; + min_width = 350; + min_height = 330; + max_width = 500; + max_height = 450; + RefreshList(); + } + + void SetFilter(GuestListFilterType type, int32_t index) + { + _selectedPage = 0; + _numPages = 1; + _trackingOnly = false; + _filterArguments = {}; + + Formatter ft(_filterArguments.args); + + switch (type) + { + case GuestListFilterType::GuestsOnRide: { - ft.Add(STR_NONE); - guestRide->FormatNameTo(ft); + auto guestRide = GetRide(RideId::FromUnderlying(index)); + if (guestRide != nullptr) + { + ft.Add( + guestRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IN_RIDE) ? STR_IN_RIDE : STR_ON_RIDE); + guestRide->FormatNameTo(ft); + + _selectedFilter = GuestFilterType::Guests; + _highlightedIndex = {}; + _selectedTab = TabId::Individual; + _selectedView = GuestViewType::Thoughts; + } + break; + } + case GuestListFilterType::GuestsInQueue: + { + auto guestRide = GetRide(RideId::FromUnderlying(index)); + if (guestRide != nullptr) + { + ft.Add(STR_QUEUING_FOR); + guestRide->FormatNameTo(ft); + + _selectedFilter = GuestFilterType::Guests; + _highlightedIndex = {}; + _selectedTab = TabId::Individual; + _selectedView = GuestViewType::Thoughts; + } + break; + } + case GuestListFilterType::GuestsThinkingAboutRide: + { + auto guestRide = GetRide(RideId::FromUnderlying(index)); + if (guestRide != nullptr) + { + ft.Add(STR_NONE); + guestRide->FormatNameTo(ft); + + _selectedFilter = GuestFilterType::GuestsThinking; + _highlightedIndex = {}; + _selectedTab = TabId::Individual; + _selectedView = GuestViewType::Thoughts; + } + break; + } + case GuestListFilterType::GuestsThinkingX: + { + ft.Add(PeepThoughts[index & 0xFF]); _selectedFilter = GuestFilterType::GuestsThinking; _highlightedIndex = {}; _selectedTab = TabId::Individual; _selectedView = GuestViewType::Thoughts; - } - break; - } - case GuestListFilterType::GuestsThinkingX: - { - ft.Add(PeepThoughts[index & 0xFF]); - - _selectedFilter = GuestFilterType::GuestsThinking; - _highlightedIndex = {}; - _selectedTab = TabId::Individual; - _selectedView = GuestViewType::Thoughts; - break; - } - } - - RefreshList(); - } - - void OnResize() override - { - min_width = 350; - min_height = 330; - if (width < min_width) - { - Invalidate(); - width = min_width; - } - if (height < min_height) - { - Invalidate(); - height = min_height; - } - } - - void OnUpdate() override - { - if (_lastFindGroupsWait != 0) - { - _lastFindGroupsWait--; - } - - // Current tab image animation - _tabAnimationIndex++; - if (_tabAnimationIndex >= (_selectedTab == TabId::Individual ? 24uL : 32uL)) - _tabAnimationIndex = 0; - InvalidateWidget(WIDX_TAB_1 + static_cast(_selectedTab)); - - gWindowMapFlashingFlags |= MapFlashingFlags::GuestListOpen; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_MAP: - ContextOpenWindow(WindowClass::Map); - break; - case WIDX_TRACKING: - _trackingOnly = !_trackingOnly; - SetWidgetPressed(WIDX_TRACKING, _trackingOnly); - Invalidate(); - scrolls[0].v_top = 0; - RefreshList(); - break; - case WIDX_FILTER_BY_NAME: - if (!_filterName.empty()) - { - // Unset the search filter. - _filterName.clear(); - SetWidgetPressed(WIDX_FILTER_BY_NAME, false); - RefreshList(); - } - else - { - WindowTextInputRawOpen( - this, WIDX_FILTER_BY_NAME, STR_GUESTS_FILTER_BY_NAME, STR_GUESTS_ENTER_NAME_TO_SEARCH, {}, - _filterName.c_str(), 32); - } - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_TAB_1: - case WIDX_TAB_2: - { - if (_selectedFilter && _selectedTab == static_cast(widgetIndex - WIDX_TAB_1)) break; - _selectedTab = static_cast(widgetIndex - WIDX_TAB_1); - _selectedPage = 0; - _numPages = 1; - widgets[WIDX_TRACKING].type = WindowWidgetType::Empty; - if (_selectedTab == TabId::Summarised) - { - widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::Empty; - SetWidgetPressed(WIDX_FILTER_BY_NAME, false); - _filterName.clear(); } - else if (_selectedTab == TabId::Individual) - { - widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; - widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; - } - widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; - _tabAnimationIndex = 0; - _selectedFilter = {}; - Invalidate(); - scrolls[0].v_top = 0; - RefreshList(); - break; } - case WIDX_PAGE_DROPDOWN_BUTTON: - { - auto* widget = &widgets[widgetIndex - 1]; - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, _numPages, widget->width() - 3); - - for (size_t i = 0; i < _numPages; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - uint16_t* args = reinterpret_cast(&gDropdownItems[i].Args); - args[0] = STR_PAGE_X; - args[1] = static_cast(i + 1); - } - Dropdown::SetChecked(static_cast(_selectedPage), true); - break; - } - case WIDX_INFO_TYPE_DROPDOWN_BUTTON: - { - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = GetViewName(GuestViewType::Actions); - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Args = GetViewName(GuestViewType::Thoughts); - - auto* widget = &widgets[widgetIndex - 1]; - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, 2, widget->width() - 3); - - Dropdown::SetChecked(static_cast(_selectedView), true); - break; - } - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - { - return; - } - switch (widgetIndex) - { - case WIDX_PAGE_DROPDOWN_BUTTON: - _selectedPage = dropdownIndex; - Invalidate(); - break; - case WIDX_INFO_TYPE_DROPDOWN_BUTTON: - _selectedView = static_cast(dropdownIndex); - Invalidate(); - break; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (!text.empty()) - { - _filterName = text; - SetWidgetPressed(WIDX_FILTER_BY_NAME, true); RefreshList(); } - } - void OnPrepareDraw() override - { - SetWidgetPressed(WIDX_TAB_1, false); - SetWidgetPressed(WIDX_TAB_2, false); - SetWidgetPressed(WIDX_TAB_1 + static_cast(_selectedTab), true); - - widgets[WIDX_INFO_TYPE_DROPDOWN].text = GetViewName(_selectedView); - widgets[WIDX_MAP].type = WindowWidgetType::Empty; - if (_selectedTab == TabId::Individual && _selectedFilter) - widgets[WIDX_MAP].type = WindowWidgetType::FlatBtn; - - ResizeFrameWithPage(); - widgets[WIDX_GUEST_LIST].right = width - 4; - widgets[WIDX_GUEST_LIST].bottom = height - 15; - widgets[WIDX_MAP].left = 273 - 350 + width; - widgets[WIDX_MAP].right = 296 - 350 + width; - widgets[WIDX_FILTER_BY_NAME].left = 297 - 350 + width; - widgets[WIDX_FILTER_BY_NAME].right = 320 - 350 + width; - widgets[WIDX_TRACKING].left = 321 - 350 + width; - widgets[WIDX_TRACKING].right = 344 - 350 + width; - - if (_numPages > 1) + void OnResize() override { - widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Button; - auto ft = Formatter::Common(); - ft.Increment(4); - ft.Add(_selectedPage + 1); - } - else - { - widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - // Filter description - StringId format; - auto screenCoords = windowPos + ScreenCoordsXY{ 6, widgets[WIDX_TAB_CONTENT_PANEL].top + 3 }; - if (_selectedTab == TabId::Individual) - { - if (_selectedFilter) + min_width = 350; + min_height = 330; + if (width < min_width) { - if (_filterArguments.GetFirstStringId() != STR_NONE) + Invalidate(); + width = min_width; + } + if (height < min_height) + { + Invalidate(); + height = min_height; + } + } + + void OnUpdate() override + { + if (_lastFindGroupsWait != 0) + { + _lastFindGroupsWait--; + } + + // Current tab image animation + _tabAnimationIndex++; + if (_tabAnimationIndex >= (_selectedTab == TabId::Individual ? 24uL : 32uL)) + _tabAnimationIndex = 0; + InvalidateWidget(WIDX_TAB_1 + static_cast(_selectedTab)); + + gWindowMapFlashingFlags |= MapFlashingFlags::GuestListOpen; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_MAP: + ContextOpenWindow(WindowClass::Map); + break; + case WIDX_TRACKING: + _trackingOnly = !_trackingOnly; + SetWidgetPressed(WIDX_TRACKING, _trackingOnly); + Invalidate(); + scrolls[0].v_top = 0; + RefreshList(); + break; + case WIDX_FILTER_BY_NAME: + if (!_filterName.empty()) + { + // Unset the search filter. + _filterName.clear(); + SetWidgetPressed(WIDX_FILTER_BY_NAME, false); + RefreshList(); + } + else + { + WindowTextInputRawOpen( + this, WIDX_FILTER_BY_NAME, STR_GUESTS_FILTER_BY_NAME, STR_GUESTS_ENTER_NAME_TO_SEARCH, {}, + _filterName.c_str(), 32); + } + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_TAB_1: + case WIDX_TAB_2: { - format = GetFilterString(*_selectedFilter); + if (_selectedFilter && _selectedTab == static_cast(widgetIndex - WIDX_TAB_1)) + break; + _selectedTab = static_cast(widgetIndex - WIDX_TAB_1); + _selectedPage = 0; + _numPages = 1; + widgets[WIDX_TRACKING].type = WindowWidgetType::Empty; + if (_selectedTab == TabId::Summarised) + { + widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::Empty; + SetWidgetPressed(WIDX_FILTER_BY_NAME, false); + _filterName.clear(); + } + else if (_selectedTab == TabId::Individual) + { + widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; + widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; + } + widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; + _tabAnimationIndex = 0; + _selectedFilter = {}; + Invalidate(); + scrolls[0].v_top = 0; + RefreshList(); + break; + } + case WIDX_PAGE_DROPDOWN_BUTTON: + { + auto* widget = &widgets[widgetIndex - 1]; + + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, _numPages, widget->width() - 3); + + for (size_t i = 0; i < _numPages; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + uint16_t* args = reinterpret_cast(&gDropdownItems[i].Args); + args[0] = STR_PAGE_X; + args[1] = static_cast(i + 1); + } + Dropdown::SetChecked(static_cast(_selectedPage), true); + break; + } + case WIDX_INFO_TYPE_DROPDOWN_BUTTON: + { + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = GetViewName(GuestViewType::Actions); + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Args = GetViewName(GuestViewType::Thoughts); + + auto* widget = &widgets[widgetIndex - 1]; + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, 2, widget->width() - 3); + + Dropdown::SetChecked(static_cast(_selectedView), true); + break; + } + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (dropdownIndex == -1) + { + return; + } + switch (widgetIndex) + { + case WIDX_PAGE_DROPDOWN_BUTTON: + _selectedPage = dropdownIndex; + Invalidate(); + break; + case WIDX_INFO_TYPE_DROPDOWN_BUTTON: + _selectedView = static_cast(dropdownIndex); + Invalidate(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (!text.empty()) + { + _filterName = text; + SetWidgetPressed(WIDX_FILTER_BY_NAME, true); + RefreshList(); + } + } + + void OnPrepareDraw() override + { + SetWidgetPressed(WIDX_TAB_1, false); + SetWidgetPressed(WIDX_TAB_2, false); + SetWidgetPressed(WIDX_TAB_1 + static_cast(_selectedTab), true); + + widgets[WIDX_INFO_TYPE_DROPDOWN].text = GetViewName(_selectedView); + widgets[WIDX_MAP].type = WindowWidgetType::Empty; + if (_selectedTab == TabId::Individual && _selectedFilter) + widgets[WIDX_MAP].type = WindowWidgetType::FlatBtn; + + ResizeFrameWithPage(); + widgets[WIDX_GUEST_LIST].right = width - 4; + widgets[WIDX_GUEST_LIST].bottom = height - 15; + widgets[WIDX_MAP].left = 273 - 350 + width; + widgets[WIDX_MAP].right = 296 - 350 + width; + widgets[WIDX_FILTER_BY_NAME].left = 297 - 350 + width; + widgets[WIDX_FILTER_BY_NAME].right = 320 - 350 + width; + widgets[WIDX_TRACKING].left = 321 - 350 + width; + widgets[WIDX_TRACKING].right = 344 - 350 + width; + + if (_numPages > 1) + { + widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Button; + auto ft = Formatter::Common(); + ft.Increment(4); + ft.Add(_selectedPage + 1); + } + else + { + widgets[WIDX_PAGE_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_PAGE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + // Filter description + StringId format; + auto screenCoords = windowPos + ScreenCoordsXY{ 6, widgets[WIDX_TAB_CONTENT_PANEL].top + 3 }; + if (_selectedTab == TabId::Individual) + { + if (_selectedFilter) + { + if (_filterArguments.GetFirstStringId() != STR_NONE) + { + format = GetFilterString(*_selectedFilter); + } + else + { + format = STR_GUESTS_FILTER_THINKING_ABOUT; + } } else { - format = STR_GUESTS_FILTER_THINKING_ABOUT; + format = STR_ALL_GUESTS; } } else { - format = STR_ALL_GUESTS; + format = STR_ALL_GUESTS_SUMMARISED; + } + + { + Formatter ft(_filterArguments.args); + DrawTextEllipsised(dpi, screenCoords, 310, format, ft); + } + + // Number of guests (list items) + if (_selectedTab == TabId::Individual) + { + screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_GUEST_LIST].bottom + 2 }; + auto ft = Formatter(); + ft.Add(static_cast(_guestList.size())); + DrawTextBasic( + dpi, screenCoords, (_guestList.size() == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL), + ft); } } - else + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - format = STR_ALL_GUESTS_SUMMARISED; - } - - { - Formatter ft(_filterArguments.args); - DrawTextEllipsised(dpi, screenCoords, 310, format, ft); - } - - // Number of guests (list items) - if (_selectedTab == TabId::Individual) - { - screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_GUEST_LIST].bottom + 2 }; - auto ft = Formatter(); - ft.Add(static_cast(_guestList.size())); - DrawTextBasic( - dpi, screenCoords, (_guestList.size() == 1 ? STR_FORMAT_NUM_GUESTS_SINGULAR : STR_FORMAT_NUM_GUESTS_PLURAL), - ft); - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - int32_t y = 0; - switch (_selectedTab) - { - case TabId::Individual: - // Count the number of guests - y = static_cast(_guestList.size()) * SCROLLABLE_ROW_HEIGHT; - _numPages = (_guestList.size() + GUESTS_PER_PAGE - 1) / GUESTS_PER_PAGE; - if (_numPages == 0) - _selectedPage = 0; - else if (_selectedPage >= _numPages) - _selectedPage = _numPages - 1; - break; - case TabId::Summarised: - default: - // Find the groups - if (IsRefreshOfGroupsRequired()) - { - RefreshGroups(); - } - y = static_cast(_groups.size() * SUMMARISED_GUEST_ROW_HEIGHT); - break; - } - - y -= static_cast(GUEST_PAGE_HEIGHT * _selectedPage); - y = std::max(0, std::min(y, GUEST_PAGE_HEIGHT)); - - if (_highlightedIndex) - { - _highlightedIndex = {}; - Invalidate(); - } - - auto i = std::max(0, y - widgets[WIDX_GUEST_LIST].bottom + widgets[WIDX_GUEST_LIST].top + 21); - if (i < scrolls[0].v_top) - { - scrolls[0].v_top = i; - Invalidate(); - } - - return { 447, y }; - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto i = screenCoords.y / (_selectedTab == TabId::Individual ? SCROLLABLE_ROW_HEIGHT : SUMMARISED_GUEST_ROW_HEIGHT); - i += static_cast(_selectedPage * GUESTS_PER_PAGE); - if (static_cast(i) != _highlightedIndex) - { - _highlightedIndex = i; - Invalidate(); - } - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - switch (_selectedTab) - { - case TabId::Individual: + int32_t y = 0; + switch (_selectedTab) { - auto i = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - i += static_cast(_selectedPage * GUESTS_PER_PAGE); - for (const auto& guestItem : _guestList) - { - if (i == 0) + case TabId::Individual: + // Count the number of guests + y = static_cast(_guestList.size()) * SCROLLABLE_ROW_HEIGHT; + _numPages = (_guestList.size() + GUESTS_PER_PAGE - 1) / GUESTS_PER_PAGE; + if (_numPages == 0) + _selectedPage = 0; + else if (_selectedPage >= _numPages) + _selectedPage = _numPages - 1; + break; + case TabId::Summarised: + default: + // Find the groups + if (IsRefreshOfGroupsRequired()) { - auto guest = GetEntity(guestItem.Id); - if (guest != nullptr) - { - WindowGuestOpen(guest); - } - break; + RefreshGroups(); } - i--; - } - break; + y = static_cast(_groups.size() * SUMMARISED_GUEST_ROW_HEIGHT); + break; } - case TabId::Summarised: + + y -= static_cast(GUEST_PAGE_HEIGHT * _selectedPage); + y = std::max(0, std::min(y, GUEST_PAGE_HEIGHT)); + + if (_highlightedIndex) { - auto i = static_cast(screenCoords.y / SUMMARISED_GUEST_ROW_HEIGHT); - if (i < _groups.size()) - { - _filterArguments = _groups[i].Arguments; - _selectedFilter = _selectedView == GuestViewType::Actions ? GuestFilterType::Guests - : GuestFilterType::GuestsThinking; - _selectedTab = TabId::Individual; - widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; - Invalidate(); - widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; - scrolls[0].v_top = 0; - RefreshList(); - } - break; + _highlightedIndex = {}; + Invalidate(); + } + + auto i = std::max(0, y - widgets[WIDX_GUEST_LIST].bottom + widgets[WIDX_GUEST_LIST].top + 21); + if (i < scrolls[0].v_top) + { + scrolls[0].v_top = i; + Invalidate(); + } + + return { 447, y }; + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + auto i = screenCoords.y / (_selectedTab == TabId::Individual ? SCROLLABLE_ROW_HEIGHT : SUMMARISED_GUEST_ROW_HEIGHT); + i += static_cast(_selectedPage * GUESTS_PER_PAGE); + if (static_cast(i) != _highlightedIndex) + { + _highlightedIndex = i; + Invalidate(); } } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - GfxFillRect( - dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - switch (_selectedTab) + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - case TabId::Individual: - DrawScrollIndividual(dpi); - break; - case TabId::Summarised: - DrawScrollSummarised(dpi); - break; + switch (_selectedTab) + { + case TabId::Individual: + { + auto i = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + i += static_cast(_selectedPage * GUESTS_PER_PAGE); + for (const auto& guestItem : _guestList) + { + if (i == 0) + { + auto guest = GetEntity(guestItem.Id); + if (guest != nullptr) + { + WindowGuestOpen(guest); + } + break; + } + i--; + } + break; + } + case TabId::Summarised: + { + auto i = static_cast(screenCoords.y / SUMMARISED_GUEST_ROW_HEIGHT); + if (i < _groups.size()) + { + _filterArguments = _groups[i].Arguments; + _selectedFilter = _selectedView == GuestViewType::Actions ? GuestFilterType::Guests + : GuestFilterType::GuestsThinking; + _selectedTab = TabId::Individual; + widgets[WIDX_TRACKING].type = WindowWidgetType::FlatBtn; + Invalidate(); + widgets[WIDX_FILTER_BY_NAME].type = WindowWidgetType::FlatBtn; + scrolls[0].v_top = 0; + RefreshList(); + } + break; + } + } } - } - void RefreshList() - { - // Only the individual tab uses the GuestList so no point calculating it - if (_selectedTab != TabId::Individual) + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - RefreshGroups(); + GfxFillRect( + dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); + switch (_selectedTab) + { + case TabId::Individual: + DrawScrollIndividual(dpi); + break; + case TabId::Summarised: + DrawScrollSummarised(dpi); + break; + } } - else + + void RefreshList() { - _guestList.clear(); + // Only the individual tab uses the GuestList so no point calculating it + if (_selectedTab != TabId::Individual) + { + RefreshGroups(); + } + else + { + _guestList.clear(); + + for (auto peep : EntityList()) + { + EntitySetFlashing(peep, false); + if (peep->OutsideOfPark) + continue; + if (_selectedFilter) + { + if (!IsPeepInFilter(*peep)) + continue; + EntitySetFlashing(peep, true); + } + if (!GuestShouldBeVisible(*peep)) + continue; + + auto& item = _guestList.emplace_back(); + item.Id = peep->Id; + + Formatter ft; + peep->FormatNameTo(ft); + OpenRCT2::FormatStringLegacy(item.Name, sizeof(item.Name), STR_STRINGID, ft.Data()); + } + + std::sort(_guestList.begin(), _guestList.end(), GetGuestCompareFunc()); + } + } + + private: + void DrawTabImages(DrawPixelInfo& dpi) + { + // Tab 1 image + auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0); + i += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1; + GfxDrawSprite( + dpi, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].midX(), widgets[WIDX_TAB_1].bottom - 6 }); + + // Tab 2 image + i = (_selectedTab == TabId::Summarised ? _tabAnimationIndex / 4 : 0); + GfxDrawSprite( + dpi, ImageId(SPR_TAB_GUESTS_0 + i), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); + } + + void DrawScrollIndividual(DrawPixelInfo& dpi) + { + size_t index = 0; + auto y = static_cast(_selectedPage) * -GUEST_PAGE_HEIGHT; + for (const auto& guestItem : _guestList) + { + // Check if y is beyond the scroll control + if (y + SCROLLABLE_ROW_HEIGHT + 1 >= -0x7FFF && y + SCROLLABLE_ROW_HEIGHT + 1 > dpi.y && y < 0x7FFF + && y < dpi.y + dpi.height) + { + // Highlight backcolour and text colour (format) + StringId format = STR_BLACK_STRING; + if (index == _highlightedIndex) + { + GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); + format = STR_WINDOW_COLOUR_2_STRINGID; + } + + // Guest name + auto peep = GetEntity(guestItem.Id); + if (peep == nullptr) + { + continue; + } + auto ft = Formatter(); + peep->FormatNameTo(ft); + DrawTextEllipsised(dpi, { 0, y }, 113, format, ft); + + switch (_selectedView) + { + case GuestViewType::Actions: + // Guest face + GfxDrawSprite(dpi, ImageId(GetPeepFaceSpriteSmall(peep)), { 118, y + 1 }); + + // Tracking icon + if (peep->PeepFlags & PEEP_FLAGS_TRACKING) + GfxDrawSprite(dpi, ImageId(STR_ENTER_SELECTION_SIZE), { 112, y + 1 }); + + // Action + ft = Formatter(); + peep->FormatActionTo(ft); + DrawTextEllipsised(dpi, { 133, y }, 314, format, ft); + break; + case GuestViewType::Thoughts: + // For each thought + for (const auto& thought : peep->Thoughts) + { + if (thought.type == PeepThoughtType::None) + break; + if (thought.freshness == 0) + continue; + if (thought.freshness > 5) + break; + + ft = Formatter(); + PeepThoughtSetFormatArgs(&thought, ft); + DrawTextEllipsised(dpi, { 118, y }, 329, format, ft, { FontStyle::Small }); + break; + } + break; + } + } + y += SCROLLABLE_ROW_HEIGHT; + index++; + } + } + + void DrawScrollSummarised(DrawPixelInfo& dpi) + { + size_t index = 0; + auto y = 0; + for (auto& group : _groups) + { + // Check if y is beyond the scroll control + if (y + SUMMARISED_GUEST_ROW_HEIGHT + 1 >= dpi.y) + { + // Check if y is beyond the scroll control + if (y >= dpi.y + dpi.height) + break; + + // Highlight backcolour and text colour (format) + StringId format = STR_BLACK_STRING; + if (index == _highlightedIndex) + { + GfxFilterRect(dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); + format = STR_WINDOW_COLOUR_2_STRINGID; + } + + // Draw guest faces + for (uint32_t j = 0; j < std::size(group.Faces) && j < group.NumGuests; j++) + { + GfxDrawSprite( + dpi, ImageId(group.Faces[j] + SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY), + { static_cast(j) * 8, y + 12 }); + } + + // Draw action/thoughts + Formatter ft(group.Arguments.args); + // Draw small font if displaying guests + if (_selectedView == GuestViewType::Thoughts) + { + DrawTextEllipsised(dpi, { 0, y }, 414, format, ft, { FontStyle::Small }); + } + else + { + DrawTextEllipsised(dpi, { 0, y }, 414, format, ft); + } + + // Draw guest count + ft = Formatter(); + ft.Add(STR_GUESTS_COUNT_COMMA_SEP); + ft.Add(group.NumGuests); + DrawTextBasic(dpi, { 326, y }, format, ft, { TextAlignment::RIGHT }); + } + y += SUMMARISED_GUEST_ROW_HEIGHT; + index++; + } + } + + bool GuestShouldBeVisible(const Guest& peep) + { + if (_trackingOnly && !(peep.PeepFlags & PEEP_FLAGS_TRACKING)) + return false; + + if (!_filterName.empty()) + { + char name[256]{}; + + Formatter ft; + peep.FormatNameTo(ft); + OpenRCT2::FormatStringLegacy(name, sizeof(name), STR_STRINGID, ft.Data()); + if (!String::Contains(name, _filterName.c_str(), true)) + { + return false; + } + } + + return true; + } + + bool IsPeepInFilter(const Guest& peep) + { + auto guestViewType = _selectedFilter == GuestFilterType::Guests ? GuestViewType::Actions : GuestViewType::Thoughts; + auto peepArgs = GetArgumentsFromPeep(peep, guestViewType); + if (_filterArguments.GetFirstStringId() == STR_NONE && _selectedFilter == GuestFilterType::GuestsThinking) + { + Formatter(peepArgs.args).Add(STR_NONE); + } + return _filterArguments == peepArgs; + } + + bool IsRefreshOfGroupsRequired() + { + uint32_t tick256 = Floor2(GetGameState().CurrentTicks, 256); + if (_selectedView == _lastFindGroupsSelectedView) + { + if (_lastFindGroupsWait != 0 || _lastFindGroupsTick == tick256) + { + return false; + } + } + + return true; + } + + GuestGroup& FindOrAddGroup(FilterArguments&& arguments) + { + auto foundGroup = std::find_if(std::begin(_groups), std::end(_groups), [&arguments](GuestGroup& group) { + return group.Arguments == arguments; + }); + if (foundGroup != std::end(_groups)) + { + return *foundGroup; + } + auto& newGroup = _groups.emplace_back(); + newGroup.Arguments = arguments; + return newGroup; + } + + void RefreshGroups() + { + _lastFindGroupsTick = Floor2(GetGameState().CurrentTicks, 256); + _lastFindGroupsSelectedView = _selectedView; + _lastFindGroupsWait = 320; + _groups.clear(); for (auto peep : EntityList()) { - EntitySetFlashing(peep, false); if (peep->OutsideOfPark) continue; - if (_selectedFilter) + + auto& group = FindOrAddGroup(GetArgumentsFromPeep(*peep, _selectedView)); + if (group.NumGuests < std::size(group.Faces)) { - if (!IsPeepInFilter(*peep)) - continue; - EntitySetFlashing(peep, true); + group.Faces[group.NumGuests] = GetPeepFaceSpriteSmall(peep) - SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY; } - if (!GuestShouldBeVisible(*peep)) - continue; - - auto& item = _guestList.emplace_back(); - item.Id = peep->Id; - - Formatter ft; - peep->FormatNameTo(ft); - OpenRCT2::FormatStringLegacy(item.Name, sizeof(item.Name), STR_STRINGID, ft.Data()); + group.NumGuests++; } - std::sort(_guestList.begin(), _guestList.end(), GetGuestCompareFunc()); - } - } - -private: - void DrawTabImages(DrawPixelInfo& dpi) - { - // Tab 1 image - auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0); - i += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1; - GfxDrawSprite( - dpi, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].midX(), widgets[WIDX_TAB_1].bottom - 6 }); - - // Tab 2 image - i = (_selectedTab == TabId::Summarised ? _tabAnimationIndex / 4 : 0); - GfxDrawSprite( - dpi, ImageId(SPR_TAB_GUESTS_0 + i), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); - } - - void DrawScrollIndividual(DrawPixelInfo& dpi) - { - size_t index = 0; - auto y = static_cast(_selectedPage) * -GUEST_PAGE_HEIGHT; - for (const auto& guestItem : _guestList) - { - // Check if y is beyond the scroll control - if (y + SCROLLABLE_ROW_HEIGHT + 1 >= -0x7FFF && y + SCROLLABLE_ROW_HEIGHT + 1 > dpi.y && y < 0x7FFF - && y < dpi.y + dpi.height) + // 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; + }); + if (foundGroup != std::end(_groups)) { - // Highlight backcolour and text colour (format) - StringId format = STR_BLACK_STRING; - if (index == _highlightedIndex) - { - GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); - format = STR_WINDOW_COLOUR_2_STRINGID; - } - - // Guest name - auto peep = GetEntity(guestItem.Id); - if (peep == nullptr) - { - continue; - } - auto ft = Formatter(); - peep->FormatNameTo(ft); - DrawTextEllipsised(dpi, { 0, y }, 113, format, ft); - - switch (_selectedView) - { - case GuestViewType::Actions: - // Guest face - GfxDrawSprite(dpi, ImageId(GetPeepFaceSpriteSmall(peep)), { 118, y + 1 }); - - // Tracking icon - if (peep->PeepFlags & PEEP_FLAGS_TRACKING) - GfxDrawSprite(dpi, ImageId(STR_ENTER_SELECTION_SIZE), { 112, y + 1 }); - - // Action - ft = Formatter(); - peep->FormatActionTo(ft); - DrawTextEllipsised(dpi, { 133, y }, 314, format, ft); - break; - case GuestViewType::Thoughts: - // For each thought - for (const auto& thought : peep->Thoughts) - { - if (thought.type == PeepThoughtType::None) - break; - if (thought.freshness == 0) - continue; - if (thought.freshness > 5) - break; - - ft = Formatter(); - PeepThoughtSetFormatArgs(&thought, ft); - DrawTextEllipsised(dpi, { 118, y }, 329, format, ft, { FontStyle::Small }); - break; - } - break; - } + _groups.erase(foundGroup); } - y += SCROLLABLE_ROW_HEIGHT; - index++; - } - } - void DrawScrollSummarised(DrawPixelInfo& dpi) - { - size_t index = 0; - auto y = 0; - for (auto& group : _groups) - { - // Check if y is beyond the scroll control - if (y + SUMMARISED_GUEST_ROW_HEIGHT + 1 >= dpi.y) + // Sort groups by number of guests + std::sort(_groups.begin(), _groups.end(), [](const GuestGroup& a, const GuestGroup& b) { + return a.NumGuests > b.NumGuests; + }); + + // Remove up to MaxGroups + if (_groups.size() > MaxGroups) { - // Check if y is beyond the scroll control - if (y >= dpi.y + dpi.height) + _groups.resize(MaxGroups); + } + } + + /** + * Calculates a hash value (arguments) for comparing peep actions/thoughts + */ + static FilterArguments GetArgumentsFromPeep(const Guest& peep, GuestViewType type) + { + FilterArguments result; + Formatter ft(result.args); + switch (type) + { + case GuestViewType::Actions: + peep.FormatActionTo(ft); break; - - // Highlight backcolour and text colour (format) - StringId format = STR_BLACK_STRING; - if (index == _highlightedIndex) + case GuestViewType::Thoughts: { - GfxFilterRect(dpi, { 0, y, 800, y + SUMMARISED_GUEST_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); - format = STR_WINDOW_COLOUR_2_STRINGID; + const auto& thought = peep.Thoughts[0]; + if (thought.type != PeepThoughtType::None && thought.freshness <= 5) + { + PeepThoughtSetFormatArgs(&thought, ft); + } + break; } - - // Draw guest faces - for (uint32_t j = 0; j < std::size(group.Faces) && j < group.NumGuests; j++) - { - GfxDrawSprite( - dpi, ImageId(group.Faces[j] + SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY), - { static_cast(j) * 8, y + 12 }); - } - - // Draw action/thoughts - Formatter ft(group.Arguments.args); - // Draw small font if displaying guests - if (_selectedView == GuestViewType::Thoughts) - { - DrawTextEllipsised(dpi, { 0, y }, 414, format, ft, { FontStyle::Small }); - } - else - { - DrawTextEllipsised(dpi, { 0, y }, 414, format, ft); - } - - // Draw guest count - ft = Formatter(); - ft.Add(STR_GUESTS_COUNT_COMMA_SEP); - ft.Add(group.NumGuests); - DrawTextBasic(dpi, { 326, y }, format, ft, { TextAlignment::RIGHT }); } - y += SUMMARISED_GUEST_ROW_HEIGHT; - index++; + return result; } - } - bool GuestShouldBeVisible(const Guest& peep) - { - if (_trackingOnly && !(peep.PeepFlags & PEEP_FLAGS_TRACKING)) - return false; - - if (!_filterName.empty()) + static constexpr StringId GetViewName(GuestViewType type) { - char name[256]{}; - - Formatter ft; - peep.FormatNameTo(ft); - OpenRCT2::FormatStringLegacy(name, sizeof(name), STR_STRINGID, ft.Data()); - if (!String::Contains(name, _filterName.c_str(), true)) + switch (type) { - return false; + default: + case GuestViewType::Actions: + return STR_ACTIONS; + case GuestViewType::Thoughts: + return STR_THOUGHTS; } } - return true; - } - - bool IsPeepInFilter(const Guest& peep) - { - auto guestViewType = _selectedFilter == GuestFilterType::Guests ? GuestViewType::Actions : GuestViewType::Thoughts; - auto peepArgs = GetArgumentsFromPeep(peep, guestViewType); - if (_filterArguments.GetFirstStringId() == STR_NONE && _selectedFilter == GuestFilterType::GuestsThinking) + static constexpr StringId GetFilterString(GuestFilterType type) { - Formatter(peepArgs.args).Add(STR_NONE); - } - return _filterArguments == peepArgs; - } - - bool IsRefreshOfGroupsRequired() - { - uint32_t tick256 = Floor2(GetGameState().CurrentTicks, 256); - if (_selectedView == _lastFindGroupsSelectedView) - { - if (_lastFindGroupsWait != 0 || _lastFindGroupsTick == tick256) + switch (type) { - return false; + default: + case GuestFilterType::Guests: + return STR_GUESTS_FILTER; + case GuestFilterType::GuestsThinking: + return STR_GUESTS_FILTER_THINKING; + case GuestFilterType::GuestsThinkingAbout: + return STR_GUESTS_FILTER_THINKING_ABOUT; } } - return true; - } - - GuestGroup& FindOrAddGroup(FilterArguments&& arguments) - { - auto foundGroup = std::find_if( - std::begin(_groups), std::end(_groups), [&arguments](GuestGroup& group) { return group.Arguments == arguments; }); - if (foundGroup != std::end(_groups)) + template static bool CompareGuestItem(const GuestItem& a, const GuestItem& b) { - return *foundGroup; - } - auto& newGroup = _groups.emplace_back(); - newGroup.Arguments = arguments; - return newGroup; - } - - void RefreshGroups() - { - _lastFindGroupsTick = Floor2(GetGameState().CurrentTicks, 256); - _lastFindGroupsSelectedView = _selectedView; - _lastFindGroupsWait = 320; - _groups.clear(); - - for (auto peep : EntityList()) - { - if (peep->OutsideOfPark) - continue; - - auto& group = FindOrAddGroup(GetArgumentsFromPeep(*peep, _selectedView)); - if (group.NumGuests < std::size(group.Faces)) + const auto* peepA = GetEntity(a.Id); + const auto* peepB = GetEntity(b.Id); + if (peepA != nullptr && peepB != nullptr) { - group.Faces[group.NumGuests] = GetPeepFaceSpriteSmall(peep) - SPR_PEEP_SMALL_FACE_VERY_VERY_UNHAPPY; + // Compare types + if (peepA->Type != peepB->Type) + { + return static_cast(peepA->Type) < static_cast(peepB->Type); + } + + // Compare name + if constexpr (!TRealNames) + { + if (peepA->Name == nullptr && peepB->Name == nullptr) + { + // Simple ID comparison for when both peeps use a number or a generated name + return peepA->PeepId < peepB->PeepId; + } + } } - group.NumGuests++; + return StrLogicalCmp(a.Name, b.Name) < 0; } - // 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; - }); - if (foundGroup != std::end(_groups)) + static GuestItem::CompareFunc GetGuestCompareFunc() { - _groups.erase(foundGroup); + return GetGameState().ParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES ? CompareGuestItem + : CompareGuestItem; } + }; - // Sort groups by number of guests - std::sort( - _groups.begin(), _groups.end(), [](const GuestGroup& a, const GuestGroup& b) { return a.NumGuests > b.NumGuests; }); - - // Remove up to MaxGroups - if (_groups.size() > MaxGroups) + WindowBase* WindowGuestListOpen() + { + auto* window = WindowBringToFrontByClass(WindowClass::GuestList); + if (window == nullptr) { - _groups.resize(MaxGroups); + window = WindowCreate(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE); } + return window; } /** - * Calculates a hash value (arguments) for comparing peep actions/thoughts + * @param index The number of the ride or index of the thought */ - static FilterArguments GetArgumentsFromPeep(const Guest& peep, GuestViewType type) + WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index) { - FilterArguments result; - Formatter ft(result.args); - switch (type) + auto* w = static_cast(WindowGuestListOpen()); + if (w != nullptr) { - case GuestViewType::Actions: - peep.FormatActionTo(ft); - break; - case GuestViewType::Thoughts: - { - const auto& thought = peep.Thoughts[0]; - if (thought.type != PeepThoughtType::None && thought.freshness <= 5) - { - PeepThoughtSetFormatArgs(&thought, ft); - } - break; - } + w->SetFilter(type, index); } - return result; + return w; } - static constexpr StringId GetViewName(GuestViewType type) + void WindowGuestListRefreshList() { - switch (type) + auto* w = WindowFindByClass(WindowClass::GuestList); + if (w != nullptr) { - default: - case GuestViewType::Actions: - return STR_ACTIONS; - case GuestViewType::Thoughts: - return STR_THOUGHTS; + static_cast(w)->RefreshList(); } } - - static constexpr StringId GetFilterString(GuestFilterType type) - { - switch (type) - { - default: - case GuestFilterType::Guests: - return STR_GUESTS_FILTER; - case GuestFilterType::GuestsThinking: - return STR_GUESTS_FILTER_THINKING; - case GuestFilterType::GuestsThinkingAbout: - return STR_GUESTS_FILTER_THINKING_ABOUT; - } - } - - template static bool CompareGuestItem(const GuestItem& a, const GuestItem& b) - { - const auto* peepA = GetEntity(a.Id); - const auto* peepB = GetEntity(b.Id); - if (peepA != nullptr && peepB != nullptr) - { - // Compare types - if (peepA->Type != peepB->Type) - { - return static_cast(peepA->Type) < static_cast(peepB->Type); - } - - // Compare name - if constexpr (!TRealNames) - { - if (peepA->Name == nullptr && peepB->Name == nullptr) - { - // Simple ID comparison for when both peeps use a number or a generated name - return peepA->PeepId < peepB->PeepId; - } - } - } - return StrLogicalCmp(a.Name, b.Name) < 0; - } - - static GuestItem::CompareFunc GetGuestCompareFunc() - { - return GetGameState().ParkFlags & PARK_FLAGS_SHOW_REAL_GUEST_NAMES ? CompareGuestItem : CompareGuestItem; - } -}; - -WindowBase* WindowGuestListOpen() -{ - auto* window = WindowBringToFrontByClass(WindowClass::GuestList); - if (window == nullptr) - { - window = WindowCreate(WindowClass::GuestList, 350, 330, WF_10 | WF_RESIZABLE); - } - return window; -} - -/** - * @param index The number of the ride or index of the thought - */ -WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index) -{ - auto* w = static_cast(WindowGuestListOpen()); - if (w != nullptr) - { - w->SetFilter(type, index); - } - return w; -} - -void WindowGuestListRefreshList() -{ - auto* w = WindowFindByClass(WindowClass::GuestList); - if (w != nullptr) - { - static_cast(w)->RefreshList(); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 59447abcc7..3ee93e8253 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -28,7 +28,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -56,387 +58,388 @@ static Widget window_install_track_widgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class InstallTrackWindow final : public Window -{ -private: - std::unique_ptr _trackDesign; - std::string _trackPath; - std::string _trackName; - std::vector _trackDesignPreviewPixels; - -public: - void SetupTrack(const utf8* path, std::unique_ptr trackDesign) + class InstallTrackWindow final : public Window { - _trackDesign = std::move(trackDesign); - _trackPath = path; - _trackName = GetNameFromTrackPath(path); - _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); + private: + std::unique_ptr _trackDesign; + std::string _trackPath; + std::string _trackName; + std::vector _trackDesignPreviewPixels; - UpdatePreview(); - Invalidate(); - } - - void OnOpen() override - { - widgets = window_install_track_widgets; - - WindowInitScrollWidgets(*this); - WindowPushOthersRight(*this); - } - - void OnClose() override - { - _trackPath.clear(); - _trackName.clear(); - _trackDesignPreviewPixels.clear(); - _trackDesignPreviewPixels.shrink_to_fit(); - _trackDesign = nullptr; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void SetupTrack(const utf8* path, std::unique_ptr trackDesign) { - case WIDX_CLOSE: - case WIDX_CANCEL: - Close(); - break; - case WIDX_ROTATE: - _currentTrackPieceDirection++; - _currentTrackPieceDirection %= 4; - Invalidate(); - break; - case WIDX_TOGGLE_SCENERY: - gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; - UpdatePreview(); - Invalidate(); - break; - case WIDX_INSTALL: - InstallTrackDesign(); - break; - } - } + _trackDesign = std::move(trackDesign); + _trackPath = path; + _trackName = GetNameFromTrackPath(path); + _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex != WIDX_INSTALL || text.empty()) - { - return; + UpdatePreview(); + Invalidate(); } - _trackName = std::string(text); - - OnMouseUp(WIDX_INSTALL); - } - - void OnPrepareDraw() override - { - pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; - if (!gTrackDesignSceneryToggle) + void OnOpen() override { - pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); + widgets = window_install_track_widgets; + + WindowInitScrollWidgets(*this); + WindowPushOthersRight(*this); } - else + + void OnClose() override { - pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); + _trackPath.clear(); + _trackName.clear(); + _trackDesignPreviewPixels.clear(); + _trackDesignPreviewPixels.shrink_to_fit(); + _trackDesign = nullptr; } - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - // Track preview - Widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW]; - auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; - int32_t colour = ColourMapA[colours[0]].darkest; - GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); - - G1Element g1temp = {}; - g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); - g1temp.width = 370; - g1temp.height = 217; - g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; - GfxSetG1Element(SPR_TEMP, &g1temp); - DrawingEngineInvalidateImage(SPR_TEMP); - GfxDrawSprite(dpi, ImageId(SPR_TEMP), screenPos); - - screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 }; - - // Warnings - const TrackDesign* td6 = _trackDesign.get(); - if (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) + void OnMouseUp(WidgetIndex widgetIndex) override { + switch (widgetIndex) + { + case WIDX_CLOSE: + case WIDX_CANCEL: + Close(); + break; + case WIDX_ROTATE: + _currentTrackPieceDirection++; + _currentTrackPieceDirection %= 4; + Invalidate(); + break; + case WIDX_TOGGLE_SCENERY: + gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; + UpdatePreview(); + Invalidate(); + break; + case WIDX_INSTALL: + InstallTrackDesign(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_INSTALL || text.empty()) + { + return; + } + + _trackName = std::string(text); + + OnMouseUp(WIDX_INSTALL); + } + + void OnPrepareDraw() override + { + pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; if (!gTrackDesignSceneryToggle) { - // Scenery not available - DrawTextEllipsised( - dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); - screenPos.y -= LIST_ROW_HEIGHT; - } - } - - // Information - screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 4 }; - // 0x006D3CF1 -- 0x006d3d71 missing - - // Track design name & type - { - auto trackName = _trackName.c_str(); - auto ft = Formatter(); - ft.Add(trackName); - DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - // Friendly Track name - { - auto ft = Formatter(); - - const auto* objectEntry = ObjectManagerLoadObject(&td6->vehicle_object.Entry); - if (objectEntry != nullptr) - { - auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(objectEntry); - auto rideName = GetRideNaming(td6->type, *GetRideEntryByIndex(groupIndex)); - ft.Add(rideName.Name); + pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); } else { - // Fall back on the technical track name if the vehicle object cannot be loaded - ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); + pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + // Track preview + Widget* widget = &window_install_track_widgets[WIDX_TRACK_PREVIEW]; + auto screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->top + 1 }; + int32_t colour = ColourMapA[colours[0]].darkest; + GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); + + G1Element g1temp = {}; + g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); + g1temp.width = 370; + g1temp.height = 217; + g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; + GfxSetG1Element(SPR_TEMP, &g1temp); + DrawingEngineInvalidateImage(SPR_TEMP); + GfxDrawSprite(dpi, ImageId(SPR_TEMP), screenPos); + + screenPos = windowPos + ScreenCoordsXY{ widget->midX(), widget->bottom - 12 }; + + // Warnings + const TrackDesign* td6 = _trackDesign.get(); + if (td6->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) + { + if (!gTrackDesignSceneryToggle) + { + // Scenery not available + DrawTextEllipsised( + dpi, screenPos, 308, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + screenPos.y -= LIST_ROW_HEIGHT; + } } - DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; - } + // Information + screenPos = windowPos + ScreenCoordsXY{ widget->left + 1, widget->bottom + 4 }; + // 0x006D3CF1 -- 0x006d3d71 missing - // Stats - { - fixed32_2dp rating = td6->excitement * 10; - auto ft = Formatter(); - ft.Add(rating); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - { - fixed32_2dp rating = td6->intensity * 10; - auto ft = Formatter(); - ft.Add(rating); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - { - fixed32_2dp rating = td6->nausea * 10; - auto ft = Formatter(); - ft.Add(rating); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; - } - - const auto& rtd = GetRideTypeDescriptor(td6->type); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { - if (td6->type == RIDE_TYPE_MINI_GOLF) + // Track design name & type { - // Holes - uint16_t holes = td6->holes & 0x1F; + auto trackName = _trackName.c_str(); auto ft = Formatter(); - ft.Add(holes); - DrawTextBasic(dpi, screenPos, STR_HOLES, ft); + ft.Add(trackName); + DrawTextBasic(dpi, screenPos - ScreenCoordsXY{ 1, 0 }, STR_TRACK_DESIGN_NAME, ft); screenPos.y += LIST_ROW_HEIGHT; } - else + + // Friendly Track name { - // Maximum speed + auto ft = Formatter(); + + const auto* objectEntry = ObjectManagerLoadObject(&td6->vehicle_object.Entry); + if (objectEntry != nullptr) { - uint16_t speed = ((td6->max_speed << 16) * 9) >> 18; + auto groupIndex = ObjectManagerGetLoadedObjectEntryIndex(objectEntry); + auto rideName = GetRideNaming(td6->type, *GetRideEntryByIndex(groupIndex)); + ft.Add(rideName.Name); + } + else + { + // Fall back on the technical track name if the vehicle object cannot be loaded + ft.Add(GetRideTypeDescriptor(td6->type).Naming.Name); + } + + DrawTextBasic(dpi, screenPos, STR_TRACK_DESIGN_TYPE, ft); + screenPos.y += LIST_ROW_HEIGHT + 4; + } + + // Stats + { + fixed32_2dp rating = td6->excitement * 10; + auto ft = Formatter(); + ft.Add(rating); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + { + fixed32_2dp rating = td6->intensity * 10; + auto ft = Formatter(); + ft.Add(rating); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + { + fixed32_2dp rating = td6->nausea * 10; + auto ft = Formatter(); + ft.Add(rating); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT + 4; + } + + const auto& rtd = GetRideTypeDescriptor(td6->type); + if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + if (td6->type == RIDE_TYPE_MINI_GOLF) + { + // Holes + uint16_t holes = td6->holes & 0x1F; auto ft = Formatter(); - ft.Add(speed); - DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); + ft.Add(holes); + DrawTextBasic(dpi, screenPos, STR_HOLES, ft); screenPos.y += LIST_ROW_HEIGHT; } - // Average speed + else { - uint16_t speed = ((td6->average_speed << 16) * 9) >> 18; + // Maximum speed + { + uint16_t speed = ((td6->max_speed << 16) * 9) >> 18; + auto ft = Formatter(); + ft.Add(speed); + DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + // Average speed + { + uint16_t speed = ((td6->average_speed << 16) * 9) >> 18; + auto ft = Formatter(); + ft.Add(speed); + DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + + // Ride length + auto ft = Formatter(); + ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(td6->ride_length); + DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) + { + // Maximum positive vertical Gs + { + int32_t gForces = td6->max_positive_vertical_g * 32; auto ft = Formatter(); - ft.Add(speed); - DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); + ft.Add(gForces); + DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + // Maximum negative vertical Gs + { + int32_t gForces = td6->max_negative_vertical_g * 32; + auto ft = Formatter(); + ft.Add(gForces); + DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + // Maximum lateral Gs + { + int32_t gForces = td6->max_lateral_g * 32; + auto ft = Formatter(); + ft.Add(gForces); + DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + if (td6->total_air_time != 0) + { + // Total air time + int32_t airTime = td6->total_air_time * 25; + auto ft = Formatter(); + ft.Add(airTime); + DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); screenPos.y += LIST_ROW_HEIGHT; } } - // Ride length - auto ft = Formatter(); - ft.Add(STR_RIDE_LENGTH_ENTRY); - ft.Add(td6->ride_length); - DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) - { - // Maximum positive vertical Gs + if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) { - int32_t gForces = td6->max_positive_vertical_g * 32; + // Drops + uint16_t drops = td6->drops & 0x3F; auto ft = Formatter(); - ft.Add(gForces); - DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); + ft.Add(drops); + DrawTextBasic(dpi, screenPos, STR_DROPS, ft); + screenPos.y += LIST_ROW_HEIGHT; + + // Drop height is multiplied by 0.75 + DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); screenPos.y += LIST_ROW_HEIGHT; } - // Maximum negative vertical Gs + + if (td6->type != RIDE_TYPE_MINI_GOLF) { - int32_t gForces = td6->max_negative_vertical_g * 32; + uint16_t inversions = td6->inversions & 0x1F; + if (inversions != 0) + { + // Inversions + auto ft = Formatter(); + ft.Add(inversions); + DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + screenPos.y += 4; + + if (td6->space_required_x != 0xFF) + { + // Space required auto ft = Formatter(); - ft.Add(gForces); - DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); + ft.Add(td6->space_required_x); + ft.Add(td6->space_required_y); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); screenPos.y += LIST_ROW_HEIGHT; } - // Maximum lateral Gs + + if (td6->cost != 0) { - int32_t gForces = td6->max_lateral_g * 32; auto ft = Formatter(); - ft.Add(gForces); - DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - if (td6->total_air_time != 0) - { - // Total air time - int32_t airTime = td6->total_air_time * 25; - auto ft = Formatter(); - ft.Add(airTime); - DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); - screenPos.y += LIST_ROW_HEIGHT; + ft.Add(td6->cost); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); } } - if (GetRideTypeDescriptor(td6->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) + void OnResize() override { - // Drops - uint16_t drops = td6->drops & 0x3F; - auto ft = Formatter(); - ft.Add(drops); - DrawTextBasic(dpi, screenPos, STR_DROPS, ft); - screenPos.y += LIST_ROW_HEIGHT; - - // Drop height is multiplied by 0.75 - DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); - screenPos.y += LIST_ROW_HEIGHT; + ResizeFrame(); } - if (td6->type != RIDE_TYPE_MINI_GOLF) + private: + void UpdatePreview() { - uint16_t inversions = td6->inversions & 0x1F; - if (inversions != 0) - { - // Inversions - auto ft = Formatter(); - ft.Add(inversions); - DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); - screenPos.y += LIST_ROW_HEIGHT; - } + TrackDesignDrawPreview(_trackDesign.get(), _trackDesignPreviewPixels.data()); } - screenPos.y += 4; - if (td6->space_required_x != 0xFF) + void InstallTrackDesign() { - // Space required - auto ft = Formatter(); - ft.Add(td6->space_required_x); - ft.Add(td6->space_required_y); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (td6->cost != 0) - { - auto ft = Formatter(); - ft.Add(td6->cost); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); - } - } - - void OnResize() override - { - ResizeFrame(); - } - -private: - void UpdatePreview() - { - TrackDesignDrawPreview(_trackDesign.get(), _trackDesignPreviewPixels.data()); - } - - void InstallTrackDesign() - { - auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK); - if (!Path::CreateDirectory(destPath)) - { - LOG_ERROR("Unable to create directory '%s'", destPath.c_str()); - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); - return; - } - - destPath = Path::Combine(destPath, _trackName + u8".td6"); - - 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, {}); - WindowTextInputRawOpen( - this, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, - {}, _trackName.c_str(), 255); - } - else - { - if (TrackRepositoryInstall(_trackPath.c_str(), _trackName.c_str())) - { - Close(); - } - else + auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); + auto destPath = env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, OpenRCT2::DIRID::TRACK); + if (!Path::CreateDirectory(destPath)) { + LOG_ERROR("Unable to create directory '%s'", destPath.c_str()); ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + return; + } + + destPath = Path::Combine(destPath, _trackName + u8".td6"); + + 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, {}); + WindowTextInputRawOpen( + this, WIDX_INSTALL, STR_SELECT_NEW_NAME_FOR_TRACK_DESIGN, + STR_AN_EXISTING_TRACK_DESIGN_ALREADY_HAS_THIS_NAME, {}, _trackName.c_str(), 255); + } + else + { + if (TrackRepositoryInstall(_trackPath.c_str(), _trackName.c_str())) + { + Close(); + } + else + { + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, STR_NONE, {}); + } } } - } -}; + }; -WindowBase* WindowInstallTrackOpen(const utf8* path) -{ - auto trackDesign = TrackDesignImport(path); - if (trackDesign == nullptr) + WindowBase* WindowInstallTrackOpen(const utf8* path) { - ContextShowError(STR_UNABLE_TO_LOAD_FILE, STR_NONE, {}); - return nullptr; + auto trackDesign = TrackDesignImport(path); + if (trackDesign == nullptr) + { + ContextShowError(STR_UNABLE_TO_LOAD_FILE, STR_NONE, {}); + return nullptr; + } + + ObjectManagerUnloadAllObjects(); + if (trackDesign->type == RIDE_TYPE_NULL) + { + LOG_ERROR("Failed to load track (ride type null): %s", path); + return nullptr; + } + if (ObjectManagerLoadObject(&trackDesign->vehicle_object.Entry) == nullptr) + { + LOG_ERROR("Failed to load track (vehicle load fail): %s", path); + return nullptr; + } + + WindowCloseByClass(WindowClass::EditorObjectSelection); + WindowCloseConstructionWindows(); + + gTrackDesignSceneryToggle = false; + _currentTrackPieceDirection = 2; + + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; + + auto* window = WindowFocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); + window->SetupTrack(path, std::move(trackDesign)); + + return window; } - - ObjectManagerUnloadAllObjects(); - if (trackDesign->type == RIDE_TYPE_NULL) - { - LOG_ERROR("Failed to load track (ride type null): %s", path); - return nullptr; - } - if (ObjectManagerLoadObject(&trackDesign->vehicle_object.Entry) == nullptr) - { - LOG_ERROR("Failed to load track (vehicle load fail): %s", path); - return nullptr; - } - - WindowCloseByClass(WindowClass::EditorObjectSelection); - WindowCloseConstructionWindows(); - - gTrackDesignSceneryToggle = false; - _currentTrackPieceDirection = 2; - - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - auto screenPos = ScreenCoordsXY{ screenWidth / 2 - 201, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; - - auto* window = WindowFocusOrCreate(WindowClass::InstallTrack, screenPos, WW, WH, 0); - window->SetupTrack(path, std::move(trackDesign)); - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index e88f254b17..f3c8cc3098 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -20,13 +20,13 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_LAND; + static constexpr int32_t WH = 160; + static constexpr int32_t WW = 98; -static constexpr StringId WINDOW_TITLE = STR_LAND; -static constexpr int32_t WH = 160; -static constexpr int32_t WW = 98; - -// clang-format off + // clang-format off enum WindowLandWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -51,302 +51,305 @@ static Widget window_land_widgets[] = { MakeWidget ({49, 106}, {47, 36}, WindowWidgetType::FlatBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_CHANGE_VERTICAL_LAND_TIP), // wall texture kWidgetsEnd, }; -// clang-format on + // clang-format on -class LandWindow final : public Window -{ -private: - ObjectEntryIndex _selectedFloorTexture = 0; - ObjectEntryIndex _selectedWallTexture = 0; - - void InputSize() + class LandWindow final : public Window { - 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); - } + private: + ObjectEntryIndex _selectedFloorTexture = 0; + ObjectEntryIndex _selectedWallTexture = 0; -public: - void OnOpen() override - { - widgets = window_land_widgets; - hold_down_widgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT); - WindowInitScrollWidgets(*this); - WindowPushOthersBelow(*this); - - gLandToolSize = 1; - gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; - gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; - gLandMountainMode = false; - gLandPaintMode = false; - _selectedFloorTexture = LandTool::GetSurfaceStyleFromDropdownIndex(0); - _selectedWallTexture = LandTool::GetEdgeStyleFromDropdownIndex(0); - gLandToolRaiseCost = kMoney64Undefined; - gLandToolLowerCost = kMoney64Undefined; - } - - void OnClose() override - { - // If the tool wasn't changed, turn tool off - if (LandToolIsActive()) - ToolCancel(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void InputSize() { - case WIDX_CLOSE: + 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); + } + + public: + void OnOpen() override + { + widgets = window_land_widgets; + hold_down_widgets = (1uLL << WIDX_DECREMENT) | (1uLL << WIDX_INCREMENT); + WindowInitScrollWidgets(*this); + WindowPushOthersBelow(*this); + + gLandToolSize = 1; + gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; + gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; + gLandMountainMode = false; + gLandPaintMode = false; + _selectedFloorTexture = LandTool::GetSurfaceStyleFromDropdownIndex(0); + _selectedWallTexture = LandTool::GetEdgeStyleFromDropdownIndex(0); + gLandToolRaiseCost = kMoney64Undefined; + gLandToolLowerCost = kMoney64Undefined; + } + + void OnClose() override + { + // If the tool wasn't changed, turn tool off + if (LandToolIsActive()) + ToolCancel(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_MOUNTAINMODE: + gLandMountainMode ^= 1; + gLandPaintMode = 0; + Invalidate(); + break; + case WIDX_PAINTMODE: + gLandMountainMode = 0; + gLandPaintMode ^= 1; + Invalidate(); + break; + case WIDX_PREVIEW: + InputSize(); + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + Widget* widget = &widgets[widgetIndex]; + switch (widgetIndex) + { + case WIDX_FLOOR: + LandTool::ShowSurfaceStyleDropdown(this, widget, _selectedFloorTexture); + break; + case WIDX_WALL: + LandTool::ShowEdgeStyleDropdown(this, widget, _selectedWallTexture); + break; + case WIDX_PREVIEW: + InputSize(); + break; + case WIDX_DECREMENT: + // Decrement land tool size + gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); + + // Invalidate the window + Invalidate(); + break; + case WIDX_INCREMENT: + // Increment land tool size + gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); + + // Invalidate the window + Invalidate(); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + int32_t type; + + switch (widgetIndex) + { + case WIDX_FLOOR: + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; + + type = (dropdownIndex == -1) + ? _selectedFloorTexture + : LandTool::GetSurfaceStyleFromDropdownIndex(static_cast(dropdownIndex)); + + if (gLandToolTerrainSurface == type) + { + gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; + } + else + { + gLandToolTerrainSurface = type; + _selectedFloorTexture = type; + } + Invalidate(); + break; + case WIDX_WALL: + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; + + type = (dropdownIndex == -1) ? _selectedWallTexture + : LandTool::GetEdgeStyleFromDropdownIndex(static_cast(dropdownIndex)); + + if (gLandToolTerrainEdge == type) + { + gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; + } + else + { + gLandToolTerrainEdge = type; + _selectedWallTexture = type; + } + Invalidate(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_PREVIEW) + return; + + char* end; + std::string textStr = std::string(text); + int32_t size = strtol(textStr.c_str(), &end, 10); + if (*end == '\0') + { + size = std::max(kLandToolMinimumSize, size); + size = std::min(kLandToolMaximumSize, size); + gLandToolSize = size; + + Invalidate(); + } + } + + void OnUpdate() override + { + if (!LandToolIsActive()) Close(); - break; - case WIDX_MOUNTAINMODE: - gLandMountainMode ^= 1; - gLandPaintMode = 0; - Invalidate(); - break; - case WIDX_PAINTMODE: - gLandMountainMode = 0; - gLandPaintMode ^= 1; - Invalidate(); - break; - case WIDX_PREVIEW: - InputSize(); - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - Widget* widget = &widgets[widgetIndex]; - switch (widgetIndex) - { - case WIDX_FLOOR: - LandTool::ShowSurfaceStyleDropdown(this, widget, _selectedFloorTexture); - break; - case WIDX_WALL: - LandTool::ShowEdgeStyleDropdown(this, widget, _selectedWallTexture); - break; - case WIDX_PREVIEW: - InputSize(); - break; - case WIDX_DECREMENT: - // Decrement land tool size - gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); - - // Invalidate the window - Invalidate(); - break; - case WIDX_INCREMENT: - // Increment land tool size - gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); - - // Invalidate the window - Invalidate(); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - int32_t type; - - switch (widgetIndex) - { - case WIDX_FLOOR: - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - type = (dropdownIndex == -1) ? _selectedFloorTexture - : LandTool::GetSurfaceStyleFromDropdownIndex(static_cast(dropdownIndex)); - - if (gLandToolTerrainSurface == type) - { - gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; - } - else - { - gLandToolTerrainSurface = type; - _selectedFloorTexture = type; - } - Invalidate(); - break; - case WIDX_WALL: - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - type = (dropdownIndex == -1) ? _selectedWallTexture - : LandTool::GetEdgeStyleFromDropdownIndex(static_cast(dropdownIndex)); - - if (gLandToolTerrainEdge == type) - { - gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; - } - else - { - gLandToolTerrainEdge = type; - _selectedWallTexture = type; - } - Invalidate(); - break; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex != WIDX_PREVIEW) - return; - - char* end; - std::string textStr = std::string(text); - int32_t size = strtol(textStr.c_str(), &end, 10); - if (*end == '\0') - { - size = std::max(kLandToolMinimumSize, size); - size = std::min(kLandToolMaximumSize, size); - gLandToolSize = size; - - Invalidate(); - } - } - - void OnUpdate() override - { - if (!LandToolIsActive()) - Close(); - } - - void OnPrepareDraw() override - { - pressed_widgets = 0; - SetWidgetPressed(WIDX_PREVIEW, true); - if (gLandToolTerrainSurface != OBJECT_ENTRY_INDEX_NULL) - SetWidgetPressed(WIDX_FLOOR, true); - if (gLandToolTerrainEdge != OBJECT_ENTRY_INDEX_NULL) - SetWidgetPressed(WIDX_WALL, true); - if (gLandMountainMode) - SetWidgetPressed(WIDX_MOUNTAINMODE, true); - if (gLandPaintMode) - SetWidgetPressed(WIDX_PAINTMODE, true); - - // Update the preview image (for tool sizes up to 7) - widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - ScreenCoordsXY screenCoords; - int32_t numTiles; - money64 price; - Widget* previewWidget = &widgets[WIDX_PREVIEW]; - - DrawWidgets(dpi); - DrawDropdownButtons(dpi); - - // Draw number for tool sizes bigger than 7 - if (gLandToolSize > kLandToolMaximumSizeWithSprite) - { - auto ft = Formatter(); - ft.Add(gLandToolSize); - screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->midY() }; - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); - } - else if (gLandMountainMode) - { - screenCoords = { windowPos.x + previewWidget->left, windowPos.y + previewWidget->top }; - auto sprite = ImageId(gLandToolSize % 2 == 0 ? SPR_G2_MOUNTAIN_TOOL_EVEN : SPR_G2_MOUNTAIN_TOOL_ODD); - GfxDrawSprite(dpi, sprite, screenCoords); - WidgetDraw(dpi, *this, WIDX_DECREMENT); - WidgetDraw(dpi, *this, WIDX_INCREMENT); } - screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->bottom + 5 }; - - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + void OnPrepareDraw() override { - // Draw raise cost amount - if (gLandToolRaiseCost != kMoney64Undefined && gLandToolRaiseCost != 0) - { - auto ft = Formatter(); - ft.Add(gLandToolRaiseCost); - DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); - } - screenCoords.y += 10; - - // Draw lower cost amount - if (gLandToolLowerCost != kMoney64Undefined && gLandToolLowerCost != 0) - { - auto ft = Formatter(); - ft.Add(gLandToolLowerCost); - DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); - } - screenCoords.y += 50; - - // Draw paint price - numTiles = gLandToolSize * gLandToolSize; - price = 0; + pressed_widgets = 0; + SetWidgetPressed(WIDX_PREVIEW, true); if (gLandToolTerrainSurface != OBJECT_ENTRY_INDEX_NULL) - { - auto& objManager = GetContext()->GetObjectManager(); - const auto surfaceObj = static_cast( - objManager.GetLoadedObject(ObjectType::TerrainSurface, gLandToolTerrainSurface)); - if (surfaceObj != nullptr) - { - price += numTiles * static_cast(surfaceObj->Price); - } - } - + SetWidgetPressed(WIDX_FLOOR, true); if (gLandToolTerrainEdge != OBJECT_ENTRY_INDEX_NULL) - price += numTiles * 100LL; + SetWidgetPressed(WIDX_WALL, true); + if (gLandMountainMode) + SetWidgetPressed(WIDX_MOUNTAINMODE, true); + if (gLandPaintMode) + SetWidgetPressed(WIDX_PAINTMODE, true); - if (price != 0) + // Update the preview image (for tool sizes up to 7) + widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + ScreenCoordsXY screenCoords; + int32_t numTiles; + money64 price; + Widget* previewWidget = &widgets[WIDX_PREVIEW]; + + DrawWidgets(dpi); + DrawDropdownButtons(dpi); + + // Draw number for tool sizes bigger than 7 + if (gLandToolSize > kLandToolMaximumSizeWithSprite) { auto ft = Formatter(); - ft.Add(price); - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + ft.Add(gLandToolSize); + screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->midY() }; + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + else if (gLandMountainMode) + { + screenCoords = { windowPos.x + previewWidget->left, windowPos.y + previewWidget->top }; + auto sprite = ImageId(gLandToolSize % 2 == 0 ? SPR_G2_MOUNTAIN_TOOL_EVEN : SPR_G2_MOUNTAIN_TOOL_ODD); + GfxDrawSprite(dpi, sprite, screenCoords); + WidgetDraw(dpi, *this, WIDX_DECREMENT); + WidgetDraw(dpi, *this, WIDX_INCREMENT); + } + + screenCoords = { windowPos.x + previewWidget->midX(), windowPos.y + previewWidget->bottom + 5 }; + + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + // Draw raise cost amount + if (gLandToolRaiseCost != kMoney64Undefined && gLandToolRaiseCost != 0) + { + auto ft = Formatter(); + ft.Add(gLandToolRaiseCost); + DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } + screenCoords.y += 10; + + // Draw lower cost amount + if (gLandToolLowerCost != kMoney64Undefined && gLandToolLowerCost != 0) + { + auto ft = Formatter(); + ft.Add(gLandToolLowerCost); + DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } + screenCoords.y += 50; + + // Draw paint price + numTiles = gLandToolSize * gLandToolSize; + price = 0; + if (gLandToolTerrainSurface != OBJECT_ENTRY_INDEX_NULL) + { + auto& objManager = GetContext()->GetObjectManager(); + const auto surfaceObj = static_cast( + objManager.GetLoadedObject(ObjectType::TerrainSurface, gLandToolTerrainSurface)); + if (surfaceObj != nullptr) + { + price += numTiles * static_cast(surfaceObj->Price); + } + } + + if (gLandToolTerrainEdge != OBJECT_ENTRY_INDEX_NULL) + price += numTiles * 100LL; + + if (price != 0) + { + auto ft = Formatter(); + ft.Add(price); + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } } } - } - void OnResize() override - { - ResizeFrame(); - } - -private: - void DrawDropdownButtons(DrawPixelInfo& dpi) - { - auto& objManager = GetContext()->GetObjectManager(); - const auto surfaceObj = static_cast( - objManager.GetLoadedObject(ObjectType::TerrainSurface, _selectedFloorTexture)); - ImageId surfaceImage; - if (surfaceObj != nullptr) + void OnResize() override { - surfaceImage = ImageId(surfaceObj->IconImageId); - if (surfaceObj->Colour != 255) - surfaceImage = surfaceImage.WithPrimary(surfaceObj->Colour); + ResizeFrame(); } - const auto edgeObj = static_cast( - objManager.GetLoadedObject(ObjectType::TerrainEdge, _selectedWallTexture)); - ImageId edgeImage; - if (edgeObj != nullptr) + private: + void DrawDropdownButtons(DrawPixelInfo& dpi) { - edgeImage = ImageId(edgeObj->IconImageId); + auto& objManager = GetContext()->GetObjectManager(); + const auto surfaceObj = static_cast( + objManager.GetLoadedObject(ObjectType::TerrainSurface, _selectedFloorTexture)); + ImageId surfaceImage; + if (surfaceObj != nullptr) + { + surfaceImage = ImageId(surfaceObj->IconImageId); + if (surfaceObj->Colour != 255) + surfaceImage = surfaceImage.WithPrimary(surfaceObj->Colour); + } + + const auto edgeObj = static_cast( + objManager.GetLoadedObject(ObjectType::TerrainEdge, _selectedWallTexture)); + ImageId edgeImage; + if (edgeObj != nullptr) + { + edgeImage = ImageId(edgeObj->IconImageId); + } + + DrawDropdownButton(dpi, WIDX_FLOOR, surfaceImage); + DrawDropdownButton(dpi, WIDX_WALL, edgeImage); } - DrawDropdownButton(dpi, WIDX_FLOOR, surfaceImage); - DrawDropdownButton(dpi, WIDX_WALL, edgeImage); - } + void DrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageId image) + { + const auto& widget = widgets[widgetIndex]; + GfxDrawSprite(dpi, image, { windowPos.x + widget.left, windowPos.y + widget.top }); + } + }; - void DrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageId image) + WindowBase* WindowLandOpen() { - const auto& widget = widgets[widgetIndex]; - GfxDrawSprite(dpi, image, { windowPos.x + widget.left, windowPos.y + widget.top }); + return WindowFocusOrCreate(WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } -}; - -WindowBase* WindowLandOpen() -{ - return WindowFocusOrCreate(WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/LandRights.cpp b/src/openrct2-ui/windows/LandRights.cpp index 63bef5983a..a0415bb3ab 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -23,13 +23,13 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_LAND_RIGHTS; + static constexpr int32_t WH = 94; + static constexpr int32_t WW = 98; -static constexpr StringId WINDOW_TITLE = STR_LAND_RIGHTS; -static constexpr int32_t WH = 94; -static constexpr int32_t WW = 98; - -// clang-format off + // clang-format off enum WindowLandRightsWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -50,366 +50,369 @@ static Widget window_land_rights_widgets[] = { MakeRemapWidget({52, 53}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Tertiary, SPR_BUY_CONSTRUCTION_RIGHTS, STR_BUY_CONSTRUCTION_RIGHTS_TIP ), // construction rights kWidgetsEnd, }; -// clang-format on + // clang-format on -constexpr uint8_t LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS = 0; -constexpr uint8_t LAND_RIGHTS_MODE_BUY_LAND = 1; + constexpr uint8_t LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS = 0; + constexpr uint8_t LAND_RIGHTS_MODE_BUY_LAND = 1; -class LandRightsWindow final : public Window -{ -public: - void OnOpen() override + class LandRightsWindow final : public Window { - widgets = window_land_rights_widgets; - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); - WindowInitScrollWidgets(*this); - WindowPushOthersBelow(*this); - _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; - pressed_widgets = (1uLL << WIDX_BUY_LAND_RIGHTS); - - gLandToolSize = 1; - - ShowGridlines(); - ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); - InputSetFlag(INPUT_FLAG_6, true); - - ShowLandRights(); - - if (gLandRemainingConstructionSales == 0) + public: + void OnOpen() override { - ShowConstructionRights(); - } - } + widgets = window_land_rights_widgets; + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + WindowInitScrollWidgets(*this); + WindowPushOthersBelow(*this); + _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; + pressed_widgets = (1uLL << WIDX_BUY_LAND_RIGHTS); - void OnClose() override - { - HideGridlines(); - if (gLandRemainingConstructionSales == 0) - { - HideConstructionRights(); + gLandToolSize = 1; + + ShowGridlines(); + ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); + InputSetFlag(INPUT_FLAG_6, true); + + ShowLandRights(); + + if (gLandRemainingConstructionSales == 0) + { + ShowConstructionRights(); + } } - // If the tool wasn't changed, turn tool off - if (LandRightsToolIsActive()) - ToolCancel(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnClose() override { - case WIDX_CLOSE: + HideGridlines(); + if (gLandRemainingConstructionSales == 0) + { + HideConstructionRights(); + } + + // If the tool wasn't changed, turn tool off + if (LandRightsToolIsActive()) + ToolCancel(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_PREVIEW: + InputSize(); + break; + case WIDX_BUY_LAND_RIGHTS: + if (_landRightsMode != LAND_RIGHTS_MODE_BUY_LAND) + { + ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); + _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; + ShowLandRights(); + Invalidate(); + } + break; + case WIDX_BUY_CONSTRUCTION_RIGHTS: + if (_landRightsMode != LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS) + { + ToolSet(*this, WIDX_BUY_CONSTRUCTION_RIGHTS, Tool::UpArrow); + _landRightsMode = LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS; + ShowConstructionRights(); + Invalidate(); + } + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_DECREMENT: + // Decrement land rights tool size + gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); + + // Invalidate the window + Invalidate(); + break; + case WIDX_INCREMENT: + // Decrement land rights tool size + gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); + + // Invalidate the window + Invalidate(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (text.empty()) + return; + + if (widgetIndex != WIDX_PREVIEW) + return; + + const auto res = String::Parse(text); + if (res.has_value()) + { + uint16_t size; + size = res.value(); + size = std::max(kLandToolMinimumSize, size); + size = std::min(kLandToolMaximumSize, size); + gLandToolSize = size; + Invalidate(); + } + } + + void OnUpdate() override + { + frame_no++; + // Close window if another tool is open + if (!LandRightsToolIsActive()) Close(); - break; - case WIDX_PREVIEW: - InputSize(); - break; - case WIDX_BUY_LAND_RIGHTS: - if (_landRightsMode != LAND_RIGHTS_MODE_BUY_LAND) + } + + void OnPrepareDraw() override + { + SetWidgetPressed(WIDX_PREVIEW, true); + if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) + { + SetWidgetPressed(WIDX_BUY_LAND_RIGHTS, true); + SetWidgetPressed(WIDX_BUY_CONSTRUCTION_RIGHTS, false); + } + else if (_landRightsMode == LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS) + { + SetWidgetPressed(WIDX_BUY_LAND_RIGHTS, false); + SetWidgetPressed(WIDX_BUY_CONSTRUCTION_RIGHTS, true); + } + + window_land_rights_widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); + + if (gLandRemainingOwnershipSales == 0) + { + SetWidgetDisabled(WIDX_BUY_LAND_RIGHTS, true); + window_land_rights_widgets[WIDX_BUY_LAND_RIGHTS].tooltip = STR_NO_LAND_RIGHTS_FOR_SALE_TIP; + } + else + { + SetWidgetDisabled(WIDX_BUY_LAND_RIGHTS, false); + window_land_rights_widgets[WIDX_BUY_LAND_RIGHTS].tooltip = STR_BUY_LAND_RIGHTS_TIP; + } + + if (gLandRemainingConstructionSales == 0) + { + SetWidgetDisabled(WIDX_BUY_CONSTRUCTION_RIGHTS, true); + window_land_rights_widgets[WIDX_BUY_CONSTRUCTION_RIGHTS].tooltip = STR_NO_CONSTRUCTION_RIGHTS_FOR_SALE_TIP; + } + else + { + SetWidgetDisabled(WIDX_BUY_CONSTRUCTION_RIGHTS, false); + window_land_rights_widgets[WIDX_BUY_CONSTRUCTION_RIGHTS].tooltip = STR_BUY_CONSTRUCTION_RIGHTS_TIP; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + auto screenCoords = ScreenCoordsXY{ windowPos.x + window_land_rights_widgets[WIDX_PREVIEW].midX(), + windowPos.y + window_land_rights_widgets[WIDX_PREVIEW].midY() }; + + DrawWidgets(dpi); + // Draw number for tool sizes bigger than 7 + if (gLandToolSize > kLandToolMaximumSizeWithSprite) + { + auto ft = Formatter(); + ft.Add(gLandToolSize); + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + + // Draw cost amount + if (_landRightsCost != kMoney64Undefined && _landRightsCost != 0 + && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(_landRightsCost); + screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + windowPos.x, + window_land_rights_widgets[WIDX_PREVIEW].bottom + windowPos.y + 32 }; + DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + + auto info = GetMapCoordinatesFromPos( + screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water)); + if (info.SpriteType == ViewportInteractionItem::None) + { + if (_landRightsCost != kMoney64Undefined) { - ToolSet(*this, WIDX_BUY_LAND_RIGHTS, Tool::UpArrow); - _landRightsMode = LAND_RIGHTS_MODE_BUY_LAND; - ShowLandRights(); - Invalidate(); + _landRightsCost = kMoney64Undefined; + WindowInvalidateByClass(WindowClass::ClearScenery); } - break; - case WIDX_BUY_CONSTRUCTION_RIGHTS: - if (_landRightsMode != LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS) + return; + } + auto mapTile = info.Loc; + + uint8_t state_changed = 0; + + if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + state_changed++; + } + + if (gMapSelectType != MAP_SELECT_TYPE_FULL_LAND_RIGHTS) + { + gMapSelectType = MAP_SELECT_TYPE_FULL_LAND_RIGHTS; + state_changed++; + } + + int16_t tool_size = gLandToolSize; + if (tool_size == 0) + tool_size = 1; + + int16_t tool_length = (tool_size - 1) * 32; + + // Move to tool bottom left + mapTile.x -= (tool_size - 1) * 16; + mapTile.y -= (tool_size - 1) * 16; + mapTile = mapTile.ToTileStart(); + + if (gMapSelectPositionA.x != mapTile.x) + { + gMapSelectPositionA.x = mapTile.x; + state_changed++; + } + + if (gMapSelectPositionA.y != mapTile.y) + { + gMapSelectPositionA.y = mapTile.y; + state_changed++; + } + + mapTile.x += tool_length; + mapTile.y += tool_length; + + if (gMapSelectPositionB.x != mapTile.x) + { + gMapSelectPositionB.x = mapTile.x; + state_changed++; + } + + if (gMapSelectPositionB.y != mapTile.y) + { + gMapSelectPositionB.y = mapTile.y; + state_changed++; + } + + MapInvalidateSelectionRect(); + if (!state_changed) + return; + + auto landBuyRightsAction = LandBuyRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) ? LandBuyRightSetting::BuyLand + : LandBuyRightSetting::BuyConstructionRights); + auto res = GameActions::Query(&landBuyRightsAction); + + _landRightsCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + } + + void OnToolAbort(WidgetIndex widgetIndex) override + { + if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) + { + HideLandRights(); + } + else + { + HideConstructionRights(); + } + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) + { + if (screenCoords.x != LOCATION_NULL) { - ToolSet(*this, WIDX_BUY_CONSTRUCTION_RIGHTS, Tool::UpArrow); - _landRightsMode = LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS; - ShowConstructionRights(); - Invalidate(); + auto landBuyRightsAction = LandBuyRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + LandBuyRightSetting::BuyLand); + GameActions::Execute(&landBuyRightsAction); } - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_DECREMENT: - // Decrement land rights tool size - gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); - - // Invalidate the window - Invalidate(); - break; - case WIDX_INCREMENT: - // Decrement land rights tool size - gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); - - // Invalidate the window - Invalidate(); - break; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - if (widgetIndex != WIDX_PREVIEW) - return; - - const auto res = String::Parse(text); - if (res.has_value()) - { - uint16_t size; - size = res.value(); - size = std::max(kLandToolMinimumSize, size); - size = std::min(kLandToolMaximumSize, size); - gLandToolSize = size; - Invalidate(); - } - } - - void OnUpdate() override - { - frame_no++; - // Close window if another tool is open - if (!LandRightsToolIsActive()) - Close(); - } - - void OnPrepareDraw() override - { - SetWidgetPressed(WIDX_PREVIEW, true); - if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) - { - SetWidgetPressed(WIDX_BUY_LAND_RIGHTS, true); - SetWidgetPressed(WIDX_BUY_CONSTRUCTION_RIGHTS, false); - } - else if (_landRightsMode == LAND_RIGHTS_MODE_BUY_CONSTRUCTION_RIGHTS) - { - SetWidgetPressed(WIDX_BUY_LAND_RIGHTS, false); - SetWidgetPressed(WIDX_BUY_CONSTRUCTION_RIGHTS, true); - } - - window_land_rights_widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); - - if (gLandRemainingOwnershipSales == 0) - { - SetWidgetDisabled(WIDX_BUY_LAND_RIGHTS, true); - window_land_rights_widgets[WIDX_BUY_LAND_RIGHTS].tooltip = STR_NO_LAND_RIGHTS_FOR_SALE_TIP; - } - else - { - SetWidgetDisabled(WIDX_BUY_LAND_RIGHTS, false); - window_land_rights_widgets[WIDX_BUY_LAND_RIGHTS].tooltip = STR_BUY_LAND_RIGHTS_TIP; - } - - if (gLandRemainingConstructionSales == 0) - { - SetWidgetDisabled(WIDX_BUY_CONSTRUCTION_RIGHTS, true); - window_land_rights_widgets[WIDX_BUY_CONSTRUCTION_RIGHTS].tooltip = STR_NO_CONSTRUCTION_RIGHTS_FOR_SALE_TIP; - } - else - { - SetWidgetDisabled(WIDX_BUY_CONSTRUCTION_RIGHTS, false); - window_land_rights_widgets[WIDX_BUY_CONSTRUCTION_RIGHTS].tooltip = STR_BUY_CONSTRUCTION_RIGHTS_TIP; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - auto screenCoords = ScreenCoordsXY{ windowPos.x + window_land_rights_widgets[WIDX_PREVIEW].midX(), - windowPos.y + window_land_rights_widgets[WIDX_PREVIEW].midY() }; - - DrawWidgets(dpi); - // Draw number for tool sizes bigger than 7 - if (gLandToolSize > kLandToolMaximumSizeWithSprite) - { - auto ft = Formatter(); - ft.Add(gLandToolSize); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); - } - - // Draw cost amount - if (_landRightsCost != kMoney64Undefined && _landRightsCost != 0 && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(_landRightsCost); - screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + windowPos.x, - window_land_rights_widgets[WIDX_PREVIEW].bottom + windowPos.y + 32 }; - DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE }); - } - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - auto info = GetMapCoordinatesFromPos( - screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water)); - if (info.SpriteType == ViewportInteractionItem::None) - { - if (_landRightsCost != kMoney64Undefined) - { - _landRightsCost = kMoney64Undefined; - WindowInvalidateByClass(WindowClass::ClearScenery); } - return; - } - auto mapTile = info.Loc; - - uint8_t state_changed = 0; - - if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - state_changed++; - } - - if (gMapSelectType != MAP_SELECT_TYPE_FULL_LAND_RIGHTS) - { - gMapSelectType = MAP_SELECT_TYPE_FULL_LAND_RIGHTS; - state_changed++; - } - - int16_t tool_size = gLandToolSize; - if (tool_size == 0) - tool_size = 1; - - int16_t tool_length = (tool_size - 1) * 32; - - // Move to tool bottom left - mapTile.x -= (tool_size - 1) * 16; - mapTile.y -= (tool_size - 1) * 16; - mapTile = mapTile.ToTileStart(); - - if (gMapSelectPositionA.x != mapTile.x) - { - gMapSelectPositionA.x = mapTile.x; - state_changed++; - } - - if (gMapSelectPositionA.y != mapTile.y) - { - gMapSelectPositionA.y = mapTile.y; - state_changed++; - } - - mapTile.x += tool_length; - mapTile.y += tool_length; - - if (gMapSelectPositionB.x != mapTile.x) - { - gMapSelectPositionB.x = mapTile.x; - state_changed++; - } - - if (gMapSelectPositionB.y != mapTile.y) - { - gMapSelectPositionB.y = mapTile.y; - state_changed++; - } - - MapInvalidateSelectionRect(); - if (!state_changed) - return; - - auto landBuyRightsAction = LandBuyRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) ? LandBuyRightSetting::BuyLand - : LandBuyRightSetting::BuyConstructionRights); - auto res = GameActions::Query(&landBuyRightsAction); - - _landRightsCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - } - - void OnToolAbort(WidgetIndex widgetIndex) override - { - if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) - { - HideLandRights(); - } - else - { - HideConstructionRights(); - } - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) - { - if (screenCoords.x != LOCATION_NULL) + else { - auto landBuyRightsAction = LandBuyRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - LandBuyRightSetting::BuyLand); - GameActions::Execute(&landBuyRightsAction); + if (screenCoords.x != LOCATION_NULL) + { + auto landBuyRightsAction = LandBuyRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + LandBuyRightSetting::BuyConstructionRights); + GameActions::Execute(&landBuyRightsAction); + } } } - else + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - if (screenCoords.x != LOCATION_NULL) + if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) { - auto landBuyRightsAction = LandBuyRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - LandBuyRightSetting::BuyConstructionRights); - GameActions::Execute(&landBuyRightsAction); + if (screenCoords.x != LOCATION_NULL) + { + auto landBuyRightsAction = LandBuyRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + LandBuyRightSetting::BuyLand); + GameActions::Execute(&landBuyRightsAction); + } + } + else + { + if (screenCoords.x != LOCATION_NULL) + { + auto landBuyRightsAction = LandBuyRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + LandBuyRightSetting::BuyConstructionRights); + GameActions::Execute(&landBuyRightsAction); + } } } - } - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (_landRightsMode == LAND_RIGHTS_MODE_BUY_LAND) + void OnResize() override { - if (screenCoords.x != LOCATION_NULL) - { - auto landBuyRightsAction = LandBuyRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - LandBuyRightSetting::BuyLand); - GameActions::Execute(&landBuyRightsAction); - } + ResizeFrame(); } - else + + private: + uint8_t _landRightsMode; + money64 _landRightsCost; + + void InputSize() { - if (screenCoords.x != LOCATION_NULL) - { - auto landBuyRightsAction = LandBuyRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - LandBuyRightSetting::BuyConstructionRights); - GameActions::Execute(&landBuyRightsAction); - } + 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); } - } - void OnResize() override + bool LandRightsToolIsActive() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WindowClass::LandRights) + return false; + return true; + } + }; + + WindowBase* WindowLandRightsOpen() { - ResizeFrame(); + return WindowFocusOrCreate( + WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } - -private: - uint8_t _landRightsMode; - money64 _landRightsCost; - - void InputSize() - { - 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); - } - - bool LandRightsToolIsActive() - { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WindowClass::LandRights) - return false; - return true; - } -}; - -WindowBase* WindowLandRightsOpen() -{ - return WindowFocusOrCreate( - 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 62c3b2a0ae..93000d8d75 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -39,33 +39,33 @@ #include #include -using namespace OpenRCT2; - +namespace OpenRCT2::Ui::Windows +{ #pragma region Widgets -static constexpr StringId WINDOW_TITLE = STR_NONE; -static constexpr int32_t WW = 350; -static constexpr int32_t WH = 400; + static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr int32_t WW = 350; + static constexpr int32_t WH = 400; -static constexpr uint16_t DATE_TIME_GAP = 2; + static constexpr uint16_t DATE_TIME_GAP = 2; -enum -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_RESIZE, - WIDX_DEFAULT, - WIDX_UP, - WIDX_NEW_FOLDER, - WIDX_NEW_FILE, - WIDX_SORT_NAME, - WIDX_SORT_DATE, - WIDX_SCROLL, - WIDX_BROWSE, -}; + enum + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_RESIZE, + WIDX_DEFAULT, + WIDX_UP, + WIDX_NEW_FOLDER, + WIDX_NEW_FILE, + WIDX_SORT_NAME, + WIDX_SORT_DATE, + WIDX_SCROLL, + WIDX_BROWSE, + }; -// clang-format off + // clang-format off static Widget window_loadsave_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), @@ -80,1081 +80,1088 @@ static Widget window_loadsave_widgets[] = MakeWidget({ 4, WH - 24}, {197, 19}, WindowWidgetType::Button, WindowColour::Primary, STR_FILEBROWSER_USE_SYSTEM_WINDOW ), // WIDX_BROWSE kWidgetsEnd, }; -// clang-format on + // clang-format on #pragma endregion -static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path); + static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path); -enum -{ - TYPE_DIRECTORY, - TYPE_FILE, -}; - -struct LoadSaveListItem -{ - std::string name{}; - std::string path{}; - time_t date_modified{ 0 }; - std::string date_formatted{}; - std::string time_formatted{}; - uint8_t type{ 0 }; - bool loaded{ false }; -}; - -static std::function _loadSaveCallback; -static TrackDesign* _trackDesign; - -static std::vector _listItems; -static char _directory[MAX_PATH]; -static char _parentDirectory[MAX_PATH]; -static u8string _extensionPattern; -static u8string _defaultPath; -static int32_t _type; - -static bool ListItemSort(LoadSaveListItem& a, LoadSaveListItem& b) -{ - if (a.type != b.type) - return a.type - b.type < 0; - - switch (gConfigGeneral.LoadSaveSort) + enum { - case Sort::NameAscending: - return StrLogicalCmp(a.name.c_str(), b.name.c_str()) < 0; - case Sort::NameDescending: - return -StrLogicalCmp(a.name.c_str(), b.name.c_str()) < 0; - case Sort::DateDescending: - return -difftime(a.date_modified, b.date_modified) < 0; - case Sort::DateAscending: - return difftime(a.date_modified, b.date_modified) < 0; - } - return StrLogicalCmp(a.name.c_str(), b.name.c_str()) < 0; -} + TYPE_DIRECTORY, + TYPE_FILE, + }; -static void SetAndSaveConfigPath(u8string& config_str, u8string_view path) -{ - config_str = Path::GetDirectory(path); - ConfigSaveDefault(); -} - -static bool IsValidPath(const char* path) -{ - // HACK This is needed because tracks get passed through with td? - // I am sure this will change eventually to use the new FileScanner - // which handles multiple patterns - auto filename = Path::GetFileNameWithoutExtension(path); - - return Platform::IsFilenameValid(filename); -} - -static u8string GetLastDirectoryByType(int32_t type) -{ - switch (type & 0x0E) + struct LoadSaveListItem { - case LOADSAVETYPE_GAME: - return gConfigGeneral.LastSaveGameDirectory; + std::string name{}; + std::string path{}; + time_t date_modified{ 0 }; + std::string date_formatted{}; + std::string time_formatted{}; + uint8_t type{ 0 }; + bool loaded{ false }; + }; - case LOADSAVETYPE_LANDSCAPE: - return gConfigGeneral.LastSaveLandscapeDirectory; + static std::function _loadSaveCallback; + static TrackDesign* _trackDesign; - case LOADSAVETYPE_SCENARIO: - return gConfigGeneral.LastSaveScenarioDirectory; + static std::vector _listItems; + static char _directory[MAX_PATH]; + static char _parentDirectory[MAX_PATH]; + static u8string _extensionPattern; + static u8string _defaultPath; + static int32_t _type; - case LOADSAVETYPE_TRACK: - return gConfigGeneral.LastSaveTrackDirectory; - - default: - return u8string(); - } -} - -static u8string GetInitialDirectoryByType(const int32_t type) -{ - std::optional subdir = std::nullopt; - switch (type & 0x0E) + static bool ListItemSort(LoadSaveListItem& a, LoadSaveListItem& b) { - case LOADSAVETYPE_GAME: - subdir = OpenRCT2::DIRID::SAVE; - break; + if (a.type != b.type) + return a.type - b.type < 0; - case LOADSAVETYPE_LANDSCAPE: - subdir = OpenRCT2::DIRID::LANDSCAPE; - break; - - case LOADSAVETYPE_SCENARIO: - subdir = OpenRCT2::DIRID::SCENARIO; - break; - - case LOADSAVETYPE_TRACK: - subdir = OpenRCT2::DIRID::TRACK; - break; - - case LOADSAVETYPE_HEIGHTMAP: - subdir = OpenRCT2::DIRID::HEIGHTMAP; - break; - } - - auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); - if (subdir.has_value()) - return env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, subdir.value()); - else - return env->GetDirectoryPath(OpenRCT2::DIRBASE::USER); -} - -static const char* GetFilterPatternByType(const int32_t type, const bool isSave) -{ - switch (type & 0x0E) - { - case LOADSAVETYPE_GAME: - return isSave ? "*.park" : "*.park;*.sv6;*.sc6;*.sc4;*.sv4;*.sv7;*.sea"; - - case LOADSAVETYPE_LANDSCAPE: - return isSave ? "*.park" : "*.park;*.sc6;*.sv6;*.sc4;*.sv4;*.sv7;*.sea"; - - case LOADSAVETYPE_SCENARIO: - return isSave ? "*.park" : "*.park;*.sc6;*.sc4"; - - case LOADSAVETYPE_TRACK: - return isSave ? "*.td6" : "*.td6;*.td4"; - - case LOADSAVETYPE_HEIGHTMAP: - return "*.bmp;*.png"; - - default: - Guard::Fail("Unsupported load/save directory type."); - } - - return ""; -} - -static u8string RemovePatternWildcard(u8string_view pattern) -{ - while (pattern.length() >= 1 && pattern.front() == '*') - { - pattern.remove_prefix(1); - } - return u8string{ pattern }; -} - -static u8string GetDir(const int32_t type) -{ - u8string result = GetLastDirectoryByType(type); - if (result.empty() || !Path::DirectoryExists(result)) - { - result = GetInitialDirectoryByType(type); - } - return result; -} - -static void InvokeCallback(int32_t result, const utf8* path) -{ - if (_loadSaveCallback != nullptr) - { - _loadSaveCallback(result, path); - } -} - -static void Select(const char* path) -{ - if (!IsValidPath(path)) - { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); - return; - } - - char pathBuffer[MAX_PATH]; - SafeStrCpy(pathBuffer, path, sizeof(pathBuffer)); - - auto& gameState = GetGameState(); - - switch (_type & 0x0F) - { - case (LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME): - SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer); - if (OpenRCT2::GetContext()->LoadParkFromFile(pathBuffer)) - { - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - WindowCloseByClass(WindowClass::Loadsave); - GfxInvalidateScreen(); - } - else - { - // Not the best message... - ContextShowError(STR_LOAD_GAME, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {}); - InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); - } - break; - - case (LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME): - SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer); - if (ScenarioSave(gameState, pathBuffer, gConfigGeneral.SavePluginData ? 1 : 0)) - { - gScenarioSavePath = pathBuffer; - gCurrentLoadedPath = pathBuffer; - gIsAutosaveLoaded = false; - gFirstTimeSaving = false; - - WindowCloseByClass(WindowClass::Loadsave); - GfxInvalidateScreen(); - - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - } - else - { - ContextShowError(STR_SAVE_GAME, STR_GAME_SAVE_FAILED, {}); - InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); - } - break; - - case (LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE): - SetAndSaveConfigPath(gConfigGeneral.LastSaveLandscapeDirectory, pathBuffer); - if (Editor::LoadLandscape(pathBuffer)) - { - gCurrentLoadedPath = pathBuffer; - GfxInvalidateScreen(); - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - } - else - { - // Not the best message... - ContextShowError(STR_LOAD_LANDSCAPE, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {}); - InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); - } - break; - - case (LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE): - SetAndSaveConfigPath(gConfigGeneral.LastSaveLandscapeDirectory, pathBuffer); - gScenarioFileName = std::string(String::ToStringView(pathBuffer, std::size(pathBuffer))); - if (ScenarioSave(gameState, pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2)) - { - gCurrentLoadedPath = pathBuffer; - WindowCloseByClass(WindowClass::Loadsave); - GfxInvalidateScreen(); - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - } - else - { - ContextShowError(STR_SAVE_LANDSCAPE, STR_LANDSCAPE_SAVE_FAILED, {}); - InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); - } - break; - - case (LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO): + switch (gConfigGeneral.LoadSaveSort) { - SetAndSaveConfigPath(gConfigGeneral.LastSaveScenarioDirectory, pathBuffer); - int32_t parkFlagsBackup = gameState.ParkFlags; - gameState.ParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED; - gameState.EditorStep = EditorStep::Invalid; - gScenarioFileName = std::string(String::ToStringView(pathBuffer, std::size(pathBuffer))); - int32_t success = ScenarioSave(gameState, pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2); - gameState.ParkFlags = parkFlagsBackup; + case Sort::NameAscending: + return StrLogicalCmp(a.name.c_str(), b.name.c_str()) < 0; + case Sort::NameDescending: + return -StrLogicalCmp(a.name.c_str(), b.name.c_str()) < 0; + case Sort::DateDescending: + return -difftime(a.date_modified, b.date_modified) < 0; + case Sort::DateAscending: + return difftime(a.date_modified, b.date_modified) < 0; + } + return StrLogicalCmp(a.name.c_str(), b.name.c_str()) < 0; + } - if (success) - { - WindowCloseByClass(WindowClass::Loadsave); - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - TitleLoad(); - } - else - { - ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); - gameState.EditorStep = EditorStep::ObjectiveSelection; - InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); - } - break; + static void SetAndSaveConfigPath(u8string& config_str, u8string_view path) + { + config_str = Path::GetDirectory(path); + ConfigSaveDefault(); + } + + static bool IsValidPath(const char* path) + { + // HACK This is needed because tracks get passed through with td? + // I am sure this will change eventually to use the new FileScanner + // which handles multiple patterns + auto filename = Path::GetFileNameWithoutExtension(path); + + return Platform::IsFilenameValid(filename); + } + + static u8string GetLastDirectoryByType(int32_t type) + { + switch (type & 0x0E) + { + case LOADSAVETYPE_GAME: + return gConfigGeneral.LastSaveGameDirectory; + + case LOADSAVETYPE_LANDSCAPE: + return gConfigGeneral.LastSaveLandscapeDirectory; + + case LOADSAVETYPE_SCENARIO: + return gConfigGeneral.LastSaveScenarioDirectory; + + case LOADSAVETYPE_TRACK: + return gConfigGeneral.LastSaveTrackDirectory; + + default: + return u8string(); + } + } + + static u8string GetInitialDirectoryByType(const int32_t type) + { + std::optional subdir = std::nullopt; + switch (type & 0x0E) + { + case LOADSAVETYPE_GAME: + subdir = OpenRCT2::DIRID::SAVE; + break; + + case LOADSAVETYPE_LANDSCAPE: + subdir = OpenRCT2::DIRID::LANDSCAPE; + break; + + case LOADSAVETYPE_SCENARIO: + subdir = OpenRCT2::DIRID::SCENARIO; + break; + + case LOADSAVETYPE_TRACK: + subdir = OpenRCT2::DIRID::TRACK; + break; + + case LOADSAVETYPE_HEIGHTMAP: + subdir = OpenRCT2::DIRID::HEIGHTMAP; + break; } - case (LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK): - { - SetAndSaveConfigPath(gConfigGeneral.LastSaveTrackDirectory, pathBuffer); - auto intent = Intent(WindowClass::InstallTrack); - intent.PutExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer }); - ContextOpenIntent(&intent); - WindowCloseByClass(WindowClass::Loadsave); - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - break; - } - - case (LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK): - { - SetAndSaveConfigPath(gConfigGeneral.LastSaveTrackDirectory, pathBuffer); - - const auto withExtension = Path::WithExtension(pathBuffer, ".td6"); - String::Set(pathBuffer, sizeof(pathBuffer), withExtension.c_str()); - - RCT2::T6Exporter t6Export{ _trackDesign }; - - auto success = t6Export.SaveTrack(pathBuffer); - - if (success) - { - WindowCloseByClass(WindowClass::Loadsave); - WindowRideMeasurementsDesignCancel(); - InvokeCallback(MODAL_RESULT_OK, path); - } - else - { - ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_TRACK, STR_TRACK_SAVE_FAILED, {}); - InvokeCallback(MODAL_RESULT_FAIL, path); - } - break; - } - - case (LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP): - WindowCloseByClass(WindowClass::Loadsave); - InvokeCallback(MODAL_RESULT_OK, pathBuffer); - break; - } -} - -static u8string OpenSystemFileBrowser(bool isSave) -{ - OpenRCT2::Ui::FileDialogDesc desc = {}; - u8string extension; - StringId title = STR_NONE; - switch (_type & 0x0E) - { - case LOADSAVETYPE_GAME: - extension = u8".park"; - title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_GAME : STR_FILE_DIALOG_TITLE_LOAD_GAME; - desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_SAVED_GAME), GetFilterPatternByType(_type, isSave)); - break; - - case LOADSAVETYPE_LANDSCAPE: - extension = u8".park"; - title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_LANDSCAPE : STR_FILE_DIALOG_TITLE_LOAD_LANDSCAPE; - desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_LANDSCAPE_FILE), GetFilterPatternByType(_type, isSave)); - break; - - case LOADSAVETYPE_SCENARIO: - extension = u8".park"; - title = STR_FILE_DIALOG_TITLE_SAVE_SCENARIO; - desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_SCENARIO_FILE), GetFilterPatternByType(_type, isSave)); - break; - - case LOADSAVETYPE_TRACK: - extension = u8".td6"; - title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_TRACK : STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN; - desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_TRACK_DESIGN_FILE), GetFilterPatternByType(_type, isSave)); - break; - - case LOADSAVETYPE_HEIGHTMAP: - title = STR_FILE_DIALOG_TITLE_LOAD_HEIGHTMAP; - desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_HEIGHTMAP_FILE), GetFilterPatternByType(_type, isSave)); - break; - } - - u8string path = _directory; - if (isSave) - { - // The file browser requires a file path instead of just a directory - if (!_defaultPath.empty()) - { - path = Path::Combine(path, _defaultPath); - } + auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); + if (subdir.has_value()) + return env->GetDirectoryPath(OpenRCT2::DIRBASE::USER, subdir.value()); else + return env->GetDirectoryPath(OpenRCT2::DIRBASE::USER); + } + + static const char* GetFilterPatternByType(const int32_t type, const bool isSave) + { + switch (type & 0x0E) { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - auto buffer = park.Name; - if (buffer.empty()) - { - // Use localised "Unnamed Park" if park name was empty. - buffer = FormatStringID(STR_UNNAMED_PARK, nullptr); - } - path = Path::Combine(path, buffer); + case LOADSAVETYPE_GAME: + return isSave ? "*.park" : "*.park;*.sv6;*.sc6;*.sc4;*.sv4;*.sv7;*.sea"; + + case LOADSAVETYPE_LANDSCAPE: + return isSave ? "*.park" : "*.park;*.sc6;*.sv6;*.sc4;*.sv4;*.sv7;*.sea"; + + case LOADSAVETYPE_SCENARIO: + return isSave ? "*.park" : "*.park;*.sc6;*.sc4"; + + case LOADSAVETYPE_TRACK: + return isSave ? "*.td6" : "*.td6;*.td4"; + + case LOADSAVETYPE_HEIGHTMAP: + return "*.bmp;*.png"; + + default: + Guard::Fail("Unsupported load/save directory type."); + } + + return ""; + } + + static u8string RemovePatternWildcard(u8string_view pattern) + { + while (pattern.length() >= 1 && pattern.front() == '*') + { + pattern.remove_prefix(1); + } + return u8string{ pattern }; + } + + static u8string GetDir(const int32_t type) + { + u8string result = GetLastDirectoryByType(type); + if (result.empty() || !Path::DirectoryExists(result)) + { + result = GetInitialDirectoryByType(type); + } + return result; + } + + static void InvokeCallback(int32_t result, const utf8* path) + { + if (_loadSaveCallback != nullptr) + { + _loadSaveCallback(result, path); } } - desc.InitialDirectory = _directory; - desc.Type = isSave ? OpenRCT2::Ui::FileDialogType::Save : OpenRCT2::Ui::FileDialogType::Open; - desc.DefaultFilename = isSave ? path : u8string(); - - desc.Filters.emplace_back(LanguageGetString(STR_ALL_FILES), "*"); - - desc.Title = LanguageGetString(title); - return ContextOpenCommonFileDialog(desc); -} - -class LoadSaveWindow final : public Window -{ -public: - LoadSaveWindow(int32_t loadSaveType) - : type(loadSaveType) + static void Select(const char* path) { - } - -private: - int32_t maxDateWidth{ 0 }; - int32_t maxTimeWidth{ 0 }; - int32_t type; - -public: - void PopulateList(int32_t includeNewItem, const u8string& directory, std::string_view extensionPattern) - { - const auto absoluteDirectory = Path::GetAbsolute(directory); - SafeStrCpy(_directory, absoluteDirectory.c_str(), std::size(_directory)); - // Note: This compares the pointers, not values - _extensionPattern = extensionPattern; - - _listItems.clear(); - - // Show "new" buttons when saving - window_loadsave_widgets[WIDX_NEW_FILE].type = includeNewItem ? WindowWidgetType::Button : WindowWidgetType::Empty; - window_loadsave_widgets[WIDX_NEW_FOLDER].type = includeNewItem ? WindowWidgetType::Button : WindowWidgetType::Empty; - - int32_t drives = Platform::GetDrives(); - if (directory.empty() && drives) - { - // List Windows drives - disabled_widgets |= (1uLL << WIDX_NEW_FILE) | (1uLL << WIDX_NEW_FOLDER) | (1uLL << WIDX_UP); - static constexpr auto NumDriveLetters = 26; - for (int32_t x = 0; x < NumDriveLetters; x++) - { - if (drives & (1 << x)) - { - // If the drive exists, list it - LoadSaveListItem newListItem; - newListItem.path = std::string(1, 'A' + x) + ":" PATH_SEPARATOR; - newListItem.name = newListItem.path; - newListItem.type = TYPE_DIRECTORY; - - _listItems.push_back(std::move(newListItem)); - } - } - } - else - { - // Remove the separator at the end of the path, if present - SafeStrCpy(_parentDirectory, absoluteDirectory.c_str(), std::size(_parentDirectory)); - if (_parentDirectory[strlen(_parentDirectory) - 1] == *PATH_SEPARATOR - || _parentDirectory[strlen(_parentDirectory) - 1] == '/') - _parentDirectory[strlen(_parentDirectory) - 1] = '\0'; - - // Remove everything past the now last separator - char* ch = strrchr(_parentDirectory, *PATH_SEPARATOR); - char* posix_ch = strrchr(_parentDirectory, '/'); - ch = ch < posix_ch ? posix_ch : ch; - if (ch != nullptr) - { - *(ch + 1) = '\0'; - } - else if (drives) - { - // If on Windows, clear the entire path to show the drives - _parentDirectory[0] = '\0'; - } - else - { - // Else, go to the root directory - snprintf(_parentDirectory, MAX_PATH, "%c", *PATH_SEPARATOR); - } - - // Disable the Up button if the current directory is the root directory - if (String::IsNullOrEmpty(_parentDirectory) && !drives) - disabled_widgets |= (1uLL << WIDX_UP); - else - disabled_widgets &= ~(1uLL << WIDX_UP); - - // Re-enable the "new" buttons if these were disabled - disabled_widgets &= ~(1uLL << WIDX_NEW_FILE); - disabled_widgets &= ~(1uLL << WIDX_NEW_FOLDER); - - // List all directories - auto subDirectories = Path::GetDirectories(absoluteDirectory); - for (const auto& sdName : subDirectories) - { - auto subDir = sdName + PATH_SEPARATOR; - - LoadSaveListItem newListItem; - newListItem.path = Path::Combine(absoluteDirectory, subDir); - newListItem.name = std::move(subDir); - newListItem.type = TYPE_DIRECTORY; - newListItem.loaded = false; - - _listItems.push_back(std::move(newListItem)); - } - - // List all files with the wanted extensions - bool showExtension = false; - for (const u8string& extToken : String::Split(extensionPattern, ";")) - { - const u8string filter = Path::Combine(directory, extToken); - auto scanner = Path::ScanDirectory(filter, false); - while (scanner->Next()) - { - LoadSaveListItem newListItem; - newListItem.path = scanner->GetPath(); - newListItem.type = TYPE_FILE; - newListItem.date_modified = Platform::FileGetModifiedTime(newListItem.path.c_str()); - - // Cache a human-readable version of the modified date. - newListItem.date_formatted = Platform::FormatShortDate(newListItem.date_modified); - newListItem.time_formatted = Platform::FormatTime(newListItem.date_modified); - - // Mark if file is the currently loaded game - newListItem.loaded = newListItem.path.compare(gCurrentLoadedPath) == 0; - - // Remove the extension (but only the first extension token) - if (!showExtension) - { - newListItem.name = Path::GetFileNameWithoutExtension(newListItem.path); - } - else - { - newListItem.name = Path::GetFileName(newListItem.path); - } - - _listItems.push_back(std::move(newListItem)); - } - - showExtension = true; // Show any extension after the first iteration - } - - SortList(); - } - - Invalidate(); - } - - void ComputeMaxDateWidth() - { - // Generate a time object for a relatively wide time: 2000-02-20 00:00:00 - std::tm tm; - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 0; - tm.tm_mday = 20; - tm.tm_mon = 2; - tm.tm_year = 100; - tm.tm_wday = 5; - tm.tm_yday = 51; - tm.tm_isdst = -1; - - std::time_t long_time = mktime(&tm); - - // Check how this date is represented (e.g. 2000-02-20, or 00/02/20) - std::string date = Platform::FormatShortDate(long_time); - maxDateWidth = GfxGetStringWidth(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP; - - // Some locales do not use leading zeros for months and days, so let's try October, too. - tm.tm_mon = 10; - tm.tm_yday = 294; - long_time = mktime(&tm); - - // Again, check how this date is represented (e.g. 2000-10-20, or 00/10/20) - date = Platform::FormatShortDate(long_time); - maxDateWidth = std::max(maxDateWidth, GfxGetStringWidth(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP); - - // Time appears to be universally represented with two digits for minutes, so 12:00 or 00:00 should be representable. - std::string time = Platform::FormatTime(long_time); - maxTimeWidth = GfxGetStringWidth(time.c_str(), FontStyle::Medium) + DATE_TIME_GAP; - } - - void SortList() - { - std::sort(_listItems.begin(), _listItems.end(), ListItemSort); - } - -#pragma region Events -public: - void OnOpen() override - { - widgets = window_loadsave_widgets; - - const auto uiContext = OpenRCT2::GetContext()->GetUiContext(); - if (!uiContext->HasFilePicker()) - { - disabled_widgets |= (1uLL << WIDX_BROWSE); - window_loadsave_widgets[WIDX_BROWSE].type = WindowWidgetType::Empty; - } - - // TODO: Split LOADSAVETYPE_* into two proper enum classes (one for load/save, the other for the type) - const bool isSave = (type & 0x01) == LOADSAVETYPE_SAVE; - const auto path = GetDir(type); - - const char* pattern = GetFilterPatternByType(type, isSave); - PopulateList(isSave, path, pattern); - no_list_items = static_cast(_listItems.size()); - selected_list_item = -1; - - InitScrollWidgets(); - ComputeMaxDateWidth(); - min_width = WW; - min_height = WH / 2; - max_width = WW * 2; - max_height = WH * 2; - } - - void OnClose() override - { - _listItems.clear(); - WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); - } - - void OnResize() override - { - if (width < min_width) - { - Invalidate(); - width = min_width; - } - if (height < min_height) - { - Invalidate(); - height = min_height; - } - } - - void OnPrepareDraw() override - { - ResizeFrameWithPage(); - - Widget* date_widget = &window_loadsave_widgets[WIDX_SORT_DATE]; - date_widget->right = width - 5; - date_widget->left = date_widget->right - (maxDateWidth + maxTimeWidth + (4 * DATE_TIME_GAP) + (kScrollBarWidth + 1)); - - window_loadsave_widgets[WIDX_SORT_NAME].left = 4; - window_loadsave_widgets[WIDX_SORT_NAME].right = window_loadsave_widgets[WIDX_SORT_DATE].left - 1; - - window_loadsave_widgets[WIDX_SCROLL].right = width - 5; - window_loadsave_widgets[WIDX_SCROLL].bottom = height - 30; - - window_loadsave_widgets[WIDX_BROWSE].top = height - 24; - window_loadsave_widgets[WIDX_BROWSE].bottom = height - 6; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - const auto shortPath = ShortenPath(_directory, width - 8, FontStyle::Medium); - - // Format text - std::string buffer; - buffer.assign("{BLACK}"); - buffer += shortPath; - - // Draw path text - const auto normalisedPath = Platform::StrDecompToPrecomp(buffer.data()); - const auto* normalisedPathC = normalisedPath.c_str(); - auto ft = Formatter(); - ft.Add(normalisedPathC); - DrawTextEllipsised(dpi, windowPos + ScreenCoordsXY{ 4, 20 }, width - 8, STR_STRING, ft); - - // Name button text - StringId id = STR_NONE; - if (gConfigGeneral.LoadSaveSort == Sort::NameAscending) - id = STR_UP; - else if (gConfigGeneral.LoadSaveSort == Sort::NameDescending) - id = STR_DOWN; - - // Draw name button indicator. - Widget sort_name_widget = window_loadsave_widgets[WIDX_SORT_NAME]; - ft = Formatter(); - ft.Add(id); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft, - { COLOUR_GREY }); - - // Date button text - if (gConfigGeneral.LoadSaveSort == Sort::DateAscending) - id = STR_UP; - else if (gConfigGeneral.LoadSaveSort == Sort::DateDescending) - id = STR_DOWN; - else - id = STR_NONE; - - Widget sort_date_widget = window_loadsave_widgets[WIDX_SORT_DATE]; - ft = Formatter(); - ft.Add(id); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft, - { COLOUR_GREY }); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - bool isSave = (_type & 0x01) == LOADSAVETYPE_SAVE; - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - - case WIDX_UP: - PopulateList(isSave, _parentDirectory, _extensionPattern); - InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); - break; - - case WIDX_NEW_FILE: - WindowTextInputOpen( - this, WIDX_NEW_FILE, STR_NONE, 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); - break; - - case WIDX_BROWSE: - { - u8string path = OpenSystemFileBrowser(isSave); - if (!path.empty()) - { - Select(path.c_str()); - } - else - { - // If user cancels file dialog, refresh list - PopulateList(isSave, _directory, _extensionPattern); - InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); - } - } - break; - - case WIDX_SORT_NAME: - if (gConfigGeneral.LoadSaveSort == Sort::NameAscending) - { - gConfigGeneral.LoadSaveSort = Sort::NameDescending; - } - else - { - gConfigGeneral.LoadSaveSort = Sort::NameAscending; - } - ConfigSaveDefault(); - SortList(); - Invalidate(); - break; - - case WIDX_SORT_DATE: - if (gConfigGeneral.LoadSaveSort == Sort::DateDescending) - { - gConfigGeneral.LoadSaveSort = Sort::DateAscending; - } - else - { - gConfigGeneral.LoadSaveSort = Sort::DateDescending; - } - ConfigSaveDefault(); - SortList(); - Invalidate(); - break; - - case WIDX_DEFAULT: - PopulateList(isSave, GetInitialDirectoryByType(_type).c_str(), _extensionPattern); - InitScrollWidgets(); - no_list_items = static_cast(_listItems.size()); - break; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - if (!Platform::IsFilenameValid(text)) + if (!IsValidPath(path)) { ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); return; } - switch (widgetIndex) + char pathBuffer[MAX_PATH]; + SafeStrCpy(pathBuffer, path, sizeof(pathBuffer)); + + auto& gameState = GetGameState(); + + switch (_type & 0x0F) { - case WIDX_NEW_FOLDER: - { - const u8string path = Path::Combine(_directory, text); - if (!Path::CreateDirectory(path)) + case (LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME): + SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer); + if (OpenRCT2::GetContext()->LoadParkFromFile(pathBuffer)) { - ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); - return; + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + WindowCloseByClass(WindowClass::Loadsave); + GfxInvalidateScreen(); } + else + { + // Not the best message... + ContextShowError(STR_LOAD_GAME, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {}); + InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); + } + break; + + case (LOADSAVETYPE_SAVE | LOADSAVETYPE_GAME): + SetAndSaveConfigPath(gConfigGeneral.LastSaveGameDirectory, pathBuffer); + if (ScenarioSave(gameState, pathBuffer, gConfigGeneral.SavePluginData ? 1 : 0)) + { + gScenarioSavePath = pathBuffer; + gCurrentLoadedPath = pathBuffer; + gIsAutosaveLoaded = false; + gFirstTimeSaving = false; + + WindowCloseByClass(WindowClass::Loadsave); + GfxInvalidateScreen(); + + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + } + else + { + ContextShowError(STR_SAVE_GAME, STR_GAME_SAVE_FAILED, {}); + InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); + } + break; + + case (LOADSAVETYPE_LOAD | LOADSAVETYPE_LANDSCAPE): + SetAndSaveConfigPath(gConfigGeneral.LastSaveLandscapeDirectory, pathBuffer); + if (Editor::LoadLandscape(pathBuffer)) + { + gCurrentLoadedPath = pathBuffer; + GfxInvalidateScreen(); + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + } + else + { + // Not the best message... + ContextShowError(STR_LOAD_LANDSCAPE, STR_FAILED_TO_LOAD_FILE_CONTAINS_INVALID_DATA, {}); + InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); + } + break; + + case (LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE): + SetAndSaveConfigPath(gConfigGeneral.LastSaveLandscapeDirectory, pathBuffer); + gScenarioFileName = std::string(String::ToStringView(pathBuffer, std::size(pathBuffer))); + if (ScenarioSave(gameState, pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2)) + { + gCurrentLoadedPath = pathBuffer; + WindowCloseByClass(WindowClass::Loadsave); + GfxInvalidateScreen(); + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + } + else + { + ContextShowError(STR_SAVE_LANDSCAPE, STR_LANDSCAPE_SAVE_FAILED, {}); + InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); + } + break; + + case (LOADSAVETYPE_SAVE | LOADSAVETYPE_SCENARIO): + { + SetAndSaveConfigPath(gConfigGeneral.LastSaveScenarioDirectory, pathBuffer); + int32_t parkFlagsBackup = gameState.ParkFlags; + gameState.ParkFlags &= ~PARK_FLAGS_SPRITES_INITIALISED; + gameState.EditorStep = EditorStep::Invalid; + gScenarioFileName = std::string(String::ToStringView(pathBuffer, std::size(pathBuffer))); + int32_t success = ScenarioSave(gameState, pathBuffer, gConfigGeneral.SavePluginData ? 3 : 2); + gameState.ParkFlags = parkFlagsBackup; + + if (success) + { + WindowCloseByClass(WindowClass::Loadsave); + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + TitleLoad(); + } + else + { + ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_SCENARIO, STR_SCENARIO_SAVE_FAILED, {}); + gameState.EditorStep = EditorStep::ObjectiveSelection; + InvokeCallback(MODAL_RESULT_FAIL, pathBuffer); + } + break; + } + + case (LOADSAVETYPE_LOAD | LOADSAVETYPE_TRACK): + { + SetAndSaveConfigPath(gConfigGeneral.LastSaveTrackDirectory, pathBuffer); + auto intent = Intent(WindowClass::InstallTrack); + intent.PutExtra(INTENT_EXTRA_PATH, std::string{ pathBuffer }); + ContextOpenIntent(&intent); + WindowCloseByClass(WindowClass::Loadsave); + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + break; + } + + case (LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK): + { + SetAndSaveConfigPath(gConfigGeneral.LastSaveTrackDirectory, pathBuffer); + + const auto withExtension = Path::WithExtension(pathBuffer, ".td6"); + String::Set(pathBuffer, sizeof(pathBuffer), withExtension.c_str()); + + RCT2::T6Exporter t6Export{ _trackDesign }; + + auto success = t6Export.SaveTrack(pathBuffer); + + if (success) + { + WindowCloseByClass(WindowClass::Loadsave); + WindowRideMeasurementsDesignCancel(); + InvokeCallback(MODAL_RESULT_OK, path); + } + else + { + ContextShowError(STR_FILE_DIALOG_TITLE_SAVE_TRACK, STR_TRACK_SAVE_FAILED, {}); + InvokeCallback(MODAL_RESULT_FAIL, path); + } + break; + } + + case (LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP): + WindowCloseByClass(WindowClass::Loadsave); + InvokeCallback(MODAL_RESULT_OK, pathBuffer); + break; + } + } + + static u8string OpenSystemFileBrowser(bool isSave) + { + OpenRCT2::Ui::FileDialogDesc desc = {}; + u8string extension; + StringId title = STR_NONE; + switch (_type & 0x0E) + { + case LOADSAVETYPE_GAME: + extension = u8".park"; + title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_GAME : STR_FILE_DIALOG_TITLE_LOAD_GAME; + desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_SAVED_GAME), GetFilterPatternByType(_type, isSave)); + break; + + case LOADSAVETYPE_LANDSCAPE: + extension = u8".park"; + title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_LANDSCAPE : STR_FILE_DIALOG_TITLE_LOAD_LANDSCAPE; + desc.Filters.emplace_back( + LanguageGetString(STR_OPENRCT2_LANDSCAPE_FILE), GetFilterPatternByType(_type, isSave)); + break; + + case LOADSAVETYPE_SCENARIO: + extension = u8".park"; + title = STR_FILE_DIALOG_TITLE_SAVE_SCENARIO; + desc.Filters.emplace_back(LanguageGetString(STR_OPENRCT2_SCENARIO_FILE), GetFilterPatternByType(_type, isSave)); + break; + + case LOADSAVETYPE_TRACK: + extension = u8".td6"; + title = isSave ? STR_FILE_DIALOG_TITLE_SAVE_TRACK : STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN; + desc.Filters.emplace_back( + LanguageGetString(STR_OPENRCT2_TRACK_DESIGN_FILE), GetFilterPatternByType(_type, isSave)); + break; + + case LOADSAVETYPE_HEIGHTMAP: + title = STR_FILE_DIALOG_TITLE_LOAD_HEIGHTMAP; + desc.Filters.emplace_back( + LanguageGetString(STR_OPENRCT2_HEIGHTMAP_FILE), GetFilterPatternByType(_type, isSave)); + break; + } + + u8string path = _directory; + if (isSave) + { + // The file browser requires a file path instead of just a directory + if (!_defaultPath.empty()) + { + path = Path::Combine(path, _defaultPath); + } + else + { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + auto buffer = park.Name; + if (buffer.empty()) + { + // Use localised "Unnamed Park" if park name was empty. + buffer = FormatStringID(STR_UNNAMED_PARK, nullptr); + } + path = Path::Combine(path, buffer); + } + } + + desc.InitialDirectory = _directory; + desc.Type = isSave ? OpenRCT2::Ui::FileDialogType::Save : OpenRCT2::Ui::FileDialogType::Open; + desc.DefaultFilename = isSave ? path : u8string(); + + desc.Filters.emplace_back(LanguageGetString(STR_ALL_FILES), "*"); + + desc.Title = LanguageGetString(title); + return ContextOpenCommonFileDialog(desc); + } + + class LoadSaveWindow final : public Window + { + public: + LoadSaveWindow(int32_t loadSaveType) + : type(loadSaveType) + { + } + + private: + int32_t maxDateWidth{ 0 }; + int32_t maxTimeWidth{ 0 }; + int32_t type; + + public: + void PopulateList(int32_t includeNewItem, const u8string& directory, std::string_view extensionPattern) + { + const auto absoluteDirectory = Path::GetAbsolute(directory); + SafeStrCpy(_directory, absoluteDirectory.c_str(), std::size(_directory)); + // Note: This compares the pointers, not values + _extensionPattern = extensionPattern; + + _listItems.clear(); + + // Show "new" buttons when saving + window_loadsave_widgets[WIDX_NEW_FILE].type = includeNewItem ? WindowWidgetType::Button : WindowWidgetType::Empty; + window_loadsave_widgets[WIDX_NEW_FOLDER].type = includeNewItem ? WindowWidgetType::Button : WindowWidgetType::Empty; + + int32_t drives = Platform::GetDrives(); + if (directory.empty() && drives) + { + // List Windows drives + disabled_widgets |= (1uLL << WIDX_NEW_FILE) | (1uLL << WIDX_NEW_FOLDER) | (1uLL << WIDX_UP); + static constexpr auto NumDriveLetters = 26; + for (int32_t x = 0; x < NumDriveLetters; x++) + { + if (drives & (1 << x)) + { + // If the drive exists, list it + LoadSaveListItem newListItem; + newListItem.path = std::string(1, 'A' + x) + ":" PATH_SEPARATOR; + newListItem.name = newListItem.path; + newListItem.type = TYPE_DIRECTORY; + + _listItems.push_back(std::move(newListItem)); + } + } + } + else + { + // Remove the separator at the end of the path, if present + SafeStrCpy(_parentDirectory, absoluteDirectory.c_str(), std::size(_parentDirectory)); + if (_parentDirectory[strlen(_parentDirectory) - 1] == *PATH_SEPARATOR + || _parentDirectory[strlen(_parentDirectory) - 1] == '/') + _parentDirectory[strlen(_parentDirectory) - 1] = '\0'; + + // Remove everything past the now last separator + char* ch = strrchr(_parentDirectory, *PATH_SEPARATOR); + char* posix_ch = strrchr(_parentDirectory, '/'); + ch = ch < posix_ch ? posix_ch : ch; + if (ch != nullptr) + { + *(ch + 1) = '\0'; + } + else if (drives) + { + // If on Windows, clear the entire path to show the drives + _parentDirectory[0] = '\0'; + } + else + { + // Else, go to the root directory + snprintf(_parentDirectory, MAX_PATH, "%c", *PATH_SEPARATOR); + } + + // Disable the Up button if the current directory is the root directory + if (String::IsNullOrEmpty(_parentDirectory) && !drives) + disabled_widgets |= (1uLL << WIDX_UP); + else + disabled_widgets &= ~(1uLL << WIDX_UP); + + // Re-enable the "new" buttons if these were disabled + disabled_widgets &= ~(1uLL << WIDX_NEW_FILE); + disabled_widgets &= ~(1uLL << WIDX_NEW_FOLDER); + + // List all directories + auto subDirectories = Path::GetDirectories(absoluteDirectory); + for (const auto& sdName : subDirectories) + { + auto subDir = sdName + PATH_SEPARATOR; + + LoadSaveListItem newListItem; + newListItem.path = Path::Combine(absoluteDirectory, subDir); + newListItem.name = std::move(subDir); + newListItem.type = TYPE_DIRECTORY; + newListItem.loaded = false; + + _listItems.push_back(std::move(newListItem)); + } + + // List all files with the wanted extensions + bool showExtension = false; + for (const u8string& extToken : String::Split(extensionPattern, ";")) + { + const u8string filter = Path::Combine(directory, extToken); + auto scanner = Path::ScanDirectory(filter, false); + while (scanner->Next()) + { + LoadSaveListItem newListItem; + newListItem.path = scanner->GetPath(); + newListItem.type = TYPE_FILE; + newListItem.date_modified = Platform::FileGetModifiedTime(newListItem.path.c_str()); + + // Cache a human-readable version of the modified date. + newListItem.date_formatted = Platform::FormatShortDate(newListItem.date_modified); + newListItem.time_formatted = Platform::FormatTime(newListItem.date_modified); + + // Mark if file is the currently loaded game + newListItem.loaded = newListItem.path.compare(gCurrentLoadedPath) == 0; + + // Remove the extension (but only the first extension token) + if (!showExtension) + { + newListItem.name = Path::GetFileNameWithoutExtension(newListItem.path); + } + else + { + newListItem.name = Path::GetFileName(newListItem.path); + } + + _listItems.push_back(std::move(newListItem)); + } + + showExtension = true; // Show any extension after the first iteration + } + + SortList(); + } + + Invalidate(); + } + + void ComputeMaxDateWidth() + { + // Generate a time object for a relatively wide time: 2000-02-20 00:00:00 + std::tm tm; + tm.tm_sec = 0; + tm.tm_min = 0; + tm.tm_hour = 0; + tm.tm_mday = 20; + tm.tm_mon = 2; + tm.tm_year = 100; + tm.tm_wday = 5; + tm.tm_yday = 51; + tm.tm_isdst = -1; + + std::time_t long_time = mktime(&tm); + + // Check how this date is represented (e.g. 2000-02-20, or 00/02/20) + std::string date = Platform::FormatShortDate(long_time); + maxDateWidth = GfxGetStringWidth(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP; + + // Some locales do not use leading zeros for months and days, so let's try October, too. + tm.tm_mon = 10; + tm.tm_yday = 294; + long_time = mktime(&tm); + + // Again, check how this date is represented (e.g. 2000-10-20, or 00/10/20) + date = Platform::FormatShortDate(long_time); + maxDateWidth = std::max(maxDateWidth, GfxGetStringWidth(date.c_str(), FontStyle::Medium) + DATE_TIME_GAP); + + // Time appears to be universally represented with two digits for minutes, so 12:00 or 00:00 should be + // representable. + std::string time = Platform::FormatTime(long_time); + maxTimeWidth = GfxGetStringWidth(time.c_str(), FontStyle::Medium) + DATE_TIME_GAP; + } + + void SortList() + { + std::sort(_listItems.begin(), _listItems.end(), ListItemSort); + } + +#pragma region Events + public: + void OnOpen() override + { + widgets = window_loadsave_widgets; + + const auto uiContext = OpenRCT2::GetContext()->GetUiContext(); + if (!uiContext->HasFilePicker()) + { + disabled_widgets |= (1uLL << WIDX_BROWSE); + window_loadsave_widgets[WIDX_BROWSE].type = WindowWidgetType::Empty; + } + + // TODO: Split LOADSAVETYPE_* into two proper enum classes (one for load/save, the other for the type) + const bool isSave = (type & 0x01) == LOADSAVETYPE_SAVE; + const auto path = GetDir(type); + + const char* pattern = GetFilterPatternByType(type, isSave); + PopulateList(isSave, path, pattern); + no_list_items = static_cast(_listItems.size()); + selected_list_item = -1; + + InitScrollWidgets(); + ComputeMaxDateWidth(); + min_width = WW; + min_height = WH / 2; + max_width = WW * 2; + max_height = WH * 2; + } + + void OnClose() override + { + _listItems.clear(); + WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); + } + + void OnResize() override + { + if (width < min_width) + { + Invalidate(); + width = min_width; + } + if (height < min_height) + { + Invalidate(); + height = min_height; + } + } + + void OnPrepareDraw() override + { + ResizeFrameWithPage(); + + Widget* date_widget = &window_loadsave_widgets[WIDX_SORT_DATE]; + date_widget->right = width - 5; + date_widget->left = date_widget->right + - (maxDateWidth + maxTimeWidth + (4 * DATE_TIME_GAP) + (kScrollBarWidth + 1)); + + window_loadsave_widgets[WIDX_SORT_NAME].left = 4; + window_loadsave_widgets[WIDX_SORT_NAME].right = window_loadsave_widgets[WIDX_SORT_DATE].left - 1; + + window_loadsave_widgets[WIDX_SCROLL].right = width - 5; + window_loadsave_widgets[WIDX_SCROLL].bottom = height - 30; + + window_loadsave_widgets[WIDX_BROWSE].top = height - 24; + window_loadsave_widgets[WIDX_BROWSE].bottom = height - 6; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + const auto shortPath = ShortenPath(_directory, width - 8, FontStyle::Medium); + + // Format text + std::string buffer; + buffer.assign("{BLACK}"); + buffer += shortPath; + + // Draw path text + const auto normalisedPath = Platform::StrDecompToPrecomp(buffer.data()); + const auto* normalisedPathC = normalisedPath.c_str(); + auto ft = Formatter(); + ft.Add(normalisedPathC); + DrawTextEllipsised(dpi, windowPos + ScreenCoordsXY{ 4, 20 }, width - 8, STR_STRING, ft); + + // Name button text + StringId id = STR_NONE; + if (gConfigGeneral.LoadSaveSort == Sort::NameAscending) + id = STR_UP; + else if (gConfigGeneral.LoadSaveSort == Sort::NameDescending) + id = STR_DOWN; + + // Draw name button indicator. + Widget sort_name_widget = window_loadsave_widgets[WIDX_SORT_NAME]; + ft = Formatter(); + ft.Add(id); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ sort_name_widget.left + 11, sort_name_widget.top + 1 }, STR_NAME, ft, + { COLOUR_GREY }); + + // Date button text + if (gConfigGeneral.LoadSaveSort == Sort::DateAscending) + id = STR_UP; + else if (gConfigGeneral.LoadSaveSort == Sort::DateDescending) + id = STR_DOWN; + else + id = STR_NONE; + + Widget sort_date_widget = window_loadsave_widgets[WIDX_SORT_DATE]; + ft = Formatter(); + ft.Add(id); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ sort_date_widget.left + 5, sort_date_widget.top + 1 }, STR_DATE, ft, + { COLOUR_GREY }); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + bool isSave = (_type & 0x01) == LOADSAVETYPE_SAVE; + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + + case WIDX_UP: + PopulateList(isSave, _parentDirectory, _extensionPattern); + InitScrollWidgets(); + no_list_items = static_cast(_listItems.size()); + break; + + case WIDX_NEW_FILE: + WindowTextInputOpen( + this, WIDX_NEW_FILE, STR_NONE, 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); + break; + + case WIDX_BROWSE: + { + u8string path = OpenSystemFileBrowser(isSave); + if (!path.empty()) + { + Select(path.c_str()); + } + else + { + // If user cancels file dialog, refresh list + PopulateList(isSave, _directory, _extensionPattern); + InitScrollWidgets(); + no_list_items = static_cast(_listItems.size()); + } + } + break; + + case WIDX_SORT_NAME: + if (gConfigGeneral.LoadSaveSort == Sort::NameAscending) + { + gConfigGeneral.LoadSaveSort = Sort::NameDescending; + } + else + { + gConfigGeneral.LoadSaveSort = Sort::NameAscending; + } + ConfigSaveDefault(); + SortList(); + Invalidate(); + break; + + case WIDX_SORT_DATE: + if (gConfigGeneral.LoadSaveSort == Sort::DateDescending) + { + gConfigGeneral.LoadSaveSort = Sort::DateAscending; + } + else + { + gConfigGeneral.LoadSaveSort = Sort::DateDescending; + } + ConfigSaveDefault(); + SortList(); + Invalidate(); + break; + + case WIDX_DEFAULT: + PopulateList(isSave, GetInitialDirectoryByType(_type).c_str(), _extensionPattern); + InitScrollWidgets(); + no_list_items = static_cast(_listItems.size()); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (text.empty()) + return; + + if (!Platform::IsFilenameValid(text)) + { + ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); + return; + } + + switch (widgetIndex) + { + case WIDX_NEW_FOLDER: + { + const u8string path = Path::Combine(_directory, text); + if (!Path::CreateDirectory(path)) + { + ContextShowError(STR_UNABLE_TO_CREATE_FOLDER, STR_NONE, {}); + return; + } + + no_list_items = 0; + selected_list_item = -1; + + PopulateList((_type & 1) == LOADSAVETYPE_SAVE, path, _extensionPattern); + InitScrollWidgets(); + + no_list_items = static_cast(_listItems.size()); + Invalidate(); + break; + } + + case WIDX_NEW_FILE: + { + const u8string path = Path::WithExtension( + Path::Combine(_directory, text), RemovePatternWildcard(_extensionPattern)); + + if (File::Exists(path)) + WindowOverwritePromptOpen(text, path); + else + Select(path.c_str()); + break; + } + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + return { 0, no_list_items * SCROLLABLE_ROW_HEIGHT }; + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t selectedItem; + + selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (selectedItem >= no_list_items) + return; + + selected_list_item = selectedItem; + + Invalidate(); + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t selectedItem; + + selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (selectedItem >= no_list_items) + return; + + if (_listItems[selectedItem].type == TYPE_DIRECTORY) + { + // The selected item is a folder + int32_t includeNewItem; no_list_items = 0; selected_list_item = -1; + includeNewItem = (_type & 1) == LOADSAVETYPE_SAVE; - PopulateList((_type & 1) == LOADSAVETYPE_SAVE, path, _extensionPattern); + char directory[MAX_PATH]; + SafeStrCpy(directory, _listItems[selectedItem].path.c_str(), sizeof(directory)); + + PopulateList(includeNewItem, directory, _extensionPattern); InitScrollWidgets(); no_list_items = static_cast(_listItems.size()); - Invalidate(); - break; } - - case WIDX_NEW_FILE: - { - const u8string path = Path::WithExtension( - Path::Combine(_directory, text), RemovePatternWildcard(_extensionPattern)); - - if (File::Exists(path)) - WindowOverwritePromptOpen(text, path); - else - Select(path.c_str()); - break; - } - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - return { 0, no_list_items * SCROLLABLE_ROW_HEIGHT }; - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t selectedItem; - - selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (selectedItem >= no_list_items) - return; - - selected_list_item = selectedItem; - - Invalidate(); - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t selectedItem; - - selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (selectedItem >= no_list_items) - return; - - if (_listItems[selectedItem].type == TYPE_DIRECTORY) - { - // The selected item is a folder - int32_t includeNewItem; - - no_list_items = 0; - selected_list_item = -1; - includeNewItem = (_type & 1) == LOADSAVETYPE_SAVE; - - char directory[MAX_PATH]; - SafeStrCpy(directory, _listItems[selectedItem].path.c_str(), sizeof(directory)); - - PopulateList(includeNewItem, directory, _extensionPattern); - InitScrollWidgets(); - - no_list_items = static_cast(_listItems.size()); - } - else - { - // TYPE_FILE - // Load or overwrite - if ((_type & 0x01) == LOADSAVETYPE_SAVE) - WindowOverwritePromptOpen(_listItems[selectedItem].name, _listItems[selectedItem].path); else - Select(_listItems[selectedItem].path.c_str()); + { + // TYPE_FILE + // Load or overwrite + if ((_type & 0x01) == LOADSAVETYPE_SAVE) + WindowOverwritePromptOpen(_listItems[selectedItem].name, _listItems[selectedItem].path); + else + Select(_listItems[selectedItem].path.c_str()); + } } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - GfxFillRect( - dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - const int32_t listWidth = widgets[WIDX_SCROLL].width(); - const int32_t dateAnchor = widgets[WIDX_SORT_DATE].left + maxDateWidth + DATE_TIME_GAP; - - for (int32_t i = 0; i < no_list_items; i++) + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - int32_t y = i * SCROLLABLE_ROW_HEIGHT; - if (y > dpi.y + dpi.height) + GfxFillRect( + dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); + const int32_t listWidth = widgets[WIDX_SCROLL].width(); + const int32_t dateAnchor = widgets[WIDX_SORT_DATE].left + maxDateWidth + DATE_TIME_GAP; + + for (int32_t i = 0; i < no_list_items; i++) + { + int32_t y = i * SCROLLABLE_ROW_HEIGHT; + if (y > dpi.y + dpi.height) + break; + + if (y + SCROLLABLE_ROW_HEIGHT < dpi.y) + continue; + + StringId stringId = STR_BLACK_STRING; + + // If hovering over item, change the color and fill the backdrop. + if (i == selected_list_item) + { + stringId = STR_WINDOW_COLOUR_2_STRINGID; + GfxFilterRect(dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); + } + // display a marker next to the currently loaded game file + if (_listItems[i].loaded) + { + auto ft = Formatter(); + ft.Add(STR_RIGHTGUILLEMET); + DrawTextBasic(dpi, { 0, y }, stringId, ft); + } + + // Print filename + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(_listItems[i].name.c_str()); + int32_t max_file_width = widgets[WIDX_SORT_NAME].width() - 10; + DrawTextEllipsised(dpi, { 10, y }, max_file_width, stringId, ft); + + // Print formatted modified date, if this is a file + if (_listItems[i].type == TYPE_FILE) + { + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(_listItems[i].date_formatted.c_str()); + DrawTextEllipsised( + dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT }); + + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(_listItems[i].time_formatted.c_str()); + DrawTextEllipsised(dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft); + } + } + } +#pragma endregion + }; + + WindowBase* WindowLoadsaveOpen( + int32_t type, std::string_view defaultPath, std::function callback, + TrackDesign* trackDesign) + { + _loadSaveCallback = callback; + _trackDesign = trackDesign; + _type = type; + _defaultPath = defaultPath; + + bool isSave = (type & 0x01) == LOADSAVETYPE_SAVE; + + // Bypass the lot? + auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); + if (gConfigGeneral.UseNativeBrowseDialog && hasFilePicker) + { + const u8string path = OpenSystemFileBrowser(isSave); + if (!path.empty()) + { + Select(path.c_str()); + } + return nullptr; + } + + const u8string path = GetDir(type); + + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Loadsave)); + if (w == nullptr) + { + w = WindowCreate( + WindowClass::Loadsave, WW, WH, WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN, type); + } + + switch (type & 0x0E) + { + case LOADSAVETYPE_GAME: + w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_GAME : STR_FILE_DIALOG_TITLE_LOAD_GAME; break; - if (y + SCROLLABLE_ROW_HEIGHT < dpi.y) - continue; + case LOADSAVETYPE_LANDSCAPE: + w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_LANDSCAPE + : STR_FILE_DIALOG_TITLE_LOAD_LANDSCAPE; + break; - StringId stringId = STR_BLACK_STRING; + case LOADSAVETYPE_SCENARIO: + w->widgets[WIDX_TITLE].text = STR_FILE_DIALOG_TITLE_SAVE_SCENARIO; + break; - // If hovering over item, change the color and fill the backdrop. - if (i == selected_list_item) - { - stringId = STR_WINDOW_COLOUR_2_STRINGID; - GfxFilterRect(dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1); - } - // display a marker next to the currently loaded game file - if (_listItems[i].loaded) - { - auto ft = Formatter(); - ft.Add(STR_RIGHTGUILLEMET); - DrawTextBasic(dpi, { 0, y }, stringId, ft); - } + case LOADSAVETYPE_TRACK: + w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_TRACK + : STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN; + break; - // Print filename - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(_listItems[i].name.c_str()); - int32_t max_file_width = widgets[WIDX_SORT_NAME].width() - 10; - DrawTextEllipsised(dpi, { 10, y }, max_file_width, stringId, ft); + case LOADSAVETYPE_HEIGHTMAP: + Guard::Assert(!isSave, "Cannot save images through loadsave window"); + w->widgets[WIDX_TITLE].text = STR_FILE_DIALOG_TITLE_LOAD_HEIGHTMAP; + break; - // Print formatted modified date, if this is a file - if (_listItems[i].type == TYPE_FILE) - { - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(_listItems[i].date_formatted.c_str()); - DrawTextEllipsised( - dpi, { dateAnchor - DATE_TIME_GAP, y }, maxDateWidth, stringId, ft, { TextAlignment::RIGHT }); - - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(_listItems[i].time_formatted.c_str()); - DrawTextEllipsised(dpi, { dateAnchor + DATE_TIME_GAP, y }, maxTimeWidth, stringId, ft); - } + default: + Guard::Fail("Unsupported load/save type: %d", type & 0x0F); + break; } + + return w; } -#pragma endregion -}; - -WindowBase* WindowLoadsaveOpen( - int32_t type, std::string_view defaultPath, std::function callback, - TrackDesign* trackDesign) -{ - _loadSaveCallback = callback; - _trackDesign = trackDesign; - _type = type; - _defaultPath = defaultPath; - - bool isSave = (type & 0x01) == LOADSAVETYPE_SAVE; - - // Bypass the lot? - auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); - if (gConfigGeneral.UseNativeBrowseDialog && hasFilePicker) - { - const u8string path = OpenSystemFileBrowser(isSave); - if (!path.empty()) - { - Select(path.c_str()); - } - return nullptr; - } - - const u8string path = GetDir(type); - - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Loadsave)); - if (w == nullptr) - { - w = WindowCreate( - WindowClass::Loadsave, WW, WH, WF_STICK_TO_FRONT | WF_RESIZABLE | WF_AUTO_POSITION | WF_CENTRE_SCREEN, type); - } - - switch (type & 0x0E) - { - case LOADSAVETYPE_GAME: - w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_GAME : STR_FILE_DIALOG_TITLE_LOAD_GAME; - break; - - case LOADSAVETYPE_LANDSCAPE: - w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_LANDSCAPE : STR_FILE_DIALOG_TITLE_LOAD_LANDSCAPE; - break; - - case LOADSAVETYPE_SCENARIO: - w->widgets[WIDX_TITLE].text = STR_FILE_DIALOG_TITLE_SAVE_SCENARIO; - break; - - case LOADSAVETYPE_TRACK: - w->widgets[WIDX_TITLE].text = isSave ? STR_FILE_DIALOG_TITLE_SAVE_TRACK - : STR_FILE_DIALOG_TITLE_INSTALL_NEW_TRACK_DESIGN; - break; - - case LOADSAVETYPE_HEIGHTMAP: - Guard::Assert(!isSave, "Cannot save images through loadsave window"); - w->widgets[WIDX_TITLE].text = STR_FILE_DIALOG_TITLE_LOAD_HEIGHTMAP; - break; - - default: - Guard::Fail("Unsupported load/save type: %d", type & 0x0F); - break; - } - - return w; -} #pragma region Overwrite prompt -constexpr int32_t OVERWRITE_WW = 200; -constexpr int32_t OVERWRITE_WH = 100; + constexpr int32_t OVERWRITE_WW = 200; + constexpr int32_t OVERWRITE_WH = 100; -enum -{ - WIDX_OVERWRITE_BACKGROUND, - WIDX_OVERWRITE_TITLE, - WIDX_OVERWRITE_CLOSE, - WIDX_OVERWRITE_OVERWRITE, - WIDX_OVERWRITE_CANCEL -}; - -static Widget window_overwrite_prompt_widgets[] = { - WINDOW_SHIM_WHITE(STR_FILEBROWSER_OVERWRITE_TITLE, OVERWRITE_WW, OVERWRITE_WH), - { WindowWidgetType::Button, 0, 10, 94, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_FILEBROWSER_OVERWRITE_TITLE, STR_NONE }, - { WindowWidgetType::Button, 0, OVERWRITE_WW - 95, OVERWRITE_WW - 11, OVERWRITE_WH - 20, OVERWRITE_WH - 9, - STR_SAVE_PROMPT_CANCEL, STR_NONE }, - kWidgetsEnd, -}; - -class OverwritePromptWindow final : public Window -{ - std::string _name; - std::string _path; - -public: - OverwritePromptWindow(const std::string_view name, const std::string_view path) - : _name(name) - , _path(path) + enum { - } + WIDX_OVERWRITE_BACKGROUND, + WIDX_OVERWRITE_TITLE, + WIDX_OVERWRITE_CLOSE, + WIDX_OVERWRITE_OVERWRITE, + WIDX_OVERWRITE_CANCEL + }; - void OnOpen() override - { - widgets = window_overwrite_prompt_widgets; - colours[0] = TRANSLUCENT(COLOUR_BORDEAUX_RED); - } + static Widget window_overwrite_prompt_widgets[] = { + WINDOW_SHIM_WHITE(STR_FILEBROWSER_OVERWRITE_TITLE, OVERWRITE_WW, OVERWRITE_WH), + { WindowWidgetType::Button, 0, 10, 94, OVERWRITE_WH - 20, OVERWRITE_WH - 9, STR_FILEBROWSER_OVERWRITE_TITLE, STR_NONE }, + { WindowWidgetType::Button, 0, OVERWRITE_WW - 95, OVERWRITE_WW - 11, OVERWRITE_WH - 20, OVERWRITE_WH - 9, + STR_SAVE_PROMPT_CANCEL, STR_NONE }, + kWidgetsEnd, + }; - void OnMouseUp(WidgetIndex widgetIndex) override + class OverwritePromptWindow final : public Window { - switch (widgetIndex) + std::string _name; + std::string _path; + + public: + OverwritePromptWindow(const std::string_view name, const std::string_view path) + : _name(name) + , _path(path) { - case WIDX_OVERWRITE_OVERWRITE: - { - Select(_path.c_str()); - - // As the LoadSaveWindow::Select function can change the order of the - // windows we can't use WindowClose(w). - WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); - break; - } - - case WIDX_OVERWRITE_CANCEL: - case WIDX_OVERWRITE_CLOSE: - Close(); - break; } - } - void OnDraw(DrawPixelInfo& dpi) override + void OnOpen() override + { + widgets = window_overwrite_prompt_widgets; + colours[0] = TRANSLUCENT(COLOUR_BORDEAUX_RED); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_OVERWRITE_OVERWRITE: + { + Select(_path.c_str()); + + // As the LoadSaveWindow::Select function can change the order of the + // windows we can't use WindowClose(w). + WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); + break; + } + + case WIDX_OVERWRITE_CANCEL: + case WIDX_OVERWRITE_CLOSE: + Close(); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(_name.c_str()); + + ScreenCoordsXY stringCoords(windowPos.x + width / 2, windowPos.y + (height / 2) - 3); + DrawTextWrapped(dpi, stringCoords, width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE }); + } + }; + + static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path) { - DrawWidgets(dpi); + WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(_name.c_str()); - - ScreenCoordsXY stringCoords(windowPos.x + width / 2, windowPos.y + (height / 2) - 3); - DrawTextWrapped(dpi, stringCoords, width - 4, STR_FILEBROWSER_OVERWRITE_PROMPT, ft, { TextAlignment::CENTRE }); + return WindowCreate( + WindowClass::LoadsaveOverwritePrompt, OVERWRITE_WW, OVERWRITE_WH, + WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, name, path); } -}; - -static WindowBase* WindowOverwritePromptOpen(const std::string_view name, const std::string_view path) -{ - WindowCloseByClass(WindowClass::LoadsaveOverwritePrompt); - - return WindowCreate( - WindowClass::LoadsaveOverwritePrompt, OVERWRITE_WW, OVERWRITE_WH, WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN, - name, path); -} #pragma endregion +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index b61bb7b880..29fd68f364 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -15,63 +15,67 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off static Widget _mainWidgets[] = { MakeWidget({0, 0}, {0, 0}, WindowWidgetType::Viewport, WindowColour::Primary, STR_VIEWPORT), kWidgetsEnd, }; -// clang-format on + // clang-format on -class MainWindow final : public Window -{ -public: - void OnOpen() override + class MainWindow final : public Window { - _mainWidgets[0].right = width; - _mainWidgets[0].bottom = height; - widgets = _mainWidgets; - - ViewportCreate(this, windowPos, width, height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); - if (viewport != nullptr) + public: + void OnOpen() override { - SetViewportFlags(); - viewport->rotation = 0; + _mainWidgets[0].right = width; + _mainWidgets[0].bottom = height; + widgets = _mainWidgets; + + ViewportCreate(this, windowPos, width, height, Focus(CoordsXYZ(0x0FFF, 0x0FFF, 0))); + if (viewport != nullptr) + { + SetViewportFlags(); + viewport->rotation = 0; + } + gShowGridLinesRefCount = 0; + gShowLandRightsRefCount = 0; + gShowConstructionRightsRefCount = 0; + WindowFootpathResetSelectedPath(); } - gShowGridLinesRefCount = 0; - gShowLandRightsRefCount = 0; - gShowConstructionRightsRefCount = 0; - WindowFootpathResetSelectedPath(); - } - void OnDraw(DrawPixelInfo& dpi) override + void OnDraw(DrawPixelInfo& dpi) override + { + ViewportRender(dpi, viewport, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }); + } + + private: + void SetViewportFlags() + { + viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + if (gConfigGeneral.InvisibleRides) + viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES; + if (gConfigGeneral.InvisibleVehicles) + viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEHICLES; + if (gConfigGeneral.InvisibleTrees) + viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEGETATION; + if (gConfigGeneral.InvisibleScenery) + viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SCENERY; + if (gConfigGeneral.InvisiblePaths) + viewport->flags |= VIEWPORT_FLAG_INVISIBLE_PATHS; + if (gConfigGeneral.InvisibleSupports) + viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SUPPORTS; + } + }; + + /** + * Creates the main window that holds the main viewport. + * rct2: 0x0066B3E8 + */ + WindowBase* WindowMainOpen() { - ViewportRender(dpi, viewport, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }); + return WindowCreate( + WindowClass::MainWindow, { 0, 0 }, ContextGetWidth(), ContextGetHeight(), WF_STICK_TO_BACK); } - -private: - void SetViewportFlags() - { - viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - if (gConfigGeneral.InvisibleRides) - viewport->flags |= VIEWPORT_FLAG_INVISIBLE_RIDES; - if (gConfigGeneral.InvisibleVehicles) - viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEHICLES; - if (gConfigGeneral.InvisibleTrees) - viewport->flags |= VIEWPORT_FLAG_INVISIBLE_VEGETATION; - if (gConfigGeneral.InvisibleScenery) - viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SCENERY; - if (gConfigGeneral.InvisiblePaths) - viewport->flags |= VIEWPORT_FLAG_INVISIBLE_PATHS; - if (gConfigGeneral.InvisibleSupports) - viewport->flags |= VIEWPORT_FLAG_INVISIBLE_SUPPORTS; - } -}; - -/** - * Creates the main window that holds the main viewport. - * rct2: 0x0066B3E8 - */ -WindowBase* WindowMainOpen() -{ - return WindowCreate(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 296fdc8a07..3c07bf2e23 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -40,70 +40,70 @@ #include #include -using namespace OpenRCT2; - -static constexpr uint16_t MapColour2(uint8_t colourA, uint8_t colourB) +namespace OpenRCT2::Ui::Windows { - return (colourA << 8) | colourB; -} -static constexpr uint16_t MapColour(uint8_t colour) -{ - return MapColour2(colour, colour); -} -static constexpr uint16_t MapColourUnowned(uint16_t colour) -{ - return MapColour2((colour & 0xFF00) >> 8, PALETTE_INDEX_10); -} + static constexpr uint16_t MapColour2(uint8_t colourA, uint8_t colourB) + { + return (colourA << 8) | colourB; + } + static constexpr uint16_t MapColour(uint8_t colour) + { + return MapColour2(colour, colour); + } + static constexpr uint16_t MapColourUnowned(uint16_t colour) + { + return MapColour2((colour & 0xFF00) >> 8, PALETTE_INDEX_10); + } -constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2; + constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2; -static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL; -static constexpr int32_t WH = 259; -static constexpr int32_t WW = 245; + static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL; + static constexpr int32_t WH = 259; + static constexpr int32_t WW = 245; -// Some functions manipulate coordinates on the map. These are the coordinates of the pixels in the -// minimap. In order to distinguish those from actual coordinates, we use a separate name. -using MapCoordsXY = TileCoordsXY; + // Some functions manipulate coordinates on the map. These are the coordinates of the pixels in the + // minimap. In order to distinguish those from actual coordinates, we use a separate name. + using MapCoordsXY = TileCoordsXY; -enum -{ - PAGE_PEEPS, - PAGE_RIDES -}; + enum + { + PAGE_PEEPS, + PAGE_RIDES + }; -enum WindowMapWidgetIdx -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_RESIZE, - WIDX_PEOPLE_TAB, - WIDX_RIDES_TAB, - WIDX_MAP, - WIDX_MAP_SIZE_SPINNER_Y, - WIDX_MAP_SIZE_SPINNER_Y_UP, - WIDX_MAP_SIZE_SPINNER_Y_DOWN, - WIDX_MAP_SIZE_LINK, - WIDX_MAP_SIZE_SPINNER_X, - WIDX_MAP_SIZE_SPINNER_X_UP, - WIDX_MAP_SIZE_SPINNER_X_DOWN, - WIDX_SET_LAND_RIGHTS, - WIDX_BUILD_PARK_ENTRANCE, - WIDX_PEOPLE_STARTING_POSITION, - WIDX_LAND_TOOL, - WIDX_LAND_TOOL_SMALLER, - WIDX_LAND_TOOL_LARGER, - WIDX_LAND_OWNED_CHECKBOX, - WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX, - WIDX_LAND_SALE_CHECKBOX, - WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX, - WIDX_ROTATE_90, - WIDX_MAP_GENERATOR -}; + enum WindowMapWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_RESIZE, + WIDX_PEOPLE_TAB, + WIDX_RIDES_TAB, + WIDX_MAP, + WIDX_MAP_SIZE_SPINNER_Y, + WIDX_MAP_SIZE_SPINNER_Y_UP, + WIDX_MAP_SIZE_SPINNER_Y_DOWN, + WIDX_MAP_SIZE_LINK, + WIDX_MAP_SIZE_SPINNER_X, + WIDX_MAP_SIZE_SPINNER_X_UP, + WIDX_MAP_SIZE_SPINNER_X_DOWN, + WIDX_SET_LAND_RIGHTS, + WIDX_BUILD_PARK_ENTRANCE, + WIDX_PEOPLE_STARTING_POSITION, + WIDX_LAND_TOOL, + WIDX_LAND_TOOL_SMALLER, + WIDX_LAND_TOOL_LARGER, + WIDX_LAND_OWNED_CHECKBOX, + WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX, + WIDX_LAND_SALE_CHECKBOX, + WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX, + WIDX_ROTATE_90, + WIDX_MAP_GENERATOR + }; -validate_global_widx(WC_MAP, WIDX_ROTATE_90); + validate_global_widx(WC_MAP, WIDX_ROTATE_90); -// clang-format off + // clang-format off static Widget window_map_widgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({ 0, 43}, {245, 215}, WindowWidgetType::Resize, WindowColour::Secondary ), @@ -136,1387 +136,1392 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { MAXIMUM_MAP_SIZE_TECHNICAL - 8, 2 * MAXIMUM_MAP_SIZE_TECHNICAL }, { 0 - 8, MAXIMUM_MAP_SIZE_TECHNICAL }, }; -// clang-format on + // clang-format on -static constexpr StringId MapLabels[] = { - STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, - STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, -}; + static constexpr StringId MapLabels[] = { + STR_MAP_RIDE, STR_MAP_FOOD_STALL, STR_MAP_DRINK_STALL, STR_MAP_SOUVENIR_STALL, + STR_MAP_INFO_KIOSK, STR_MAP_FIRST_AID, STR_MAP_CASH_MACHINE, STR_MAP_TOILET, + }; -static constexpr uint16_t RideKeyColours[] = { - MapColour(PALETTE_INDEX_61), // COLOUR_KEY_RIDE - MapColour(PALETTE_INDEX_42), // COLOUR_KEY_FOOD - MapColour(PALETTE_INDEX_20), // COLOUR_KEY_DRINK - MapColour(PALETTE_INDEX_209), // COLOUR_KEY_SOUVENIR - MapColour(PALETTE_INDEX_136), // COLOUR_KEY_KIOSK - MapColour(PALETTE_INDEX_102), // COLOUR_KEY_FIRST_AID - MapColour(PALETTE_INDEX_55), // COLOUR_KEY_CASH_MACHINE - MapColour(PALETTE_INDEX_161), // COLOUR_KEY_TOILETS -}; + static constexpr uint16_t RideKeyColours[] = { + MapColour(PALETTE_INDEX_61), // COLOUR_KEY_RIDE + MapColour(PALETTE_INDEX_42), // COLOUR_KEY_FOOD + MapColour(PALETTE_INDEX_20), // COLOUR_KEY_DRINK + MapColour(PALETTE_INDEX_209), // COLOUR_KEY_SOUVENIR + MapColour(PALETTE_INDEX_136), // COLOUR_KEY_KIOSK + MapColour(PALETTE_INDEX_102), // COLOUR_KEY_FIRST_AID + MapColour(PALETTE_INDEX_55), // COLOUR_KEY_CASH_MACHINE + MapColour(PALETTE_INDEX_161), // COLOUR_KEY_TOILETS + }; -static constexpr uint8_t DefaultPeepMapColour = PALETTE_INDEX_20; -static constexpr uint8_t GuestMapColour = PALETTE_INDEX_172; -static constexpr uint8_t GuestMapColourAlternate = PALETTE_INDEX_21; -static constexpr uint8_t StaffMapColour = PALETTE_INDEX_138; -static constexpr uint8_t StaffMapColourAlternate = PALETTE_INDEX_10; + static constexpr uint8_t DefaultPeepMapColour = PALETTE_INDEX_20; + static constexpr uint8_t GuestMapColour = PALETTE_INDEX_172; + static constexpr uint8_t GuestMapColourAlternate = PALETTE_INDEX_21; + static constexpr uint8_t StaffMapColour = PALETTE_INDEX_138; + static constexpr uint8_t StaffMapColourAlternate = PALETTE_INDEX_10; -static constexpr uint16_t WaterColour = MapColour(PALETTE_INDEX_195); + static constexpr uint16_t WaterColour = MapColour(PALETTE_INDEX_195); -static constexpr uint16_t ElementTypeMaskColour[] = { - 0xFFFF, // TILE_ELEMENT_TYPE_SURFACE - 0x0000, // TILE_ELEMENT_TYPE_PATH - 0x00FF, // TILE_ELEMENT_TYPE_TRACK - 0xFF00, // TILE_ELEMENT_TYPE_SMALL_SCENERY - 0x0000, // TILE_ELEMENT_TYPE_ENTRANCE - 0xFFFF, // TILE_ELEMENT_TYPE_WALL - 0x0000, // TILE_ELEMENT_TYPE_LARGE_SCENERY - 0xFFFF, // TILE_ELEMENT_TYPE_BANNER -}; + static constexpr uint16_t ElementTypeMaskColour[] = { + 0xFFFF, // TILE_ELEMENT_TYPE_SURFACE + 0x0000, // TILE_ELEMENT_TYPE_PATH + 0x00FF, // TILE_ELEMENT_TYPE_TRACK + 0xFF00, // TILE_ELEMENT_TYPE_SMALL_SCENERY + 0x0000, // TILE_ELEMENT_TYPE_ENTRANCE + 0xFFFF, // TILE_ELEMENT_TYPE_WALL + 0x0000, // TILE_ELEMENT_TYPE_LARGE_SCENERY + 0xFFFF, // TILE_ELEMENT_TYPE_BANNER + }; -static constexpr uint16_t ElementTypeAddColour[] = { - MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_SURFACE - MapColour(PALETTE_INDEX_17), // TILE_ELEMENT_TYPE_PATH - MapColour2(PALETTE_INDEX_183, PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_TRACK - MapColour2(PALETTE_INDEX_0, PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_SMALL_SCENERY - MapColour(PALETTE_INDEX_186), // TILE_ELEMENT_TYPE_ENTRANCE - MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_WALL - MapColour(PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_LARGE_SCENERY - MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_BANNER -}; + static constexpr uint16_t ElementTypeAddColour[] = { + MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_SURFACE + MapColour(PALETTE_INDEX_17), // TILE_ELEMENT_TYPE_PATH + MapColour2(PALETTE_INDEX_183, PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_TRACK + MapColour2(PALETTE_INDEX_0, PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_SMALL_SCENERY + MapColour(PALETTE_INDEX_186), // TILE_ELEMENT_TYPE_ENTRANCE + MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_WALL + MapColour(PALETTE_INDEX_99), // TILE_ELEMENT_TYPE_LARGE_SCENERY + MapColour(PALETTE_INDEX_0), // TILE_ELEMENT_TYPE_BANNER + }; -class MapWindow final : public Window -{ - uint8_t _rotation; - uint8_t _activeTool; - uint32_t _currentLine; - uint16_t _landRightsToolSize; - int32_t _firstColumnWidth; - std::vector _mapImageData; - bool _mapWidthAndHeightLinked{ true }; - bool _recalculateScrollbars = false; - enum class ResizeDirection + class MapWindow final : public Window { - Both, - X, - Y, - } _resizeDirection{ ResizeDirection::Both }; - -public: - MapWindow() - { - _mapImageData.resize(MAP_WINDOW_MAP_SIZE * MAP_WINDOW_MAP_SIZE); - } - - void OnOpen() override - { - widgets = window_map_widgets; - - hold_down_widgets = (1uLL << WIDX_MAP_SIZE_SPINNER_Y_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_Y_DOWN) - | (1uLL << WIDX_MAP_SIZE_SPINNER_X_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_X_DOWN) | (1uLL << WIDX_LAND_TOOL_LARGER) - | (1uLL << WIDX_LAND_TOOL_SMALLER); - - flags |= WF_RESIZABLE; - min_width = WW; - max_width = 800; - min_height = WH; - max_height = 560; - - ResizeMap(); - InitScrollWidgets(); - CalculateTextLayout(); - - _rotation = GetCurrentRotation(); - - InitMap(); - gWindowSceneryRotation = 0; - CentreMapOnViewPoint(); - FootpathSelectDefault(); - - auto& gameState = GetGameState(); - _mapWidthAndHeightLinked = gameState.MapSize.x == gameState.MapSize.y; - - // Reset land rights tool size - _landRightsToolSize = 1; - } - - void OnClose() override - { - _mapImageData.clear(); - _mapImageData.shrink_to_fit(); - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == classification - && gCurrentToolWidget.window_number == number) + uint8_t _rotation; + uint8_t _activeTool; + uint32_t _currentLine; + uint16_t _landRightsToolSize; + int32_t _firstColumnWidth; + std::vector _mapImageData; + bool _mapWidthAndHeightLinked{ true }; + bool _recalculateScrollbars = false; + enum class ResizeDirection { - ToolCancel(); + Both, + X, + Y, + } _resizeDirection{ ResizeDirection::Both }; + + public: + MapWindow() + { + _mapImageData.resize(MAP_WINDOW_MAP_SIZE * MAP_WINDOW_MAP_SIZE); } - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_SET_LAND_RIGHTS: - Invalidate(); - if (ToolSet(*this, widgetIndex, Tool::UpArrow)) + widgets = window_map_widgets; + + hold_down_widgets = (1uLL << WIDX_MAP_SIZE_SPINNER_Y_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_Y_DOWN) + | (1uLL << WIDX_MAP_SIZE_SPINNER_X_UP) | (1uLL << WIDX_MAP_SIZE_SPINNER_X_DOWN) + | (1uLL << WIDX_LAND_TOOL_LARGER) | (1uLL << WIDX_LAND_TOOL_SMALLER); + + flags |= WF_RESIZABLE; + min_width = WW; + max_width = 800; + min_height = WH; + max_height = 560; + + ResizeMap(); + InitScrollWidgets(); + CalculateTextLayout(); + + _rotation = GetCurrentRotation(); + + InitMap(); + gWindowSceneryRotation = 0; + CentreMapOnViewPoint(); + FootpathSelectDefault(); + + auto& gameState = GetGameState(); + _mapWidthAndHeightLinked = gameState.MapSize.x == gameState.MapSize.y; + + // Reset land rights tool size + _landRightsToolSize = 1; + } + + void OnClose() override + { + _mapImageData.clear(); + _mapImageData.shrink_to_fit(); + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == classification + && gCurrentToolWidget.window_number == number) + { + ToolCancel(); + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); break; - _activeTool = 2; - // Prevent mountain tool size. - _landRightsToolSize = std::max(kLandToolMinimumSize, _landRightsToolSize); - ShowGridlines(); - ShowLandRights(); - ShowConstructionRights(); - break; - case WIDX_LAND_OWNED_CHECKBOX: - _activeTool ^= 2; - - if (_activeTool & 2) - _activeTool &= 0xF2; - - Invalidate(); - break; - case WIDX_LAND_SALE_CHECKBOX: - _activeTool ^= 8; - - if (_activeTool & 8) - _activeTool &= 0xF8; - - Invalidate(); - break; - case WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX: - _activeTool ^= 1; - - if (_activeTool & 1) - _activeTool &= 0xF1; - - Invalidate(); - break; - case WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX: - _activeTool ^= 4; - - if (_activeTool & 4) - _activeTool &= 0xF4; - - Invalidate(); - break; - case WIDX_BUILD_PARK_ENTRANCE: - Invalidate(); - if (ToolSet(*this, widgetIndex, Tool::UpArrow)) + case WIDX_SET_LAND_RIGHTS: + Invalidate(); + if (ToolSet(*this, widgetIndex, Tool::UpArrow)) + break; + _activeTool = 2; + // Prevent mountain tool size. + _landRightsToolSize = std::max(kLandToolMinimumSize, _landRightsToolSize); + ShowGridlines(); + ShowLandRights(); + ShowConstructionRights(); break; + case WIDX_LAND_OWNED_CHECKBOX: + _activeTool ^= 2; - gParkEntranceGhostExists = false; - InputSetFlag(INPUT_FLAG_6, true); + if (_activeTool & 2) + _activeTool &= 0xF2; - ShowGridlines(); - ShowLandRights(); - ShowConstructionRights(); - break; - case WIDX_ROTATE_90: - gWindowSceneryRotation = (gWindowSceneryRotation + 1) & 3; - break; - case WIDX_PEOPLE_STARTING_POSITION: - if (ToolSet(*this, widgetIndex, Tool::UpArrow)) + Invalidate(); break; + case WIDX_LAND_SALE_CHECKBOX: + _activeTool ^= 8; - ShowGridlines(); - ShowLandRights(); - ShowConstructionRights(); - break; - case WIDX_LAND_TOOL: - InputLandSize(); - break; - case WIDX_MAP_SIZE_SPINNER_Y: - case WIDX_MAP_SIZE_SPINNER_X: - InputMapSize(widgetIndex); - break; - case WIDX_MAP_SIZE_LINK: - _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; - break; - case WIDX_MAP_GENERATOR: - ContextOpenWindow(WindowClass::Mapgen); - break; - default: - if (widgetIndex >= WIDX_PEOPLE_TAB && widgetIndex <= WIDX_RIDES_TAB) - { - widgetIndex -= WIDX_PEOPLE_TAB; - if (widgetIndex == selected_tab) + if (_activeTool & 8) + _activeTool &= 0xF8; + + Invalidate(); + break; + case WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX: + _activeTool ^= 1; + + if (_activeTool & 1) + _activeTool &= 0xF1; + + Invalidate(); + break; + case WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX: + _activeTool ^= 4; + + if (_activeTool & 4) + _activeTool &= 0xF4; + + Invalidate(); + break; + case WIDX_BUILD_PARK_ENTRANCE: + Invalidate(); + if (ToolSet(*this, widgetIndex, Tool::UpArrow)) break; - selected_tab = widgetIndex; - list_information_type = 0; - _recalculateScrollbars = true; - } - } - } + gParkEntranceGhostExists = false; + InputSetFlag(INPUT_FLAG_6, true); - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_MAP_SIZE_SPINNER_Y_UP: - _resizeDirection = ResizeDirection::Y; - IncreaseMapSize(); - break; - case WIDX_MAP_SIZE_SPINNER_Y_DOWN: - _resizeDirection = ResizeDirection::Y; - DecreaseMapSize(); - break; - case WIDX_MAP_SIZE_SPINNER_X_UP: - _resizeDirection = ResizeDirection::X; - IncreaseMapSize(); - break; - case WIDX_MAP_SIZE_SPINNER_X_DOWN: - _resizeDirection = ResizeDirection::X; - DecreaseMapSize(); - break; - case WIDX_LAND_TOOL_SMALLER: - // Decrement land rights tool size - _landRightsToolSize = std::max(kLandToolMinimumSize, _landRightsToolSize - 1); + ShowGridlines(); + ShowLandRights(); + ShowConstructionRights(); + break; + case WIDX_ROTATE_90: + gWindowSceneryRotation = (gWindowSceneryRotation + 1) & 3; + break; + case WIDX_PEOPLE_STARTING_POSITION: + if (ToolSet(*this, widgetIndex, Tool::UpArrow)) + break; - Invalidate(); - break; - case WIDX_LAND_TOOL_LARGER: - // Increment land rights tool size - _landRightsToolSize = std::min(kLandToolMaximumSize, _landRightsToolSize + 1); + ShowGridlines(); + ShowLandRights(); + ShowConstructionRights(); + break; + case WIDX_LAND_TOOL: + InputLandSize(); + break; + case WIDX_MAP_SIZE_SPINNER_Y: + case WIDX_MAP_SIZE_SPINNER_X: + InputMapSize(widgetIndex); + break; + case WIDX_MAP_SIZE_LINK: + _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; + break; + case WIDX_MAP_GENERATOR: + ContextOpenWindow(WindowClass::Mapgen); + break; + default: + if (widgetIndex >= WIDX_PEOPLE_TAB && widgetIndex <= WIDX_RIDES_TAB) + { + widgetIndex -= WIDX_PEOPLE_TAB; + if (widgetIndex == selected_tab) + break; - Invalidate(); - break; - } - } - - void OnUpdate() override - { - if (GetCurrentRotation() != _rotation) - { - _rotation = GetCurrentRotation(); - InitMap(); - CentreMapOnViewPoint(); + selected_tab = widgetIndex; + list_information_type = 0; + _recalculateScrollbars = true; + } + } } - for (int32_t i = 0; i < 16; i++) - SetMapPixels(); - - Invalidate(); - - // Update tab animations - list_information_type++; - switch (selected_tab) + void OnMouseDown(WidgetIndex widgetIndex) override { - case PAGE_PEEPS: - if (list_information_type >= 32) - { - list_information_type = 0; - } - break; - case PAGE_RIDES: - if (list_information_type >= 64) - { - list_information_type = 0; - } - break; - } - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_SET_LAND_RIGHTS: - SetLandRightsToolUpdate(screenCoords); - break; - case WIDX_BUILD_PARK_ENTRANCE: - PlaceParkEntranceToolUpdate(screenCoords); - break; - case WIDX_PEOPLE_STARTING_POSITION: - SetPeepSpawnToolUpdate(screenCoords); - break; - } - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_BUILD_PARK_ENTRANCE: - PlaceParkEntranceToolDown(screenCoords); - break; - case WIDX_PEOPLE_STARTING_POSITION: - SetPeepSpawnToolDown(screenCoords); - break; - } - } - - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_SET_LAND_RIGHTS: - if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) - { - auto landSetRightsAction = LandSetRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - LandSetRightSetting::SetOwnershipWithChecks, _activeTool << 4); - GameActions::Execute(&landSetRightsAction); - } - break; - } - } - - void OnToolAbort(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_SET_LAND_RIGHTS: - Invalidate(); - HideGridlines(); - HideLandRights(); - HideConstructionRights(); - break; - case WIDX_BUILD_PARK_ENTRANCE: - ParkEntranceRemoveGhost(); - Invalidate(); - HideGridlines(); - HideLandRights(); - HideConstructionRights(); - break; - case WIDX_PEOPLE_STARTING_POSITION: - Invalidate(); - HideGridlines(); - HideLandRights(); - HideConstructionRights(); - break; - } - } - - void SetLandRightsToolUpdate(const ScreenCoordsXY& screenCoords) - { - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - auto info = GetMapCoordinatesFromPos( - screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water)); - if (info.SpriteType == ViewportInteractionItem::None) - return; - - auto mapCoords = info.Loc; - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL_LAND_RIGHTS; - - int32_t landRightsToolSize = _landRightsToolSize; - if (landRightsToolSize == 0) - landRightsToolSize = 1; - - int32_t size = (landRightsToolSize * 32) - 32; - int32_t radius = (landRightsToolSize * 16) - 16; - mapCoords.x -= radius; - mapCoords.y -= radius; - mapCoords = mapCoords.ToTileStart(); - gMapSelectPositionA = mapCoords; - gMapSelectPositionB.x = mapCoords.x + size; - gMapSelectPositionB.y = mapCoords.y + size; - MapInvalidateSelectionRect(); - } - - CoordsXYZD PlaceParkEntranceGetMapPosition(const ScreenCoordsXY& screenCoords) - { - CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION }; - const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, INVALID_DIRECTION }; - if (parkEntranceMapPosition.IsNull()) - return parkEntranceMapPosition; - - auto surfaceElement = MapGetSurfaceElementAt(mapCoords); - if (surfaceElement == nullptr) - { - parkEntranceMapPosition.SetNull(); - return parkEntranceMapPosition; - } - - parkEntranceMapPosition.z = surfaceElement->GetWaterHeight(); - if (parkEntranceMapPosition.z == 0) - { - parkEntranceMapPosition.z = surfaceElement->GetBaseZ(); - if ((surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) + switch (widgetIndex) { - parkEntranceMapPosition.z += 16; - if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + case WIDX_MAP_SIZE_SPINNER_Y_UP: + _resizeDirection = ResizeDirection::Y; + IncreaseMapSize(); + break; + case WIDX_MAP_SIZE_SPINNER_Y_DOWN: + _resizeDirection = ResizeDirection::Y; + DecreaseMapSize(); + break; + case WIDX_MAP_SIZE_SPINNER_X_UP: + _resizeDirection = ResizeDirection::X; + IncreaseMapSize(); + break; + case WIDX_MAP_SIZE_SPINNER_X_DOWN: + _resizeDirection = ResizeDirection::X; + DecreaseMapSize(); + break; + case WIDX_LAND_TOOL_SMALLER: + // Decrement land rights tool size + _landRightsToolSize = std::max(kLandToolMinimumSize, _landRightsToolSize - 1); + + Invalidate(); + break; + case WIDX_LAND_TOOL_LARGER: + // Increment land rights tool size + _landRightsToolSize = std::min(kLandToolMaximumSize, _landRightsToolSize + 1); + + Invalidate(); + break; + } + } + + void OnUpdate() override + { + if (GetCurrentRotation() != _rotation) + { + _rotation = GetCurrentRotation(); + InitMap(); + CentreMapOnViewPoint(); + } + + for (int32_t i = 0; i < 16; i++) + SetMapPixels(); + + Invalidate(); + + // Update tab animations + list_information_type++; + switch (selected_tab) + { + case PAGE_PEEPS: + if (list_information_type >= 32) + { + list_information_type = 0; + } + break; + case PAGE_RIDES: + if (list_information_type >= 64) + { + list_information_type = 0; + } + break; + } + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (widgetIndex) + { + case WIDX_SET_LAND_RIGHTS: + SetLandRightsToolUpdate(screenCoords); + break; + case WIDX_BUILD_PARK_ENTRANCE: + PlaceParkEntranceToolUpdate(screenCoords); + break; + case WIDX_PEOPLE_STARTING_POSITION: + SetPeepSpawnToolUpdate(screenCoords); + break; + } + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (widgetIndex) + { + case WIDX_BUILD_PARK_ENTRANCE: + PlaceParkEntranceToolDown(screenCoords); + break; + case WIDX_PEOPLE_STARTING_POSITION: + SetPeepSpawnToolDown(screenCoords); + break; + } + } + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (widgetIndex) + { + case WIDX_SET_LAND_RIGHTS: + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) + { + auto landSetRightsAction = LandSetRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + LandSetRightSetting::SetOwnershipWithChecks, _activeTool << 4); + GameActions::Execute(&landSetRightsAction); + } + break; + } + } + + void OnToolAbort(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_SET_LAND_RIGHTS: + Invalidate(); + HideGridlines(); + HideLandRights(); + HideConstructionRights(); + break; + case WIDX_BUILD_PARK_ENTRANCE: + ParkEntranceRemoveGhost(); + Invalidate(); + HideGridlines(); + HideLandRights(); + HideConstructionRights(); + break; + case WIDX_PEOPLE_STARTING_POSITION: + Invalidate(); + HideGridlines(); + HideLandRights(); + HideConstructionRights(); + break; + } + } + + void SetLandRightsToolUpdate(const ScreenCoordsXY& screenCoords) + { + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + + auto info = GetMapCoordinatesFromPos( + screenCoords, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water)); + if (info.SpriteType == ViewportInteractionItem::None) + return; + + auto mapCoords = info.Loc; + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL_LAND_RIGHTS; + + int32_t landRightsToolSize = _landRightsToolSize; + if (landRightsToolSize == 0) + landRightsToolSize = 1; + + int32_t size = (landRightsToolSize * 32) - 32; + int32_t radius = (landRightsToolSize * 16) - 16; + mapCoords.x -= radius; + mapCoords.y -= radius; + mapCoords = mapCoords.ToTileStart(); + gMapSelectPositionA = mapCoords; + gMapSelectPositionB.x = mapCoords.x + size; + gMapSelectPositionB.y = mapCoords.y + size; + MapInvalidateSelectionRect(); + } + + CoordsXYZD PlaceParkEntranceGetMapPosition(const ScreenCoordsXY& screenCoords) + { + CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION }; + const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); + parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, INVALID_DIRECTION }; + if (parkEntranceMapPosition.IsNull()) + return parkEntranceMapPosition; + + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); + if (surfaceElement == nullptr) + { + parkEntranceMapPosition.SetNull(); + return parkEntranceMapPosition; + } + + parkEntranceMapPosition.z = surfaceElement->GetWaterHeight(); + if (parkEntranceMapPosition.z == 0) + { + parkEntranceMapPosition.z = surfaceElement->GetBaseZ(); + if ((surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) { parkEntranceMapPosition.z += 16; + if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + { + parkEntranceMapPosition.z += 16; + } + } + } + parkEntranceMapPosition.direction = (gWindowSceneryRotation - GetCurrentRotation()) & 3; + return parkEntranceMapPosition; + } + + void PlaceParkEntranceToolUpdate(const ScreenCoordsXY& screenCoords) + { + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); + if (parkEntrancePosition.IsNull()) + { + ParkEntranceRemoveGhost(); + return; + } + + int32_t sideDirection = (parkEntrancePosition.direction + 1) & 3; + gMapSelectionTiles.clear(); + gMapSelectionTiles.push_back({ parkEntrancePosition.x, parkEntrancePosition.y }); + gMapSelectionTiles.push_back({ parkEntrancePosition.x + CoordsDirectionDelta[sideDirection].x, + parkEntrancePosition.y + CoordsDirectionDelta[sideDirection].y }); + gMapSelectionTiles.push_back({ parkEntrancePosition.x - CoordsDirectionDelta[sideDirection].x, + parkEntrancePosition.y - CoordsDirectionDelta[sideDirection].y }); + + gMapSelectArrowPosition = parkEntrancePosition; + gMapSelectArrowDirection = parkEntrancePosition.direction; + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT | MAP_SELECT_FLAG_ENABLE_ARROW; + MapInvalidateMapSelectionTiles(); + if (gParkEntranceGhostExists && parkEntrancePosition == gParkEntranceGhostPosition) + { + return; + } + + ParkEntranceRemoveGhost(); + + auto gameAction = ParkEntrancePlaceAction(parkEntrancePosition, gFootpathSelectedId); + gameAction.SetFlags(GAME_COMMAND_FLAG_GHOST); + + auto result = GameActions::Execute(&gameAction); + if (result.Error == GameActions::Status::Ok) + { + gParkEntranceGhostPosition = parkEntrancePosition; + gParkEntranceGhostExists = true; + } + } + + void PlaceParkEntranceToolDown(const ScreenCoordsXY& screenCoords) + { + ParkEntranceRemoveGhost(); + + CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); + if (!parkEntrancePosition.IsNull()) + { + auto gameAction = ParkEntrancePlaceAction(parkEntrancePosition, gFootpathSelectedId); + auto result = GameActions::Execute(&gameAction); + if (result.Error == GameActions::Status::Ok) + { + Audio::Play3D(Audio::SoundId::PlaceItem, result.Position); } } } - parkEntranceMapPosition.direction = (gWindowSceneryRotation - GetCurrentRotation()) & 3; - return parkEntranceMapPosition; - } - void PlaceParkEntranceToolUpdate(const ScreenCoordsXY& screenCoords) - { - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); - if (parkEntrancePosition.IsNull()) + void SetPeepSpawnToolUpdate(const ScreenCoordsXY& screenCoords) { - ParkEntranceRemoveGhost(); - return; + int32_t direction; + TileElement* tileElement; + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); + if (mapCoords.IsNull()) + return; + + int32_t mapZ = tileElement->GetBaseZ(); + if (tileElement->GetType() == TileElementType::Surface) + { + if ((tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) + mapZ += 16; + if (tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + mapZ += 16; + } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords; + gMapSelectArrowPosition = CoordsXYZ{ mapCoords, mapZ }; + gMapSelectArrowDirection = DirectionReverse(direction); + MapInvalidateSelectionRect(); } - int32_t sideDirection = (parkEntrancePosition.direction + 1) & 3; - gMapSelectionTiles.clear(); - gMapSelectionTiles.push_back({ parkEntrancePosition.x, parkEntrancePosition.y }); - gMapSelectionTiles.push_back({ parkEntrancePosition.x + CoordsDirectionDelta[sideDirection].x, - parkEntrancePosition.y + CoordsDirectionDelta[sideDirection].y }); - gMapSelectionTiles.push_back({ parkEntrancePosition.x - CoordsDirectionDelta[sideDirection].x, - parkEntrancePosition.y - CoordsDirectionDelta[sideDirection].y }); - - gMapSelectArrowPosition = parkEntrancePosition; - gMapSelectArrowDirection = parkEntrancePosition.direction; - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT | MAP_SELECT_FLAG_ENABLE_ARROW; - MapInvalidateMapSelectionTiles(); - if (gParkEntranceGhostExists && parkEntrancePosition == gParkEntranceGhostPosition) + void SetPeepSpawnToolDown(const ScreenCoordsXY& screenCoords) { - return; - } + // Verify footpath exists at location, and retrieve coordinates + TileElement* tileElement; + int32_t direction; + auto mapCoords = FootpathGetCoordinatesFromPos(screenCoords, &direction, &tileElement); + if (mapCoords.IsNull()) + return; - ParkEntranceRemoveGhost(); + int32_t mapZ = tileElement->GetBaseZ(); - auto gameAction = ParkEntrancePlaceAction(parkEntrancePosition, gFootpathSelectedId); - gameAction.SetFlags(GAME_COMMAND_FLAG_GHOST); - - auto result = GameActions::Execute(&gameAction); - if (result.Error == GameActions::Status::Ok) - { - gParkEntranceGhostPosition = parkEntrancePosition; - gParkEntranceGhostExists = true; - } - } - - void PlaceParkEntranceToolDown(const ScreenCoordsXY& screenCoords) - { - ParkEntranceRemoveGhost(); - - CoordsXYZD parkEntrancePosition = PlaceParkEntranceGetMapPosition(screenCoords); - if (!parkEntrancePosition.IsNull()) - { - auto gameAction = ParkEntrancePlaceAction(parkEntrancePosition, gFootpathSelectedId); + auto gameAction = PeepSpawnPlaceAction({ mapCoords, mapZ, static_cast(direction) }); auto result = GameActions::Execute(&gameAction); if (result.Error == GameActions::Status::Ok) { Audio::Play3D(Audio::SoundId::PlaceItem, result.Position); } } - } - void SetPeepSpawnToolUpdate(const ScreenCoordsXY& screenCoords) - { - int32_t direction; - TileElement* tileElement; - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - auto mapCoords = FootpathBridgeGetInfoFromPos(screenCoords, &direction, &tileElement); - if (mapCoords.IsNull()) - return; - - int32_t mapZ = tileElement->GetBaseZ(); - if (tileElement->GetType() == TileElementType::Surface) + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - if ((tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) != 0) - mapZ += 16; - if (tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - mapZ += 16; - } + if (text.empty()) + return; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords; - gMapSelectArrowPosition = CoordsXYZ{ mapCoords, mapZ }; - gMapSelectArrowDirection = DirectionReverse(direction); - MapInvalidateSelectionRect(); - } - - void SetPeepSpawnToolDown(const ScreenCoordsXY& screenCoords) - { - // Verify footpath exists at location, and retrieve coordinates - TileElement* tileElement; - int32_t direction; - auto mapCoords = FootpathGetCoordinatesFromPos(screenCoords, &direction, &tileElement); - if (mapCoords.IsNull()) - return; - - int32_t mapZ = tileElement->GetBaseZ(); - - auto gameAction = PeepSpawnPlaceAction({ mapCoords, mapZ, static_cast(direction) }); - auto result = GameActions::Execute(&gameAction); - if (result.Error == GameActions::Status::Ok) - { - Audio::Play3D(Audio::SoundId::PlaceItem, result.Position); - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - switch (widgetIndex) - { - case WIDX_LAND_TOOL: + switch (widgetIndex) { - char* end; - std::string textStr = std::string(text); - int32_t size = strtol(textStr.c_str(), &end, 10); - if (*end == '\0') + case WIDX_LAND_TOOL: { - size = std::clamp(size, kLandToolMinimumSize, kLandToolMaximumSize); - _landRightsToolSize = size; - Invalidate(); + char* end; + std::string textStr = std::string(text); + int32_t size = strtol(textStr.c_str(), &end, 10); + if (*end == '\0') + { + size = std::clamp(size, kLandToolMinimumSize, kLandToolMaximumSize); + _landRightsToolSize = size; + Invalidate(); + } + break; } - break; - } - case WIDX_MAP_SIZE_SPINNER_Y: - case WIDX_MAP_SIZE_SPINNER_X: - { - char* end; - std::string textStr = std::string(text); - int32_t size = strtol(textStr.c_str(), &end, 10); - if (*end == '\0') + case WIDX_MAP_SIZE_SPINNER_Y: + case WIDX_MAP_SIZE_SPINNER_X: { - // The practical size is 2 lower than the technical size - size += 2; - size = std::clamp(size, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); + char* end; + std::string textStr = std::string(text); + int32_t size = strtol(textStr.c_str(), &end, 10); + if (*end == '\0') + { + // The practical size is 2 lower than the technical size + size += 2; + size = std::clamp(size, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); - TileCoordsXY newMapSize = GetGameState().MapSize; - if (_resizeDirection != ResizeDirection::X) - newMapSize.y = size; - if (_resizeDirection != ResizeDirection::Y) - newMapSize.x = size; + TileCoordsXY newMapSize = GetGameState().MapSize; + if (_resizeDirection != ResizeDirection::X) + newMapSize.y = size; + if (_resizeDirection != ResizeDirection::Y) + newMapSize.x = size; - auto mapChangeSizeAction = MapChangeSizeAction(newMapSize); - GameActions::Execute(&mapChangeSizeAction); - Invalidate(); + auto mapChangeSizeAction = MapChangeSizeAction(newMapSize); + GameActions::Execute(&mapChangeSizeAction); + Invalidate(); + } + break; } - break; } } - } - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - return ScreenSize(MAP_WINDOW_MAP_SIZE, MAP_WINDOW_MAP_SIZE); - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - CoordsXY c = ScreenToMap(screenCoords); - auto mapCoords = CoordsXY{ std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1), std::clamp(c.y, 0, MAXIMUM_MAP_SIZE_BIG - 1) }; - auto mapZ = TileElementHeight(mapCoords); - - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) + ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - WindowScrollToLocation(*mainWindow, { mapCoords, mapZ }); + return ScreenSize(MAP_WINDOW_MAP_SIZE, MAP_WINDOW_MAP_SIZE); } - if (LandToolIsActive()) + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - // Set land terrain - int32_t landToolSize = std::max(1, gLandToolSize); - int32_t size = (landToolSize * 32) - 32; - int32_t radius = (landToolSize * 16) - 16; + CoordsXY c = ScreenToMap(screenCoords); + auto mapCoords = CoordsXY{ std::clamp(c.x, 0, MAXIMUM_MAP_SIZE_BIG - 1), + std::clamp(c.y, 0, MAXIMUM_MAP_SIZE_BIG - 1) }; + auto mapZ = TileElementHeight(mapCoords); - mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart(); - MapInvalidateSelectionRect(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords + CoordsXY{ size, size }; - MapInvalidateSelectionRect(); - - auto surfaceSetStyleAction = SurfaceSetStyleAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - gLandToolTerrainSurface, gLandToolTerrainEdge); - GameActions::Execute(&surfaceSetStyleAction); - } - else if (WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS)) - { - // Set land rights - int32_t landRightsToolSize = std::max(1, _landRightsToolSize); - int32_t size = (landRightsToolSize * 32) - 32; - int32_t radius = (landRightsToolSize * 16) - 16; - mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart(); - - MapInvalidateSelectionRect(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL_LAND_RIGHTS; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords + CoordsXY{ size, size }; - MapInvalidateSelectionRect(); - - auto landSetRightsAction = LandSetRightsAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - LandSetRightSetting::SetOwnershipWithChecks, _activeTool << 4); - GameActions::Execute(&landSetRightsAction); - } - } - - void OnScrollMouseDrag(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - OnScrollMouseDown(scrollIndex, screenCoords); - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - GfxClear(&dpi, PALETTE_INDEX_10); - - G1Element g1temp = {}; - g1temp.offset = _mapImageData.data(); - g1temp.width = MAP_WINDOW_MAP_SIZE; - g1temp.height = MAP_WINDOW_MAP_SIZE; - g1temp.x_offset = -8; - g1temp.y_offset = -8; - GfxSetG1Element(SPR_TEMP, &g1temp); - DrawingEngineInvalidateImage(SPR_TEMP); - GfxDrawSprite(dpi, ImageId(SPR_TEMP), { 0, 0 }); - - if (selected_tab == PAGE_PEEPS) - { - PaintPeepOverlay(dpi); - } - else - { - PaintTrainOverlay(dpi); - } - PaintHudRectangle(dpi); - } - - void OnPrepareDraw() override - { - // Set the pressed widgets - pressed_widgets = 0; - SetWidgetPressed(WIDX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); - pressed_widgets |= (1uLL << (WIDX_PEOPLE_TAB + selected_tab)); - pressed_widgets |= (1uLL << WIDX_LAND_TOOL); - - if (_activeTool & (1 << 3)) - pressed_widgets |= (1uLL << WIDX_LAND_SALE_CHECKBOX); - - if (_activeTool & (1 << 2)) - pressed_widgets |= (1uLL << WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX); - - if (_activeTool & (1 << 1)) - pressed_widgets |= (1uLL << WIDX_LAND_OWNED_CHECKBOX); - - if (_activeTool & (1 << 0)) - pressed_widgets |= (1uLL << WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX); - - // Set disabled widgets - auto& gameState = GetGameState(); - SetWidgetDisabled(WIDX_MAP_SIZE_LINK, gameState.MapSize.x != gameState.MapSize.y); - - // Resize widgets to window size - ResizeFrameWithPage(); - ResizeMap(); - - widgets[WIDX_MAP_SIZE_SPINNER_Y].top = height - 15; - widgets[WIDX_MAP_SIZE_SPINNER_Y].bottom = height - 4; - widgets[WIDX_MAP_SIZE_SPINNER_Y_UP].top = height - 14; - widgets[WIDX_MAP_SIZE_SPINNER_Y_UP].bottom = height - 5; - widgets[WIDX_MAP_SIZE_SPINNER_Y_DOWN].top = height - 14; - widgets[WIDX_MAP_SIZE_SPINNER_Y_DOWN].bottom = height - 5; - widgets[WIDX_MAP_SIZE_LINK].top = height - 15; - widgets[WIDX_MAP_SIZE_LINK].bottom = height - 4; - widgets[WIDX_MAP_SIZE_SPINNER_X].top = height - 15; - widgets[WIDX_MAP_SIZE_SPINNER_X].bottom = height - 4; - widgets[WIDX_MAP_SIZE_SPINNER_X_UP].top = height - 14; - widgets[WIDX_MAP_SIZE_SPINNER_X_UP].bottom = height - 5; - widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].top = height - 14; - widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].bottom = height - 5; - - widgets[WIDX_SET_LAND_RIGHTS].top = height - 70; - widgets[WIDX_SET_LAND_RIGHTS].bottom = height - 70 + 23; - widgets[WIDX_BUILD_PARK_ENTRANCE].top = height - 46; - widgets[WIDX_BUILD_PARK_ENTRANCE].bottom = height - 46 + 23; - widgets[WIDX_ROTATE_90].top = height - 46; - widgets[WIDX_ROTATE_90].bottom = height - 46 + 23; - widgets[WIDX_PEOPLE_STARTING_POSITION].top = height - 46; - widgets[WIDX_PEOPLE_STARTING_POSITION].bottom = height - 46 + 23; - - widgets[WIDX_LAND_TOOL].top = height - 42; - widgets[WIDX_LAND_TOOL].bottom = height - 42 + 30; - widgets[WIDX_LAND_TOOL_SMALLER].top = height - 41; - widgets[WIDX_LAND_TOOL_SMALLER].bottom = height - 41 + 15; - widgets[WIDX_LAND_TOOL_LARGER].top = height - 27; - widgets[WIDX_LAND_TOOL_LARGER].bottom = height - 27 + 15; - - widgets[WIDX_MAP_GENERATOR].top = height - 69; - widgets[WIDX_MAP_GENERATOR].bottom = height - 69 + 13; - - // Land tool mode (4 checkboxes) - int checkboxY = height - 55; - for (int32_t i = WIDX_LAND_OWNED_CHECKBOX; i <= WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX; i++) - { - widgets[i].top = checkboxY; - checkboxY += 11; - widgets[i].bottom = checkboxY; - checkboxY += 2; - } - - // Disable all scenario editor related widgets - for (int32_t i = WIDX_MAP_SIZE_SPINNER_Y; i <= WIDX_MAP_GENERATOR; i++) - { - widgets[i].type = WindowWidgetType::Empty; - } - - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) - { - // scenario editor: build park entrance selected, show rotate button - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map - && gCurrentToolWidget.widget_index == WIDX_BUILD_PARK_ENTRANCE) + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) { - widgets[WIDX_ROTATE_90].type = WindowWidgetType::FlatBtn; + WindowScrollToLocation(*mainWindow, { mapCoords, mapZ }); } - // Always show set land rights button - widgets[WIDX_SET_LAND_RIGHTS].type = WindowWidgetType::FlatBtn; - - // If any tool is active - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map) + if (LandToolIsActive()) { - // if not in set land rights mode: show the default scenario editor buttons - if (gCurrentToolWidget.widget_index != WIDX_SET_LAND_RIGHTS) - { - ShowDefaultScenarioEditorButtons(); - } - else - { // if in set land rights mode: show land tool buttons + modes - widgets[WIDX_LAND_TOOL].type = WindowWidgetType::ImgBtn; - widgets[WIDX_LAND_TOOL_SMALLER].type = WindowWidgetType::TrnBtn; - widgets[WIDX_LAND_TOOL_LARGER].type = WindowWidgetType::TrnBtn; + // Set land terrain + int32_t landToolSize = std::max(1, gLandToolSize); + int32_t size = (landToolSize * 32) - 32; + int32_t radius = (landToolSize * 16) - 16; - for (int32_t i = WIDX_LAND_OWNED_CHECKBOX; i <= WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX; i++) - widgets[i].type = WindowWidgetType::Checkbox; + mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart(); + MapInvalidateSelectionRect(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords + CoordsXY{ size, size }; + MapInvalidateSelectionRect(); - widgets[WIDX_LAND_TOOL].image = ImageId(LandTool::SizeToSpriteIndex(_landRightsToolSize)); - } + auto surfaceSetStyleAction = SurfaceSetStyleAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + gLandToolTerrainSurface, gLandToolTerrainEdge); + GameActions::Execute(&surfaceSetStyleAction); + } + else if (WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS)) + { + // Set land rights + int32_t landRightsToolSize = std::max(1, _landRightsToolSize); + int32_t size = (landRightsToolSize * 32) - 32; + int32_t radius = (landRightsToolSize * 16) - 16; + mapCoords = (mapCoords - CoordsXY{ radius, radius }).ToTileStart(); + + MapInvalidateSelectionRect(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL_LAND_RIGHTS; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords + CoordsXY{ size, size }; + MapInvalidateSelectionRect(); + + auto landSetRightsAction = LandSetRightsAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + LandSetRightSetting::SetOwnershipWithChecks, _activeTool << 4); + GameActions::Execute(&landSetRightsAction); + } + } + + void OnScrollMouseDrag(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + OnScrollMouseDown(scrollIndex, screenCoords); + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + GfxClear(&dpi, PALETTE_INDEX_10); + + G1Element g1temp = {}; + g1temp.offset = _mapImageData.data(); + g1temp.width = MAP_WINDOW_MAP_SIZE; + g1temp.height = MAP_WINDOW_MAP_SIZE; + g1temp.x_offset = -8; + g1temp.y_offset = -8; + GfxSetG1Element(SPR_TEMP, &g1temp); + DrawingEngineInvalidateImage(SPR_TEMP); + GfxDrawSprite(dpi, ImageId(SPR_TEMP), { 0, 0 }); + + if (selected_tab == PAGE_PEEPS) + { + PaintPeepOverlay(dpi); } else { - // if no tool is active: show the default scenario editor buttons - ShowDefaultScenarioEditorButtons(); + PaintTrainOverlay(dpi); + } + PaintHudRectangle(dpi); + } + + void OnPrepareDraw() override + { + // Set the pressed widgets + pressed_widgets = 0; + SetWidgetPressed(WIDX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); + pressed_widgets |= (1uLL << (WIDX_PEOPLE_TAB + selected_tab)); + pressed_widgets |= (1uLL << WIDX_LAND_TOOL); + + if (_activeTool & (1 << 3)) + pressed_widgets |= (1uLL << WIDX_LAND_SALE_CHECKBOX); + + if (_activeTool & (1 << 2)) + pressed_widgets |= (1uLL << WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX); + + if (_activeTool & (1 << 1)) + pressed_widgets |= (1uLL << WIDX_LAND_OWNED_CHECKBOX); + + if (_activeTool & (1 << 0)) + pressed_widgets |= (1uLL << WIDX_CONSTRUCTION_RIGHTS_OWNED_CHECKBOX); + + // Set disabled widgets + auto& gameState = GetGameState(); + SetWidgetDisabled(WIDX_MAP_SIZE_LINK, gameState.MapSize.x != gameState.MapSize.y); + + // Resize widgets to window size + ResizeFrameWithPage(); + ResizeMap(); + + widgets[WIDX_MAP_SIZE_SPINNER_Y].top = height - 15; + widgets[WIDX_MAP_SIZE_SPINNER_Y].bottom = height - 4; + widgets[WIDX_MAP_SIZE_SPINNER_Y_UP].top = height - 14; + widgets[WIDX_MAP_SIZE_SPINNER_Y_UP].bottom = height - 5; + widgets[WIDX_MAP_SIZE_SPINNER_Y_DOWN].top = height - 14; + widgets[WIDX_MAP_SIZE_SPINNER_Y_DOWN].bottom = height - 5; + widgets[WIDX_MAP_SIZE_LINK].top = height - 15; + widgets[WIDX_MAP_SIZE_LINK].bottom = height - 4; + widgets[WIDX_MAP_SIZE_SPINNER_X].top = height - 15; + widgets[WIDX_MAP_SIZE_SPINNER_X].bottom = height - 4; + widgets[WIDX_MAP_SIZE_SPINNER_X_UP].top = height - 14; + widgets[WIDX_MAP_SIZE_SPINNER_X_UP].bottom = height - 5; + widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].top = height - 14; + widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].bottom = height - 5; + + widgets[WIDX_SET_LAND_RIGHTS].top = height - 70; + widgets[WIDX_SET_LAND_RIGHTS].bottom = height - 70 + 23; + widgets[WIDX_BUILD_PARK_ENTRANCE].top = height - 46; + widgets[WIDX_BUILD_PARK_ENTRANCE].bottom = height - 46 + 23; + widgets[WIDX_ROTATE_90].top = height - 46; + widgets[WIDX_ROTATE_90].bottom = height - 46 + 23; + widgets[WIDX_PEOPLE_STARTING_POSITION].top = height - 46; + widgets[WIDX_PEOPLE_STARTING_POSITION].bottom = height - 46 + 23; + + widgets[WIDX_LAND_TOOL].top = height - 42; + widgets[WIDX_LAND_TOOL].bottom = height - 42 + 30; + widgets[WIDX_LAND_TOOL_SMALLER].top = height - 41; + widgets[WIDX_LAND_TOOL_SMALLER].bottom = height - 41 + 15; + widgets[WIDX_LAND_TOOL_LARGER].top = height - 27; + widgets[WIDX_LAND_TOOL_LARGER].bottom = height - 27 + 15; + + widgets[WIDX_MAP_GENERATOR].top = height - 69; + widgets[WIDX_MAP_GENERATOR].bottom = height - 69 + 13; + + // Land tool mode (4 checkboxes) + int checkboxY = height - 55; + for (int32_t i = WIDX_LAND_OWNED_CHECKBOX; i <= WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX; i++) + { + widgets[i].top = checkboxY; + checkboxY += 11; + widgets[i].bottom = checkboxY; + checkboxY += 2; + } + + // Disable all scenario editor related widgets + for (int32_t i = WIDX_MAP_SIZE_SPINNER_Y; i <= WIDX_MAP_GENERATOR; i++) + { + widgets[i].type = WindowWidgetType::Empty; + } + + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) + { + // scenario editor: build park entrance selected, show rotate button + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map + && gCurrentToolWidget.widget_index == WIDX_BUILD_PARK_ENTRANCE) + { + widgets[WIDX_ROTATE_90].type = WindowWidgetType::FlatBtn; + } + + // Always show set land rights button + widgets[WIDX_SET_LAND_RIGHTS].type = WindowWidgetType::FlatBtn; + + // If any tool is active + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::Map) + { + // if not in set land rights mode: show the default scenario editor buttons + if (gCurrentToolWidget.widget_index != WIDX_SET_LAND_RIGHTS) + { + ShowDefaultScenarioEditorButtons(); + } + else + { // if in set land rights mode: show land tool buttons + modes + widgets[WIDX_LAND_TOOL].type = WindowWidgetType::ImgBtn; + widgets[WIDX_LAND_TOOL_SMALLER].type = WindowWidgetType::TrnBtn; + widgets[WIDX_LAND_TOOL_LARGER].type = WindowWidgetType::TrnBtn; + + for (int32_t i = WIDX_LAND_OWNED_CHECKBOX; i <= WIDX_CONSTRUCTION_RIGHTS_SALE_CHECKBOX; i++) + widgets[i].type = WindowWidgetType::Checkbox; + + widgets[WIDX_LAND_TOOL].image = ImageId(LandTool::SizeToSpriteIndex(_landRightsToolSize)); + } + } + else + { + // if no tool is active: show the default scenario editor buttons + ShowDefaultScenarioEditorButtons(); + } + } + if (_recalculateScrollbars) + { + WidgetScrollUpdateThumbs(*this, WIDX_MAP); + _recalculateScrollbars = false; } } - if (_recalculateScrollbars) + + void OnDraw(DrawPixelInfo& dpi) override { - WidgetScrollUpdateThumbs(*this, WIDX_MAP); - _recalculateScrollbars = false; - } - } + DrawWidgets(dpi); + DrawTabImages(dpi); - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); + auto screenCoords = windowPos + + ScreenCoordsXY{ window_map_widgets[WIDX_LAND_TOOL].midX(), window_map_widgets[WIDX_LAND_TOOL].midY() }; - auto screenCoords = windowPos - + ScreenCoordsXY{ window_map_widgets[WIDX_LAND_TOOL].midX(), window_map_widgets[WIDX_LAND_TOOL].midY() }; - - // Draw land tool size - if (WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS) && _landRightsToolSize > kLandToolMaximumSizeWithSprite) - { - auto ft = Formatter(); - ft.Add(_landRightsToolSize); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); - } - screenCoords.y = windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5; - - // People starting position (scenario editor only) - if (widgets[WIDX_PEOPLE_STARTING_POSITION].type != WindowWidgetType::Empty) - { - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PEOPLE_STARTING_POSITION].left + 12, - widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18 }; - GfxDrawSprite(dpi, ImageId(SPR_6410, COLOUR_BRIGHT_RED, COLOUR_LIGHT_BROWN), screenCoords); - } - - if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) - { - // Render the map legend - if (selected_tab == PAGE_RIDES) + // Draw land tool size + if (WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS) && _landRightsToolSize > kLandToolMaximumSizeWithSprite) { - screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP].bottom + 2 }; + auto ft = Formatter(); + ft.Add(_landRightsToolSize); + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + screenCoords.y = windowPos.y + window_map_widgets[WIDX_LAND_TOOL].bottom + 5; - static_assert(std::size(RideKeyColours) == std::size(MapLabels)); + // People starting position (scenario editor only) + if (widgets[WIDX_PEOPLE_STARTING_POSITION].type != WindowWidgetType::Empty) + { + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PEOPLE_STARTING_POSITION].left + 12, + widgets[WIDX_PEOPLE_STARTING_POSITION].top + 18 }; + GfxDrawSprite(dpi, ImageId(SPR_6410, COLOUR_BRIGHT_RED, COLOUR_LIGHT_BROWN), screenCoords); + } - for (uint32_t i = 0; i < std::size(RideKeyColours); i++) + if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !GetGameState().Cheats.SandboxMode) + { + // Render the map legend + if (selected_tab == PAGE_RIDES) { - GfxFillRect( - dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, - RideKeyColours[i]); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, MapLabels[i], {}); - screenCoords.y += LIST_ROW_HEIGHT; - if (i == 3) + screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP].bottom + 2 }; + + static_assert(std::size(RideKeyColours) == std::size(MapLabels)); + + for (uint32_t i = 0; i < std::size(RideKeyColours); i++) { - screenCoords += { _firstColumnWidth, -(LIST_ROW_HEIGHT * 4) }; + GfxFillRect( + dpi, { screenCoords + ScreenCoordsXY{ 0, 2 }, screenCoords + ScreenCoordsXY{ 6, 8 } }, + RideKeyColours[i]); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LIST_ROW_HEIGHT, 0 }, MapLabels[i], {}); + screenCoords.y += LIST_ROW_HEIGHT; + if (i == 3) + { + screenCoords += { _firstColumnWidth, -(LIST_ROW_HEIGHT * 4) }; + } } } } - } - else if (!WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS)) - { - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_SPINNER_Y].top + 1 }, STR_MAP_SIZE, {}, - { colours[1] }); - } - } - - void OnLanguageChange() override - { - CalculateTextLayout(); - } - - void ResetMap() - { - InitMap(); - CentreMapOnViewPoint(); - } - -private: - void InitMap() - { - std::fill(_mapImageData.begin(), _mapImageData.end(), PALETTE_INDEX_10); - _currentLine = 0; - } - - void CentreMapOnViewPoint() - { - WindowBase* mainWindow = WindowGetMain(); - int16_t ax, bx, cx, dx; - int16_t bp, di; - - if (mainWindow == nullptr || mainWindow->viewport == nullptr) - return; - - auto offset = MiniMapOffsets[GetCurrentRotation()]; - - // calculate centre view point of viewport and transform it to minimap coordinates - - cx = ((mainWindow->viewport->view_width >> 1) + mainWindow->viewport->viewPos.x) >> 5; - dx = ((mainWindow->viewport->view_height >> 1) + mainWindow->viewport->viewPos.y) >> 4; - cx += offset.x; - dx += offset.y; - - // calculate width and height of minimap - - ax = widgets[WIDX_MAP].width() - 11; - bx = widgets[WIDX_MAP].height() - 11; - bp = ax; - di = bx; - - ax >>= 1; - bx >>= 1; - cx = std::max(cx - ax, 0); - dx = std::max(dx - bx, 0); - - bp = scrolls[0].h_right - bp; - di = scrolls[0].v_bottom - di; - - if (bp < 0 && (bp - cx) < 0) - cx = 0; - - if (di < 0 && (di - dx) < 0) - dx = 0; - - scrolls[0].h_left = cx; - scrolls[0].v_top = dx; - WidgetScrollUpdateThumbs(*this, WIDX_MAP); - } - - void IncreaseMapSize() - { - auto newMapSize = GetGameState().MapSize; - if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::Y) - newMapSize.y++; - if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X) - newMapSize.x++; - - auto increaseMapSizeAction = MapChangeSizeAction(newMapSize); - GameActions::Execute(&increaseMapSizeAction); - } - - void DecreaseMapSize() - { - auto newMapSize = GetGameState().MapSize; - if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::Y) - newMapSize.y--; - if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X) - newMapSize.x--; - - auto decreaseMapSizeAction = MapChangeSizeAction(newMapSize); - GameActions::Execute(&decreaseMapSizeAction); - } - - void SetMapPixels() - { - int32_t x = 0, y = 0, dx = 0, dy = 0; - - int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1; - auto destinationPosition = ScreenCoordsXY{ pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE }; - auto destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; - switch (GetCurrentRotation()) - { - case 0: - x = _currentLine * COORDS_XY_STEP; - y = 0; - dx = 0; - dy = COORDS_XY_STEP; - break; - case 1: - x = MAXIMUM_TILE_START_XY; - y = _currentLine * COORDS_XY_STEP; - dx = -COORDS_XY_STEP; - dy = 0; - break; - case 2: - x = MAXIMUM_MAP_SIZE_BIG - ((_currentLine + 1) * COORDS_XY_STEP); - y = MAXIMUM_TILE_START_XY; - dx = 0; - dy = -COORDS_XY_STEP; - break; - case 3: - x = 0; - y = MAXIMUM_MAP_SIZE_BIG - ((_currentLine + 1) * COORDS_XY_STEP); - dx = COORDS_XY_STEP; - dy = 0; - break; - } - - for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) - { - if (!MapIsEdge({ x, y })) + else if (!WidgetIsActiveTool(*this, WIDX_SET_LAND_RIGHTS)) { - uint16_t colour = 0; - switch (selected_tab) - { - case PAGE_PEEPS: - colour = GetPixelColourPeep({ x, y }); - break; - case PAGE_RIDES: - colour = GetPixelColourRide({ x, y }); - break; - } - destination[0] = (colour >> 8) & 0xFF; - destination[1] = colour; + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_SPINNER_Y].top + 1 }, STR_MAP_SIZE, {}, + { colours[1] }); } - x += dx; - y += dy; - - destinationPosition.x++; - destinationPosition.y++; - destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; } - _currentLine++; - if (_currentLine >= MAXIMUM_MAP_SIZE_TECHNICAL) + + void OnLanguageChange() override + { + CalculateTextLayout(); + } + + void ResetMap() + { + InitMap(); + CentreMapOnViewPoint(); + } + + private: + void InitMap() + { + std::fill(_mapImageData.begin(), _mapImageData.end(), PALETTE_INDEX_10); _currentLine = 0; - } - - uint16_t GetPixelColourPeep(const CoordsXY& c) - { - auto* surfaceElement = MapGetSurfaceElementAt(c); - if (surfaceElement == nullptr) - return 0; - - uint16_t colour = MapColour(PALETTE_INDEX_0); - const auto* surfaceObject = surfaceElement->GetSurfaceObject(); - if (surfaceObject != nullptr) - colour = MapColour2(surfaceObject->MapColours[0], surfaceObject->MapColours[1]); - - if (surfaceElement->GetWaterHeight() > 0) - colour = WaterColour; - - if (!(surfaceElement->GetOwnership() & OWNERSHIP_OWNED)) - colour = MapColourUnowned(colour); - - const int32_t maxSupportedTileElementType = static_cast(std::size(ElementTypeAddColour)); - auto tileElement = reinterpret_cast(surfaceElement); - while (!(tileElement++)->IsLastForTile()) - { - if (tileElement->IsGhost()) - { - colour = MapColour(PALETTE_INDEX_21); - break; - } - - auto tileElementType = tileElement->GetType(); - if (EnumValue(tileElementType) >= maxSupportedTileElementType) - { - tileElementType = TileElementType::Surface; - } - colour &= ElementTypeMaskColour[EnumValue(tileElementType)]; - colour |= ElementTypeAddColour[EnumValue(tileElementType)]; } - return colour; - } - - uint16_t GetPixelColourRide(const CoordsXY& c) - { - uint16_t colourA = 0; // highlight colour - uint16_t colourB = MapColour(PALETTE_INDEX_13); // surface colour (dark grey) - - // as an improvement we could use first_element to show underground stuff? - TileElement* tileElement = reinterpret_cast(MapGetSurfaceElementAt(c)); - do + void CentreMapOnViewPoint() { - if (tileElement == nullptr) - break; + WindowBase* mainWindow = WindowGetMain(); + int16_t ax, bx, cx, dx; + int16_t bp, di; - if (tileElement->IsGhost()) + if (mainWindow == nullptr || mainWindow->viewport == nullptr) + return; + + auto offset = MiniMapOffsets[GetCurrentRotation()]; + + // calculate centre view point of viewport and transform it to minimap coordinates + + cx = ((mainWindow->viewport->view_width >> 1) + mainWindow->viewport->viewPos.x) >> 5; + dx = ((mainWindow->viewport->view_height >> 1) + mainWindow->viewport->viewPos.y) >> 4; + cx += offset.x; + dx += offset.y; + + // calculate width and height of minimap + + ax = widgets[WIDX_MAP].width() - 11; + bx = widgets[WIDX_MAP].height() - 11; + bp = ax; + di = bx; + + ax >>= 1; + bx >>= 1; + cx = std::max(cx - ax, 0); + dx = std::max(dx - bx, 0); + + bp = scrolls[0].h_right - bp; + di = scrolls[0].v_bottom - di; + + if (bp < 0 && (bp - cx) < 0) + cx = 0; + + if (di < 0 && (di - dx) < 0) + dx = 0; + + scrolls[0].h_left = cx; + scrolls[0].v_top = dx; + WidgetScrollUpdateThumbs(*this, WIDX_MAP); + } + + void IncreaseMapSize() + { + auto newMapSize = GetGameState().MapSize; + if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::Y) + newMapSize.y++; + if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X) + newMapSize.x++; + + auto increaseMapSizeAction = MapChangeSizeAction(newMapSize); + GameActions::Execute(&increaseMapSizeAction); + } + + void DecreaseMapSize() + { + auto newMapSize = GetGameState().MapSize; + if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::Y) + newMapSize.y--; + if (IsWidgetPressed(WIDX_MAP_SIZE_LINK) || _resizeDirection == ResizeDirection::X) + newMapSize.x--; + + auto decreaseMapSizeAction = MapChangeSizeAction(newMapSize); + GameActions::Execute(&decreaseMapSizeAction); + } + + void SetMapPixels() + { + int32_t x = 0, y = 0, dx = 0, dy = 0; + + int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1; + auto destinationPosition = ScreenCoordsXY{ pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE }; + auto destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; + switch (GetCurrentRotation()) { - colourA = MapColour(PALETTE_INDEX_21); - break; + case 0: + x = _currentLine * COORDS_XY_STEP; + y = 0; + dx = 0; + dy = COORDS_XY_STEP; + break; + case 1: + x = MAXIMUM_TILE_START_XY; + y = _currentLine * COORDS_XY_STEP; + dx = -COORDS_XY_STEP; + dy = 0; + break; + case 2: + x = MAXIMUM_MAP_SIZE_BIG - ((_currentLine + 1) * COORDS_XY_STEP); + y = MAXIMUM_TILE_START_XY; + dx = 0; + dy = -COORDS_XY_STEP; + break; + case 3: + x = 0; + y = MAXIMUM_MAP_SIZE_BIG - ((_currentLine + 1) * COORDS_XY_STEP); + dx = COORDS_XY_STEP; + dy = 0; + break; } - switch (tileElement->GetType()) + for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) { - case TileElementType::Surface: - if (tileElement->AsSurface()->GetWaterHeight() > 0) - // Why is this a different water colour as above (195)? - colourB = MapColour(PALETTE_INDEX_194); - if (!(tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED)) - colourB = MapColourUnowned(colourB); - break; - case TileElementType::Path: - colourA = MapColour(PALETTE_INDEX_14); // lighter grey - break; - case TileElementType::Entrance: + if (!MapIsEdge({ x, y })) { - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) + uint16_t colour = 0; + switch (selected_tab) + { + case PAGE_PEEPS: + colour = GetPixelColourPeep({ x, y }); + break; + case PAGE_RIDES: + colour = GetPixelColourRide({ x, y }); + break; + } + destination[0] = (colour >> 8) & 0xFF; + destination[1] = colour; + } + x += dx; + y += dy; + + destinationPosition.x++; + destinationPosition.y++; + destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; + } + _currentLine++; + if (_currentLine >= MAXIMUM_MAP_SIZE_TECHNICAL) + _currentLine = 0; + } + + uint16_t GetPixelColourPeep(const CoordsXY& c) + { + auto* surfaceElement = MapGetSurfaceElementAt(c); + if (surfaceElement == nullptr) + return 0; + + uint16_t colour = MapColour(PALETTE_INDEX_0); + const auto* surfaceObject = surfaceElement->GetSurfaceObject(); + if (surfaceObject != nullptr) + colour = MapColour2(surfaceObject->MapColours[0], surfaceObject->MapColours[1]); + + if (surfaceElement->GetWaterHeight() > 0) + colour = WaterColour; + + if (!(surfaceElement->GetOwnership() & OWNERSHIP_OWNED)) + colour = MapColourUnowned(colour); + + const int32_t maxSupportedTileElementType = static_cast(std::size(ElementTypeAddColour)); + auto tileElement = reinterpret_cast(surfaceElement); + while (!(tileElement++)->IsLastForTile()) + { + if (tileElement->IsGhost()) + { + colour = MapColour(PALETTE_INDEX_21); + break; + } + + auto tileElementType = tileElement->GetType(); + if (EnumValue(tileElementType) >= maxSupportedTileElementType) + { + tileElementType = TileElementType::Surface; + } + colour &= ElementTypeMaskColour[EnumValue(tileElementType)]; + colour |= ElementTypeAddColour[EnumValue(tileElementType)]; + } + + return colour; + } + + uint16_t GetPixelColourRide(const CoordsXY& c) + { + uint16_t colourA = 0; // highlight colour + uint16_t colourB = MapColour(PALETTE_INDEX_13); // surface colour (dark grey) + + // as an improvement we could use first_element to show underground stuff? + TileElement* tileElement = reinterpret_cast(MapGetSurfaceElementAt(c)); + do + { + if (tileElement == nullptr) + break; + + if (tileElement->IsGhost()) + { + colourA = MapColour(PALETTE_INDEX_21); + break; + } + + switch (tileElement->GetType()) + { + case TileElementType::Surface: + if (tileElement->AsSurface()->GetWaterHeight() > 0) + // Why is this a different water colour as above (195)? + colourB = MapColour(PALETTE_INDEX_194); + if (!(tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED)) + colourB = MapColourUnowned(colourB); break; - Ride* targetRide = GetRide(tileElement->AsEntrance()->GetRideIndex()); - if (targetRide != nullptr) + case TileElementType::Path: + colourA = MapColour(PALETTE_INDEX_14); // lighter grey + break; + case TileElementType::Entrance: { - const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; - colourA = RideKeyColours[EnumValue(colourKey)]; + if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) + break; + Ride* targetRide = GetRide(tileElement->AsEntrance()->GetRideIndex()); + if (targetRide != nullptr) + { + const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; + colourA = RideKeyColours[EnumValue(colourKey)]; + } + break; } - break; + case TileElementType::Track: + { + Ride* targetRide = GetRide(tileElement->AsTrack()->GetRideIndex()); + if (targetRide != nullptr) + { + const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; + colourA = RideKeyColours[EnumValue(colourKey)]; + } + + break; + } + default: + break; } - case TileElementType::Track: + } while (!(tileElement++)->IsLastForTile()); + + if (colourA != 0) + return colourA; + + return colourB; + } + + void PaintPeepOverlay(DrawPixelInfo& dpi) + { + auto flashColour = GetGuestFlashColour(); + for (auto guest : EntityList()) + { + DrawMapPeepPixel(guest, flashColour, dpi); + } + flashColour = GetStaffFlashColour(); + for (auto staff : EntityList()) + { + DrawMapPeepPixel(staff, flashColour, dpi); + } + } + + void DrawMapPeepPixel(Peep* peep, const uint8_t flashColour, DrawPixelInfo& dpi) + { + if (peep->x == LOCATION_NULL) + return; + + MapCoordsXY c = TransformToMapCoords({ peep->x, peep->y }); + auto leftTop = ScreenCoordsXY{ c.x, c.y }; + auto rightBottom = leftTop; + uint8_t colour = DefaultPeepMapColour; + if (EntityGetFlashing(peep)) + { + colour = flashColour; + // If flashing then map peep pixel size is increased (by moving left top downwards) + if (flashColour != DefaultPeepMapColour) { - Ride* targetRide = GetRide(tileElement->AsTrack()->GetRideIndex()); - if (targetRide != nullptr) - { - const auto& colourKey = targetRide->GetRideTypeDescriptor().ColourKey; - colourA = RideKeyColours[EnumValue(colourKey)]; - } - - break; + leftTop.x--; } - default: + } + + GfxFillRect(dpi, { leftTop, rightBottom }, colour); + } + + static uint8_t GetGuestFlashColour() + { + uint8_t colour = DefaultPeepMapColour; + if ((gWindowMapFlashingFlags & MapFlashingFlags::FlashGuests) != 0) + { + colour = GuestMapColour; + if ((gWindowMapFlashingFlags & MapFlashingFlags::SwitchColour) == 0) + colour = GuestMapColourAlternate; + } + return colour; + } + + static uint8_t GetStaffFlashColour() + { + uint8_t colour = DefaultPeepMapColour; + if ((gWindowMapFlashingFlags & MapFlashingFlags::FlashStaff) != 0) + { + colour = StaffMapColour; + if ((gWindowMapFlashingFlags & MapFlashingFlags::SwitchColour) == 0) + colour = StaffMapColourAlternate; + } + return colour; + } + + void PaintTrainOverlay(DrawPixelInfo& dpi) + { + for (auto train : TrainManager::View()) + { + for (Vehicle* vehicle = train; vehicle != nullptr; vehicle = GetEntity(vehicle->next_vehicle_on_train)) + { + if (vehicle->x == LOCATION_NULL) + continue; + + MapCoordsXY c = TransformToMapCoords({ vehicle->x, vehicle->y }); + + GfxFillRect(dpi, { { c.x, c.y }, { c.x, c.y } }, PALETTE_INDEX_171); + } + } + } + + /** + * The call to GfxFillRect was originally wrapped in Sub68DABD which made sure that arguments were ordered correctly, + * but it doesn't look like it's ever necessary here so the call was removed. + */ + void PaintHudRectangle(DrawPixelInfo& dpi) + { + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow == nullptr) + return; + + Viewport* mainViewport = mainWindow->viewport; + if (mainViewport == nullptr) + return; + + auto offset = MiniMapOffsets[GetCurrentRotation()]; + auto leftTop = ScreenCoordsXY{ (mainViewport->viewPos.x >> 5) + offset.x, + (mainViewport->viewPos.y >> 4) + offset.y }; + auto rightBottom = ScreenCoordsXY{ ((mainViewport->viewPos.x + mainViewport->view_width) >> 5) + offset.x, + ((mainViewport->viewPos.y + mainViewport->view_height) >> 4) + offset.y }; + auto rightTop = ScreenCoordsXY{ rightBottom.x, leftTop.y }; + auto leftBottom = ScreenCoordsXY{ leftTop.x, rightBottom.y }; + + // top horizontal lines + GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56); + GfxFillRect(dpi, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PALETTE_INDEX_56); + + // left vertical lines + GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56); + GfxFillRect(dpi, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PALETTE_INDEX_56); + + // bottom horizontal lines + GfxFillRect(dpi, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56); + GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PALETTE_INDEX_56); + + // right vertical lines + GfxFillRect(dpi, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56); + GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PALETTE_INDEX_56); + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + // Guest tab image (animated) + uint32_t guestTabImage = SPR_TAB_GUESTS_0; + if (selected_tab == PAGE_PEEPS) + guestTabImage += list_information_type / 4; + + GfxDrawSprite( + dpi, ImageId(guestTabImage), + windowPos + ScreenCoordsXY{ widgets[WIDX_PEOPLE_TAB].left, widgets[WIDX_PEOPLE_TAB].top }); + + // Ride/stall tab image (animated) + uint32_t rideTabImage = SPR_TAB_RIDE_0; + if (selected_tab == PAGE_RIDES) + rideTabImage += list_information_type / 4; + + GfxDrawSprite( + dpi, ImageId(rideTabImage), + windowPos + ScreenCoordsXY{ widgets[WIDX_RIDES_TAB].left, widgets[WIDX_RIDES_TAB].top }); + } + + void ShowDefaultScenarioEditorButtons() + { + widgets[WIDX_BUILD_PARK_ENTRANCE].type = WindowWidgetType::FlatBtn; + widgets[WIDX_PEOPLE_STARTING_POSITION].type = WindowWidgetType::FlatBtn; + widgets[WIDX_MAP_SIZE_SPINNER_Y].type = WindowWidgetType::Spinner; + widgets[WIDX_MAP_SIZE_SPINNER_Y_UP].type = WindowWidgetType::Button; + widgets[WIDX_MAP_SIZE_SPINNER_Y_DOWN].type = WindowWidgetType::Button; + widgets[WIDX_MAP_SIZE_LINK].type = WindowWidgetType::FlatBtn; + widgets[WIDX_MAP_SIZE_SPINNER_X].type = WindowWidgetType::Spinner; + widgets[WIDX_MAP_SIZE_SPINNER_X_UP].type = WindowWidgetType::Button; + widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].type = WindowWidgetType::Button; + + // Only show this in the scenario editor, even when in sandbox mode. + if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + widgets[WIDX_MAP_GENERATOR].type = WindowWidgetType::Button; + + // Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use + auto& gameState = GetGameState(); + auto ft = Formatter::Common(); + ft.Add(gameState.MapSize.y - 2); + ft.Add(gameState.MapSize.x - 2); + } + + void InputLandSize() + { + Formatter ft; + ft.Add(kLandToolMinimumSize); + ft.Add(kLandToolMaximumSize); + TextInputOpen(WIDX_LAND_TOOL, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); + } + + void InputMapSize(WidgetIndex callingWidget) + { + if (IsWidgetPressed(WIDX_MAP_SIZE_LINK)) + _resizeDirection = ResizeDirection::Both; + else + _resizeDirection = (callingWidget == WIDX_MAP_SIZE_SPINNER_Y) ? ResizeDirection::Y : ResizeDirection::X; + + Formatter ft; + ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); + ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); + TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_NONE, STR_NONE, 4); + } + + CoordsXY ScreenToMap(ScreenCoordsXY screenCoords) + { + screenCoords.x = ((screenCoords.x + 8) - MAXIMUM_MAP_SIZE_TECHNICAL) / 2; + screenCoords.y = ((screenCoords.y + 8)) / 2; + auto location = TileCoordsXY(screenCoords.y - screenCoords.x, screenCoords.x + screenCoords.y).ToCoordsXY(); + + switch (GetCurrentRotation()) + { + case 0: + return location; + case 1: + return { MAXIMUM_MAP_SIZE_BIG - 1 - location.y, location.x }; + case 2: + return { MAXIMUM_MAP_SIZE_BIG - 1 - location.x, MAXIMUM_MAP_SIZE_BIG - 1 - location.y }; + case 3: + return { location.y, MAXIMUM_MAP_SIZE_BIG - 1 - location.x }; + } + + return { 0, 0 }; // unreachable + } + + MapCoordsXY TransformToMapCoords(CoordsXY c) + { + int32_t x = c.x, y = c.y; + + switch (GetCurrentRotation()) + { + case 3: + std::swap(x, y); + x = MAXIMUM_MAP_SIZE_BIG - 1 - x; + break; + case 2: + x = MAXIMUM_MAP_SIZE_BIG - 1 - x; + y = MAXIMUM_MAP_SIZE_BIG - 1 - y; + break; + case 1: + std::swap(x, y); + y = MAXIMUM_MAP_SIZE_BIG - 1 - y; + break; + case 0: break; } - } while (!(tileElement++)->IsLastForTile()); + x /= 32; + y /= 32; - if (colourA != 0) - return colourA; - - return colourB; - } - - void PaintPeepOverlay(DrawPixelInfo& dpi) - { - auto flashColour = GetGuestFlashColour(); - for (auto guest : EntityList()) - { - DrawMapPeepPixel(guest, flashColour, dpi); + return { -x + y + MAXIMUM_MAP_SIZE_TECHNICAL - 8, x + y - 8 }; } - flashColour = GetStaffFlashColour(); - for (auto staff : EntityList()) + + void ResizeMap() { - DrawMapPeepPixel(staff, flashColour, dpi); + widgets[WIDX_MAP].right = width - 4; + + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) + widgets[WIDX_MAP].bottom = height - 1 - 72; + else if (selected_tab == PAGE_RIDES) + widgets[WIDX_MAP].bottom = height - 1 - (4 * LIST_ROW_HEIGHT + 4); + else + widgets[WIDX_MAP].bottom = height - 1 - 14; } - } - void DrawMapPeepPixel(Peep* peep, const uint8_t flashColour, DrawPixelInfo& dpi) - { - if (peep->x == LOCATION_NULL) - return; - - MapCoordsXY c = TransformToMapCoords({ peep->x, peep->y }); - auto leftTop = ScreenCoordsXY{ c.x, c.y }; - auto rightBottom = leftTop; - uint8_t colour = DefaultPeepMapColour; - if (EntityGetFlashing(peep)) + void CalculateTextLayout() { - colour = flashColour; - // If flashing then map peep pixel size is increased (by moving left top downwards) - if (flashColour != DefaultPeepMapColour) + int32_t textOffset = 4 + LIST_ROW_HEIGHT; + _firstColumnWidth = 118; + for (uint32_t i = 0; i < 4; i++) { - leftTop.x--; + const auto* labelStr = LanguageGetString(MapLabels[i]); + _firstColumnWidth = std::max(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium), _firstColumnWidth); } - } - GfxFillRect(dpi, { leftTop, rightBottom }, colour); - } - - static uint8_t GetGuestFlashColour() - { - uint8_t colour = DefaultPeepMapColour; - if ((gWindowMapFlashingFlags & MapFlashingFlags::FlashGuests) != 0) - { - colour = GuestMapColour; - if ((gWindowMapFlashingFlags & MapFlashingFlags::SwitchColour) == 0) - colour = GuestMapColourAlternate; - } - return colour; - } - - static uint8_t GetStaffFlashColour() - { - uint8_t colour = DefaultPeepMapColour; - if ((gWindowMapFlashingFlags & MapFlashingFlags::FlashStaff) != 0) - { - colour = StaffMapColour; - if ((gWindowMapFlashingFlags & MapFlashingFlags::SwitchColour) == 0) - colour = StaffMapColourAlternate; - } - return colour; - } - - void PaintTrainOverlay(DrawPixelInfo& dpi) - { - for (auto train : TrainManager::View()) - { - for (Vehicle* vehicle = train; vehicle != nullptr; vehicle = GetEntity(vehicle->next_vehicle_on_train)) + textOffset += _firstColumnWidth + 4; + min_width = WW; + for (uint32_t i = 4; i < std::size(MapLabels); i++) { - if (vehicle->x == LOCATION_NULL) - continue; - - MapCoordsXY c = TransformToMapCoords({ vehicle->x, vehicle->y }); - - GfxFillRect(dpi, { { c.x, c.y }, { c.x, c.y } }, PALETTE_INDEX_171); + const auto* labelStr = LanguageGetString(MapLabels[i]); + min_width = std::max( + static_cast(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium)), min_width); } + width = std::max(min_width, width); + _recalculateScrollbars = true; + } + }; + + WindowBase* WindowMapOpen() + { + try + { + WindowBase* w = WindowFocusOrCreate(WindowClass::Map, 245, 259, WF_10); + w->selected_tab = 0; + w->list_information_type = 0; + return w; + } + catch (const std::bad_alloc&) + { + return nullptr; } } - /** - * The call to GfxFillRect was originally wrapped in Sub68DABD which made sure that arguments were ordered correctly, - * but it doesn't look like it's ever necessary here so the call was removed. - */ - void PaintHudRectangle(DrawPixelInfo& dpi) + void WindowMapReset() { - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow == nullptr) + WindowBase* w; + + // Check if window is even opened + w = WindowBringToFrontByClass(WindowClass::Map); + if (w == nullptr) + { return; - - Viewport* mainViewport = mainWindow->viewport; - if (mainViewport == nullptr) - return; - - auto offset = MiniMapOffsets[GetCurrentRotation()]; - auto leftTop = ScreenCoordsXY{ (mainViewport->viewPos.x >> 5) + offset.x, (mainViewport->viewPos.y >> 4) + offset.y }; - auto rightBottom = ScreenCoordsXY{ ((mainViewport->viewPos.x + mainViewport->view_width) >> 5) + offset.x, - ((mainViewport->viewPos.y + mainViewport->view_height) >> 4) + offset.y }; - auto rightTop = ScreenCoordsXY{ rightBottom.x, leftTop.y }; - auto leftBottom = ScreenCoordsXY{ leftTop.x, rightBottom.y }; - - // top horizontal lines - GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56); - GfxFillRect(dpi, { rightTop - ScreenCoordsXY{ 3, 0 }, rightTop }, PALETTE_INDEX_56); - - // left vertical lines - GfxFillRect(dpi, { leftTop, leftTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56); - GfxFillRect(dpi, { leftBottom - ScreenCoordsXY{ 0, 3 }, leftBottom }, PALETTE_INDEX_56); - - // bottom horizontal lines - GfxFillRect(dpi, { leftBottom, leftBottom + ScreenCoordsXY{ 3, 0 } }, PALETTE_INDEX_56); - GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 3, 0 }, rightBottom }, PALETTE_INDEX_56); - - // right vertical lines - GfxFillRect(dpi, { rightTop, rightTop + ScreenCoordsXY{ 0, 3 } }, PALETTE_INDEX_56); - GfxFillRect(dpi, { rightBottom - ScreenCoordsXY{ 0, 3 }, rightBottom }, PALETTE_INDEX_56); - } - - void DrawTabImages(DrawPixelInfo& dpi) - { - // Guest tab image (animated) - uint32_t guestTabImage = SPR_TAB_GUESTS_0; - if (selected_tab == PAGE_PEEPS) - guestTabImage += list_information_type / 4; - - GfxDrawSprite( - dpi, ImageId(guestTabImage), - windowPos + ScreenCoordsXY{ widgets[WIDX_PEOPLE_TAB].left, widgets[WIDX_PEOPLE_TAB].top }); - - // Ride/stall tab image (animated) - uint32_t rideTabImage = SPR_TAB_RIDE_0; - if (selected_tab == PAGE_RIDES) - rideTabImage += list_information_type / 4; - - GfxDrawSprite( - dpi, ImageId(rideTabImage), - windowPos + ScreenCoordsXY{ widgets[WIDX_RIDES_TAB].left, widgets[WIDX_RIDES_TAB].top }); - } - - void ShowDefaultScenarioEditorButtons() - { - widgets[WIDX_BUILD_PARK_ENTRANCE].type = WindowWidgetType::FlatBtn; - widgets[WIDX_PEOPLE_STARTING_POSITION].type = WindowWidgetType::FlatBtn; - widgets[WIDX_MAP_SIZE_SPINNER_Y].type = WindowWidgetType::Spinner; - widgets[WIDX_MAP_SIZE_SPINNER_Y_UP].type = WindowWidgetType::Button; - widgets[WIDX_MAP_SIZE_SPINNER_Y_DOWN].type = WindowWidgetType::Button; - widgets[WIDX_MAP_SIZE_LINK].type = WindowWidgetType::FlatBtn; - widgets[WIDX_MAP_SIZE_SPINNER_X].type = WindowWidgetType::Spinner; - widgets[WIDX_MAP_SIZE_SPINNER_X_UP].type = WindowWidgetType::Button; - widgets[WIDX_MAP_SIZE_SPINNER_X_DOWN].type = WindowWidgetType::Button; - - // Only show this in the scenario editor, even when in sandbox mode. - if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - widgets[WIDX_MAP_GENERATOR].type = WindowWidgetType::Button; - - // Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use - auto& gameState = GetGameState(); - auto ft = Formatter::Common(); - ft.Add(gameState.MapSize.y - 2); - ft.Add(gameState.MapSize.x - 2); - } - - void InputLandSize() - { - Formatter ft; - ft.Add(kLandToolMinimumSize); - ft.Add(kLandToolMaximumSize); - TextInputOpen(WIDX_LAND_TOOL, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, 3); - } - - void InputMapSize(WidgetIndex callingWidget) - { - if (IsWidgetPressed(WIDX_MAP_SIZE_LINK)) - _resizeDirection = ResizeDirection::Both; - else - _resizeDirection = (callingWidget == WIDX_MAP_SIZE_SPINNER_Y) ? ResizeDirection::Y : ResizeDirection::X; - - Formatter ft; - ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); - ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); - TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_NONE, STR_NONE, 4); - } - - CoordsXY ScreenToMap(ScreenCoordsXY screenCoords) - { - screenCoords.x = ((screenCoords.x + 8) - MAXIMUM_MAP_SIZE_TECHNICAL) / 2; - screenCoords.y = ((screenCoords.y + 8)) / 2; - auto location = TileCoordsXY(screenCoords.y - screenCoords.x, screenCoords.x + screenCoords.y).ToCoordsXY(); - - switch (GetCurrentRotation()) - { - case 0: - return location; - case 1: - return { MAXIMUM_MAP_SIZE_BIG - 1 - location.y, location.x }; - case 2: - return { MAXIMUM_MAP_SIZE_BIG - 1 - location.x, MAXIMUM_MAP_SIZE_BIG - 1 - location.y }; - case 3: - return { location.y, MAXIMUM_MAP_SIZE_BIG - 1 - location.x }; } - return { 0, 0 }; // unreachable + auto* mapWindow = static_cast(w); + mapWindow->ResetMap(); } - - MapCoordsXY TransformToMapCoords(CoordsXY c) - { - int32_t x = c.x, y = c.y; - - switch (GetCurrentRotation()) - { - case 3: - std::swap(x, y); - x = MAXIMUM_MAP_SIZE_BIG - 1 - x; - break; - case 2: - x = MAXIMUM_MAP_SIZE_BIG - 1 - x; - y = MAXIMUM_MAP_SIZE_BIG - 1 - y; - break; - case 1: - std::swap(x, y); - y = MAXIMUM_MAP_SIZE_BIG - 1 - y; - break; - case 0: - break; - } - x /= 32; - y /= 32; - - return { -x + y + MAXIMUM_MAP_SIZE_TECHNICAL - 8, x + y - 8 }; - } - - void ResizeMap() - { - widgets[WIDX_MAP].right = width - 4; - - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) - widgets[WIDX_MAP].bottom = height - 1 - 72; - else if (selected_tab == PAGE_RIDES) - widgets[WIDX_MAP].bottom = height - 1 - (4 * LIST_ROW_HEIGHT + 4); - else - widgets[WIDX_MAP].bottom = height - 1 - 14; - } - - void CalculateTextLayout() - { - int32_t textOffset = 4 + LIST_ROW_HEIGHT; - _firstColumnWidth = 118; - for (uint32_t i = 0; i < 4; i++) - { - const auto* labelStr = LanguageGetString(MapLabels[i]); - _firstColumnWidth = std::max(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium), _firstColumnWidth); - } - - textOffset += _firstColumnWidth + 4; - min_width = WW; - for (uint32_t i = 4; i < std::size(MapLabels); i++) - { - const auto* labelStr = LanguageGetString(MapLabels[i]); - min_width = std::max(static_cast(textOffset + GfxGetStringWidth(labelStr, FontStyle::Medium)), min_width); - } - width = std::max(min_width, width); - _recalculateScrollbars = true; - } -}; - -WindowBase* WindowMapOpen() -{ - try - { - WindowBase* w = WindowFocusOrCreate(WindowClass::Map, 245, 259, WF_10); - w->selected_tab = 0; - w->list_information_type = 0; - return w; - } - catch (const std::bad_alloc&) - { - return nullptr; - } -} - -void WindowMapReset() -{ - WindowBase* w; - - // Check if window is even opened - w = WindowBringToFrontByClass(WindowClass::Map); - if (w == nullptr) - { - return; - } - - auto* mapWindow = static_cast(w); - mapWindow->ResetMap(); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index f8bae95d8e..0c99fc1f98 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -25,105 +25,105 @@ #include #include -using namespace OpenRCT2; - -enum +namespace OpenRCT2::Ui::Windows { - WINDOW_MAPGEN_PAGE_BASE, - WINDOW_MAPGEN_PAGE_RANDOM, - WINDOW_MAPGEN_PAGE_SIMPLEX, - WINDOW_MAPGEN_PAGE_HEIGHTMAP, - WINDOW_MAPGEN_PAGE_COUNT -}; + enum + { + WINDOW_MAPGEN_PAGE_BASE, + WINDOW_MAPGEN_PAGE_RANDOM, + WINDOW_MAPGEN_PAGE_SIMPLEX, + WINDOW_MAPGEN_PAGE_HEIGHTMAP, + WINDOW_MAPGEN_PAGE_COUNT + }; -enum -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PAGE_BACKGROUND, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_TAB_4, + enum + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PAGE_BACKGROUND, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_TAB_4, - TAB_BEGIN, + TAB_BEGIN, - WIDX_MAP_GENERATE = TAB_BEGIN, - WIDX_MAP_SIZE_Y, - WIDX_MAP_SIZE_Y_UP, - WIDX_MAP_SIZE_Y_DOWN, - WIDX_MAP_SIZE_LINK, - WIDX_MAP_SIZE_X, - WIDX_MAP_SIZE_X_UP, - WIDX_MAP_SIZE_X_DOWN, - WIDX_BASE_HEIGHT, - WIDX_BASE_HEIGHT_UP, - WIDX_BASE_HEIGHT_DOWN, - WIDX_WATER_LEVEL, - WIDX_WATER_LEVEL_UP, - WIDX_WATER_LEVEL_DOWN, - WIDX_FLOOR_TEXTURE, - WIDX_WALL_TEXTURE, + WIDX_MAP_GENERATE = TAB_BEGIN, + WIDX_MAP_SIZE_Y, + WIDX_MAP_SIZE_Y_UP, + WIDX_MAP_SIZE_Y_DOWN, + WIDX_MAP_SIZE_LINK, + WIDX_MAP_SIZE_X, + WIDX_MAP_SIZE_X_UP, + WIDX_MAP_SIZE_X_DOWN, + WIDX_BASE_HEIGHT, + WIDX_BASE_HEIGHT_UP, + WIDX_BASE_HEIGHT_DOWN, + WIDX_WATER_LEVEL, + WIDX_WATER_LEVEL_UP, + WIDX_WATER_LEVEL_DOWN, + WIDX_FLOOR_TEXTURE, + WIDX_WALL_TEXTURE, - WIDX_RANDOM_GENERATE = TAB_BEGIN, - WIDX_RANDOM_TERRAIN, - WIDX_RANDOM_PLACE_TREES, + WIDX_RANDOM_GENERATE = TAB_BEGIN, + WIDX_RANDOM_TERRAIN, + WIDX_RANDOM_PLACE_TREES, - WIDX_SIMPLEX_GENERATE = TAB_BEGIN, - WIDX_SIMPLEX_LABEL, - WIDX_SIMPLEX_LOW, - WIDX_SIMPLEX_LOW_UP, - WIDX_SIMPLEX_LOW_DOWN, - WIDX_SIMPLEX_HIGH, - WIDX_SIMPLEX_HIGH_UP, - WIDX_SIMPLEX_HIGH_DOWN, - WIDX_SIMPLEX_BASE_FREQ, - WIDX_SIMPLEX_BASE_FREQ_UP, - WIDX_SIMPLEX_BASE_FREQ_DOWN, - WIDX_SIMPLEX_OCTAVES, - WIDX_SIMPLEX_OCTAVES_UP, - WIDX_SIMPLEX_OCTAVES_DOWN, - WIDX_SIMPLEX_MAP_SIZE_Y, - WIDX_SIMPLEX_MAP_SIZE_Y_UP, - WIDX_SIMPLEX_MAP_SIZE_Y_DOWN, - WIDX_SIMPLEX_MAP_SIZE_LINK, - WIDX_SIMPLEX_MAP_SIZE_X, - WIDX_SIMPLEX_MAP_SIZE_X_UP, - WIDX_SIMPLEX_MAP_SIZE_X_DOWN, - WIDX_SIMPLEX_WATER_LEVEL, - WIDX_SIMPLEX_WATER_LEVEL_UP, - WIDX_SIMPLEX_WATER_LEVEL_DOWN, - WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX, - WIDX_SIMPLEX_FLOOR_TEXTURE, - WIDX_SIMPLEX_WALL_TEXTURE, - WIDX_SIMPLEX_PLACE_TREES_CHECKBOX, + WIDX_SIMPLEX_GENERATE = TAB_BEGIN, + WIDX_SIMPLEX_LABEL, + WIDX_SIMPLEX_LOW, + WIDX_SIMPLEX_LOW_UP, + WIDX_SIMPLEX_LOW_DOWN, + WIDX_SIMPLEX_HIGH, + WIDX_SIMPLEX_HIGH_UP, + WIDX_SIMPLEX_HIGH_DOWN, + WIDX_SIMPLEX_BASE_FREQ, + WIDX_SIMPLEX_BASE_FREQ_UP, + WIDX_SIMPLEX_BASE_FREQ_DOWN, + WIDX_SIMPLEX_OCTAVES, + WIDX_SIMPLEX_OCTAVES_UP, + WIDX_SIMPLEX_OCTAVES_DOWN, + WIDX_SIMPLEX_MAP_SIZE_Y, + WIDX_SIMPLEX_MAP_SIZE_Y_UP, + WIDX_SIMPLEX_MAP_SIZE_Y_DOWN, + WIDX_SIMPLEX_MAP_SIZE_LINK, + WIDX_SIMPLEX_MAP_SIZE_X, + WIDX_SIMPLEX_MAP_SIZE_X_UP, + WIDX_SIMPLEX_MAP_SIZE_X_DOWN, + WIDX_SIMPLEX_WATER_LEVEL, + WIDX_SIMPLEX_WATER_LEVEL_UP, + WIDX_SIMPLEX_WATER_LEVEL_DOWN, + WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX, + WIDX_SIMPLEX_FLOOR_TEXTURE, + WIDX_SIMPLEX_WALL_TEXTURE, + WIDX_SIMPLEX_PLACE_TREES_CHECKBOX, - WIDX_HEIGHTMAP_SELECT = TAB_BEGIN, - WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, - WIDX_HEIGHTMAP_STRENGTH, - WIDX_HEIGHTMAP_STRENGTH_UP, - WIDX_HEIGHTMAP_STRENGTH_DOWN, - WIDX_HEIGHTMAP_NORMALIZE, - WIDX_HEIGHTMAP_SMOOTH_TILES, - WIDX_HEIGHTMAP_LOW, - WIDX_HEIGHTMAP_LOW_UP, - WIDX_HEIGHTMAP_LOW_DOWN, - WIDX_HEIGHTMAP_HIGH, - WIDX_HEIGHTMAP_HIGH_UP, - WIDX_HEIGHTMAP_HIGH_DOWN, - WIDX_HEIGHTMAP_WATER_LEVEL, - WIDX_HEIGHTMAP_WATER_LEVEL_UP, - WIDX_HEIGHTMAP_WATER_LEVEL_DOWN, -}; + WIDX_HEIGHTMAP_SELECT = TAB_BEGIN, + WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, + WIDX_HEIGHTMAP_STRENGTH, + WIDX_HEIGHTMAP_STRENGTH_UP, + WIDX_HEIGHTMAP_STRENGTH_DOWN, + WIDX_HEIGHTMAP_NORMALIZE, + WIDX_HEIGHTMAP_SMOOTH_TILES, + WIDX_HEIGHTMAP_LOW, + WIDX_HEIGHTMAP_LOW_UP, + WIDX_HEIGHTMAP_LOW_DOWN, + WIDX_HEIGHTMAP_HIGH, + WIDX_HEIGHTMAP_HIGH_UP, + WIDX_HEIGHTMAP_HIGH_DOWN, + WIDX_HEIGHTMAP_WATER_LEVEL, + WIDX_HEIGHTMAP_WATER_LEVEL_UP, + WIDX_HEIGHTMAP_WATER_LEVEL_DOWN, + }; #pragma region Widgets -static constexpr StringId WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE; -static constexpr int32_t WW = 250; -static constexpr int32_t WH = 273; + static constexpr StringId WINDOW_TITLE = STR_MAPGEN_WINDOW_TITLE; + static constexpr int32_t WW = 250; + static constexpr int32_t WH = 273; -// clang-format off + // clang-format off #define SHARED_WIDGETS \ WINDOW_SHIM(WINDOW_TITLE, WW, WH), /* WIDX_BACKGROUND, WIDX_TITLE, WIDX_CLOSE */ \ MakeWidget({ 0, 43}, {WW, 229}, WindowWidgetType::Resize, WindowColour::Secondary), /* WIDX_PAGE_BACKGROUND */ \ @@ -184,20 +184,20 @@ static Widget HeightmapWidgets[] = { MakeSpinnerWidgets({104, 160}, { 95, 12}, WindowWidgetType::Spinner, WindowColour::Secondary ), // WIDX_HEIGHTMAP_WATER_LEVEL{,_UP,_DOWN} kWidgetsEnd, }; -// clang-format on + // clang-format on -static Widget* PageWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { - MapWidgets, - RandomWidgets, - SimplexWidgets, - HeightmapWidgets, -}; + static Widget* PageWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { + MapWidgets, + RandomWidgets, + SimplexWidgets, + HeightmapWidgets, + }; #pragma endregion #pragma region Widget flags -// clang-format off + // clang-format off static uint64_t PageDisabledWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { 0, @@ -265,1126 +265,1139 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { 0, (1uLL << WIDX_HEIGHTMAP_SMOOTH_TILES) }; -// clang-format on + // clang-format on #pragma endregion -static constexpr int32_t TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = { - 1, - 1, - 1, - 1, -}; -static constexpr int32_t TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = { - 1, - 1, - 1, - 1, -}; -static constexpr int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = { - 16, - 16, - 16, - 0, -}; -// clang-format on + static constexpr int32_t TabAnimationDivisor[WINDOW_MAPGEN_PAGE_COUNT] = { + 1, + 1, + 1, + 1, + }; + static constexpr int32_t TabAnimationFrames[WINDOW_MAPGEN_PAGE_COUNT] = { + 1, + 1, + 1, + 1, + }; + static constexpr int32_t TabAnimationLoops[WINDOW_MAPGEN_PAGE_COUNT] = { + 16, + 16, + 16, + 0, + }; + // clang-format on -constexpr int32_t BASESIZE_MIN = 0; -constexpr int32_t BASESIZE_MAX = 60; -constexpr int32_t WATERLEVEL_MIN = 0; -constexpr int32_t WATERLEVEL_MAX = 54; -constexpr int32_t MAX_SMOOTH_ITERATIONS = 20; + constexpr int32_t BASESIZE_MIN = 0; + constexpr int32_t BASESIZE_MAX = 60; + constexpr int32_t WATERLEVEL_MIN = 0; + constexpr int32_t WATERLEVEL_MAX = 54; + constexpr int32_t MAX_SMOOTH_ITERATIONS = 20; -enum class ResizeDirection -{ - Both, - X, - Y, -}; - -static void HeightmapLoadsaveCallback(int32_t result, const utf8* path); - -class MapGenWindow final : public Window -{ -private: - TileCoordsXY _mapSize{ 150, 150 }; - ResizeDirection _resizeDirection{ ResizeDirection::Both }; - bool _mapWidthAndHeightLinked{ true }; - int32_t _baseHeight = 12; - int32_t _waterLevel = 6; - int32_t _floorTexture = 0; - int32_t _wallTexture = 0; - bool _randomTerrain = true; - int32_t _placeTrees = 1; - - int32_t _simplex_low = 6; - int32_t _simplex_high = 10; - int32_t _simplex_base_freq = 60; - int32_t _simplex_octaves = 4; - - bool _heightmapLoaded = false; - bool _heightmapSmoothMap = false; - int32_t _heightmapSmoothStrength = 1; - bool _heightmapNormalize = false; - bool _heightmapSmoothTiles = true; - int32_t _heightmapLow = 2; - int32_t _heightmapHigh = 70; - - void SetPage(int32_t newPage) + enum class ResizeDirection { - page = newPage; - frame_no = 0; - RemoveViewport(); + Both, + X, + Y, + }; - hold_down_widgets = HoldDownWidgets[newPage]; - widgets = PageWidgets[newPage]; - disabled_widgets = PageDisabledWidgets[newPage]; - pressed_widgets = PressedWidgets[newPage]; + static void HeightmapLoadsaveCallback(int32_t result, const utf8* path); - // Enable heightmap widgets if one is loaded - if (newPage == WINDOW_MAPGEN_PAGE_HEIGHTMAP && _heightmapLoaded) + class MapGenWindow final : public Window + { + private: + TileCoordsXY _mapSize{ 150, 150 }; + ResizeDirection _resizeDirection{ ResizeDirection::Both }; + bool _mapWidthAndHeightLinked{ true }; + int32_t _baseHeight = 12; + int32_t _waterLevel = 6; + int32_t _floorTexture = 0; + int32_t _wallTexture = 0; + bool _randomTerrain = true; + int32_t _placeTrees = 1; + + int32_t _simplex_low = 6; + int32_t _simplex_high = 10; + int32_t _simplex_base_freq = 60; + int32_t _simplex_octaves = 4; + + bool _heightmapLoaded = false; + bool _heightmapSmoothMap = false; + int32_t _heightmapSmoothStrength = 1; + bool _heightmapNormalize = false; + bool _heightmapSmoothTiles = true; + int32_t _heightmapLow = 2; + int32_t _heightmapHigh = 70; + + void SetPage(int32_t newPage) { - SetWidgetEnabled(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH, _heightmapSmoothMap); - SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_UP, _heightmapSmoothMap); - SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_DOWN, _heightmapSmoothMap); - SetWidgetEnabled(WIDX_HEIGHTMAP_NORMALIZE, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_SMOOTH_TILES, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_HIGH, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_HIGH_UP, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_HIGH_DOWN, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_LOW, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_LOW_UP, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_LOW_DOWN, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_WATER_LEVEL, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_WATER_LEVEL_UP, true); - SetWidgetEnabled(WIDX_HEIGHTMAP_WATER_LEVEL_DOWN, true); - } + page = newPage; + frame_no = 0; + RemoveViewport(); - InitScrollWidgets(); - Invalidate(); - } + hold_down_widgets = HoldDownWidgets[newPage]; + widgets = PageWidgets[newPage]; + disabled_widgets = PageDisabledWidgets[newPage]; + pressed_widgets = PressedWidgets[newPage]; - void SetPressedTab() - { - int32_t i; - for (i = 0; i < WINDOW_MAPGEN_PAGE_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t newPage, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + newPage; - - if (!WidgetIsDisabled(*this, widgetIndex)) - { - if (page == newPage) + // Enable heightmap widgets if one is loaded + if (newPage == WINDOW_MAPGEN_PAGE_HEIGHTMAP && _heightmapLoaded) { - int32_t frame = frame_no / TabAnimationDivisor[page]; - spriteIndex += (frame % TabAnimationFrames[page]); + SetWidgetEnabled(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH, _heightmapSmoothMap); + SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_UP, _heightmapSmoothMap); + SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_DOWN, _heightmapSmoothMap); + SetWidgetEnabled(WIDX_HEIGHTMAP_NORMALIZE, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_SMOOTH_TILES, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_HIGH, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_HIGH_UP, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_HIGH_DOWN, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_LOW, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_LOW_UP, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_LOW_DOWN, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_WATER_LEVEL, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_WATER_LEVEL_UP, true); + SetWidgetEnabled(WIDX_HEIGHTMAP_WATER_LEVEL_DOWN, true); } - GfxDrawSprite( - dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + InitScrollWidgets(); + Invalidate(); } - } - void DrawTabImages(DrawPixelInfo& dpi) - { - DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_BASE, SPR_G2_TAB_LAND); - DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_RANDOM, SPR_G2_TAB_TREE); - DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_SIMPLEX, SPR_G2_TAB_PENCIL); - DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_HEIGHTMAP, SPR_TAB_GRAPH_0); - } - - void ChangeMapSize(int32_t sizeOffset) - { - if (_mapWidthAndHeightLinked) - _resizeDirection = ResizeDirection::Both; - - if (_resizeDirection != ResizeDirection::X) - _mapSize.y = std::clamp(_mapSize.y + sizeOffset, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); - if (_resizeDirection != ResizeDirection::Y) - _mapSize.x = std::clamp(_mapSize.x + sizeOffset, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); - } - - void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) - { - Formatter ft; - ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); - ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); - - // Practical map size is 2 lower than the technical map size - currentValue -= 2; - WindowTextInputOpen(this, callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_FORMAT_INTEGER, currentValue, 4); - } - - void SharedMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void SetPressedTab() { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - SetPage(widgetIndex - WIDX_TAB_1); - break; + int32_t i; + for (i = 0; i < WINDOW_MAPGEN_PAGE_COUNT; i++) + pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + } + + void DrawTabImage(DrawPixelInfo& dpi, int32_t newPage, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + newPage; + + if (!WidgetIsDisabled(*this, widgetIndex)) + { + if (page == newPage) + { + int32_t frame = frame_no / TabAnimationDivisor[page]; + spriteIndex += (frame % TabAnimationFrames[page]); + } + + GfxDrawSprite( + dpi, ImageId(spriteIndex), + windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + } + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_BASE, SPR_G2_TAB_LAND); + DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_RANDOM, SPR_G2_TAB_TREE); + DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_SIMPLEX, SPR_G2_TAB_PENCIL); + DrawTabImage(dpi, WINDOW_MAPGEN_PAGE_HEIGHTMAP, SPR_TAB_GRAPH_0); + } + + void ChangeMapSize(int32_t sizeOffset) + { + if (_mapWidthAndHeightLinked) + _resizeDirection = ResizeDirection::Both; + + if (_resizeDirection != ResizeDirection::X) + _mapSize.y = std::clamp(_mapSize.y + sizeOffset, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); + if (_resizeDirection != ResizeDirection::Y) + _mapSize.x = std::clamp(_mapSize.x + sizeOffset, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); + } + + void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) + { + Formatter ft; + ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); + ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); + + // Practical map size is 2 lower than the technical map size + currentValue -= 2; + WindowTextInputOpen( + this, callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_FORMAT_INTEGER, currentValue, 4); + } + + void SharedMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + SetPage(widgetIndex - WIDX_TAB_1); + break; + } } - } #pragma region Base page - void BaseMouseUp(WidgetIndex widgetIndex) - { - SharedMouseUp(widgetIndex); - - MapGenSettings mapgenSettings; - Formatter ft; - switch (widgetIndex) + void BaseMouseUp(WidgetIndex widgetIndex) { - case WIDX_MAP_GENERATE: - mapgenSettings.mapSize = _mapSize; - mapgenSettings.height = _baseHeight + 2; - mapgenSettings.water_level = _waterLevel + 2; - mapgenSettings.floor = _floorTexture; - mapgenSettings.wall = _wallTexture; + SharedMouseUp(widgetIndex); - MapGenGenerateBlank(&mapgenSettings); - GfxInvalidateScreen(); - break; - case WIDX_MAP_SIZE_Y: - _resizeDirection = ResizeDirection::Y; - InputMapSize(WIDX_MAP_SIZE_Y, _mapSize.y); - break; - case WIDX_MAP_SIZE_X: - _resizeDirection = ResizeDirection::X; - InputMapSize(WIDX_MAP_SIZE_X, _mapSize.x); - break; - case WIDX_MAP_SIZE_LINK: - _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; - break; - case WIDX_BASE_HEIGHT: - ft.Add((BASESIZE_MIN - 12) / 2); - ft.Add((BASESIZE_MAX - 12) / 2); - WindowTextInputOpen( - this, WIDX_BASE_HEIGHT, STR_BASE_HEIGHT, STR_ENTER_BASE_HEIGHT, ft, STR_FORMAT_INTEGER, - (_baseHeight - 12) / 2, 3); - break; - case WIDX_WATER_LEVEL: - ft.Add((WATERLEVEL_MIN - 12) / 2); - ft.Add((WATERLEVEL_MAX - 12) / 2); - WindowTextInputOpen( - this, WIDX_WATER_LEVEL, STR_WATER_LEVEL, STR_ENTER_WATER_LEVEL, ft, STR_FORMAT_INTEGER, - (_waterLevel - 12) / 2, 3); - break; - } - } - - void BaseMouseDown(WidgetIndex widgetIndex, Widget* widget) - { - switch (widgetIndex) - { - case WIDX_MAP_SIZE_Y_UP: - _resizeDirection = ResizeDirection::Y; - ChangeMapSize(+1); - Invalidate(); - break; - case WIDX_MAP_SIZE_Y_DOWN: - _resizeDirection = ResizeDirection::Y; - ChangeMapSize(-1); - Invalidate(); - break; - case WIDX_MAP_SIZE_X_UP: - _resizeDirection = ResizeDirection::X; - ChangeMapSize(+1); - Invalidate(); - break; - case WIDX_MAP_SIZE_X_DOWN: - _resizeDirection = ResizeDirection::X; - ChangeMapSize(-1); - Invalidate(); - break; - case WIDX_BASE_HEIGHT_UP: - _baseHeight = std::min(_baseHeight + 2, BASESIZE_MAX); - Invalidate(); - break; - case WIDX_BASE_HEIGHT_DOWN: - _baseHeight = std::max(_baseHeight - 2, BASESIZE_MIN); - Invalidate(); - break; - case WIDX_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + 2, WATERLEVEL_MAX); - Invalidate(); - break; - case WIDX_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - 2, WATERLEVEL_MIN); - Invalidate(); - break; - case WIDX_FLOOR_TEXTURE: - LandTool::ShowSurfaceStyleDropdown(this, widget, _floorTexture); - break; - case WIDX_WALL_TEXTURE: - LandTool::ShowEdgeStyleDropdown(this, widget, _wallTexture); - break; - } - } - - void BaseDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - int32_t type; - - switch (widgetIndex) - { - case WIDX_FLOOR_TEXTURE: - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - type = (dropdownIndex == -1) ? _floorTexture : dropdownIndex; - - if (gLandToolTerrainSurface == type) - { - gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; - } - else - { - gLandToolTerrainSurface = type; - _floorTexture = type; - } - Invalidate(); - break; - case WIDX_WALL_TEXTURE: - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - type = (dropdownIndex == -1) ? _wallTexture : dropdownIndex; - - if (gLandToolTerrainEdge == type) - { - gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; - } - else - { - gLandToolTerrainEdge = type; - _wallTexture = type; - } - Invalidate(); - break; - } - } - - void BaseUpdate() - { - // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; - InvalidateWidget(WIDX_TAB_1); - } - - void TextInput(WidgetIndex widgetIndex, std::string_view text) - { - int32_t value; - char* end; - - const auto strText = u8string(text); - value = strtol(strText.c_str(), &end, 10); - - if (*end != '\0') - { - return; - } - - switch (widgetIndex) - { - case WIDX_MAP_SIZE_Y: - case WIDX_MAP_SIZE_X: - case WIDX_SIMPLEX_MAP_SIZE_Y: - case WIDX_SIMPLEX_MAP_SIZE_X: - // The practical size is 2 lower than the technical size - value += 2; - if (_resizeDirection == ResizeDirection::Y || _mapWidthAndHeightLinked) - _mapSize.y = value; - if (_resizeDirection == ResizeDirection::X || _mapWidthAndHeightLinked) - _mapSize.x = value; - break; - case WIDX_BASE_HEIGHT: - _baseHeight = std::clamp((value * 2) + 12, BASESIZE_MIN, BASESIZE_MAX); - break; - case WIDX_WATER_LEVEL: - _waterLevel = std::clamp((value * 2) + 12, WATERLEVEL_MIN, WATERLEVEL_MAX); - break; - } - - Invalidate(); - } - - void BasePrepareDraw() - { - if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_BASE]) - { - widgets = PageWidgets[WINDOW_MAPGEN_PAGE_BASE]; - InitScrollWidgets(); - } - - // Only allow linking the map size when X and Y are the same - SetWidgetPressed(WIDX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); - SetWidgetDisabled(WIDX_MAP_SIZE_LINK, _mapSize.x != _mapSize.y); - - SetPressedTab(); - - // Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use - auto ft = Formatter::Common(); - ft.Add(_mapSize.y - 2); - ft.Add(_mapSize.x - 2); - } - - void DrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageId image) - { - const auto& widget = widgets[widgetIndex]; - ScreenCoordsXY pos = { windowPos.x + widget.left, windowPos.y + widget.top }; - if (IsWidgetDisabled(widgetIndex)) - { - // Draw greyed out (light border bottom right shadow) - auto colour = colours[widget.colour]; - colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter; - GfxDrawSpriteSolid(&dpi, image, pos + ScreenCoordsXY{ 1, 1 }, colour); - - // Draw greyed out (dark) - colour = colours[widget.colour]; - colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light; - GfxDrawSpriteSolid(&dpi, image, pos, colour); - } - else - { - GfxDrawSprite(dpi, image, pos); - } - } - - void DrawDropdownButtons(DrawPixelInfo& dpi, WidgetIndex floorWidgetIndex, WidgetIndex edgeWidgetIndex) - { - auto& objManager = GetContext()->GetObjectManager(); - const auto surfaceObj = static_cast( - objManager.GetLoadedObject(ObjectType::TerrainSurface, _floorTexture)); - ImageId surfaceImage; - if (surfaceObj != nullptr) - { - surfaceImage = ImageId(surfaceObj->IconImageId); - if (surfaceObj->Colour != 255) + MapGenSettings mapgenSettings; + Formatter ft; + switch (widgetIndex) { - surfaceImage = surfaceImage.WithPrimary(surfaceObj->Colour); + case WIDX_MAP_GENERATE: + mapgenSettings.mapSize = _mapSize; + mapgenSettings.height = _baseHeight + 2; + mapgenSettings.water_level = _waterLevel + 2; + mapgenSettings.floor = _floorTexture; + mapgenSettings.wall = _wallTexture; + + MapGenGenerateBlank(&mapgenSettings); + GfxInvalidateScreen(); + break; + case WIDX_MAP_SIZE_Y: + _resizeDirection = ResizeDirection::Y; + InputMapSize(WIDX_MAP_SIZE_Y, _mapSize.y); + break; + case WIDX_MAP_SIZE_X: + _resizeDirection = ResizeDirection::X; + InputMapSize(WIDX_MAP_SIZE_X, _mapSize.x); + break; + case WIDX_MAP_SIZE_LINK: + _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; + break; + case WIDX_BASE_HEIGHT: + ft.Add((BASESIZE_MIN - 12) / 2); + ft.Add((BASESIZE_MAX - 12) / 2); + WindowTextInputOpen( + this, WIDX_BASE_HEIGHT, STR_BASE_HEIGHT, STR_ENTER_BASE_HEIGHT, ft, STR_FORMAT_INTEGER, + (_baseHeight - 12) / 2, 3); + break; + case WIDX_WATER_LEVEL: + ft.Add((WATERLEVEL_MIN - 12) / 2); + ft.Add((WATERLEVEL_MAX - 12) / 2); + WindowTextInputOpen( + this, WIDX_WATER_LEVEL, STR_WATER_LEVEL, STR_ENTER_WATER_LEVEL, ft, STR_FORMAT_INTEGER, + (_waterLevel - 12) / 2, 3); + break; } } - ImageId edgeImage; - const auto edgeObj = static_cast(objManager.GetLoadedObject(ObjectType::TerrainEdge, _wallTexture)); - if (edgeObj != nullptr) + void BaseMouseDown(WidgetIndex widgetIndex, Widget* widget) { - edgeImage = ImageId(edgeObj->IconImageId); + switch (widgetIndex) + { + case WIDX_MAP_SIZE_Y_UP: + _resizeDirection = ResizeDirection::Y; + ChangeMapSize(+1); + Invalidate(); + break; + case WIDX_MAP_SIZE_Y_DOWN: + _resizeDirection = ResizeDirection::Y; + ChangeMapSize(-1); + Invalidate(); + break; + case WIDX_MAP_SIZE_X_UP: + _resizeDirection = ResizeDirection::X; + ChangeMapSize(+1); + Invalidate(); + break; + case WIDX_MAP_SIZE_X_DOWN: + _resizeDirection = ResizeDirection::X; + ChangeMapSize(-1); + Invalidate(); + break; + case WIDX_BASE_HEIGHT_UP: + _baseHeight = std::min(_baseHeight + 2, BASESIZE_MAX); + Invalidate(); + break; + case WIDX_BASE_HEIGHT_DOWN: + _baseHeight = std::max(_baseHeight - 2, BASESIZE_MIN); + Invalidate(); + break; + case WIDX_WATER_LEVEL_UP: + _waterLevel = std::min(_waterLevel + 2, WATERLEVEL_MAX); + Invalidate(); + break; + case WIDX_WATER_LEVEL_DOWN: + _waterLevel = std::max(_waterLevel - 2, WATERLEVEL_MIN); + Invalidate(); + break; + case WIDX_FLOOR_TEXTURE: + LandTool::ShowSurfaceStyleDropdown(this, widget, _floorTexture); + break; + case WIDX_WALL_TEXTURE: + LandTool::ShowEdgeStyleDropdown(this, widget, _wallTexture); + break; + } } - DrawDropdownButton(dpi, floorWidgetIndex, surfaceImage); - DrawDropdownButton(dpi, edgeWidgetIndex, edgeImage); - } + void BaseDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + int32_t type; - void BaseDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - DrawDropdownButtons(dpi, WIDX_FLOOR_TEXTURE, WIDX_WALL_TEXTURE); + switch (widgetIndex) + { + case WIDX_FLOOR_TEXTURE: + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; - const auto textColour = colours[1]; + type = (dropdownIndex == -1) ? _floorTexture : dropdownIndex; - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_BASE_HEIGHT_LABEL, {}, { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_FLOOR_TEXTURE].top + 1 }, STR_TERRAIN_LABEL, {}, { textColour }); + if (gLandToolTerrainSurface == type) + { + gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; + } + else + { + gLandToolTerrainSurface = type; + _floorTexture = type; + } + Invalidate(); + break; + case WIDX_WALL_TEXTURE: + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; - auto ft = Formatter(); - ft.Add((_baseHeight - 12) / 2); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_BASE_HEIGHT].left + 1, widgets[WIDX_BASE_HEIGHT].top + 1 }, - STR_COMMA16, ft, { colours[1] }); + type = (dropdownIndex == -1) ? _wallTexture : dropdownIndex; - ft = Formatter(); - ft.Add((_waterLevel - 12) / 2); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_WATER_LEVEL].left + 1, widgets[WIDX_WATER_LEVEL].top + 1 }, - STR_COMMA16, ft, { colours[1] }); - } + if (gLandToolTerrainEdge == type) + { + gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; + } + else + { + gLandToolTerrainEdge = type; + _wallTexture = type; + } + Invalidate(); + break; + } + } + + void BaseUpdate() + { + // Tab animation + if (++frame_no >= TabAnimationLoops[page]) + frame_no = 0; + InvalidateWidget(WIDX_TAB_1); + } + + void TextInput(WidgetIndex widgetIndex, std::string_view text) + { + int32_t value; + char* end; + + const auto strText = u8string(text); + value = strtol(strText.c_str(), &end, 10); + + if (*end != '\0') + { + return; + } + + switch (widgetIndex) + { + case WIDX_MAP_SIZE_Y: + case WIDX_MAP_SIZE_X: + case WIDX_SIMPLEX_MAP_SIZE_Y: + case WIDX_SIMPLEX_MAP_SIZE_X: + // The practical size is 2 lower than the technical size + value += 2; + if (_resizeDirection == ResizeDirection::Y || _mapWidthAndHeightLinked) + _mapSize.y = value; + if (_resizeDirection == ResizeDirection::X || _mapWidthAndHeightLinked) + _mapSize.x = value; + break; + case WIDX_BASE_HEIGHT: + _baseHeight = std::clamp((value * 2) + 12, BASESIZE_MIN, BASESIZE_MAX); + break; + case WIDX_WATER_LEVEL: + _waterLevel = std::clamp((value * 2) + 12, WATERLEVEL_MIN, WATERLEVEL_MAX); + break; + } + + Invalidate(); + } + + void BasePrepareDraw() + { + if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_BASE]) + { + widgets = PageWidgets[WINDOW_MAPGEN_PAGE_BASE]; + InitScrollWidgets(); + } + + // Only allow linking the map size when X and Y are the same + SetWidgetPressed(WIDX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); + SetWidgetDisabled(WIDX_MAP_SIZE_LINK, _mapSize.x != _mapSize.y); + + SetPressedTab(); + + // Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use + auto ft = Formatter::Common(); + ft.Add(_mapSize.y - 2); + ft.Add(_mapSize.x - 2); + } + + void DrawDropdownButton(DrawPixelInfo& dpi, WidgetIndex widgetIndex, ImageId image) + { + const auto& widget = widgets[widgetIndex]; + ScreenCoordsXY pos = { windowPos.x + widget.left, windowPos.y + widget.top }; + if (IsWidgetDisabled(widgetIndex)) + { + // Draw greyed out (light border bottom right shadow) + auto colour = colours[widget.colour]; + colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter; + GfxDrawSpriteSolid(&dpi, image, pos + ScreenCoordsXY{ 1, 1 }, colour); + + // Draw greyed out (dark) + colour = colours[widget.colour]; + colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light; + GfxDrawSpriteSolid(&dpi, image, pos, colour); + } + else + { + GfxDrawSprite(dpi, image, pos); + } + } + + void DrawDropdownButtons(DrawPixelInfo& dpi, WidgetIndex floorWidgetIndex, WidgetIndex edgeWidgetIndex) + { + auto& objManager = GetContext()->GetObjectManager(); + const auto surfaceObj = static_cast( + objManager.GetLoadedObject(ObjectType::TerrainSurface, _floorTexture)); + ImageId surfaceImage; + if (surfaceObj != nullptr) + { + surfaceImage = ImageId(surfaceObj->IconImageId); + if (surfaceObj->Colour != 255) + { + surfaceImage = surfaceImage.WithPrimary(surfaceObj->Colour); + } + } + + ImageId edgeImage; + const auto edgeObj = static_cast( + objManager.GetLoadedObject(ObjectType::TerrainEdge, _wallTexture)); + if (edgeObj != nullptr) + { + edgeImage = ImageId(edgeObj->IconImageId); + } + + DrawDropdownButton(dpi, floorWidgetIndex, surfaceImage); + DrawDropdownButton(dpi, edgeWidgetIndex, edgeImage); + } + + void BaseDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + DrawDropdownButtons(dpi, WIDX_FLOOR_TEXTURE, WIDX_WALL_TEXTURE); + + const auto textColour = colours[1]; + + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_BASE_HEIGHT].top + 1 }, STR_BASE_HEIGHT_LABEL, {}, + { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, + { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_FLOOR_TEXTURE].top + 1 }, STR_TERRAIN_LABEL, {}, + { textColour }); + + auto ft = Formatter(); + ft.Add((_baseHeight - 12) / 2); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_BASE_HEIGHT].left + 1, widgets[WIDX_BASE_HEIGHT].top + 1 }, + STR_COMMA16, ft, { colours[1] }); + + ft = Formatter(); + ft.Add((_waterLevel - 12) / 2); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_WATER_LEVEL].left + 1, widgets[WIDX_WATER_LEVEL].top + 1 }, + STR_COMMA16, ft, { colours[1] }); + } #pragma endregion #pragma region Random page - void RandomMouseUp(WidgetIndex widgetIndex) - { - SharedMouseUp(widgetIndex); - - MapGenSettings mapgenSettings; - - switch (widgetIndex) + void RandomMouseUp(WidgetIndex widgetIndex) { - case WIDX_RANDOM_GENERATE: - mapgenSettings.mapSize = _mapSize; - mapgenSettings.height = _baseHeight + 2; - mapgenSettings.water_level = _waterLevel + 2; - mapgenSettings.floor = _randomTerrain ? -1 : _floorTexture; - mapgenSettings.wall = _randomTerrain ? -1 : _wallTexture; - mapgenSettings.trees = _placeTrees; + SharedMouseUp(widgetIndex); - mapgenSettings.simplex_low = UtilRand() % 4; - mapgenSettings.simplex_high = 12 + (UtilRand() % (32 - 12)); - mapgenSettings.simplex_base_freq = 1.75f; - mapgenSettings.simplex_octaves = 6; + MapGenSettings mapgenSettings; - MapGenGenerate(&mapgenSettings); - GfxInvalidateScreen(); - break; - case WIDX_RANDOM_TERRAIN: - _randomTerrain = !_randomTerrain; - break; - case WIDX_RANDOM_PLACE_TREES: - _placeTrees ^= 1; - break; - } - } + switch (widgetIndex) + { + case WIDX_RANDOM_GENERATE: + mapgenSettings.mapSize = _mapSize; + mapgenSettings.height = _baseHeight + 2; + mapgenSettings.water_level = _waterLevel + 2; + mapgenSettings.floor = _randomTerrain ? -1 : _floorTexture; + mapgenSettings.wall = _randomTerrain ? -1 : _wallTexture; + mapgenSettings.trees = _placeTrees; - void RandomUpdate() - { - // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; - InvalidateWidget(WIDX_TAB_2); - } + mapgenSettings.simplex_low = UtilRand() % 4; + mapgenSettings.simplex_high = 12 + (UtilRand() % (32 - 12)); + mapgenSettings.simplex_base_freq = 1.75f; + mapgenSettings.simplex_octaves = 6; - void RandomPrepareDraw() - { - if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_RANDOM]) - { - widgets = PageWidgets[WINDOW_MAPGEN_PAGE_RANDOM]; - InitScrollWidgets(); + MapGenGenerate(&mapgenSettings); + GfxInvalidateScreen(); + break; + case WIDX_RANDOM_TERRAIN: + _randomTerrain = !_randomTerrain; + break; + case WIDX_RANDOM_PLACE_TREES: + _placeTrees ^= 1; + break; + } } - pressed_widgets = 0; - if (_randomTerrain) - pressed_widgets |= 1uLL << WIDX_RANDOM_TERRAIN; - if (_placeTrees) - pressed_widgets |= 1uLL << WIDX_RANDOM_PLACE_TREES; + void RandomUpdate() + { + // Tab animation + if (++frame_no >= TabAnimationLoops[page]) + frame_no = 0; + InvalidateWidget(WIDX_TAB_2); + } - SetPressedTab(); - } + void RandomPrepareDraw() + { + if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_RANDOM]) + { + widgets = PageWidgets[WINDOW_MAPGEN_PAGE_RANDOM]; + InitScrollWidgets(); + } - void RandomDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - } + pressed_widgets = 0; + if (_randomTerrain) + pressed_widgets |= 1uLL << WIDX_RANDOM_TERRAIN; + if (_placeTrees) + pressed_widgets |= 1uLL << WIDX_RANDOM_PLACE_TREES; + + SetPressedTab(); + } + + void RandomDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + } #pragma endregion #pragma region Simplex page - void SimplexMouseUp(WidgetIndex widgetIndex) - { - SharedMouseUp(widgetIndex); - - MapGenSettings mapgenSettings; - - switch (widgetIndex) + void SimplexMouseUp(WidgetIndex widgetIndex) { - case WIDX_SIMPLEX_MAP_SIZE_Y: - _resizeDirection = ResizeDirection::Y; - InputMapSize(WIDX_SIMPLEX_MAP_SIZE_Y, _mapSize.y); - break; - case WIDX_SIMPLEX_MAP_SIZE_X: - _resizeDirection = ResizeDirection::X; - InputMapSize(WIDX_SIMPLEX_MAP_SIZE_X, _mapSize.x); - break; - case WIDX_SIMPLEX_MAP_SIZE_LINK: - _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; - break; - case WIDX_SIMPLEX_GENERATE: - mapgenSettings.mapSize = _mapSize; + SharedMouseUp(widgetIndex); - mapgenSettings.height = _baseHeight; - mapgenSettings.water_level = _waterLevel + kMinimumWaterHeight; - mapgenSettings.floor = _randomTerrain ? -1 : _floorTexture; - mapgenSettings.wall = _randomTerrain ? -1 : _wallTexture; - mapgenSettings.trees = _placeTrees; + MapGenSettings mapgenSettings; - mapgenSettings.simplex_low = _simplex_low; - mapgenSettings.simplex_high = _simplex_high; - mapgenSettings.simplex_base_freq = (static_cast(_simplex_base_freq)) / 100.00f; - mapgenSettings.simplex_octaves = _simplex_octaves; + switch (widgetIndex) + { + case WIDX_SIMPLEX_MAP_SIZE_Y: + _resizeDirection = ResizeDirection::Y; + InputMapSize(WIDX_SIMPLEX_MAP_SIZE_Y, _mapSize.y); + break; + case WIDX_SIMPLEX_MAP_SIZE_X: + _resizeDirection = ResizeDirection::X; + InputMapSize(WIDX_SIMPLEX_MAP_SIZE_X, _mapSize.x); + break; + case WIDX_SIMPLEX_MAP_SIZE_LINK: + _mapWidthAndHeightLinked = !_mapWidthAndHeightLinked; + break; + case WIDX_SIMPLEX_GENERATE: + mapgenSettings.mapSize = _mapSize; - MapGenGenerate(&mapgenSettings); - GfxInvalidateScreen(); - break; - } - } + mapgenSettings.height = _baseHeight; + mapgenSettings.water_level = _waterLevel + kMinimumWaterHeight; + mapgenSettings.floor = _randomTerrain ? -1 : _floorTexture; + mapgenSettings.wall = _randomTerrain ? -1 : _wallTexture; + mapgenSettings.trees = _placeTrees; - void SimplexMouseDown(WidgetIndex widgetIndex, Widget* widget) - { - switch (widgetIndex) - { - case WIDX_SIMPLEX_LOW_UP: - _simplex_low = std::min(_simplex_low + 1, 24); - Invalidate(); - break; - case WIDX_SIMPLEX_LOW_DOWN: - _simplex_low = std::max(_simplex_low - 1, 0); - Invalidate(); - break; - case WIDX_SIMPLEX_HIGH_UP: - _simplex_high = std::min(_simplex_high + 1, 36); - Invalidate(); - break; - case WIDX_SIMPLEX_HIGH_DOWN: - _simplex_high = std::max(_simplex_high - 1, 0); - Invalidate(); - break; - case WIDX_SIMPLEX_BASE_FREQ_UP: - _simplex_base_freq = std::min(_simplex_base_freq + 5, 1000); - Invalidate(); - break; - case WIDX_SIMPLEX_BASE_FREQ_DOWN: - _simplex_base_freq = std::max(_simplex_base_freq - 5, 0); - Invalidate(); - break; - case WIDX_SIMPLEX_OCTAVES_UP: - _simplex_octaves = std::min(_simplex_octaves + 1, 10); - Invalidate(); - break; - case WIDX_SIMPLEX_OCTAVES_DOWN: - _simplex_octaves = std::max(_simplex_octaves - 1, 1); - Invalidate(); - break; - case WIDX_SIMPLEX_MAP_SIZE_Y_UP: - _resizeDirection = ResizeDirection::Y; - ChangeMapSize(+1); - Invalidate(); - break; - case WIDX_SIMPLEX_MAP_SIZE_Y_DOWN: - _resizeDirection = ResizeDirection::Y; - ChangeMapSize(-1); - Invalidate(); - break; - case WIDX_SIMPLEX_MAP_SIZE_X_UP: - _resizeDirection = ResizeDirection::X; - ChangeMapSize(+1); - Invalidate(); - break; - case WIDX_SIMPLEX_MAP_SIZE_X_DOWN: - _resizeDirection = ResizeDirection::X; - ChangeMapSize(-1); - Invalidate(); - break; - case WIDX_SIMPLEX_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + kMinimumWaterHeight, kMinimumWaterHeight + kMaximumWaterHeight); - Invalidate(); - break; - case WIDX_SIMPLEX_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - kMinimumWaterHeight, 0); - Invalidate(); - break; - case WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX: - _randomTerrain = !_randomTerrain; - Invalidate(); - break; - case WIDX_SIMPLEX_FLOOR_TEXTURE: - LandTool::ShowSurfaceStyleDropdown(this, widget, _floorTexture); - break; - case WIDX_SIMPLEX_WALL_TEXTURE: - LandTool::ShowEdgeStyleDropdown(this, widget, _wallTexture); - break; - case WIDX_SIMPLEX_PLACE_TREES_CHECKBOX: - _placeTrees ^= 1; - Invalidate(); - break; - } - } + mapgenSettings.simplex_low = _simplex_low; + mapgenSettings.simplex_high = _simplex_high; + mapgenSettings.simplex_base_freq = (static_cast(_simplex_base_freq)) / 100.00f; + mapgenSettings.simplex_octaves = _simplex_octaves; - void SimplexDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - int32_t type; - - switch (widgetIndex) - { - case WIDX_SIMPLEX_FLOOR_TEXTURE: - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - type = (dropdownIndex == -1) ? _floorTexture : dropdownIndex; - - if (gLandToolTerrainSurface == type) - { - gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; - } - else - { - gLandToolTerrainSurface = type; - _floorTexture = type; - } - Invalidate(); - break; - case WIDX_SIMPLEX_WALL_TEXTURE: - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - type = (dropdownIndex == -1) ? _wallTexture : dropdownIndex; - - if (gLandToolTerrainEdge == type) - { - gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; - } - else - { - gLandToolTerrainEdge = type; - _wallTexture = type; - } - Invalidate(); - break; - } - } - - void SimplexUpdate() - { - // Tab animation - if (++frame_no >= TabAnimationLoops[page]) - frame_no = 0; - InvalidateWidget(WIDX_TAB_3); - } - - void SimplexPrepareDraw() - { - if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_SIMPLEX]) - { - widgets = PageWidgets[WINDOW_MAPGEN_PAGE_SIMPLEX]; - InitScrollWidgets(); + MapGenGenerate(&mapgenSettings); + GfxInvalidateScreen(); + break; + } } - // Only allow linking the map size when X and Y are the same - SetWidgetPressed(WIDX_SIMPLEX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); - SetWidgetDisabled(WIDX_SIMPLEX_MAP_SIZE_LINK, _mapSize.x != _mapSize.y); - - SetCheckboxValue(WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX, _randomTerrain != 0); - SetCheckboxValue(WIDX_SIMPLEX_PLACE_TREES_CHECKBOX, _placeTrees != 0); - - // Only allow floor and wall texture options if random terrain is disabled - if (!_randomTerrain) + void SimplexMouseDown(WidgetIndex widgetIndex, Widget* widget) { - SetWidgetEnabled(WIDX_SIMPLEX_FLOOR_TEXTURE, true); - SetWidgetEnabled(WIDX_SIMPLEX_WALL_TEXTURE, true); - } - else - { - SetWidgetEnabled(WIDX_SIMPLEX_FLOOR_TEXTURE, false); - SetWidgetEnabled(WIDX_SIMPLEX_WALL_TEXTURE, false); + switch (widgetIndex) + { + case WIDX_SIMPLEX_LOW_UP: + _simplex_low = std::min(_simplex_low + 1, 24); + Invalidate(); + break; + case WIDX_SIMPLEX_LOW_DOWN: + _simplex_low = std::max(_simplex_low - 1, 0); + Invalidate(); + break; + case WIDX_SIMPLEX_HIGH_UP: + _simplex_high = std::min(_simplex_high + 1, 36); + Invalidate(); + break; + case WIDX_SIMPLEX_HIGH_DOWN: + _simplex_high = std::max(_simplex_high - 1, 0); + Invalidate(); + break; + case WIDX_SIMPLEX_BASE_FREQ_UP: + _simplex_base_freq = std::min(_simplex_base_freq + 5, 1000); + Invalidate(); + break; + case WIDX_SIMPLEX_BASE_FREQ_DOWN: + _simplex_base_freq = std::max(_simplex_base_freq - 5, 0); + Invalidate(); + break; + case WIDX_SIMPLEX_OCTAVES_UP: + _simplex_octaves = std::min(_simplex_octaves + 1, 10); + Invalidate(); + break; + case WIDX_SIMPLEX_OCTAVES_DOWN: + _simplex_octaves = std::max(_simplex_octaves - 1, 1); + Invalidate(); + break; + case WIDX_SIMPLEX_MAP_SIZE_Y_UP: + _resizeDirection = ResizeDirection::Y; + ChangeMapSize(+1); + Invalidate(); + break; + case WIDX_SIMPLEX_MAP_SIZE_Y_DOWN: + _resizeDirection = ResizeDirection::Y; + ChangeMapSize(-1); + Invalidate(); + break; + case WIDX_SIMPLEX_MAP_SIZE_X_UP: + _resizeDirection = ResizeDirection::X; + ChangeMapSize(+1); + Invalidate(); + break; + case WIDX_SIMPLEX_MAP_SIZE_X_DOWN: + _resizeDirection = ResizeDirection::X; + ChangeMapSize(-1); + Invalidate(); + break; + case WIDX_SIMPLEX_WATER_LEVEL_UP: + _waterLevel = std::min(_waterLevel + kMinimumWaterHeight, kMinimumWaterHeight + kMaximumWaterHeight); + Invalidate(); + break; + case WIDX_SIMPLEX_WATER_LEVEL_DOWN: + _waterLevel = std::max(_waterLevel - kMinimumWaterHeight, 0); + Invalidate(); + break; + case WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX: + _randomTerrain = !_randomTerrain; + Invalidate(); + break; + case WIDX_SIMPLEX_FLOOR_TEXTURE: + LandTool::ShowSurfaceStyleDropdown(this, widget, _floorTexture); + break; + case WIDX_SIMPLEX_WALL_TEXTURE: + LandTool::ShowEdgeStyleDropdown(this, widget, _wallTexture); + break; + case WIDX_SIMPLEX_PLACE_TREES_CHECKBOX: + _placeTrees ^= 1; + Invalidate(); + break; + } } - SetPressedTab(); + void SimplexDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + int32_t type; - // Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use - auto ft = Formatter::Common(); - ft.Add(_mapSize.y - 2); - ft.Add(_mapSize.x - 2); - } + switch (widgetIndex) + { + case WIDX_SIMPLEX_FLOOR_TEXTURE: + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; - void SimplexDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - DrawDropdownButtons(dpi, WIDX_SIMPLEX_FLOOR_TEXTURE, WIDX_SIMPLEX_WALL_TEXTURE); + type = (dropdownIndex == -1) ? _floorTexture : dropdownIndex; - const uint8_t textColour = colours[1]; + if (gLandToolTerrainSurface == type) + { + gLandToolTerrainSurface = OBJECT_ENTRY_INDEX_NULL; + } + else + { + gLandToolTerrainSurface = type; + _floorTexture = type; + } + Invalidate(); + break; + case WIDX_SIMPLEX_WALL_TEXTURE: + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, - { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, - { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, - STR_MAPGEN_SIMPLEX_NOISE_BASE_FREQUENCY, {}, { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES, {}, - { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, - { textColour }); + type = (dropdownIndex == -1) ? _wallTexture : dropdownIndex; - auto ft = Formatter(); - ft.Add(_simplex_low); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_LOW].left + 1, widgets[WIDX_SIMPLEX_LOW].top + 1 }, - STR_COMMA16, ft, { textColour }); - ft = Formatter(); - ft.Add(_simplex_high); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_HIGH].left + 1, widgets[WIDX_SIMPLEX_HIGH].top + 1 }, - STR_COMMA16, ft, { textColour }); - ft = Formatter(); - ft.Add(_simplex_base_freq); - DrawTextBasic( - dpi, - windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, - STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { textColour }); - ft = Formatter(); - ft.Add(_simplex_octaves); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_OCTAVES].left + 1, widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, - STR_COMMA16, ft, { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL, {}, - { textColour }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1 }, - STR_MAPGEN_OPTION_PLACE_TREES, {}, { textColour }); + if (gLandToolTerrainEdge == type) + { + gLandToolTerrainEdge = OBJECT_ENTRY_INDEX_NULL; + } + else + { + gLandToolTerrainEdge = type; + _wallTexture = type; + } + Invalidate(); + break; + } + } - ft = Formatter(); - ft.Add((_waterLevel - 12) / 2); - DrawTextBasic( - dpi, - windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, - STR_COMMA16, ft, { textColour }); - } + void SimplexUpdate() + { + // Tab animation + if (++frame_no >= TabAnimationLoops[page]) + frame_no = 0; + InvalidateWidget(WIDX_TAB_3); + } + + void SimplexPrepareDraw() + { + if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_SIMPLEX]) + { + widgets = PageWidgets[WINDOW_MAPGEN_PAGE_SIMPLEX]; + InitScrollWidgets(); + } + + // Only allow linking the map size when X and Y are the same + SetWidgetPressed(WIDX_SIMPLEX_MAP_SIZE_LINK, _mapWidthAndHeightLinked); + SetWidgetDisabled(WIDX_SIMPLEX_MAP_SIZE_LINK, _mapSize.x != _mapSize.y); + + SetCheckboxValue(WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX, _randomTerrain != 0); + SetCheckboxValue(WIDX_SIMPLEX_PLACE_TREES_CHECKBOX, _placeTrees != 0); + + // Only allow floor and wall texture options if random terrain is disabled + if (!_randomTerrain) + { + SetWidgetEnabled(WIDX_SIMPLEX_FLOOR_TEXTURE, true); + SetWidgetEnabled(WIDX_SIMPLEX_WALL_TEXTURE, true); + } + else + { + SetWidgetEnabled(WIDX_SIMPLEX_FLOOR_TEXTURE, false); + SetWidgetEnabled(WIDX_SIMPLEX_WALL_TEXTURE, false); + } + + SetPressedTab(); + + // Push width (Y) and height (X) to the common formatter arguments for the map size spinners to use + auto ft = Formatter::Common(); + ft.Add(_mapSize.y - 2); + ft.Add(_mapSize.x - 2); + } + + void SimplexDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + DrawDropdownButtons(dpi, WIDX_SIMPLEX_FLOOR_TEXTURE, WIDX_SIMPLEX_WALL_TEXTURE); + + const uint8_t textColour = colours[1]; + + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, + { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, + { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, + STR_MAPGEN_SIMPLEX_NOISE_BASE_FREQUENCY, {}, { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_OCTAVES, + {}, { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_MAP_SIZE_Y].top + 1 }, STR_MAP_SIZE, {}, + { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, + { textColour }); + + auto ft = Formatter(); + ft.Add(_simplex_low); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_LOW].left + 1, widgets[WIDX_SIMPLEX_LOW].top + 1 }, + STR_COMMA16, ft, { textColour }); + ft = Formatter(); + ft.Add(_simplex_high); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_HIGH].left + 1, widgets[WIDX_SIMPLEX_HIGH].top + 1 }, + STR_COMMA16, ft, { textColour }); + ft = Formatter(); + ft.Add(_simplex_base_freq); + DrawTextBasic( + dpi, + windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_BASE_FREQ].left + 1, widgets[WIDX_SIMPLEX_BASE_FREQ].top + 1 }, + STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { textColour }); + ft = Formatter(); + ft.Add(_simplex_octaves); + DrawTextBasic( + dpi, + windowPos + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_OCTAVES].left + 1, widgets[WIDX_SIMPLEX_OCTAVES].top + 1 }, + STR_COMMA16, ft, { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_RANDOM_TERRAIN_CHECKBOX].top + 1 }, STR_TERRAIN_LABEL, + {}, { textColour }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_SIMPLEX_PLACE_TREES_CHECKBOX].top + 1 }, + STR_MAPGEN_OPTION_PLACE_TREES, {}, { textColour }); + + ft = Formatter(); + ft.Add((_waterLevel - 12) / 2); + DrawTextBasic( + dpi, + windowPos + + ScreenCoordsXY{ widgets[WIDX_SIMPLEX_WATER_LEVEL].left + 1, widgets[WIDX_SIMPLEX_WATER_LEVEL].top + 1 }, + STR_COMMA16, ft, { textColour }); + } #pragma endregion #pragma region Heightmap page - void HeightmapMouseDown(WidgetIndex widgetIndex, Widget* widget) - { - switch (widgetIndex) + void HeightmapMouseDown(WidgetIndex widgetIndex, Widget* widget) { - case WIDX_HEIGHTMAP_STRENGTH_UP: - _heightmapSmoothStrength = std::min(_heightmapSmoothStrength + 1, MAX_SMOOTH_ITERATIONS); - InvalidateWidget(WIDX_HEIGHTMAP_STRENGTH); - break; - case WIDX_HEIGHTMAP_STRENGTH_DOWN: - _heightmapSmoothStrength = std::max(_heightmapSmoothStrength - 1, 1); - InvalidateWidget(WIDX_HEIGHTMAP_STRENGTH); - break; - case WIDX_HEIGHTMAP_LOW_UP: - _heightmapLow = std::min(_heightmapLow + 1, 142 - 1); - _heightmapHigh = std::max(_heightmapHigh, _heightmapLow + 1); - InvalidateWidget(WIDX_HEIGHTMAP_LOW); - break; - case WIDX_HEIGHTMAP_LOW_DOWN: - _heightmapLow = std::max(_heightmapLow - 1, 2); - InvalidateWidget(WIDX_HEIGHTMAP_LOW); - break; - case WIDX_HEIGHTMAP_HIGH_UP: - _heightmapHigh = std::min(_heightmapHigh + 1, 142); - InvalidateWidget(WIDX_HEIGHTMAP_HIGH); - break; - case WIDX_HEIGHTMAP_HIGH_DOWN: - _heightmapHigh = std::max(_heightmapHigh - 1, 2 + 1); - _heightmapLow = std::min(_heightmapLow, _heightmapHigh - 1); - InvalidateWidget(WIDX_HEIGHTMAP_HIGH); - break; - case WIDX_HEIGHTMAP_WATER_LEVEL_UP: - _waterLevel = std::min(_waterLevel + kMinimumWaterHeight, kMinimumWaterHeight + kMaximumWaterHeight); - InvalidateWidget(WIDX_HEIGHTMAP_WATER_LEVEL); - break; - case WIDX_HEIGHTMAP_WATER_LEVEL_DOWN: - _waterLevel = std::max(_waterLevel - kMinimumWaterHeight, 0); - InvalidateWidget(WIDX_HEIGHTMAP_WATER_LEVEL); - break; - } - } - - void HeightmapGenerateMap() - { - MapGenSettings mapgenSettings; - mapgenSettings.water_level = _waterLevel; - mapgenSettings.smooth = _heightmapSmoothTiles; - mapgenSettings.smooth_height_map = _heightmapSmoothMap; - mapgenSettings.smooth_strength = _heightmapSmoothStrength; - mapgenSettings.normalize_height = _heightmapNormalize; - mapgenSettings.simplex_low = _heightmapLow; - mapgenSettings.simplex_high = _heightmapHigh; - MapGenGenerateFromHeightmap(&mapgenSettings); - GfxInvalidateScreen(); - } - - void HeightmapMouseUp(WidgetIndex widgetIndex) - { - SharedMouseUp(widgetIndex); - - switch (widgetIndex) - { - case WIDX_CLOSE: - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - return; // Only widgets that change a setting need to regenerate the map - - // Page widgets - case WIDX_HEIGHTMAP_SELECT: + switch (widgetIndex) { - auto intent = Intent(WindowClass::Loadsave); - intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP); - intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(HeightmapLoadsaveCallback)); - ContextOpenIntent(&intent); - return; + case WIDX_HEIGHTMAP_STRENGTH_UP: + _heightmapSmoothStrength = std::min(_heightmapSmoothStrength + 1, MAX_SMOOTH_ITERATIONS); + InvalidateWidget(WIDX_HEIGHTMAP_STRENGTH); + break; + case WIDX_HEIGHTMAP_STRENGTH_DOWN: + _heightmapSmoothStrength = std::max(_heightmapSmoothStrength - 1, 1); + InvalidateWidget(WIDX_HEIGHTMAP_STRENGTH); + break; + case WIDX_HEIGHTMAP_LOW_UP: + _heightmapLow = std::min(_heightmapLow + 1, 142 - 1); + _heightmapHigh = std::max(_heightmapHigh, _heightmapLow + 1); + InvalidateWidget(WIDX_HEIGHTMAP_LOW); + break; + case WIDX_HEIGHTMAP_LOW_DOWN: + _heightmapLow = std::max(_heightmapLow - 1, 2); + InvalidateWidget(WIDX_HEIGHTMAP_LOW); + break; + case WIDX_HEIGHTMAP_HIGH_UP: + _heightmapHigh = std::min(_heightmapHigh + 1, 142); + InvalidateWidget(WIDX_HEIGHTMAP_HIGH); + break; + case WIDX_HEIGHTMAP_HIGH_DOWN: + _heightmapHigh = std::max(_heightmapHigh - 1, 2 + 1); + _heightmapLow = std::min(_heightmapLow, _heightmapHigh - 1); + InvalidateWidget(WIDX_HEIGHTMAP_HIGH); + break; + case WIDX_HEIGHTMAP_WATER_LEVEL_UP: + _waterLevel = std::min(_waterLevel + kMinimumWaterHeight, kMinimumWaterHeight + kMaximumWaterHeight); + InvalidateWidget(WIDX_HEIGHTMAP_WATER_LEVEL); + break; + case WIDX_HEIGHTMAP_WATER_LEVEL_DOWN: + _waterLevel = std::max(_waterLevel - kMinimumWaterHeight, 0); + InvalidateWidget(WIDX_HEIGHTMAP_WATER_LEVEL); + break; } - case WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP: - _heightmapSmoothMap = !_heightmapSmoothMap; - SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, _heightmapSmoothMap); - SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH, _heightmapSmoothMap); - SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_UP, _heightmapSmoothMap); - SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_DOWN, _heightmapSmoothMap); - InvalidateWidget(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP); - InvalidateWidget(WIDX_HEIGHTMAP_STRENGTH); - break; - case WIDX_HEIGHTMAP_NORMALIZE: - _heightmapNormalize = !_heightmapNormalize; - SetCheckboxValue(WIDX_HEIGHTMAP_NORMALIZE, _heightmapNormalize); - InvalidateWidget(WIDX_HEIGHTMAP_NORMALIZE); - break; - case WIDX_HEIGHTMAP_SMOOTH_TILES: - _heightmapSmoothTiles = !_heightmapSmoothTiles; - SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_TILES, _heightmapSmoothTiles); - InvalidateWidget(WIDX_HEIGHTMAP_SMOOTH_TILES); - break; } - // Always regenerate the map after one of the page widgets has been changed - HeightmapGenerateMap(); - } - - void HeightmapPrepareDraw() - { - if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_HEIGHTMAP]) + void HeightmapGenerateMap() { - widgets = PageWidgets[WINDOW_MAPGEN_PAGE_HEIGHTMAP]; - InitScrollWidgets(); + MapGenSettings mapgenSettings; + mapgenSettings.water_level = _waterLevel; + mapgenSettings.smooth = _heightmapSmoothTiles; + mapgenSettings.smooth_height_map = _heightmapSmoothMap; + mapgenSettings.smooth_strength = _heightmapSmoothStrength; + mapgenSettings.normalize_height = _heightmapNormalize; + mapgenSettings.simplex_low = _heightmapLow; + mapgenSettings.simplex_high = _heightmapHigh; + MapGenGenerateFromHeightmap(&mapgenSettings); + GfxInvalidateScreen(); } - SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, _heightmapSmoothMap); - SetCheckboxValue(WIDX_HEIGHTMAP_NORMALIZE, _heightmapNormalize); - SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_TILES, _heightmapSmoothTiles); + void HeightmapMouseUp(WidgetIndex widgetIndex) + { + SharedMouseUp(widgetIndex); - SetPressedTab(); - } + switch (widgetIndex) + { + case WIDX_CLOSE: + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + return; // Only widgets that change a setting need to regenerate the map - void HeightmapDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); + // Page widgets + case WIDX_HEIGHTMAP_SELECT: + { + auto intent = Intent(WindowClass::Loadsave); + intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_HEIGHTMAP); + intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(HeightmapLoadsaveCallback)); + ContextOpenIntent(&intent); + return; + } + case WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP: + _heightmapSmoothMap = !_heightmapSmoothMap; + SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, _heightmapSmoothMap); + SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH, _heightmapSmoothMap); + SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_UP, _heightmapSmoothMap); + SetWidgetEnabled(WIDX_HEIGHTMAP_STRENGTH_DOWN, _heightmapSmoothMap); + InvalidateWidget(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP); + InvalidateWidget(WIDX_HEIGHTMAP_STRENGTH); + break; + case WIDX_HEIGHTMAP_NORMALIZE: + _heightmapNormalize = !_heightmapNormalize; + SetCheckboxValue(WIDX_HEIGHTMAP_NORMALIZE, _heightmapNormalize); + InvalidateWidget(WIDX_HEIGHTMAP_NORMALIZE); + break; + case WIDX_HEIGHTMAP_SMOOTH_TILES: + _heightmapSmoothTiles = !_heightmapSmoothTiles; + SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_TILES, _heightmapSmoothTiles); + InvalidateWidget(WIDX_HEIGHTMAP_SMOOTH_TILES); + break; + } - const colour_t enabledColour = colours[1]; - const colour_t disabledColour = enabledColour | COLOUR_FLAG_INSET; + // Always regenerate the map after one of the page widgets has been changed + HeightmapGenerateMap(); + } - // Smooth strength label and value - const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour; - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {}, - { strengthColour }); + void HeightmapPrepareDraw() + { + if (widgets != PageWidgets[WINDOW_MAPGEN_PAGE_HEIGHTMAP]) + { + widgets = PageWidgets[WINDOW_MAPGEN_PAGE_HEIGHTMAP]; + InitScrollWidgets(); + } - auto ft = Formatter(); - ft.Add(_heightmapSmoothStrength); - DrawTextBasic( - dpi, - windowPos + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, - STR_COMMA16, ft, { strengthColour }); + SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_HEIGHTMAP, _heightmapSmoothMap); + SetCheckboxValue(WIDX_HEIGHTMAP_NORMALIZE, _heightmapNormalize); + SetCheckboxValue(WIDX_HEIGHTMAP_SMOOTH_TILES, _heightmapSmoothTiles); - // Low label and value - const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour; - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, - { labelColour }); + SetPressedTab(); + } - ft = Formatter(); - ft.Add(_heightmapLow); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_LOW].left + 1, widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, - STR_COMMA16, ft, { labelColour }); + void HeightmapDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); - // High label and value - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, - { labelColour }); + const colour_t enabledColour = colours[1]; + const colour_t disabledColour = enabledColour | COLOUR_FLAG_INSET; - ft = Formatter(); - ft.Add(_heightmapHigh); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_HIGH].left + 1, widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, - STR_COMMA16, ft, { labelColour }); + // Smooth strength label and value + const colour_t strengthColour = _heightmapSmoothMap ? enabledColour : disabledColour; + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, STR_MAPGEN_SMOOTH_STRENGTH, {}, + { strengthColour }); - // Water level label and value - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, - { labelColour }); + auto ft = Formatter(); + ft.Add(_heightmapSmoothStrength); + DrawTextBasic( + dpi, + windowPos + + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_STRENGTH].left + 1, widgets[WIDX_HEIGHTMAP_STRENGTH].top + 1 }, + STR_COMMA16, ft, { strengthColour }); - ft = Formatter(); - ft.Add(_waterLevel); - DrawTextBasic( - dpi, - windowPos - + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, - STR_COMMA16, ft, { labelColour }); - } + // Low label and value + const colour_t labelColour = _heightmapLoaded ? enabledColour : disabledColour; + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_LOW_, {}, + { labelColour }); + + ft = Formatter(); + ft.Add(_heightmapLow); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_LOW].left + 1, widgets[WIDX_HEIGHTMAP_LOW].top + 1 }, + STR_COMMA16, ft, { labelColour }); + + // High label and value + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, STR_MAPGEN_SIMPLEX_NOISE_HIGH, {}, + { labelColour }); + + ft = Formatter(); + ft.Add(_heightmapHigh); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_HIGH].left + 1, widgets[WIDX_HEIGHTMAP_HIGH].top + 1 }, + STR_COMMA16, ft, { labelColour }); + + // Water level label and value + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 5, widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, STR_WATER_LEVEL_LABEL, {}, + { labelColour }); + + ft = Formatter(); + ft.Add(_waterLevel); + DrawTextBasic( + dpi, + windowPos + + ScreenCoordsXY{ widgets[WIDX_HEIGHTMAP_WATER_LEVEL].left + 1, + widgets[WIDX_HEIGHTMAP_WATER_LEVEL].top + 1 }, + STR_COMMA16, ft, { labelColour }); + } #pragma endregion -public: - void OnOpen() override - { - number = 0; - frame_no = 0; - - page = WINDOW_MAPGEN_PAGE_BASE; - Invalidate(); - widgets = PageWidgets[WINDOW_MAPGEN_PAGE_BASE]; - hold_down_widgets = HoldDownWidgets[WINDOW_MAPGEN_PAGE_BASE]; - pressed_widgets = PressedWidgets[WINDOW_MAPGEN_PAGE_BASE]; - disabled_widgets = PageDisabledWidgets[WINDOW_MAPGEN_PAGE_BASE]; - InitScrollWidgets(); - - _heightmapLoaded = false; - } - - void OnClose() override - { - MapGenUnloadHeightmap(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (page) + public: + void OnOpen() override { - case WINDOW_MAPGEN_PAGE_BASE: - return BaseMouseUp(widgetIndex); - case WINDOW_MAPGEN_PAGE_RANDOM: - return RandomMouseUp(widgetIndex); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return SimplexMouseUp(widgetIndex); - case WINDOW_MAPGEN_PAGE_HEIGHTMAP: - return HeightmapMouseUp(widgetIndex); + number = 0; + frame_no = 0; + + page = WINDOW_MAPGEN_PAGE_BASE; + Invalidate(); + widgets = PageWidgets[WINDOW_MAPGEN_PAGE_BASE]; + hold_down_widgets = HoldDownWidgets[WINDOW_MAPGEN_PAGE_BASE]; + pressed_widgets = PressedWidgets[WINDOW_MAPGEN_PAGE_BASE]; + disabled_widgets = PageDisabledWidgets[WINDOW_MAPGEN_PAGE_BASE]; + InitScrollWidgets(); + + _heightmapLoaded = false; } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) + void OnClose() override { - case WINDOW_MAPGEN_PAGE_BASE: - return BaseMouseDown(widgetIndex, &widgets[widgetIndex]); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return SimplexMouseDown(widgetIndex, &widgets[widgetIndex]); - case WINDOW_MAPGEN_PAGE_HEIGHTMAP: - return HeightmapMouseDown(widgetIndex, &widgets[widgetIndex]); + MapGenUnloadHeightmap(); } - } - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - switch (page) + void OnMouseUp(WidgetIndex widgetIndex) override { - case WINDOW_MAPGEN_PAGE_BASE: - return BaseDropdown(widgetIndex, selectedIndex); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return SimplexDropdown(widgetIndex, selectedIndex); - } - } - - void OnUpdate() override - { - switch (page) - { - case WINDOW_MAPGEN_PAGE_BASE: - return BaseUpdate(); - case WINDOW_MAPGEN_PAGE_RANDOM: - return RandomUpdate(); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return SimplexUpdate(); - } - } - - void OnPrepareDraw() override - { - switch (page) - { - case WINDOW_MAPGEN_PAGE_BASE: - return BasePrepareDraw(); - case WINDOW_MAPGEN_PAGE_RANDOM: - return RandomPrepareDraw(); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return SimplexPrepareDraw(); - case WINDOW_MAPGEN_PAGE_HEIGHTMAP: - return HeightmapPrepareDraw(); - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_MAPGEN_PAGE_BASE: - return BaseDraw(dpi); - case WINDOW_MAPGEN_PAGE_RANDOM: - return RandomDraw(dpi); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return SimplexDraw(dpi); - case WINDOW_MAPGEN_PAGE_HEIGHTMAP: - return HeightmapDraw(dpi); - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - switch (page) - { - case WINDOW_MAPGEN_PAGE_BASE: - return TextInput(widgetIndex, text); - case WINDOW_MAPGEN_PAGE_SIMPLEX: - return TextInput(widgetIndex, text); - } - } - - void AfterLoadingHeightMap(int32_t result, const utf8* path) - { - if (result == MODAL_RESULT_OK) - { - if (!MapGenLoadHeightmap(path)) + switch (page) { - // TODO: Display error popup - return; + case WINDOW_MAPGEN_PAGE_BASE: + return BaseMouseUp(widgetIndex); + case WINDOW_MAPGEN_PAGE_RANDOM: + return RandomMouseUp(widgetIndex); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return SimplexMouseUp(widgetIndex); + case WINDOW_MAPGEN_PAGE_HEIGHTMAP: + return HeightmapMouseUp(widgetIndex); } - - // The window needs to be open while using the map - _heightmapLoaded = true; - SetPage(WINDOW_MAPGEN_PAGE_HEIGHTMAP); - - HeightmapGenerateMap(); } - } - void OnResize() override + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (page) + { + case WINDOW_MAPGEN_PAGE_BASE: + return BaseMouseDown(widgetIndex, &widgets[widgetIndex]); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return SimplexMouseDown(widgetIndex, &widgets[widgetIndex]); + case WINDOW_MAPGEN_PAGE_HEIGHTMAP: + return HeightmapMouseDown(widgetIndex, &widgets[widgetIndex]); + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + switch (page) + { + case WINDOW_MAPGEN_PAGE_BASE: + return BaseDropdown(widgetIndex, selectedIndex); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return SimplexDropdown(widgetIndex, selectedIndex); + } + } + + void OnUpdate() override + { + switch (page) + { + case WINDOW_MAPGEN_PAGE_BASE: + return BaseUpdate(); + case WINDOW_MAPGEN_PAGE_RANDOM: + return RandomUpdate(); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return SimplexUpdate(); + } + } + + void OnPrepareDraw() override + { + switch (page) + { + case WINDOW_MAPGEN_PAGE_BASE: + return BasePrepareDraw(); + case WINDOW_MAPGEN_PAGE_RANDOM: + return RandomPrepareDraw(); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return SimplexPrepareDraw(); + case WINDOW_MAPGEN_PAGE_HEIGHTMAP: + return HeightmapPrepareDraw(); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_MAPGEN_PAGE_BASE: + return BaseDraw(dpi); + case WINDOW_MAPGEN_PAGE_RANDOM: + return RandomDraw(dpi); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return SimplexDraw(dpi); + case WINDOW_MAPGEN_PAGE_HEIGHTMAP: + return HeightmapDraw(dpi); + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + switch (page) + { + case WINDOW_MAPGEN_PAGE_BASE: + return TextInput(widgetIndex, text); + case WINDOW_MAPGEN_PAGE_SIMPLEX: + return TextInput(widgetIndex, text); + } + } + + void AfterLoadingHeightMap(int32_t result, const utf8* path) + { + if (result == MODAL_RESULT_OK) + { + if (!MapGenLoadHeightmap(path)) + { + // TODO: Display error popup + return; + } + + // The window needs to be open while using the map + _heightmapLoaded = true; + SetPage(WINDOW_MAPGEN_PAGE_HEIGHTMAP); + + HeightmapGenerateMap(); + } + } + + void OnResize() override + { + ResizeFrameWithPage(); + } + }; + + WindowBase* WindowMapgenOpen() { - ResizeFrameWithPage(); + return WindowFocusOrCreate(WindowClass::Mapgen, WW, WH, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); } -}; -WindowBase* WindowMapgenOpen() -{ - return WindowFocusOrCreate(WindowClass::Mapgen, WW, WH, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); -} - -static void HeightmapLoadsaveCallback(int32_t result, const utf8* path) -{ - auto* w = static_cast(WindowMapgenOpen()); - w->AfterLoadingHeightMap(result, path); -} + static void HeightmapLoadsaveCallback(int32_t result, const utf8* path) + { + auto* w = static_cast(WindowMapgenOpen()); + w->AfterLoadingHeightMap(result, path); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/MapTooltip.cpp b/src/openrct2-ui/windows/MapTooltip.cpp index 0361c3e6b3..331df333f8 100644 --- a/src/openrct2-ui/windows/MapTooltip.cpp +++ b/src/openrct2-ui/windows/MapTooltip.cpp @@ -17,7 +17,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off static Widget window_map_tooltip_widgets[] = { MakeWidget({0, 0}, {200, 30}, WindowWidgetType::ImgBtn, WindowColour::Primary), kWidgetsEnd, @@ -26,105 +28,106 @@ static Widget window_map_tooltip_widgets[] = { // clang-format on #define MAP_TOOLTIP_ARGS -static ScreenCoordsXY _lastCursor; -static int32_t _cursorHoldDuration; + static ScreenCoordsXY _lastCursor; + static int32_t _cursorHoldDuration; -static void WindowMapTooltipOpen(); + static void WindowMapTooltipOpen(); -static Formatter _mapTooltipArgs; + static Formatter _mapTooltipArgs; -class MapTooltip final : public Window -{ -public: - void OnOpen() override + class MapTooltip final : public Window { - widgets = window_map_tooltip_widgets; - } - - void OnUpdate() override - { - Invalidate(); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - StringId stringId; - std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); - if (stringId == STR_NONE) + public: + void OnOpen() override { + widgets = window_map_tooltip_widgets; + } + + void OnUpdate() override + { + Invalidate(); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + StringId stringId; + std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); + if (stringId == STR_NONE) + { + return; + } + + auto stringCoords = windowPos + ScreenCoordsXY{ width / 2, height / 2 }; + DrawTextWrapped(dpi, stringCoords, width, STR_MAP_TOOLTIP_STRINGID, _mapTooltipArgs, { TextAlignment::CENTRE }); + } + }; + + void SetMapTooltip(Formatter& ft) + { + _mapTooltipArgs = ft; + } + + const Formatter& GetMapTooltip() + { + return _mapTooltipArgs; + } + + void WindowMapTooltipUpdateVisibility() + { + if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) + { + // The map tooltip is drawn by the bottom toolbar + WindowInvalidateByClass(WindowClass::BottomToolbar); return; } - auto stringCoords = windowPos + ScreenCoordsXY{ width / 2, height / 2 }; - DrawTextWrapped(dpi, stringCoords, width, STR_MAP_TOOLTIP_STRINGID, _mapTooltipArgs, { TextAlignment::CENTRE }); + const CursorState* state = ContextGetCursorState(); + auto cursor = state->position; + auto cursorChange = cursor - _lastCursor; + + // Check for cursor movement + _cursorHoldDuration++; + if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (InputTestFlag(INPUT_FLAG_5)) + || InputGetState() == InputState::ViewportRight) + _cursorHoldDuration = 0; + + _lastCursor = cursor; + + // Show or hide tooltip + StringId stringId; + std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); + + if (_cursorHoldDuration < 25 || stringId == STR_NONE + || InputTestPlaceObjectModifier( + static_cast(PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z)) + || WindowFindByClass(WindowClass::Error) != nullptr) + { + WindowCloseByClass(WindowClass::MapTooltip); + } + else + { + WindowMapTooltipOpen(); + } } -}; -void SetMapTooltip(Formatter& ft) -{ - _mapTooltipArgs = ft; -} - -const Formatter& GetMapTooltip() -{ - return _mapTooltipArgs; -} - -void WindowMapTooltipUpdateVisibility() -{ - if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR) + static void WindowMapTooltipOpen() { - // The map tooltip is drawn by the bottom toolbar - WindowInvalidateByClass(WindowClass::BottomToolbar); - return; + constexpr int32_t width = 200; + constexpr int32_t height = 44; + const CursorState* state = ContextGetCursorState(); + auto pos = state->position + ScreenCoordsXY{ -width / 2, 15 }; + + if (auto w = WindowFindByClass(WindowClass::MapTooltip)) + { + w->Invalidate(); + w->windowPos = pos; + w->width = width; + w->height = height; + } + else + { + w = WindowCreate( + WindowClass::MapTooltip, pos, width, height, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); + } } - - const CursorState* state = ContextGetCursorState(); - auto cursor = state->position; - auto cursorChange = cursor - _lastCursor; - - // Check for cursor movement - _cursorHoldDuration++; - if (abs(cursorChange.x) > 5 || abs(cursorChange.y) > 5 || (InputTestFlag(INPUT_FLAG_5)) - || InputGetState() == InputState::ViewportRight) - _cursorHoldDuration = 0; - - _lastCursor = cursor; - - // Show or hide tooltip - StringId stringId; - std::memcpy(&stringId, _mapTooltipArgs.Data(), sizeof(StringId)); - - if (_cursorHoldDuration < 25 || stringId == STR_NONE - || InputTestPlaceObjectModifier( - static_cast(PLACE_OBJECT_MODIFIER_COPY_Z | PLACE_OBJECT_MODIFIER_SHIFT_Z)) - || WindowFindByClass(WindowClass::Error) != nullptr) - { - WindowCloseByClass(WindowClass::MapTooltip); - } - else - { - WindowMapTooltipOpen(); - } -} - -static void WindowMapTooltipOpen() -{ - constexpr int32_t width = 200; - constexpr int32_t height = 44; - const CursorState* state = ContextGetCursorState(); - auto pos = state->position + ScreenCoordsXY{ -width / 2, 15 }; - - if (auto w = WindowFindByClass(WindowClass::MapTooltip)) - { - w->Invalidate(); - w->windowPos = pos; - w->width = width; - w->height = height; - } - else - { - w = WindowCreate( - WindowClass::MapTooltip, pos, width, height, WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 48ba5c9832..34cde8c77c 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -26,13 +26,15 @@ #include #include +namespace OpenRCT2::Ui::Windows +{ #pragma region Widgets -static constexpr StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; -static constexpr int32_t WH = 200; -static constexpr int32_t WW = 166; + static constexpr StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; + static constexpr int32_t WH = 200; + static constexpr int32_t WW = 166; -// clang-format off + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -91,389 +93,391 @@ static Widget window_maze_construction_widgets[] = { }; #pragma endregion -// clang-format on + // clang-format on -class MazeConstructionWindow final : public Window -{ -public: - void OnOpen() override + class MazeConstructionWindow final : public Window { - widgets = window_maze_construction_widgets; - WindowInitScrollWidgets(*this); - rideId = _currentRideIndex; - ShowGridlines(); - } - - void OnClose() override - { - RideConstructionInvalidateCurrentTrack(); - ViewportSetVisibility(ViewportVisibility::Default); - - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - // In order to cancel the yellow arrow correctly the - // selection tool should be cancelled. - ToolCancel(); - - HideGridlines(); - - auto currentRide = GetRide(_currentRideIndex); - if (currentRide != nullptr) + public: + void OnOpen() override { - if (currentRide->overall_view.IsNull()) - { - auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH); - gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - GameActions::Execute(&gameAction); - } - else - { - auto intent = Intent(WindowClass::Ride); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); - ContextOpenIntent(&intent); - } - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_MAZE_ENTRANCE: - case WIDX_MAZE_EXIT: - WindowMazeConstructionEntranceMouseup(widgetIndex); - break; - case WIDX_MAZE_DIRECTION_NW: - case WIDX_MAZE_DIRECTION_NE: - case WIDX_MAZE_DIRECTION_SE: - case WIDX_MAZE_DIRECTION_SW: - WindowMazeConstructionConstruct(((widgetIndex - WIDX_MAZE_DIRECTION_NW) - GetCurrentRotation()) & 3); - break; - } - } - - void OnResize() override - { - ResizeFrameWithPage(); - uint64_t disabledWidgets = 0; - if (_rideConstructionState == RideConstructionState::Place) - { - disabledWidgets - |= ((1uLL << WIDX_MAZE_BUILD_MODE) | (1uLL << WIDX_MAZE_MOVE_MODE) | (1uLL << WIDX_MAZE_FILL_MODE) - | (1uLL << WIDX_MAZE_DIRECTION_NW) | (1uLL << WIDX_MAZE_DIRECTION_NE) | (1uLL << WIDX_MAZE_DIRECTION_SW) - | (1uLL << WIDX_MAZE_DIRECTION_SE)); - } - else if (_rideConstructionState == RideConstructionState::EntranceExit) - { - disabledWidgets = (1uLL << WIDX_MAZE_DIRECTION_NW) | (1uLL << WIDX_MAZE_DIRECTION_NE) - | (1uLL << WIDX_MAZE_DIRECTION_SW) | (1uLL << WIDX_MAZE_DIRECTION_SE); + widgets = window_maze_construction_widgets; + WindowInitScrollWidgets(*this); + rideId = _currentRideIndex; + ShowGridlines(); } - // Set and invalidate the changed widgets - uint64_t currentDisabledWidgets = disabled_widgets; - if (currentDisabledWidgets == disabledWidgets) - return; - - for (WidgetIndex i = 0; i < 64; i++) + void OnClose() override { - if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) - { - WidgetInvalidate(*this, i); - } - } - disabled_widgets = disabledWidgets; - } + RideConstructionInvalidateCurrentTrack(); + ViewportSetVisibility(ViewportVisibility::Default); - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_MAZE_BUILD_MODE: - WindowMazeConstructionBuildModeMousedown(RideConstructionState::MazeBuild); - break; - case WIDX_MAZE_MOVE_MODE: - WindowMazeConstructionBuildModeMousedown(RideConstructionState::MazeMove); - break; - case WIDX_MAZE_FILL_MODE: - WindowMazeConstructionBuildModeMousedown(RideConstructionState::MazeFill); - break; - } - } + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - void OnUpdate() override - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr || currentRide->status != RideStatus::Closed) - { - Close(); - return; - } - - switch (_rideConstructionState) - { - case RideConstructionState::Place: - if (!WidgetIsActiveTool(*this, WIDX_MAZE_DIRECTION_GROUPBOX)) - { - Close(); - return; - } - break; - case RideConstructionState::EntranceExit: - if (!WidgetIsActiveTool(*this, WIDX_MAZE_ENTRANCE) && !WidgetIsActiveTool(*this, WIDX_MAZE_EXIT)) - { - _rideConstructionState = gRideEntranceExitPlacePreviousRideConstructionState; - WindowMazeConstructionUpdatePressedWidgets(); - } - break; - default: - break; - } - - switch (_rideConstructionState) - { - case RideConstructionState::Front: - case RideConstructionState::Back: - case RideConstructionState::Selected: - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - && gCurrentToolWidget.window_classification == WindowClass::RideConstruction) - { - ToolCancel(); - } - break; - default: - break; - } - UpdateGhostTrackAndArrow(); - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_MAZE_DIRECTION_GROUPBOX: - RideConstructionToolupdateConstruct(screenCoords); - break; - case WIDX_MAZE_ENTRANCE: - case WIDX_MAZE_EXIT: - RideConstructionToolupdateEntranceExit(screenCoords); - break; - } - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_MAZE_DIRECTION_GROUPBOX: - RideConstructionTooldownConstruct(screenCoords); - break; - case WIDX_MAZE_ENTRANCE: - case WIDX_MAZE_EXIT: - WindowMazeConstructionEntranceTooldown(screenCoords); - break; - } - } - - void OnPrepareDraw() override - { - auto currentRide = GetRide(_currentRideIndex); - auto ft = Formatter::Common(); - if (currentRide != nullptr) - { - ft.Increment(4); - currentRide->FormatNameTo(ft); - } - else - { - ft.Increment(4); - ft.Add(STR_NONE); - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - } - -private: - void WindowMazeConstructionEntranceMouseup(WidgetIndex widgetIndex) - { - if (ToolSet(*this, widgetIndex, Tool::Crosshair)) - return; - - gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE : ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = rideId; - gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0); - InputSetFlag(INPUT_FLAG_6, true); - - RideConstructionInvalidateCurrentTrack(); - - if (_rideConstructionState != RideConstructionState::EntranceExit) - { - gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - } - _rideConstructionState = RideConstructionState::EntranceExit; - - WindowMazeConstructionUpdatePressedWidgets(); - } - - void WindowMazeConstructionBuildModeMousedown(RideConstructionState rideConstructionState) - { - if (_rideConstructionState == RideConstructionState::EntranceExit) - { + // In order to cancel the yellow arrow correctly the + // selection tool should be cancelled. ToolCancel(); + + HideGridlines(); + + auto currentRide = GetRide(_currentRideIndex); + if (currentRide != nullptr) + { + if (currentRide->overall_view.IsNull()) + { + auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH); + gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + GameActions::Execute(&gameAction); + } + else + { + auto intent = Intent(WindowClass::Ride); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); + ContextOpenIntent(&intent); + } + } } - _rideConstructionState = rideConstructionState; - WindowMazeConstructionUpdatePressedWidgets(); - } - void WindowMazeConstructionEntranceTooldown(const ScreenCoordsXY& screenCoords) - { - RideConstructionInvalidateCurrentTrack(); + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_MAZE_ENTRANCE: + case WIDX_MAZE_EXIT: + WindowMazeConstructionEntranceMouseup(widgetIndex); + break; + case WIDX_MAZE_DIRECTION_NW: + case WIDX_MAZE_DIRECTION_NE: + case WIDX_MAZE_DIRECTION_SE: + case WIDX_MAZE_DIRECTION_SW: + WindowMazeConstructionConstruct(((widgetIndex - WIDX_MAZE_DIRECTION_NW) - GetCurrentRotation()) & 3); + break; + } + } - MapInvalidateSelectionRect(); + void OnResize() override + { + ResizeFrameWithPage(); + uint64_t disabledWidgets = 0; + if (_rideConstructionState == RideConstructionState::Place) + { + disabledWidgets + |= ((1uLL << WIDX_MAZE_BUILD_MODE) | (1uLL << WIDX_MAZE_MOVE_MODE) | (1uLL << WIDX_MAZE_FILL_MODE) + | (1uLL << WIDX_MAZE_DIRECTION_NW) | (1uLL << WIDX_MAZE_DIRECTION_NE) | (1uLL << WIDX_MAZE_DIRECTION_SW) + | (1uLL << WIDX_MAZE_DIRECTION_SE)); + } + else if (_rideConstructionState == RideConstructionState::EntranceExit) + { + disabledWidgets = (1uLL << WIDX_MAZE_DIRECTION_NW) | (1uLL << WIDX_MAZE_DIRECTION_NE) + | (1uLL << WIDX_MAZE_DIRECTION_SW) | (1uLL << WIDX_MAZE_DIRECTION_SE); + } - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords); - if (entranceOrExitCoords.IsNull()) - return; - - if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) - return; - - RideId rideIndex = gRideEntranceExitPlaceRideIndex; - - auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( - entranceOrExitCoords, DirectionReverse(entranceOrExitCoords.direction), rideIndex, - gRideEntranceExitPlaceStationIndex, gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_EXIT); - - rideEntranceExitPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + // Set and invalidate the changed widgets + uint64_t currentDisabledWidgets = disabled_widgets; + if (currentDisabledWidgets == disabledWidgets) return; - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + for (WidgetIndex i = 0; i < 64; i++) + { + if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) + { + WidgetInvalidate(*this, i); + } + } + disabled_widgets = disabledWidgets; + } - auto currentRide = GetRide(rideIndex); - if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful) + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_MAZE_BUILD_MODE: + WindowMazeConstructionBuildModeMousedown(RideConstructionState::MazeBuild); + break; + case WIDX_MAZE_MOVE_MODE: + WindowMazeConstructionBuildModeMousedown(RideConstructionState::MazeMove); + break; + case WIDX_MAZE_FILL_MODE: + WindowMazeConstructionBuildModeMousedown(RideConstructionState::MazeFill); + break; + } + } + + void OnUpdate() override + { + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr || currentRide->status != RideStatus::Closed) + { + Close(); + return; + } + + switch (_rideConstructionState) + { + case RideConstructionState::Place: + if (!WidgetIsActiveTool(*this, WIDX_MAZE_DIRECTION_GROUPBOX)) + { + Close(); + return; + } + break; + case RideConstructionState::EntranceExit: + if (!WidgetIsActiveTool(*this, WIDX_MAZE_ENTRANCE) && !WidgetIsActiveTool(*this, WIDX_MAZE_EXIT)) + { + _rideConstructionState = gRideEntranceExitPlacePreviousRideConstructionState; + WindowMazeConstructionUpdatePressedWidgets(); + } + break; + default: + break; + } + + switch (_rideConstructionState) + { + case RideConstructionState::Front: + case RideConstructionState::Back: + case RideConstructionState::Selected: + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + && gCurrentToolWidget.window_classification == WindowClass::RideConstruction) + { + ToolCancel(); + } + break; + default: + break; + } + UpdateGhostTrackAndArrow(); + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (widgetIndex) + { + case WIDX_MAZE_DIRECTION_GROUPBOX: + RideConstructionToolupdateConstruct(screenCoords); + break; + case WIDX_MAZE_ENTRANCE: + case WIDX_MAZE_EXIT: + RideConstructionToolupdateEntranceExit(screenCoords); + break; + } + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (widgetIndex) + { + case WIDX_MAZE_DIRECTION_GROUPBOX: + RideConstructionTooldownConstruct(screenCoords); + break; + case WIDX_MAZE_ENTRANCE: + case WIDX_MAZE_EXIT: + WindowMazeConstructionEntranceTooldown(screenCoords); + break; + } + } + + void OnPrepareDraw() override + { + auto currentRide = GetRide(_currentRideIndex); + auto ft = Formatter::Common(); + if (currentRide != nullptr) + { + ft.Increment(4); + currentRide->FormatNameTo(ft); + } + else + { + ft.Increment(4); + ft.Add(STR_NONE); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + } + + private: + void WindowMazeConstructionEntranceMouseup(WidgetIndex widgetIndex) + { + if (ToolSet(*this, widgetIndex, Tool::Crosshair)) + return; + + gRideEntranceExitPlaceType = widgetIndex == WIDX_MAZE_ENTRANCE ? ENTRANCE_TYPE_RIDE_ENTRANCE + : ENTRANCE_TYPE_RIDE_EXIT; + gRideEntranceExitPlaceRideIndex = rideId; + gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0); + InputSetFlag(INPUT_FLAG_6, true); + + RideConstructionInvalidateCurrentTrack(); + + if (_rideConstructionState != RideConstructionState::EntranceExit) + { + gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; + } + _rideConstructionState = RideConstructionState::EntranceExit; + + WindowMazeConstructionUpdatePressedWidgets(); + } + + void WindowMazeConstructionBuildModeMousedown(RideConstructionState rideConstructionState) + { + if (_rideConstructionState == RideConstructionState::EntranceExit) { ToolCancel(); - if (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) - WindowCloseByClass(WindowClass::RideConstruction); } - else - { - gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1; - WindowInvalidateByClass(WindowClass::RideConstruction); - gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE) - ? WIDX_MAZE_ENTRANCE - : WIDX_MAZE_EXIT; + _rideConstructionState = rideConstructionState; + WindowMazeConstructionUpdatePressedWidgets(); + } - WindowMazeConstructionUpdatePressedWidgets(); + void WindowMazeConstructionEntranceTooldown(const ScreenCoordsXY& screenCoords) + { + RideConstructionInvalidateCurrentTrack(); + + MapInvalidateSelectionRect(); + + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords); + if (entranceOrExitCoords.IsNull()) + return; + + if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) + return; + + RideId rideIndex = gRideEntranceExitPlaceRideIndex; + + auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( + entranceOrExitCoords, DirectionReverse(entranceOrExitCoords.direction), rideIndex, + gRideEntranceExitPlaceStationIndex, gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_EXIT); + + rideEntranceExitPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + + auto currentRide = GetRide(rideIndex); + if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful) + { + ToolCancel(); + if (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + WindowCloseByClass(WindowClass::RideConstruction); + } + else + { + gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1; + WindowInvalidateByClass(WindowClass::RideConstruction); + gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE) + ? WIDX_MAZE_ENTRANCE + : WIDX_MAZE_EXIT; + + WindowMazeConstructionUpdatePressedWidgets(); + } + }); + auto res = GameActions::Execute(&rideEntranceExitPlaceAction); + } + + void WindowMazeConstructionConstruct(int32_t direction) + { + int32_t x, y, z, actionFlags = 0, mode; + + _currentTrackSelectionFlags = 0; + _rideConstructionNextArrowPulse = 0; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + RideConstructionInvalidateCurrentTrack(); + + x = _currentTrackBegin.x + (CoordsDirectionDelta[direction].x / 2); + y = _currentTrackBegin.y + (CoordsDirectionDelta[direction].y / 2); + z = _currentTrackBegin.z; + switch (_rideConstructionState) + { + case RideConstructionState::MazeBuild: + mode = GC_SET_MAZE_TRACK_BUILD; + break; + case RideConstructionState::MazeMove: + mode = GC_SET_MAZE_TRACK_MOVE; + actionFlags = GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED; + break; + default: + case RideConstructionState::MazeFill: + mode = GC_SET_MAZE_TRACK_FILL; + break; } - }); - auto res = GameActions::Execute(&rideEntranceExitPlaceAction); + + const auto loc = CoordsXYZD{ x, y, z, static_cast(direction) }; + auto action = MazeSetTrackAction(loc, false, _currentRideIndex, mode); + action.SetFlags(actionFlags); + const auto res = GameActions::Execute(&action); + if (res.Error != GameActions::Status::Ok) + { + return; + } + + _currentTrackBegin.x = x; + _currentTrackBegin.y = y; + if (_rideConstructionState != RideConstructionState::MazeMove) + { + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { x, y, z }); + } + } + }; + + WindowBase* WindowMazeConstructionOpen() + { + return WindowFocusOrCreate( + WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); } - void WindowMazeConstructionConstruct(int32_t direction) + void WindowMazeConstructionUpdatePressedWidgets() { - int32_t x, y, z, actionFlags = 0, mode; + WindowBase* w; - _currentTrackSelectionFlags = 0; - _rideConstructionNextArrowPulse = 0; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - RideConstructionInvalidateCurrentTrack(); + w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr) + return; + + uint64_t pressedWidgets = w->pressed_widgets; + + // Unpress all the mode buttons + pressedWidgets &= ~EnumToFlag(WIDX_MAZE_BUILD_MODE); + pressedWidgets &= ~EnumToFlag(WIDX_MAZE_MOVE_MODE); + pressedWidgets &= ~EnumToFlag(WIDX_MAZE_FILL_MODE); + pressedWidgets &= ~EnumToFlag(WIDX_MAZE_ENTRANCE); + pressedWidgets &= ~EnumToFlag(WIDX_MAZE_EXIT); - x = _currentTrackBegin.x + (CoordsDirectionDelta[direction].x / 2); - y = _currentTrackBegin.y + (CoordsDirectionDelta[direction].y / 2); - z = _currentTrackBegin.z; switch (_rideConstructionState) { + case RideConstructionState::EntranceExit: + if (gCurrentToolWidget.widget_index == WIDX_MAZE_ENTRANCE) + { + pressedWidgets |= EnumToFlag(WIDX_MAZE_ENTRANCE); + } + else + { + pressedWidgets |= EnumToFlag(WIDX_MAZE_EXIT); + } + break; case RideConstructionState::MazeBuild: - mode = GC_SET_MAZE_TRACK_BUILD; + pressedWidgets |= EnumToFlag(WIDX_MAZE_BUILD_MODE); break; case RideConstructionState::MazeMove: - mode = GC_SET_MAZE_TRACK_MOVE; - actionFlags = GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED; + pressedWidgets |= EnumToFlag(WIDX_MAZE_MOVE_MODE); + break; + case RideConstructionState::MazeFill: + pressedWidgets |= EnumToFlag(WIDX_MAZE_FILL_MODE); break; default: - case RideConstructionState::MazeFill: - mode = GC_SET_MAZE_TRACK_FILL; break; } - const auto loc = CoordsXYZD{ x, y, z, static_cast(direction) }; - auto action = MazeSetTrackAction(loc, false, _currentRideIndex, mode); - action.SetFlags(actionFlags); - const auto res = GameActions::Execute(&action); - if (res.Error != GameActions::Status::Ok) - { - return; - } - - _currentTrackBegin.x = x; - _currentTrackBegin.y = y; - if (_rideConstructionState != RideConstructionState::MazeMove) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, { x, y, z }); - } + w->pressed_widgets = pressedWidgets; + w->Invalidate(); } -}; - -WindowBase* WindowMazeConstructionOpen() -{ - return WindowFocusOrCreate( - WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); -} - -void WindowMazeConstructionUpdatePressedWidgets() -{ - WindowBase* w; - - w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr) - return; - - uint64_t pressedWidgets = w->pressed_widgets; - - // Unpress all the mode buttons - pressedWidgets &= ~EnumToFlag(WIDX_MAZE_BUILD_MODE); - pressedWidgets &= ~EnumToFlag(WIDX_MAZE_MOVE_MODE); - pressedWidgets &= ~EnumToFlag(WIDX_MAZE_FILL_MODE); - pressedWidgets &= ~EnumToFlag(WIDX_MAZE_ENTRANCE); - pressedWidgets &= ~EnumToFlag(WIDX_MAZE_EXIT); - - switch (_rideConstructionState) - { - case RideConstructionState::EntranceExit: - if (gCurrentToolWidget.widget_index == WIDX_MAZE_ENTRANCE) - { - pressedWidgets |= EnumToFlag(WIDX_MAZE_ENTRANCE); - } - else - { - pressedWidgets |= EnumToFlag(WIDX_MAZE_EXIT); - } - break; - case RideConstructionState::MazeBuild: - pressedWidgets |= EnumToFlag(WIDX_MAZE_BUILD_MODE); - break; - case RideConstructionState::MazeMove: - pressedWidgets |= EnumToFlag(WIDX_MAZE_MOVE_MODE); - break; - case RideConstructionState::MazeFill: - pressedWidgets |= EnumToFlag(WIDX_MAZE_FILL_MODE); - break; - default: - break; - } - - w->pressed_widgets = pressedWidgets; - w->Invalidate(); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 7be9caed98..08eccaece4 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -20,7 +20,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WINDOW_MULTIPLAYER_PAGE_INFORMATION, WINDOW_MULTIPLAYER_PAGE_PLAYERS, @@ -118,831 +120,834 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { STR_MULTIPLAYER_OPTIONS_TITLE, }; -// clang-format on + // clang-format on -static constexpr int32_t window_multiplayer_animation_divisor[] = { - 4, - 4, - 2, - 2, -}; -static constexpr int32_t window_multiplayer_animation_frames[] = { - 8, - 8, - 7, - 4, -}; + static constexpr int32_t window_multiplayer_animation_divisor[] = { + 4, + 4, + 2, + 2, + }; + static constexpr int32_t window_multiplayer_animation_frames[] = { + 8, + 8, + 7, + 4, + }; -static bool IsServerPlayerInvisible() -{ - return NetworkIsServerPlayerInvisible() && !gConfigGeneral.DebuggingTools; -} - -class MultiplayerWindow final : public Window -{ -private: - std::optional _windowInformationSize; - uint8_t _selectedGroup{ 0 }; - -private: - void ResetPressedWidgets(); - - void InformationPaint(DrawPixelInfo& dpi); - void PlayersPaint(DrawPixelInfo& dpi); - void GroupsPaint(DrawPixelInfo& dpi); - - void DrawTabImage(DrawPixelInfo& dpi, int32_t page_number, int32_t spriteIndex); - void DrawTabImages(DrawPixelInfo& dpi); - - void PlayersScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const; - void GroupsScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const; - - void ShowGroupDropdown(WidgetIndex widgetIndex); - ScreenCoordsXY InformationGetSize(); - -public: - void OnOpen() override; - - void SetPage(int32_t page_number); - - void OnMouseUp(WidgetIndex widgetIndex) override; - void OnResize() override; - void OnUpdate() override; - void OnPrepareDraw() override; - void OnDraw(DrawPixelInfo& dpi) override; - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override; - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override; - void OnMouseDown(WidgetIndex widgetIndex) override; - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override; - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override; - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override; - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override; -}; - -WindowBase* WindowMultiplayerOpen() -{ - // Check if window is already open - WindowBase* window = WindowBringToFrontByClass(WindowClass::Multiplayer); - if (window == nullptr) + static bool IsServerPlayerInvisible() { - window = WindowCreate(WindowClass::Multiplayer, 320, 144, WF_10 | WF_RESIZABLE | WF_AUTO_POSITION); + return NetworkIsServerPlayerInvisible() && !gConfigGeneral.DebuggingTools; } - return window; -} - -void MultiplayerWindow::OnOpen() -{ - SetPage(WINDOW_MULTIPLAYER_PAGE_INFORMATION); -} - -void MultiplayerWindow::SetPage(int32_t page_number) -{ - _windowInformationSize.reset(); - - page = page_number; - frame_no = 0; - no_list_items = 0; - selected_list_item = -1; - - hold_down_widgets = 0; - pressed_widgets = 0; - widgets = window_multiplayer_page_widgets[page]; - widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page]; - - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - Invalidate(); -} - -void MultiplayerWindow::OnMouseUp(WidgetIndex widgetIndex) -{ - switch (widgetIndex) + class MultiplayerWindow final : public Window { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB1: - case WIDX_TAB2: - case WIDX_TAB3: - case WIDX_TAB4: - if (page != widgetIndex - WIDX_TAB1) - { - SetPage(widgetIndex - WIDX_TAB1); - } - break; - } - switch (page) + private: + std::optional _windowInformationSize; + uint8_t _selectedGroup{ 0 }; + + private: + void ResetPressedWidgets(); + + void InformationPaint(DrawPixelInfo& dpi); + void PlayersPaint(DrawPixelInfo& dpi); + void GroupsPaint(DrawPixelInfo& dpi); + + void DrawTabImage(DrawPixelInfo& dpi, int32_t page_number, int32_t spriteIndex); + void DrawTabImages(DrawPixelInfo& dpi); + + void PlayersScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const; + void GroupsScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const; + + void ShowGroupDropdown(WidgetIndex widgetIndex); + ScreenCoordsXY InformationGetSize(); + + public: + void OnOpen() override; + + void SetPage(int32_t page_number); + + void OnMouseUp(WidgetIndex widgetIndex) override; + void OnResize() override; + void OnUpdate() override; + void OnPrepareDraw() override; + void OnDraw(DrawPixelInfo& dpi) override; + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override; + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override; + void OnMouseDown(WidgetIndex widgetIndex) override; + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override; + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override; + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override; + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override; + }; + + WindowBase* WindowMultiplayerOpen() { - case WINDOW_MULTIPLAYER_PAGE_GROUPS: + // Check if window is already open + WindowBase* window = WindowBringToFrontByClass(WindowClass::Multiplayer); + if (window == nullptr) { - switch (widgetIndex) - { - case WIDX_ADD_GROUP: + window = WindowCreate( + WindowClass::Multiplayer, 320, 144, WF_10 | WF_RESIZABLE | WF_AUTO_POSITION); + } + + return window; + } + + void MultiplayerWindow::OnOpen() + { + SetPage(WINDOW_MULTIPLAYER_PAGE_INFORMATION); + } + + void MultiplayerWindow::SetPage(int32_t page_number) + { + _windowInformationSize.reset(); + + page = page_number; + frame_no = 0; + no_list_items = 0; + selected_list_item = -1; + + hold_down_widgets = 0; + pressed_widgets = 0; + widgets = window_multiplayer_page_widgets[page]; + widgets[WIDX_TITLE].text = WindowMultiplayerPageTitles[page]; + + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + Invalidate(); + } + + void MultiplayerWindow::OnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB1: + case WIDX_TAB2: + case WIDX_TAB3: + case WIDX_TAB4: + if (page != widgetIndex - WIDX_TAB1) { - auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::AddGroup); - GameActions::Execute(&networkModifyGroup); - break; + SetPage(widgetIndex - WIDX_TAB1); } - case WIDX_REMOVE_GROUP: + break; + } + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + switch (widgetIndex) { - auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::RemoveGroup, _selectedGroup); - GameActions::Execute(&networkModifyGroup); - break; + case WIDX_ADD_GROUP: + { + auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::AddGroup); + GameActions::Execute(&networkModifyGroup); + break; + } + case WIDX_REMOVE_GROUP: + { + auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::RemoveGroup, _selectedGroup); + GameActions::Execute(&networkModifyGroup); + break; + } + case WIDX_RENAME_GROUP: + { + int32_t groupIndex = NetworkGetGroupIndex(_selectedGroup); + const utf8* groupName = NetworkGetGroupName(groupIndex); + WindowTextInputRawOpen( + this, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, {}, groupName, 32); + break; + } } - case WIDX_RENAME_GROUP: + break; + } + case WINDOW_MULTIPLAYER_PAGE_OPTIONS: + { + switch (widgetIndex) { - int32_t groupIndex = NetworkGetGroupIndex(_selectedGroup); - const utf8* groupName = NetworkGetGroupName(groupIndex); - WindowTextInputRawOpen( - this, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, {}, groupName, 32); - break; + case WIDX_LOG_CHAT_CHECKBOX: + gConfigNetwork.LogChat = !gConfigNetwork.LogChat; + ConfigSaveDefault(); + break; + case WIDX_LOG_SERVER_ACTIONS_CHECKBOX: + gConfigNetwork.LogServerActions = !gConfigNetwork.LogServerActions; + ConfigSaveDefault(); + break; + case WIDX_KNOWN_KEYS_ONLY_CHECKBOX: + gConfigNetwork.KnownKeysOnly = !gConfigNetwork.KnownKeysOnly; + ConfigSaveDefault(); + break; } + break; } - break; } - case WINDOW_MULTIPLAYER_PAGE_OPTIONS: + } + + ScreenCoordsXY MultiplayerWindow::InformationGetSize() + { + assert(!_windowInformationSize.has_value()); + + int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); + + // Base dimensions. + const int32_t baseWidth = 450; + int32_t baseHeight = 55; + + // Server name is displayed word-wrapped, so figure out how high it will be. { - switch (widgetIndex) + int32_t numLines; + GfxWrapString(NetworkGetServerName(), baseWidth, FontStyle::Medium, nullptr, &numLines); + baseHeight += (numLines + 1) * lineHeight + (LIST_ROW_HEIGHT / 2); + } + + // Likewise, for the optional server description -- which can be a little longer. + const auto& descString = NetworkGetServerDescription(); + if (!descString.empty()) + { + int32_t numLines; + GfxWrapString(descString, baseWidth, FontStyle::Medium, nullptr, &numLines); + baseHeight += (numLines + 1) * lineHeight + (LIST_ROW_HEIGHT / 2); + } + + // Finally, account for provider info, if present. + { + const auto& providerName = NetworkGetServerProviderName(); + if (!providerName.empty()) + baseHeight += LIST_ROW_HEIGHT; + + const auto& providerEmail = NetworkGetServerProviderEmail(); + if (!providerEmail.empty()) + baseHeight += LIST_ROW_HEIGHT; + + const auto& providerWebsite = NetworkGetServerProviderWebsite(); + if (!providerWebsite.empty()) + baseHeight += LIST_ROW_HEIGHT; + } + + // TODO: Are these casts still neccessary? + _windowInformationSize = { static_cast(baseWidth), static_cast(baseHeight) }; + return _windowInformationSize.value(); + } + + void MultiplayerWindow::OnResize() + { + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_INFORMATION: { - case WIDX_LOG_CHAT_CHECKBOX: - gConfigNetwork.LogChat = !gConfigNetwork.LogChat; - ConfigSaveDefault(); - break; - case WIDX_LOG_SERVER_ACTIONS_CHECKBOX: - gConfigNetwork.LogServerActions = !gConfigNetwork.LogServerActions; - ConfigSaveDefault(); - break; - case WIDX_KNOWN_KEYS_ONLY_CHECKBOX: - gConfigNetwork.KnownKeysOnly = !gConfigNetwork.KnownKeysOnly; - ConfigSaveDefault(); - break; + auto size = _windowInformationSize ? _windowInformationSize.value() : InformationGetSize(); + WindowSetResize(*this, size.x, size.y, size.x, size.y); + break; } - break; - } - } -} - -ScreenCoordsXY MultiplayerWindow::InformationGetSize() -{ - assert(!_windowInformationSize.has_value()); - - int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); - - // Base dimensions. - const int32_t baseWidth = 450; - int32_t baseHeight = 55; - - // Server name is displayed word-wrapped, so figure out how high it will be. - { - int32_t numLines; - GfxWrapString(NetworkGetServerName(), baseWidth, FontStyle::Medium, nullptr, &numLines); - baseHeight += (numLines + 1) * lineHeight + (LIST_ROW_HEIGHT / 2); - } - - // Likewise, for the optional server description -- which can be a little longer. - const auto& descString = NetworkGetServerDescription(); - if (!descString.empty()) - { - int32_t numLines; - GfxWrapString(descString, baseWidth, FontStyle::Medium, nullptr, &numLines); - baseHeight += (numLines + 1) * lineHeight + (LIST_ROW_HEIGHT / 2); - } - - // Finally, account for provider info, if present. - { - const auto& providerName = NetworkGetServerProviderName(); - if (!providerName.empty()) - baseHeight += LIST_ROW_HEIGHT; - - const auto& providerEmail = NetworkGetServerProviderEmail(); - if (!providerEmail.empty()) - baseHeight += LIST_ROW_HEIGHT; - - const auto& providerWebsite = NetworkGetServerProviderWebsite(); - if (!providerWebsite.empty()) - baseHeight += LIST_ROW_HEIGHT; - } - - // TODO: Are these casts still neccessary? - _windowInformationSize = { static_cast(baseWidth), static_cast(baseHeight) }; - return _windowInformationSize.value(); -} - -void MultiplayerWindow::OnResize() -{ - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_INFORMATION: - { - auto size = _windowInformationSize ? _windowInformationSize.value() : InformationGetSize(); - WindowSetResize(*this, size.x, size.y, size.x, size.y); - break; - } - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: - { - WindowSetResize(*this, 420, 124, 500, 450); - - no_list_items = (IsServerPlayerInvisible() ? NetworkGetNumVisiblePlayers() : NetworkGetNumPlayers()); - - widgets[WIDX_HEADER_PING].right = width - 5; - - selected_list_item = -1; - Invalidate(); - break; - } - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - WindowSetResize(*this, 320, 200, 320, 500); - - no_list_items = NetworkGetNumActions(); - - selected_list_item = -1; - Invalidate(); - break; - } - case WINDOW_MULTIPLAYER_PAGE_OPTIONS: - { - WindowSetResize(*this, 300, 100, 300, 100); - break; - } - } -} - -void MultiplayerWindow::OnUpdate() -{ - frame_no++; - InvalidateWidget(WIDX_TAB1 + page); -} - -void MultiplayerWindow::ResetPressedWidgets() -{ - for (int32_t i = WIDX_TAB1; i <= WIDX_TAB4; i++) - { - SetWidgetPressed(i, false); - } -} - -void MultiplayerWindow::OnPrepareDraw() -{ - ResetPressedWidgets(); - SetWidgetPressed(WIDX_TAB1 + page, true); - ResizeFrameWithPage(); - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_INFORMATION: - { - WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); - break; - } - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: - { - window_multiplayer_players_widgets[WIDX_LIST].right = width - 4; - window_multiplayer_players_widgets[WIDX_LIST].bottom = height - 0x0F; - WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); - break; - } - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].right = width - 4; - window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].bottom = height - 0x0F; - WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); - - // select other group if one is removed - while (NetworkGetGroupIndex(_selectedGroup) == -1 && _selectedGroup > 0) + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: { - _selectedGroup--; - } - break; - } - case WINDOW_MULTIPLAYER_PAGE_OPTIONS: - { - WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); + WindowSetResize(*this, 420, 124, 500, 450); - if (NetworkGetMode() == NETWORK_MODE_CLIENT) - { - widgets[WIDX_KNOWN_KEYS_ONLY_CHECKBOX].type = WindowWidgetType::Empty; - } + no_list_items = (IsServerPlayerInvisible() ? NetworkGetNumVisiblePlayers() : NetworkGetNumPlayers()); - SetCheckboxValue(WIDX_LOG_CHAT_CHECKBOX, gConfigNetwork.LogChat); - SetCheckboxValue(WIDX_LOG_SERVER_ACTIONS_CHECKBOX, gConfigNetwork.LogServerActions); - SetCheckboxValue(WIDX_KNOWN_KEYS_ONLY_CHECKBOX, gConfigNetwork.KnownKeysOnly); - break; - } - } -} + widgets[WIDX_HEADER_PING].right = width - 5; -void MultiplayerWindow::OnDraw(DrawPixelInfo& dpi) -{ - DrawWidgets(dpi); - DrawTabImages(dpi); - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_INFORMATION: - { - InformationPaint(dpi); - break; - } - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: - { - PlayersPaint(dpi); - break; - } - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - GroupsPaint(dpi); - break; - } - } -} - -void MultiplayerWindow::OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) -{ - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - if (selectedIndex == -1) - { - return; - } - - switch (widgetIndex) - { - case WIDX_DEFAULT_GROUP_DROPDOWN: - { - auto networkModifyGroup = NetworkModifyGroupAction( - ModifyGroupType::SetDefault, NetworkGetGroupID(selectedIndex)); - GameActions::Execute(&networkModifyGroup); - break; - } - case WIDX_SELECTED_GROUP_DROPDOWN: - { - _selectedGroup = NetworkGetGroupID(selectedIndex); - break; - } - } - Invalidate(); - break; - } - } -} - -void MultiplayerWindow::OnTextInput(WidgetIndex widgetIndex, std::string_view text) -{ - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - if (widgetIndex != WIDX_RENAME_GROUP) - return; - - if (text.empty()) - return; - - auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::SetName, _selectedGroup, std::string(text)); - GameActions::Execute(&networkModifyGroup); - break; - } - } -} - -void MultiplayerWindow::ShowGroupDropdown(WidgetIndex widgetIndex) -{ - auto widget = &widgets[widgetIndex]; - Widget* dropdownWidget = widget - 1; - auto numItems = NetworkGetNumGroups(); - - WindowDropdownShowTextCustomWidth( - windowPos + ScreenCoordsXY{ dropdownWidget->left, dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], 0, 0, - numItems, widget->right - dropdownWidget->left); - - for (auto i = 0; i < NetworkGetNumGroups(); i++) - { - gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(NetworkGetGroupName(i)); - } - if (widget == &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP_DROPDOWN]) - { - Dropdown::SetChecked(NetworkGetGroupIndex(NetworkGetDefaultGroup()), true); - } - else if (widget == &window_multiplayer_groups_widgets[WIDX_SELECTED_GROUP_DROPDOWN]) - { - Dropdown::SetChecked(NetworkGetGroupIndex(_selectedGroup), true); - } -} - -void MultiplayerWindow::OnMouseDown(WidgetIndex widgetIndex) -{ - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - switch (widgetIndex) - { - case WIDX_DEFAULT_GROUP_DROPDOWN: - case WIDX_SELECTED_GROUP_DROPDOWN: - ShowGroupDropdown(widgetIndex); - break; - } - break; - } - } -} - -ScreenSize MultiplayerWindow::OnScrollGetSize(int32_t scrollIndex) -{ - ScreenSize screenSize{}; - switch (page) - { - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: - { - if (selected_list_item != -1) - { selected_list_item = -1; Invalidate(); + break; } - - screenSize = { 0, NetworkGetNumPlayers() * SCROLLABLE_ROW_HEIGHT }; - int32_t i = screenSize.height - window_multiplayer_players_widgets[WIDX_LIST].bottom - + window_multiplayer_players_widgets[WIDX_LIST].top + 21; - if (i < 0) - i = 0; - if (i < scrolls[0].v_top) + case WINDOW_MULTIPLAYER_PAGE_GROUPS: { - scrolls[0].v_top = i; - Invalidate(); - } - break; - } + WindowSetResize(*this, 320, 200, 320, 500); + + no_list_items = NetworkGetNumActions(); - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - if (selected_list_item != -1) - { selected_list_item = -1; Invalidate(); + break; } - - screenSize = { 0, NetworkGetNumActions() * SCROLLABLE_ROW_HEIGHT }; - int32_t i = screenSize.height - window_multiplayer_groups_widgets[WIDX_LIST].bottom - + window_multiplayer_groups_widgets[WIDX_LIST].top + 21; - if (i < 0) - i = 0; - if (i < scrolls[0].v_top) + case WINDOW_MULTIPLAYER_PAGE_OPTIONS: { - scrolls[0].v_top = i; - Invalidate(); + WindowSetResize(*this, 300, 100, 300, 100); + break; } - break; } } - return screenSize; -} -void MultiplayerWindow::OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - switch (page) + void MultiplayerWindow::OnUpdate() { - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + frame_no++; + InvalidateWidget(WIDX_TAB1 + page); + } + + void MultiplayerWindow::ResetPressedWidgets() + { + for (int32_t i = WIDX_TAB1; i <= WIDX_TAB4; i++) { - int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index >= no_list_items) - return; - - selected_list_item = index; - Invalidate(); - - int32_t player = (IsServerPlayerInvisible() ? index + 1 : index); - WindowPlayerOpen(NetworkGetPlayerID(player)); - break; - } - - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - { - int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index >= no_list_items) - return; - - selected_list_item = index; - Invalidate(); - - auto networkModifyGroup = NetworkModifyGroupAction( - ModifyGroupType::SetPermissions, _selectedGroup, "", index, PermissionState::Toggle); - GameActions::Execute(&networkModifyGroup); - break; + SetWidgetPressed(i, false); } } -} -void MultiplayerWindow::OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) -{ - switch (page) + void MultiplayerWindow::OnPrepareDraw() { - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: - case WINDOW_MULTIPLAYER_PAGE_GROUPS: + ResetPressedWidgets(); + SetWidgetPressed(WIDX_TAB1 + page, true); + ResizeFrameWithPage(); + switch (page) { - int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index >= no_list_items) - return; + case WINDOW_MULTIPLAYER_PAGE_INFORMATION: + { + WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); + break; + } + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + { + window_multiplayer_players_widgets[WIDX_LIST].right = width - 4; + window_multiplayer_players_widgets[WIDX_LIST].bottom = height - 0x0F; + WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); + break; + } + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].right = width - 4; + window_multiplayer_groups_widgets[WIDX_PERMISSIONS_LIST].bottom = height - 0x0F; + WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); - selected_list_item = index; - Invalidate(); - break; + // select other group if one is removed + while (NetworkGetGroupIndex(_selectedGroup) == -1 && _selectedGroup > 0) + { + _selectedGroup--; + } + break; + } + case WINDOW_MULTIPLAYER_PAGE_OPTIONS: + { + WindowAlignTabs(this, WIDX_TAB1, WIDX_TAB4); + + if (NetworkGetMode() == NETWORK_MODE_CLIENT) + { + widgets[WIDX_KNOWN_KEYS_ONLY_CHECKBOX].type = WindowWidgetType::Empty; + } + + SetCheckboxValue(WIDX_LOG_CHAT_CHECKBOX, gConfigNetwork.LogChat); + SetCheckboxValue(WIDX_LOG_SERVER_ACTIONS_CHECKBOX, gConfigNetwork.LogServerActions); + SetCheckboxValue(WIDX_KNOWN_KEYS_ONLY_CHECKBOX, gConfigNetwork.KnownKeysOnly); + break; + } } } -} -void MultiplayerWindow::OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) -{ - switch (page) + void MultiplayerWindow::OnDraw(DrawPixelInfo& dpi) { - case WINDOW_MULTIPLAYER_PAGE_PLAYERS: - PlayersScrollPaint(scrollIndex, dpi); - break; - - case WINDOW_MULTIPLAYER_PAGE_GROUPS: - GroupsScrollPaint(scrollIndex, dpi); - break; - } -} - -void MultiplayerWindow::InformationPaint(DrawPixelInfo& dpi) -{ - DrawPixelInfo clippedDPI; - if (ClipDrawPixelInfo(clippedDPI, dpi, windowPos, width, height)) - { - auto screenCoords = ScreenCoordsXY{ 3, 50 }; - int32_t newWidth = width - 6; - - const auto& name = NetworkGetServerName(); + DrawWidgets(dpi); + DrawTabImages(dpi); + switch (page) { - auto ft = Formatter(); - ft.Add(name.c_str()); - screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, newWidth, STR_STRING, ft, { colours[1] }); - screenCoords.y += LIST_ROW_HEIGHT / 2; - } - - const auto& description = NetworkGetServerDescription(); - if (!description.empty()) - { - auto ft = Formatter(); - ft.Add(description.c_str()); - screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, newWidth, STR_STRING, ft, { colours[1] }); - screenCoords.y += LIST_ROW_HEIGHT / 2; - } - - const auto& providerName = NetworkGetServerProviderName(); - if (!providerName.empty()) - { - auto ft = Formatter(); - ft.Add(providerName.c_str()); - DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_NAME, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - const auto& providerEmail = NetworkGetServerProviderEmail(); - if (!providerEmail.empty()) - { - auto ft = Formatter(); - ft.Add(providerEmail.c_str()); - DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_EMAIL, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - const auto& providerWebsite = NetworkGetServerProviderWebsite(); - if (!providerWebsite.empty()) - { - auto ft = Formatter(); - ft.Add(providerWebsite.c_str()); - DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_WEBSITE, ft); + case WINDOW_MULTIPLAYER_PAGE_INFORMATION: + { + InformationPaint(dpi); + break; + } + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + { + PlayersPaint(dpi); + break; + } + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + GroupsPaint(dpi); + break; + } } } -} -void MultiplayerWindow::PlayersPaint(DrawPixelInfo& dpi) -{ - // Number of players - StringId stringId = no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL; - auto screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }; - auto ft = Formatter(); - ft.Add(no_list_items); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colours[2] }); -} - -void MultiplayerWindow::PlayersScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const -{ - ScreenCoordsXY screenCoords; - screenCoords.y = 0; - - const int32_t firstPlayerInList = (IsServerPlayerInvisible() ? 1 : 0); - int32_t listPosition = 0; - - for (int32_t player = firstPlayerInList; player < NetworkGetNumPlayers(); player++) + void MultiplayerWindow::OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) { - if (screenCoords.y > dpi.y + dpi.height) + switch (page) { - break; + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + if (selectedIndex == -1) + { + return; + } + + switch (widgetIndex) + { + case WIDX_DEFAULT_GROUP_DROPDOWN: + { + auto networkModifyGroup = NetworkModifyGroupAction( + ModifyGroupType::SetDefault, NetworkGetGroupID(selectedIndex)); + GameActions::Execute(&networkModifyGroup); + break; + } + case WIDX_SELECTED_GROUP_DROPDOWN: + { + _selectedGroup = NetworkGetGroupID(selectedIndex); + break; + } + } + Invalidate(); + break; + } + } + } + + void MultiplayerWindow::OnTextInput(WidgetIndex widgetIndex, std::string_view text) + { + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + if (widgetIndex != WIDX_RENAME_GROUP) + return; + + if (text.empty()) + return; + + auto networkModifyGroup = NetworkModifyGroupAction(ModifyGroupType::SetName, _selectedGroup, std::string(text)); + GameActions::Execute(&networkModifyGroup); + break; + } + } + } + + void MultiplayerWindow::ShowGroupDropdown(WidgetIndex widgetIndex) + { + auto widget = &widgets[widgetIndex]; + Widget* dropdownWidget = widget - 1; + auto numItems = NetworkGetNumGroups(); + + WindowDropdownShowTextCustomWidth( + windowPos + ScreenCoordsXY{ dropdownWidget->left, dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], + 0, 0, numItems, widget->right - dropdownWidget->left); + + for (auto i = 0; i < NetworkGetNumGroups(); i++) + { + gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i].Args = reinterpret_cast(NetworkGetGroupName(i)); + } + if (widget == &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP_DROPDOWN]) + { + Dropdown::SetChecked(NetworkGetGroupIndex(NetworkGetDefaultGroup()), true); + } + else if (widget == &window_multiplayer_groups_widgets[WIDX_SELECTED_GROUP_DROPDOWN]) + { + Dropdown::SetChecked(NetworkGetGroupIndex(_selectedGroup), true); + } + } + + void MultiplayerWindow::OnMouseDown(WidgetIndex widgetIndex) + { + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + switch (widgetIndex) + { + case WIDX_DEFAULT_GROUP_DROPDOWN: + case WIDX_SELECTED_GROUP_DROPDOWN: + ShowGroupDropdown(widgetIndex); + break; + } + break; + } + } + } + + ScreenSize MultiplayerWindow::OnScrollGetSize(int32_t scrollIndex) + { + ScreenSize screenSize{}; + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + { + if (selected_list_item != -1) + { + selected_list_item = -1; + Invalidate(); + } + + screenSize = { 0, NetworkGetNumPlayers() * SCROLLABLE_ROW_HEIGHT }; + int32_t i = screenSize.height - window_multiplayer_players_widgets[WIDX_LIST].bottom + + window_multiplayer_players_widgets[WIDX_LIST].top + 21; + if (i < 0) + i = 0; + if (i < scrolls[0].v_top) + { + scrolls[0].v_top = i; + Invalidate(); + } + break; + } + + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + if (selected_list_item != -1) + { + selected_list_item = -1; + Invalidate(); + } + + screenSize = { 0, NetworkGetNumActions() * SCROLLABLE_ROW_HEIGHT }; + int32_t i = screenSize.height - window_multiplayer_groups_widgets[WIDX_LIST].bottom + + window_multiplayer_groups_widgets[WIDX_LIST].top + 21; + if (i < 0) + i = 0; + if (i < scrolls[0].v_top) + { + scrolls[0].v_top = i; + Invalidate(); + } + break; + } + } + return screenSize; + } + + void MultiplayerWindow::OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) + { + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + { + int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index >= no_list_items) + return; + + selected_list_item = index; + Invalidate(); + + int32_t player = (IsServerPlayerInvisible() ? index + 1 : index); + WindowPlayerOpen(NetworkGetPlayerID(player)); + break; + } + + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index >= no_list_items) + return; + + selected_list_item = index; + Invalidate(); + + auto networkModifyGroup = NetworkModifyGroupAction( + ModifyGroupType::SetPermissions, _selectedGroup, "", index, PermissionState::Toggle); + GameActions::Execute(&networkModifyGroup); + break; + } + } + } + + void MultiplayerWindow::OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) + { + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + { + int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index >= no_list_items) + return; + + selected_list_item = index; + Invalidate(); + break; + } + } + } + + void MultiplayerWindow::OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) + { + switch (page) + { + case WINDOW_MULTIPLAYER_PAGE_PLAYERS: + PlayersScrollPaint(scrollIndex, dpi); + break; + + case WINDOW_MULTIPLAYER_PAGE_GROUPS: + GroupsScrollPaint(scrollIndex, dpi); + break; + } + } + + void MultiplayerWindow::InformationPaint(DrawPixelInfo& dpi) + { + DrawPixelInfo clippedDPI; + if (ClipDrawPixelInfo(clippedDPI, dpi, windowPos, width, height)) + { + auto screenCoords = ScreenCoordsXY{ 3, 50 }; + int32_t newWidth = width - 6; + + const auto& name = NetworkGetServerName(); + { + auto ft = Formatter(); + ft.Add(name.c_str()); + screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, newWidth, STR_STRING, ft, { colours[1] }); + screenCoords.y += LIST_ROW_HEIGHT / 2; + } + + const auto& description = NetworkGetServerDescription(); + if (!description.empty()) + { + auto ft = Formatter(); + ft.Add(description.c_str()); + screenCoords.y += DrawTextWrapped(clippedDPI, screenCoords, newWidth, STR_STRING, ft, { colours[1] }); + screenCoords.y += LIST_ROW_HEIGHT / 2; + } + + const auto& providerName = NetworkGetServerProviderName(); + if (!providerName.empty()) + { + auto ft = Formatter(); + ft.Add(providerName.c_str()); + DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_NAME, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + const auto& providerEmail = NetworkGetServerProviderEmail(); + if (!providerEmail.empty()) + { + auto ft = Formatter(); + ft.Add(providerEmail.c_str()); + DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_EMAIL, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + const auto& providerWebsite = NetworkGetServerProviderWebsite(); + if (!providerWebsite.empty()) + { + auto ft = Formatter(); + ft.Add(providerWebsite.c_str()); + DrawTextBasic(clippedDPI, screenCoords, STR_PROVIDER_WEBSITE, ft); + } + } + } + + void MultiplayerWindow::PlayersPaint(DrawPixelInfo& dpi) + { + // Number of players + StringId stringId = no_list_items == 1 ? STR_MULTIPLAYER_PLAYER_COUNT : STR_MULTIPLAYER_PLAYER_COUNT_PLURAL; + auto screenCoords = windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }; + auto ft = Formatter(); + ft.Add(no_list_items); + DrawTextBasic(dpi, screenCoords, stringId, ft, { colours[2] }); + } + + void MultiplayerWindow::PlayersScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const + { + ScreenCoordsXY screenCoords; + screenCoords.y = 0; + + const int32_t firstPlayerInList = (IsServerPlayerInvisible() ? 1 : 0); + int32_t listPosition = 0; + + for (int32_t player = firstPlayerInList; player < NetworkGetNumPlayers(); player++) + { + if (screenCoords.y > dpi.y + dpi.height) + { + break; + } + + if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y) + { + thread_local std::string _buffer; + _buffer.reserve(512); + _buffer.clear(); + + // Draw player name + colour_t colour = COLOUR_BLACK; + if (listPosition == selected_list_item) + { + GfxFilterRect( + dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, + FilterPaletteID::PaletteDarken1); + _buffer += NetworkGetPlayerName(player); + colour = colours[2]; + } + else + { + if (NetworkGetPlayerFlags(player) & NETWORK_PLAYER_FLAG_ISSERVER) + { + _buffer += "{BABYBLUE}"; + } + else + { + _buffer += "{BLACK}"; + } + _buffer += NetworkGetPlayerName(player); + } + screenCoords.x = 0; + GfxClipString(_buffer.data(), 230, FontStyle::Medium); + GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); + + // Draw group name + _buffer.resize(0); + int32_t group = NetworkGetGroupIndex(NetworkGetPlayerGroup(player)); + if (group != -1) + { + _buffer += "{BLACK}"; + screenCoords.x = 173; + _buffer += NetworkGetGroupName(group); + GfxClipString(_buffer.data(), 80, FontStyle::Medium); + GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); + } + + // Draw last action + int32_t action = NetworkGetPlayerLastAction(player, 2000); + auto ft = Formatter(); + if (action != -999) + { + ft.Add(NetworkGetActionNameStringID(action)); + } + else + { + ft.Add(STR_ACTION_NA); + } + DrawTextEllipsised(dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft); + + // Draw ping + _buffer.resize(0); + int32_t ping = NetworkGetPlayerPing(player); + if (ping <= 100) + { + _buffer += "{GREEN}"; + } + else if (ping <= 250) + { + _buffer += "{YELLOW}"; + } + else + { + _buffer += "{RED}"; + } + + char pingBuffer[64]{}; + snprintf(pingBuffer, sizeof(pingBuffer), "%d ms", ping); + _buffer += pingBuffer; + + screenCoords.x = 356; + GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); + } + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + listPosition++; + } + } + + void MultiplayerWindow::GroupsPaint(DrawPixelInfo& dpi) + { + thread_local std::string _buffer; + + Widget* widget = &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP]; + int32_t group = NetworkGetGroupIndex(NetworkGetDefaultGroup()); + if (group != -1) + { + _buffer.assign("{WINDOW_COLOUR_2}"); + _buffer += NetworkGetGroupName(group); + + auto ft = Formatter(); + ft.Add(_buffer.c_str()); + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, + { TextAlignment::CENTRE }); } - if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y) - { - thread_local std::string _buffer; - _buffer.reserve(512); - _buffer.clear(); + auto screenPos = windowPos + + ScreenCoordsXY{ window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4, + window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].top + 4 }; - // Draw player name - colour_t colour = COLOUR_BLACK; - if (listPosition == selected_list_item) + DrawTextBasic(dpi, screenPos, STR_DEFAULT_GROUP, {}, { colours[2] }); + + screenPos.y += 20; + + GfxFillRectInset( + dpi, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, colours[1], + INSET_RECT_FLAG_BORDER_INSET); + + widget = &window_multiplayer_groups_widgets[WIDX_SELECTED_GROUP]; + group = NetworkGetGroupIndex(_selectedGroup); + if (group != -1) + { + _buffer.assign("{WINDOW_COLOUR_2}"); + _buffer += NetworkGetGroupName(group); + auto ft = Formatter(); + ft.Add(_buffer.c_str()); + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, + { TextAlignment::CENTRE }); + } + } + + void MultiplayerWindow::GroupsScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const + { + auto screenCoords = ScreenCoordsXY{ 0, 0 }; + + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + GfxFillRect( + dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); + + for (int32_t i = 0; i < NetworkGetNumActions(); i++) + { + if (i == selected_list_item) { GfxFilterRect( dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); - _buffer += NetworkGetPlayerName(player); - colour = colours[2]; } - else + if (screenCoords.y > dpi.y + dpi.height) { - if (NetworkGetPlayerFlags(player) & NETWORK_PLAYER_FLAG_ISSERVER) + break; + } + + if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y) + { + int32_t groupindex = NetworkGetGroupIndex(_selectedGroup); + if (groupindex != -1) { - _buffer += "{BABYBLUE}"; + if (NetworkCanPerformAction(groupindex, static_cast(i))) + { + screenCoords.x = 0; + GfxDrawString(dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {}); + } } - else + + // Draw action name + auto ft = Formatter(); + ft.Add(NetworkGetActionNameStringID(i)); + DrawTextBasic(dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft); + } + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + } + } + + void MultiplayerWindow::DrawTabImage(DrawPixelInfo& dpi, int32_t page_number, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_TAB1 + page_number; + + if (!IsWidgetDisabled(widgetIndex)) + { + if (page == page_number) + { + int32_t numFrames = window_multiplayer_animation_frames[page]; + if (numFrames > 1) { - _buffer += "{BLACK}"; - } - _buffer += NetworkGetPlayerName(player); - } - screenCoords.x = 0; - GfxClipString(_buffer.data(), 230, FontStyle::Medium); - GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); - - // Draw group name - _buffer.resize(0); - int32_t group = NetworkGetGroupIndex(NetworkGetPlayerGroup(player)); - if (group != -1) - { - _buffer += "{BLACK}"; - screenCoords.x = 173; - _buffer += NetworkGetGroupName(group); - GfxClipString(_buffer.data(), 80, FontStyle::Medium); - GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); - } - - // Draw last action - int32_t action = NetworkGetPlayerLastAction(player, 2000); - auto ft = Formatter(); - if (action != -999) - { - ft.Add(NetworkGetActionNameStringID(action)); - } - else - { - ft.Add(STR_ACTION_NA); - } - DrawTextEllipsised(dpi, { 256, screenCoords.y }, 100, STR_BLACK_STRING, ft); - - // Draw ping - _buffer.resize(0); - int32_t ping = NetworkGetPlayerPing(player); - if (ping <= 100) - { - _buffer += "{GREEN}"; - } - else if (ping <= 250) - { - _buffer += "{YELLOW}"; - } - else - { - _buffer += "{RED}"; - } - - char pingBuffer[64]{}; - snprintf(pingBuffer, sizeof(pingBuffer), "%d ms", ping); - _buffer += pingBuffer; - - screenCoords.x = 356; - GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour }); - } - screenCoords.y += SCROLLABLE_ROW_HEIGHT; - listPosition++; - } -} - -void MultiplayerWindow::GroupsPaint(DrawPixelInfo& dpi) -{ - thread_local std::string _buffer; - - Widget* widget = &window_multiplayer_groups_widgets[WIDX_DEFAULT_GROUP]; - int32_t group = NetworkGetGroupIndex(NetworkGetDefaultGroup()); - if (group != -1) - { - _buffer.assign("{WINDOW_COLOUR_2}"); - _buffer += NetworkGetGroupName(group); - - auto ft = Formatter(); - ft.Add(_buffer.c_str()); - DrawTextEllipsised( - dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, - { TextAlignment::CENTRE }); - } - - auto screenPos = windowPos - + ScreenCoordsXY{ window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].left + 4, - window_multiplayer_groups_widgets[WIDX_CONTENT_PANEL].top + 4 }; - - DrawTextBasic(dpi, screenPos, STR_DEFAULT_GROUP, {}, { colours[2] }); - - screenPos.y += 20; - - GfxFillRectInset( - dpi, { screenPos - ScreenCoordsXY{ 0, 6 }, screenPos + ScreenCoordsXY{ 310, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); - - widget = &window_multiplayer_groups_widgets[WIDX_SELECTED_GROUP]; - group = NetworkGetGroupIndex(_selectedGroup); - if (group != -1) - { - _buffer.assign("{WINDOW_COLOUR_2}"); - _buffer += NetworkGetGroupName(group); - auto ft = Formatter(); - ft.Add(_buffer.c_str()); - DrawTextEllipsised( - dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, - { TextAlignment::CENTRE }); - } -} - -void MultiplayerWindow::GroupsScrollPaint(int32_t scrollIndex, DrawPixelInfo& dpi) const -{ - auto screenCoords = ScreenCoordsXY{ 0, 0 }; - - auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; - GfxFillRect( - dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - - for (int32_t i = 0; i < NetworkGetNumActions(); i++) - { - if (i == selected_list_item) - { - GfxFilterRect( - dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); - } - if (screenCoords.y > dpi.y + dpi.height) - { - break; - } - - if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y) - { - int32_t groupindex = NetworkGetGroupIndex(_selectedGroup); - if (groupindex != -1) - { - if (NetworkCanPerformAction(groupindex, static_cast(i))) - { - screenCoords.x = 0; - GfxDrawString(dpi, screenCoords, u8"{WINDOW_COLOUR_2}✓", {}); + int32_t frame = frame_no / window_multiplayer_animation_divisor[page]; + spriteIndex += (frame % numFrames); } } - // Draw action name - auto ft = Formatter(); - ft.Add(NetworkGetActionNameStringID(i)); - DrawTextBasic(dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft); + GfxDrawSprite( + dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); } - screenCoords.y += SCROLLABLE_ROW_HEIGHT; } -} -void MultiplayerWindow::DrawTabImage(DrawPixelInfo& dpi, int32_t page_number, int32_t spriteIndex) -{ - WidgetIndex widgetIndex = WIDX_TAB1 + page_number; - - if (!IsWidgetDisabled(widgetIndex)) + void MultiplayerWindow::DrawTabImages(DrawPixelInfo& dpi) { - if (page == page_number) - { - int32_t numFrames = window_multiplayer_animation_frames[page]; - if (numFrames > 1) - { - int32_t frame = frame_no / window_multiplayer_animation_divisor[page]; - spriteIndex += (frame % numFrames); - } - } - - GfxDrawSprite( - dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_INFORMATION, SPR_TAB_KIOSKS_AND_FACILITIES_0); + DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_PLAYERS, SPR_TAB_GUESTS_0); + DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_GROUPS, SPR_TAB_STAFF_OPTIONS_0); + DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_OPTIONS, SPR_TAB_GEARS_0); } -} - -void MultiplayerWindow::DrawTabImages(DrawPixelInfo& dpi) -{ - DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_INFORMATION, SPR_TAB_KIOSKS_AND_FACILITIES_0); - DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_PLAYERS, SPR_TAB_GUESTS_0); - DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_GROUPS, SPR_TAB_STAFF_OPTIONS_0); - DrawTabImage(dpi, WINDOW_MULTIPLAYER_PAGE_OPTIONS, SPR_TAB_GEARS_0); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 29dc11758b..6dafc0c5ad 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -14,7 +14,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowNetworkStatusWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -29,133 +31,134 @@ static Widget window_network_status_widgets[] = { kWidgetsEnd, }; -// clang-format on -class NetworkStatusWindow final : public Window -{ -public: - void OnOpen() override + // clang-format on + class NetworkStatusWindow final : public Window { - widgets = window_network_status_widgets; - WindowInitScrollWidgets(*this); - - frame_no = 0; - min_width = 320; - min_height = 90; - max_width = min_width; - max_height = min_height; - - page = 0; - list_information_type = 0; - } - - void OnClose() override - { - if (_onClose != nullptr) + public: + void OnOpen() override { - _onClose(); - } - } + widgets = window_network_status_widgets; + WindowInitScrollWidgets(*this); - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + frame_no = 0; + min_width = 320; + min_height = 90; + max_width = min_width; + max_height = min_height; + + page = 0; + list_information_type = 0; + } + + void OnClose() override { - case WIDX_CLOSE: - Close(); - break; + if (_onClose != nullptr) + { + _onClose(); + } } - } - void OnUpdate() override - { - InvalidateWidget(WIDX_BACKGROUND); - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - _password.clear(); - switch (widgetIndex) + void OnMouseUp(WidgetIndex widgetIndex) override { - case WIDX_PASSWORD: - _password = text; - break; + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + } } - if (text.empty()) + + void OnUpdate() override { - NetworkShutdownClient(); + InvalidateWidget(WIDX_BACKGROUND); } - else + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - NetworkSendPassword(_password); + _password.clear(); + switch (widgetIndex) + { + case WIDX_PASSWORD: + _password = text; + break; + } + if (text.empty()) + { + NetworkShutdownClient(); + } + else + { + NetworkSendPassword(_password); + } } - } - void OnPrepareDraw() override + void OnPrepareDraw() override + { + ResizeFrame(); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + WindowDrawWidgets(*this, dpi); + thread_local std::string _buffer; + _buffer.assign("{BLACK}"); + _buffer += _windowNetworkStatusText; + GfxClipString(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium); + ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2)); + screenCoords.x -= GfxGetStringWidth(_buffer, FontStyle::Medium) / 2; + GfxDrawString(dpi, screenCoords, _buffer.c_str()); + } + + void SetCloseCallBack(close_callback onClose) + { + _onClose = onClose; + } + + void SetWindowNetworkStatusText(const std::string& text) + { + _windowNetworkStatusText = text; + } + + void SetPassword(char* password) + { + _password = password; + } + + private: + close_callback _onClose = nullptr; + std::string _windowNetworkStatusText; + std::string _password; + }; + + WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose) { - ResizeFrame(); + auto window = WindowFocusOrCreate( + WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); + window->SetCloseCallBack(onClose); + window->SetWindowNetworkStatusText(text); + return window; } - void OnDraw(DrawPixelInfo& dpi) override + // force close + void WindowNetworkStatusClose() { - WindowDrawWidgets(*this, dpi); - thread_local std::string _buffer; - _buffer.assign("{BLACK}"); - _buffer += _windowNetworkStatusText; - GfxClipString(_buffer.data(), widgets[WIDX_BACKGROUND].right - 50, FontStyle::Medium); - ScreenCoordsXY screenCoords(windowPos.x + (width / 2), windowPos.y + (height / 2)); - screenCoords.x -= GfxGetStringWidth(_buffer, FontStyle::Medium) / 2; - GfxDrawString(dpi, screenCoords, _buffer.c_str()); + auto window = WindowFindByClass(WindowClass::NetworkStatus); + if (window == nullptr) + { + return; + } + auto networkWindow = static_cast(window); + networkWindow->SetCloseCallBack(nullptr); + networkWindow->Close(); } - void SetCloseCallBack(close_callback onClose) + WindowBase* WindowNetworkStatusOpenPassword() { - _onClose = onClose; + auto window = WindowFocusOrCreate( + WindowClass::NetworkStatus, 420, 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); + return window; } - - void SetWindowNetworkStatusText(const std::string& text) - { - _windowNetworkStatusText = text; - } - - void SetPassword(char* password) - { - _password = password; - } - -private: - close_callback _onClose = nullptr; - std::string _windowNetworkStatusText; - std::string _password; -}; - -WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose) -{ - auto window = WindowFocusOrCreate( - WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); - window->SetCloseCallBack(onClose); - window->SetWindowNetworkStatusText(text); - return window; -} - -// force close -void WindowNetworkStatusClose() -{ - auto window = WindowFindByClass(WindowClass::NetworkStatus); - if (window == nullptr) - { - return; - } - auto networkWindow = static_cast(window); - networkWindow->SetCloseCallBack(nullptr); - networkWindow->Close(); -} - -WindowBase* WindowNetworkStatusOpenPassword() -{ - auto window = WindowFocusOrCreate( - WindowClass::NetworkStatus, 420, 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); - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index bdb372bfd6..218c7cd41f 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -21,15 +21,15 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr int32_t WH = 109; + static constexpr int32_t WW = 350; -static constexpr StringId WINDOW_TITLE = STR_NONE; -static constexpr int32_t WH = 109; -static constexpr int32_t WW = 350; + constexpr uint16_t SELECTED_ITEM_UNDEFINED = 0xFFFF; -constexpr uint16_t SELECTED_ITEM_UNDEFINED = 0xFFFF; - -// clang-format off + // clang-format off enum WindowNewCampaignWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -54,159 +54,189 @@ static Widget window_new_campaign_widgets[] = { MakeWidget ({ 14, 89}, {322, 14}, WindowWidgetType::Button, WindowColour::Primary, STR_MARKETING_START_THIS_MARKETING_CAMPAIGN), // start button kWidgetsEnd, }; -// clang-format on + // clang-format on -class NewCampaignWindow final : public Window -{ -private: - std::vector RideList; - std::vector ShopItems; - struct CampaignVariables + class NewCampaignWindow final : public Window { - int16_t campaign_type; - int16_t no_weeks; // 0x482 - union + private: + std::vector RideList; + std::vector ShopItems; + struct CampaignVariables { - ::RideId RideId; - ObjectEntryIndex ShopItemId; - }; - } Campaign; - - static bool RideValueCompare(const RideId& a, const RideId& b) - { - auto valueA = 0; - auto rideA = GetRide(a); - if (rideA != nullptr) - valueA = rideA->value; - - auto valueB = 0; - auto rideB = GetRide(b); - if (rideB != nullptr) - valueB = rideB->value; - - return (valueB - valueA) < 0; - } - - static int32_t RideNameCompare(const RideId& a, const RideId& b) - { - std::string rideAName = ""; - auto rideA = GetRide(a); - if (rideA != nullptr) - rideAName = rideA->GetName(); - - std::string rideBName = ""; - auto rideB = GetRide(b); - if (rideB != nullptr) - rideBName = rideB->GetName(); - - return StrLogicalCmp(rideAName.c_str(), rideBName.c_str()) < 0; - } - - /** - * - * rct2: 0x0069E320 - */ - void GetShopItems() - { - BitSet items = {}; - for (auto& curRide : GetRideManager()) - { - auto rideEntry = curRide.GetRideEntry(); - if (rideEntry != nullptr) + int16_t campaign_type; + int16_t no_weeks; // 0x482 + union { - for (const auto itemType : rideEntry->shop_item) + ::RideId RideId; + ObjectEntryIndex ShopItemId; + }; + } Campaign; + + static bool RideValueCompare(const RideId& a, const RideId& b) + { + auto valueA = 0; + auto rideA = GetRide(a); + if (rideA != nullptr) + valueA = rideA->value; + + auto valueB = 0; + auto rideB = GetRide(b); + if (rideB != nullptr) + valueB = rideB->value; + + return (valueB - valueA) < 0; + } + + static int32_t RideNameCompare(const RideId& a, const RideId& b) + { + std::string rideAName = ""; + auto rideA = GetRide(a); + if (rideA != nullptr) + rideAName = rideA->GetName(); + + std::string rideBName = ""; + auto rideB = GetRide(b); + if (rideB != nullptr) + rideBName = rideB->GetName(); + + return StrLogicalCmp(rideAName.c_str(), rideBName.c_str()) < 0; + } + + /** + * + * rct2: 0x0069E320 + */ + void GetShopItems() + { + BitSet items = {}; + for (auto& curRide : GetRideManager()) + { + auto rideEntry = curRide.GetRideEntry(); + if (rideEntry != nullptr) { - if (itemType != ShopItem::None && GetShopItemDescriptor(itemType).IsFoodOrDrink()) + for (const auto itemType : rideEntry->shop_item) { - items[EnumValue(itemType)] = true; + if (itemType != ShopItem::None && GetShopItemDescriptor(itemType).IsFoodOrDrink()) + { + items[EnumValue(itemType)] = true; + } } } } - } - ShopItems.clear(); - for (auto i = 0; i < EnumValue(ShopItem::Count); i++) - { - if (items[i]) + ShopItems.clear(); + for (auto i = 0; i < EnumValue(ShopItem::Count); i++) { - ShopItems.push_back(ShopItem(i)); - } - } - } - -public: - void RefreshRides() - { - // Get all applicable rides - RideList.clear(); - for (const auto& curRide : GetRideManager()) - { - if (curRide.status == RideStatus::Open) - { - if (!curRide.GetRideTypeDescriptor().HasFlag( - RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY | RIDE_TYPE_FLAG_SELLS_FOOD | RIDE_TYPE_FLAG_SELLS_DRINKS - | RIDE_TYPE_FLAG_IS_TOILET)) + if (items[i]) { - RideList.push_back(curRide.id); + ShopItems.push_back(ShopItem(i)); } } } - if (RideList.size() > Dropdown::ItemsMaxSize) + public: + void RefreshRides() { - std::sort(RideList.begin(), RideList.end(), RideValueCompare); - RideList.resize(Dropdown::ItemsMaxSize); + // Get all applicable rides + RideList.clear(); + for (const auto& curRide : GetRideManager()) + { + if (curRide.status == RideStatus::Open) + { + if (!curRide.GetRideTypeDescriptor().HasFlag( + RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY | RIDE_TYPE_FLAG_SELLS_FOOD | RIDE_TYPE_FLAG_SELLS_DRINKS + | RIDE_TYPE_FLAG_IS_TOILET)) + { + RideList.push_back(curRide.id); + } + } + } + + if (RideList.size() > Dropdown::ItemsMaxSize) + { + std::sort(RideList.begin(), RideList.end(), RideValueCompare); + RideList.resize(Dropdown::ItemsMaxSize); + } + + // Sort rides by name + std::sort(RideList.begin(), RideList.end(), RideNameCompare); } - // Sort rides by name - std::sort(RideList.begin(), RideList.end(), RideNameCompare); - } - - void OnOpen() override - { - widgets = window_new_campaign_widgets; - hold_down_widgets = (1uLL << WIDX_WEEKS_INCREASE_BUTTON) | (1uLL << WIDX_WEEKS_DECREASE_BUTTON); - WindowInitScrollWidgets(*this); - } - - void SetCampaign(int16_t campaignType) - { - widgets[WIDX_TITLE].text = MarketingCampaignNames[campaignType][0]; - - // Campaign type - Campaign.campaign_type = campaignType; - - // Number of weeks - Campaign.no_weeks = 2; - - // Currently selected ride - Campaign.RideId = RideId::GetNull(); - - RefreshRides(); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - Widget* widget = &widgets[widgetIndex]; - Widget* dropdownWidget; - - switch (widgetIndex) + void OnOpen() override { - case WIDX_RIDE_DROPDOWN_BUTTON: - dropdownWidget = widget - 1; + widgets = window_new_campaign_widgets; + hold_down_widgets = (1uLL << WIDX_WEEKS_INCREASE_BUTTON) | (1uLL << WIDX_WEEKS_DECREASE_BUTTON); + WindowInitScrollWidgets(*this); + } - if (Campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) - { - GetShopItems(); - if (!ShopItems.empty()) + void SetCampaign(int16_t campaignType) + { + widgets[WIDX_TITLE].text = MarketingCampaignNames[campaignType][0]; + + // Campaign type + Campaign.campaign_type = campaignType; + + // Number of weeks + Campaign.no_weeks = 2; + + // Currently selected ride + Campaign.RideId = RideId::GetNull(); + + RefreshRides(); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + Widget* widget = &widgets[widgetIndex]; + Widget* dropdownWidget; + + switch (widgetIndex) + { + case WIDX_RIDE_DROPDOWN_BUTTON: + dropdownWidget = widget - 1; + + if (Campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) + { + GetShopItems(); + if (!ShopItems.empty()) + { + int32_t numItems = 0; + int32_t maxSize = std::min(Dropdown::ItemsMaxSize, static_cast(ShopItems.size())); + for (int32_t i = 0; i < maxSize; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = GetShopItemDescriptor(ShopItems[i]).Naming.Plural; + numItems++; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, + dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, numItems, + dropdownWidget->width() - 3); + } + } + else { int32_t numItems = 0; - int32_t maxSize = std::min(Dropdown::ItemsMaxSize, static_cast(ShopItems.size())); - for (int32_t i = 0; i < maxSize; i++) + for (auto rideIndex : RideList) { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = GetShopItemDescriptor(ShopItems[i]).Naming.Plural; - numItems++; + auto curRide = GetRide(rideIndex); + if (curRide != nullptr) + { + // HACK until dropdown items have longer argument buffers + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + Formatter ft(reinterpret_cast(&gDropdownItems[numItems].Args)); + if (curRide->custom_name.empty()) + { + curRide->FormatNameTo(ft); + } + else + { + gDropdownItems[numItems].Format = STR_OPTIONS_DROPDOWN_ITEM; + ft.Add(curRide->custom_name.c_str()); + } + numItems++; + } } WindowDropdownShowTextCustomWidth( @@ -214,207 +244,179 @@ public: dropdownWidget->height() + 1, colours[1], 0, Dropdown::Flag::StayOpen, numItems, dropdownWidget->width() - 3); } - } - else - { - int32_t numItems = 0; - for (auto rideIndex : RideList) - { - auto curRide = GetRide(rideIndex); - if (curRide != nullptr) - { - // HACK until dropdown items have longer argument buffers - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - Formatter ft(reinterpret_cast(&gDropdownItems[numItems].Args)); - if (curRide->custom_name.empty()) - { - curRide->FormatNameTo(ft); - } - else - { - gDropdownItems[numItems].Format = STR_OPTIONS_DROPDOWN_ITEM; - ft.Add(curRide->custom_name.c_str()); - } - numItems++; - } - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, numItems, dropdownWidget->width() - 3); - } - break; - // In RCT2, the maximum was 6 weeks - case WIDX_WEEKS_INCREASE_BUTTON: - Campaign.no_weeks = std::min(Campaign.no_weeks + 1, 12); - Invalidate(); - break; - case WIDX_WEEKS_DECREASE_BUTTON: - Campaign.no_weeks = std::max(Campaign.no_weeks - 1, 2); - Invalidate(); - break; - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_START_BUTTON: - { - auto gameAction = ParkMarketingAction( - Campaign.campaign_type, Campaign.RideId.ToUnderlying(), Campaign.no_weeks); - gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - WindowCloseByClass(WindowClass::NewCampaign); - } - }); - GameActions::Execute(&gameAction); - break; + break; + // In RCT2, the maximum was 6 weeks + case WIDX_WEEKS_INCREASE_BUTTON: + Campaign.no_weeks = std::min(Campaign.no_weeks + 1, 12); + Invalidate(); + break; + case WIDX_WEEKS_DECREASE_BUTTON: + Campaign.no_weeks = std::max(Campaign.no_weeks - 1, 2); + Invalidate(); + break; } } - } - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (widgetIndex != WIDX_RIDE_DROPDOWN_BUTTON) - return; - - if (dropdownIndex < 0) - return; - - if (Campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) + void OnMouseUp(WidgetIndex widgetIndex) override { - if (static_cast(dropdownIndex) >= ShopItems.size()) - return; - - Campaign.ShopItemId = EnumValue(ShopItems[dropdownIndex]); - } - else - { - if (static_cast(dropdownIndex) >= RideList.size()) - return; - - Campaign.RideId = RideList[dropdownIndex]; - } - - Invalidate(); - } - - void OnPrepareDraw() override - { - widgets[WIDX_RIDE_LABEL].type = WindowWidgetType::Empty; - widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_RIDE_DROPDOWN].text = STR_MARKETING_NOT_SELECTED; - switch (Campaign.campaign_type) - { - case ADVERTISING_CAMPAIGN_RIDE_FREE: - case ADVERTISING_CAMPAIGN_RIDE: - widgets[WIDX_RIDE_LABEL].type = WindowWidgetType::Label; - widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Button; - widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_RIDE; - if (Campaign.RideId != RideId::GetNull()) + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_START_BUTTON: { - auto curRide = GetRide(Campaign.RideId); - if (curRide != nullptr) + auto gameAction = ParkMarketingAction( + Campaign.campaign_type, Campaign.RideId.ToUnderlying(), Campaign.no_weeks); + gameAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + WindowCloseByClass(WindowClass::NewCampaign); + } + }); + GameActions::Execute(&gameAction); + break; + } + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (widgetIndex != WIDX_RIDE_DROPDOWN_BUTTON) + return; + + if (dropdownIndex < 0) + return; + + if (Campaign.campaign_type == ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE) + { + if (static_cast(dropdownIndex) >= ShopItems.size()) + return; + + Campaign.ShopItemId = EnumValue(ShopItems[dropdownIndex]); + } + else + { + if (static_cast(dropdownIndex) >= RideList.size()) + return; + + Campaign.RideId = RideList[dropdownIndex]; + } + + Invalidate(); + } + + void OnPrepareDraw() override + { + widgets[WIDX_RIDE_LABEL].type = WindowWidgetType::Empty; + widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_RIDE_DROPDOWN].text = STR_MARKETING_NOT_SELECTED; + switch (Campaign.campaign_type) + { + case ADVERTISING_CAMPAIGN_RIDE_FREE: + case ADVERTISING_CAMPAIGN_RIDE: + widgets[WIDX_RIDE_LABEL].type = WindowWidgetType::Label; + widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Button; + widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_RIDE; + if (Campaign.RideId != RideId::GetNull()) { - widgets[WIDX_RIDE_DROPDOWN].text = STR_STRINGID; + auto curRide = GetRide(Campaign.RideId); + if (curRide != nullptr) + { + widgets[WIDX_RIDE_DROPDOWN].text = STR_STRINGID; - auto ft = Formatter::Common(); - curRide->FormatNameTo(ft); + auto ft = Formatter::Common(); + curRide->FormatNameTo(ft); + } } - } - break; - case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: - widgets[WIDX_RIDE_LABEL].type = WindowWidgetType::Label; - widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Button; - widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_ITEM; - if (Campaign.ShopItemId != SELECTED_ITEM_UNDEFINED) - { - widgets[WIDX_RIDE_DROPDOWN].text = GetShopItemDescriptor(ShopItem(Campaign.ShopItemId)).Naming.Plural; - } - break; + break; + case ADVERTISING_CAMPAIGN_FOOD_OR_DRINK_FREE: + widgets[WIDX_RIDE_LABEL].type = WindowWidgetType::Label; + widgets[WIDX_RIDE_DROPDOWN].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_RIDE_DROPDOWN_BUTTON].type = WindowWidgetType::Button; + widgets[WIDX_RIDE_LABEL].text = STR_MARKETING_ITEM; + if (Campaign.ShopItemId != SELECTED_ITEM_UNDEFINED) + { + widgets[WIDX_RIDE_DROPDOWN].text = GetShopItemDescriptor(ShopItem(Campaign.ShopItemId)).Naming.Plural; + } + break; + } + + // Set current number of weeks spinner (moved to paint due to required parameter) + widgets[WIDX_WEEKS_SPINNER].text = STR_NONE; + + // Enable / disable start button based on ride dropdown + WidgetSetDisabled(*this, WIDX_START_BUTTON, false); + if (widgets[WIDX_RIDE_DROPDOWN].type == WindowWidgetType::DropdownMenu && Campaign.RideId == RideId::GetNull()) + WidgetSetDisabled(*this, WIDX_START_BUTTON, true); } - // Set current number of weeks spinner (moved to paint due to required parameter) - widgets[WIDX_WEEKS_SPINNER].text = STR_NONE; + void OnDraw(DrawPixelInfo& dpi) override + { + ScreenCoordsXY screenCoords{}; - // Enable / disable start button based on ride dropdown - WidgetSetDisabled(*this, WIDX_START_BUTTON, false); - if (widgets[WIDX_RIDE_DROPDOWN].type == WindowWidgetType::DropdownMenu && Campaign.RideId == RideId::GetNull()) - WidgetSetDisabled(*this, WIDX_START_BUTTON, true); - } + DrawWidgets(dpi); - void OnDraw(DrawPixelInfo& dpi) override + // Number of weeks + Widget* spinnerWidget = &widgets[WIDX_WEEKS_SPINNER]; + auto ft = Formatter(); + ft.Add(Campaign.no_weeks); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top }, + Campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] }); + + screenCoords = windowPos + ScreenCoordsXY{ 14, 60 }; + + // Price per week + ft = Formatter(); + ft.Add(AdvertisingCampaignPricePerWeek[Campaign.campaign_type]); + DrawTextBasic(dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft); + screenCoords.y += 13; + + // Total price + ft = Formatter(); + ft.Add(AdvertisingCampaignPricePerWeek[Campaign.campaign_type] * Campaign.no_weeks); + DrawTextBasic(dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft); + } + + void OnResize() override + { + ResizeFrame(); + } + + int16_t GetCampaignType() const + { + return Campaign.campaign_type; + } + }; + + WindowBase* WindowNewCampaignOpen(int16_t campaignType) { - ScreenCoordsXY screenCoords{}; + auto w = static_cast(WindowBringToFrontByClass(WindowClass::NewCampaign)); + if (w != nullptr) + { + if (w->GetCampaignType() == campaignType) + return w; - DrawWidgets(dpi); + WindowClose(*w); + } - // Number of weeks - Widget* spinnerWidget = &widgets[WIDX_WEEKS_SPINNER]; - auto ft = Formatter(); - ft.Add(Campaign.no_weeks); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ spinnerWidget->left + 1, spinnerWidget->top }, - Campaign.no_weeks == 1 ? STR_MARKETING_1_WEEK : STR_X_WEEKS, ft, { colours[0] }); - - screenCoords = windowPos + ScreenCoordsXY{ 14, 60 }; - - // Price per week - ft = Formatter(); - ft.Add(AdvertisingCampaignPricePerWeek[Campaign.campaign_type]); - DrawTextBasic(dpi, screenCoords, STR_MARKETING_COST_PER_WEEK, ft); - screenCoords.y += 13; - - // Total price - ft = Formatter(); - ft.Add(AdvertisingCampaignPricePerWeek[Campaign.campaign_type] * Campaign.no_weeks); - DrawTextBasic(dpi, screenCoords, STR_MARKETING_TOTAL_COST, ft); + w = WindowCreate(WindowClass::NewCampaign, WW, WH, 0); + if (w != nullptr) + { + w->SetCampaign(campaignType); + } + return w; } - void OnResize() override + void WindowCampaignRefreshRides() { - ResizeFrame(); + auto w = static_cast(WindowFindByClass(WindowClass::NewCampaign)); + if (w != nullptr) + { + w->RefreshRides(); + } } - - int16_t GetCampaignType() const - { - return Campaign.campaign_type; - } -}; - -WindowBase* WindowNewCampaignOpen(int16_t campaignType) -{ - auto w = static_cast(WindowBringToFrontByClass(WindowClass::NewCampaign)); - if (w != nullptr) - { - if (w->GetCampaignType() == campaignType) - return w; - - WindowClose(*w); - } - - w = WindowCreate(WindowClass::NewCampaign, WW, WH, 0); - if (w != nullptr) - { - w->SetCampaign(campaignType); - } - return w; -} - -void WindowCampaignRefreshRides() -{ - auto w = static_cast(WindowFindByClass(WindowClass::NewCampaign)); - if (w != nullptr) - { - w->RefreshRides(); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 65099ed86c..d20b49db76 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -39,172 +39,172 @@ #include #include -using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; - -static constexpr StringId WindowTitle = STR_NONE; -static constexpr int32_t WindowHeight = 382; -static constexpr int32_t WindowWidth = 601; -static constexpr int32_t RideListItemsMax = 384; -static constexpr int32_t RideTabCount = 6; -static constexpr int32_t GroupByTrackTypeWidth = 172; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WindowTitle = STR_NONE; + static constexpr int32_t WindowHeight = 382; + static constexpr int32_t WindowWidth = 601; + static constexpr int32_t RideListItemsMax = 384; + static constexpr int32_t RideTabCount = 6; + static constexpr int32_t GroupByTrackTypeWidth = 172; #pragma region Ride type view order -/** - * The order of ride types shown in the new ride window so that the order stays consistent across games and rides of the same - * type are kept together. - */ -static constexpr ride_type_t RideTypeViewOrder[] = { - // Transport rides - RIDE_TYPE_MINIATURE_RAILWAY, - RIDE_TYPE_MONORAIL, - RIDE_TYPE_SUSPENDED_MONORAIL, - RIDE_TYPE_CHAIRLIFT, - RIDE_TYPE_LIFT, + /** + * The order of ride types shown in the new ride window so that the order stays consistent across games and rides of the + * same type are kept together. + */ + static constexpr ride_type_t RideTypeViewOrder[] = { + // Transport rides + RIDE_TYPE_MINIATURE_RAILWAY, + RIDE_TYPE_MONORAIL, + RIDE_TYPE_SUSPENDED_MONORAIL, + RIDE_TYPE_CHAIRLIFT, + RIDE_TYPE_LIFT, - // Roller Coasters - RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER, - RIDE_TYPE_VIRGINIA_REEL, - RIDE_TYPE_REVERSER_ROLLER_COASTER, - RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER, - RIDE_TYPE_WOODEN_ROLLER_COASTER, - RIDE_TYPE_WOODEN_WILD_MOUSE, - RIDE_TYPE_STEEL_WILD_MOUSE, - RIDE_TYPE_SPINNING_WILD_MOUSE, - RIDE_TYPE_INVERTED_HAIRPIN_COASTER, - RIDE_TYPE_JUNIOR_ROLLER_COASTER, - RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER, - RIDE_TYPE_MINI_ROLLER_COASTER, - RIDE_TYPE_SPIRAL_ROLLER_COASTER, - RIDE_TYPE_MINE_TRAIN_COASTER, - RIDE_TYPE_LOOPING_ROLLER_COASTER, - RIDE_TYPE_STAND_UP_ROLLER_COASTER, - RIDE_TYPE_CORKSCREW_ROLLER_COASTER, - RIDE_TYPE_HYPERCOASTER, - RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER, - RIDE_TYPE_TWISTER_ROLLER_COASTER, - RIDE_TYPE_HYPER_TWISTER, - RIDE_TYPE_GIGA_COASTER, - RIDE_TYPE_SUSPENDED_SWINGING_COASTER, - RIDE_TYPE_COMPACT_INVERTED_COASTER, - RIDE_TYPE_INVERTED_ROLLER_COASTER, - RIDE_TYPE_INVERTED_IMPULSE_COASTER, - RIDE_TYPE_MINI_SUSPENDED_COASTER, - RIDE_TYPE_STEEPLECHASE, - RIDE_TYPE_BOBSLEIGH_COASTER, - RIDE_TYPE_MINE_RIDE, - RIDE_TYPE_HEARTLINE_TWISTER_COASTER, - RIDE_TYPE_LAY_DOWN_ROLLER_COASTER, - RIDE_TYPE_FLYING_ROLLER_COASTER, - RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER, - RIDE_TYPE_REVERSE_FREEFALL_COASTER, - RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER, - RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, - RIDE_TYPE_HYBRID_COASTER, - RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, - RIDE_TYPE_ALPINE_COASTER, + // Roller Coasters + RIDE_TYPE_SIDE_FRICTION_ROLLER_COASTER, + RIDE_TYPE_VIRGINIA_REEL, + RIDE_TYPE_REVERSER_ROLLER_COASTER, + RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER, + RIDE_TYPE_WOODEN_ROLLER_COASTER, + RIDE_TYPE_WOODEN_WILD_MOUSE, + RIDE_TYPE_STEEL_WILD_MOUSE, + RIDE_TYPE_SPINNING_WILD_MOUSE, + RIDE_TYPE_INVERTED_HAIRPIN_COASTER, + RIDE_TYPE_JUNIOR_ROLLER_COASTER, + RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER, + RIDE_TYPE_MINI_ROLLER_COASTER, + RIDE_TYPE_SPIRAL_ROLLER_COASTER, + RIDE_TYPE_MINE_TRAIN_COASTER, + RIDE_TYPE_LOOPING_ROLLER_COASTER, + RIDE_TYPE_STAND_UP_ROLLER_COASTER, + RIDE_TYPE_CORKSCREW_ROLLER_COASTER, + RIDE_TYPE_HYPERCOASTER, + RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER, + RIDE_TYPE_TWISTER_ROLLER_COASTER, + RIDE_TYPE_HYPER_TWISTER, + RIDE_TYPE_GIGA_COASTER, + RIDE_TYPE_SUSPENDED_SWINGING_COASTER, + RIDE_TYPE_COMPACT_INVERTED_COASTER, + RIDE_TYPE_INVERTED_ROLLER_COASTER, + RIDE_TYPE_INVERTED_IMPULSE_COASTER, + RIDE_TYPE_MINI_SUSPENDED_COASTER, + RIDE_TYPE_STEEPLECHASE, + RIDE_TYPE_BOBSLEIGH_COASTER, + RIDE_TYPE_MINE_RIDE, + RIDE_TYPE_HEARTLINE_TWISTER_COASTER, + RIDE_TYPE_LAY_DOWN_ROLLER_COASTER, + RIDE_TYPE_FLYING_ROLLER_COASTER, + RIDE_TYPE_MULTI_DIMENSION_ROLLER_COASTER, + RIDE_TYPE_REVERSE_FREEFALL_COASTER, + RIDE_TYPE_VERTICAL_DROP_ROLLER_COASTER, + RIDE_TYPE_AIR_POWERED_VERTICAL_COASTER, + RIDE_TYPE_HYBRID_COASTER, + RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, + RIDE_TYPE_ALPINE_COASTER, - // Gentle rides - RIDE_TYPE_MONORAIL_CYCLES, - RIDE_TYPE_CROOKED_HOUSE, - RIDE_TYPE_HAUNTED_HOUSE, - RIDE_TYPE_FERRIS_WHEEL, - RIDE_TYPE_MAZE, - RIDE_TYPE_MERRY_GO_ROUND, - RIDE_TYPE_MINI_GOLF, - RIDE_TYPE_OBSERVATION_TOWER, - RIDE_TYPE_CAR_RIDE, - RIDE_TYPE_MONSTER_TRUCKS, - RIDE_TYPE_MINI_HELICOPTERS, - RIDE_TYPE_SPIRAL_SLIDE, - RIDE_TYPE_DODGEMS, - RIDE_TYPE_SPACE_RINGS, - RIDE_TYPE_CIRCUS, - RIDE_TYPE_GHOST_TRAIN, - RIDE_TYPE_FLYING_SAUCERS, + // Gentle rides + RIDE_TYPE_MONORAIL_CYCLES, + RIDE_TYPE_CROOKED_HOUSE, + RIDE_TYPE_HAUNTED_HOUSE, + RIDE_TYPE_FERRIS_WHEEL, + RIDE_TYPE_MAZE, + RIDE_TYPE_MERRY_GO_ROUND, + RIDE_TYPE_MINI_GOLF, + RIDE_TYPE_OBSERVATION_TOWER, + RIDE_TYPE_CAR_RIDE, + RIDE_TYPE_MONSTER_TRUCKS, + RIDE_TYPE_MINI_HELICOPTERS, + RIDE_TYPE_SPIRAL_SLIDE, + RIDE_TYPE_DODGEMS, + RIDE_TYPE_SPACE_RINGS, + RIDE_TYPE_CIRCUS, + RIDE_TYPE_GHOST_TRAIN, + RIDE_TYPE_FLYING_SAUCERS, - // Thrill rides - RIDE_TYPE_TWIST, - RIDE_TYPE_MAGIC_CARPET, - RIDE_TYPE_LAUNCHED_FREEFALL, - RIDE_TYPE_SWINGING_SHIP, - RIDE_TYPE_GO_KARTS, - RIDE_TYPE_SWINGING_INVERTER_SHIP, - RIDE_TYPE_MOTION_SIMULATOR, - RIDE_TYPE_3D_CINEMA, - RIDE_TYPE_TOP_SPIN, - RIDE_TYPE_ROTO_DROP, - RIDE_TYPE_ENTERPRISE, + // Thrill rides + RIDE_TYPE_TWIST, + RIDE_TYPE_MAGIC_CARPET, + RIDE_TYPE_LAUNCHED_FREEFALL, + RIDE_TYPE_SWINGING_SHIP, + RIDE_TYPE_GO_KARTS, + RIDE_TYPE_SWINGING_INVERTER_SHIP, + RIDE_TYPE_MOTION_SIMULATOR, + RIDE_TYPE_3D_CINEMA, + RIDE_TYPE_TOP_SPIN, + RIDE_TYPE_ROTO_DROP, + RIDE_TYPE_ENTERPRISE, - // Water rides - RIDE_TYPE_DINGHY_SLIDE, - RIDE_TYPE_LOG_FLUME, - RIDE_TYPE_RIVER_RAPIDS, - RIDE_TYPE_SPLASH_BOATS, - RIDE_TYPE_SUBMARINE_RIDE, - RIDE_TYPE_BOAT_HIRE, - RIDE_TYPE_RIVER_RAFTS, - RIDE_TYPE_WATER_COASTER, + // Water rides + RIDE_TYPE_DINGHY_SLIDE, + RIDE_TYPE_LOG_FLUME, + RIDE_TYPE_RIVER_RAPIDS, + RIDE_TYPE_SPLASH_BOATS, + RIDE_TYPE_SUBMARINE_RIDE, + RIDE_TYPE_BOAT_HIRE, + RIDE_TYPE_RIVER_RAFTS, + RIDE_TYPE_WATER_COASTER, - // Shops / stalls - RIDE_TYPE_FOOD_STALL, - RIDE_TYPE_1D, - RIDE_TYPE_DRINK_STALL, - RIDE_TYPE_1F, - RIDE_TYPE_SHOP, - RIDE_TYPE_22, - RIDE_TYPE_INFORMATION_KIOSK, - RIDE_TYPE_FIRST_AID, - RIDE_TYPE_CASH_MACHINE, - RIDE_TYPE_TOILETS, -}; + // Shops / stalls + RIDE_TYPE_FOOD_STALL, + RIDE_TYPE_1D, + RIDE_TYPE_DRINK_STALL, + RIDE_TYPE_1F, + RIDE_TYPE_SHOP, + RIDE_TYPE_22, + RIDE_TYPE_INFORMATION_KIOSK, + RIDE_TYPE_FIRST_AID, + RIDE_TYPE_CASH_MACHINE, + RIDE_TYPE_TOILETS, + }; #pragma endregion -enum NewRideTabId -{ - TRANSPORT_TAB, - GENTLE_TAB, - ROLLER_COASTER_TAB, - THRILL_TAB, - WATER_TAB, - SHOP_TAB, - RESEARCH_TAB, - TAB_COUNT, -}; + enum NewRideTabId + { + TRANSPORT_TAB, + GENTLE_TAB, + ROLLER_COASTER_TAB, + THRILL_TAB, + WATER_TAB, + SHOP_TAB, + RESEARCH_TAB, + TAB_COUNT, + }; #pragma region Widgets -enum -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PAGE_BACKGROUND, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_TAB_4, - WIDX_TAB_5, - WIDX_TAB_6, - WIDX_TAB_7, - WIDX_RIDE_LIST, + enum + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PAGE_BACKGROUND, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_TAB_4, + WIDX_TAB_5, + WIDX_TAB_6, + WIDX_TAB_7, + WIDX_RIDE_LIST, - WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP, - WIDX_LAST_DEVELOPMENT_GROUP, - WIDX_LAST_DEVELOPMENT_BUTTON, - WIDX_RESEARCH_FUNDING_BUTTON, + WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP, + WIDX_LAST_DEVELOPMENT_GROUP, + WIDX_LAST_DEVELOPMENT_BUTTON, + WIDX_RESEARCH_FUNDING_BUTTON, - WIDX_FILTER_TEXT_BOX, - WIDX_FILTER_CLEAR_BUTTON, - WIDX_GROUP_BY_TRACK_TYPE, -}; + WIDX_FILTER_TEXT_BOX, + WIDX_FILTER_CLEAR_BUTTON, + WIDX_GROUP_BY_TRACK_TYPE, + }; -static constexpr ScreenCoordsXY GroupByTrackTypeOrigin{ WindowWidth - 8 - GroupByTrackTypeWidth, 47 }; -static constexpr ScreenSize GroupTrackTypeSize{ GroupByTrackTypeWidth, 14 }; + static constexpr ScreenCoordsXY GroupByTrackTypeOrigin{ WindowWidth - 8 - GroupByTrackTypeWidth, 47 }; + static constexpr ScreenSize GroupTrackTypeSize{ GroupByTrackTypeWidth, 14 }; -// clang-format off + // clang-format off static Widget window_new_ride_widgets[] = { WINDOW_SHIM(WindowTitle, WindowWidth, WindowHeight), MakeWidget({ 0, 43}, {601, 339}, WindowWidgetType::Resize, WindowColour::Secondary ), @@ -225,861 +225,863 @@ static Widget window_new_ride_widgets[] = { MakeWidget(GroupByTrackTypeOrigin, GroupTrackTypeSize, WindowWidgetType::Checkbox, WindowColour::Secondary, STR_GROUP_BY_TRACK_TYPE, STR_GROUP_BY_TRACK_TYPE_TIP ), kWidgetsEnd, }; -// clang-format on + // clang-format on #pragma endregion -static constexpr StringId RideTitles[] = { - STR_NEW_TRANSPORT_RIDES, // TRANSPORT_TAB - STR_NEW_GENTLE_RIDES, // GENTLE_TAB - STR_NEW_ROLLER_COASTERS, // ROLLER_COASTER_TAB - STR_NEW_THRILL_RIDES, // THRILL_TAB - STR_NEW_WATER_RIDES, // WATER_TAB - STR_NEW_SHOPS_STALLS, // SHOP_TAB - STR_RESEARCH_AND_DEVELOPMENT, // RESEARCH_TAB -}; -static_assert(std::size(RideTitles) == TAB_COUNT); + static constexpr StringId RideTitles[] = { + STR_NEW_TRANSPORT_RIDES, // TRANSPORT_TAB + STR_NEW_GENTLE_RIDES, // GENTLE_TAB + STR_NEW_ROLLER_COASTERS, // ROLLER_COASTER_TAB + STR_NEW_THRILL_RIDES, // THRILL_TAB + STR_NEW_WATER_RIDES, // WATER_TAB + STR_NEW_SHOPS_STALLS, // SHOP_TAB + STR_RESEARCH_AND_DEVELOPMENT, // RESEARCH_TAB + }; + static_assert(std::size(RideTitles) == TAB_COUNT); -static constexpr int32_t TabAnimationLoops[] = { - 20, // TRANSPORT_TAB - 32, // GENTLE_TAB - 10, // ROLLER_COASTER_TAB - 72, // THRILL_TAB - 24, // WATER_TAB - 28, // SHOP_TAB - 16, // RESEARCH_TAB -}; -static_assert(std::size(TabAnimationLoops) == TAB_COUNT); + static constexpr int32_t TabAnimationLoops[] = { + 20, // TRANSPORT_TAB + 32, // GENTLE_TAB + 10, // ROLLER_COASTER_TAB + 72, // THRILL_TAB + 24, // WATER_TAB + 28, // SHOP_TAB + 16, // RESEARCH_TAB + }; + static_assert(std::size(TabAnimationLoops) == TAB_COUNT); -static constexpr int32_t TabAnimationDivisor[] = { - 4, // TRANSPORT_TAB - 8, // GENTLE_TAB - 2, // ROLLER_COASTER_TAB - 4, // THRILL_TAB - 4, // WATER_TAB - 4, // SHOP_TAB - 2, // RESEARCH_TAB -}; -static_assert(std::size(TabAnimationDivisor) == TAB_COUNT); + static constexpr int32_t TabAnimationDivisor[] = { + 4, // TRANSPORT_TAB + 8, // GENTLE_TAB + 2, // ROLLER_COASTER_TAB + 4, // THRILL_TAB + 4, // WATER_TAB + 4, // SHOP_TAB + 2, // RESEARCH_TAB + }; + static_assert(std::size(TabAnimationDivisor) == TAB_COUNT); -static constexpr int32_t ThrillRidesTabAnimationSequence[] = { - 5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, -}; + static constexpr int32_t ThrillRidesTabAnimationSequence[] = { + 5, 6, 5, 4, 3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 0, 0, 0, + }; -class NewRideWindow final : public Window -{ -private: - static NewRideTabId _currentTab; - static uint_fast16_t _windowNewRideTabScroll[RideTabCount]; - u8string _filter; - u8string _vehicleAvailability{}; - RideSelection _lastTrackDesignCountRideType{}; - int32_t _lastTrackDesignCount{}; - RideSelection _windowNewRideListItems[RideListItemsMax]{}; - struct NewRideVariables + class NewRideWindow final : public Window { - RideSelection SelectedRide; - RideSelection HighlightedRide; - uint16_t SelectedRideCountdown; - } _newRideVars{}; - -public: - static void SetOpeningPage(NewRideTabId tab) - { - _currentTab = tab; - } - - static void ResetTabScrolls() - { - std::fill_n(NewRideWindow::_windowNewRideTabScroll, RideTabCount, 0); - } - - void OnOpen() override - { - widgets = window_new_ride_widgets; - PopulateRideList(); - InitScrollWidgets(); - _filter.clear(); - - frame_no = 0; - _newRideVars.SelectedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; - _lastTrackDesignCountRideType.Type = RIDE_TYPE_NULL; - _lastTrackDesignCountRideType.EntryIndex = OBJECT_ENTRY_INDEX_NULL; - - width = 1; - RefreshWidgetSizing(); - - if (_currentTab < RESEARCH_TAB) + private: + static NewRideTabId _currentTab; + static uint_fast16_t _windowNewRideTabScroll[RideTabCount]; + u8string _filter; + u8string _vehicleAvailability{}; + RideSelection _lastTrackDesignCountRideType{}; + int32_t _lastTrackDesignCount{}; + RideSelection _windowNewRideListItems[RideListItemsMax]{}; + struct NewRideVariables { - SetPage(_currentTab); - RestoreScrollPositionForCurrentTab(); + RideSelection SelectedRide; + RideSelection HighlightedRide; + uint16_t SelectedRideCountdown; + } _newRideVars{}; + + public: + static void SetOpeningPage(NewRideTabId tab) + { + _currentTab = tab; } - } + + static void ResetTabScrolls() + { + std::fill_n(NewRideWindow::_windowNewRideTabScroll, RideTabCount, 0); + } + + void OnOpen() override + { + widgets = window_new_ride_widgets; + PopulateRideList(); + InitScrollWidgets(); + _filter.clear(); - void OnUpdate() override - { - frame_no++; - if (frame_no >= TabAnimationLoops[_currentTab]) frame_no = 0; + _newRideVars.SelectedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; + _lastTrackDesignCountRideType.Type = RIDE_TYPE_NULL; + _lastTrackDesignCountRideType.EntryIndex = OBJECT_ENTRY_INDEX_NULL; - WidgetInvalidate(*this, WIDX_TAB_1 + static_cast(_currentTab)); + width = 1; + RefreshWidgetSizing(); - if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) - { - WindowUpdateTextboxCaret(); - WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); - } - - if (_newRideVars.SelectedRide.Type != RIDE_TYPE_NULL && _newRideVars.SelectedRideCountdown-- == 0) - { - RideSelect(); - } - - PopulateRideList(); - - if (_currentTab < RESEARCH_TAB) - { - _windowNewRideTabScroll[_currentTab] = scrolls[0].v_top; - - // Remove highlight when mouse leaves rides list - if (!WidgetIsHighlighted(*this, WIDX_RIDE_LIST)) + if (_currentTab < RESEARCH_TAB) { - _newRideVars.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; - WidgetInvalidate(*this, WIDX_RIDE_LIST); - } - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_LAST_DEVELOPMENT_BUTTON: - WindowResearchDevelopmentMouseUp(widgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - break; - case WIDX_RESEARCH_FUNDING_BUTTON: - ContextOpenWindowView(WV_FINANCES_RESEARCH); - break; - case WIDX_GROUP_BY_TRACK_TYPE: - gConfigInterface.ListRideVehiclesSeparately = !gConfigInterface.ListRideVehiclesSeparately; - ConfigSaveDefault(); SetPage(_currentTab); - break; - case WIDX_FILTER_TEXT_BOX: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter.data(), TEXT_INPUT_SIZE); - break; - case WIDX_FILTER_CLEAR_BUTTON: - _filter.clear(); - scrolls->v_top = 0; - Invalidate(); - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - if (widgetIndex >= WIDX_TAB_1 && widgetIndex <= WIDX_TAB_7) - { - SetPage(widgetIndex - WIDX_TAB_1); - } - } - - void OnPrepareDraw() override - { - SetPressedTab(); - - if (!gConfigInterface.ListRideVehiclesSeparately) - pressed_widgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); - else - pressed_widgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); - - widgets[WIDX_TITLE].text = RideTitles[_currentTab]; - widgets[WIDX_TAB_7].type = WindowWidgetType::Tab; - widgets[WIDX_FILTER_TEXT_BOX].string = _filter.data(); - - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - widgets[WIDX_TAB_7].type = WindowWidgetType::Empty; - - if (_currentTab == RESEARCH_TAB) - { - WindowResearchDevelopmentPrepareDraw(this, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - } - - const auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - auto string = ls.GetString(STR_GROUP_BY_TRACK_TYPE); - auto strWidth = GfxGetStringWidth(string, FontStyle::Medium); - auto localizedGroupByTrackTypeWidth = strWidth + 14; - widgets[WIDX_GROUP_BY_TRACK_TYPE].left = width - 8 - localizedGroupByTrackTypeWidth; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - if (_currentTab != RESEARCH_TAB) - { - RideSelection item = _newRideVars.HighlightedRide; - if (item.Type != RIDE_TYPE_NULL || item.EntryIndex != OBJECT_ENTRY_INDEX_NULL) - DrawRideInformation(dpi, item, windowPos + ScreenCoordsXY{ 3, height - 64 }, width - 6); - } - else - { - WindowResearchDevelopmentDraw(this, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - RideSelection* listItem = _windowNewRideListItems; - - int32_t count = 0; - while (listItem->Type != RIDE_TYPE_NULL || listItem->EntryIndex != OBJECT_ENTRY_INDEX_NULL) - { - count++; - listItem++; - } - return { widgets[WIDX_RIDE_LIST].width(), ((count + 4) / 5) * 116 }; - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - RideSelection item = ScrollGetRideListItemAt(screenCoords); - if (_newRideVars.HighlightedRide == item) - { - return; - } - - _newRideVars.HighlightedRide = item; - Invalidate(); - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - RideSelection item = ScrollGetRideListItemAt(screenCoords); - if (item.Type == RIDE_TYPE_NULL && item.EntryIndex == OBJECT_ENTRY_INDEX_NULL) - { - return; - } - - _newRideVars.SelectedRide = item; - - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); - _newRideVars.SelectedRideCountdown = 8; - Invalidate(); - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - if (_currentTab == RESEARCH_TAB) - { - return; - } - - GfxClear(&dpi, ColourMapA[colours[1]].mid_light); - - ScreenCoordsXY coords{ 1, 1 }; - RideSelection* listItem = _windowNewRideListItems; - while (listItem->Type != RIDE_TYPE_NULL || listItem->EntryIndex != OBJECT_ENTRY_INDEX_NULL) - { - // Draw flat button rectangle - int32_t buttonFlags = 0; - if (_newRideVars.SelectedRide == *listItem) - buttonFlags |= INSET_RECT_FLAG_BORDER_INSET; - if (_newRideVars.HighlightedRide == *listItem || buttonFlags != 0) - GfxFillRectInset( - dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1], - INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags); - - // Draw ride image with feathered border - auto mask = ImageId(SPR_NEW_RIDE_MASK); - auto rideImage = ImageId(GetRideImage(*listItem)); - GfxDrawSpriteRawMasked(&dpi, coords + ScreenCoordsXY{ 2, 2 }, mask, rideImage); - - // Next position - coords.x += 116; - if (coords.x >= 116 * 5 + 1) - { - coords.x = 1; - coords.y += 116; - } - - // Next item - listItem++; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex != WIDX_FILTER_TEXT_BOX) - return; - - if (text == _filter) - return; - - _filter.assign(text); - - scrolls->v_top = 0; - Invalidate(); - } - - void SetPage(int tab) - { - if (tab >= TRANSPORT_TAB && tab < TAB_COUNT) - { - SetPage(static_cast(tab)); - } - } - - void SetPage(NewRideTabId tab) - { - _currentTab = tab; - frame_no = 0; - _newRideVars.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; - _newRideVars.SelectedRideCountdown = std::numeric_limits::max(); - PopulateRideList(); - RefreshWidgetSizing(); - Invalidate(); - - if (tab < RESEARCH_TAB) - { - RestoreScrollPositionForCurrentTab(); - } - } - -private: - void RideSelect() - { - RideSelection item = _newRideVars.SelectedRide; - if (item.Type == RIDE_TYPE_NULL) - { - return; - } - - Close(); - WindowCloseConstructionWindows(); - - auto count = GetNumTrackDesigns(item); - if (count > 0) - { - auto intent = Intent(WindowClass::TrackDesignList); - intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, item.Type); - intent.PutExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, item.EntryIndex); - ContextOpenIntent(&intent); - return; - } - - RideConstructNew(item); - } - - int32_t GetNumTrackDesigns(RideSelection item) - { - // Cache the result - if (item.Type == _lastTrackDesignCountRideType.Type && item.EntryIndex == _lastTrackDesignCountRideType.EntryIndex) - { - return _lastTrackDesignCount; - } - - std::string entryName; - - if (item.Type < 0x80) - { - if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - entryName = GetRideEntryName(item.EntryIndex); + RestoreScrollPositionForCurrentTab(); } } - auto repo = OpenRCT2::GetContext()->GetTrackDesignRepository(); - _lastTrackDesignCount = static_cast(repo->GetCountForObjectEntry(item.Type, entryName)); - _lastTrackDesignCountRideType = item; - return _lastTrackDesignCount; - } - - void UpdateVehicleAvailability(ObjectEntryIndex rideType) - { - _vehicleAvailability.clear(); - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + void OnUpdate() override { - return; - } + frame_no++; + if (frame_no >= TabAnimationLoops[_currentTab]) + frame_no = 0; - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - auto& rideEntries = objManager.GetAllRideEntries(rideType); - auto isFirst = true; - for (auto rideEntryIndex : rideEntries) - { - auto currentRideEntry = GetRideEntryByIndex(rideEntryIndex); + WidgetInvalidate(*this, WIDX_TAB_1 + static_cast(_currentTab)); - // Skip if vehicle type is not invented yet - if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) { - continue; + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); } - // Append comma if not the first iteration - if (!isFirst) + if (_newRideVars.SelectedRide.Type != RIDE_TYPE_NULL && _newRideVars.SelectedRideCountdown-- == 0) { - _vehicleAvailability += u8", "; + RideSelect(); } - // Append vehicle name - auto vehicleName = LanguageGetString(currentRideEntry->naming.Name); - _vehicleAvailability += vehicleName; + PopulateRideList(); - isFirst = false; - } - } - - ImageIndex GetRideImage(RideSelection rideSelection) - { - auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); - auto obj = static_cast(objMgr.GetLoadedObject(ObjectType::Ride, rideSelection.EntryIndex)); - return obj == nullptr ? ImageIndexUndefined : obj->GetPreviewImage(rideSelection.Type); - } - - void PopulateRideList() - { - uint8_t currentCategory = _currentTab; - RideSelection* nextListItem = _windowNewRideListItems; - RideSelection* listEnd = _windowNewRideListItems + RideListItemsMax; - - // For each ride type in the view order list - for (int32_t i = 0; i < static_cast(std::size(RideTypeViewOrder)); i++) - { - auto rideType = RideTypeViewOrder[i]; - if (rideType == RIDE_TYPE_NULL) - continue; - - if (GetRideTypeDescriptor(rideType).Category != currentCategory) - continue; - - nextListItem = IterateOverRideType(rideType, nextListItem, listEnd); - } - - nextListItem->Type = RIDE_TYPE_NULL; - nextListItem->EntryIndex = OBJECT_ENTRY_INDEX_NULL; - } - - RideSelection* IterateOverRideType(ride_type_t rideType, RideSelection* nextListItem, RideSelection* listEnd) - { - bool buttonForRideTypeCreated = false; - bool allowDrawingOverLastButton = false; - - uint8_t highestVehiclePriority = 0; - - // For each ride entry for this ride type - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - auto& rideEntries = objManager.GetAllRideEntries(rideType); - for (auto rideEntryIndex : rideEntries) - { - // Skip if vehicle type is not invented yet - if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) - continue; - - // Ride entries - const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); - - // Skip if the vehicle isn't the preferred vehicle for this generic track type - if (!gConfigInterface.ListRideVehiclesSeparately - && !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY) - && highestVehiclePriority > rideEntry->BuildMenuPriority) + if (_currentTab < RESEARCH_TAB) { - continue; - } + _windowNewRideTabScroll[_currentTab] = scrolls[0].v_top; - if (!IsFiltered(*rideEntry)) - { - continue; - } - - highestVehiclePriority = rideEntry->BuildMenuPriority; - - // Determines how and where to draw a button for this ride type/vehicle. - if (gConfigInterface.ListRideVehiclesSeparately - || GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - // Separate, draw apart - allowDrawingOverLastButton = false; - - if (nextListItem >= listEnd) - continue; - - nextListItem->Type = rideType; - nextListItem->EntryIndex = rideEntryIndex; - nextListItem++; - } - else if (!buttonForRideTypeCreated) - { - // Non-separate, draw-apart - buttonForRideTypeCreated = true; - allowDrawingOverLastButton = true; - - if (nextListItem >= listEnd) - continue; - - nextListItem->Type = rideType; - nextListItem->EntryIndex = rideEntryIndex; - nextListItem++; - } - else if (allowDrawingOverLastButton) - { - // Non-separate, draw over previous - if (rideType == rideEntry->ride_type[0]) + // Remove highlight when mouse leaves rides list + if (!WidgetIsHighlighted(*this, WIDX_RIDE_LIST)) { - nextListItem--; - nextListItem->Type = rideType; - nextListItem->EntryIndex = rideEntryIndex; - nextListItem++; + _newRideVars.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; + WidgetInvalidate(*this, WIDX_RIDE_LIST); } } } - return nextListItem; - } - - bool IsFiltered(const RideObjectEntry& rideEntry) - { - if (_filter.empty()) - return true; - - return IsFilterInRideType(rideEntry) || IsFilterInRideName(rideEntry) || IsFilterInIdentifier(rideEntry) - || IsFilterInAuthors(rideEntry) || IsFilterInFilename(rideEntry); - } - - bool IsFilterInRideType(const RideObjectEntry& rideEntry) - { - auto rideTypeName = GetRideNaming(rideEntry.ride_type[0], rideEntry).Name; - return String::Contains(u8string_view(LanguageGetString(rideTypeName)), _filter, true); - } - - bool IsFilterInRideName(const RideObjectEntry& rideEntry) - { - auto rideName = rideEntry.naming.Name; - return String::Contains(u8string_view(LanguageGetString(rideName)), _filter, true); - } - - bool IsFilterInAuthors(const RideObjectEntry& rideEntry) - { - auto rideObject = static_cast(rideEntry.obj); - auto authors = rideObject->GetAuthors(); - - for (auto author : authors) - if (String::Contains(author, _filter, true)) - return true; - - return false; - } - - bool IsFilterInIdentifier(const RideObjectEntry& rideEntry) - { - auto rideObject = static_cast(rideEntry.obj); - auto objectName = rideObject->GetObjectEntry().GetName(); - - return String::Contains(objectName, _filter, true); - } - - bool IsFilterInFilename(const RideObjectEntry& rideEntry) - { - auto rideObject = static_cast(rideEntry.obj); - auto repoItem = ObjectRepositoryFindObjectByEntry(&(rideObject->GetObjectEntry())); - - return String::Contains(repoItem->Path, _filter, true); - } - - void SetPressedTab() - { - int32_t i{}; - for (i = 0; i < TAB_COUNT; i++) + void OnMouseUp(WidgetIndex widgetIndex) override { - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - } - pressed_widgets |= 1LL << (WIDX_TAB_1 + static_cast(_currentTab)); - } - - void RefreshWidgetSizing() - { - int32_t newWidth{}, newHeight{}; - - if (_currentTab < SHOP_TAB) - { - disabled_widgets &= ~(1 << WIDX_GROUP_BY_TRACK_TYPE); - } - else - { - disabled_widgets |= 1LL << WIDX_GROUP_BY_TRACK_TYPE; - } - - // Show or hide unrelated widgets - - if (_currentTab < RESEARCH_TAB) - { - widgets[WIDX_GROUP_BY_TRACK_TYPE].type = WindowWidgetType::Checkbox; - } - else - { - widgets[WIDX_GROUP_BY_TRACK_TYPE].type = WindowWidgetType::Empty; - } - - if (_currentTab != RESEARCH_TAB) - { - widgets[WIDX_RIDE_LIST].type = WindowWidgetType::Scroll; - widgets[WIDX_FILTER_TEXT_BOX].type = WindowWidgetType::TextBox; - widgets[WIDX_FILTER_CLEAR_BUTTON].type = WindowWidgetType::Button; - widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WindowWidgetType::Empty; - widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WindowWidgetType::Empty; - widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WindowWidgetType::Empty; - - newWidth = WindowWidth; - newHeight = WindowHeight; - } - else - { - widgets[WIDX_RIDE_LIST].type = WindowWidgetType::Empty; - widgets[WIDX_FILTER_TEXT_BOX].type = WindowWidgetType::Empty; - widgets[WIDX_FILTER_CLEAR_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WindowWidgetType::Groupbox; - widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WindowWidgetType::Groupbox; - widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WindowWidgetType::FlatBtn; - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WindowWidgetType::FlatBtn; - - newWidth = 300; - newHeight = 196; - } - - // Handle new window size - if (width != newWidth || height != newHeight) - { - Invalidate(); - - // Resize widgets to new window size - width = newWidth; - height = newHeight; - ResizeFrameWithPage(); - widgets[WIDX_GROUP_BY_TRACK_TYPE].left = newWidth - 8 - GroupByTrackTypeWidth; - widgets[WIDX_GROUP_BY_TRACK_TYPE].right = newWidth - 8; - - Invalidate(); - } - - InitScrollWidgets(); - } - - RideSelection ScrollGetRideListItemAt(const ScreenCoordsXY& screenCoords) - { - RideSelection result; - result.Type = RIDE_TYPE_NULL; - result.EntryIndex = OBJECT_ENTRY_INDEX_NULL; - - if (screenCoords.x <= 0 || screenCoords.y <= 0) - return result; - - int32_t column = screenCoords.x / 116; - int32_t row = screenCoords.y / 116; - if (column >= 5) - return result; - - int32_t index = column + (row * 5); - - RideSelection* listItem = _windowNewRideListItems; - while (listItem->Type != RIDE_TYPE_NULL || listItem->EntryIndex != OBJECT_ENTRY_INDEX_NULL) - { - if (index-- == 0) + switch (widgetIndex) { - return *listItem; + case WIDX_CLOSE: + Close(); + break; + case WIDX_LAST_DEVELOPMENT_BUTTON: + WindowResearchDevelopmentMouseUp(widgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + break; + case WIDX_RESEARCH_FUNDING_BUTTON: + ContextOpenWindowView(WV_FINANCES_RESEARCH); + break; + case WIDX_GROUP_BY_TRACK_TYPE: + gConfigInterface.ListRideVehiclesSeparately = !gConfigInterface.ListRideVehiclesSeparately; + ConfigSaveDefault(); + SetPage(_currentTab); + break; + case WIDX_FILTER_TEXT_BOX: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filter.data(), TEXT_INPUT_SIZE); + break; + case WIDX_FILTER_CLEAR_BUTTON: + _filter.clear(); + scrolls->v_top = 0; + Invalidate(); + break; } - listItem++; } - return result; - } - - void RestoreScrollPositionForCurrentTab() - { - assert(static_cast(_currentTab) < std::size(_windowNewRideTabScroll)); - auto& currentTabScroll = _windowNewRideTabScroll[_currentTab]; - - // Get maximum scroll height - ScreenSize scrollSize = OnScrollGetSize(0); - const Widget& listWidget = widgets[WIDX_RIDE_LIST]; - const int32_t listWidgetHeight = listWidget.bottom - listWidget.top - 1; - - // Ensure the current tab scroll is within range - currentTabScroll = std::min(currentTabScroll, std::max(0, scrollSize.height - listWidgetHeight)); - - scrolls[0].v_top = currentTabScroll; - WidgetScrollUpdateThumbs(*this, WIDX_RIDE_LIST); - } - - void DrawRideInformation(DrawPixelInfo& dpi, RideSelection item, const ScreenCoordsXY& screenPos, int32_t textWidth) - { - const auto* rideEntry = GetRideEntryByIndex(item.EntryIndex); - RideNaming rideNaming = GetRideNaming(item.Type, *rideEntry); - auto ft = Formatter(); - - UpdateVehicleAvailability(item.Type); - - // Ride name and description - ft.Add(rideNaming.Name); - ft.Add(rideNaming.Description); - DrawTextWrapped(dpi, screenPos, textWidth, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft); - - if (!_vehicleAvailability.empty()) + void OnMouseDown(WidgetIndex widgetIndex) override { - if (gConfigInterface.ListRideVehiclesSeparately) + if (widgetIndex >= WIDX_TAB_1 && widgetIndex <= WIDX_TAB_7) { - ft = Formatter(); - ft.Add(rideEntry->naming.Name); - DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft); + SetPage(widgetIndex - WIDX_TAB_1); + } + } + + void OnPrepareDraw() override + { + SetPressedTab(); + + if (!gConfigInterface.ListRideVehiclesSeparately) + pressed_widgets |= (1LL << WIDX_GROUP_BY_TRACK_TYPE); + else + pressed_widgets &= ~(1LL << WIDX_GROUP_BY_TRACK_TYPE); + + widgets[WIDX_TITLE].text = RideTitles[_currentTab]; + widgets[WIDX_TAB_7].type = WindowWidgetType::Tab; + widgets[WIDX_FILTER_TEXT_BOX].string = _filter.data(); + + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + widgets[WIDX_TAB_7].type = WindowWidgetType::Empty; + + if (_currentTab == RESEARCH_TAB) + { + WindowResearchDevelopmentPrepareDraw(this, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + } + + const auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); + auto string = ls.GetString(STR_GROUP_BY_TRACK_TYPE); + auto strWidth = GfxGetStringWidth(string, FontStyle::Medium); + auto localizedGroupByTrackTypeWidth = strWidth + 14; + widgets[WIDX_GROUP_BY_TRACK_TYPE].left = width - 8 - localizedGroupByTrackTypeWidth; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + if (_currentTab != RESEARCH_TAB) + { + RideSelection item = _newRideVars.HighlightedRide; + if (item.Type != RIDE_TYPE_NULL || item.EntryIndex != OBJECT_ENTRY_INDEX_NULL) + DrawRideInformation(dpi, item, windowPos + ScreenCoordsXY{ 3, height - 64 }, width - 6); } else { - ft = Formatter(); - ft.Add(_vehicleAvailability.c_str()); - DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft); + WindowResearchDevelopmentDraw(this, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); } } - auto count = GetNumTrackDesigns(item); - auto designCountStringId = GetDesignsAvailableStringId(count); - ft = Formatter(); - ft.Add(count); - DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft); - - // Price - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - // Get price of ride - int32_t startPieceId = GetRideTypeDescriptor(item.Type).StartTrackPiece; - money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; - const auto& ted = GetTrackElementDescriptor(startPieceId); - price *= ted.PriceModifier; - price = (price >> 16) * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; + RideSelection* listItem = _windowNewRideListItems; - // - StringId stringId = STR_NEW_RIDE_COST; - if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) - stringId = STR_NEW_RIDE_COST_FROM; + int32_t count = 0; + while (listItem->Type != RIDE_TYPE_NULL || listItem->EntryIndex != OBJECT_ENTRY_INDEX_NULL) + { + count++; + listItem++; + } + return { widgets[WIDX_RIDE_LIST].width(), ((count + 4) / 5) * 116 }; + } + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + RideSelection item = ScrollGetRideListItemAt(screenCoords); + if (_newRideVars.HighlightedRide == item) + { + return; + } + + _newRideVars.HighlightedRide = item; + Invalidate(); + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + RideSelection item = ScrollGetRideListItemAt(screenCoords); + if (item.Type == RIDE_TYPE_NULL && item.EntryIndex == OBJECT_ENTRY_INDEX_NULL) + { + return; + } + + _newRideVars.SelectedRide = item; + + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); + _newRideVars.SelectedRideCountdown = 8; + Invalidate(); + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + if (_currentTab == RESEARCH_TAB) + { + return; + } + + GfxClear(&dpi, ColourMapA[colours[1]].mid_light); + + ScreenCoordsXY coords{ 1, 1 }; + RideSelection* listItem = _windowNewRideListItems; + while (listItem->Type != RIDE_TYPE_NULL || listItem->EntryIndex != OBJECT_ENTRY_INDEX_NULL) + { + // Draw flat button rectangle + int32_t buttonFlags = 0; + if (_newRideVars.SelectedRide == *listItem) + buttonFlags |= INSET_RECT_FLAG_BORDER_INSET; + if (_newRideVars.HighlightedRide == *listItem || buttonFlags != 0) + GfxFillRectInset( + dpi, { coords, coords + ScreenCoordsXY{ 115, 115 } }, colours[1], + INSET_RECT_FLAG_FILL_MID_LIGHT | buttonFlags); + + // Draw ride image with feathered border + auto mask = ImageId(SPR_NEW_RIDE_MASK); + auto rideImage = ImageId(GetRideImage(*listItem)); + GfxDrawSpriteRawMasked(&dpi, coords + ScreenCoordsXY{ 2, 2 }, mask, rideImage); + + // Next position + coords.x += 116; + if (coords.x >= 116 * 5 + 1) + { + coords.x = 1; + coords.y += 116; + } + + // Next item + listItem++; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_FILTER_TEXT_BOX) + return; + + if (text == _filter) + return; + + _filter.assign(text); + + scrolls->v_top = 0; + Invalidate(); + } + + void SetPage(int tab) + { + if (tab >= TRANSPORT_TAB && tab < TAB_COUNT) + { + SetPage(static_cast(tab)); + } + } + + void SetPage(NewRideTabId tab) + { + _currentTab = tab; + frame_no = 0; + _newRideVars.HighlightedRide = { RIDE_TYPE_NULL, OBJECT_ENTRY_INDEX_NULL }; + _newRideVars.SelectedRideCountdown = std::numeric_limits::max(); + PopulateRideList(); + RefreshWidgetSizing(); + Invalidate(); + + if (tab < RESEARCH_TAB) + { + RestoreScrollPositionForCurrentTab(); + } + } + + private: + void RideSelect() + { + RideSelection item = _newRideVars.SelectedRide; + if (item.Type == RIDE_TYPE_NULL) + { + return; + } + + Close(); + WindowCloseConstructionWindows(); + + auto count = GetNumTrackDesigns(item); + if (count > 0) + { + auto intent = Intent(WindowClass::TrackDesignList); + intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, item.Type); + intent.PutExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, item.EntryIndex); + ContextOpenIntent(&intent); + return; + } + + RideConstructNew(item); + } + + int32_t GetNumTrackDesigns(RideSelection item) + { + // Cache the result + if (item.Type == _lastTrackDesignCountRideType.Type && item.EntryIndex == _lastTrackDesignCountRideType.EntryIndex) + { + return _lastTrackDesignCount; + } + + std::string entryName; + + if (item.Type < 0x80) + { + if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + entryName = GetRideEntryName(item.EntryIndex); + } + } + + auto repo = OpenRCT2::GetContext()->GetTrackDesignRepository(); + _lastTrackDesignCount = static_cast(repo->GetCountForObjectEntry(item.Type, entryName)); + _lastTrackDesignCountRideType = item; + return _lastTrackDesignCount; + } + + void UpdateVehicleAvailability(ObjectEntryIndex rideType) + { + _vehicleAvailability.clear(); + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + return; + } + + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& rideEntries = objManager.GetAllRideEntries(rideType); + auto isFirst = true; + for (auto rideEntryIndex : rideEntries) + { + auto currentRideEntry = GetRideEntryByIndex(rideEntryIndex); + + // Skip if vehicle type is not invented yet + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) + { + continue; + } + + // Append comma if not the first iteration + if (!isFirst) + { + _vehicleAvailability += u8", "; + } + + // Append vehicle name + auto vehicleName = LanguageGetString(currentRideEntry->naming.Name); + _vehicleAvailability += vehicleName; + + isFirst = false; + } + } + + ImageIndex GetRideImage(RideSelection rideSelection) + { + auto& objMgr = OpenRCT2::GetContext()->GetObjectManager(); + auto obj = static_cast(objMgr.GetLoadedObject(ObjectType::Ride, rideSelection.EntryIndex)); + return obj == nullptr ? ImageIndexUndefined : obj->GetPreviewImage(rideSelection.Type); + } + + void PopulateRideList() + { + uint8_t currentCategory = _currentTab; + RideSelection* nextListItem = _windowNewRideListItems; + RideSelection* listEnd = _windowNewRideListItems + RideListItemsMax; + + // For each ride type in the view order list + for (int32_t i = 0; i < static_cast(std::size(RideTypeViewOrder)); i++) + { + auto rideType = RideTypeViewOrder[i]; + if (rideType == RIDE_TYPE_NULL) + continue; + + if (GetRideTypeDescriptor(rideType).Category != currentCategory) + continue; + + nextListItem = IterateOverRideType(rideType, nextListItem, listEnd); + } + + nextListItem->Type = RIDE_TYPE_NULL; + nextListItem->EntryIndex = OBJECT_ENTRY_INDEX_NULL; + } + + RideSelection* IterateOverRideType(ride_type_t rideType, RideSelection* nextListItem, RideSelection* listEnd) + { + bool buttonForRideTypeCreated = false; + bool allowDrawingOverLastButton = false; + + uint8_t highestVehiclePriority = 0; + + // For each ride entry for this ride type + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& rideEntries = objManager.GetAllRideEntries(rideType); + for (auto rideEntryIndex : rideEntries) + { + // Skip if vehicle type is not invented yet + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) + continue; + + // Ride entries + const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); + + // Skip if the vehicle isn't the preferred vehicle for this generic track type + if (!gConfigInterface.ListRideVehiclesSeparately + && !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY) + && highestVehiclePriority > rideEntry->BuildMenuPriority) + { + continue; + } + + if (!IsFiltered(*rideEntry)) + { + continue; + } + + highestVehiclePriority = rideEntry->BuildMenuPriority; + + // Determines how and where to draw a button for this ride type/vehicle. + if (gConfigInterface.ListRideVehiclesSeparately + || GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + // Separate, draw apart + allowDrawingOverLastButton = false; + + if (nextListItem >= listEnd) + continue; + + nextListItem->Type = rideType; + nextListItem->EntryIndex = rideEntryIndex; + nextListItem++; + } + else if (!buttonForRideTypeCreated) + { + // Non-separate, draw-apart + buttonForRideTypeCreated = true; + allowDrawingOverLastButton = true; + + if (nextListItem >= listEnd) + continue; + + nextListItem->Type = rideType; + nextListItem->EntryIndex = rideEntryIndex; + nextListItem++; + } + else if (allowDrawingOverLastButton) + { + // Non-separate, draw over previous + if (rideType == rideEntry->ride_type[0]) + { + nextListItem--; + nextListItem->Type = rideType; + nextListItem->EntryIndex = rideEntryIndex; + nextListItem++; + } + } + } + + return nextListItem; + } + + bool IsFiltered(const RideObjectEntry& rideEntry) + { + if (_filter.empty()) + return true; + + return IsFilterInRideType(rideEntry) || IsFilterInRideName(rideEntry) || IsFilterInIdentifier(rideEntry) + || IsFilterInAuthors(rideEntry) || IsFilterInFilename(rideEntry); + } + + bool IsFilterInRideType(const RideObjectEntry& rideEntry) + { + auto rideTypeName = GetRideNaming(rideEntry.ride_type[0], rideEntry).Name; + return String::Contains(u8string_view(LanguageGetString(rideTypeName)), _filter, true); + } + + bool IsFilterInRideName(const RideObjectEntry& rideEntry) + { + auto rideName = rideEntry.naming.Name; + return String::Contains(u8string_view(LanguageGetString(rideName)), _filter, true); + } + + bool IsFilterInAuthors(const RideObjectEntry& rideEntry) + { + auto rideObject = static_cast(rideEntry.obj); + auto authors = rideObject->GetAuthors(); + + for (auto author : authors) + if (String::Contains(author, _filter, true)) + return true; + + return false; + } + + bool IsFilterInIdentifier(const RideObjectEntry& rideEntry) + { + auto rideObject = static_cast(rideEntry.obj); + auto objectName = rideObject->GetObjectEntry().GetName(); + + return String::Contains(objectName, _filter, true); + } + + bool IsFilterInFilename(const RideObjectEntry& rideEntry) + { + auto rideObject = static_cast(rideEntry.obj); + auto repoItem = ObjectRepositoryFindObjectByEntry(&(rideObject->GetObjectEntry())); + + return String::Contains(repoItem->Path, _filter, true); + } + + void SetPressedTab() + { + int32_t i{}; + for (i = 0; i < TAB_COUNT; i++) + { + pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + } + pressed_widgets |= 1LL << (WIDX_TAB_1 + static_cast(_currentTab)); + } + + void RefreshWidgetSizing() + { + int32_t newWidth{}, newHeight{}; + + if (_currentTab < SHOP_TAB) + { + disabled_widgets &= ~(1 << WIDX_GROUP_BY_TRACK_TYPE); + } + else + { + disabled_widgets |= 1LL << WIDX_GROUP_BY_TRACK_TYPE; + } + + // Show or hide unrelated widgets + + if (_currentTab < RESEARCH_TAB) + { + widgets[WIDX_GROUP_BY_TRACK_TYPE].type = WindowWidgetType::Checkbox; + } + else + { + widgets[WIDX_GROUP_BY_TRACK_TYPE].type = WindowWidgetType::Empty; + } + + if (_currentTab != RESEARCH_TAB) + { + widgets[WIDX_RIDE_LIST].type = WindowWidgetType::Scroll; + widgets[WIDX_FILTER_TEXT_BOX].type = WindowWidgetType::TextBox; + widgets[WIDX_FILTER_CLEAR_BUTTON].type = WindowWidgetType::Button; + widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WindowWidgetType::Empty; + widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WindowWidgetType::Empty; + widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WindowWidgetType::Empty; + + newWidth = WindowWidth; + newHeight = WindowHeight; + } + else + { + widgets[WIDX_RIDE_LIST].type = WindowWidgetType::Empty; + widgets[WIDX_FILTER_TEXT_BOX].type = WindowWidgetType::Empty; + widgets[WIDX_FILTER_CLEAR_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP].type = WindowWidgetType::Groupbox; + widgets[WIDX_LAST_DEVELOPMENT_GROUP].type = WindowWidgetType::Groupbox; + widgets[WIDX_LAST_DEVELOPMENT_BUTTON].type = WindowWidgetType::FlatBtn; + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + widgets[WIDX_RESEARCH_FUNDING_BUTTON].type = WindowWidgetType::FlatBtn; + + newWidth = 300; + newHeight = 196; + } + + // Handle new window size + if (width != newWidth || height != newHeight) + { + Invalidate(); + + // Resize widgets to new window size + width = newWidth; + height = newHeight; + ResizeFrameWithPage(); + widgets[WIDX_GROUP_BY_TRACK_TYPE].left = newWidth - 8 - GroupByTrackTypeWidth; + widgets[WIDX_GROUP_BY_TRACK_TYPE].right = newWidth - 8; + + Invalidate(); + } + + InitScrollWidgets(); + } + + RideSelection ScrollGetRideListItemAt(const ScreenCoordsXY& screenCoords) + { + RideSelection result; + result.Type = RIDE_TYPE_NULL; + result.EntryIndex = OBJECT_ENTRY_INDEX_NULL; + + if (screenCoords.x <= 0 || screenCoords.y <= 0) + return result; + + int32_t column = screenCoords.x / 116; + int32_t row = screenCoords.y / 116; + if (column >= 5) + return result; + + int32_t index = column + (row * 5); + + RideSelection* listItem = _windowNewRideListItems; + while (listItem->Type != RIDE_TYPE_NULL || listItem->EntryIndex != OBJECT_ENTRY_INDEX_NULL) + { + if (index-- == 0) + { + return *listItem; + } + listItem++; + } + + return result; + } + + void RestoreScrollPositionForCurrentTab() + { + assert(static_cast(_currentTab) < std::size(_windowNewRideTabScroll)); + auto& currentTabScroll = _windowNewRideTabScroll[_currentTab]; + + // Get maximum scroll height + ScreenSize scrollSize = OnScrollGetSize(0); + const Widget& listWidget = widgets[WIDX_RIDE_LIST]; + const int32_t listWidgetHeight = listWidget.bottom - listWidget.top - 1; + + // Ensure the current tab scroll is within range + currentTabScroll = std::min(currentTabScroll, std::max(0, scrollSize.height - listWidgetHeight)); + + scrolls[0].v_top = currentTabScroll; + WidgetScrollUpdateThumbs(*this, WIDX_RIDE_LIST); + } + + void DrawRideInformation(DrawPixelInfo& dpi, RideSelection item, const ScreenCoordsXY& screenPos, int32_t textWidth) + { + const auto* rideEntry = GetRideEntryByIndex(item.EntryIndex); + RideNaming rideNaming = GetRideNaming(item.Type, *rideEntry); + auto ft = Formatter(); + + UpdateVehicleAvailability(item.Type); + + // Ride name and description + ft.Add(rideNaming.Name); + ft.Add(rideNaming.Description); + DrawTextWrapped(dpi, screenPos, textWidth, STR_NEW_RIDE_NAME_AND_DESCRIPTION, ft); + + if (!_vehicleAvailability.empty()) + { + if (gConfigInterface.ListRideVehiclesSeparately) + { + ft = Formatter(); + ft.Add(rideEntry->naming.Name); + DrawTextEllipsised( + dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_NEW_RIDE_VEHICLE_NAME, ft); + } + else + { + ft = Formatter(); + ft.Add(_vehicleAvailability.c_str()); + DrawTextEllipsised(dpi, screenPos + ScreenCoordsXY{ 0, 39 }, WindowWidth - 2, STR_AVAILABLE_VEHICLES, ft); + } + } + + auto count = GetNumTrackDesigns(item); + auto designCountStringId = GetDesignsAvailableStringId(count); ft = Formatter(); - ft.Add(price); - DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT }); + ft.Add(count); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 0, 51 }, designCountStringId, ft); + + // Price + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + // Get price of ride + int32_t startPieceId = GetRideTypeDescriptor(item.Type).StartTrackPiece; + money64 price = GetRideTypeDescriptor(item.Type).BuildCosts.TrackPrice; + const auto& ted = GetTrackElementDescriptor(startPieceId); + price *= ted.PriceModifier; + price = (price >> 16) * GetRideTypeDescriptor(item.Type).BuildCosts.PriceEstimateMultiplier; + + // + StringId stringId = STR_NEW_RIDE_COST; + if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + stringId = STR_NEW_RIDE_COST_FROM; + + ft = Formatter(); + ft.Add(price); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT }); + } } - } - void DrawTabImage(DrawPixelInfo& dpi, NewRideTabId tab, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(tab); - - if (widgets[widgetIndex].type != WindowWidgetType::Empty && !WidgetIsDisabled(*this, widgetIndex)) + void DrawTabImage(DrawPixelInfo& dpi, NewRideTabId tab, int32_t spriteIndex) { - int32_t frame = 0; - if (_currentTab == tab) - frame = frame_no / TabAnimationDivisor[_currentTab]; + WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(tab); - spriteIndex += tab == THRILL_TAB ? ThrillRidesTabAnimationSequence[frame] : frame; + if (widgets[widgetIndex].type != WindowWidgetType::Empty && !WidgetIsDisabled(*this, widgetIndex)) + { + int32_t frame = 0; + if (_currentTab == tab) + frame = frame_no / TabAnimationDivisor[_currentTab]; - GfxDrawSprite( - dpi, ImageId(spriteIndex, colours[1]), - windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + spriteIndex += tab == THRILL_TAB ? ThrillRidesTabAnimationSequence[frame] : frame; + + GfxDrawSprite( + dpi, ImageId(spriteIndex, colours[1]), + windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + } } - } - void DrawTabImages(DrawPixelInfo& dpi) - { - DrawTabImage(dpi, TRANSPORT_TAB, SPR_TAB_RIDES_TRANSPORT_0); - DrawTabImage(dpi, GENTLE_TAB, SPR_TAB_RIDES_GENTLE_0); - DrawTabImage(dpi, ROLLER_COASTER_TAB, SPR_TAB_RIDES_ROLLER_COASTERS_0); - DrawTabImage(dpi, THRILL_TAB, SPR_TAB_RIDES_THRILL_0); - DrawTabImage(dpi, WATER_TAB, SPR_TAB_RIDES_WATER_0); - DrawTabImage(dpi, SHOP_TAB, SPR_TAB_RIDES_SHOP_0); - DrawTabImage(dpi, RESEARCH_TAB, SPR_TAB_FINANCES_RESEARCH_0); - } - - StringId GetDesignsAvailableStringId(int32_t count) - { - switch (count) + void DrawTabImages(DrawPixelInfo& dpi) { - case 0: - return STR_CUSTOM_DESIGNED_LAYOUT; - case 1: - return STR_1_DESIGN_AVAILABLE; - default: - return STR_X_DESIGNS_AVAILABLE; + DrawTabImage(dpi, TRANSPORT_TAB, SPR_TAB_RIDES_TRANSPORT_0); + DrawTabImage(dpi, GENTLE_TAB, SPR_TAB_RIDES_GENTLE_0); + DrawTabImage(dpi, ROLLER_COASTER_TAB, SPR_TAB_RIDES_ROLLER_COASTERS_0); + DrawTabImage(dpi, THRILL_TAB, SPR_TAB_RIDES_THRILL_0); + DrawTabImage(dpi, WATER_TAB, SPR_TAB_RIDES_WATER_0); + DrawTabImage(dpi, SHOP_TAB, SPR_TAB_RIDES_SHOP_0); + DrawTabImage(dpi, RESEARCH_TAB, SPR_TAB_FINANCES_RESEARCH_0); } - } -}; -NewRideTabId NewRideWindow::_currentTab{}; -uint_fast16_t NewRideWindow::_windowNewRideTabScroll[RideTabCount]{}; + StringId GetDesignsAvailableStringId(int32_t count) + { + switch (count) + { + case 0: + return STR_CUSTOM_DESIGNED_LAYOUT; + case 1: + return STR_1_DESIGN_AVAILABLE; + default: + return STR_X_DESIGNS_AVAILABLE; + } + } + }; -/** - * - * rct2: 0x006ACA58 - */ -void WindowNewRideInitVars() -{ - // If we are in the track designer, default to the Roller Coaster tab - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + NewRideTabId NewRideWindow::_currentTab{}; + uint_fast16_t NewRideWindow::_windowNewRideTabScroll[RideTabCount]{}; + + /** + * + * rct2: 0x006ACA58 + */ + void WindowNewRideInitVars() { - NewRideWindow::SetOpeningPage(ROLLER_COASTER_TAB); + // If we are in the track designer, default to the Roller Coaster tab + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + { + NewRideWindow::SetOpeningPage(ROLLER_COASTER_TAB); + } + else + { + NewRideWindow::SetOpeningPage(TRANSPORT_TAB); + } + NewRideWindow::ResetTabScrolls(); } - else - { - NewRideWindow::SetOpeningPage(TRANSPORT_TAB); - } - NewRideWindow::ResetTabScrolls(); -} -/** - * - * rct2: 0x006B3CFF - */ -WindowBase* WindowNewRideOpen() -{ - WindowBase* window; - - window = WindowBringToFrontByClass(WindowClass::ConstructRide); - if (window) + /** + * + * rct2: 0x006B3CFF + */ + WindowBase* WindowNewRideOpen() { + WindowBase* window; + + window = WindowBringToFrontByClass(WindowClass::ConstructRide); + if (window) + { + return window; + } + + WindowCloseByClass(WindowClass::TrackDesignList); + WindowCloseByClass(WindowClass::TrackDesignPlace); + + window = WindowCreate(WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION); return window; } - WindowCloseByClass(WindowClass::TrackDesignList); - WindowCloseByClass(WindowClass::TrackDesignPlace); - - window = WindowCreate(WindowClass::ConstructRide, WindowWidth, WindowHeight, WF_10 | WF_AUTO_POSITION); - return window; -} - -WindowBase* WindowNewRideOpenResearch() -{ - auto w = static_cast(WindowNewRideOpen()); - w->SetPage(RESEARCH_TAB); - return w; -} - -/** - * - * rct2: 0x006B3EBA - */ -void WindowNewRideFocus(RideSelection rideItem) -{ - auto w = static_cast(WindowFindByClass(WindowClass::ConstructRide)); - if (!w) + WindowBase* WindowNewRideOpenResearch() { - return; + auto w = static_cast(WindowNewRideOpen()); + w->SetPage(RESEARCH_TAB); + return w; } - const auto* rideEntry = GetRideEntryByIndex(rideItem.EntryIndex); - if (rideEntry == nullptr) - return; + /** + * + * rct2: 0x006B3EBA + */ + void WindowNewRideFocus(RideSelection rideItem) + { + auto w = static_cast(WindowFindByClass(WindowClass::ConstructRide)); + if (!w) + { + return; + } - auto rideTypeIndex = rideEntry->GetFirstNonNullRideType(); - w->SetPage(GetRideTypeDescriptor(rideTypeIndex).Category); -} + const auto* rideEntry = GetRideEntryByIndex(rideItem.EntryIndex); + if (rideEntry == nullptr) + return; + + auto rideTypeIndex = rideEntry->GetFirstNonNullRideType(); + w->SetPage(GetRideTypeDescriptor(rideTypeIndex).Category); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index 13431bd0e6..c23bbf25d3 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -22,13 +22,13 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_RECENT_MESSAGES; + static constexpr int32_t WH = 300; + static constexpr int32_t WW = 400; -static constexpr StringId WINDOW_TITLE = STR_RECENT_MESSAGES; -static constexpr int32_t WH = 300; -static constexpr int32_t WW = 400; - -// clang-format off + // clang-format off enum WindowNewsWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -45,278 +45,280 @@ static Widget window_news_widgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class NewsWindow final : public Window -{ -private: - int32_t _pressedNewsItemIndex{}, _pressedButtonIndex{}, _suspendUpdateTicks{}; - static int32_t CalculateItemHeight() + class NewsWindow final : public Window { - return 4 * FontGetLineHeight(FontStyle::Small) + 2; - } - -public: - void OnOpen() override - { - widgets = window_news_widgets; - WindowInitScrollWidgets(*this); - _pressedNewsItemIndex = -1; - - Widget* widget = &widgets[WIDX_SCROLL]; - ScreenSize scrollSize = OnScrollGetSize(0); - scrolls[0].v_top = std::max(0, scrollSize.height - (widget->height() - 1)); - WidgetScrollUpdateThumbs(*this, WIDX_SCROLL); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + private: + int32_t _pressedNewsItemIndex{}, _pressedButtonIndex{}, _suspendUpdateTicks{}; + static int32_t CalculateItemHeight() { - case WIDX_CLOSE: - Close(); - break; - case WIDX_SETTINGS: - ContextOpenWindow(WindowClass::NotificationOptions); - break; - } - } - - void OnUpdate() override - { - if (_pressedNewsItemIndex == -1 || --_suspendUpdateTicks != 0) - { - return; + return 4 * FontGetLineHeight(FontStyle::Small) + 2; } - Invalidate(); - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click2, 0, windowPos.x + (width / 2)); - - size_t j = _pressedNewsItemIndex; - _pressedNewsItemIndex = -1; - auto& gameState = GetGameState(); - - if (j >= gameState.NewsItems.GetArchived().size()) + public: + void OnOpen() override { - return; + widgets = window_news_widgets; + WindowInitScrollWidgets(*this); + _pressedNewsItemIndex = -1; + + Widget* widget = &widgets[WIDX_SCROLL]; + ScreenSize scrollSize = OnScrollGetSize(0); + scrolls[0].v_top = std::max(0, scrollSize.height - (widget->height() - 1)); + WidgetScrollUpdateThumbs(*this, WIDX_SCROLL); } - const auto& newsItem = gameState.NewsItems.GetArchived()[j]; - if (newsItem.HasButton()) + void OnMouseUp(WidgetIndex widgetIndex) override { - return; - } - - if (_pressedButtonIndex == 1) - { - News::OpenSubject(newsItem.Type, newsItem.Assoc); - } - else if (_pressedButtonIndex > 1) - { - static WindowBase* _mainWindow; - auto subjectLoc = News::GetSubjectLocation(newsItem.Type, newsItem.Assoc); - if (subjectLoc.has_value() && (_mainWindow = WindowGetMain()) != nullptr) + switch (widgetIndex) { - WindowScrollToLocation(*_mainWindow, subjectLoc.value()); + case WIDX_CLOSE: + Close(); + break; + case WIDX_SETTINGS: + ContextOpenWindow(WindowClass::NotificationOptions); + break; } } - } - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - int32_t scrollHeight = static_cast(GetGameState().NewsItems.GetArchived().size()) * CalculateItemHeight(); - return { WW, scrollHeight }; - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t itemHeight = CalculateItemHeight(); - int32_t i = 0; - int32_t buttonIndex = 0; - auto mutableScreenCoords = screenCoords; - for (const auto& newsItem : GetGameState().NewsItems.GetArchived()) + void OnUpdate() override { - if (mutableScreenCoords.y < itemHeight) + if (_pressedNewsItemIndex == -1 || --_suspendUpdateTicks != 0) { - if (newsItem.HasButton() || mutableScreenCoords.y < 14 || mutableScreenCoords.y >= 38 - || mutableScreenCoords.x < 328) - { - buttonIndex = 0; - break; - } - if (mutableScreenCoords.x < 351 && newsItem.TypeHasSubject()) - { - buttonIndex = 1; - break; - } - if (mutableScreenCoords.x < 376 && newsItem.TypeHasLocation()) - { - buttonIndex = 2; - break; - } + return; } - mutableScreenCoords.y -= itemHeight; - i++; - } - if (buttonIndex != 0) - { - _pressedNewsItemIndex = i; - _pressedButtonIndex = buttonIndex; - _suspendUpdateTicks = 4; Invalidate(); - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); - } - } + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click2, 0, windowPos.x + (width / 2)); - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - } + size_t j = _pressedNewsItemIndex; + _pressedNewsItemIndex = -1; + auto& gameState = GetGameState(); - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - int32_t lineHeight = FontGetLineHeight(FontStyle::Small); - int32_t itemHeight = CalculateItemHeight(); - int32_t y = 0; - int32_t i = 0; - - for (const auto& newsItem : GetGameState().NewsItems.GetArchived()) - { - if (y >= dpi.y + dpi.height) - break; - if (y + itemHeight < dpi.y) + if (j >= gameState.NewsItems.GetArchived().size()) { + return; + } + + const auto& newsItem = gameState.NewsItems.GetArchived()[j]; + if (newsItem.HasButton()) + { + return; + } + + if (_pressedButtonIndex == 1) + { + News::OpenSubject(newsItem.Type, newsItem.Assoc); + } + else if (_pressedButtonIndex > 1) + { + static WindowBase* _mainWindow; + auto subjectLoc = News::GetSubjectLocation(newsItem.Type, newsItem.Assoc); + if (subjectLoc.has_value() && (_mainWindow = WindowGetMain()) != nullptr) + { + WindowScrollToLocation(*_mainWindow, subjectLoc.value()); + } + } + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + int32_t scrollHeight = static_cast(GetGameState().NewsItems.GetArchived().size()) * CalculateItemHeight(); + return { WW, scrollHeight }; + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t itemHeight = CalculateItemHeight(); + int32_t i = 0; + int32_t buttonIndex = 0; + auto mutableScreenCoords = screenCoords; + for (const auto& newsItem : GetGameState().NewsItems.GetArchived()) + { + if (mutableScreenCoords.y < itemHeight) + { + if (newsItem.HasButton() || mutableScreenCoords.y < 14 || mutableScreenCoords.y >= 38 + || mutableScreenCoords.x < 328) + { + buttonIndex = 0; + break; + } + if (mutableScreenCoords.x < 351 && newsItem.TypeHasSubject()) + { + buttonIndex = 1; + break; + } + if (mutableScreenCoords.x < 376 && newsItem.TypeHasLocation()) + { + buttonIndex = 2; + break; + } + } + mutableScreenCoords.y -= itemHeight; + i++; + } + + if (buttonIndex != 0) + { + _pressedNewsItemIndex = i; + _pressedButtonIndex = buttonIndex; + _suspendUpdateTicks = 4; + Invalidate(); + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + int32_t lineHeight = FontGetLineHeight(FontStyle::Small); + int32_t itemHeight = CalculateItemHeight(); + int32_t y = 0; + int32_t i = 0; + + for (const auto& newsItem : GetGameState().NewsItems.GetArchived()) + { + if (y >= dpi.y + dpi.height) + break; + if (y + itemHeight < dpi.y) + { + y += itemHeight; + i++; + continue; + } + + // Background + GfxFillRectInset( + dpi, { -1, y, 383, y + itemHeight - 1 }, colours[1], + (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY)); + + // Date text + { + auto ft = Formatter(); + ft.Add(DateDayNames[newsItem.Day - 1]); + ft.Add(DateGameMonthNames[DateGetMonth(newsItem.MonthYear)]); + DrawTextBasic(dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small }); + } + // Item text + { + auto ft = Formatter(); + ft.Add(newsItem.Text.c_str()); + DrawTextWrapped(dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small }); + } + // Subject button + if ((newsItem.TypeHasSubject()) && !(newsItem.HasButton())) + { + auto screenCoords = ScreenCoordsXY{ 328, y + lineHeight + 4 }; + + int32_t press = 0; + if (_pressedNewsItemIndex != -1) + { + News::IsValidIndex(_pressedNewsItemIndex + News::ItemHistoryStart); + if (i == _pressedNewsItemIndex && _pressedButtonIndex == 1) + { + press = INSET_RECT_FLAG_BORDER_INSET; + } + } + GfxFillRectInset(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); + + switch (newsItem.Type) + { + case News::ItemType::Ride: + GfxDrawSprite(dpi, ImageId(SPR_RIDE), screenCoords); + break; + case News::ItemType::Peep: + case News::ItemType::PeepOnRide: + { + DrawPixelInfo cliped_dpi; + if (!ClipDrawPixelInfo(cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22)) + { + break; + } + + auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem.Assoc)); + if (peep == nullptr) + { + break; + } + + auto clipCoords = ScreenCoordsXY{ 10, 19 }; + + // If normal peep set sprite to normal (no food) + // If staff set sprite to staff sprite + auto spriteType = PeepSpriteType::Normal; + auto* staff = peep->As(); + if (staff != nullptr) + { + spriteType = staff->SpriteType; + if (staff->AssignedStaffType == StaffType::Entertainer) + { + clipCoords.y += 3; + } + } + + ImageIndex imageId = GetPeepAnimation(spriteType).base_image + 1; + auto image = ImageId(imageId, peep->TshirtColour, peep->TrousersColour); + GfxDrawSprite(cliped_dpi, image, clipCoords); + break; + } + case News::ItemType::Money: + case News::ItemType::Campaign: + GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenCoords); + break; + case News::ItemType::Research: + GfxDrawSprite( + dpi, ImageId(newsItem.Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); + break; + case News::ItemType::Peeps: + GfxDrawSprite(dpi, ImageId(SPR_GUESTS), screenCoords); + break; + case News::ItemType::Award: + GfxDrawSprite(dpi, ImageId(SPR_AWARD), screenCoords); + break; + case News::ItemType::Graph: + GfxDrawSprite(dpi, ImageId(SPR_GRAPH), screenCoords); + break; + case News::ItemType::Null: + case News::ItemType::Blank: + case News::ItemType::Count: + break; + } + } + + // Location button + if ((newsItem.TypeHasLocation()) && !(newsItem.HasButton())) + { + auto screenCoords = ScreenCoordsXY{ 352, y + lineHeight + 4 }; + + int32_t press = 0; + if (_pressedNewsItemIndex != -1) + { + News::IsValidIndex(_pressedNewsItemIndex + News::ItemHistoryStart); + if (i == _pressedNewsItemIndex && _pressedButtonIndex == 2) + press = 0x20; + } + GfxFillRectInset(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); + GfxDrawSprite(dpi, ImageId(SPR_LOCATE), screenCoords); + } + y += itemHeight; i++; - continue; } - - // Background - GfxFillRectInset( - dpi, { -1, y, 383, y + itemHeight - 1 }, colours[1], - (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_GREY)); - - // Date text - { - auto ft = Formatter(); - ft.Add(DateDayNames[newsItem.Day - 1]); - ft.Add(DateGameMonthNames[DateGetMonth(newsItem.MonthYear)]); - DrawTextBasic(dpi, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small }); - } - // Item text - { - auto ft = Formatter(); - ft.Add(newsItem.Text.c_str()); - DrawTextWrapped(dpi, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { FontStyle::Small }); - } - // Subject button - if ((newsItem.TypeHasSubject()) && !(newsItem.HasButton())) - { - auto screenCoords = ScreenCoordsXY{ 328, y + lineHeight + 4 }; - - int32_t press = 0; - if (_pressedNewsItemIndex != -1) - { - News::IsValidIndex(_pressedNewsItemIndex + News::ItemHistoryStart); - if (i == _pressedNewsItemIndex && _pressedButtonIndex == 1) - { - press = INSET_RECT_FLAG_BORDER_INSET; - } - } - GfxFillRectInset(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); - - switch (newsItem.Type) - { - case News::ItemType::Ride: - GfxDrawSprite(dpi, ImageId(SPR_RIDE), screenCoords); - break; - case News::ItemType::Peep: - case News::ItemType::PeepOnRide: - { - DrawPixelInfo cliped_dpi; - if (!ClipDrawPixelInfo(cliped_dpi, dpi, screenCoords + ScreenCoordsXY{ 1, 1 }, 22, 22)) - { - break; - } - - auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem.Assoc)); - if (peep == nullptr) - { - break; - } - - auto clipCoords = ScreenCoordsXY{ 10, 19 }; - - // If normal peep set sprite to normal (no food) - // If staff set sprite to staff sprite - auto spriteType = PeepSpriteType::Normal; - auto* staff = peep->As(); - if (staff != nullptr) - { - spriteType = staff->SpriteType; - if (staff->AssignedStaffType == StaffType::Entertainer) - { - clipCoords.y += 3; - } - } - - ImageIndex imageId = GetPeepAnimation(spriteType).base_image + 1; - auto image = ImageId(imageId, peep->TshirtColour, peep->TrousersColour); - GfxDrawSprite(cliped_dpi, image, clipCoords); - break; - } - case News::ItemType::Money: - case News::ItemType::Campaign: - GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenCoords); - break; - case News::ItemType::Research: - GfxDrawSprite(dpi, ImageId(newsItem.Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); - break; - case News::ItemType::Peeps: - GfxDrawSprite(dpi, ImageId(SPR_GUESTS), screenCoords); - break; - case News::ItemType::Award: - GfxDrawSprite(dpi, ImageId(SPR_AWARD), screenCoords); - break; - case News::ItemType::Graph: - GfxDrawSprite(dpi, ImageId(SPR_GRAPH), screenCoords); - break; - case News::ItemType::Null: - case News::ItemType::Blank: - case News::ItemType::Count: - break; - } - } - - // Location button - if ((newsItem.TypeHasLocation()) && !(newsItem.HasButton())) - { - auto screenCoords = ScreenCoordsXY{ 352, y + lineHeight + 4 }; - - int32_t press = 0; - if (_pressedNewsItemIndex != -1) - { - News::IsValidIndex(_pressedNewsItemIndex + News::ItemHistoryStart); - if (i == _pressedNewsItemIndex && _pressedButtonIndex == 2) - press = 0x20; - } - GfxFillRectInset(dpi, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); - GfxDrawSprite(dpi, ImageId(SPR_LOCATE), screenCoords); - } - - y += itemHeight; - i++; } - } - void OnResize() override + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowNewsOpen() { - ResizeFrame(); + return WindowFocusOrCreate(WindowClass::RecentNews, WW, WH, 0); } -}; - -WindowBase* WindowNewsOpen() -{ - return WindowFocusOrCreate(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 1a2a140869..69c387405a 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -14,11 +14,13 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_NOTIFICATION_SETTINGS; -static constexpr int32_t WH = 300; -static constexpr int32_t WW = 400; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_NOTIFICATION_SETTINGS; + static constexpr int32_t WH = 300; + static constexpr int32_t WW = 400; -// clang-format off + // clang-format off enum { NOTIFICATION_CATEGORY_PARK, @@ -85,198 +87,199 @@ static Widget WindowNewsOptionsWidgets[] = { MakeWidget({ 0, 0}, {343, 14}, WindowWidgetType::Checkbox, WindowColour::Tertiary ), kWidgetsEnd, }; -// clang-format on + // clang-format on -class NewsOptionsWindow final : public Window -{ -public: - void OnOpen() override + class NewsOptionsWindow final : public Window { - widgets = WindowNewsOptionsWidgets; - InitScrollWidgets(); - colours[0] = COLOUR_GREY; - colours[1] = COLOUR_LIGHT_BLUE; - colours[2] = COLOUR_LIGHT_BLUE; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB_PARK: - case WIDX_TAB_RIDE: - case WIDX_TAB_GUEST: - SetPage(widgetIndex - WIDX_FIRST_TAB); - break; - default: + widgets = WindowNewsOptionsWidgets; + InitScrollWidgets(); + colours[0] = COLOUR_GREY; + colours[1] = COLOUR_LIGHT_BLUE; + colours[2] = COLOUR_LIGHT_BLUE; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) { - int32_t checkBoxIndex = widgetIndex - WIDX_CHECKBOX_0; - if (checkBoxIndex >= 0) + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB_PARK: + case WIDX_TAB_RIDE: + case WIDX_TAB_GUEST: + SetPage(widgetIndex - WIDX_FIRST_TAB); + break; + default: { - int32_t matchIndex = 0; - for (size_t i = 0; i < std::size(NewsItemOptionDefinitions); i++) + int32_t checkBoxIndex = widgetIndex - WIDX_CHECKBOX_0; + if (checkBoxIndex >= 0) { - const NotificationDef* ndef = &NewsItemOptionDefinitions[i]; - if (ndef->category != page) - continue; - - if (matchIndex == checkBoxIndex) + int32_t matchIndex = 0; + for (size_t i = 0; i < std::size(NewsItemOptionDefinitions); i++) { - // Toggle value - bool* configValue = GetNotificationValuePtr(ndef); - *configValue = !(*configValue); + const NotificationDef* ndef = &NewsItemOptionDefinitions[i]; + if (ndef->category != page) + continue; - ConfigSaveDefault(); + if (matchIndex == checkBoxIndex) + { + // Toggle value + bool* configValue = GetNotificationValuePtr(ndef); + *configValue = !(*configValue); - InvalidateWidget(widgetIndex); - break; + ConfigSaveDefault(); + + InvalidateWidget(widgetIndex); + break; + } + matchIndex++; } - matchIndex++; + } + break; + } + } + } + + void OnUpdate() override + { + // Tab animation + frame_no++; + InvalidateWidget(WIDX_FIRST_TAB + page); + } + + void OnPrepareDraw() override + { + SetPressedTab(); + + // Set checkboxes + const auto& baseCheckBox = widgets[WIDX_CHECKBOX_0]; + int32_t y = baseCheckBox.top; + + int32_t checkboxWidgetIndex = WIDX_CHECKBOX_0; + Widget* checkboxWidget = &widgets[checkboxWidgetIndex]; + for (size_t i = 0; i < std::size(NewsItemOptionDefinitions); i++) + { + const NotificationDef* ndef = &NewsItemOptionDefinitions[i]; + if (ndef->category != page) + continue; + + checkboxWidget->type = WindowWidgetType::Checkbox; + checkboxWidget->left = baseCheckBox.left; + checkboxWidget->right = baseCheckBox.right; + checkboxWidget->top = y; + checkboxWidget->bottom = checkboxWidget->top + LIST_ROW_HEIGHT + 3; + checkboxWidget->text = ndef->caption; + + const bool* configValue = GetNotificationValuePtr(ndef); + SetCheckboxValue(checkboxWidgetIndex, *configValue); + + checkboxWidgetIndex++; + checkboxWidget++; + y += LIST_ROW_HEIGHT + 3; + } + + // Remove unused checkboxes + while (checkboxWidget->type != WindowWidgetType::Last) + { + checkboxWidget->type = WindowWidgetType::Empty; + checkboxWidgetIndex++; + checkboxWidget++; + } + + // Resize window to fit checkboxes exactly + y += 3; + + if (height != y) + { + Invalidate(); + height = y; + widgets[WIDX_BACKGROUND].bottom = y - 1; + widgets[WIDX_TAB_CONTENT_PANEL].bottom = y - 1; + Invalidate(); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + } + + private: + void SetPage(int32_t p) + { + if (page != p) + { + page = p; + frame_no = 0; + Invalidate(); + } + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawTabImage(dpi, NOTIFICATION_CATEGORY_PARK, SPR_TAB_PARK); + DrawTabImage(dpi, NOTIFICATION_CATEGORY_RIDE, SPR_TAB_RIDE_0); + DrawTabImage(dpi, NOTIFICATION_CATEGORY_GUEST, SPR_TAB_GUESTS_0); + } + + void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_FIRST_TAB + p; + + if (!WidgetIsDisabled(*this, widgetIndex)) + { + if (page == p) + { + int32_t numFrames = TabAnimationFrames[page]; + if (numFrames > 1) + { + int32_t frame = frame_no / TabAnimationDivisor[page]; + spriteIndex += (frame % numFrames); } } - break; + + const auto& widget = widgets[widgetIndex]; + GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top }); } } - } - void OnUpdate() override - { - // Tab animation - frame_no++; - InvalidateWidget(WIDX_FIRST_TAB + page); - } - - void OnPrepareDraw() override - { - SetPressedTab(); - - // Set checkboxes - const auto& baseCheckBox = widgets[WIDX_CHECKBOX_0]; - int32_t y = baseCheckBox.top; - - int32_t checkboxWidgetIndex = WIDX_CHECKBOX_0; - Widget* checkboxWidget = &widgets[checkboxWidgetIndex]; - for (size_t i = 0; i < std::size(NewsItemOptionDefinitions); i++) + void SetPressedTab() { - const NotificationDef* ndef = &NewsItemOptionDefinitions[i]; - if (ndef->category != page) - continue; - - checkboxWidget->type = WindowWidgetType::Checkbox; - checkboxWidget->left = baseCheckBox.left; - checkboxWidget->right = baseCheckBox.right; - checkboxWidget->top = y; - checkboxWidget->bottom = checkboxWidget->top + LIST_ROW_HEIGHT + 3; - checkboxWidget->text = ndef->caption; - - const bool* configValue = GetNotificationValuePtr(ndef); - SetCheckboxValue(checkboxWidgetIndex, *configValue); - - checkboxWidgetIndex++; - checkboxWidget++; - y += LIST_ROW_HEIGHT + 3; + for (int32_t i = 0; i < NOTIFICATION_CATEGORY_COUNT; i++) + pressed_widgets &= ~(1 << (WIDX_FIRST_TAB + i)); + pressed_widgets |= 1LL << (WIDX_FIRST_TAB + page); } - // Remove unused checkboxes - while (checkboxWidget->type != WindowWidgetType::Last) + bool* GetNotificationValuePtr(const NotificationDef* ndef) { - checkboxWidget->type = WindowWidgetType::Empty; - checkboxWidgetIndex++; - checkboxWidget++; + bool* configValue = reinterpret_cast(reinterpret_cast(&gConfigNotifications) + ndef->config_offset); + return configValue; } - // Resize window to fit checkboxes exactly - y += 3; - - if (height != y) + void OnResize() override { - Invalidate(); - height = y; - widgets[WIDX_BACKGROUND].bottom = y - 1; - widgets[WIDX_TAB_CONTENT_PANEL].bottom = y - 1; - Invalidate(); + ResizeFrameWithPage(); } - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - } - -private: - void SetPage(int32_t p) - { - if (page != p) - { - page = p; - frame_no = 0; - Invalidate(); - } - } - - void DrawTabImages(DrawPixelInfo& dpi) - { - DrawTabImage(dpi, NOTIFICATION_CATEGORY_PARK, SPR_TAB_PARK); - DrawTabImage(dpi, NOTIFICATION_CATEGORY_RIDE, SPR_TAB_RIDE_0); - DrawTabImage(dpi, NOTIFICATION_CATEGORY_GUEST, SPR_TAB_GUESTS_0); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_FIRST_TAB + p; - - if (!WidgetIsDisabled(*this, widgetIndex)) - { - if (page == p) - { - int32_t numFrames = TabAnimationFrames[page]; - if (numFrames > 1) - { - int32_t frame = frame_no / TabAnimationDivisor[page]; - spriteIndex += (frame % numFrames); - } - } - - const auto& widget = widgets[widgetIndex]; - GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top }); - } - } - - void SetPressedTab() - { - for (int32_t i = 0; i < NOTIFICATION_CATEGORY_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_FIRST_TAB + i)); - pressed_widgets |= 1LL << (WIDX_FIRST_TAB + page); - } - - bool* GetNotificationValuePtr(const NotificationDef* ndef) - { - bool* configValue = reinterpret_cast(reinterpret_cast(&gConfigNotifications) + ndef->config_offset); - return configValue; - } - - void OnResize() override - { - ResizeFrameWithPage(); - } - - static constexpr int32_t TabAnimationDivisor[3] = { - 1, // Park - 4, // Ride - 4, // Guest + static constexpr int32_t TabAnimationDivisor[3] = { + 1, // Park + 4, // Ride + 4, // Guest + }; + static constexpr int32_t TabAnimationFrames[3] = { + 1, // Park + 16, // Ride + 8, // Guest + }; }; - static constexpr int32_t TabAnimationFrames[3] = { - 1, // Park - 16, // Ride - 8, // Guest - }; -}; -WindowBase* WindowNewsOptionsOpen() -{ - return WindowFocusOrCreate(WindowClass::NotificationOptions, WW, WH, WF_CENTRE_SCREEN); -} + WindowBase* WindowNewsOptionsOpen() + { + return WindowFocusOrCreate(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 88ca2b2a72..c5100c7277 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -27,232 +27,233 @@ #include #include #include - +namespace OpenRCT2::Ui::Windows +{ #ifndef DISABLE_HTTP -class ObjectDownloader -{ -private: - static constexpr auto OPENRCT2_API_LEGACY_OBJECT_URL = "https://api.openrct2.io/objects/legacy/"; - - struct DownloadStatusInfo + class ObjectDownloader { - std::string Name; - std::string Source; - size_t Count{}; - size_t Total{}; + private: + static constexpr auto OPENRCT2_API_LEGACY_OBJECT_URL = "https://api.openrct2.io/objects/legacy/"; - bool operator==(const DownloadStatusInfo& rhs) const + struct DownloadStatusInfo { - return Name == rhs.Name && Source == rhs.Source && Count == rhs.Count && Total == rhs.Total; + std::string Name; + std::string Source; + size_t Count{}; + size_t Total{}; + + bool operator==(const DownloadStatusInfo& rhs) const + { + return Name == rhs.Name && Source == rhs.Source && Count == rhs.Count && Total == rhs.Total; + } + bool operator!=(const DownloadStatusInfo& rhs) const + { + return !(*this == rhs); + } + }; + + std::vector _entries; + std::vector _downloadedEntries; + size_t _currentDownloadIndex{}; + std::mutex _downloadedEntriesMutex; + std::mutex _queueMutex; + bool _nextDownloadQueued{}; + + DownloadStatusInfo _lastDownloadStatusInfo; + DownloadStatusInfo _downloadStatusInfo; + std::mutex _downloadStatusInfoMutex; + std::string _lastDownloadSource; + + // TODO static due to INTENT_EXTRA_CALLBACK not allowing a std::function + inline static bool _downloadingObjects; + + public: + void Begin(const std::vector& entries) + { + _lastDownloadStatusInfo = {}; + _downloadStatusInfo = {}; + _lastDownloadSource = {}; + _entries = entries; + _currentDownloadIndex = 0; + _downloadingObjects = true; + QueueNextDownload(); } - bool operator!=(const DownloadStatusInfo& rhs) const + + bool IsDownloading() const { - return !(*this == rhs); + return _downloadingObjects; + } + + std::vector GetDownloadedEntries() + { + std::lock_guard guard(_downloadedEntriesMutex); + return _downloadedEntries; + } + + void Update() + { + std::lock_guard guard(_queueMutex); + if (_nextDownloadQueued) + { + _nextDownloadQueued = false; + NextDownload(); + } + UpdateStatusBox(); + } + + private: + void UpdateStatusBox() + { + std::lock_guard guard(_downloadStatusInfoMutex); + if (_lastDownloadStatusInfo != _downloadStatusInfo) + { + _lastDownloadStatusInfo = _downloadStatusInfo; + + if (_downloadStatusInfo == DownloadStatusInfo()) + { + ContextForceCloseWindowByClass(WindowClass::NetworkStatus); + } + else + { + char str_downloading_objects[256]{}; + Formatter ft; + if (_downloadStatusInfo.Source.empty()) + { + ft.Add(static_cast(_downloadStatusInfo.Count)); + ft.Add(static_cast(_downloadStatusInfo.Total)); + ft.Add(_downloadStatusInfo.Name.c_str()); + OpenRCT2::FormatStringLegacy( + str_downloading_objects, sizeof(str_downloading_objects), STR_DOWNLOADING_OBJECTS, ft.Data()); + } + else + { + ft.Add(_downloadStatusInfo.Name.c_str()); + ft.Add(_downloadStatusInfo.Source.c_str()); + ft.Add(static_cast(_downloadStatusInfo.Count)); + ft.Add(static_cast(_downloadStatusInfo.Total)); + OpenRCT2::FormatStringLegacy( + str_downloading_objects, sizeof(str_downloading_objects), STR_DOWNLOADING_OBJECTS_FROM, ft.Data()); + } + + auto intent = Intent(WindowClass::NetworkStatus); + intent.PutExtra(INTENT_EXTRA_MESSAGE, std::string(str_downloading_objects)); + intent.PutExtra(INTENT_EXTRA_CALLBACK, []() -> void { _downloadingObjects = false; }); + ContextOpenIntent(&intent); + } + } + } + + void UpdateProgress(const DownloadStatusInfo& info) + { + std::lock_guard guard(_downloadStatusInfoMutex); + _downloadStatusInfo = info; + } + + void QueueNextDownload() + { + std::lock_guard guard(_queueMutex); + _nextDownloadQueued = true; + } + + void DownloadObject(const ObjectEntryDescriptor& entry, const std::string& name, const std::string& url) + { + try + { + Console::WriteLine("Downloading %s", url.c_str()); + Http::Request req; + req.method = Http::Method::GET; + req.url = url; + Http::DoAsync(req, [this, entry, name](Http::Response response) { + if (response.status == Http::Status::Ok) + { + // Check that download operation hasn't been cancelled + if (_downloadingObjects) + { + auto data = reinterpret_cast(response.body.data()); + auto dataLen = response.body.size(); + + auto& objRepo = OpenRCT2::GetContext()->GetObjectRepository(); + objRepo.AddObjectFromFile(ObjectGeneration::DAT, name, data, dataLen); + + std::lock_guard guard(_downloadedEntriesMutex); + _downloadedEntries.push_back(entry); + } + } + else + { + Console::Error::WriteLine(" Failed to download %s", name.c_str()); + } + QueueNextDownload(); + }); + } + catch (const std::exception&) + { + Console::Error::WriteLine(" Failed to download %s", name.c_str()); + QueueNextDownload(); + } + } + + void NextDownload() + { + if (!_downloadingObjects || _currentDownloadIndex >= _entries.size()) + { + // Finished... + _downloadingObjects = false; + UpdateProgress({}); + return; + } + + auto& entry = _entries[_currentDownloadIndex]; + auto name = String::Trim(std::string(entry.GetName())); + LOG_VERBOSE("Downloading object: [%s]:", name.c_str()); + _currentDownloadIndex++; + UpdateProgress({ name, _lastDownloadSource, _currentDownloadIndex, _entries.size() }); + try + { + Http::Request req; + req.method = Http::Method::GET; + req.url = OPENRCT2_API_LEGACY_OBJECT_URL + name; + Http::DoAsync(req, [this, entry, name](Http::Response response) { + if (response.status == Http::Status::Ok) + { + auto jresponse = Json::FromString(response.body); + if (jresponse.is_object()) + { + auto objName = Json::GetString(jresponse["name"]); + auto source = Json::GetString(jresponse["source"]); + auto downloadLink = Json::GetString(jresponse["download"]); + if (!downloadLink.empty()) + { + _lastDownloadSource = source; + UpdateProgress({ name, source, _currentDownloadIndex, _entries.size() }); + DownloadObject(entry, objName, downloadLink); + } + } + } + else if (response.status == Http::Status::NotFound) + { + Console::Error::WriteLine(" %s not found", name.c_str()); + QueueNextDownload(); + } + else + { + Console::Error::WriteLine( + " %s query failed (status %d)", name.c_str(), static_cast(response.status)); + QueueNextDownload(); + } + }); + } + catch (const std::exception&) + { + Console::Error::WriteLine(" Failed to query %s", name.c_str()); + } } }; - std::vector _entries; - std::vector _downloadedEntries; - size_t _currentDownloadIndex{}; - std::mutex _downloadedEntriesMutex; - std::mutex _queueMutex; - bool _nextDownloadQueued{}; - - DownloadStatusInfo _lastDownloadStatusInfo; - DownloadStatusInfo _downloadStatusInfo; - std::mutex _downloadStatusInfoMutex; - std::string _lastDownloadSource; - - // TODO static due to INTENT_EXTRA_CALLBACK not allowing a std::function - inline static bool _downloadingObjects; - -public: - void Begin(const std::vector& entries) - { - _lastDownloadStatusInfo = {}; - _downloadStatusInfo = {}; - _lastDownloadSource = {}; - _entries = entries; - _currentDownloadIndex = 0; - _downloadingObjects = true; - QueueNextDownload(); - } - - bool IsDownloading() const - { - return _downloadingObjects; - } - - std::vector GetDownloadedEntries() - { - std::lock_guard guard(_downloadedEntriesMutex); - return _downloadedEntries; - } - - void Update() - { - std::lock_guard guard(_queueMutex); - if (_nextDownloadQueued) - { - _nextDownloadQueued = false; - NextDownload(); - } - UpdateStatusBox(); - } - -private: - void UpdateStatusBox() - { - std::lock_guard guard(_downloadStatusInfoMutex); - if (_lastDownloadStatusInfo != _downloadStatusInfo) - { - _lastDownloadStatusInfo = _downloadStatusInfo; - - if (_downloadStatusInfo == DownloadStatusInfo()) - { - ContextForceCloseWindowByClass(WindowClass::NetworkStatus); - } - else - { - char str_downloading_objects[256]{}; - Formatter ft; - if (_downloadStatusInfo.Source.empty()) - { - ft.Add(static_cast(_downloadStatusInfo.Count)); - ft.Add(static_cast(_downloadStatusInfo.Total)); - ft.Add(_downloadStatusInfo.Name.c_str()); - OpenRCT2::FormatStringLegacy( - str_downloading_objects, sizeof(str_downloading_objects), STR_DOWNLOADING_OBJECTS, ft.Data()); - } - else - { - ft.Add(_downloadStatusInfo.Name.c_str()); - ft.Add(_downloadStatusInfo.Source.c_str()); - ft.Add(static_cast(_downloadStatusInfo.Count)); - ft.Add(static_cast(_downloadStatusInfo.Total)); - OpenRCT2::FormatStringLegacy( - str_downloading_objects, sizeof(str_downloading_objects), STR_DOWNLOADING_OBJECTS_FROM, ft.Data()); - } - - auto intent = Intent(WindowClass::NetworkStatus); - intent.PutExtra(INTENT_EXTRA_MESSAGE, std::string(str_downloading_objects)); - intent.PutExtra(INTENT_EXTRA_CALLBACK, []() -> void { _downloadingObjects = false; }); - ContextOpenIntent(&intent); - } - } - } - - void UpdateProgress(const DownloadStatusInfo& info) - { - std::lock_guard guard(_downloadStatusInfoMutex); - _downloadStatusInfo = info; - } - - void QueueNextDownload() - { - std::lock_guard guard(_queueMutex); - _nextDownloadQueued = true; - } - - void DownloadObject(const ObjectEntryDescriptor& entry, const std::string& name, const std::string& url) - { - try - { - Console::WriteLine("Downloading %s", url.c_str()); - Http::Request req; - req.method = Http::Method::GET; - req.url = url; - Http::DoAsync(req, [this, entry, name](Http::Response response) { - if (response.status == Http::Status::Ok) - { - // Check that download operation hasn't been cancelled - if (_downloadingObjects) - { - auto data = reinterpret_cast(response.body.data()); - auto dataLen = response.body.size(); - - auto& objRepo = OpenRCT2::GetContext()->GetObjectRepository(); - objRepo.AddObjectFromFile(ObjectGeneration::DAT, name, data, dataLen); - - std::lock_guard guard(_downloadedEntriesMutex); - _downloadedEntries.push_back(entry); - } - } - else - { - Console::Error::WriteLine(" Failed to download %s", name.c_str()); - } - QueueNextDownload(); - }); - } - catch (const std::exception&) - { - Console::Error::WriteLine(" Failed to download %s", name.c_str()); - QueueNextDownload(); - } - } - - void NextDownload() - { - if (!_downloadingObjects || _currentDownloadIndex >= _entries.size()) - { - // Finished... - _downloadingObjects = false; - UpdateProgress({}); - return; - } - - auto& entry = _entries[_currentDownloadIndex]; - auto name = String::Trim(std::string(entry.GetName())); - LOG_VERBOSE("Downloading object: [%s]:", name.c_str()); - _currentDownloadIndex++; - UpdateProgress({ name, _lastDownloadSource, _currentDownloadIndex, _entries.size() }); - try - { - Http::Request req; - req.method = Http::Method::GET; - req.url = OPENRCT2_API_LEGACY_OBJECT_URL + name; - Http::DoAsync(req, [this, entry, name](Http::Response response) { - if (response.status == Http::Status::Ok) - { - auto jresponse = Json::FromString(response.body); - if (jresponse.is_object()) - { - auto objName = Json::GetString(jresponse["name"]); - auto source = Json::GetString(jresponse["source"]); - auto downloadLink = Json::GetString(jresponse["download"]); - if (!downloadLink.empty()) - { - _lastDownloadSource = source; - UpdateProgress({ name, source, _currentDownloadIndex, _entries.size() }); - DownloadObject(entry, objName, downloadLink); - } - } - } - else if (response.status == Http::Status::NotFound) - { - Console::Error::WriteLine(" %s not found", name.c_str()); - QueueNextDownload(); - } - else - { - Console::Error::WriteLine( - " %s query failed (status %d)", name.c_str(), static_cast(response.status)); - QueueNextDownload(); - } - }); - } - catch (const std::exception&) - { - Console::Error::WriteLine(" Failed to query %s", name.c_str()); - } - } -}; - #endif -// clang-format off + // clang-format off enum WindowObjectLoadErrorWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -287,297 +288,299 @@ static Widget window_object_load_error_widgets[] = { #endif kWidgetsEnd, }; -// clang-format on - -/** - * Returns an StringId that represents an RCTObjectEntry's type. - * - * Could possibly be moved out of the window file if other - * uses exist and a suitable location is found. - */ -static constexpr StringId GetStringFromObjectType(const ObjectType type) -{ - switch (type) - { - case ObjectType::Ride: - return STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS; - case ObjectType::SmallScenery: - return STR_OBJECT_SELECTION_SMALL_SCENERY; - case ObjectType::LargeScenery: - return STR_OBJECT_SELECTION_LARGE_SCENERY; - case ObjectType::Walls: - return STR_OBJECT_SELECTION_WALLS_FENCES; - case ObjectType::Banners: - return STR_OBJECT_SELECTION_PATH_SIGNS; - case ObjectType::Paths: - return STR_OBJECT_SELECTION_FOOTPATHS; - case ObjectType::PathAdditions: - return STR_OBJECT_SELECTION_PATH_EXTRAS; - case ObjectType::SceneryGroup: - return STR_OBJECT_SELECTION_SCENERY_GROUPS; - case ObjectType::ParkEntrance: - return STR_OBJECT_SELECTION_PARK_ENTRANCE; - case ObjectType::Water: - return STR_OBJECT_SELECTION_WATER; - default: - return STR_UNKNOWN_OBJECT_TYPE; - } -} - -class ObjectLoadErrorWindow final : public WindowBase -{ -private: - std::vector _invalidEntries; - int32_t _highlightedIndex = -1; - std::string _filePath; -#ifndef DISABLE_HTTP - ObjectDownloader _objDownloader; - bool _updatedListAfterDownload{}; - - void DownloadAllObjects() - { - if (!_objDownloader.IsDownloading()) - { - _updatedListAfterDownload = false; - _objDownloader.Begin(_invalidEntries); - } - } - - void UpdateObjectList() - { - const auto entries = _objDownloader.GetDownloadedEntries(); - for (auto& de : entries) - { - _invalidEntries.erase( - std::remove_if( - _invalidEntries.begin(), _invalidEntries.end(), - [de](const ObjectEntryDescriptor& e) { return de.GetName() == e.GetName(); }), - _invalidEntries.end()); - } - no_list_items = static_cast(_invalidEntries.size()); - } -#endif + // clang-format on /** - * Returns a newline-separated string listing all object names. - * Used for placing all names on the clipboard. + * Returns an StringId that represents an RCTObjectEntry's type. + * + * Could possibly be moved out of the window file if other + * uses exist and a suitable location is found. */ - void CopyObjectNamesToClipboard() + static constexpr StringId GetStringFromObjectType(const ObjectType type) { - std::stringstream stream; - for (uint16_t i = 0; i < no_list_items; i++) + switch (type) { - const auto& entry = _invalidEntries[i]; - stream << entry.GetName(); - stream << PLATFORM_NEWLINE; + case ObjectType::Ride: + return STR_OBJECT_SELECTION_RIDE_VEHICLES_ATTRACTIONS; + case ObjectType::SmallScenery: + return STR_OBJECT_SELECTION_SMALL_SCENERY; + case ObjectType::LargeScenery: + return STR_OBJECT_SELECTION_LARGE_SCENERY; + case ObjectType::Walls: + return STR_OBJECT_SELECTION_WALLS_FENCES; + case ObjectType::Banners: + return STR_OBJECT_SELECTION_PATH_SIGNS; + case ObjectType::Paths: + return STR_OBJECT_SELECTION_FOOTPATHS; + case ObjectType::PathAdditions: + return STR_OBJECT_SELECTION_PATH_EXTRAS; + case ObjectType::SceneryGroup: + return STR_OBJECT_SELECTION_SCENERY_GROUPS; + case ObjectType::ParkEntrance: + return STR_OBJECT_SELECTION_PARK_ENTRANCE; + case ObjectType::Water: + return STR_OBJECT_SELECTION_WATER; + default: + return STR_UNKNOWN_OBJECT_TYPE; } - - const auto clip = stream.str(); - OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(clip.c_str()); } - void SelectObjectFromList(const int32_t index) + class ObjectLoadErrorWindow final : public WindowBase { - if (index < 0 || index > no_list_items) - { - selected_list_item = -1; - } - else - { - selected_list_item = index; - } - WidgetInvalidate(*this, WIDX_SCROLL); - } - -public: - void OnOpen() override - { - widgets = window_object_load_error_widgets; - - WindowInitScrollWidgets(*this); - colours[0] = COLOUR_LIGHT_BLUE; - colours[1] = COLOUR_LIGHT_BLUE; - colours[2] = COLOUR_LIGHT_BLUE; - } - - void OnClose() override - { - _invalidEntries.clear(); - _invalidEntries.shrink_to_fit(); - } - - void OnMouseUp(const WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - WindowClose(*this); - return; - case WIDX_COPY_CURRENT: - if (selected_list_item > -1 && selected_list_item < no_list_items) - { - const auto name = std::string(_invalidEntries[selected_list_item].GetName()); - OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(name.c_str()); - } - break; - case WIDX_COPY_ALL: - CopyObjectNamesToClipboard(); - break; + private: + std::vector _invalidEntries; + int32_t _highlightedIndex = -1; + std::string _filePath; #ifndef DISABLE_HTTP - case WIDX_DOWNLOAD_ALL: - DownloadAllObjects(); - break; -#endif - } - } + ObjectDownloader _objDownloader; + bool _updatedListAfterDownload{}; - void OnUpdate() override - { - frame_no++; - - // Check if the mouse is hovering over the list - if (!WidgetIsHighlighted(*this, WIDX_SCROLL)) + void DownloadAllObjects() { - _highlightedIndex = -1; + if (!_objDownloader.IsDownloading()) + { + _updatedListAfterDownload = false; + _objDownloader.Begin(_invalidEntries); + } + } + + void UpdateObjectList() + { + const auto entries = _objDownloader.GetDownloadedEntries(); + for (auto& de : entries) + { + _invalidEntries.erase( + std::remove_if( + _invalidEntries.begin(), _invalidEntries.end(), + [de](const ObjectEntryDescriptor& e) { return de.GetName() == e.GetName(); }), + _invalidEntries.end()); + } + no_list_items = static_cast(_invalidEntries.size()); + } +#endif + + /** + * Returns a newline-separated string listing all object names. + * Used for placing all names on the clipboard. + */ + void CopyObjectNamesToClipboard() + { + std::stringstream stream; + for (uint16_t i = 0; i < no_list_items; i++) + { + const auto& entry = _invalidEntries[i]; + stream << entry.GetName(); + stream << PLATFORM_NEWLINE; + } + + const auto clip = stream.str(); + OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(clip.c_str()); + } + + void SelectObjectFromList(const int32_t index) + { + if (index < 0 || index > no_list_items) + { + selected_list_item = -1; + } + else + { + selected_list_item = index; + } WidgetInvalidate(*this, WIDX_SCROLL); } -#ifndef DISABLE_HTTP - _objDownloader.Update(); - - // Remove downloaded objects from our invalid entry list - if (_objDownloader.IsDownloading()) + public: + void OnOpen() override { - // Don't do this too often as it isn't particularly efficient - if (frame_no % 64 == 0) + widgets = window_object_load_error_widgets; + + WindowInitScrollWidgets(*this); + colours[0] = COLOUR_LIGHT_BLUE; + colours[1] = COLOUR_LIGHT_BLUE; + colours[2] = COLOUR_LIGHT_BLUE; + } + + void OnClose() override + { + _invalidEntries.clear(); + _invalidEntries.shrink_to_fit(); + } + + void OnMouseUp(const WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + WindowClose(*this); + return; + case WIDX_COPY_CURRENT: + if (selected_list_item > -1 && selected_list_item < no_list_items) + { + const auto name = std::string(_invalidEntries[selected_list_item].GetName()); + OpenRCT2::GetContext()->GetUiContext()->SetClipboardText(name.c_str()); + } + break; + case WIDX_COPY_ALL: + CopyObjectNamesToClipboard(); + break; +#ifndef DISABLE_HTTP + case WIDX_DOWNLOAD_ALL: + DownloadAllObjects(); + break; +#endif + } + } + + void OnUpdate() override + { + frame_no++; + + // Check if the mouse is hovering over the list + if (!WidgetIsHighlighted(*this, WIDX_SCROLL)) + { + _highlightedIndex = -1; + WidgetInvalidate(*this, WIDX_SCROLL); + } + +#ifndef DISABLE_HTTP + _objDownloader.Update(); + + // Remove downloaded objects from our invalid entry list + if (_objDownloader.IsDownloading()) + { + // Don't do this too often as it isn't particularly efficient + if (frame_no % 64 == 0) + { + UpdateObjectList(); + } + } + else if (!_updatedListAfterDownload) { UpdateObjectList(); + _updatedListAfterDownload = true; } - } - else if (!_updatedListAfterDownload) - { - UpdateObjectList(); - _updatedListAfterDownload = true; - } #endif - } - - ScreenSize OnScrollGetSize(const int32_t scrollIndex) override - { - return ScreenSize(0, no_list_items * SCROLLABLE_ROW_HEIGHT); - } - - void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - SelectObjectFromList(selectedItem); - } - - void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - // Highlight item that the cursor is over, or remove highlighting if none - const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (selectedItem < 0 || selectedItem >= no_list_items) - _highlightedIndex = -1; - else - _highlightedIndex = selectedItem; - - WidgetInvalidate(*this, WIDX_SCROLL); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - WindowDrawWidgets(*this, dpi); - - // Draw explanatory message - auto ft = Formatter(); - ft.Add(STR_OBJECT_ERROR_WINDOW_EXPLANATION); - DrawTextWrapped(dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft); - - // Draw file name - ft = Formatter(); - ft.Add(STR_OBJECT_ERROR_WINDOW_FILE); - ft.Add(_filePath.c_str()); - DrawTextEllipsised(dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft); - } - - void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override - { - auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; - GfxFillRect( - dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - const int32_t listWidth = widgets[WIDX_SCROLL].width(); - - for (int32_t i = 0; i < no_list_items; i++) - { - ScreenCoordsXY screenCoords; - screenCoords.y = i * SCROLLABLE_ROW_HEIGHT; - if (screenCoords.y > dpi.y + dpi.height) - break; - - if (screenCoords.y + SCROLLABLE_ROW_HEIGHT < dpi.y) - continue; - - const auto screenRect = ScreenRect{ { 0, screenCoords.y }, - { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }; - // If hovering over item, change the color and fill the backdrop. - if (i == selected_list_item) - GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].darker); - else if (i == _highlightedIndex) - GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].mid_dark); - else if ((i & 1) != 0) // odd / even check - GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].light); - - // Draw the actual object entry's name... - screenCoords.x = NAME_COL_LEFT - 3; - - const auto& entry = _invalidEntries[i]; - - auto name = entry.GetName(); - char buffer[256]; - String::Set(buffer, sizeof(buffer), name.data(), name.size()); - GfxDrawString(dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); - - if (entry.Generation == ObjectGeneration::DAT) - { - // ... source game ... - const auto sourceStringId = ObjectManagerGetSourceGameString(entry.Entry.GetSourceGame()); - DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); - } - - // ... and type - const auto type = GetStringFromObjectType(entry.GetType()); - DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); } - } - void OnResize() override + ScreenSize OnScrollGetSize(const int32_t scrollIndex) override + { + return ScreenSize(0, no_list_items * SCROLLABLE_ROW_HEIGHT); + } + + void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + SelectObjectFromList(selectedItem); + } + + void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + // Highlight item that the cursor is over, or remove highlighting if none + const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (selectedItem < 0 || selectedItem >= no_list_items) + _highlightedIndex = -1; + else + _highlightedIndex = selectedItem; + + WidgetInvalidate(*this, WIDX_SCROLL); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + WindowDrawWidgets(*this, dpi); + + // Draw explanatory message + auto ft = Formatter(); + ft.Add(STR_OBJECT_ERROR_WINDOW_EXPLANATION); + DrawTextWrapped(dpi, windowPos + ScreenCoordsXY{ 5, 18 }, WW - 10, STR_BLACK_STRING, ft); + + // Draw file name + ft = Formatter(); + ft.Add(STR_OBJECT_ERROR_WINDOW_FILE); + ft.Add(_filePath.c_str()); + DrawTextEllipsised(dpi, { windowPos.x + 5, windowPos.y + 43 }, WW - 5, STR_BLACK_STRING, ft); + } + + void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override + { + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + GfxFillRect( + dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, + ColourMapA[colours[1]].mid_light); + const int32_t listWidth = widgets[WIDX_SCROLL].width(); + + for (int32_t i = 0; i < no_list_items; i++) + { + ScreenCoordsXY screenCoords; + screenCoords.y = i * SCROLLABLE_ROW_HEIGHT; + if (screenCoords.y > dpi.y + dpi.height) + break; + + if (screenCoords.y + SCROLLABLE_ROW_HEIGHT < dpi.y) + continue; + + const auto screenRect = ScreenRect{ { 0, screenCoords.y }, + { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }; + // If hovering over item, change the color and fill the backdrop. + if (i == selected_list_item) + GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].darker); + else if (i == _highlightedIndex) + GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].mid_dark); + else if ((i & 1) != 0) // odd / even check + GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].light); + + // Draw the actual object entry's name... + screenCoords.x = NAME_COL_LEFT - 3; + + const auto& entry = _invalidEntries[i]; + + auto name = entry.GetName(); + char buffer[256]; + String::Set(buffer, sizeof(buffer), name.data(), name.size()); + GfxDrawString(dpi, screenCoords, buffer, { COLOUR_DARK_GREEN }); + + if (entry.Generation == ObjectGeneration::DAT) + { + // ... source game ... + const auto sourceStringId = ObjectManagerGetSourceGameString(entry.Entry.GetSourceGame()); + DrawTextBasic(dpi, { SOURCE_COL_LEFT - 3, screenCoords.y }, sourceStringId, {}, { COLOUR_DARK_GREEN }); + } + + // ... and type + const auto type = GetStringFromObjectType(entry.GetType()); + DrawTextBasic(dpi, { TYPE_COL_LEFT - 3, screenCoords.y }, type, {}, { COLOUR_DARK_GREEN }); + } + } + + void OnResize() override + { + ResizeFrame(); + } + + void Initialise(utf8* path, const size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) + { + _invalidEntries = std::vector(missingObjects, missingObjects + numMissingObjects); + + // Refresh list items and path + no_list_items = static_cast(numMissingObjects); + _filePath = path; + + Invalidate(); + } + }; + + WindowBase* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) { - ResizeFrame(); + // Check if window is already open + auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError); + if (window == nullptr) + { + window = WindowCreate(WindowClass::ObjectLoadError, WW, WH, 0); + } + + static_cast(window)->Initialise(path, numMissingObjects, missingObjects); + + return window; } - - void Initialise(utf8* path, const size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) - { - _invalidEntries = std::vector(missingObjects, missingObjects + numMissingObjects); - - // Refresh list items and path - no_list_items = static_cast(numMissingObjects); - _filePath = path; - - Invalidate(); - } -}; - -WindowBase* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) -{ - // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError); - if (window == nullptr) - { - window = WindowCreate(WindowClass::ObjectLoadError, WW, WH, 0); - } - - static_cast(window)->Initialise(path, numMissingObjects, missingObjects); - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 3d12d0ec13..9d2a0dab49 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -46,10 +46,10 @@ #include #include -using namespace OpenRCT2; using namespace OpenRCT2::Audio; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowOptionsPage { WINDOW_OPTIONS_PAGE_DISPLAY, WINDOW_OPTIONS_PAGE_RENDERING, @@ -411,1791 +411,1798 @@ static Widget *window_options_page_widgets[] = { }; #pragma endregion -// clang-format on + // clang-format on -class OptionsWindow final : public Window -{ -public: - void OnOpen() override + class OptionsWindow final : public Window { - widgets = window_options_display_widgets; - page = WINDOW_OPTIONS_PAGE_DISPLAY; - frame_no = 0; - InitScrollWidgets(); - } + public: + void OnOpen() override + { + widgets = window_options_display_widgets; + page = WINDOW_OPTIONS_PAGE_DISPLAY; + frame_no = 0; + InitScrollWidgets(); + } - void OnMouseUp(WidgetIndex widgetIndex) override - { - if (widgetIndex < WIDX_PAGE_START) - CommonMouseUp(widgetIndex); - else + void OnMouseUp(WidgetIndex widgetIndex) override + { + if (widgetIndex < WIDX_PAGE_START) + CommonMouseUp(widgetIndex); + else + { + switch (page) + { + case WINDOW_OPTIONS_PAGE_DISPLAY: + DisplayMouseUp(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_RENDERING: + RenderingMouseUp(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_AUDIO: + AudioMouseUp(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + ControlsMouseUp(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_MISC: + MiscMouseUp(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_ADVANCED: + AdvancedMouseUp(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_CULTURE: + default: + break; + } + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override { switch (page) { case WINDOW_OPTIONS_PAGE_DISPLAY: - DisplayMouseUp(widgetIndex); + DisplayMouseDown(widgetIndex); break; case WINDOW_OPTIONS_PAGE_RENDERING: - RenderingMouseUp(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_AUDIO: - AudioMouseUp(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: - ControlsMouseUp(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_MISC: - MiscMouseUp(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_ADVANCED: - AdvancedMouseUp(widgetIndex); + RenderingMouseDown(widgetIndex); break; case WINDOW_OPTIONS_PAGE_CULTURE: + CultureMouseDown(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_AUDIO: + AudioMouseDown(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + ControlsMouseDown(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_MISC: + MiscMouseDown(widgetIndex); + break; + case WINDOW_OPTIONS_PAGE_ADVANCED: + AdvancedMouseDown(widgetIndex); + break; default: break; } } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override { - case WINDOW_OPTIONS_PAGE_DISPLAY: - DisplayMouseDown(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_RENDERING: - RenderingMouseDown(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_CULTURE: - CultureMouseDown(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_AUDIO: - AudioMouseDown(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: - ControlsMouseDown(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_MISC: - MiscMouseDown(widgetIndex); - break; - case WINDOW_OPTIONS_PAGE_ADVANCED: - AdvancedMouseDown(widgetIndex); - break; - default: - break; - } - } + if (dropdownIndex == -1) + return; - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - return; - - switch (page) - { - case WINDOW_OPTIONS_PAGE_DISPLAY: - DisplayDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_OPTIONS_PAGE_RENDERING: - RenderingDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_OPTIONS_PAGE_CULTURE: - CultureDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_OPTIONS_PAGE_AUDIO: - AudioDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: - ControlsDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_OPTIONS_PAGE_MISC: - MiscDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_OPTIONS_PAGE_ADVANCED: - AdvancedDropdown(widgetIndex, dropdownIndex); - break; - default: - break; - } - } - - void OnPrepareDraw() override - { - CommonPrepareDrawBefore(); - - switch (page) - { - case WINDOW_OPTIONS_PAGE_DISPLAY: - DisplayPrepareDraw(); - break; - case WINDOW_OPTIONS_PAGE_RENDERING: - RenderingPrepareDraw(); - break; - case WINDOW_OPTIONS_PAGE_CULTURE: - CulturePrepareDraw(); - break; - case WINDOW_OPTIONS_PAGE_AUDIO: - AudioPrepareDraw(); - break; - case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: - ControlsPrepareDraw(); - break; - case WINDOW_OPTIONS_PAGE_MISC: - MiscPrepareDraw(); - break; - case WINDOW_OPTIONS_PAGE_ADVANCED: - AdvancedPrepareDraw(); - break; - default: - break; + switch (page) + { + case WINDOW_OPTIONS_PAGE_DISPLAY: + DisplayDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_OPTIONS_PAGE_RENDERING: + RenderingDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_OPTIONS_PAGE_CULTURE: + CultureDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_OPTIONS_PAGE_AUDIO: + AudioDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + ControlsDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_OPTIONS_PAGE_MISC: + MiscDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_OPTIONS_PAGE_ADVANCED: + AdvancedDropdown(widgetIndex, dropdownIndex); + break; + default: + break; + } } - CommonPrepareDrawAfter(); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - switch (page) + void OnPrepareDraw() override { - case WINDOW_OPTIONS_PAGE_DISPLAY: - DisplayDraw(dpi); - break; - case WINDOW_OPTIONS_PAGE_ADVANCED: - AdvancedDraw(dpi); - break; - default: - break; + CommonPrepareDrawBefore(); + + switch (page) + { + case WINDOW_OPTIONS_PAGE_DISPLAY: + DisplayPrepareDraw(); + break; + case WINDOW_OPTIONS_PAGE_RENDERING: + RenderingPrepareDraw(); + break; + case WINDOW_OPTIONS_PAGE_CULTURE: + CulturePrepareDraw(); + break; + case WINDOW_OPTIONS_PAGE_AUDIO: + AudioPrepareDraw(); + break; + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + ControlsPrepareDraw(); + break; + case WINDOW_OPTIONS_PAGE_MISC: + MiscPrepareDraw(); + break; + case WINDOW_OPTIONS_PAGE_ADVANCED: + AdvancedPrepareDraw(); + break; + default: + break; + } + + CommonPrepareDrawAfter(); } - } - void OnUpdate() override - { - CommonUpdate(); - - switch (page) + void OnDraw(DrawPixelInfo& dpi) override { - case WINDOW_OPTIONS_PAGE_AUDIO: - AudioUpdate(); - break; - case WINDOW_OPTIONS_PAGE_DISPLAY: - case WINDOW_OPTIONS_PAGE_RENDERING: - case WINDOW_OPTIONS_PAGE_CULTURE: - case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: - case WINDOW_OPTIONS_PAGE_MISC: - case WINDOW_OPTIONS_PAGE_ADVANCED: - default: - break; - } - } + DrawWidgets(dpi); + DrawTabImages(dpi); - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - switch (page) + switch (page) + { + case WINDOW_OPTIONS_PAGE_DISPLAY: + DisplayDraw(dpi); + break; + case WINDOW_OPTIONS_PAGE_ADVANCED: + AdvancedDraw(dpi); + break; + default: + break; + } + } + + void OnUpdate() override { - case WINDOW_OPTIONS_PAGE_AUDIO: - return AudioScrollGetSize(scrollIndex); - case WINDOW_OPTIONS_PAGE_DISPLAY: - case WINDOW_OPTIONS_PAGE_RENDERING: - case WINDOW_OPTIONS_PAGE_CULTURE: - case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: - case WINDOW_OPTIONS_PAGE_MISC: - case WINDOW_OPTIONS_PAGE_ADVANCED: - default: - return { WW, WH }; + CommonUpdate(); + + switch (page) + { + case WINDOW_OPTIONS_PAGE_AUDIO: + AudioUpdate(); + break; + case WINDOW_OPTIONS_PAGE_DISPLAY: + case WINDOW_OPTIONS_PAGE_RENDERING: + case WINDOW_OPTIONS_PAGE_CULTURE: + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + case WINDOW_OPTIONS_PAGE_MISC: + case WINDOW_OPTIONS_PAGE_ADVANCED: + default: + break; + } } - } - OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override - { - if (page == WINDOW_OPTIONS_PAGE_ADVANCED) - return AdvancedTooltip(widgetIndex, fallback); + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + switch (page) + { + case WINDOW_OPTIONS_PAGE_AUDIO: + return AudioScrollGetSize(scrollIndex); + case WINDOW_OPTIONS_PAGE_DISPLAY: + case WINDOW_OPTIONS_PAGE_RENDERING: + case WINDOW_OPTIONS_PAGE_CULTURE: + case WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE: + case WINDOW_OPTIONS_PAGE_MISC: + case WINDOW_OPTIONS_PAGE_ADVANCED: + default: + return { WW, WH }; + } + } - return WindowBase::OnTooltip(widgetIndex, fallback); - } + OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override + { + if (page == WINDOW_OPTIONS_PAGE_ADVANCED) + return AdvancedTooltip(widgetIndex, fallback); -private: + return WindowBase::OnTooltip(widgetIndex, fallback); + } + + private: #pragma region Common events - void CommonMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void CommonMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - WindowClose(*this); - break; - case WIDX_TAB_DISPLAY: - case WIDX_TAB_RENDERING: - case WIDX_TAB_CULTURE: - case WIDX_TAB_AUDIO: - case WIDX_TAB_CONTROLS_AND_INTERFACE: - case WIDX_TAB_MISC: - case WIDX_TAB_ADVANCED: - SetPage(widgetIndex - WIDX_FIRST_TAB); - break; + switch (widgetIndex) + { + case WIDX_CLOSE: + WindowClose(*this); + break; + case WIDX_TAB_DISPLAY: + case WIDX_TAB_RENDERING: + case WIDX_TAB_CULTURE: + case WIDX_TAB_AUDIO: + case WIDX_TAB_CONTROLS_AND_INTERFACE: + case WIDX_TAB_MISC: + case WIDX_TAB_ADVANCED: + SetPage(widgetIndex - WIDX_FIRST_TAB); + break; + } } - } - void CommonPrepareDrawBefore() - { - if (window_options_page_widgets[page] != widgets) + void CommonPrepareDrawBefore() { - widgets = window_options_page_widgets[page]; - InitScrollWidgets(); - } - SetPressedTab(); + if (window_options_page_widgets[page] != widgets) + { + widgets = window_options_page_widgets[page]; + InitScrollWidgets(); + } + SetPressedTab(); - disabled_widgets = 0; - auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); - const bool controlsTabSelected = (WIDX_FIRST_TAB + page) == WIDX_TAB_CONTROLS_AND_INTERFACE; - if (!hasFilePicker && controlsTabSelected) + disabled_widgets = 0; + auto hasFilePicker = OpenRCT2::GetContext()->GetUiContext()->HasFilePicker(); + const bool controlsTabSelected = (WIDX_FIRST_TAB + page) == WIDX_TAB_CONTROLS_AND_INTERFACE; + if (!hasFilePicker && controlsTabSelected) + { + disabled_widgets |= (1uLL << WIDX_ALWAYS_NATIVE_LOADSAVE); + widgets[WIDX_ALWAYS_NATIVE_LOADSAVE].type = WindowWidgetType::Empty; + } + } + + void CommonPrepareDrawAfter() { - disabled_widgets |= (1uLL << WIDX_ALWAYS_NATIVE_LOADSAVE); - widgets[WIDX_ALWAYS_NATIVE_LOADSAVE].type = WindowWidgetType::Empty; + // Automatically adjust window height to fit widgets + int32_t y = 0; + for (auto widget = &widgets[WIDX_PAGE_START]; widget->type != WindowWidgetType::Last; widget++) + { + y = std::max(y, widget->bottom); + } + height = y + 6; + ResizeFrameWithPage(); } - } - void CommonPrepareDrawAfter() - { - // Automatically adjust window height to fit widgets - int32_t y = 0; - for (auto widget = &widgets[WIDX_PAGE_START]; widget->type != WindowWidgetType::Last; widget++) + void OnResize() override { - y = std::max(y, widget->bottom); + ResizeFrameWithPage(); } - height = y + 6; - ResizeFrameWithPage(); - } - void OnResize() override - { - ResizeFrameWithPage(); - } - - void CommonUpdate() - { - // Tab animation - frame_no++; - InvalidateWidget(WIDX_FIRST_TAB + page); - } + void CommonUpdate() + { + // Tab animation + frame_no++; + InvalidateWidget(WIDX_FIRST_TAB + page); + } #pragma endregion #pragma region Display tab events - void DisplayMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void DisplayMouseUp(WidgetIndex widgetIndex) { - case WIDX_UNCAP_FPS_CHECKBOX: - gConfigGeneral.UncapFPS ^= 1; - DrawingEngineSetVSync(gConfigGeneral.UseVSync); - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_USE_VSYNC_CHECKBOX: - gConfigGeneral.UseVSync ^= 1; - DrawingEngineSetVSync(gConfigGeneral.UseVSync); - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_SHOW_FPS_CHECKBOX: - gConfigGeneral.ShowFPS ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_MULTITHREADING_CHECKBOX: - gConfigGeneral.MultiThreading ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_MINIMIZE_FOCUS_LOSS: - gConfigGeneral.MinimizeFullscreenFocusLoss ^= 1; - RefreshVideo(false); - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_STEAM_OVERLAY_PAUSE: - gConfigGeneral.SteamOverlayPause ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_DISABLE_SCREENSAVER_LOCK: - gConfigGeneral.DisableScreensaver ^= 1; - ApplyScreenSaverLockSetting(); - ConfigSaveDefault(); - Invalidate(); - break; - } - } - - void DisplayMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_RESOLUTION_DROPDOWN: + switch (widgetIndex) { - const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); - - int32_t selectedResolution = -1; - for (size_t i = 0; i < resolutions.size(); i++) - { - const Resolution& resolution = resolutions[i]; - - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - - uint16_t* args = reinterpret_cast(&gDropdownItems[i].Args); - args[0] = STR_RESOLUTION_X_BY_Y; - args[1] = resolution.Width; - args[2] = resolution.Height; - - if (resolution.Width == gConfigGeneral.FullscreenWidth - && resolution.Height == gConfigGeneral.FullscreenHeight) - { - selectedResolution = static_cast(i); - } - } - - ShowDropdown(widget, static_cast(resolutions.size())); - - if (selectedResolution != -1 && selectedResolution < 32) - { - Dropdown::SetChecked(selectedResolution, true); - } - } - - break; - case WIDX_FULLSCREEN_DROPDOWN: - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_OPTIONS_DISPLAY_WINDOWED; - gDropdownItems[1].Args = STR_OPTIONS_DISPLAY_FULLSCREEN; - gDropdownItems[2].Args = STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS; - - ShowDropdown(widget, 3); - - Dropdown::SetChecked(gConfigGeneral.FullscreenMode, true); - break; - case WIDX_DRAWING_ENGINE_DROPDOWN: - { - int32_t numItems = 3; -#ifdef DISABLE_OPENGL - numItems = 2; -#endif - - for (int32_t i = 0; i < numItems; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = DrawingEngineStringIds[i]; - } - ShowDropdown(widget, numItems); - Dropdown::SetChecked(EnumValue(gConfigGeneral.DrawingEngine), true); - break; - } - case WIDX_SCALE_UP: - gConfigGeneral.WindowScale += 0.25f; - ConfigSaveDefault(); - GfxInvalidateScreen(); - ContextTriggerResize(); - ContextUpdateCursorScale(); - break; - case WIDX_SCALE_DOWN: - gConfigGeneral.WindowScale -= 0.25f; - gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale); - ConfigSaveDefault(); - GfxInvalidateScreen(); - ContextTriggerResize(); - ContextUpdateCursorScale(); - break; - } - } - - void DisplayDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_RESOLUTION_DROPDOWN: - { - const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); - - const Resolution& resolution = resolutions[dropdownIndex]; - if (resolution.Width != gConfigGeneral.FullscreenWidth || resolution.Height != gConfigGeneral.FullscreenHeight) - { - gConfigGeneral.FullscreenWidth = resolution.Width; - gConfigGeneral.FullscreenHeight = resolution.Height; - - if (gConfigGeneral.FullscreenMode == static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) - ContextSetFullscreenMode(static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)); - - ConfigSaveDefault(); - GfxInvalidateScreen(); - } - } - break; - case WIDX_FULLSCREEN_DROPDOWN: - if (dropdownIndex != gConfigGeneral.FullscreenMode) - { - ContextSetFullscreenMode(dropdownIndex); - - gConfigGeneral.FullscreenMode = static_cast(dropdownIndex); - ConfigSaveDefault(); - GfxInvalidateScreen(); - } - break; - case WIDX_DRAWING_ENGINE_DROPDOWN: - if (dropdownIndex != EnumValue(gConfigGeneral.DrawingEngine)) - { - DrawingEngine srcEngine = drawing_engine_get_type(); - DrawingEngine dstEngine = static_cast(dropdownIndex); - - gConfigGeneral.DrawingEngine = dstEngine; - bool recreate_window = DrawingEngineRequiresNewWindow(srcEngine, dstEngine); - RefreshVideo(recreate_window); + case WIDX_UNCAP_FPS_CHECKBOX: + gConfigGeneral.UncapFPS ^= 1; + DrawingEngineSetVSync(gConfigGeneral.UseVSync); ConfigSaveDefault(); Invalidate(); - } - break; - } - } - - void DisplayPrepareDraw() - { - // Resolution dropdown caption. - auto ft = Formatter::Common(); - ft.Increment(16); - ft.Add(static_cast(gConfigGeneral.FullscreenWidth)); - ft.Add(static_cast(gConfigGeneral.FullscreenHeight)); - - // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" - if (gConfigGeneral.FullscreenMode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) - { - disabled_widgets |= (1uLL << WIDX_RESOLUTION_DROPDOWN); - disabled_widgets |= (1uLL << WIDX_RESOLUTION); - disabled_widgets |= (1uLL << WIDX_RESOLUTION_LABEL); - } - else - { - disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_DROPDOWN); - disabled_widgets &= ~(1uLL << WIDX_RESOLUTION); - disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_LABEL); - } - - // Disable Steam Overlay checkbox when using software or OpenGL rendering. - if (gConfigGeneral.DrawingEngine == DrawingEngine::Software || gConfigGeneral.DrawingEngine == DrawingEngine::OpenGL) - { - disabled_widgets |= (1uLL << WIDX_STEAM_OVERLAY_PAUSE); - } - else - { - disabled_widgets &= ~(1uLL << WIDX_STEAM_OVERLAY_PAUSE); - } - - // Disable changing VSync for Software engine, as we can't control its use of VSync - if (gConfigGeneral.DrawingEngine == DrawingEngine::Software) - { - disabled_widgets |= (1uLL << WIDX_USE_VSYNC_CHECKBOX); - } - else - { - disabled_widgets &= ~(1uLL << WIDX_USE_VSYNC_CHECKBOX); - } - - SetCheckboxValue(WIDX_UNCAP_FPS_CHECKBOX, gConfigGeneral.UncapFPS); - SetCheckboxValue(WIDX_USE_VSYNC_CHECKBOX, gConfigGeneral.UseVSync); - SetCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, gConfigGeneral.ShowFPS); - SetCheckboxValue(WIDX_MULTITHREADING_CHECKBOX, gConfigGeneral.MultiThreading); - SetCheckboxValue(WIDX_MINIMIZE_FOCUS_LOSS, gConfigGeneral.MinimizeFullscreenFocusLoss); - SetCheckboxValue(WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.SteamOverlayPause); - SetCheckboxValue(WIDX_DISABLE_SCREENSAVER_LOCK, gConfigGeneral.DisableScreensaver); - - // Dropdown captions for straightforward strings. - widgets[WIDX_FULLSCREEN].text = FullscreenModeNames[gConfigGeneral.FullscreenMode]; - widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.DrawingEngine)]; - } - - void DisplayDraw(DrawPixelInfo& dpi) - { - auto ft = Formatter(); - ft.Add(static_cast(gConfigGeneral.WindowScale * 100)); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 }, - STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { colours[1] }); - } -#pragma endregion - -#pragma region Rendering tab events - void RenderingMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_TILE_SMOOTHING_CHECKBOX: - gConfigGeneral.LandscapeSmoothing ^= 1; - ConfigSaveDefault(); - GfxInvalidateScreen(); - break; - case WIDX_GRIDLINES_CHECKBOX: - { - gConfigGeneral.AlwaysShowGridlines ^= 1; - ConfigSaveDefault(); - GfxInvalidateScreen(); - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - { - if (gConfigGeneral.AlwaysShowGridlines) - mainWindow->viewport->flags |= VIEWPORT_FLAG_GRIDLINES; - else - mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; - } - break; + break; + case WIDX_USE_VSYNC_CHECKBOX: + gConfigGeneral.UseVSync ^= 1; + DrawingEngineSetVSync(gConfigGeneral.UseVSync); + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_SHOW_FPS_CHECKBOX: + gConfigGeneral.ShowFPS ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_MULTITHREADING_CHECKBOX: + gConfigGeneral.MultiThreading ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_MINIMIZE_FOCUS_LOSS: + gConfigGeneral.MinimizeFullscreenFocusLoss ^= 1; + RefreshVideo(false); + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_STEAM_OVERLAY_PAUSE: + gConfigGeneral.SteamOverlayPause ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_DISABLE_SCREENSAVER_LOCK: + gConfigGeneral.DisableScreensaver ^= 1; + ApplyScreenSaverLockSetting(); + ConfigSaveDefault(); + Invalidate(); + break; } - case WIDX_DAY_NIGHT_CHECKBOX: - gConfigGeneral.DayNightCycle ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_ENABLE_LIGHT_FX_CHECKBOX: - gConfigGeneral.EnableLightFx ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX: - gConfigGeneral.EnableLightFxForVehicles ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_UPPER_CASE_BANNERS_CHECKBOX: - gConfigGeneral.UpperCaseBanners ^= 1; - ConfigSaveDefault(); - Invalidate(); - ScrollingTextInvalidate(); - break; - case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX: - gConfigGeneral.DisableLightningEffect ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX: - gConfigGeneral.RenderWeatherEffects ^= 1; - gConfigGeneral.RenderWeatherGloom = gConfigGeneral.RenderWeatherEffects; - ConfigSaveDefault(); - Invalidate(); - GfxInvalidateScreen(); - break; - case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX: - gConfigGeneral.ShowGuestPurchases ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX: - gConfigGeneral.TransparentScreenshot ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - } - } - - void RenderingMouseDown(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_VIRTUAL_FLOOR_DROPDOWN: - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_VIRTUAL_FLOOR_STYLE_DISABLED; - gDropdownItems[1].Args = STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT; - gDropdownItems[2].Args = STR_VIRTUAL_FLOOR_STYLE_GLASSY; - - Widget* widget = &widgets[widgetIndex - 1]; - ShowDropdown(widget, 3); - - Dropdown::SetChecked(static_cast(gConfigGeneral.VirtualFloorStyle), true); - break; - } - } - - void RenderingDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_VIRTUAL_FLOOR_DROPDOWN: - gConfigGeneral.VirtualFloorStyle = static_cast(dropdownIndex); - ConfigSaveDefault(); - break; - } - } - - void RenderingPrepareDraw() - { - SetCheckboxValue(WIDX_TILE_SMOOTHING_CHECKBOX, gConfigGeneral.LandscapeSmoothing); - SetCheckboxValue(WIDX_GRIDLINES_CHECKBOX, gConfigGeneral.AlwaysShowGridlines); - SetCheckboxValue(WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.DayNightCycle); - SetCheckboxValue(WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.ShowGuestPurchases); - SetCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.TransparentScreenshot); - SetCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.UpperCaseBanners); - - static constexpr StringId _virtualFloorStyleStrings[] = { - STR_VIRTUAL_FLOOR_STYLE_DISABLED, - STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, - STR_VIRTUAL_FLOOR_STYLE_GLASSY, - }; - - widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[EnumValue(gConfigGeneral.VirtualFloorStyle)]; - - SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.EnableLightFx); - if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) - { - disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); - } - else - { - disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); - gConfigGeneral.EnableLightFx = false; } - SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, gConfigGeneral.EnableLightFxForVehicles); - if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay - && gConfigGeneral.EnableLightFx) + void DisplayMouseDown(WidgetIndex widgetIndex) { - disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); - } - else - { - disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); - gConfigGeneral.EnableLightFxForVehicles = false; - } + Widget* widget = &widgets[widgetIndex - 1]; - WidgetSetCheckboxValue( - *this, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, - gConfigGeneral.RenderWeatherEffects || gConfigGeneral.RenderWeatherGloom); - SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.DisableLightningEffect); - if (!gConfigGeneral.RenderWeatherEffects && !gConfigGeneral.RenderWeatherGloom) - { - SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); - disabled_widgets |= (1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); - } - else - { - disabled_widgets &= ~(1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); - } - } - -#pragma endregion - -#pragma region Culture tab events - void CultureMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_HEIGHT_LABELS_DROPDOWN: - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_HEIGHT_IN_UNITS; - gDropdownItems[1].Args = STR_REAL_VALUES; - - ShowDropdown(widget, 2); - - Dropdown::SetChecked(gConfigGeneral.ShowHeightAsUnits ? 0 : 1, true); - break; - case WIDX_CURRENCY_DROPDOWN: + switch (widgetIndex) { - // All the currencies plus the separator - constexpr auto numItems = EnumValue(CurrencyType::Count) + 1; - - // All the currencies except custom currency - size_t numOrdinaryCurrencies = EnumValue(CurrencyType::Count) - 1; - - for (size_t i = 0; i < numOrdinaryCurrencies; i++) + case WIDX_RESOLUTION_DROPDOWN: { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = CurrencyDescriptors[i].stringId; + const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); + + int32_t selectedResolution = -1; + for (size_t i = 0; i < resolutions.size(); i++) + { + const Resolution& resolution = resolutions[i]; + + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + + uint16_t* args = reinterpret_cast(&gDropdownItems[i].Args); + args[0] = STR_RESOLUTION_X_BY_Y; + args[1] = resolution.Width; + args[2] = resolution.Height; + + if (resolution.Width == gConfigGeneral.FullscreenWidth + && resolution.Height == gConfigGeneral.FullscreenHeight) + { + selectedResolution = static_cast(i); + } + } + + ShowDropdown(widget, static_cast(resolutions.size())); + + if (selectedResolution != -1 && selectedResolution < 32) + { + Dropdown::SetChecked(selectedResolution, true); + } } - gDropdownItems[numOrdinaryCurrencies].Format = Dropdown::SeparatorString; + break; + case WIDX_FULLSCREEN_DROPDOWN: + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_OPTIONS_DISPLAY_WINDOWED; + gDropdownItems[1].Args = STR_OPTIONS_DISPLAY_FULLSCREEN; + gDropdownItems[2].Args = STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS; - gDropdownItems[numOrdinaryCurrencies + 1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numOrdinaryCurrencies + 1].Args = CurrencyDescriptors[EnumValue(CurrencyType::Custom)].stringId; + ShowDropdown(widget, 3); - ShowDropdown(widget, numItems); - - if (gConfigGeneral.CurrencyFormat == CurrencyType::Custom) + Dropdown::SetChecked(gConfigGeneral.FullscreenMode, true); + break; + case WIDX_DRAWING_ENGINE_DROPDOWN: { - Dropdown::SetChecked(EnumValue(gConfigGeneral.CurrencyFormat) + 1, true); - } - else - { - Dropdown::SetChecked(EnumValue(gConfigGeneral.CurrencyFormat), true); - } - break; - } - case WIDX_DISTANCE_DROPDOWN: - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_IMPERIAL; - gDropdownItems[1].Args = STR_METRIC; - gDropdownItems[2].Args = STR_SI; + int32_t numItems = 3; +#ifdef DISABLE_OPENGL + numItems = 2; +#endif - ShowDropdown(widget, 3); - - Dropdown::SetChecked(static_cast(gConfigGeneral.MeasurementFormat), true); - break; - case WIDX_TEMPERATURE_DROPDOWN: - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_CELSIUS; - gDropdownItems[1].Args = STR_FAHRENHEIT; - - ShowDropdown(widget, 2); - - Dropdown::SetChecked(static_cast(gConfigGeneral.TemperatureFormat), true); - break; - case WIDX_LANGUAGE_DROPDOWN: - for (size_t i = 1; i < LANGUAGE_COUNT; i++) - { - gDropdownItems[i - 1].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i - 1].Args = reinterpret_cast(LanguagesDescriptors[i].native_name); + for (int32_t i = 0; i < numItems; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = DrawingEngineStringIds[i]; + } + ShowDropdown(widget, numItems); + Dropdown::SetChecked(EnumValue(gConfigGeneral.DrawingEngine), true); + break; } - ShowDropdown(widget, LANGUAGE_COUNT - 1); - Dropdown::SetChecked(LocalisationService_GetCurrentLanguage() - 1, true); - break; - case WIDX_DATE_FORMAT_DROPDOWN: - for (size_t i = 0; i < 4; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = DateFormatStringIDs[i]; - } - ShowDropdown(widget, 4); - Dropdown::SetChecked(gConfigGeneral.DateFormat, true); - break; - } - } - - void CultureDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_HEIGHT_LABELS_DROPDOWN: - // reset flag and set it to 1 if height as units is selected - gConfigGeneral.ShowHeightAsUnits = 0; - - if (dropdownIndex == 0) - { - gConfigGeneral.ShowHeightAsUnits = 1; - } - ConfigSaveDefault(); - UpdateHeightMarkers(); - break; - case WIDX_CURRENCY_DROPDOWN: - if (dropdownIndex == EnumValue(CurrencyType::Custom) + 1) - { // Add 1 because the separator occupies a position - gConfigGeneral.CurrencyFormat = static_cast(dropdownIndex - 1); - ContextOpenWindow(WindowClass::CustomCurrencyConfig); - } - else - { - gConfigGeneral.CurrencyFormat = static_cast(dropdownIndex); - } - ConfigSaveDefault(); - GfxInvalidateScreen(); - break; - case WIDX_DISTANCE_DROPDOWN: - gConfigGeneral.MeasurementFormat = static_cast(dropdownIndex); - ConfigSaveDefault(); - UpdateHeightMarkers(); - break; - case WIDX_TEMPERATURE_DROPDOWN: - if (dropdownIndex != static_cast(gConfigGeneral.TemperatureFormat)) - { - gConfigGeneral.TemperatureFormat = static_cast(dropdownIndex); + case WIDX_SCALE_UP: + gConfigGeneral.WindowScale += 0.25f; ConfigSaveDefault(); GfxInvalidateScreen(); - } - break; - case WIDX_LANGUAGE_DROPDOWN: + ContextTriggerResize(); + ContextUpdateCursorScale(); + break; + case WIDX_SCALE_DOWN: + gConfigGeneral.WindowScale -= 0.25f; + gConfigGeneral.WindowScale = std::max(0.5f, gConfigGeneral.WindowScale); + ConfigSaveDefault(); + GfxInvalidateScreen(); + ContextTriggerResize(); + ContextUpdateCursorScale(); + break; + } + } + + void DisplayDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) { - auto fallbackLanguage = LocalisationService_GetCurrentLanguage(); - if (dropdownIndex != LocalisationService_GetCurrentLanguage() - 1) + case WIDX_RESOLUTION_DROPDOWN: { - if (!LanguageOpen(dropdownIndex + 1)) + const auto& resolutions = OpenRCT2::GetContext()->GetUiContext()->GetFullscreenResolutions(); + + const Resolution& resolution = resolutions[dropdownIndex]; + if (resolution.Width != gConfigGeneral.FullscreenWidth + || resolution.Height != gConfigGeneral.FullscreenHeight) { - // Failed to open language file, try to recover by falling - // back to previously used language - if (LanguageOpen(fallbackLanguage)) - { - // It worked, so we can say it with error message in-game - ContextShowError(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {}); - } - // report error to console regardless - LOG_ERROR("Failed to open language file."); - } - else - { - gConfigGeneral.Language = dropdownIndex + 1; + gConfigGeneral.FullscreenWidth = resolution.Width; + gConfigGeneral.FullscreenHeight = resolution.Height; + + if (gConfigGeneral.FullscreenMode == static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + ContextSetFullscreenMode(static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)); + ConfigSaveDefault(); GfxInvalidateScreen(); } } + break; + case WIDX_FULLSCREEN_DROPDOWN: + if (dropdownIndex != gConfigGeneral.FullscreenMode) + { + ContextSetFullscreenMode(dropdownIndex); + + gConfigGeneral.FullscreenMode = static_cast(dropdownIndex); + ConfigSaveDefault(); + GfxInvalidateScreen(); + } + break; + case WIDX_DRAWING_ENGINE_DROPDOWN: + if (dropdownIndex != EnumValue(gConfigGeneral.DrawingEngine)) + { + DrawingEngine srcEngine = drawing_engine_get_type(); + DrawingEngine dstEngine = static_cast(dropdownIndex); + + gConfigGeneral.DrawingEngine = dstEngine; + bool recreate_window = DrawingEngineRequiresNewWindow(srcEngine, dstEngine); + RefreshVideo(recreate_window); + ConfigSaveDefault(); + Invalidate(); + } + break; } - break; - case WIDX_DATE_FORMAT_DROPDOWN: - if (dropdownIndex != gConfigGeneral.DateFormat) - { - gConfigGeneral.DateFormat = static_cast(dropdownIndex); + } + + void DisplayPrepareDraw() + { + // Resolution dropdown caption. + auto ft = Formatter::Common(); + ft.Increment(16); + ft.Add(static_cast(gConfigGeneral.FullscreenWidth)); + ft.Add(static_cast(gConfigGeneral.FullscreenHeight)); + + // Disable resolution dropdown on "Windowed" and "Fullscreen (desktop)" + if (gConfigGeneral.FullscreenMode != static_cast(OpenRCT2::Ui::FULLSCREEN_MODE::FULLSCREEN)) + { + disabled_widgets |= (1uLL << WIDX_RESOLUTION_DROPDOWN); + disabled_widgets |= (1uLL << WIDX_RESOLUTION); + disabled_widgets |= (1uLL << WIDX_RESOLUTION_LABEL); + } + else + { + disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_DROPDOWN); + disabled_widgets &= ~(1uLL << WIDX_RESOLUTION); + disabled_widgets &= ~(1uLL << WIDX_RESOLUTION_LABEL); + } + + // Disable Steam Overlay checkbox when using software or OpenGL rendering. + if (gConfigGeneral.DrawingEngine == DrawingEngine::Software + || gConfigGeneral.DrawingEngine == DrawingEngine::OpenGL) + { + disabled_widgets |= (1uLL << WIDX_STEAM_OVERLAY_PAUSE); + } + else + { + disabled_widgets &= ~(1uLL << WIDX_STEAM_OVERLAY_PAUSE); + } + + // Disable changing VSync for Software engine, as we can't control its use of VSync + if (gConfigGeneral.DrawingEngine == DrawingEngine::Software) + { + disabled_widgets |= (1uLL << WIDX_USE_VSYNC_CHECKBOX); + } + else + { + disabled_widgets &= ~(1uLL << WIDX_USE_VSYNC_CHECKBOX); + } + + SetCheckboxValue(WIDX_UNCAP_FPS_CHECKBOX, gConfigGeneral.UncapFPS); + SetCheckboxValue(WIDX_USE_VSYNC_CHECKBOX, gConfigGeneral.UseVSync); + SetCheckboxValue(WIDX_SHOW_FPS_CHECKBOX, gConfigGeneral.ShowFPS); + SetCheckboxValue(WIDX_MULTITHREADING_CHECKBOX, gConfigGeneral.MultiThreading); + SetCheckboxValue(WIDX_MINIMIZE_FOCUS_LOSS, gConfigGeneral.MinimizeFullscreenFocusLoss); + SetCheckboxValue(WIDX_STEAM_OVERLAY_PAUSE, gConfigGeneral.SteamOverlayPause); + SetCheckboxValue(WIDX_DISABLE_SCREENSAVER_LOCK, gConfigGeneral.DisableScreensaver); + + // Dropdown captions for straightforward strings. + widgets[WIDX_FULLSCREEN].text = FullscreenModeNames[gConfigGeneral.FullscreenMode]; + widgets[WIDX_DRAWING_ENGINE].text = DrawingEngineStringIds[EnumValue(gConfigGeneral.DrawingEngine)]; + } + + void DisplayDraw(DrawPixelInfo& dpi) + { + auto ft = Formatter(); + ft.Add(static_cast(gConfigGeneral.WindowScale * 100)); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_SCALE].left + 1, widgets[WIDX_SCALE].top + 1 }, + STR_WINDOW_COLOUR_2_COMMA2DP32, ft, { colours[1] }); + } +#pragma endregion + +#pragma region Rendering tab events + void RenderingMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_TILE_SMOOTHING_CHECKBOX: + gConfigGeneral.LandscapeSmoothing ^= 1; ConfigSaveDefault(); GfxInvalidateScreen(); + break; + case WIDX_GRIDLINES_CHECKBOX: + { + gConfigGeneral.AlwaysShowGridlines ^= 1; + ConfigSaveDefault(); + GfxInvalidateScreen(); + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + { + if (gConfigGeneral.AlwaysShowGridlines) + mainWindow->viewport->flags |= VIEWPORT_FLAG_GRIDLINES; + else + mainWindow->viewport->flags &= ~VIEWPORT_FLAG_GRIDLINES; + } + break; } - break; - } - } - - void CulturePrepareDraw() - { - // Language - auto ft = Formatter::Common(); - ft.Add(LanguagesDescriptors[LocalisationService_GetCurrentLanguage()].native_name); - - // Currency: pounds, dollars, etc. (10 total) - widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)].stringId; - - // Distance: metric / imperial / si - { - StringId stringId = STR_NONE; - switch (gConfigGeneral.MeasurementFormat) - { - case MeasurementFormat::Imperial: - stringId = STR_IMPERIAL; + case WIDX_DAY_NIGHT_CHECKBOX: + gConfigGeneral.DayNightCycle ^= 1; + ConfigSaveDefault(); + Invalidate(); break; - case MeasurementFormat::Metric: - stringId = STR_METRIC; + case WIDX_ENABLE_LIGHT_FX_CHECKBOX: + gConfigGeneral.EnableLightFx ^= 1; + ConfigSaveDefault(); + Invalidate(); break; - case MeasurementFormat::SI: - stringId = STR_SI; + case WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX: + gConfigGeneral.EnableLightFxForVehicles ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_UPPER_CASE_BANNERS_CHECKBOX: + gConfigGeneral.UpperCaseBanners ^= 1; + ConfigSaveDefault(); + Invalidate(); + ScrollingTextInvalidate(); + break; + case WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX: + gConfigGeneral.DisableLightningEffect ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX: + gConfigGeneral.RenderWeatherEffects ^= 1; + gConfigGeneral.RenderWeatherGloom = gConfigGeneral.RenderWeatherEffects; + ConfigSaveDefault(); + Invalidate(); + GfxInvalidateScreen(); + break; + case WIDX_SHOW_GUEST_PURCHASES_CHECKBOX: + gConfigGeneral.ShowGuestPurchases ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX: + gConfigGeneral.TransparentScreenshot ^= 1; + ConfigSaveDefault(); + Invalidate(); break; } - widgets[WIDX_DISTANCE].text = stringId; } - // Date format - widgets[WIDX_DATE_FORMAT].text = DateFormatStringIDs[gConfigGeneral.DateFormat]; + void RenderingMouseDown(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_VIRTUAL_FLOOR_DROPDOWN: + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_VIRTUAL_FLOOR_STYLE_DISABLED; + gDropdownItems[1].Args = STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT; + gDropdownItems[2].Args = STR_VIRTUAL_FLOOR_STYLE_GLASSY; - // Temperature: celsius/fahrenheit - widgets[WIDX_TEMPERATURE].text = gConfigGeneral.TemperatureFormat == TemperatureUnit::Fahrenheit ? STR_FAHRENHEIT - : STR_CELSIUS; + Widget* widget = &widgets[widgetIndex - 1]; + ShowDropdown(widget, 3); - // Height: units/real values - widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.ShowHeightAsUnits ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; - } + Dropdown::SetChecked(static_cast(gConfigGeneral.VirtualFloorStyle), true); + break; + } + } + + void RenderingDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_VIRTUAL_FLOOR_DROPDOWN: + gConfigGeneral.VirtualFloorStyle = static_cast(dropdownIndex); + ConfigSaveDefault(); + break; + } + } + + void RenderingPrepareDraw() + { + SetCheckboxValue(WIDX_TILE_SMOOTHING_CHECKBOX, gConfigGeneral.LandscapeSmoothing); + SetCheckboxValue(WIDX_GRIDLINES_CHECKBOX, gConfigGeneral.AlwaysShowGridlines); + SetCheckboxValue(WIDX_DAY_NIGHT_CHECKBOX, gConfigGeneral.DayNightCycle); + SetCheckboxValue(WIDX_SHOW_GUEST_PURCHASES_CHECKBOX, gConfigGeneral.ShowGuestPurchases); + SetCheckboxValue(WIDX_TRANSPARENT_SCREENSHOTS_CHECKBOX, gConfigGeneral.TransparentScreenshot); + SetCheckboxValue(WIDX_UPPER_CASE_BANNERS_CHECKBOX, gConfigGeneral.UpperCaseBanners); + + static constexpr StringId _virtualFloorStyleStrings[] = { + STR_VIRTUAL_FLOOR_STYLE_DISABLED, + STR_VIRTUAL_FLOOR_STYLE_TRANSPARENT, + STR_VIRTUAL_FLOOR_STYLE_GLASSY, + }; + + widgets[WIDX_VIRTUAL_FLOOR].text = _virtualFloorStyleStrings[EnumValue(gConfigGeneral.VirtualFloorStyle)]; + + SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_CHECKBOX, gConfigGeneral.EnableLightFx); + if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay) + { + disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + } + else + { + disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_CHECKBOX); + gConfigGeneral.EnableLightFx = false; + } + + SetCheckboxValue(WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX, gConfigGeneral.EnableLightFxForVehicles); + if (gConfigGeneral.DayNightCycle && gConfigGeneral.DrawingEngine == DrawingEngine::SoftwareWithHardwareDisplay + && gConfigGeneral.EnableLightFx) + { + disabled_widgets &= ~(1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + } + else + { + disabled_widgets |= (1uLL << WIDX_ENABLE_LIGHT_FX_FOR_VEHICLES_CHECKBOX); + gConfigGeneral.EnableLightFxForVehicles = false; + } + + WidgetSetCheckboxValue( + *this, WIDX_RENDER_WEATHER_EFFECTS_CHECKBOX, + gConfigGeneral.RenderWeatherEffects || gConfigGeneral.RenderWeatherGloom); + SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, gConfigGeneral.DisableLightningEffect); + if (!gConfigGeneral.RenderWeatherEffects && !gConfigGeneral.RenderWeatherGloom) + { + SetCheckboxValue(WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX, true); + disabled_widgets |= (1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + } + else + { + disabled_widgets &= ~(1uLL << WIDX_DISABLE_LIGHTNING_EFFECT_CHECKBOX); + } + } + +#pragma endregion + +#pragma region Culture tab events + void CultureMouseDown(WidgetIndex widgetIndex) + { + Widget* widget = &widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_HEIGHT_LABELS_DROPDOWN: + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_HEIGHT_IN_UNITS; + gDropdownItems[1].Args = STR_REAL_VALUES; + + ShowDropdown(widget, 2); + + Dropdown::SetChecked(gConfigGeneral.ShowHeightAsUnits ? 0 : 1, true); + break; + case WIDX_CURRENCY_DROPDOWN: + { + // All the currencies plus the separator + constexpr auto numItems = EnumValue(CurrencyType::Count) + 1; + + // All the currencies except custom currency + size_t numOrdinaryCurrencies = EnumValue(CurrencyType::Count) - 1; + + for (size_t i = 0; i < numOrdinaryCurrencies; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = CurrencyDescriptors[i].stringId; + } + + gDropdownItems[numOrdinaryCurrencies].Format = Dropdown::SeparatorString; + + gDropdownItems[numOrdinaryCurrencies + 1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numOrdinaryCurrencies + 1].Args = CurrencyDescriptors[EnumValue(CurrencyType::Custom)] + .stringId; + + ShowDropdown(widget, numItems); + + if (gConfigGeneral.CurrencyFormat == CurrencyType::Custom) + { + Dropdown::SetChecked(EnumValue(gConfigGeneral.CurrencyFormat) + 1, true); + } + else + { + Dropdown::SetChecked(EnumValue(gConfigGeneral.CurrencyFormat), true); + } + break; + } + case WIDX_DISTANCE_DROPDOWN: + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_IMPERIAL; + gDropdownItems[1].Args = STR_METRIC; + gDropdownItems[2].Args = STR_SI; + + ShowDropdown(widget, 3); + + Dropdown::SetChecked(static_cast(gConfigGeneral.MeasurementFormat), true); + break; + case WIDX_TEMPERATURE_DROPDOWN: + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_CELSIUS; + gDropdownItems[1].Args = STR_FAHRENHEIT; + + ShowDropdown(widget, 2); + + Dropdown::SetChecked(static_cast(gConfigGeneral.TemperatureFormat), true); + break; + case WIDX_LANGUAGE_DROPDOWN: + for (size_t i = 1; i < LANGUAGE_COUNT; i++) + { + gDropdownItems[i - 1].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i - 1].Args = reinterpret_cast(LanguagesDescriptors[i].native_name); + } + ShowDropdown(widget, LANGUAGE_COUNT - 1); + Dropdown::SetChecked(LocalisationService_GetCurrentLanguage() - 1, true); + break; + case WIDX_DATE_FORMAT_DROPDOWN: + for (size_t i = 0; i < 4; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = DateFormatStringIDs[i]; + } + ShowDropdown(widget, 4); + Dropdown::SetChecked(gConfigGeneral.DateFormat, true); + break; + } + } + + void CultureDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_HEIGHT_LABELS_DROPDOWN: + // reset flag and set it to 1 if height as units is selected + gConfigGeneral.ShowHeightAsUnits = 0; + + if (dropdownIndex == 0) + { + gConfigGeneral.ShowHeightAsUnits = 1; + } + ConfigSaveDefault(); + UpdateHeightMarkers(); + break; + case WIDX_CURRENCY_DROPDOWN: + if (dropdownIndex == EnumValue(CurrencyType::Custom) + 1) + { // Add 1 because the separator occupies a position + gConfigGeneral.CurrencyFormat = static_cast(dropdownIndex - 1); + ContextOpenWindow(WindowClass::CustomCurrencyConfig); + } + else + { + gConfigGeneral.CurrencyFormat = static_cast(dropdownIndex); + } + ConfigSaveDefault(); + GfxInvalidateScreen(); + break; + case WIDX_DISTANCE_DROPDOWN: + gConfigGeneral.MeasurementFormat = static_cast(dropdownIndex); + ConfigSaveDefault(); + UpdateHeightMarkers(); + break; + case WIDX_TEMPERATURE_DROPDOWN: + if (dropdownIndex != static_cast(gConfigGeneral.TemperatureFormat)) + { + gConfigGeneral.TemperatureFormat = static_cast(dropdownIndex); + ConfigSaveDefault(); + GfxInvalidateScreen(); + } + break; + case WIDX_LANGUAGE_DROPDOWN: + { + auto fallbackLanguage = LocalisationService_GetCurrentLanguage(); + if (dropdownIndex != LocalisationService_GetCurrentLanguage() - 1) + { + if (!LanguageOpen(dropdownIndex + 1)) + { + // Failed to open language file, try to recover by falling + // back to previously used language + if (LanguageOpen(fallbackLanguage)) + { + // It worked, so we can say it with error message in-game + ContextShowError(STR_LANGUAGE_LOAD_FAILED, STR_NONE, {}); + } + // report error to console regardless + LOG_ERROR("Failed to open language file."); + } + else + { + gConfigGeneral.Language = dropdownIndex + 1; + ConfigSaveDefault(); + GfxInvalidateScreen(); + } + } + } + break; + case WIDX_DATE_FORMAT_DROPDOWN: + if (dropdownIndex != gConfigGeneral.DateFormat) + { + gConfigGeneral.DateFormat = static_cast(dropdownIndex); + ConfigSaveDefault(); + GfxInvalidateScreen(); + } + break; + } + } + + void CulturePrepareDraw() + { + // Language + auto ft = Formatter::Common(); + ft.Add(LanguagesDescriptors[LocalisationService_GetCurrentLanguage()].native_name); + + // Currency: pounds, dollars, etc. (10 total) + widgets[WIDX_CURRENCY].text = CurrencyDescriptors[EnumValue(gConfigGeneral.CurrencyFormat)].stringId; + + // Distance: metric / imperial / si + { + StringId stringId = STR_NONE; + switch (gConfigGeneral.MeasurementFormat) + { + case MeasurementFormat::Imperial: + stringId = STR_IMPERIAL; + break; + case MeasurementFormat::Metric: + stringId = STR_METRIC; + break; + case MeasurementFormat::SI: + stringId = STR_SI; + break; + } + widgets[WIDX_DISTANCE].text = stringId; + } + + // Date format + widgets[WIDX_DATE_FORMAT].text = DateFormatStringIDs[gConfigGeneral.DateFormat]; + + // Temperature: celsius/fahrenheit + widgets[WIDX_TEMPERATURE].text = gConfigGeneral.TemperatureFormat == TemperatureUnit::Fahrenheit ? STR_FAHRENHEIT + : STR_CELSIUS; + + // Height: units/real values + widgets[WIDX_HEIGHT_LABELS].text = gConfigGeneral.ShowHeightAsUnits ? STR_HEIGHT_IN_UNITS : STR_REAL_VALUES; + } #pragma endregion #pragma region Audio tab events - void AudioMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void AudioMouseUp(WidgetIndex widgetIndex) { - case WIDX_SOUND_CHECKBOX: - gConfigSound.SoundEnabled = !gConfigSound.SoundEnabled; - ConfigSaveDefault(); - Invalidate(); - break; - - case WIDX_MASTER_SOUND_CHECKBOX: - gConfigSound.MasterSoundEnabled = !gConfigSound.MasterSoundEnabled; - if (!gConfigSound.MasterSoundEnabled) - OpenRCT2::Audio::Pause(); - else - OpenRCT2::Audio::Resume(); - WindowInvalidateByClass(WindowClass::TopToolbar); - ConfigSaveDefault(); - Invalidate(); - break; - - case WIDX_MUSIC_CHECKBOX: - gConfigSound.RideMusicEnabled = !gConfigSound.RideMusicEnabled; - if (!gConfigSound.RideMusicEnabled) - { - OpenRCT2::RideAudio::StopAllChannels(); - } - ConfigSaveDefault(); - Invalidate(); - break; - - case WIDX_AUDIO_FOCUS_CHECKBOX: - gConfigSound.audio_focus = !gConfigSound.audio_focus; - ConfigSaveDefault(); - Invalidate(); - break; - } - } - - void AudioMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_SOUND_DROPDOWN: - OpenRCT2::Audio::PopulateDevices(); - - // populate the list with the sound devices - for (int32_t i = 0; i < OpenRCT2::Audio::GetDeviceCount(); i++) - { - gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(OpenRCT2::Audio::GetDeviceName(i).c_str()); - } - - ShowDropdown(widget, OpenRCT2::Audio::GetDeviceCount()); - - Dropdown::SetChecked(OpenRCT2::Audio::GetCurrentDeviceIndex(), true); - break; - case WIDX_TITLE_MUSIC_DROPDOWN: + switch (widgetIndex) { - const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable(); - int32_t numItems{}; - int32_t checkedIndex{}; - for (auto theme : TitleThemeOptions) - { - if (theme.Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable) - continue; + case WIDX_SOUND_CHECKBOX: + gConfigSound.SoundEnabled = !gConfigSound.SoundEnabled; + ConfigSaveDefault(); + Invalidate(); + break; - if (gConfigSound.TitleMusic == theme.Kind) - checkedIndex = numItems; - - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numItems++].Args = theme.Name; - } - ShowDropdown(widget, numItems); - Dropdown::SetChecked(checkedIndex, true); - break; - } - } - } - - void AudioDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_SOUND_DROPDOWN: - OpenRCT2::Audio::InitRideSounds(dropdownIndex); - if (dropdownIndex < OpenRCT2::Audio::GetDeviceCount()) - { - auto audioContext = GetContext()->GetAudioContext(); - if (dropdownIndex == 0) - { - audioContext->SetOutputDevice(""); - gConfigSound.Device = ""; - } + case WIDX_MASTER_SOUND_CHECKBOX: + gConfigSound.MasterSoundEnabled = !gConfigSound.MasterSoundEnabled; + if (!gConfigSound.MasterSoundEnabled) + OpenRCT2::Audio::Pause(); else + OpenRCT2::Audio::Resume(); + WindowInvalidateByClass(WindowClass::TopToolbar); + ConfigSaveDefault(); + Invalidate(); + break; + + case WIDX_MUSIC_CHECKBOX: + gConfigSound.RideMusicEnabled = !gConfigSound.RideMusicEnabled; + if (!gConfigSound.RideMusicEnabled) { - const auto& deviceName = GetDeviceName(dropdownIndex); - audioContext->SetOutputDevice(deviceName); - gConfigSound.Device = deviceName; + OpenRCT2::RideAudio::StopAllChannels(); } ConfigSaveDefault(); - OpenRCT2::Audio::PlayTitleMusic(); - } - Invalidate(); - break; - case WIDX_TITLE_MUSIC_DROPDOWN: - { - // HACK: When RCT1 is not available, it's not in the dropdown, so indices higher than it should be incremented - const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable(); - for (size_t i = 0; i < std::size(TitleThemeOptions) && static_cast(i) <= dropdownIndex; i++) - { - if (TitleThemeOptions[i].Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable) - dropdownIndex++; - } + Invalidate(); + break; - gConfigSound.TitleMusic = TitleThemeOptions[dropdownIndex].Kind; + case WIDX_AUDIO_FOCUS_CHECKBOX: + gConfigSound.audio_focus = !gConfigSound.audio_focus; + ConfigSaveDefault(); + Invalidate(); + break; + } + } + + void AudioMouseDown(WidgetIndex widgetIndex) + { + Widget* widget = &widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_SOUND_DROPDOWN: + OpenRCT2::Audio::PopulateDevices(); + + // populate the list with the sound devices + for (int32_t i = 0; i < OpenRCT2::Audio::GetDeviceCount(); i++) + { + gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i].Args = reinterpret_cast(OpenRCT2::Audio::GetDeviceName(i).c_str()); + } + + ShowDropdown(widget, OpenRCT2::Audio::GetDeviceCount()); + + Dropdown::SetChecked(OpenRCT2::Audio::GetCurrentDeviceIndex(), true); + break; + case WIDX_TITLE_MUSIC_DROPDOWN: + { + const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable(); + int32_t numItems{}; + int32_t checkedIndex{}; + for (auto theme : TitleThemeOptions) + { + if (theme.Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable) + continue; + + if (gConfigSound.TitleMusic == theme.Kind) + checkedIndex = numItems; + + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numItems++].Args = theme.Name; + } + ShowDropdown(widget, numItems); + Dropdown::SetChecked(checkedIndex, true); + break; + } + } + } + + void AudioDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_SOUND_DROPDOWN: + OpenRCT2::Audio::InitRideSounds(dropdownIndex); + if (dropdownIndex < OpenRCT2::Audio::GetDeviceCount()) + { + auto audioContext = GetContext()->GetAudioContext(); + if (dropdownIndex == 0) + { + audioContext->SetOutputDevice(""); + gConfigSound.Device = ""; + } + else + { + const auto& deviceName = GetDeviceName(dropdownIndex); + audioContext->SetOutputDevice(deviceName); + gConfigSound.Device = deviceName; + } + ConfigSaveDefault(); + OpenRCT2::Audio::PlayTitleMusic(); + } + Invalidate(); + break; + case WIDX_TITLE_MUSIC_DROPDOWN: + { + // HACK: When RCT1 is not available, it's not in the dropdown, so indices higher than it should be + // incremented + const bool rct1MusicThemeIsAvailable = IsRCT1TitleMusicAvailable(); + for (size_t i = 0; i < std::size(TitleThemeOptions) && static_cast(i) <= dropdownIndex; i++) + { + if (TitleThemeOptions[i].Kind == TitleMusicKind::RCT1 && !rct1MusicThemeIsAvailable) + dropdownIndex++; + } + + gConfigSound.TitleMusic = TitleThemeOptions[dropdownIndex].Kind; + ConfigSaveDefault(); + Invalidate(); + + OpenRCT2::Audio::StopTitleMusic(); + if (gConfigSound.TitleMusic != TitleMusicKind::None) + { + OpenRCT2::Audio::PlayTitleMusic(); + } + break; + } + } + } + + void AudioUpdate() + { + const auto& masterVolumeWidget = widgets[WIDX_MASTER_VOLUME]; + const auto& masterVolumeScroll = scrolls[0]; + uint8_t masterVolume = GetScrollPercentage(masterVolumeWidget, masterVolumeScroll); + if (masterVolume != gConfigSound.MasterVolume) + { + gConfigSound.MasterVolume = masterVolume; ConfigSaveDefault(); - Invalidate(); + InvalidateWidget(WIDX_MASTER_VOLUME); + } - OpenRCT2::Audio::StopTitleMusic(); - if (gConfigSound.TitleMusic != TitleMusicKind::None) - { - OpenRCT2::Audio::PlayTitleMusic(); - } - break; + const auto& soundVolumeWidget = widgets[WIDX_MASTER_VOLUME]; + const auto& soundVolumeScroll = scrolls[1]; + uint8_t soundVolume = GetScrollPercentage(soundVolumeWidget, soundVolumeScroll); + if (soundVolume != gConfigSound.SoundVolume) + { + gConfigSound.SoundVolume = soundVolume; + ConfigSaveDefault(); + InvalidateWidget(WIDX_SOUND_VOLUME); + } + + const auto& musicVolumeWidget = widgets[WIDX_MASTER_VOLUME]; + const auto& musicVolumeScroll = scrolls[2]; + uint8_t rideMusicVolume = GetScrollPercentage(musicVolumeWidget, musicVolumeScroll); + if (rideMusicVolume != gConfigSound.AudioFocus) + { + gConfigSound.AudioFocus = rideMusicVolume; + ConfigSaveDefault(); + InvalidateWidget(WIDX_MUSIC_VOLUME); } } - } - void AudioUpdate() - { - const auto& masterVolumeWidget = widgets[WIDX_MASTER_VOLUME]; - const auto& masterVolumeScroll = scrolls[0]; - uint8_t masterVolume = GetScrollPercentage(masterVolumeWidget, masterVolumeScroll); - if (masterVolume != gConfigSound.MasterVolume) + ScreenSize AudioScrollGetSize(int32_t scrollIndex) { - gConfigSound.MasterVolume = masterVolume; - ConfigSaveDefault(); - InvalidateWidget(WIDX_MASTER_VOLUME); + return { 500, 0 }; } - const auto& soundVolumeWidget = widgets[WIDX_MASTER_VOLUME]; - const auto& soundVolumeScroll = scrolls[1]; - uint8_t soundVolume = GetScrollPercentage(soundVolumeWidget, soundVolumeScroll); - if (soundVolume != gConfigSound.SoundVolume) + StringId GetTitleMusicName() const { - gConfigSound.SoundVolume = soundVolume; - ConfigSaveDefault(); - InvalidateWidget(WIDX_SOUND_VOLUME); + auto theme = std::find_if(std::begin(TitleThemeOptions), std::end(TitleThemeOptions), [](auto&& option) { + return gConfigSound.TitleMusic == option.Kind; + }); + if (theme != std::end(TitleThemeOptions)) + return theme->Name; + return STR_OPENRCT2_DROPDOWN; } - const auto& musicVolumeWidget = widgets[WIDX_MASTER_VOLUME]; - const auto& musicVolumeScroll = scrolls[2]; - uint8_t rideMusicVolume = GetScrollPercentage(musicVolumeWidget, musicVolumeScroll); - if (rideMusicVolume != gConfigSound.AudioFocus) + void AudioPrepareDraw() { - gConfigSound.AudioFocus = rideMusicVolume; - ConfigSaveDefault(); - InvalidateWidget(WIDX_MUSIC_VOLUME); - } - } - - ScreenSize AudioScrollGetSize(int32_t scrollIndex) - { - return { 500, 0 }; - } - - StringId GetTitleMusicName() const - { - auto theme = std::find_if(std::begin(TitleThemeOptions), std::end(TitleThemeOptions), [](auto&& option) { - return gConfigSound.TitleMusic == option.Kind; - }); - if (theme != std::end(TitleThemeOptions)) - return theme->Name; - return STR_OPENRCT2_DROPDOWN; - } - - void AudioPrepareDraw() - { - // Sound device - StringId audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; - const char* audioDeviceName = nullptr; - const int32_t currentDeviceIndex = OpenRCT2::Audio::GetCurrentDeviceIndex(); - if (currentDeviceIndex == -1 || OpenRCT2::Audio::GetDeviceCount() == 0) - { - audioDeviceStringId = STR_SOUND_NONE; - } - else - { - audioDeviceStringId = STR_STRING; + // Sound device + StringId audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; + const char* audioDeviceName = nullptr; + const int32_t currentDeviceIndex = OpenRCT2::Audio::GetCurrentDeviceIndex(); + if (currentDeviceIndex == -1 || OpenRCT2::Audio::GetDeviceCount() == 0) + { + audioDeviceStringId = STR_SOUND_NONE; + } + else + { + audioDeviceStringId = STR_STRING; #ifndef __linux__ - if (currentDeviceIndex == 0) - { - audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; - } + if (currentDeviceIndex == 0) + { + audioDeviceStringId = STR_OPTIONS_SOUND_VALUE_DEFAULT; + } #endif // __linux__ - if (audioDeviceStringId == STR_STRING) + if (audioDeviceStringId == STR_STRING) + { + audioDeviceName = OpenRCT2::Audio::GetDeviceName(currentDeviceIndex).c_str(); + } + } + + widgets[WIDX_SOUND].text = audioDeviceStringId; + auto ft = Formatter::Common(); + ft.Add(audioDeviceName); + + widgets[WIDX_TITLE_MUSIC].text = GetTitleMusicName(); + + SetCheckboxValue(WIDX_SOUND_CHECKBOX, gConfigSound.SoundEnabled); + SetCheckboxValue(WIDX_MASTER_SOUND_CHECKBOX, gConfigSound.MasterSoundEnabled); + SetCheckboxValue(WIDX_MUSIC_CHECKBOX, gConfigSound.RideMusicEnabled); + SetCheckboxValue(WIDX_AUDIO_FOCUS_CHECKBOX, gConfigSound.audio_focus); + WidgetSetEnabled(*this, WIDX_SOUND_CHECKBOX, gConfigSound.MasterSoundEnabled); + WidgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, gConfigSound.MasterSoundEnabled); + + // Initialize only on first frame, otherwise the scrollbars won't be able to be modified + if (frame_no == 0) { - audioDeviceName = OpenRCT2::Audio::GetDeviceName(currentDeviceIndex).c_str(); + InitializeScrollPosition(WIDX_MASTER_VOLUME, 0, gConfigSound.MasterVolume); + InitializeScrollPosition(WIDX_SOUND_VOLUME, 1, gConfigSound.SoundVolume); + InitializeScrollPosition(WIDX_MUSIC_VOLUME, 2, gConfigSound.AudioFocus); } } - widgets[WIDX_SOUND].text = audioDeviceStringId; - auto ft = Formatter::Common(); - ft.Add(audioDeviceName); - - widgets[WIDX_TITLE_MUSIC].text = GetTitleMusicName(); - - SetCheckboxValue(WIDX_SOUND_CHECKBOX, gConfigSound.SoundEnabled); - SetCheckboxValue(WIDX_MASTER_SOUND_CHECKBOX, gConfigSound.MasterSoundEnabled); - SetCheckboxValue(WIDX_MUSIC_CHECKBOX, gConfigSound.RideMusicEnabled); - SetCheckboxValue(WIDX_AUDIO_FOCUS_CHECKBOX, gConfigSound.audio_focus); - WidgetSetEnabled(*this, WIDX_SOUND_CHECKBOX, gConfigSound.MasterSoundEnabled); - WidgetSetEnabled(*this, WIDX_MUSIC_CHECKBOX, gConfigSound.MasterSoundEnabled); - - // Initialize only on first frame, otherwise the scrollbars won't be able to be modified - if (frame_no == 0) - { - InitializeScrollPosition(WIDX_MASTER_VOLUME, 0, gConfigSound.MasterVolume); - InitializeScrollPosition(WIDX_SOUND_VOLUME, 1, gConfigSound.SoundVolume); - InitializeScrollPosition(WIDX_MUSIC_VOLUME, 2, gConfigSound.AudioFocus); - } - } - #pragma endregion #pragma region Controls tab events - void ControlsMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void ControlsMouseUp(WidgetIndex widgetIndex) { - case WIDX_HOTKEY_DROPDOWN: - ContextOpenWindow(WindowClass::KeyboardShortcutList); - break; - case WIDX_SCREEN_EDGE_SCROLLING: - gConfigGeneral.EdgeScrolling ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_TRAP_CURSOR: - gConfigGeneral.TrapCursor ^= 1; - ConfigSaveDefault(); - ContextSetCursorTrap(gConfigGeneral.TrapCursor); - Invalidate(); - break; - case WIDX_ZOOM_TO_CURSOR: - gConfigGeneral.ZoomToCursor ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_TOOLBAR_SHOW_FINANCES: - gConfigInterface.ToolbarShowFinances ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_TOOLBAR_SHOW_RESEARCH: - gConfigInterface.ToolbarShowResearch ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_TOOLBAR_SHOW_CHEATS: - gConfigInterface.ToolbarShowCheats ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_TOOLBAR_SHOW_NEWS: - gConfigInterface.ToolbarShowNews ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_TOOLBAR_SHOW_MUTE: - gConfigInterface.ToolbarShowMute ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_TOOLBAR_SHOW_CHAT: - gConfigInterface.ToolbarShowChat ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_TOOLBAR_SHOW_ZOOM: - gConfigInterface.ToolbarShowZoom ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateByClass(WindowClass::TopToolbar); - break; - case WIDX_WINDOW_BUTTONS_ON_THE_LEFT: - gConfigInterface.WindowButtonsOnTheLeft ^= 1; - ConfigSaveDefault(); - Invalidate(); - WindowInvalidateAll(); - break; - case WIDX_INVERT_DRAG: - gConfigGeneral.InvertViewportDrag ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_THEMES_BUTTON: - ContextOpenWindow(WindowClass::Themes); - Invalidate(); - break; + switch (widgetIndex) + { + case WIDX_HOTKEY_DROPDOWN: + ContextOpenWindow(WindowClass::KeyboardShortcutList); + break; + case WIDX_SCREEN_EDGE_SCROLLING: + gConfigGeneral.EdgeScrolling ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_TRAP_CURSOR: + gConfigGeneral.TrapCursor ^= 1; + ConfigSaveDefault(); + ContextSetCursorTrap(gConfigGeneral.TrapCursor); + Invalidate(); + break; + case WIDX_ZOOM_TO_CURSOR: + gConfigGeneral.ZoomToCursor ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_TOOLBAR_SHOW_FINANCES: + gConfigInterface.ToolbarShowFinances ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_TOOLBAR_SHOW_RESEARCH: + gConfigInterface.ToolbarShowResearch ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_TOOLBAR_SHOW_CHEATS: + gConfigInterface.ToolbarShowCheats ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_TOOLBAR_SHOW_NEWS: + gConfigInterface.ToolbarShowNews ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_TOOLBAR_SHOW_MUTE: + gConfigInterface.ToolbarShowMute ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_TOOLBAR_SHOW_CHAT: + gConfigInterface.ToolbarShowChat ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_TOOLBAR_SHOW_ZOOM: + gConfigInterface.ToolbarShowZoom ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateByClass(WindowClass::TopToolbar); + break; + case WIDX_WINDOW_BUTTONS_ON_THE_LEFT: + gConfigInterface.WindowButtonsOnTheLeft ^= 1; + ConfigSaveDefault(); + Invalidate(); + WindowInvalidateAll(); + break; + case WIDX_INVERT_DRAG: + gConfigGeneral.InvertViewportDrag ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_THEMES_BUTTON: + ContextOpenWindow(WindowClass::Themes); + Invalidate(); + break; + } } - } - void ControlsMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) + void ControlsMouseDown(WidgetIndex widgetIndex) { - case WIDX_THEMES_DROPDOWN: - uint32_t numItems = static_cast(ThemeManagerGetNumAvailableThemes()); + Widget* widget = &widgets[widgetIndex - 1]; - for (size_t i = 0; i < numItems; i++) - { - gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(ThemeManagerGetAvailableThemeName(i)); - } + switch (widgetIndex) + { + case WIDX_THEMES_DROPDOWN: + uint32_t numItems = static_cast(ThemeManagerGetNumAvailableThemes()); - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, numItems, widget->width() - 3); + for (size_t i = 0; i < numItems; i++) + { + gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i].Args = reinterpret_cast(ThemeManagerGetAvailableThemeName(i)); + } - Dropdown::SetChecked(static_cast(ThemeManagerGetAvailableThemeIndex()), true); - InvalidateWidget(WIDX_THEMES_DROPDOWN); - break; + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, numItems, widget->width() - 3); + + Dropdown::SetChecked(static_cast(ThemeManagerGetAvailableThemeIndex()), true); + InvalidateWidget(WIDX_THEMES_DROPDOWN); + break; + } } - } - void ControlsDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) + void ControlsDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) { - case WIDX_THEMES_DROPDOWN: - if (dropdownIndex != -1) - { - ThemeManagerSetActiveAvailableTheme(dropdownIndex); - } - ConfigSaveDefault(); - break; + switch (widgetIndex) + { + case WIDX_THEMES_DROPDOWN: + if (dropdownIndex != -1) + { + ThemeManagerSetActiveAvailableTheme(dropdownIndex); + } + ConfigSaveDefault(); + break; + } } - } - void ControlsPrepareDraw() - { - SetCheckboxValue(WIDX_SCREEN_EDGE_SCROLLING, gConfigGeneral.EdgeScrolling); - SetCheckboxValue(WIDX_TRAP_CURSOR, gConfigGeneral.TrapCursor); - SetCheckboxValue(WIDX_INVERT_DRAG, gConfigGeneral.InvertViewportDrag); - SetCheckboxValue(WIDX_ZOOM_TO_CURSOR, gConfigGeneral.ZoomToCursor); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.ToolbarShowFinances); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.ToolbarShowResearch); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.ToolbarShowCheats); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.ToolbarShowNews); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.ToolbarShowMute); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.ToolbarShowChat); - SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.ToolbarShowZoom); - SetCheckboxValue(WIDX_WINDOW_BUTTONS_ON_THE_LEFT, gConfigInterface.WindowButtonsOnTheLeft); + void ControlsPrepareDraw() + { + SetCheckboxValue(WIDX_SCREEN_EDGE_SCROLLING, gConfigGeneral.EdgeScrolling); + SetCheckboxValue(WIDX_TRAP_CURSOR, gConfigGeneral.TrapCursor); + SetCheckboxValue(WIDX_INVERT_DRAG, gConfigGeneral.InvertViewportDrag); + SetCheckboxValue(WIDX_ZOOM_TO_CURSOR, gConfigGeneral.ZoomToCursor); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_FINANCES, gConfigInterface.ToolbarShowFinances); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_RESEARCH, gConfigInterface.ToolbarShowResearch); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHEATS, gConfigInterface.ToolbarShowCheats); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_NEWS, gConfigInterface.ToolbarShowNews); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.ToolbarShowMute); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.ToolbarShowChat); + SetCheckboxValue(WIDX_TOOLBAR_SHOW_ZOOM, gConfigInterface.ToolbarShowZoom); + SetCheckboxValue(WIDX_WINDOW_BUTTONS_ON_THE_LEFT, gConfigInterface.WindowButtonsOnTheLeft); - size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); - const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); - auto ft = Formatter::Common(); - ft.Add(activeThemeName); - } + size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); + const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); + auto ft = Formatter::Common(); + ft.Add(activeThemeName); + } #pragma endregion #pragma region Misc tab events - void MiscMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void MiscMouseUp(WidgetIndex widgetIndex) { - case WIDX_REAL_NAME_CHECKBOX: - gConfigGeneral.ShowRealNamesOfGuests ^= 1; - ConfigSaveDefault(); - Invalidate(); - PeepUpdateNames(gConfigGeneral.ShowRealNamesOfGuests); - break; - case WIDX_AUTO_STAFF_PLACEMENT: - gConfigGeneral.AutoStaffPlacement ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_SCENARIO_UNLOCKING: - gConfigGeneral.ScenarioUnlockingEnabled ^= 1; - ConfigSaveDefault(); - WindowCloseByClass(WindowClass::ScenarioSelect); - break; - case WIDX_AUTO_OPEN_SHOPS: - gConfigGeneral.AutoOpenShops = !gConfigGeneral.AutoOpenShops; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_ALLOW_EARLY_COMPLETION: - gConfigGeneral.AllowEarlyCompletion ^= 1; - // Only the server can control this setting and needs to send the - // current value of allow_early_completion to all clients - if (NetworkGetMode() == NETWORK_MODE_SERVER) - { - auto setAllowEarlyCompletionAction = ScenarioSetSettingAction( - ScenarioSetSetting::AllowEarlyCompletion, gConfigGeneral.AllowEarlyCompletion); - GameActions::Execute(&setAllowEarlyCompletionAction); - } - ConfigSaveDefault(); - Invalidate(); - break; - } - } - - void MiscMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) - { - case WIDX_TITLE_SEQUENCE_DROPDOWN: + switch (widgetIndex) { - uint32_t numItems = static_cast(TitleSequenceManagerGetCount()); - for (size_t i = 0; i < numItems; i++) - { - gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(TitleSequenceManagerGetName(i)); - } - - gDropdownItems[numItems].Format = 0; - numItems++; - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numItems].Args = STR_TITLE_SEQUENCE_RANDOM; - numItems++; - - WindowDropdownShowText( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], - Dropdown::Flag::StayOpen, numItems); - - auto selectedIndex = gConfigInterface.RandomTitleSequence ? numItems - 1 - : static_cast(TitleGetCurrentSequence()); - Dropdown::SetChecked(selectedIndex, true); - break; - } - case WIDX_SCENARIO_GROUPING_DROPDOWN: - { - uint32_t numItems = 2; - - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_OPTIONS_SCENARIO_DIFFICULTY; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Args = STR_OPTIONS_SCENARIO_ORIGIN; - - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, numItems, widget->width() - 3); - - Dropdown::SetChecked(gConfigGeneral.ScenarioSelectMode, true); - break; - } - case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: - for (size_t i = 0; i < 7; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = RideInspectionIntervalNames[i]; - } - - ShowDropdown(widget, 7); - Dropdown::SetChecked(gConfigGeneral.DefaultInspectionInterval, true); - break; - } - } - - void MiscDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_TITLE_SEQUENCE_DROPDOWN: - { - auto numItems = static_cast(TitleSequenceManagerGetCount()); - if (dropdownIndex < numItems && dropdownIndex != static_cast(TitleGetCurrentSequence())) - { - gConfigInterface.RandomTitleSequence = false; - TitleSequenceChangePreset(static_cast(dropdownIndex)); + case WIDX_REAL_NAME_CHECKBOX: + gConfigGeneral.ShowRealNamesOfGuests ^= 1; ConfigSaveDefault(); Invalidate(); - } - else if (dropdownIndex == numItems + 1) - { - gConfigInterface.RandomTitleSequence = true; + PeepUpdateNames(gConfigGeneral.ShowRealNamesOfGuests); + break; + case WIDX_AUTO_STAFF_PLACEMENT: + gConfigGeneral.AutoStaffPlacement ^= 1; ConfigSaveDefault(); Invalidate(); - } - break; - } - case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: - if (dropdownIndex != gConfigGeneral.DefaultInspectionInterval) - { - gConfigGeneral.DefaultInspectionInterval = static_cast(dropdownIndex); + break; + case WIDX_SCENARIO_UNLOCKING: + gConfigGeneral.ScenarioUnlockingEnabled ^= 1; ConfigSaveDefault(); - Invalidate(); - } - break; - case WIDX_SCENARIO_GROUPING_DROPDOWN: - if (dropdownIndex != gConfigGeneral.ScenarioSelectMode) - { - gConfigGeneral.ScenarioSelectMode = dropdownIndex; - gConfigInterface.ScenarioselectLastTab = 0; - ConfigSaveDefault(); - Invalidate(); WindowCloseByClass(WindowClass::ScenarioSelect); - } - break; - } - } - - void MiscPrepareDraw() - { - auto ft = Formatter::Common(); - if (gConfigInterface.RandomTitleSequence) - { - ft.Add(STR_TITLE_SEQUENCE_RANDOM); - } - else - { - auto name = TitleSequenceManagerGetName(TitleGetConfigSequence()); - ft.Add(STR_STRING); - ft.Add(name); - } - - // The real name setting of clients is fixed to that of the server - // and the server cannot change the setting during gameplay to prevent desyncs - if (NetworkGetMode() != NETWORK_MODE_NONE) - { - disabled_widgets |= (1uLL << WIDX_REAL_NAME_CHECKBOX); - widgets[WIDX_REAL_NAME_CHECKBOX].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; - // Disable the use of the allow_early_completion option during network play on clients. - // This is to prevent confusion on clients because changing this setting during network play wouldn't change - // the way scenarios are completed during this network-session - if (NetworkGetMode() == NETWORK_MODE_CLIENT) - { - disabled_widgets |= (1uLL << WIDX_ALLOW_EARLY_COMPLETION); - widgets[WIDX_ALLOW_EARLY_COMPLETION].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; + break; + case WIDX_AUTO_OPEN_SHOPS: + gConfigGeneral.AutoOpenShops = !gConfigGeneral.AutoOpenShops; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_ALLOW_EARLY_COMPLETION: + gConfigGeneral.AllowEarlyCompletion ^= 1; + // Only the server can control this setting and needs to send the + // current value of allow_early_completion to all clients + if (NetworkGetMode() == NETWORK_MODE_SERVER) + { + auto setAllowEarlyCompletionAction = ScenarioSetSettingAction( + ScenarioSetSetting::AllowEarlyCompletion, gConfigGeneral.AllowEarlyCompletion); + GameActions::Execute(&setAllowEarlyCompletionAction); + } + ConfigSaveDefault(); + Invalidate(); + break; } } - SetCheckboxValue(WIDX_REAL_NAME_CHECKBOX, gConfigGeneral.ShowRealNamesOfGuests); - SetCheckboxValue(WIDX_AUTO_STAFF_PLACEMENT, gConfigGeneral.AutoStaffPlacement); - SetCheckboxValue(WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.AutoOpenShops); - SetCheckboxValue(WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.AllowEarlyCompletion); - - if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_DIFFICULTY) - widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_DIFFICULTY; - else - widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_ORIGIN; - - SetCheckboxValue(WIDX_SCENARIO_UNLOCKING, gConfigGeneral.ScenarioUnlockingEnabled); - - if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) + void MiscMouseDown(WidgetIndex widgetIndex) { - disabled_widgets &= ~(1uLL << WIDX_SCENARIO_UNLOCKING); - } - else - { - disabled_widgets |= (1uLL << WIDX_SCENARIO_UNLOCKING); + Widget* widget = &widgets[widgetIndex - 1]; + + switch (widgetIndex) + { + case WIDX_TITLE_SEQUENCE_DROPDOWN: + { + uint32_t numItems = static_cast(TitleSequenceManagerGetCount()); + for (size_t i = 0; i < numItems; i++) + { + gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i].Args = reinterpret_cast(TitleSequenceManagerGetName(i)); + } + + gDropdownItems[numItems].Format = 0; + numItems++; + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numItems].Args = STR_TITLE_SEQUENCE_RANDOM; + numItems++; + + WindowDropdownShowText( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], + Dropdown::Flag::StayOpen, numItems); + + auto selectedIndex = gConfigInterface.RandomTitleSequence ? numItems - 1 + : static_cast(TitleGetCurrentSequence()); + Dropdown::SetChecked(selectedIndex, true); + break; + } + case WIDX_SCENARIO_GROUPING_DROPDOWN: + { + uint32_t numItems = 2; + + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_OPTIONS_SCENARIO_DIFFICULTY; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Args = STR_OPTIONS_SCENARIO_ORIGIN; + + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, numItems, widget->width() - 3); + + Dropdown::SetChecked(gConfigGeneral.ScenarioSelectMode, true); + break; + } + case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: + for (size_t i = 0; i < 7; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = RideInspectionIntervalNames[i]; + } + + ShowDropdown(widget, 7); + Dropdown::SetChecked(gConfigGeneral.DefaultInspectionInterval, true); + break; + } } - widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[gConfigGeneral.DefaultInspectionInterval]; - } + void MiscDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_TITLE_SEQUENCE_DROPDOWN: + { + auto numItems = static_cast(TitleSequenceManagerGetCount()); + if (dropdownIndex < numItems && dropdownIndex != static_cast(TitleGetCurrentSequence())) + { + gConfigInterface.RandomTitleSequence = false; + TitleSequenceChangePreset(static_cast(dropdownIndex)); + ConfigSaveDefault(); + Invalidate(); + } + else if (dropdownIndex == numItems + 1) + { + gConfigInterface.RandomTitleSequence = true; + ConfigSaveDefault(); + Invalidate(); + } + break; + } + case WIDX_DEFAULT_INSPECTION_INTERVAL_DROPDOWN: + if (dropdownIndex != gConfigGeneral.DefaultInspectionInterval) + { + gConfigGeneral.DefaultInspectionInterval = static_cast(dropdownIndex); + ConfigSaveDefault(); + Invalidate(); + } + break; + case WIDX_SCENARIO_GROUPING_DROPDOWN: + if (dropdownIndex != gConfigGeneral.ScenarioSelectMode) + { + gConfigGeneral.ScenarioSelectMode = dropdownIndex; + gConfigInterface.ScenarioselectLastTab = 0; + ConfigSaveDefault(); + Invalidate(); + WindowCloseByClass(WindowClass::ScenarioSelect); + } + break; + } + } + + void MiscPrepareDraw() + { + auto ft = Formatter::Common(); + if (gConfigInterface.RandomTitleSequence) + { + ft.Add(STR_TITLE_SEQUENCE_RANDOM); + } + else + { + auto name = TitleSequenceManagerGetName(TitleGetConfigSequence()); + ft.Add(STR_STRING); + ft.Add(name); + } + + // The real name setting of clients is fixed to that of the server + // and the server cannot change the setting during gameplay to prevent desyncs + if (NetworkGetMode() != NETWORK_MODE_NONE) + { + disabled_widgets |= (1uLL << WIDX_REAL_NAME_CHECKBOX); + widgets[WIDX_REAL_NAME_CHECKBOX].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; + // Disable the use of the allow_early_completion option during network play on clients. + // This is to prevent confusion on clients because changing this setting during network play wouldn't change + // the way scenarios are completed during this network-session + if (NetworkGetMode() == NETWORK_MODE_CLIENT) + { + disabled_widgets |= (1uLL << WIDX_ALLOW_EARLY_COMPLETION); + widgets[WIDX_ALLOW_EARLY_COMPLETION].tooltip = STR_OPTION_DISABLED_DURING_NETWORK_PLAY; + } + } + + SetCheckboxValue(WIDX_REAL_NAME_CHECKBOX, gConfigGeneral.ShowRealNamesOfGuests); + SetCheckboxValue(WIDX_AUTO_STAFF_PLACEMENT, gConfigGeneral.AutoStaffPlacement); + SetCheckboxValue(WIDX_AUTO_OPEN_SHOPS, gConfigGeneral.AutoOpenShops); + SetCheckboxValue(WIDX_ALLOW_EARLY_COMPLETION, gConfigGeneral.AllowEarlyCompletion); + + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_DIFFICULTY) + widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_DIFFICULTY; + else + widgets[WIDX_SCENARIO_GROUPING].text = STR_OPTIONS_SCENARIO_ORIGIN; + + SetCheckboxValue(WIDX_SCENARIO_UNLOCKING, gConfigGeneral.ScenarioUnlockingEnabled); + + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) + { + disabled_widgets &= ~(1uLL << WIDX_SCENARIO_UNLOCKING); + } + else + { + disabled_widgets |= (1uLL << WIDX_SCENARIO_UNLOCKING); + } + + widgets[WIDX_DEFAULT_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[gConfigGeneral + .DefaultInspectionInterval]; + } #pragma endregion #pragma region Advanced tab events - void AdvancedMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void AdvancedMouseUp(WidgetIndex widgetIndex) { - case WIDX_DEBUGGING_TOOLS: - gConfigGeneral.DebuggingTools ^= 1; - ConfigSaveDefault(); - GfxInvalidateScreen(); - break; - case WIDX_SAVE_PLUGIN_DATA_CHECKBOX: - gConfigGeneral.SavePluginData ^= 1; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_STAY_CONNECTED_AFTER_DESYNC: - gConfigNetwork.StayConnected = !gConfigNetwork.StayConnected; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_ALWAYS_NATIVE_LOADSAVE: - gConfigGeneral.UseNativeBrowseDialog = !gConfigGeneral.UseNativeBrowseDialog; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_PATH_TO_RCT1_BUTTON: + switch (widgetIndex) { - auto rct1path = OpenRCT2::GetContext()->GetUiContext()->ShowDirectoryDialog( - LanguageGetString(STR_PATH_TO_RCT1_BROWSER)); - if (!rct1path.empty()) + case WIDX_DEBUGGING_TOOLS: + gConfigGeneral.DebuggingTools ^= 1; + ConfigSaveDefault(); + GfxInvalidateScreen(); + break; + case WIDX_SAVE_PLUGIN_DATA_CHECKBOX: + gConfigGeneral.SavePluginData ^= 1; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_STAY_CONNECTED_AFTER_DESYNC: + gConfigNetwork.StayConnected = !gConfigNetwork.StayConnected; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_ALWAYS_NATIVE_LOADSAVE: + gConfigGeneral.UseNativeBrowseDialog = !gConfigGeneral.UseNativeBrowseDialog; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_PATH_TO_RCT1_BUTTON: { - // Check if this directory actually contains RCT1 - if (Csg1datPresentAtLocation(rct1path)) + auto rct1path = OpenRCT2::GetContext()->GetUiContext()->ShowDirectoryDialog( + LanguageGetString(STR_PATH_TO_RCT1_BROWSER)); + if (!rct1path.empty()) { - if (Csg1idatPresentAtLocation(rct1path)) + // Check if this directory actually contains RCT1 + if (Csg1datPresentAtLocation(rct1path)) { - if (CsgAtLocationIsUsable(rct1path)) + if (Csg1idatPresentAtLocation(rct1path)) { - gConfigGeneral.RCT1Path = std::move(rct1path); - gConfigInterface.ScenarioselectLastTab = 0; - ConfigSaveDefault(); - ContextShowError(STR_RESTART_REQUIRED, STR_NONE, {}); + if (CsgAtLocationIsUsable(rct1path)) + { + gConfigGeneral.RCT1Path = std::move(rct1path); + gConfigInterface.ScenarioselectLastTab = 0; + ConfigSaveDefault(); + ContextShowError(STR_RESTART_REQUIRED, STR_NONE, {}); + } + else + { + ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + } } else { - ContextShowError(STR_PATH_TO_RCT1_IS_WRONG_VERSION, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); } } else { - ContextShowError(STR_PATH_TO_RCT1_DOES_NOT_CONTAIN_CSG1I_DAT, STR_NONE, {}); + ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); } } - else + Invalidate(); + break; + } + case WIDX_PATH_TO_RCT1_CLEAR: + if (!gConfigGeneral.RCT1Path.empty()) { - ContextShowError(STR_PATH_TO_RCT1_WRONG_ERROR, STR_NONE, {}); + gConfigGeneral.RCT1Path.clear(); + ConfigSaveDefault(); } - } - Invalidate(); - break; + Invalidate(); + break; + case WIDX_ASSET_PACKS: + ContextOpenWindow(WindowClass::AssetPacks); + break; } - case WIDX_PATH_TO_RCT1_CLEAR: - if (!gConfigGeneral.RCT1Path.empty()) - { - gConfigGeneral.RCT1Path.clear(); - ConfigSaveDefault(); - } - Invalidate(); - break; - case WIDX_ASSET_PACKS: - ContextOpenWindow(WindowClass::AssetPacks); - break; } - } - void AdvancedMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex - 1]; - - switch (widgetIndex) + void AdvancedMouseDown(WidgetIndex widgetIndex) { - case WIDX_AUTOSAVE_FREQUENCY_DROPDOWN: - for (size_t i = AUTOSAVE_EVERY_MINUTE; i <= AUTOSAVE_NEVER; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = AutosaveNames[i]; - } + Widget* widget = &widgets[widgetIndex - 1]; - ShowDropdown(widget, AUTOSAVE_NEVER + 1); - Dropdown::SetChecked(gConfigGeneral.AutosaveFrequency, true); - break; - case WIDX_AUTOSAVE_AMOUNT_UP: - gConfigGeneral.AutosaveAmount += 1; - ConfigSaveDefault(); - InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY); - InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); - InvalidateWidget(WIDX_AUTOSAVE_AMOUNT); - break; - case WIDX_AUTOSAVE_AMOUNT_DOWN: - if (gConfigGeneral.AutosaveAmount > 1) - { - gConfigGeneral.AutosaveAmount -= 1; + switch (widgetIndex) + { + case WIDX_AUTOSAVE_FREQUENCY_DROPDOWN: + for (size_t i = AUTOSAVE_EVERY_MINUTE; i <= AUTOSAVE_NEVER; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = AutosaveNames[i]; + } + + ShowDropdown(widget, AUTOSAVE_NEVER + 1); + Dropdown::SetChecked(gConfigGeneral.AutosaveFrequency, true); + break; + case WIDX_AUTOSAVE_AMOUNT_UP: + gConfigGeneral.AutosaveAmount += 1; ConfigSaveDefault(); InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY); InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); InvalidateWidget(WIDX_AUTOSAVE_AMOUNT); - } - } - } - - void AdvancedDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_AUTOSAVE_FREQUENCY_DROPDOWN: - if (dropdownIndex != gConfigGeneral.AutosaveFrequency) - { - gConfigGeneral.AutosaveFrequency = static_cast(dropdownIndex); - ConfigSaveDefault(); - Invalidate(); - } - break; - } - } - - void AdvancedPrepareDraw() - { - SetCheckboxValue(WIDX_DEBUGGING_TOOLS, gConfigGeneral.DebuggingTools); - SetCheckboxValue(WIDX_SAVE_PLUGIN_DATA_CHECKBOX, gConfigGeneral.SavePluginData); - SetCheckboxValue(WIDX_STAY_CONNECTED_AFTER_DESYNC, gConfigNetwork.StayConnected); - SetCheckboxValue(WIDX_ALWAYS_NATIVE_LOADSAVE, gConfigGeneral.UseNativeBrowseDialog); - widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[gConfigGeneral.AutosaveFrequency]; - } - - void AdvancedDraw(DrawPixelInfo& dpi) - { - auto ft = Formatter(); - ft.Add(static_cast(gConfigGeneral.AutosaveAmount)); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, - STR_WINDOW_COLOUR_2_COMMA16, ft, { colours[1] }); - - const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.RCT1Path); - ft = Formatter(); - ft.Add(normalisedPath.c_str()); - - Widget pathWidget = widgets[WIDX_PATH_TO_RCT1_BUTTON]; - - // Apply vertical alignment if appropriate. - int32_t widgetHeight = pathWidget.bottom - pathWidget.top; - int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); - uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0; - ScreenCoordsXY screenCoords = { windowPos.x + pathWidget.left + 1, - windowPos.y + pathWidget.top + static_cast(padding) }; - DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { colours[1] }); - } - - OpenRCT2String AdvancedTooltip(WidgetIndex widgetIndex, StringId fallback) - { - if (widgetIndex == WIDX_PATH_TO_RCT1_BUTTON) - { - if (gConfigGeneral.RCT1Path.empty()) - { - // No tooltip if the path is empty - return { STR_NONE, {} }; + break; + case WIDX_AUTOSAVE_AMOUNT_DOWN: + if (gConfigGeneral.AutosaveAmount > 1) + { + gConfigGeneral.AutosaveAmount -= 1; + ConfigSaveDefault(); + InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY); + InvalidateWidget(WIDX_AUTOSAVE_FREQUENCY_DROPDOWN); + InvalidateWidget(WIDX_AUTOSAVE_AMOUNT); + } } - - auto ft = Formatter(); - ft.Add(gConfigGeneral.RCT1Path.c_str()); - return { fallback, ft }; } - return { fallback, {} }; - } + + void AdvancedDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_AUTOSAVE_FREQUENCY_DROPDOWN: + if (dropdownIndex != gConfigGeneral.AutosaveFrequency) + { + gConfigGeneral.AutosaveFrequency = static_cast(dropdownIndex); + ConfigSaveDefault(); + Invalidate(); + } + break; + } + } + + void AdvancedPrepareDraw() + { + SetCheckboxValue(WIDX_DEBUGGING_TOOLS, gConfigGeneral.DebuggingTools); + SetCheckboxValue(WIDX_SAVE_PLUGIN_DATA_CHECKBOX, gConfigGeneral.SavePluginData); + SetCheckboxValue(WIDX_STAY_CONNECTED_AFTER_DESYNC, gConfigNetwork.StayConnected); + SetCheckboxValue(WIDX_ALWAYS_NATIVE_LOADSAVE, gConfigGeneral.UseNativeBrowseDialog); + widgets[WIDX_AUTOSAVE_FREQUENCY].text = AutosaveNames[gConfigGeneral.AutosaveFrequency]; + } + + void AdvancedDraw(DrawPixelInfo& dpi) + { + auto ft = Formatter(); + ft.Add(static_cast(gConfigGeneral.AutosaveAmount)); + DrawTextBasic( + dpi, + windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, + STR_WINDOW_COLOUR_2_COMMA16, ft, { colours[1] }); + + const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.RCT1Path); + ft = Formatter(); + ft.Add(normalisedPath.c_str()); + + Widget pathWidget = widgets[WIDX_PATH_TO_RCT1_BUTTON]; + + // Apply vertical alignment if appropriate. + int32_t widgetHeight = pathWidget.bottom - pathWidget.top; + int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); + uint32_t padding = widgetHeight > lineHeight ? (widgetHeight - lineHeight) / 2 : 0; + ScreenCoordsXY screenCoords = { windowPos.x + pathWidget.left + 1, + windowPos.y + pathWidget.top + static_cast(padding) }; + DrawTextEllipsised(dpi, screenCoords, 277, STR_STRING, ft, { colours[1] }); + } + + OpenRCT2String AdvancedTooltip(WidgetIndex widgetIndex, StringId fallback) + { + if (widgetIndex == WIDX_PATH_TO_RCT1_BUTTON) + { + if (gConfigGeneral.RCT1Path.empty()) + { + // No tooltip if the path is empty + return { STR_NONE, {} }; + } + + auto ft = Formatter(); + ft.Add(gConfigGeneral.RCT1Path.c_str()); + return { fallback, ft }; + } + return { fallback, {} }; + } #pragma endregion - void SetPage(int32_t p) - { - page = p; - frame_no = 0; - pressed_widgets = 0; - widgets = window_options_page_widgets[page]; - - Invalidate(); - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - Invalidate(); - } - - void SetPressedTab() - { - for (int32_t i = 0; i < WINDOW_OPTIONS_PAGE_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_FIRST_TAB + i)); - pressed_widgets |= 1LL << (WIDX_FIRST_TAB + page); - } - - void ShowDropdown(Widget* widget, int32_t num_items) - { - // helper function, all dropdown boxes have similar properties - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, num_items, widget->width() - 3); - } - - void DrawTabImages(DrawPixelInfo& dpi) - { - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_DISPLAY, SPR_TAB_PAINT_0); - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_RENDERING, SPR_G2_TAB_TREE); - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_CULTURE, SPR_TAB_TIMER_0); - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_AUDIO, SPR_TAB_MUSIC_0); - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, SPR_TAB_GEARS_0); - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_MISC, SPR_TAB_RIDE_0); - DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_ADVANCED, SPR_TAB_WRENCH_0); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_FIRST_TAB + p; - Widget* widget = &widgets[widgetIndex]; - - auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; - - if (!WidgetIsDisabled(*this, widgetIndex)) + void SetPage(int32_t p) { - if (page == p) + page = p; + frame_no = 0; + pressed_widgets = 0; + widgets = window_options_page_widgets[page]; + + Invalidate(); + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + Invalidate(); + } + + void SetPressedTab() + { + for (int32_t i = 0; i < WINDOW_OPTIONS_PAGE_COUNT; i++) + pressed_widgets &= ~(1 << (WIDX_FIRST_TAB + i)); + pressed_widgets |= 1LL << (WIDX_FIRST_TAB + page); + } + + void ShowDropdown(Widget* widget, int32_t num_items) + { + // helper function, all dropdown boxes have similar properties + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, num_items, widget->width() - 3); + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_DISPLAY, SPR_TAB_PAINT_0); + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_RENDERING, SPR_G2_TAB_TREE); + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_CULTURE, SPR_TAB_TIMER_0); + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_AUDIO, SPR_TAB_MUSIC_0); + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, SPR_TAB_GEARS_0); + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_MISC, SPR_TAB_RIDE_0); + DrawTabImage(dpi, WINDOW_OPTIONS_PAGE_ADVANCED, SPR_TAB_WRENCH_0); + } + + void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_FIRST_TAB + p; + Widget* widget = &widgets[widgetIndex]; + + auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; + + if (!WidgetIsDisabled(*this, widgetIndex)) { - int32_t frame = frame_no / TabAnimationDivisor[page]; - spriteIndex += (frame % TabAnimationFrames[page]); + if (page == p) + { + int32_t frame = frame_no / TabAnimationDivisor[page]; + spriteIndex += (frame % TabAnimationFrames[page]); + } + + // Draw normal, enabled sprite. + GfxDrawSprite(dpi, ImageId(spriteIndex), screenCoords); } + else + { + // Get the window background colour + uint8_t window_colour = NOT_TRANSLUCENT(colours[widget->colour]); - // Draw normal, enabled sprite. - GfxDrawSprite(dpi, ImageId(spriteIndex), screenCoords); + // Draw greyed out (light border bottom right shadow) + GfxDrawSpriteSolid( + &dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter); + + // Draw greyed out (dark) + GfxDrawSpriteSolid(&dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light); + } } - else + + void UpdateHeightMarkers() { - // Get the window background colour - uint8_t window_colour = NOT_TRANSLUCENT(colours[widget->colour]); - - // Draw greyed out (light border bottom right shadow) - GfxDrawSpriteSolid( - &dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter); - - // Draw greyed out (dark) - GfxDrawSpriteSolid(&dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light); + ConfigSaveDefault(); + GfxInvalidateScreen(); } - } - void UpdateHeightMarkers() - { - ConfigSaveDefault(); - GfxInvalidateScreen(); - } + uint8_t GetScrollPercentage(const Widget& widget, const ScrollBar& scroll) + { + uint8_t w = widget.width() - 1; + return static_cast(scroll.h_left) / (scroll.h_right - w) * 100; + } - uint8_t GetScrollPercentage(const Widget& widget, const ScrollBar& scroll) - { - uint8_t w = widget.width() - 1; - return static_cast(scroll.h_left) / (scroll.h_right - w) * 100; - } + void InitializeScrollPosition(WidgetIndex widgetIndex, int32_t scrollId, uint8_t volume) + { + const auto& widget = widgets[widgetIndex]; + auto& scroll = scrolls[scrollId]; - void InitializeScrollPosition(WidgetIndex widgetIndex, int32_t scrollId, uint8_t volume) - { - const auto& widget = widgets[widgetIndex]; - auto& scroll = scrolls[scrollId]; + int32_t widgetSize = scroll.h_right - (widget.width() - 1); + scroll.h_left = ceil(volume / 100.0f * widgetSize); - int32_t widgetSize = scroll.h_right - (widget.width() - 1); - scroll.h_left = ceil(volume / 100.0f * widgetSize); + WidgetScrollUpdateThumbs(*this, widgetIndex); + } - WidgetScrollUpdateThumbs(*this, widgetIndex); - } + static bool IsRCT1TitleMusicAvailable() + { + auto env = GetContext()->GetPlatformEnvironment(); + auto rct1path = env->GetDirectoryPath(DIRBASE::RCT1); + return !rct1path.empty(); + } - static bool IsRCT1TitleMusicAvailable() - { - auto env = GetContext()->GetPlatformEnvironment(); - auto rct1path = env->GetDirectoryPath(DIRBASE::RCT1); - return !rct1path.empty(); - } + static constexpr StringId AutosaveNames[] = { + STR_SAVE_EVERY_MINUTE, STR_SAVE_EVERY_5MINUTES, STR_SAVE_EVERY_15MINUTES, + STR_SAVE_EVERY_30MINUTES, STR_SAVE_EVERY_HOUR, STR_SAVE_NEVER, + }; - static constexpr StringId AutosaveNames[] = { - STR_SAVE_EVERY_MINUTE, STR_SAVE_EVERY_5MINUTES, STR_SAVE_EVERY_15MINUTES, - STR_SAVE_EVERY_30MINUTES, STR_SAVE_EVERY_HOUR, STR_SAVE_NEVER, + static constexpr struct + { + TitleMusicKind Kind; + StringId Name; + } TitleThemeOptions[] = { + { TitleMusicKind::None, STR_OPTIONS_MUSIC_VALUE_NONE }, + { TitleMusicKind::OpenRCT2, STR_OPENRCT2_DROPDOWN }, + { TitleMusicKind::RCT1, STR_ROLLERCOASTER_TYCOON_1_DROPDOWN }, + { TitleMusicKind::RCT2, STR_ROLLERCOASTER_TYCOON_2_DROPDOWN }, + { TitleMusicKind::Random, STR_OPTIONS_MUSIC_VALUE_RANDOM }, + }; + + static constexpr StringId FullscreenModeNames[] = { + STR_OPTIONS_DISPLAY_WINDOWED, + STR_OPTIONS_DISPLAY_FULLSCREEN, + STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS, + }; + + static constexpr int32_t TabAnimationDivisor[] = { + 4, // WINDOW_OPTIONS_PAGE_DISPLAY, + 1, // WINDOW_OPTIONS_PAGE_RENDERING, + 8, // WINDOW_OPTIONS_PAGE_CULTURE, + 2, // WINDOW_OPTIONS_PAGE_AUDIO, + 2, // WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, + 4, // WINDOW_OPTIONS_PAGE_MISC, + 2, // WINDOW_OPTIONS_PAGE_ADVANCED, + }; + + static constexpr int32_t TabAnimationFrames[] = { + 8, // WINDOW_OPTIONS_PAGE_DISPLAY, + 1, // WINDOW_OPTIONS_PAGE_RENDERING, + 8, // WINDOW_OPTIONS_PAGE_CULTURE, + 16, // WINDOW_OPTIONS_PAGE_AUDIO, + 4, // WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, + 16, // WINDOW_OPTIONS_PAGE_MISC, + 16, // WINDOW_OPTIONS_PAGE_ADVANCED, + }; }; - static constexpr struct + /** + * + * rct2: 0x006BAC5B + */ + WindowBase* WindowOptionsOpen() { - TitleMusicKind Kind; - StringId Name; - } TitleThemeOptions[] = { - { TitleMusicKind::None, STR_OPTIONS_MUSIC_VALUE_NONE }, - { TitleMusicKind::OpenRCT2, STR_OPENRCT2_DROPDOWN }, - { TitleMusicKind::RCT1, STR_ROLLERCOASTER_TYCOON_1_DROPDOWN }, - { TitleMusicKind::RCT2, STR_ROLLERCOASTER_TYCOON_2_DROPDOWN }, - { TitleMusicKind::Random, STR_OPTIONS_MUSIC_VALUE_RANDOM }, - }; - - static constexpr StringId FullscreenModeNames[] = { - STR_OPTIONS_DISPLAY_WINDOWED, - STR_OPTIONS_DISPLAY_FULLSCREEN, - STR_OPTIONS_DISPLAY_FULLSCREEN_BORDERLESS, - }; - - static constexpr int32_t TabAnimationDivisor[] = { - 4, // WINDOW_OPTIONS_PAGE_DISPLAY, - 1, // WINDOW_OPTIONS_PAGE_RENDERING, - 8, // WINDOW_OPTIONS_PAGE_CULTURE, - 2, // WINDOW_OPTIONS_PAGE_AUDIO, - 2, // WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, - 4, // WINDOW_OPTIONS_PAGE_MISC, - 2, // WINDOW_OPTIONS_PAGE_ADVANCED, - }; - - static constexpr int32_t TabAnimationFrames[] = { - 8, // WINDOW_OPTIONS_PAGE_DISPLAY, - 1, // WINDOW_OPTIONS_PAGE_RENDERING, - 8, // WINDOW_OPTIONS_PAGE_CULTURE, - 16, // WINDOW_OPTIONS_PAGE_AUDIO, - 4, // WINDOW_OPTIONS_PAGE_CONTROLS_AND_INTERFACE, - 16, // WINDOW_OPTIONS_PAGE_MISC, - 16, // WINDOW_OPTIONS_PAGE_ADVANCED, - }; -}; - -/** - * - * rct2: 0x006BAC5B - */ -WindowBase* WindowOptionsOpen() -{ - return WindowFocusOrCreate(WindowClass::Options, WW, WH, WF_CENTRE_SCREEN); -} + return WindowFocusOrCreate(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 c5eaf575d7..9b2b894dee 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -35,12 +35,12 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_STRINGID; + static constexpr int32_t WH = 224; -static constexpr StringId WINDOW_TITLE = STR_STRINGID; -static constexpr int32_t WH = 224; - -// clang-format off + // clang-format off enum WindowParkPage { WINDOW_PARK_PAGE_ENTRANCE, WINDOW_PARK_PAGE_RATING, @@ -188,328 +188,218 @@ static constexpr WindowParkAward _parkAwards[] = { { STR_AWARD_MOST_CONFUSING_LAYOUT, SPR_AWARD_MOST_CONFUSING_LAYOUT }, { STR_AWARD_BEST_GENTLE_RIDES, SPR_AWARD_BEST_GENTLE_RIDES }, }; -// clang-format on + // clang-format on -class ParkWindow final : public Window -{ - int32_t _numberOfStaff = -1; - int32_t _numberOfRides = -1; - uint8_t _peepAnimationFrame = 0; - -public: - void OnOpen() override + class ParkWindow final : public Window { - number = 0; - frame_no = 0; - _numberOfRides = -1; - _numberOfStaff = -1; - _peepAnimationFrame = 0; - SetPage(0); - } + int32_t _numberOfStaff = -1; + int32_t _numberOfRides = -1; + uint8_t _peepAnimationFrame = 0; - void OnClose() override - { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && classification == gCurrentToolWidget.window_classification - && number == gCurrentToolWidget.window_number) + public: + void OnOpen() override { - ToolCancel(); + number = 0; + frame_no = 0; + _numberOfRides = -1; + _numberOfStaff = -1; + _peepAnimationFrame = 0; + SetPage(0); } - } - void OnMouseUp(WidgetIndex idx) override - { - switch (idx) + void OnClose() override { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - SetPage(idx - WIDX_TAB_1); - return; - } - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnMouseUpEntrance(idx); - break; - case WINDOW_PARK_PAGE_OBJECTIVE: - OnMouseUpObjective(idx); - break; - } - } - - void OnResize() override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnResizeEntrance(); - break; - case WINDOW_PARK_PAGE_RATING: - OnResizeRating(); - break; - case WINDOW_PARK_PAGE_GUESTS: - OnResizeGuests(); - break; - case WINDOW_PARK_PAGE_PRICE: - OnResizePrice(); - break; - case WINDOW_PARK_PAGE_STATS: - OnResizeStats(); - break; - case WINDOW_PARK_PAGE_OBJECTIVE: - OnResizeObjective(); - break; - case WINDOW_PARK_PAGE_AWARDS: - OnResizeAwards(); - break; - } - } - - void OnMouseDown(WidgetIndex idx) override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnMouseDownEntrance(idx); - break; - case WINDOW_PARK_PAGE_PRICE: - OnMouseDownPrice(idx); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnDropdownEntrance(widgetIndex, selectedIndex); - break; - } - } - - void OnUpdate() override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnUpdateEntrance(); - break; - case WINDOW_PARK_PAGE_RATING: - OnUpdateRating(); - break; - case WINDOW_PARK_PAGE_GUESTS: - OnUpdateGuests(); - break; - case WINDOW_PARK_PAGE_PRICE: - OnUpdatePrice(); - break; - case WINDOW_PARK_PAGE_STATS: - OnUpdateStats(); - break; - case WINDOW_PARK_PAGE_OBJECTIVE: - OnUpdateObjective(); - break; - case WINDOW_PARK_PAGE_AWARDS: - OnUpdateAwards(); - break; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnTextInputEntrance(widgetIndex, text); - break; - case WINDOW_PARK_PAGE_OBJECTIVE: - OnTextInputObjective(widgetIndex, text); - break; - } - } - - void OnPrepareDraw() override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnPrepareDrawEntrance(); - break; - case WINDOW_PARK_PAGE_RATING: - OnPrepareDrawRating(); - break; - case WINDOW_PARK_PAGE_GUESTS: - OnPrepareDrawGuests(); - break; - case WINDOW_PARK_PAGE_PRICE: - OnPrepareDrawPrice(); - break; - case WINDOW_PARK_PAGE_STATS: - OnPrepareDrawStats(); - break; - case WINDOW_PARK_PAGE_OBJECTIVE: - OnPrepareDrawObjective(); - break; - case WINDOW_PARK_PAGE_AWARDS: - OnPrepareDrawAwards(); - break; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_PARK_PAGE_ENTRANCE: - OnDrawEntrance(dpi); - break; - case WINDOW_PARK_PAGE_RATING: - OnDrawRating(dpi); - break; - case WINDOW_PARK_PAGE_GUESTS: - OnDrawGuests(dpi); - break; - case WINDOW_PARK_PAGE_PRICE: - OnDrawPrice(dpi); - break; - case WINDOW_PARK_PAGE_STATS: - OnDrawStats(dpi); - break; - case WINDOW_PARK_PAGE_OBJECTIVE: - OnDrawObjective(dpi); - break; - case WINDOW_PARK_PAGE_AWARDS: - OnDrawAwards(dpi); - break; - } - } - -private: - void SetDisabledTabs() - { - // Disable price tab if money is disabled - disabled_widgets = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0; - } - - void PrepareWindowTitleText() - { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - auto parkName = park.Name.c_str(); - - auto ft = Formatter::Common(); - ft.Add(STR_STRING); - ft.Add(parkName); - } - -#pragma region Entrance page - void OnMouseUpEntrance(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_BUY_LAND_RIGHTS: - ContextOpenWindow(WindowClass::LandRights); - break; - case WIDX_LOCATE: - ScrollToViewport(); - break; - case WIDX_RENAME: + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && classification == gCurrentToolWidget.window_classification + && number == gCurrentToolWidget.window_number) { - auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); - WindowTextInputRawOpen( - this, WIDX_RENAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), USER_STRING_MAX_LENGTH); - break; - } - case WIDX_CLOSE_LIGHT: - ParkSetOpen(false); - break; - case WIDX_OPEN_LIGHT: - ParkSetOpen(true); - break; - } - } - - void OnResizeEntrance() - { - flags |= WF_RESIZABLE; - WindowSetResize(*this, 230, 174 + 9, 230 * 3, (274 + 9) * 3); - InitViewport(); - } - - void OnMouseDownEntrance(WidgetIndex widgetIndex) - { - if (widgetIndex == WIDX_OPEN_OR_CLOSE) - { - auto& widget = widgets[widgetIndex]; - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_CLOSE_PARK; - gDropdownItems[1].Args = STR_OPEN_PARK; - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2); - - if (ParkIsOpen()) - { - gDropdownDefaultIndex = 0; - Dropdown::SetChecked(1, true); - } - else - { - gDropdownDefaultIndex = 1; - Dropdown::SetChecked(0, true); + ToolCancel(); } } - } - void OnDropdownEntrance(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (widgetIndex == WIDX_OPEN_OR_CLOSE) + void OnMouseUp(WidgetIndex idx) override { - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - if (dropdownIndex != 0) + switch (idx) { - ParkSetOpen(true); + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + SetPage(idx - WIDX_TAB_1); + return; } - else + switch (page) { - ParkSetOpen(false); + case WINDOW_PARK_PAGE_ENTRANCE: + OnMouseUpEntrance(idx); + break; + case WINDOW_PARK_PAGE_OBJECTIVE: + OnMouseUpObjective(idx); + break; } } - } - void OnUpdateEntrance() - { - frame_no++; - WidgetInvalidate(*this, WIDX_TAB_1); - } - - void OnTextInputEntrance(WidgetIndex widgetIndex, std::string_view text) - { - if (widgetIndex == WIDX_RENAME && !text.empty()) + void OnResize() override { - auto action = ParkSetNameAction(std::string(text)); - GameActions::Execute(&action); + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnResizeEntrance(); + break; + case WINDOW_PARK_PAGE_RATING: + OnResizeRating(); + break; + case WINDOW_PARK_PAGE_GUESTS: + OnResizeGuests(); + break; + case WINDOW_PARK_PAGE_PRICE: + OnResizePrice(); + break; + case WINDOW_PARK_PAGE_STATS: + OnResizeStats(); + break; + case WINDOW_PARK_PAGE_OBJECTIVE: + OnResizeObjective(); + break; + case WINDOW_PARK_PAGE_AWARDS: + OnResizeAwards(); + break; + } } - } - void OnPrepareDrawEntrance() - { - const auto& gameState = GetGameState(); - widgets = _pagedWidgets[page]; - InitScrollWidgets(); + void OnMouseDown(WidgetIndex idx) override + { + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnMouseDownEntrance(idx); + break; + case WINDOW_PARK_PAGE_PRICE: + OnMouseDownPrice(idx); + break; + } + } - SetPressedTab(); + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnDropdownEntrance(widgetIndex, selectedIndex); + break; + } + } - // Set open / close park button state + void OnUpdate() override + { + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnUpdateEntrance(); + break; + case WINDOW_PARK_PAGE_RATING: + OnUpdateRating(); + break; + case WINDOW_PARK_PAGE_GUESTS: + OnUpdateGuests(); + break; + case WINDOW_PARK_PAGE_PRICE: + OnUpdatePrice(); + break; + case WINDOW_PARK_PAGE_STATS: + OnUpdateStats(); + break; + case WINDOW_PARK_PAGE_OBJECTIVE: + OnUpdateObjective(); + break; + case WINDOW_PARK_PAGE_AWARDS: + OnUpdateAwards(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnTextInputEntrance(widgetIndex, text); + break; + case WINDOW_PARK_PAGE_OBJECTIVE: + OnTextInputObjective(widgetIndex, text); + break; + } + } + + void OnPrepareDraw() override + { + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnPrepareDrawEntrance(); + break; + case WINDOW_PARK_PAGE_RATING: + OnPrepareDrawRating(); + break; + case WINDOW_PARK_PAGE_GUESTS: + OnPrepareDrawGuests(); + break; + case WINDOW_PARK_PAGE_PRICE: + OnPrepareDrawPrice(); + break; + case WINDOW_PARK_PAGE_STATS: + OnPrepareDrawStats(); + break; + case WINDOW_PARK_PAGE_OBJECTIVE: + OnPrepareDrawObjective(); + break; + case WINDOW_PARK_PAGE_AWARDS: + OnPrepareDrawAwards(); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_PARK_PAGE_ENTRANCE: + OnDrawEntrance(dpi); + break; + case WINDOW_PARK_PAGE_RATING: + OnDrawRating(dpi); + break; + case WINDOW_PARK_PAGE_GUESTS: + OnDrawGuests(dpi); + break; + case WINDOW_PARK_PAGE_PRICE: + OnDrawPrice(dpi); + break; + case WINDOW_PARK_PAGE_STATS: + OnDrawStats(dpi); + break; + case WINDOW_PARK_PAGE_OBJECTIVE: + OnDrawObjective(dpi); + break; + case WINDOW_PARK_PAGE_AWARDS: + OnDrawAwards(dpi); + break; + } + } + + private: + void SetDisabledTabs() + { + // Disable price tab if money is disabled + disabled_widgets = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? (1uLL << WIDX_TAB_4) : 0; + } + + void PrepareWindowTitleText() { auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); auto parkName = park.Name.c_str(); @@ -518,845 +408,960 @@ private: ft.Add(STR_STRING); ft.Add(parkName); } - widgets[WIDX_OPEN_OR_CLOSE].image = ImageId(ParkIsOpen() ? SPR_OPEN : SPR_CLOSED); - const auto closeLightImage = SPR_G2_RCT1_CLOSE_BUTTON_0 + !ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); - widgets[WIDX_CLOSE_LIGHT].image = ImageId(closeLightImage); - const auto openLightImage = SPR_G2_RCT1_OPEN_BUTTON_0 + ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); - widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage); - // Only allow closing of park for guest / rating objective - if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) - disabled_widgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT); - else - disabled_widgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT)); - - // Only allow purchase of land when there is money - if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) - widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::Empty; - else - widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::FlatBtn; - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - - // Anchor entrance page specific widgets - widgets[WIDX_VIEWPORT].right = width - 26; - widgets[WIDX_VIEWPORT].bottom = height - 14; - widgets[WIDX_STATUS].right = width - 26; - widgets[WIDX_STATUS].top = height - 13; - widgets[WIDX_STATUS].bottom = height - 3; - - auto y = 0; - if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK) +#pragma region Entrance page + void OnMouseUpEntrance(WidgetIndex widgetIndex) { - widgets[WIDX_OPEN_OR_CLOSE].type = WindowWidgetType::Empty; - if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) + switch (widgetIndex) { - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::FlatBtn; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::FlatBtn; + case WIDX_BUY_LAND_RIGHTS: + ContextOpenWindow(WindowClass::LandRights); + break; + case WIDX_LOCATE: + ScrollToViewport(); + break; + case WIDX_RENAME: + { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + WindowTextInputRawOpen( + this, WIDX_RENAME, STR_PARK_NAME, STR_ENTER_PARK_NAME, {}, park.Name.c_str(), USER_STRING_MAX_LENGTH); + break; + } + case WIDX_CLOSE_LIGHT: + ParkSetOpen(false); + break; + case WIDX_OPEN_LIGHT: + ParkSetOpen(true); + break; + } + } + + void OnResizeEntrance() + { + flags |= WF_RESIZABLE; + WindowSetResize(*this, 230, 174 + 9, 230 * 3, (274 + 9) * 3); + InitViewport(); + } + + void OnMouseDownEntrance(WidgetIndex widgetIndex) + { + if (widgetIndex == WIDX_OPEN_OR_CLOSE) + { + auto& widget = widgets[widgetIndex]; + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_CLOSE_PARK; + gDropdownItems[1].Args = STR_OPEN_PARK; + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1], 0, 2); + + if (ParkIsOpen()) + { + gDropdownDefaultIndex = 0; + Dropdown::SetChecked(1, true); + } + else + { + gDropdownDefaultIndex = 1; + Dropdown::SetChecked(0, true); + } + } + } + + void OnDropdownEntrance(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (widgetIndex == WIDX_OPEN_OR_CLOSE) + { + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; + + if (dropdownIndex != 0) + { + ParkSetOpen(true); + } + else + { + ParkSetOpen(false); + } + } + } + + void OnUpdateEntrance() + { + frame_no++; + WidgetInvalidate(*this, WIDX_TAB_1); + } + + void OnTextInputEntrance(WidgetIndex widgetIndex, std::string_view text) + { + if (widgetIndex == WIDX_RENAME && !text.empty()) + { + auto action = ParkSetNameAction(std::string(text)); + GameActions::Execute(&action); + } + } + + void OnPrepareDrawEntrance() + { + const auto& gameState = GetGameState(); + widgets = _pagedWidgets[page]; + InitScrollWidgets(); + + SetPressedTab(); + + // Set open / close park button state + { + auto& park = OpenRCT2::GetContext()->GetGameState()->GetPark(); + auto parkName = park.Name.c_str(); + + auto ft = Formatter::Common(); + ft.Add(STR_STRING); + ft.Add(parkName); + } + widgets[WIDX_OPEN_OR_CLOSE].image = ImageId(ParkIsOpen() ? SPR_OPEN : SPR_CLOSED); + const auto closeLightImage = SPR_G2_RCT1_CLOSE_BUTTON_0 + !ParkIsOpen() * 2 + + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); + widgets[WIDX_CLOSE_LIGHT].image = ImageId(closeLightImage); + const auto openLightImage = SPR_G2_RCT1_OPEN_BUTTON_0 + ParkIsOpen() * 2 + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); + widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage); + + // Only allow closing of park for guest / rating objective + if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) + disabled_widgets |= (1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT); + else + disabled_widgets &= ~((1uLL << WIDX_OPEN_OR_CLOSE) | (1uLL << WIDX_CLOSE_LIGHT) | (1uLL << WIDX_OPEN_LIGHT)); + + // Only allow purchase of land when there is money + if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) + widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::Empty; + else + widgets[WIDX_BUY_LAND_RIGHTS].type = WindowWidgetType::FlatBtn; + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); + + // Anchor entrance page specific widgets + widgets[WIDX_VIEWPORT].right = width - 26; + widgets[WIDX_VIEWPORT].bottom = height - 14; + widgets[WIDX_STATUS].right = width - 26; + widgets[WIDX_STATUS].top = height - 13; + widgets[WIDX_STATUS].bottom = height - 3; + + auto y = 0; + if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK) + { + widgets[WIDX_OPEN_OR_CLOSE].type = WindowWidgetType::Empty; + if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) + { + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::FlatBtn; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::FlatBtn; + } + else + { + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; + } + y = widgets[WIDX_OPEN_LIGHT].bottom + 5; } else { - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_OPEN_OR_CLOSE].type = WindowWidgetType::FlatBtn; + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::Empty; + y = 49; + } + + for (int32_t i = WIDX_CLOSE_LIGHT; i <= WIDX_OPEN_LIGHT; i++) + { + widgets[i].left = width - 20; + widgets[i].right = width - 7; + } + for (int32_t i = WIDX_OPEN_OR_CLOSE; i <= WIDX_RENAME; i++) + { + if (widgets[i].type == WindowWidgetType::Empty) + continue; + + widgets[i].left = width - 25; + widgets[i].right = width - 2; + widgets[i].top = y; + widgets[i].bottom = y + 23; + y += 24; } - y = widgets[WIDX_OPEN_LIGHT].bottom + 5; - } - else - { - widgets[WIDX_OPEN_OR_CLOSE].type = WindowWidgetType::FlatBtn; - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::Empty; - y = 49; } - for (int32_t i = WIDX_CLOSE_LIGHT; i <= WIDX_OPEN_LIGHT; i++) + void OnDrawEntrance(DrawPixelInfo& dpi) { - widgets[i].left = width - 20; - widgets[i].right = width - 7; - } - for (int32_t i = WIDX_OPEN_OR_CLOSE; i <= WIDX_RENAME; i++) - { - if (widgets[i].type == WindowWidgetType::Empty) - continue; + DrawWidgets(dpi); + DrawTabImages(dpi); - widgets[i].left = width - 25; - widgets[i].right = width - 2; - widgets[i].top = y; - widgets[i].bottom = y + 23; - y += 24; - } - } + // Draw viewport + if (viewport != nullptr) + { + WindowDrawViewport(dpi, *this); + if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); + } - void OnDrawEntrance(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); + // Draw park closed / open label + auto ft = Formatter(); + ft.Add(ParkIsOpen() ? STR_PARK_OPEN : STR_PARK_CLOSED); - // Draw viewport - if (viewport != nullptr) - { - WindowDrawViewport(dpi, *this); - if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) - GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); + auto* labelWidget = &widgets[WIDX_STATUS]; + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), + STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); } - // Draw park closed / open label - auto ft = Formatter(); - ft.Add(ParkIsOpen() ? STR_PARK_OPEN : STR_PARK_CLOSED); - - auto* labelWidget = &widgets[WIDX_STATUS]; - DrawTextEllipsised( - dpi, windowPos + ScreenCoordsXY{ labelWidget->midX(), labelWidget->top }, labelWidget->width(), STR_BLACK_STRING, - ft, { TextAlignment::CENTRE }); - } - - void InitViewport() - { - if (page != WINDOW_PARK_PAGE_ENTRANCE) - return; - - const auto& gameState = GetGameState(); - - std::optional newFocus = std::nullopt; - if (!gameState.ParkEntrances.empty()) + void InitViewport() { - const auto& entrance = gameState.ParkEntrances[0]; - newFocus = Focus(CoordsXYZ{ entrance.x + 16, entrance.y + 16, entrance.z + 32 }); - } + if (page != WINDOW_PARK_PAGE_ENTRANCE) + return; - int32_t viewportFlags{}; - if (viewport == nullptr) - { - viewportFlags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; - } - else - { - viewportFlags = viewport->flags; - RemoveViewport(); - } + const auto& gameState = GetGameState(); - // Call invalidate event - OnPrepareDraw(); + std::optional newFocus = std::nullopt; + if (!gameState.ParkEntrances.empty()) + { + const auto& entrance = gameState.ParkEntrances[0]; + newFocus = Focus(CoordsXYZ{ entrance.x + 16, entrance.y + 16, entrance.z + 32 }); + } - focus = newFocus; - - if (focus.has_value()) - { - // Create viewport + int32_t viewportFlags{}; if (viewport == nullptr) { - Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; - ViewportCreate( - this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, - viewportWidget->width() - 1, viewportWidget->height() - 1, focus.value()); - flags |= WF_NO_SCROLLING; - Invalidate(); + viewportFlags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + } + else + { + viewportFlags = viewport->flags; + RemoveViewport(); } - } - if (viewport != nullptr) - viewport->flags = viewportFlags; - Invalidate(); - } + // Call invalidate event + OnPrepareDraw(); + + focus = newFocus; + + if (focus.has_value()) + { + // Create viewport + if (viewport == nullptr) + { + Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; + ViewportCreate( + this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, + viewportWidget->width() - 1, viewportWidget->height() - 1, focus.value()); + flags |= WF_NO_SCROLLING; + Invalidate(); + } + } + + if (viewport != nullptr) + viewport->flags = viewportFlags; + Invalidate(); + } #pragma endregion #pragma region Rating page - void OnResizeRating() - { - WindowSetResize(*this, 255, 182, 255, 182); - } - - void OnUpdateRating() - { - frame_no++; - WidgetInvalidate(*this, WIDX_TAB_2); - } - - void OnPrepareDrawRating() - { - auto* ratingWidgets = _pagedWidgets[page]; - if (ratingWidgets != widgets) + void OnResizeRating() { - widgets = ratingWidgets; - InitScrollWidgets(); + WindowSetResize(*this, 255, 182, 255, 182); } - SetPressedTab(); - PrepareWindowTitleText(); - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - } - - void OnDrawRating(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto screenPos = windowPos; - Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; - - // Current value - auto ft = Formatter(); - ft.Add(GetGameState().ParkRating); - DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft); - - // Graph border - GfxFillRectInset( - dpi, - { screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 }, - screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } }, - colours[1], INSET_RECT_F_30); - - // Y axis labels - screenPos = screenPos + ScreenCoordsXY{ widget->left + 27, widget->top + 23 }; - for (int i = 5; i >= 0; i--) + void OnUpdateRating() { - uint32_t axisValue = i * 200; - ft = Formatter(); - ft.Add(axisValue); - DrawTextBasic( - dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT }); + frame_no++; + WidgetInvalidate(*this, WIDX_TAB_2); + } + + void OnPrepareDrawRating() + { + auto* ratingWidgets = _pagedWidgets[page]; + if (ratingWidgets != widgets) + { + widgets = ratingWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + PrepareWindowTitleText(); + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); + } + + void OnDrawRating(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto screenPos = windowPos; + Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; + + // Current value + auto ft = Formatter(); + ft.Add(GetGameState().ParkRating); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_PARK_RATING_LABEL, ft); + + // Graph border GfxFillRectInset( - dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], - INSET_RECT_FLAG_BORDER_INSET); - screenPos.y += 20; + dpi, + { screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 }, + screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } }, + colours[1], INSET_RECT_F_30); + + // Y axis labels + screenPos = screenPos + ScreenCoordsXY{ widget->left + 27, widget->top + 23 }; + for (int i = 5; i >= 0; i--) + { + uint32_t axisValue = i * 200; + ft = Formatter(); + ft.Add(axisValue); + DrawTextBasic( + dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, + { FontStyle::Small, TextAlignment::RIGHT }); + GfxFillRectInset( + dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], + INSET_RECT_FLAG_BORDER_INSET); + screenPos.y += 20; + } + + // Graph + screenPos = windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; + + Graph::Draw(dpi, GetGameState().ParkRatingHistory, 32, screenPos); } - // Graph - screenPos = windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; - - Graph::Draw(dpi, GetGameState().ParkRatingHistory, 32, screenPos); - } - #pragma endregion #pragma region Guests page - void OnResizeGuests() - { - WindowSetResize(*this, 255, 182, 255, 182); - } - - void OnUpdateGuests() - { - frame_no++; - _peepAnimationFrame = (_peepAnimationFrame + 1) % 24; - WidgetInvalidate(*this, WIDX_TAB_3); - } - - void OnPrepareDrawGuests() - { - auto* guestsWidgets = _pagedWidgets[page]; - if (widgets != guestsWidgets) + void OnResizeGuests() { - widgets = guestsWidgets; - InitScrollWidgets(); + WindowSetResize(*this, 255, 182, 255, 182); } - SetPressedTab(); - PrepareWindowTitleText(); - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - } - - void OnDrawGuests(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto screenPos = windowPos; - Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; - - const auto& gameState = OpenRCT2::GetGameState(); - - // Current value - auto ft = Formatter(); - ft.Add(gameState.NumGuestsInPark); - DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); - - // Graph border - GfxFillRectInset( - dpi, - { screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 }, - screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } }, - colours[1], INSET_RECT_F_30); - - // Y axis labels - screenPos = screenPos + ScreenCoordsXY{ widget->left + 27, widget->top + 23 }; - for (int i = 5; i >= 0; i--) + void OnUpdateGuests() { - uint32_t axisValue = i * 1000; - ft = Formatter(); - ft.Add(axisValue); - DrawTextBasic( - dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, { FontStyle::Small, TextAlignment::RIGHT }); + frame_no++; + _peepAnimationFrame = (_peepAnimationFrame + 1) % 24; + WidgetInvalidate(*this, WIDX_TAB_3); + } + + void OnPrepareDrawGuests() + { + auto* guestsWidgets = _pagedWidgets[page]; + if (widgets != guestsWidgets) + { + widgets = guestsWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + PrepareWindowTitleText(); + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); + } + + void OnDrawGuests(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto screenPos = windowPos; + Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; + + const auto& gameState = OpenRCT2::GetGameState(); + + // Current value + auto ft = Formatter(); + ft.Add(gameState.NumGuestsInPark); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ widget->left + 3, widget->top + 2 }, STR_GUESTS_IN_PARK_LABEL, ft); + + // Graph border GfxFillRectInset( - dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], - INSET_RECT_FLAG_BORDER_INSET); - screenPos.y += 20; - } + dpi, + { screenPos + ScreenCoordsXY{ widget->left + 4, widget->top + 15 }, + screenPos + ScreenCoordsXY{ widget->right - 4, widget->bottom - 4 } }, + colours[1], INSET_RECT_F_30); - // Graph - screenPos = windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; + // Y axis labels + screenPos = screenPos + ScreenCoordsXY{ widget->left + 27, widget->top + 23 }; + for (int i = 5; i >= 0; i--) + { + uint32_t axisValue = i * 1000; + ft = Formatter(); + ft.Add(axisValue); + DrawTextBasic( + dpi, screenPos + ScreenCoordsXY{ 10, 0 }, STR_GRAPH_AXIS_LABEL, ft, + { FontStyle::Small, TextAlignment::RIGHT }); + GfxFillRectInset( + dpi, { screenPos + ScreenCoordsXY{ 15, 5 }, screenPos + ScreenCoordsXY{ width - 32, 5 } }, colours[2], + INSET_RECT_FLAG_BORDER_INSET); + screenPos.y += 20; + } - uint8_t cappedHistory[32]; - for (size_t i = 0; i < std::size(cappedHistory); i++) - { - auto value = gameState.GuestsInParkHistory[i]; - if (value != std::numeric_limits::max()) + // Graph + screenPos = windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; + + uint8_t cappedHistory[32]; + for (size_t i = 0; i < std::size(cappedHistory); i++) { - cappedHistory[i] = static_cast(std::min(value, 5000) / 20); - } - else - { - cappedHistory[i] = std::numeric_limits::max(); + auto value = gameState.GuestsInParkHistory[i]; + if (value != std::numeric_limits::max()) + { + cappedHistory[i] = static_cast(std::min(value, 5000) / 20); + } + else + { + cappedHistory[i] = std::numeric_limits::max(); + } } + Graph::Draw(dpi, cappedHistory, static_cast(std::size(cappedHistory)), screenPos); } - Graph::Draw(dpi, cappedHistory, static_cast(std::size(cappedHistory)), screenPos); - } #pragma endregion #pragma region Price page - void OnResizePrice() - { - WindowSetResize(*this, 230, 124, 230, 124); - } - - void OnMouseDownPrice(WidgetIndex widgetIndex) - { - const auto& gameState = GetGameState(); - switch (widgetIndex) + void OnResizePrice() { - case WIDX_INCREASE_PRICE: + WindowSetResize(*this, 230, 124, 230, 124); + } + + void OnMouseDownPrice(WidgetIndex widgetIndex) + { + const auto& gameState = GetGameState(); + switch (widgetIndex) { - const auto newFee = std::min(MAX_ENTRANCE_FEE, gameState.ParkEntranceFee + 1.00_GBP); - auto gameAction = ParkSetEntranceFeeAction(newFee); - GameActions::Execute(&gameAction); - break; - } - case WIDX_DECREASE_PRICE: - { - const auto newFee = std::max(0.00_GBP, gameState.ParkEntranceFee - 1.00_GBP); - auto gameAction = ParkSetEntranceFeeAction(newFee); - GameActions::Execute(&gameAction); - break; + case WIDX_INCREASE_PRICE: + { + const auto newFee = std::min(MAX_ENTRANCE_FEE, gameState.ParkEntranceFee + 1.00_GBP); + auto gameAction = ParkSetEntranceFeeAction(newFee); + GameActions::Execute(&gameAction); + break; + } + case WIDX_DECREASE_PRICE: + { + const auto newFee = std::max(0.00_GBP, gameState.ParkEntranceFee - 1.00_GBP); + auto gameAction = ParkSetEntranceFeeAction(newFee); + GameActions::Execute(&gameAction); + break; + } } } - } - void OnUpdatePrice() - { - frame_no++; - WidgetInvalidate(*this, WIDX_TAB_4); - } - - void OnPrepareDrawPrice() - { - auto* priceWidgets = _pagedWidgets[page]; - if (widgets != priceWidgets) + void OnUpdatePrice() { - widgets = priceWidgets; - InitScrollWidgets(); + frame_no++; + WidgetInvalidate(*this, WIDX_TAB_4); } - SetPressedTab(); - PrepareWindowTitleText(); - - // Show a tooltip if the park is pay per ride. - widgets[WIDX_PRICE_LABEL].tooltip = STR_NONE; - widgets[WIDX_PRICE].tooltip = STR_NONE; - - if (!ParkEntranceFeeUnlocked()) + void OnPrepareDrawPrice() { - widgets[WIDX_PRICE_LABEL].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; - widgets[WIDX_PRICE].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; + auto* priceWidgets = _pagedWidgets[page]; + if (widgets != priceWidgets) + { + widgets = priceWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + PrepareWindowTitleText(); + + // Show a tooltip if the park is pay per ride. + widgets[WIDX_PRICE_LABEL].tooltip = STR_NONE; + widgets[WIDX_PRICE].tooltip = STR_NONE; + + if (!ParkEntranceFeeUnlocked()) + { + widgets[WIDX_PRICE_LABEL].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; + widgets[WIDX_PRICE].tooltip = STR_ADMISSION_PRICE_PAY_PER_RIDE_TIP; + } + + // If the entry price is locked at free, disable the widget, unless the unlock_all_prices cheat is active. + if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) || !ParkEntranceFeeUnlocked()) + { + widgets[WIDX_PRICE].type = WindowWidgetType::LabelCentred; + widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Empty; + widgets[WIDX_DECREASE_PRICE].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_PRICE].type = WindowWidgetType::Spinner; + widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Button; + widgets[WIDX_DECREASE_PRICE].type = WindowWidgetType::Button; + } + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); } - // If the entry price is locked at free, disable the widget, unless the unlock_all_prices cheat is active. - if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) || !ParkEntranceFeeUnlocked()) + void OnDrawPrice(DrawPixelInfo& dpi) { - widgets[WIDX_PRICE].type = WindowWidgetType::LabelCentred; - widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Empty; - widgets[WIDX_DECREASE_PRICE].type = WindowWidgetType::Empty; + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 30 }; + auto ft = Formatter(); + ft.Add(GetGameState().TotalIncomeFromAdmissions); + DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); + + money64 parkEntranceFee = ParkGetEntranceFee(); + auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; + screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PRICE].left + 1, widgets[WIDX_PRICE].top + 1 }; + ft = Formatter(); + ft.Add(parkEntranceFee); + DrawTextBasic(dpi, screenCoords, stringId, ft, { colours[1] }); } - else - { - widgets[WIDX_PRICE].type = WindowWidgetType::Spinner; - widgets[WIDX_INCREASE_PRICE].type = WindowWidgetType::Button; - widgets[WIDX_DECREASE_PRICE].type = WindowWidgetType::Button; - } - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - } - - void OnDrawPrice(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 30 }; - auto ft = Formatter(); - ft.Add(GetGameState().TotalIncomeFromAdmissions); - DrawTextBasic(dpi, screenCoords, STR_INCOME_FROM_ADMISSIONS, ft); - - money64 parkEntranceFee = ParkGetEntranceFee(); - auto stringId = parkEntranceFee == 0 ? STR_FREE : STR_BOTTOM_TOOLBAR_CASH; - screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PRICE].left + 1, widgets[WIDX_PRICE].top + 1 }; - ft = Formatter(); - ft.Add(parkEntranceFee); - DrawTextBasic(dpi, screenCoords, stringId, ft, { colours[1] }); - } #pragma endregion #pragma region Stats page - void OnResizeStats() - { - WindowSetResize(*this, 230, 119, 230, 119); - } - - void OnUpdateStats() - { - frame_no++; - WidgetInvalidate(*this, WIDX_TAB_5); - - // Invalidate ride count if changed - const auto rideCount = RideGetCount(); - if (_numberOfRides != rideCount) + void OnResizeStats() { - _numberOfRides = rideCount; - WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND); + WindowSetResize(*this, 230, 119, 230, 119); } - // Invalidate number of staff if changed - const auto staffCount = PeepGetStaffCount(); - if (_numberOfStaff != staffCount) + void OnUpdateStats() { - _numberOfStaff = staffCount; - WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND); - } - } + frame_no++; + WidgetInvalidate(*this, WIDX_TAB_5); - void OnPrepareDrawStats() - { - auto* statsWidgets = _pagedWidgets[page]; - if (widgets != statsWidgets) - { - widgets = statsWidgets; - InitScrollWidgets(); + // Invalidate ride count if changed + const auto rideCount = RideGetCount(); + if (_numberOfRides != rideCount) + { + _numberOfRides = rideCount; + WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND); + } + + // Invalidate number of staff if changed + const auto staffCount = PeepGetStaffCount(); + if (_numberOfStaff != staffCount) + { + _numberOfStaff = staffCount; + WidgetInvalidate(*this, WIDX_PAGE_BACKGROUND); + } } - SetPressedTab(); - PrepareWindowTitleText(); - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - } - - void OnDrawStats(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - - auto& gameState = GetGameState(); - // Draw park size - auto parkSize = gameState.ParkSize * 10; - auto stringIndex = STR_PARK_SIZE_METRIC_LABEL; - if (gConfigGeneral.MeasurementFormat == MeasurementFormat::Imperial) + void OnPrepareDrawStats() { - stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL; - parkSize = SquaredMetresToSquaredFeet(parkSize); + auto* statsWidgets = _pagedWidgets[page]; + if (widgets != statsWidgets) + { + widgets = statsWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + PrepareWindowTitleText(); + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); } - auto ft = Formatter(); - ft.Add(parkSize); - DrawTextBasic(dpi, screenCoords, stringIndex, ft); - screenCoords.y += LIST_ROW_HEIGHT; - // Draw number of rides / attractions - if (_numberOfRides != -1) + void OnDrawStats(DrawPixelInfo& dpi) { + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + + auto& gameState = GetGameState(); + // Draw park size + auto parkSize = gameState.ParkSize * 10; + auto stringIndex = STR_PARK_SIZE_METRIC_LABEL; + if (gConfigGeneral.MeasurementFormat == MeasurementFormat::Imperial) + { + stringIndex = STR_PARK_SIZE_IMPERIAL_LABEL; + parkSize = SquaredMetresToSquaredFeet(parkSize); + } + auto ft = Formatter(); + ft.Add(parkSize); + DrawTextBasic(dpi, screenCoords, stringIndex, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Draw number of rides / attractions + if (_numberOfRides != -1) + { + ft = Formatter(); + ft.Add(_numberOfRides); + DrawTextBasic(dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + + // Draw number of staff + if (_numberOfStaff != -1) + { + ft = Formatter(); + ft.Add(_numberOfStaff); + DrawTextBasic(dpi, screenCoords, STR_STAFF_LABEL, ft); + } + screenCoords.y += LIST_ROW_HEIGHT; + + // Draw number of guests in park ft = Formatter(); - ft.Add(_numberOfRides); - DrawTextBasic(dpi, screenCoords, STR_NUMBER_OF_RIDES_LABEL, ft); - } - screenCoords.y += LIST_ROW_HEIGHT; + ft.Add(gameState.NumGuestsInPark); + DrawTextBasic(dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft); + screenCoords.y += LIST_ROW_HEIGHT; - // Draw number of staff - if (_numberOfStaff != -1) - { ft = Formatter(); - ft.Add(_numberOfStaff); - DrawTextBasic(dpi, screenCoords, STR_STAFF_LABEL, ft); + ft.Add(gameState.TotalAdmissions); + DrawTextBasic(dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft); } - screenCoords.y += LIST_ROW_HEIGHT; - - // Draw number of guests in park - ft = Formatter(); - ft.Add(gameState.NumGuestsInPark); - DrawTextBasic(dpi, screenCoords, STR_GUESTS_IN_PARK_LABEL, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(gameState.TotalAdmissions); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_ADMISSIONS, ft); - } #pragma endregion #pragma region Objective page - void OnMouseUpObjective(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void OnMouseUpObjective(WidgetIndex widgetIndex) { - case WIDX_ENTER_NAME: - WindowTextInputOpen( - this, WIDX_ENTER_NAME, STR_ENTER_NAME, STR_PLEASE_ENTER_YOUR_NAME_FOR_THE_SCENARIO_CHART, {}, 0, 0, - ParkNameMaxLength); - break; + switch (widgetIndex) + { + case WIDX_ENTER_NAME: + WindowTextInputOpen( + this, WIDX_ENTER_NAME, STR_ENTER_NAME, STR_PLEASE_ENTER_YOUR_NAME_FOR_THE_SCENARIO_CHART, {}, 0, 0, + ParkNameMaxLength); + break; + } } - } - void OnResizeObjective() - { + void OnResizeObjective() + { #ifndef NO_TTF - if (gCurrentTTFFontSet != nullptr) - WindowSetResize(*this, 230, 270, 230, 270); - else + if (gCurrentTTFFontSet != nullptr) + WindowSetResize(*this, 230, 270, 230, 270); + else #endif - WindowSetResize(*this, 230, 226, 230, 226); - } - - void OnUpdateObjective() - { - frame_no++; - WidgetInvalidate(*this, WIDX_TAB_6); - } - - void OnTextInputObjective(WidgetIndex widgetIndex, std::string_view text) - { - if (widgetIndex == WIDX_ENTER_NAME && !text.empty()) - { - std::string strText(text); - ScenarioSuccessSubmitName(GetGameState(), strText.c_str()); - Invalidate(); + WindowSetResize(*this, 230, 226, 230, 226); } - } - void OnPrepareDrawObjective() - { - SetPressedTab(); - PrepareWindowTitleText(); - - // Show name input button on scenario completion. - if (GetGameState().ParkFlags & PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT) + void OnUpdateObjective() { - widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Button; - widgets[WIDX_ENTER_NAME].top = height - 19; - widgets[WIDX_ENTER_NAME].bottom = height - 6; + frame_no++; + WidgetInvalidate(*this, WIDX_TAB_6); } - else - widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Empty; - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - } - - void OnDrawObjective(DrawPixelInfo& dpi) - { - auto& gameState = GetGameState(); - DrawWidgets(dpi); - DrawTabImages(dpi); - - // Scenario description - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 7 }; - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(gameState.ScenarioDetails.c_str()); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 222, STR_BLACK_STRING, ft); - screenCoords.y += 5; - - // Your objective: - DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_LABEL); - screenCoords.y += LIST_ROW_HEIGHT; - - // Objective - ft = Formatter(); - if (gameState.ScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST) + void OnTextInputObjective(WidgetIndex widgetIndex, std::string_view text) { - StringId rideTypeString = STR_NONE; - auto rideTypeId = gameState.ScenarioObjective.RideId; - if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) + if (widgetIndex == WIDX_ENTER_NAME && !text.empty()) { - rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; + std::string strText(text); + ScenarioSuccessSubmitName(GetGameState(), strText.c_str()); + Invalidate(); } - ft.Add(rideTypeString); - } - else - { - ft.Add(gameState.ScenarioObjective.NumGuests); - ft.Add(DateGetTotalMonths(MONTH_OCTOBER, gameState.ScenarioObjective.Year)); - if (gameState.ScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) - ft.Add(gameState.ScenarioObjective.MinimumExcitement); - else - ft.Add(gameState.ScenarioObjective.Currency); } - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, ObjectiveNames[gameState.ScenarioObjective.Type], ft); - screenCoords.y += 5; - - // Objective outcome - if (gameState.ScenarioCompletedCompanyValue != kMoney64Undefined) + void OnPrepareDrawObjective() { - if (gameState.ScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) + SetPressedTab(); + PrepareWindowTitleText(); + + // Show name input button on scenario completion. + if (GetGameState().ParkFlags & PARK_FLAGS_SCENARIO_COMPLETE_NAME_INPUT) { - // Objective failed - DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_FAILED); + widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Button; + widgets[WIDX_ENTER_NAME].top = height - 19; + widgets[WIDX_ENTER_NAME].bottom = height - 6; + } + else + widgets[WIDX_ENTER_NAME].type = WindowWidgetType::Empty; + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); + } + + void OnDrawObjective(DrawPixelInfo& dpi) + { + auto& gameState = GetGameState(); + DrawWidgets(dpi); + DrawTabImages(dpi); + + // Scenario description + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 7 }; + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(gameState.ScenarioDetails.c_str()); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 222, STR_BLACK_STRING, ft); + screenCoords.y += 5; + + // Your objective: + DrawTextBasic(dpi, screenCoords, STR_OBJECTIVE_LABEL); + screenCoords.y += LIST_ROW_HEIGHT; + + // Objective + ft = Formatter(); + if (gameState.ScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST) + { + StringId rideTypeString = STR_NONE; + auto rideTypeId = gameState.ScenarioObjective.RideId; + if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) + { + rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; + } + ft.Add(rideTypeString); } else { - // Objective completed - ft = Formatter(); - ft.Add(gameState.ScenarioCompletedCompanyValue); - DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft); + ft.Add(gameState.ScenarioObjective.NumGuests); + ft.Add(DateGetTotalMonths(MONTH_OCTOBER, gameState.ScenarioObjective.Year)); + if (gameState.ScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) + ft.Add(gameState.ScenarioObjective.MinimumExcitement); + else + ft.Add(gameState.ScenarioObjective.Currency); + } + + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, ObjectiveNames[gameState.ScenarioObjective.Type], ft); + screenCoords.y += 5; + + // Objective outcome + if (gameState.ScenarioCompletedCompanyValue != kMoney64Undefined) + { + if (gameState.ScenarioCompletedCompanyValue == COMPANY_VALUE_ON_FAILED_OBJECTIVE) + { + // Objective failed + DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_FAILED); + } + else + { + // Objective completed + ft = Formatter(); + ft.Add(gameState.ScenarioCompletedCompanyValue); + DrawTextWrapped(dpi, screenCoords, 222, STR_OBJECTIVE_ACHIEVED, ft); + } } } - } #pragma endregion #pragma region Awards page - void OnResizeAwards() - { - WindowSetResize(*this, 230, 182, 230, 182); - } - - void OnUpdateAwards() - { - frame_no++; - WidgetInvalidate(*this, WIDX_TAB_7); - } - - void OnPrepareDrawAwards() - { - auto* awardsWidgets = _pagedWidgets[page]; - if (widgets != awardsWidgets) + void OnResizeAwards() { - widgets = awardsWidgets; - InitScrollWidgets(); + WindowSetResize(*this, 230, 182, 230, 182); } - SetPressedTab(); - PrepareWindowTitleText(); - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); - AnchorBorderWidgets(); - } - - void OnDrawAwards(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - - for (const auto& award : GetAwards()) + void OnUpdateAwards() { - GfxDrawSprite(dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords); - DrawTextWrapped(dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text); - - screenCoords.y += 32; + frame_no++; + WidgetInvalidate(*this, WIDX_TAB_7); } - if (GetAwards().empty()) - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS); - } + void OnPrepareDrawAwards() + { + auto* awardsWidgets = _pagedWidgets[page]; + if (widgets != awardsWidgets) + { + widgets = awardsWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + PrepareWindowTitleText(); + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_7); + AnchorBorderWidgets(); + } + + void OnDrawAwards(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + + for (const auto& award : GetAwards()) + { + GfxDrawSprite(dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords); + DrawTextWrapped(dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text); + + screenCoords.y += 32; + } + + if (GetAwards().empty()) + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS); + } #pragma endregion #pragma region Common - void SetPage(int32_t newPage) + void SetPage(int32_t newPage) + { + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) + ToolCancel(); + + // Set listen only to viewport + bool listen = false; + if (newPage == WINDOW_PARK_PAGE_ENTRANCE && viewport != nullptr && !(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) + listen = true; + + page = newPage; + frame_no = 0; + _peepAnimationFrame = 0; + RemoveViewport(); + + hold_down_widgets = _pagedHoldDownWidgets[newPage]; + widgets = _pagedWidgets[newPage]; + SetDisabledTabs(); + Invalidate(); + + OnResize(); + OnPrepareDraw(); + OnUpdate(); + if (listen && viewport != nullptr) + viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + } + + void AnchorBorderWidgets() + { + ResizeFrameWithPage(); + } + + void SetPressedTab() + { + for (int32_t i = WIDX_TAB_1; i <= WIDX_TAB_7; i++) + pressed_widgets &= ~(1 << i); + pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + // Entrance tab + if (!WidgetIsDisabled(*this, WIDX_TAB_1)) + { + GfxDrawSprite( + dpi, ImageId(SPR_TAB_PARK_ENTRANCE), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); + } + + // Rating tab + if (!WidgetIsDisabled(*this, WIDX_TAB_2)) + { + ImageId spriteIdx(SPR_TAB_GRAPH_0); + if (page == WINDOW_PARK_PAGE_RATING) + spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8); + GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); + GfxDrawSprite( + dpi, ImageId(SPR_RATING_HIGH), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left + 7, widgets[WIDX_TAB_2].top + 1 }); + GfxDrawSprite( + dpi, ImageId(SPR_RATING_LOW), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left + 16, widgets[WIDX_TAB_2].top + 12 }); + } + + // Guests tab + if (!WidgetIsDisabled(*this, WIDX_TAB_3)) + { + ImageId spriteIdx(SPR_TAB_GRAPH_0); + if (page == WINDOW_PARK_PAGE_GUESTS) + spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8); + GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); + + ImageId peepImage(GetPeepAnimation(PeepSpriteType::Normal).base_image + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL); + if (page == WINDOW_PARK_PAGE_GUESTS) + peepImage = peepImage.WithIndexOffset(_peepAnimationFrame & 0xFFFFFFFC); + + GfxDrawSprite( + dpi, peepImage, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].midX(), widgets[WIDX_TAB_3].bottom - 9 }); + } + + // Price tab + if (!WidgetIsDisabled(*this, WIDX_TAB_4)) + { + ImageId spriteIdx(SPR_TAB_ADMISSION_0); + if (page == WINDOW_PARK_PAGE_PRICE) + spriteIdx = spriteIdx.WithIndexOffset((frame_no / 2) % 8); + GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); + } + + // Statistics tab + if (!WidgetIsDisabled(*this, WIDX_TAB_5)) + { + ImageId spriteIdx(SPR_TAB_STATS_0); + if (page == WINDOW_PARK_PAGE_STATS) + spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 7); + GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); + } + + // Objective tab + if (!WidgetIsDisabled(*this, WIDX_TAB_6)) + { + ImageId spriteIdx(SPR_TAB_OBJECTIVE_0); + if (page == WINDOW_PARK_PAGE_OBJECTIVE) + spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 16); + GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top }); + } + + // Awards tab + if (!WidgetIsDisabled(*this, WIDX_TAB_7)) + { + GfxDrawSprite( + dpi, ImageId(SPR_TAB_AWARDS), + windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_7].left, widgets[WIDX_TAB_7].top }); + } + } + }; + + static ParkWindow* ParkWindowOpen(uint8_t page) { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - ToolCancel(); - - // Set listen only to viewport - bool listen = false; - if (newPage == WINDOW_PARK_PAGE_ENTRANCE && viewport != nullptr && !(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) - listen = true; - - page = newPage; - frame_no = 0; - _peepAnimationFrame = 0; - RemoveViewport(); - - hold_down_widgets = _pagedHoldDownWidgets[newPage]; - widgets = _pagedWidgets[newPage]; - SetDisabledTabs(); - Invalidate(); - - OnResize(); - OnPrepareDraw(); - OnUpdate(); - if (listen && viewport != nullptr) - viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + auto* wnd = WindowFocusOrCreate(WindowClass::ParkInformation, 230, 174 + 9, WF_10); + if (wnd != nullptr && page != WINDOW_PARK_PAGE_ENTRANCE) + { + wnd->OnMouseUp(WIDX_TAB_1 + page); + } + return wnd; } - void AnchorBorderWidgets() + /** + * + * rct2: 0x00667C48 + */ + WindowBase* WindowParkEntranceOpen() { - ResizeFrameWithPage(); + return ParkWindowOpen(WINDOW_PARK_PAGE_ENTRANCE); } - void SetPressedTab() + /** + * + * rct2: 0x00667CA4 + */ + WindowBase* WindowParkRatingOpen() { - for (int32_t i = WIDX_TAB_1; i <= WIDX_TAB_7; i++) - pressed_widgets &= ~(1 << i); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + return ParkWindowOpen(WINDOW_PARK_PAGE_RATING); } - void DrawTabImages(DrawPixelInfo& dpi) + /** + * + * rct2: 0x00667D35 + */ + WindowBase* WindowParkGuestsOpen() { - // Entrance tab - if (!WidgetIsDisabled(*this, WIDX_TAB_1)) - { - GfxDrawSprite( - dpi, ImageId(SPR_TAB_PARK_ENTRANCE), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); - } - - // Rating tab - if (!WidgetIsDisabled(*this, WIDX_TAB_2)) - { - ImageId spriteIdx(SPR_TAB_GRAPH_0); - if (page == WINDOW_PARK_PAGE_RATING) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8); - GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); - GfxDrawSprite( - dpi, ImageId(SPR_RATING_HIGH), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left + 7, widgets[WIDX_TAB_2].top + 1 }); - GfxDrawSprite( - dpi, ImageId(SPR_RATING_LOW), - windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left + 16, widgets[WIDX_TAB_2].top + 12 }); - } - - // Guests tab - if (!WidgetIsDisabled(*this, WIDX_TAB_3)) - { - ImageId spriteIdx(SPR_TAB_GRAPH_0); - if (page == WINDOW_PARK_PAGE_GUESTS) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 8) % 8); - GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); - - ImageId peepImage(GetPeepAnimation(PeepSpriteType::Normal).base_image + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL); - if (page == WINDOW_PARK_PAGE_GUESTS) - peepImage = peepImage.WithIndexOffset(_peepAnimationFrame & 0xFFFFFFFC); - - GfxDrawSprite( - dpi, peepImage, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].midX(), widgets[WIDX_TAB_3].bottom - 9 }); - } - - // Price tab - if (!WidgetIsDisabled(*this, WIDX_TAB_4)) - { - ImageId spriteIdx(SPR_TAB_ADMISSION_0); - if (page == WINDOW_PARK_PAGE_PRICE) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 2) % 8); - GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_4].left, widgets[WIDX_TAB_4].top }); - } - - // Statistics tab - if (!WidgetIsDisabled(*this, WIDX_TAB_5)) - { - ImageId spriteIdx(SPR_TAB_STATS_0); - if (page == WINDOW_PARK_PAGE_STATS) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 7); - GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_5].left, widgets[WIDX_TAB_5].top }); - } - - // Objective tab - if (!WidgetIsDisabled(*this, WIDX_TAB_6)) - { - ImageId spriteIdx(SPR_TAB_OBJECTIVE_0); - if (page == WINDOW_PARK_PAGE_OBJECTIVE) - spriteIdx = spriteIdx.WithIndexOffset((frame_no / 4) % 16); - GfxDrawSprite(dpi, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_6].left, widgets[WIDX_TAB_6].top }); - } - - // Awards tab - if (!WidgetIsDisabled(*this, WIDX_TAB_7)) - { - GfxDrawSprite( - dpi, ImageId(SPR_TAB_AWARDS), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_7].left, widgets[WIDX_TAB_7].top }); - } + return ParkWindowOpen(WINDOW_PARK_PAGE_GUESTS); } -}; -static ParkWindow* ParkWindowOpen(uint8_t page) -{ - auto* wnd = WindowFocusOrCreate(WindowClass::ParkInformation, 230, 174 + 9, WF_10); - if (wnd != nullptr && page != WINDOW_PARK_PAGE_ENTRANCE) + /** + * + * rct2: 0x00667E57 + */ + WindowBase* WindowParkObjectiveOpen() { - wnd->OnMouseUp(WIDX_TAB_1 + page); + auto* wnd = ParkWindowOpen(WINDOW_PARK_PAGE_OBJECTIVE); + if (wnd != nullptr) + { + wnd->Invalidate(); + wnd->windowPos.x = ContextGetWidth() / 2 - 115; + wnd->windowPos.y = ContextGetHeight() / 2 - 87; + wnd->Invalidate(); + } + return wnd; } - return wnd; -} -/** - * - * rct2: 0x00667C48 - */ -WindowBase* WindowParkEntranceOpen() -{ - return ParkWindowOpen(WINDOW_PARK_PAGE_ENTRANCE); -} - -/** - * - * rct2: 0x00667CA4 - */ -WindowBase* WindowParkRatingOpen() -{ - return ParkWindowOpen(WINDOW_PARK_PAGE_RATING); -} - -/** - * - * rct2: 0x00667D35 - */ -WindowBase* WindowParkGuestsOpen() -{ - return ParkWindowOpen(WINDOW_PARK_PAGE_GUESTS); -} - -/** - * - * rct2: 0x00667E57 - */ -WindowBase* WindowParkObjectiveOpen() -{ - auto* wnd = ParkWindowOpen(WINDOW_PARK_PAGE_OBJECTIVE); - if (wnd != nullptr) + /** + * + * rct2: 0x00667DC6 + */ + WindowBase* WindowParkAwardsOpen() { - wnd->Invalidate(); - wnd->windowPos.x = ContextGetWidth() / 2 - 115; - wnd->windowPos.y = ContextGetHeight() / 2 - 87; - wnd->Invalidate(); + return ParkWindowOpen(WINDOW_PARK_PAGE_AWARDS); } - return wnd; -} - -/** - * - * rct2: 0x00667DC6 - */ -WindowBase* WindowParkAwardsOpen() -{ - return ParkWindowOpen(WINDOW_PARK_PAGE_AWARDS); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 3a096aa865..388d74f4c4 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -25,21 +25,23 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_SET_PATROL_AREA; -static constexpr int32_t WH = 54; -static constexpr int32_t WW = 104; - -enum WindowPatrolAreaWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PREVIEW, - WIDX_DECREMENT, - WIDX_INCREMENT, -}; + static constexpr StringId WINDOW_TITLE = STR_SET_PATROL_AREA; + static constexpr int32_t WH = 54; + static constexpr int32_t WW = 104; -// clang-format off + enum WindowPatrolAreaWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PREVIEW, + WIDX_DECREMENT, + WIDX_INCREMENT, + }; + + // clang-format off static Widget PatrolAreaWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({27, 17}, {44, 32}, WindowWidgetType::ImgBtn, WindowColour::Primary , ImageId(SPR_LAND_TOOL_SIZE_0) ), // preview box @@ -47,262 +49,264 @@ static Widget PatrolAreaWidgets[] = { MakeRemapWidget({54, 32}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_PATROL_AREA_TIP ), // increment size kWidgetsEnd, }; -// clang-format on + // clang-format on -class PatrolAreaWindow final : public Window -{ -public: - void OnOpen() override + class PatrolAreaWindow final : public Window { - widgets = PatrolAreaWidgets; - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); - WindowInitScrollWidgets(*this); - WindowPushOthersBelow(*this); - gLandToolSize = 4; - } - - void OnClose() override - { - // If the tool wasn't changed, turn tool off - if (PatrolAreaToolIsActive()) - ToolCancel(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: + widgets = PatrolAreaWidgets; + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + WindowInitScrollWidgets(*this); + WindowPushOthersBelow(*this); + gLandToolSize = 4; + } + + void OnClose() override + { + // If the tool wasn't changed, turn tool off + if (PatrolAreaToolIsActive()) + ToolCancel(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_PREVIEW: + InputSize(); + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_DECREMENT: + gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); + Invalidate(); + break; + case WIDX_INCREMENT: + gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); + Invalidate(); + break; + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (text.empty()) + return; + + if (widgetIndex != WIDX_PREVIEW) + return; + + const auto res = String::Parse(text); + if (res.has_value()) + { + int32_t size; + size = res.value(); + size = std::max(kLandToolMinimumSize, size); + size = std::min(kLandToolMaximumSize, size); + gLandToolSize = size; + Invalidate(); + } + } + + void OnUpdate() override + { + // Close window if another tool is open or staff window gets closed + if (!PatrolAreaToolIsActive() || !IsStaffWindowOpen()) + { Close(); - break; - case WIDX_PREVIEW: - InputSize(); - break; + } } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnPrepareDraw() override { - case WIDX_DECREMENT: - gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); - Invalidate(); - break; - case WIDX_INCREMENT: - gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); - Invalidate(); - break; + SetWidgetPressed(WIDX_PREVIEW, true); + PatrolAreaWidgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - if (widgetIndex != WIDX_PREVIEW) - return; - - const auto res = String::Parse(text); - if (res.has_value()) + void OnDraw(DrawPixelInfo& dpi) override { - int32_t size; - size = res.value(); - size = std::max(kLandToolMinimumSize, size); - size = std::min(kLandToolMaximumSize, size); - gLandToolSize = size; - Invalidate(); - } - } + DrawWidgets(dpi); - void OnUpdate() override - { - // Close window if another tool is open or staff window gets closed - if (!PatrolAreaToolIsActive() || !IsStaffWindowOpen()) + // Draw number for tool sizes bigger than 7 + if (gLandToolSize > kLandToolMaximumSizeWithSprite) + { + auto screenCoords = ScreenCoordsXY{ windowPos.x + PatrolAreaWidgets[WIDX_PREVIEW].midX(), + windowPos.y + PatrolAreaWidgets[WIDX_PREVIEW].midY() }; + auto ft = Formatter(); + ft.Add(gLandToolSize); + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - Close(); + auto mapTile = GetBestCoordsFromPos(screenCoords); + if (!mapTile) + return; + + auto stateChanged = false; + if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + stateChanged = true; + + if (gMapSelectType != MAP_SELECT_TYPE_FULL) + stateChanged = true; + + auto toolSize = std::max(1, gLandToolSize); + auto toolLength = (toolSize - 1) * 32; + + // Move to tool bottom left + mapTile->x -= (toolSize - 1) * 16; + mapTile->y -= (toolSize - 1) * 16; + mapTile = mapTile->ToTileStart(); + auto posA = *mapTile; + mapTile->x += toolLength; + mapTile->y += toolLength; + auto posB = *mapTile; + if (gMapSelectPositionA != posA || gMapSelectPositionB != posB) + stateChanged = true; + + if (stateChanged) + { + // Invalidate previous area + MapInvalidateSelectionRect(); + + // Update and invalidate new area + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = posA; + gMapSelectPositionB = posB; + MapInvalidateSelectionRect(); + } } - } - void OnPrepareDraw() override - { - SetWidgetPressed(WIDX_PREVIEW, true); - PatrolAreaWidgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - // Draw number for tool sizes bigger than 7 - if (gLandToolSize > kLandToolMaximumSizeWithSprite) + void OnToolAbort(WidgetIndex widgetIndex) override { - auto screenCoords = ScreenCoordsXY{ windowPos.x + PatrolAreaWidgets[WIDX_PREVIEW].midX(), - windowPos.y + PatrolAreaWidgets[WIDX_PREVIEW].midY() }; - auto ft = Formatter(); - ft.Add(gLandToolSize); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + HideGridlines(); + ClearPatrolAreaToRender(); + GfxInvalidateScreen(); } - } - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - auto mapTile = GetBestCoordsFromPos(screenCoords); - if (!mapTile) - return; - - auto stateChanged = false; - if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) - stateChanged = true; - - if (gMapSelectType != MAP_SELECT_TYPE_FULL) - stateChanged = true; - - auto toolSize = std::max(1, gLandToolSize); - auto toolLength = (toolSize - 1) * 32; - - // Move to tool bottom left - mapTile->x -= (toolSize - 1) * 16; - mapTile->y -= (toolSize - 1) * 16; - mapTile = mapTile->ToTileStart(); - auto posA = *mapTile; - mapTile->x += toolLength; - mapTile->y += toolLength; - auto posB = *mapTile; - if (gMapSelectPositionA != posA || gMapSelectPositionB != posB) - stateChanged = true; - - if (stateChanged) + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - // Invalidate previous area - MapInvalidateSelectionRect(); + auto mapTile = GetBestCoordsFromPos(screenCoords); + if (mapTile) + { + auto staff = GetEntity(_staffId); + if (staff != nullptr) + { + _mode = staff->IsPatrolAreaSet(*mapTile) ? StaffSetPatrolAreaMode::Unset : StaffSetPatrolAreaMode::Set; + } + } - // Update and invalidate new area - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = posA; - gMapSelectPositionB = posB; - MapInvalidateSelectionRect(); + OnToolDrag(widgetIndex, screenCoords); } - } - void OnToolAbort(WidgetIndex widgetIndex) override - { - HideGridlines(); - ClearPatrolAreaToRender(); - GfxInvalidateScreen(); - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - auto mapTile = GetBestCoordsFromPos(screenCoords); - if (mapTile) + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { auto staff = GetEntity(_staffId); if (staff != nullptr) { - _mode = staff->IsPatrolAreaSet(*mapTile) ? StaffSetPatrolAreaMode::Unset : StaffSetPatrolAreaMode::Set; + MapRange range(gMapSelectPositionA, gMapSelectPositionB); + auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction(_staffId, range, _mode); + GameActions::Execute(&staffSetPatrolAreaAction); } } - OnToolDrag(widgetIndex, screenCoords); - } - - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - auto staff = GetEntity(_staffId); - if (staff != nullptr) + EntityId GetStaffId() const { - MapRange range(gMapSelectPositionA, gMapSelectPositionB); - auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction(_staffId, range, _mode); - GameActions::Execute(&staffSetPatrolAreaAction); + return _staffId; } - } - EntityId GetStaffId() const - { - return _staffId; - } - - void SetStaffId(EntityId staffId) - { - _staffId = staffId; - EnableTool(); - } - -private: - EntityId _staffId; - StaffSetPatrolAreaMode _mode; - - void EnableTool() - { - if (PatrolAreaToolIsActive()) + void SetStaffId(EntityId staffId) { - SetPatrolAreaToRender(_staffId); - GfxInvalidateScreen(); + _staffId = staffId; + EnableTool(); } - else + + private: + EntityId _staffId; + StaffSetPatrolAreaMode _mode; + + void EnableTool() { - if (!ToolSet(*this, 0, Tool::WalkDown)) + if (PatrolAreaToolIsActive()) { - ShowGridlines(); - InputSetFlag(INPUT_FLAG_6, true); SetPatrolAreaToRender(_staffId); GfxInvalidateScreen(); } + else + { + if (!ToolSet(*this, 0, Tool::WalkDown)) + { + ShowGridlines(); + InputSetFlag(INPUT_FLAG_6, true); + SetPatrolAreaToRender(_staffId); + GfxInvalidateScreen(); + } + } } - } - void InputSize() + void InputSize() + { + 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); + } + + bool PatrolAreaToolIsActive() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WindowClass::PatrolArea) + return false; + return true; + } + + bool IsStaffWindowOpen() + { + // If staff window for this patrol area was closed, tool is no longer active + auto staffWindow = WindowFindByNumber(WindowClass::Peep, _staffId); + return staffWindow != nullptr; + } + + std::optional GetBestCoordsFromPos(const ScreenCoordsXY& pos) + { + auto coords = FootpathGetCoordinatesFromPos(pos, nullptr, nullptr); + return coords.IsNull() ? std::nullopt : std::make_optional(coords); + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowPatrolAreaOpen(EntityId staffId) { - 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); + auto w = WindowFocusOrCreate( + WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); + if (w != nullptr) + { + w->SetStaffId(staffId); + } + return w; } - bool PatrolAreaToolIsActive() + EntityId WindowPatrolAreaGetCurrentStaffId() { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WindowClass::PatrolArea) - return false; - return true; + auto current = reinterpret_cast(WindowFindByClass(WindowClass::PatrolArea)); + return current != nullptr ? current->GetStaffId() : EntityId::GetNull(); } - - bool IsStaffWindowOpen() - { - // If staff window for this patrol area was closed, tool is no longer active - auto staffWindow = WindowFindByNumber(WindowClass::Peep, _staffId); - return staffWindow != nullptr; - } - - std::optional GetBestCoordsFromPos(const ScreenCoordsXY& pos) - { - auto coords = FootpathGetCoordinatesFromPos(pos, nullptr, nullptr); - return coords.IsNull() ? std::nullopt : std::make_optional(coords); - } - - void OnResize() override - { - ResizeFrame(); - } -}; - -WindowBase* WindowPatrolAreaOpen(EntityId staffId) -{ - auto w = WindowFocusOrCreate( - WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); - if (w != nullptr) - { - w->SetStaffId(staffId); - } - return w; -} - -EntityId WindowPatrolAreaGetCurrentStaffId() -{ - auto current = reinterpret_cast(WindowFindByClass(WindowClass::PatrolArea)); - return current != nullptr ? current->GetStaffId() : EntityId::GetNull(); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index a9d2f50957..3a76fc9eac 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -21,7 +21,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowPlayerPage { WINDOW_PLAYER_PAGE_OVERVIEW, WINDOW_PLAYER_PAGE_STATISTICS, @@ -74,579 +76,580 @@ static Widget *window_player_page_widgets[] = { #pragma endregion -// clang-format on + // clang-format on -class PlayerWindow final : public Window -{ - int16_t _previousRotation = -1; - bool _drawViewport = true; - -public: - void Init(const uint8_t id) + class PlayerWindow final : public Window { - number = id; - InitScrollWidgets(); - SetPage(WINDOW_PLAYER_PAGE_OVERVIEW); - } + int16_t _previousRotation = -1; + bool _drawViewport = true; + + public: + void Init(const uint8_t id) + { + number = id; + InitScrollWidgets(); + SetPage(WINDOW_PLAYER_PAGE_OVERVIEW); + } #pragma region Events - void OnOpen() override - { - page = 0; - frame_no = 0; - list_information_type = 0; - min_width = 210; - min_height = 134; - max_width = 500; - max_height = 450; - - Invalidate(); - - widgets = window_player_page_widgets[WINDOW_PLAYER_PAGE_OVERVIEW]; - hold_down_widgets = 0; - pressed_widgets = 0; - } - - void OnResize() override - { - switch (page) + void OnOpen() override { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnResizeOverview(); - break; + page = 0; + frame_no = 0; + list_information_type = 0; + min_width = 210; + min_height = 134; + max_width = 500; + max_height = 450; - case WINDOW_PLAYER_PAGE_STATISTICS: - OnResizeStatistics(); - break; - } - } + Invalidate(); - void OnUpdate() override - { - switch (page) - { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnUpdateOverview(); - break; - - case WINDOW_PLAYER_PAGE_STATISTICS: - OnUpdateStatistics(); - break; - } - } - - void OnPrepareDraw() override - { - switch (page) - { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnPrepareDrawOverview(); - break; - - case WINDOW_PLAYER_PAGE_STATISTICS: - OnPrepareDrawStatistics(); - break; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnDrawOverview(dpi); - break; - - case WINDOW_PLAYER_PAGE_STATISTICS: - OnDrawStatistics(dpi); - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) - { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnMouseDownOverview(widgetIndex); - break; - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - SetPage(widgetIndex - WIDX_TAB_1); - return; + widgets = window_player_page_widgets[WINDOW_PLAYER_PAGE_OVERVIEW]; + hold_down_widgets = 0; + pressed_widgets = 0; } - switch (page) + void OnResize() override { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnMouseUpOverview(widgetIndex); - break; - } - } + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnResizeOverview(); + break; - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - switch (page) + case WINDOW_PLAYER_PAGE_STATISTICS: + OnResizeStatistics(); + break; + } + } + + void OnUpdate() override { - case WINDOW_PLAYER_PAGE_OVERVIEW: - OnDropdownOverview(widgetIndex, selectedIndex); - break; + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnUpdateOverview(); + break; + + case WINDOW_PLAYER_PAGE_STATISTICS: + OnUpdateStatistics(); + break; + } + } + + void OnPrepareDraw() override + { + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnPrepareDrawOverview(); + break; + + case WINDOW_PLAYER_PAGE_STATISTICS: + OnPrepareDrawStatistics(); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnDrawOverview(dpi); + break; + + case WINDOW_PLAYER_PAGE_STATISTICS: + OnDrawStatistics(dpi); + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnMouseDownOverview(widgetIndex); + break; + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + SetPage(widgetIndex - WIDX_TAB_1); + return; + } + + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnMouseUpOverview(widgetIndex); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + switch (page) + { + case WINDOW_PLAYER_PAGE_OVERVIEW: + OnDropdownOverview(widgetIndex, selectedIndex); + break; + } } - } #pragma endregion -private: - void SetPage(int32_t newPage) - { - int32_t originalPage = page; - - page = newPage; - frame_no = 0; - - hold_down_widgets = 0; - pressed_widgets = 0; - widgets = window_player_page_widgets[newPage]; - Invalidate(); - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - Invalidate(); - - if (page == WINDOW_PLAYER_PAGE_OVERVIEW) + private: + void SetPage(int32_t newPage) { - if (viewport == nullptr) + int32_t originalPage = page; + + page = newPage; + frame_no = 0; + + hold_down_widgets = 0; + pressed_widgets = 0; + widgets = window_player_page_widgets[newPage]; + Invalidate(); + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + Invalidate(); + + if (page == WINDOW_PLAYER_PAGE_OVERVIEW) { - const auto viewportFocus = Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); - ViewportCreate(this, windowPos, width, height, viewportFocus); - flags |= WF_NO_SCROLLING; - OnPrepareDraw(); - UpdateViewport(false); - } - else if (originalPage != page) - { - OnPrepareDraw(); - UpdateViewport(false); - } - } - else - { - RemoveViewport(); - } - } - - void DrawTabImages(DrawPixelInfo& dpi) - { - Widget* widget; - - // Tab 1 - if (!IsWidgetDisabled(WIDX_TAB_1)) - { - widget = &this->widgets[WIDX_TAB_1]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; - GfxDrawSprite(dpi, ImageId(SPR_PEEP_LARGE_FACE_NORMAL), screenCoords); - } - - // Tab 2 - if (!IsWidgetDisabled(WIDX_TAB_2)) - { - widget = &this->widgets[WIDX_TAB_2]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; - int32_t imageId = SPR_TAB_FINANCES_SUMMARY_0; - - if (page == WINDOW_PLAYER_PAGE_STATISTICS) - { - imageId += (frame_no / 2) & 7; - } - - GfxDrawSprite(dpi, ImageId(imageId), screenCoords); - } - } - - void UpdateViewport(bool scroll) - { - int32_t playerIndex = NetworkGetPlayerIndex(static_cast(number)); - if (playerIndex == -1) - { - return; - } - - if (viewport != nullptr) - { - auto coord = NetworkGetPlayerLastActionCoord(playerIndex); - if (coord.x != 0 || coord.y != 0 || coord.z != 0) - { - auto centreLoc = centre_2d_coordinates(coord, viewport); - if (!centreLoc.has_value()) + if (viewport == nullptr) { - return; + const auto viewportFocus = Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ()); + ViewportCreate(this, windowPos, width, height, viewportFocus); + flags |= WF_NO_SCROLLING; + OnPrepareDraw(); + UpdateViewport(false); } - // Don't scroll if the view was originally undefined - if (!_drawViewport) + else if (originalPage != page) { - scroll = false; + OnPrepareDraw(); + UpdateViewport(false); } - - if (!scroll || savedViewPos != centreLoc.value()) - { - flags |= WF_SCROLLING_TO_LOCATION; - savedViewPos = centreLoc.value(); - if (!scroll) - { - viewport->viewPos = centreLoc.value(); - } - InvalidateWidget(WIDX_VIEWPORT); - } - - // Draw the viewport - _drawViewport = true; } else { - // Don't draw the viewport - _drawViewport = false; + RemoveViewport(); } } - } - void UpdateTitle() - { - auto ft = Formatter::Common(); - int32_t player = NetworkGetPlayerIndex(static_cast(number)); - if (player != -1) + void DrawTabImages(DrawPixelInfo& dpi) { - ft.Add(NetworkGetPlayerName(player)); // set title caption to player name - } - else - { - ft.Add(""); - } - } + Widget* widget; -#pragma region Overview - - void OnResizeOverview() - { - WindowSetResize(*this, 240, 170, 500, 300); - } - - void OnUpdateOverview() - { - frame_no++; - InvalidateWidget(WIDX_TAB_1 + page); - - if (NetworkGetPlayerIndex(static_cast(number)) == -1) - { - Close(); - return; - } - - // Update viewport - bool scroll = true; - - // Use this spare window field for rotation check - if (_previousRotation != GetCurrentRotation()) - { - _previousRotation = GetCurrentRotation(); - scroll = false; - } - UpdateViewport(scroll); - } - - void OnPrepareDrawOverview() - { - int32_t playerIndex = NetworkGetPlayerIndex(static_cast(number)); - if (playerIndex == -1) - { - return; - } - - if (window_player_page_widgets[page] != widgets) - { - widgets = window_player_page_widgets[page]; - InitScrollWidgets(); - } - - pressed_widgets &= ~(WIDX_TAB_1); - pressed_widgets &= ~(WIDX_TAB_2); - pressed_widgets |= 1uLL << (page + WIDX_TAB_1); - - UpdateTitle(); - - ResizeFrameWithPage(); - widgets[WIDX_LOCATE].right = width - 2; - widgets[WIDX_LOCATE].left = width - 25; - widgets[WIDX_KICK].right = width - 2; - widgets[WIDX_KICK].left = width - 25; - widgets[WIDX_VIEWPORT].right = width - 26; - widgets[WIDX_VIEWPORT].bottom = height - 14; - - int32_t groupDropdownWidth = widgets[WIDX_GROUP].width(); - widgets[WIDX_GROUP].left = (width - groupDropdownWidth) / 2; - widgets[WIDX_GROUP].right = widgets[WIDX_GROUP].left + groupDropdownWidth; - widgets[WIDX_GROUP_DROPDOWN].left = widgets[WIDX_GROUP].right - 10; - widgets[WIDX_GROUP_DROPDOWN].right = widgets[WIDX_GROUP].right; - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_2); - - if (viewport != nullptr) - { - Widget* viewportWidget = &window_player_overview_widgets[WIDX_VIEWPORT]; - - viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget->left, viewportWidget->top }; - viewport->width = viewportWidget->width(); - viewport->height = viewportWidget->height(); - viewport->view_width = viewport->zoom.ApplyTo(viewport->width); - viewport->view_height = viewport->zoom.ApplyTo(viewport->height); - } - - // Only enable kick button for other players - const bool canKick = NetworkCanPerformAction(NetworkGetCurrentPlayerGroupIndex(), NetworkPermission::KickPlayer); - const bool isServer = NetworkGetPlayerFlags(playerIndex) & NETWORK_PLAYER_FLAG_ISSERVER; - const bool isOwnWindow = (NetworkGetCurrentPlayerId() == number); - WidgetSetEnabled(*this, WIDX_KICK, canKick && !isOwnWindow && !isServer); - } - - void OnDrawOverview(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - int32_t player = NetworkGetPlayerIndex(static_cast(number)); - if (player == -1) - { - return; - } - - // Draw current group - int32_t groupindex = NetworkGetGroupIndex(NetworkGetPlayerGroup(player)); - if (groupindex != -1) - { - Widget* widget = &window_player_overview_widgets[WIDX_GROUP]; - - thread_local std::string _buffer; - _buffer.assign("{WINDOW_COLOUR_2}"); - _buffer += NetworkGetGroupName(groupindex); - auto ft = Formatter(); - ft.Add(_buffer.c_str()); - - DrawTextEllipsised( - dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, - { TextAlignment::CENTRE }); - } - - // Draw ping - auto screenCoords = windowPos + ScreenCoordsXY{ 90, 24 }; - - auto ft = Formatter(); - ft.Add(STR_PING); - DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); - char ping[64]; - snprintf(ping, 64, "%d ms", NetworkGetPlayerPing(player)); - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { colours[2] }); - - // Draw last action - screenCoords = windowPos + ScreenCoordsXY{ width / 2, height - 13 }; - int32_t updatedWidth = this->width - 8; - int32_t lastaction = NetworkGetPlayerLastAction(player, 0); - ft = Formatter(); - if (lastaction != -999) - { - ft.Add(NetworkGetActionNameStringID(lastaction)); - } - else - { - ft.Add(STR_ACTION_NA); - } - DrawTextEllipsised(dpi, screenCoords, updatedWidth, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE }); - - if (viewport != nullptr && _drawViewport) - { - WindowDrawViewport(dpi, *this); - } - } - - void OnMouseDownOverview(WidgetIndex widgetIndex) - { - auto* widget = &widgets[widgetIndex]; - switch (widgetIndex) - { - case WIDX_GROUP_DROPDOWN: - ShowGroupDropdownOverview(widget); - break; - } - } - - void OnMouseUpOverview(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_LOCATE: + // Tab 1 + if (!IsWidgetDisabled(WIDX_TAB_1)) { - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) + widget = &this->widgets[WIDX_TAB_1]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; + GfxDrawSprite(dpi, ImageId(SPR_PEEP_LARGE_FACE_NORMAL), screenCoords); + } + + // Tab 2 + if (!IsWidgetDisabled(WIDX_TAB_2)) + { + widget = &this->widgets[WIDX_TAB_2]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; + int32_t imageId = SPR_TAB_FINANCES_SUMMARY_0; + + if (page == WINDOW_PLAYER_PAGE_STATISTICS) { - int32_t player = NetworkGetPlayerIndex(static_cast(number)); - if (player == -1) + imageId += (frame_no / 2) & 7; + } + + GfxDrawSprite(dpi, ImageId(imageId), screenCoords); + } + } + + void UpdateViewport(bool scroll) + { + int32_t playerIndex = NetworkGetPlayerIndex(static_cast(number)); + if (playerIndex == -1) + { + return; + } + + if (viewport != nullptr) + { + auto coord = NetworkGetPlayerLastActionCoord(playerIndex); + if (coord.x != 0 || coord.y != 0 || coord.z != 0) + { + auto centreLoc = centre_2d_coordinates(coord, viewport); + if (!centreLoc.has_value()) { return; } - auto coord = NetworkGetPlayerLastActionCoord(player); - if (coord.x || coord.y || coord.z) + // Don't scroll if the view was originally undefined + if (!_drawViewport) { - WindowScrollToLocation(*mainWindow, coord); + scroll = false; } + + if (!scroll || savedViewPos != centreLoc.value()) + { + flags |= WF_SCROLLING_TO_LOCATION; + savedViewPos = centreLoc.value(); + if (!scroll) + { + viewport->viewPos = centreLoc.value(); + } + InvalidateWidget(WIDX_VIEWPORT); + } + + // Draw the viewport + _drawViewport = true; + } + else + { + // Don't draw the viewport + _drawViewport = false; } } - break; - case WIDX_KICK: + } + + void UpdateTitle() + { + auto ft = Formatter::Common(); + int32_t player = NetworkGetPlayerIndex(static_cast(number)); + if (player != -1) { - auto kickPlayerAction = PlayerKickAction(number); - GameActions::Execute(&kickPlayerAction); + ft.Add(NetworkGetPlayerName(player)); // set title caption to player name } - break; - } - } - - void OnDropdownOverview(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - const auto playerId = static_cast(number); - const auto playerIdx = NetworkGetPlayerIndex(playerId); - if (playerIdx == -1) - { - return; - } - if (dropdownIndex == -1) - { - return; - } - const auto groupId = NetworkGetGroupID(dropdownIndex); - const auto windowHandle = std::make_pair(classification, number); - auto playerSetGroupAction = PlayerSetGroupAction(playerId, groupId); - playerSetGroupAction.SetCallback([windowHandle](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + else { - WindowInvalidateByNumber(windowHandle.first, windowHandle.second); + ft.Add(""); } - }); - GameActions::Execute(&playerSetGroupAction); - } - - void ShowGroupDropdownOverview(Widget* widget) - { - Widget* dropdownWidget; - int32_t numItems, i; - int32_t player = NetworkGetPlayerIndex(static_cast(number)); - if (player == -1) - { - return; } - dropdownWidget = widget - 1; +#pragma region Overview - numItems = NetworkGetNumGroups(); - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, 0, numItems, widget->right - dropdownWidget->left); - - for (i = 0; i < NetworkGetNumGroups(); i++) + void OnResizeOverview() { - gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(NetworkGetGroupName(i)); + WindowSetResize(*this, 240, 170, 500, 300); } - Dropdown::SetChecked(NetworkGetGroupIndex(NetworkGetPlayerGroup(player)), true); - } + void OnUpdateOverview() + { + frame_no++; + InvalidateWidget(WIDX_TAB_1 + page); + + if (NetworkGetPlayerIndex(static_cast(number)) == -1) + { + Close(); + return; + } + + // Update viewport + bool scroll = true; + + // Use this spare window field for rotation check + if (_previousRotation != GetCurrentRotation()) + { + _previousRotation = GetCurrentRotation(); + scroll = false; + } + UpdateViewport(scroll); + } + + void OnPrepareDrawOverview() + { + int32_t playerIndex = NetworkGetPlayerIndex(static_cast(number)); + if (playerIndex == -1) + { + return; + } + + if (window_player_page_widgets[page] != widgets) + { + widgets = window_player_page_widgets[page]; + InitScrollWidgets(); + } + + pressed_widgets &= ~(WIDX_TAB_1); + pressed_widgets &= ~(WIDX_TAB_2); + pressed_widgets |= 1uLL << (page + WIDX_TAB_1); + + UpdateTitle(); + + ResizeFrameWithPage(); + widgets[WIDX_LOCATE].right = width - 2; + widgets[WIDX_LOCATE].left = width - 25; + widgets[WIDX_KICK].right = width - 2; + widgets[WIDX_KICK].left = width - 25; + widgets[WIDX_VIEWPORT].right = width - 26; + widgets[WIDX_VIEWPORT].bottom = height - 14; + + int32_t groupDropdownWidth = widgets[WIDX_GROUP].width(); + widgets[WIDX_GROUP].left = (width - groupDropdownWidth) / 2; + widgets[WIDX_GROUP].right = widgets[WIDX_GROUP].left + groupDropdownWidth; + widgets[WIDX_GROUP_DROPDOWN].left = widgets[WIDX_GROUP].right - 10; + widgets[WIDX_GROUP_DROPDOWN].right = widgets[WIDX_GROUP].right; + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_2); + + if (viewport != nullptr) + { + Widget* viewportWidget = &window_player_overview_widgets[WIDX_VIEWPORT]; + + viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget->left, viewportWidget->top }; + viewport->width = viewportWidget->width(); + viewport->height = viewportWidget->height(); + viewport->view_width = viewport->zoom.ApplyTo(viewport->width); + viewport->view_height = viewport->zoom.ApplyTo(viewport->height); + } + + // Only enable kick button for other players + const bool canKick = NetworkCanPerformAction(NetworkGetCurrentPlayerGroupIndex(), NetworkPermission::KickPlayer); + const bool isServer = NetworkGetPlayerFlags(playerIndex) & NETWORK_PLAYER_FLAG_ISSERVER; + const bool isOwnWindow = (NetworkGetCurrentPlayerId() == number); + WidgetSetEnabled(*this, WIDX_KICK, canKick && !isOwnWindow && !isServer); + } + + void OnDrawOverview(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + int32_t player = NetworkGetPlayerIndex(static_cast(number)); + if (player == -1) + { + return; + } + + // Draw current group + int32_t groupindex = NetworkGetGroupIndex(NetworkGetPlayerGroup(player)); + if (groupindex != -1) + { + Widget* widget = &window_player_overview_widgets[WIDX_GROUP]; + + thread_local std::string _buffer; + _buffer.assign("{WINDOW_COLOUR_2}"); + _buffer += NetworkGetGroupName(groupindex); + auto ft = Formatter(); + ft.Add(_buffer.c_str()); + + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ widget->midX() - 5, widget->top }, widget->width() - 8, STR_STRING, ft, + { TextAlignment::CENTRE }); + } + + // Draw ping + auto screenCoords = windowPos + ScreenCoordsXY{ 90, 24 }; + + auto ft = Formatter(); + ft.Add(STR_PING); + DrawTextBasic(dpi, screenCoords, STR_WINDOW_COLOUR_2_STRINGID, ft); + char ping[64]; + snprintf(ping, 64, "%d ms", NetworkGetPlayerPing(player)); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(30, 0), ping, { colours[2] }); + + // Draw last action + screenCoords = windowPos + ScreenCoordsXY{ width / 2, height - 13 }; + int32_t updatedWidth = this->width - 8; + int32_t lastaction = NetworkGetPlayerLastAction(player, 0); + ft = Formatter(); + if (lastaction != -999) + { + ft.Add(NetworkGetActionNameStringID(lastaction)); + } + else + { + ft.Add(STR_ACTION_NA); + } + DrawTextEllipsised(dpi, screenCoords, updatedWidth, STR_LAST_ACTION_RAN, ft, { TextAlignment::CENTRE }); + + if (viewport != nullptr && _drawViewport) + { + WindowDrawViewport(dpi, *this); + } + } + + void OnMouseDownOverview(WidgetIndex widgetIndex) + { + auto* widget = &widgets[widgetIndex]; + switch (widgetIndex) + { + case WIDX_GROUP_DROPDOWN: + ShowGroupDropdownOverview(widget); + break; + } + } + + void OnMouseUpOverview(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_LOCATE: + { + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + { + int32_t player = NetworkGetPlayerIndex(static_cast(number)); + if (player == -1) + { + return; + } + auto coord = NetworkGetPlayerLastActionCoord(player); + if (coord.x || coord.y || coord.z) + { + WindowScrollToLocation(*mainWindow, coord); + } + } + } + break; + case WIDX_KICK: + { + auto kickPlayerAction = PlayerKickAction(number); + GameActions::Execute(&kickPlayerAction); + } + break; + } + } + + void OnDropdownOverview(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + const auto playerId = static_cast(number); + const auto playerIdx = NetworkGetPlayerIndex(playerId); + if (playerIdx == -1) + { + return; + } + if (dropdownIndex == -1) + { + return; + } + const auto groupId = NetworkGetGroupID(dropdownIndex); + const auto windowHandle = std::make_pair(classification, number); + auto playerSetGroupAction = PlayerSetGroupAction(playerId, groupId); + playerSetGroupAction.SetCallback([windowHandle](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + WindowInvalidateByNumber(windowHandle.first, windowHandle.second); + } + }); + GameActions::Execute(&playerSetGroupAction); + } + + void ShowGroupDropdownOverview(Widget* widget) + { + Widget* dropdownWidget; + int32_t numItems, i; + int32_t player = NetworkGetPlayerIndex(static_cast(number)); + if (player == -1) + { + return; + } + + dropdownWidget = widget - 1; + + numItems = NetworkGetNumGroups(); + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, 0, numItems, widget->right - dropdownWidget->left); + + for (i = 0; i < NetworkGetNumGroups(); i++) + { + gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i].Args = reinterpret_cast(NetworkGetGroupName(i)); + } + + Dropdown::SetChecked(NetworkGetGroupIndex(NetworkGetPlayerGroup(player)), true); + } #pragma endregion #pragma region Statistics - void OnResizeStatistics() - { - WindowSetResize(*this, 210, 80, 210, 80); - } - - void OnUpdateStatistics() - { - frame_no++; - InvalidateWidget(WIDX_TAB_1 + page); - - if (NetworkGetPlayerIndex(static_cast(number)) == -1) + void OnResizeStatistics() { - Close(); - } - } - - void OnPrepareDrawStatistics() - { - if (window_player_page_widgets[page] != widgets) - { - widgets = window_player_page_widgets[page]; - InitScrollWidgets(); + WindowSetResize(*this, 210, 80, 210, 80); } - pressed_widgets &= ~(WIDX_TAB_1); - pressed_widgets &= ~(WIDX_TAB_2); - pressed_widgets |= 1uLL << (page + WIDX_TAB_1); - - UpdateTitle(); - - ResizeFrameWithPage(); - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_2); - } - - void OnDrawStatistics(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - int32_t player = NetworkGetPlayerIndex(static_cast(number)); - if (player == -1) + void OnUpdateStatistics() { - return; + frame_no++; + InvalidateWidget(WIDX_TAB_1 + page); + + if (NetworkGetPlayerIndex(static_cast(number)) == -1) + { + Close(); + } } - auto screenCoords = windowPos - + ScreenCoordsXY{ window_player_overview_widgets[WIDX_PAGE_BACKGROUND].left + 4, - window_player_overview_widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + void OnPrepareDrawStatistics() + { + if (window_player_page_widgets[page] != widgets) + { + widgets = window_player_page_widgets[page]; + InitScrollWidgets(); + } - auto ft = Formatter(); - ft.Add(NetworkGetPlayerCommandsRan(player)); - DrawTextBasic(dpi, screenCoords, STR_COMMANDS_RAN, ft); + pressed_widgets &= ~(WIDX_TAB_1); + pressed_widgets &= ~(WIDX_TAB_2); + pressed_widgets |= 1uLL << (page + WIDX_TAB_1); - screenCoords.y += LIST_ROW_HEIGHT; + UpdateTitle(); - ft = Formatter(); - ft.Add(NetworkGetPlayerMoneySpent(player)); - DrawTextBasic(dpi, screenCoords, STR_MONEY_SPENT, ft); - } + ResizeFrameWithPage(); + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_2); + } + + void OnDrawStatistics(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + int32_t player = NetworkGetPlayerIndex(static_cast(number)); + if (player == -1) + { + return; + } + + auto screenCoords = windowPos + + ScreenCoordsXY{ window_player_overview_widgets[WIDX_PAGE_BACKGROUND].left + 4, + window_player_overview_widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + + auto ft = Formatter(); + ft.Add(NetworkGetPlayerCommandsRan(player)); + DrawTextBasic(dpi, screenCoords, STR_COMMANDS_RAN, ft); + + screenCoords.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(NetworkGetPlayerMoneySpent(player)); + DrawTextBasic(dpi, screenCoords, STR_MONEY_SPENT, ft); + } #pragma endregion -}; + }; -WindowBase* WindowPlayerOpen(uint8_t id) -{ - auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Player, id)); - if (window == nullptr) + WindowBase* WindowPlayerOpen(uint8_t id) { - window = WindowCreate(WindowClass::Player, 240, 170, WF_RESIZABLE); + auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Player, id)); + if (window == nullptr) + { + window = WindowCreate(WindowClass::Player, 240, 170, WF_RESIZABLE); + } + + window->Init(id); + + return window; } - - window->Init(id); - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index a98dca1d61..a25a3edb70 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -18,12 +18,12 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WW = 200; + static constexpr int32_t WH = 100; -static constexpr int32_t WW = 200; -static constexpr int32_t WH = 100; - -// clang-format off + // clang-format off enum WindowRideRefurbishWidgetIdx { WIDX_BACKGROUND, @@ -40,85 +40,87 @@ static Widget window_ride_refurbish_widgets[] = MakeWidget({ WW - 95, WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_SAVE_PROMPT_CANCEL), kWidgetsEnd, }; -// clang-format on + // clang-format on -class RefurbishRidePromptWindow final : public Window -{ - money64 _demolishRideCost; - -public: - void SetRide(const Ride& currentRide) + class RefurbishRidePromptWindow final : public Window { - rideId = currentRide.id; - _demolishRideCost = -RideGetRefundPrice(currentRide); - } + money64 _demolishRideCost; - void OnOpen() override - { - widgets = window_ride_refurbish_widgets; - WindowInitScrollWidgets(*this); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void SetRide(const Ride& currentRide) { - case WIDX_REFURBISH: + rideId = currentRide.id; + _demolishRideCost = -RideGetRefundPrice(currentRide); + } + + void OnOpen() override + { + widgets = window_ride_refurbish_widgets; + WindowInitScrollWidgets(*this); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) { - auto gameAction = RideDemolishAction(rideId, RIDE_MODIFY_RENEW); - GameActions::Execute(&gameAction); - break; + case WIDX_REFURBISH: + { + auto gameAction = RideDemolishAction(rideId, RIDE_MODIFY_RENEW); + GameActions::Execute(&gameAction); + break; + } + case WIDX_CANCEL: + case WIDX_CLOSE: + Close(); + break; } - case WIDX_CANCEL: - case WIDX_CLOSE: - Close(); - break; } - } - void OnDraw(DrawPixelInfo& dpi) override - { - WindowDrawWidgets(*this, dpi); - - auto currentRide = GetRide(rideId); - if (currentRide != nullptr) + void OnDraw(DrawPixelInfo& dpi) override { - auto stringId = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY - : STR_REFURBISH_RIDE_ID_MONEY; - auto ft = Formatter(); - currentRide->FormatNameTo(ft); - ft.Add(_demolishRideCost / 2); + WindowDrawWidgets(*this, dpi); - ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); - DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); + auto currentRide = GetRide(rideId); + if (currentRide != nullptr) + { + auto stringId = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? STR_REFURBISH_RIDE_ID_NO_MONEY + : STR_REFURBISH_RIDE_ID_MONEY; + auto ft = Formatter(); + currentRide->FormatNameTo(ft); + ft.Add(_demolishRideCost / 2); + + ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3); + DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE }); + } } - } - void OnResize() override + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride) { - ResizeFrame(); + WindowBase* w; + RefurbishRidePromptWindow* newWindow; + + w = WindowFindByClass(WindowClass::DemolishRidePrompt); + if (w != nullptr) + { + auto windowPos = w->windowPos; + WindowClose(*w); + newWindow = WindowCreate( + WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); + } + else + { + newWindow = WindowCreate( + WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + } + + newWindow->SetRide(ride); + + return newWindow; } -}; - -WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride) -{ - WindowBase* w; - RefurbishRidePromptWindow* newWindow; - - w = WindowFindByClass(WindowClass::DemolishRidePrompt); - if (w != nullptr) - { - auto windowPos = w->windowPos; - WindowClose(*w); - newWindow = WindowCreate(WindowClass::DemolishRidePrompt, windowPos, WW, WH, WF_TRANSPARENT); - } - else - { - newWindow = WindowCreate( - WindowClass::DemolishRidePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); - } - - newWindow->SetRide(ride); - - return newWindow; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 7ae443680a..02a254bb8d 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -24,14 +24,14 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WH_DEVELOPMENT = 196; + static constexpr int32_t WW_DEVELOPMENT = 300; + static constexpr int32_t WH_FUNDING = 207; + static constexpr int32_t WW_FUNDING = 320; -static constexpr int32_t WH_DEVELOPMENT = 196; -static constexpr int32_t WW_DEVELOPMENT = 300; -static constexpr int32_t WH_FUNDING = 207; -static constexpr int32_t WW_FUNDING = 320; - -// clang-format off + // clang-format off enum { WINDOW_RESEARCH_PAGE_DEVELOPMENT, WINDOW_RESEARCH_PAGE_FUNDING, @@ -102,502 +102,504 @@ static Widget *window_research_page_widgets[] = { #pragma endregion -// clang-format on + // clang-format on -const int32_t window_research_tab_animation_loops[] = { - 16, - 16, -}; + const int32_t window_research_tab_animation_loops[] = { + 16, + 16, + }; -static constexpr StringId ResearchStageNames[] = { - STR_RESEARCH_STAGE_INITIAL_RESEARCH, - STR_RESEARCH_STAGE_DESIGNING, - STR_RESEARCH_STAGE_COMPLETING_DESIGN, - STR_RESEARCH_STAGE_UNKNOWN, -}; + static constexpr StringId ResearchStageNames[] = { + STR_RESEARCH_STAGE_INITIAL_RESEARCH, + STR_RESEARCH_STAGE_DESIGNING, + STR_RESEARCH_STAGE_COMPLETING_DESIGN, + STR_RESEARCH_STAGE_UNKNOWN, + }; -class ResearchWindow final : public Window -{ -public: - void OnOpen() override + class ResearchWindow final : public Window { - widgets = window_research_page_widgets[WINDOW_RESEARCH_PAGE_DEVELOPMENT]; - width = WW_DEVELOPMENT; - height = WH_DEVELOPMENT; - ResearchUpdateUncompletedTypes(); - } - - void SetPage(int32_t newPageIndex) - { - page = newPageIndex; - frame_no = 0; - RemoveViewport(); - - hold_down_widgets = 0; - widgets = window_research_page_widgets[newPageIndex]; - disabled_widgets = 0; - pressed_widgets = 0; - - Invalidate(); - if (newPageIndex == WINDOW_RESEARCH_PAGE_DEVELOPMENT) + public: + void OnOpen() override { + widgets = window_research_page_widgets[WINDOW_RESEARCH_PAGE_DEVELOPMENT]; width = WW_DEVELOPMENT; height = WH_DEVELOPMENT; + ResearchUpdateUncompletedTypes(); } - else + + void SetPage(int32_t newPageIndex) { - width = WW_FUNDING; - height = WH_FUNDING; - } - OnResize(); - - InitScrollWidgets(); - Invalidate(); - } - -private: - void OnUpdate() override - { - // Tab animation - if (++frame_no >= window_research_tab_animation_loops[page]) + page = newPageIndex; frame_no = 0; + RemoveViewport(); - switch (page) - { - case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + hold_down_widgets = 0; + widgets = window_research_page_widgets[newPageIndex]; + disabled_widgets = 0; + pressed_widgets = 0; + + Invalidate(); + if (newPageIndex == WINDOW_RESEARCH_PAGE_DEVELOPMENT) { - InvalidateWidget(WIDX_TAB_1); - break; + width = WW_DEVELOPMENT; + height = WH_DEVELOPMENT; } - case WINDOW_RESEARCH_PAGE_FUNDING: + else { - InvalidateWidget(WIDX_TAB_2); - break; + width = WW_FUNDING; + height = WH_FUNDING; } - } - } + OnResize(); - void OnMouseDown(WidgetIndex widgetIndex) override - { - if (page == WINDOW_RESEARCH_PAGE_FUNDING) - { - WindowResearchFundingMouseDown(this, widgetIndex, WIDX_RESEARCH_FUNDING); - } - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - // Switch tab or close - switch (widgetIndex) - { - case WIDX_CLOSE: - { - Close(); - break; - } - case WIDX_TAB_1: - case WIDX_TAB_2: - { - SetPage(widgetIndex - WIDX_TAB_1); - break; - } - } - - // Process mouse up for specific tab - switch (page) - { - case WINDOW_RESEARCH_PAGE_DEVELOPMENT: - { - WindowResearchDevelopmentMouseUp(widgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - break; - } - case WINDOW_RESEARCH_PAGE_FUNDING: - { - WindowResearchFundingMouseUp(widgetIndex, WIDX_RESEARCH_FUNDING); - break; - } - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (page == WINDOW_RESEARCH_PAGE_FUNDING) - { - WindowResearchFundingDropdown(widgetIndex, selectedIndex, WIDX_RESEARCH_FUNDING); - } - } - - void OnPrepareDraw() override - { - auto* targetWidgets = window_research_page_widgets[page]; - - if (widgets != targetWidgets) - { - widgets = targetWidgets; InitScrollWidgets(); + Invalidate(); } - for (auto i = 0; i < WINDOW_RESEARCH_PAGE_COUNT; i++) + private: + void OnUpdate() override { - SetWidgetPressed(WIDX_TAB_1 + i, false); + // Tab animation + if (++frame_no >= window_research_tab_animation_loops[page]) + frame_no = 0; + + switch (page) + { + case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + { + InvalidateWidget(WIDX_TAB_1); + break; + } + case WINDOW_RESEARCH_PAGE_FUNDING: + { + InvalidateWidget(WIDX_TAB_2); + break; + } + } } - SetWidgetPressed(WIDX_TAB_1 + page, true); - - switch (page) + void OnMouseDown(WidgetIndex widgetIndex) override { - case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + if (page == WINDOW_RESEARCH_PAGE_FUNDING) { - WindowResearchDevelopmentPrepareDraw(this, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - break; - } - case WINDOW_RESEARCH_PAGE_FUNDING: - { - WindowResearchFundingPrepareDraw(this, WIDX_RESEARCH_FUNDING); - break; + WindowResearchFundingMouseDown(this, widgetIndex, WIDX_RESEARCH_FUNDING); } } - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - switch (page) + void OnMouseUp(WidgetIndex widgetIndex) override { - case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + // Switch tab or close + switch (widgetIndex) { - WindowResearchDevelopmentDraw(this, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - break; + case WIDX_CLOSE: + { + Close(); + break; + } + case WIDX_TAB_1: + case WIDX_TAB_2: + { + SetPage(widgetIndex - WIDX_TAB_1); + break; + } } - case WINDOW_RESEARCH_PAGE_FUNDING: + + // Process mouse up for specific tab + switch (page) { - WindowResearchFundingDraw(this, dpi); - break; + case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + { + WindowResearchDevelopmentMouseUp(widgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + break; + } + case WINDOW_RESEARCH_PAGE_FUNDING: + { + WindowResearchFundingMouseUp(widgetIndex, WIDX_RESEARCH_FUNDING); + break; + } } } - } - void OnResize() override - { - ResizeFrameWithPage(); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t tabPage, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + tabPage; - - if (!IsWidgetDisabled(widgetIndex)) + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override { - if (page == tabPage) + if (page == WINDOW_RESEARCH_PAGE_FUNDING) { - int32_t frame = frame_no / 2; - if (tabPage == WINDOW_RESEARCH_PAGE_DEVELOPMENT) - frame %= 8; - spriteIndex += frame; + WindowResearchFundingDropdown(widgetIndex, selectedIndex, WIDX_RESEARCH_FUNDING); + } + } + + void OnPrepareDraw() override + { + auto* targetWidgets = window_research_page_widgets[page]; + + if (widgets != targetWidgets) + { + widgets = targetWidgets; + InitScrollWidgets(); } - GfxDrawSprite( - dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + for (auto i = 0; i < WINDOW_RESEARCH_PAGE_COUNT; i++) + { + SetWidgetPressed(WIDX_TAB_1 + i, false); + } + + SetWidgetPressed(WIDX_TAB_1 + page, true); + + switch (page) + { + case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + { + WindowResearchDevelopmentPrepareDraw(this, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + break; + } + case WINDOW_RESEARCH_PAGE_FUNDING: + { + WindowResearchFundingPrepareDraw(this, WIDX_RESEARCH_FUNDING); + break; + } + } } - } - void DrawTabImages(DrawPixelInfo& dpi) + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + switch (page) + { + case WINDOW_RESEARCH_PAGE_DEVELOPMENT: + { + WindowResearchDevelopmentDraw(this, dpi, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + break; + } + case WINDOW_RESEARCH_PAGE_FUNDING: + { + WindowResearchFundingDraw(this, dpi); + break; + } + } + } + + void OnResize() override + { + ResizeFrameWithPage(); + } + + void DrawTabImage(DrawPixelInfo& dpi, int32_t tabPage, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + tabPage; + + if (!IsWidgetDisabled(widgetIndex)) + { + if (page == tabPage) + { + int32_t frame = frame_no / 2; + if (tabPage == WINDOW_RESEARCH_PAGE_DEVELOPMENT) + frame %= 8; + spriteIndex += frame; + } + + GfxDrawSprite( + dpi, ImageId(spriteIndex), + windowPos + ScreenCoordsXY{ widgets[widgetIndex].left, widgets[widgetIndex].top }); + } + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawTabImage(dpi, WINDOW_RESEARCH_PAGE_DEVELOPMENT, SPR_TAB_FINANCES_RESEARCH_0); + DrawTabImage(dpi, WINDOW_RESEARCH_PAGE_FUNDING, SPR_TAB_FINANCES_SUMMARY_0); + } + }; + + WindowBase* WindowResearchOpen() { - DrawTabImage(dpi, WINDOW_RESEARCH_PAGE_DEVELOPMENT, SPR_TAB_FINANCES_RESEARCH_0); - DrawTabImage(dpi, WINDOW_RESEARCH_PAGE_FUNDING, SPR_TAB_FINANCES_SUMMARY_0); + ResearchWindow* window = WindowFocusOrCreate(WindowClass::Research, WW_FUNDING, WH_FUNDING, WF_10); + window->SetPage(WINDOW_RESEARCH_PAGE_DEVELOPMENT); + return window; } -}; -WindowBase* WindowResearchOpen() -{ - ResearchWindow* window = WindowFocusOrCreate(WindowClass::Research, WW_FUNDING, WH_FUNDING, WF_10); - window->SetPage(WINDOW_RESEARCH_PAGE_DEVELOPMENT); - return window; -} - -static WidgetIndex GetWidgetIndexOffset(WidgetIndex baseWidgetIndex, WidgetIndex currentPageWidgetIndex) -{ - // Other windows that reuse the logic here will have different values for the widget enums, but they otherwise align to - // those in this class. Therefore, they can be referenced relative to the widget index for the page in this class, using - // the difference between them as an offset. - return baseWidgetIndex - currentPageWidgetIndex; -} + static WidgetIndex GetWidgetIndexOffset(WidgetIndex baseWidgetIndex, WidgetIndex currentPageWidgetIndex) + { + // Other windows that reuse the logic here will have different values for the widget enums, but they otherwise align to + // those in this class. Therefore, they can be referenced relative to the widget index for the page in this class, using + // the difference between them as an offset. + return baseWidgetIndex - currentPageWidgetIndex; + } #pragma region Development page -void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - - if (widgetIndex == (WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset)) + void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex) { - News::OpenSubject(News::ItemType::Research, gameState.ResearchLastItem->rawValue); - } -} + const auto& gameState = GetGameState(); + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); -void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - // Offset the widget index to allow reuse from other windows - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WindowWidgetType::Empty; - - // Display button to link to the last development, if there is one - if (gameState.ResearchLastItem.has_value()) - { - auto type = gameState.ResearchLastItem->type; - w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WindowWidgetType::FlatBtn; - const auto image = type == Research::EntryType::Ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY; - w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].image = ImageId(image); - } -} - -void WindowResearchDevelopmentDraw(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); - auto screenCoords = w->windowPos - + ScreenCoordsXY{ 10, w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + widgetOffset].top + 12 }; - - if (gameState.ResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) - { - // Research type - auto ft = Formatter(); - ft.Add(STR_RESEARCH_UNKNOWN); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); - screenCoords.y += 25; - - // Progress - ft = Formatter(); - ft.Add(STR_RESEARCH_COMPLETED_AL); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); - screenCoords.y += 15; - - // Expected - ft = Formatter(); - ft.Add(STR_RESEARCH_STAGE_UNKNOWN); - DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); - } - else - { - // Research type - auto ft = Formatter(); - StringId label = STR_RESEARCH_TYPE_LABEL; - if (gameState.ResearchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH) + if (widgetIndex == (WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset)) { + News::OpenSubject(News::ItemType::Research, gameState.ResearchLastItem->rawValue); + } + } + + void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex) + { + const auto& gameState = GetGameState(); + // Offset the widget index to allow reuse from other windows + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WindowWidgetType::Empty; + + // Display button to link to the last development, if there is one + if (gameState.ResearchLastItem.has_value()) + { + auto type = gameState.ResearchLastItem->type; + w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].type = WindowWidgetType::FlatBtn; + const auto image = type == Research::EntryType::Ride ? SPR_NEW_RIDE : SPR_NEW_SCENERY; + w->widgets[WIDX_LAST_DEVELOPMENT_BUTTON + widgetOffset].image = ImageId(image); + } + } + + void WindowResearchDevelopmentDraw(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex) + { + const auto& gameState = GetGameState(); + + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP); + auto screenCoords = w->windowPos + + ScreenCoordsXY{ 10, w->widgets[WIDX_CURRENTLY_IN_DEVELOPMENT_GROUP + widgetOffset].top + 12 }; + + if (gameState.ResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) + { + // Research type + auto ft = Formatter(); ft.Add(STR_RESEARCH_UNKNOWN); - } - else if (gameState.ResearchProgressStage == RESEARCH_STAGE_DESIGNING) - { - ft.Add(gameState.ResearchNextItem->GetCategoryName()); - } - else if (gameState.ResearchNextItem->type == Research::EntryType::Ride) - { - const auto& rtd = GetRideTypeDescriptor(gameState.ResearchNextItem->baseRideType); - if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - ft.Add(gameState.ResearchNextItem->GetName()); - } - else if (gameState.ResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) - { - ft.Add(rtd.Naming.Name); - } - else - { - ft.Add(gameState.ResearchNextItem->GetName()); - ft.Add(rtd.Naming.Name); - label = STR_RESEARCH_TYPE_LABEL_VEHICLE; - } - } - else - { - ft.Add(gameState.ResearchNextItem->GetName()); - } - DrawTextWrapped(dpi, screenCoords, 296, label, ft); - screenCoords.y += 25; + DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_TYPE_LABEL, ft); + screenCoords.y += 25; - // Progress - ft = Formatter(); - ft.Add(ResearchStageNames[gameState.ResearchProgressStage]); - DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); - screenCoords.y += 15; + // Progress + ft = Formatter(); + ft.Add(STR_RESEARCH_COMPLETED_AL); + DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); + screenCoords.y += 15; - // Expected - ft = Formatter(); - if (gameState.ResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH && gameState.ResearchExpectedDay != 255) - { - // TODO: Should probably use game date format setting - ft.Add(STR_RESEARCH_EXPECTED_FORMAT); - ft.Add(DateDayNames[gameState.ResearchExpectedDay]); - ft.Add(DateGameMonthNames[gameState.ResearchExpectedMonth]); - } - else - { + // Expected + ft = Formatter(); ft.Add(STR_RESEARCH_STAGE_UNKNOWN); - } - DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); - } - - // Last development - screenCoords = w->windowPos + ScreenCoordsXY{ 10, w->widgets[WIDX_LAST_DEVELOPMENT_GROUP + widgetOffset].top + 12 }; - - if (gameState.ResearchLastItem.has_value()) - { - StringId lastDevelopmentFormat = STR_EMPTY; - auto ft = Formatter(); - if (gameState.ResearchLastItem->type == Research::EntryType::Scenery) - { - lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; - ft.Add(gameState.ResearchLastItem->GetName()); + DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); } else { - lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; - const auto& rtd = GetRideTypeDescriptor(gameState.ResearchLastItem->baseRideType); - if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + // Research type + auto ft = Formatter(); + StringId label = STR_RESEARCH_TYPE_LABEL; + if (gameState.ResearchProgressStage == RESEARCH_STAGE_INITIAL_RESEARCH) { - ft.Add(gameState.ResearchLastItem->GetName()); + ft.Add(STR_RESEARCH_UNKNOWN); } - else if (gameState.ResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) + else if (gameState.ResearchProgressStage == RESEARCH_STAGE_DESIGNING) { - ft.Add(rtd.Naming.Name); + ft.Add(gameState.ResearchNextItem->GetCategoryName()); + } + else if (gameState.ResearchNextItem->type == Research::EntryType::Ride) + { + const auto& rtd = GetRideTypeDescriptor(gameState.ResearchNextItem->baseRideType); + if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + ft.Add(gameState.ResearchNextItem->GetName()); + } + else if (gameState.ResearchNextItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) + { + ft.Add(rtd.Naming.Name); + } + else + { + ft.Add(gameState.ResearchNextItem->GetName()); + ft.Add(rtd.Naming.Name); + label = STR_RESEARCH_TYPE_LABEL_VEHICLE; + } } else { - ft.Add(gameState.ResearchLastItem->GetName()); - ft.Add(rtd.Naming.Name); - lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL; + ft.Add(gameState.ResearchNextItem->GetName()); } + DrawTextWrapped(dpi, screenCoords, 296, label, ft); + screenCoords.y += 25; + + // Progress + ft = Formatter(); + ft.Add(ResearchStageNames[gameState.ResearchProgressStage]); + DrawTextWrapped(dpi, screenCoords, 296, STR_RESEARCH_PROGRESS_LABEL, ft); + screenCoords.y += 15; + + // Expected + ft = Formatter(); + if (gameState.ResearchProgressStage != RESEARCH_STAGE_INITIAL_RESEARCH && gameState.ResearchExpectedDay != 255) + { + // TODO: Should probably use game date format setting + ft.Add(STR_RESEARCH_EXPECTED_FORMAT); + ft.Add(DateDayNames[gameState.ResearchExpectedDay]); + ft.Add(DateGameMonthNames[gameState.ResearchExpectedMonth]); + } + else + { + ft.Add(STR_RESEARCH_STAGE_UNKNOWN); + } + DrawTextBasic(dpi, screenCoords, STR_RESEARCH_EXPECTED_LABEL, ft); } - DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft); + // Last development + screenCoords = w->windowPos + ScreenCoordsXY{ 10, w->widgets[WIDX_LAST_DEVELOPMENT_GROUP + widgetOffset].top + 12 }; + + if (gameState.ResearchLastItem.has_value()) + { + StringId lastDevelopmentFormat = STR_EMPTY; + auto ft = Formatter(); + if (gameState.ResearchLastItem->type == Research::EntryType::Scenery) + { + lastDevelopmentFormat = STR_RESEARCH_SCENERY_LABEL; + ft.Add(gameState.ResearchLastItem->GetName()); + } + else + { + lastDevelopmentFormat = STR_RESEARCH_RIDE_LABEL; + const auto& rtd = GetRideTypeDescriptor(gameState.ResearchLastItem->baseRideType); + if (rtd.HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + ft.Add(gameState.ResearchLastItem->GetName()); + } + else if (gameState.ResearchLastItem->flags & RESEARCH_ENTRY_FLAG_FIRST_OF_TYPE) + { + ft.Add(rtd.Naming.Name); + } + else + { + ft.Add(gameState.ResearchLastItem->GetName()); + ft.Add(rtd.Naming.Name); + lastDevelopmentFormat = STR_RESEARCH_VEHICLE_LABEL; + } + } + + DrawTextWrapped(dpi, screenCoords, 266, lastDevelopmentFormat, ft); + } } -} #pragma endregion #pragma region Funding page -void WindowResearchFundingMouseDown(WindowBase* w, WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); - - if (widgetIndex != (WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset)) - return; - - Widget* dropdownWidget = &w->widgets[widgetIndex - 1]; - - for (std::size_t i = 0; i < std::size(ResearchFundingLevelNames); i++) + void WindowResearchFundingMouseDown(WindowBase* w, WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex) { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = ResearchFundingLevelNames[i]; - } - WindowDropdownShowTextCustomWidth( - { w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - w->colours[1], 0, Dropdown::Flag::StayOpen, 4, dropdownWidget->width() - 3); + const auto& gameState = GetGameState(); + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); - int32_t currentResearchLevel = gameState.ResearchFundingLevel; - Dropdown::SetChecked(currentResearchLevel, true); -} + if (widgetIndex != (WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset)) + return; -void WindowResearchFundingMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); + Widget* dropdownWidget = &w->widgets[widgetIndex - 1]; - switch (widgetIndex - widgetOffset) - { - case WIDX_TRANSPORT_RIDES: - case WIDX_GENTLE_RIDES: - case WIDX_ROLLER_COASTERS: - case WIDX_THRILL_RIDES: - case WIDX_WATER_RIDES: - case WIDX_SHOPS_AND_STALLS: - case WIDX_SCENERY_AND_THEMING: + for (std::size_t i = 0; i < std::size(ResearchFundingLevelNames); i++) { - auto activeResearchTypes = gameState.ResearchPriorities; - activeResearchTypes ^= 1uLL << (widgetIndex - (WIDX_TRANSPORT_RIDES + widgetOffset)); - auto gameAction = ParkSetResearchFundingAction(activeResearchTypes, gameState.ResearchFundingLevel); - GameActions::Execute(&gameAction); - break; + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = ResearchFundingLevelNames[i]; + } + WindowDropdownShowTextCustomWidth( + { w->windowPos.x + dropdownWidget->left, w->windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + w->colours[1], 0, Dropdown::Flag::StayOpen, 4, dropdownWidget->width() - 3); + + int32_t currentResearchLevel = gameState.ResearchFundingLevel; + Dropdown::SetChecked(currentResearchLevel, true); + } + + void WindowResearchFundingMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex) + { + const auto& gameState = GetGameState(); + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); + + switch (widgetIndex - widgetOffset) + { + case WIDX_TRANSPORT_RIDES: + case WIDX_GENTLE_RIDES: + case WIDX_ROLLER_COASTERS: + case WIDX_THRILL_RIDES: + case WIDX_WATER_RIDES: + case WIDX_SHOPS_AND_STALLS: + case WIDX_SCENERY_AND_THEMING: + { + auto activeResearchTypes = gameState.ResearchPriorities; + activeResearchTypes ^= 1uLL << (widgetIndex - (WIDX_TRANSPORT_RIDES + widgetOffset)); + auto gameAction = ParkSetResearchFundingAction(activeResearchTypes, gameState.ResearchFundingLevel); + GameActions::Execute(&gameAction); + break; + } } } -} -void WindowResearchFundingDropdown(WidgetIndex widgetIndex, int32_t selectedIndex, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); - - if (widgetIndex != (WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset) || selectedIndex == -1) - return; - - auto gameAction = ParkSetResearchFundingAction(gameState.ResearchPriorities, selectedIndex); - GameActions::Execute(&gameAction); -} - -void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex) -{ - const auto& gameState = GetGameState(); - auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); - - if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) || gameState.ResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) + void WindowResearchFundingDropdown(WidgetIndex widgetIndex, int32_t selectedIndex, WidgetIndex baseWidgetIndex) { - w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].type = WindowWidgetType::Empty; - w->widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset].type = WindowWidgetType::Empty; - } - else - { - w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].type = WindowWidgetType::DropdownMenu; - w->widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset].type = WindowWidgetType::Button; + const auto& gameState = GetGameState(); + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); + + if (widgetIndex != (WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset) || selectedIndex == -1) + return; + + auto gameAction = ParkSetResearchFundingAction(gameState.ResearchPriorities, selectedIndex); + GameActions::Execute(&gameAction); } - // Current funding - int32_t currentResearchLevel = gameState.ResearchFundingLevel; - w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].text = ResearchFundingLevelNames[currentResearchLevel]; - - // Checkboxes - uint8_t activeResearchTypes = gameState.ResearchPriorities; - int32_t uncompletedResearchTypes = gameState.ResearchUncompletedCategories; - for (int32_t i = 0; i < 7; i++) + void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex) { - int32_t mask = 1 << i; - int32_t widgetMask = 1uLL << (i + WIDX_TRANSPORT_RIDES + widgetOffset); + const auto& gameState = GetGameState(); + auto widgetOffset = GetWidgetIndexOffset(baseWidgetIndex, WIDX_RESEARCH_FUNDING); - // Set checkbox disabled if research type is complete - if (uncompletedResearchTypes & mask) + if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) || gameState.ResearchProgressStage == RESEARCH_STAGE_FINISHED_ALL) { - w->disabled_widgets &= ~widgetMask; - - // Set checkbox ticked if research type is active - if (activeResearchTypes & mask) - w->pressed_widgets |= widgetMask; - else - w->pressed_widgets &= ~widgetMask; + w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].type = WindowWidgetType::Empty; + w->widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset].type = WindowWidgetType::Empty; } else { - w->disabled_widgets |= widgetMask; - w->pressed_widgets &= ~widgetMask; + w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].type = WindowWidgetType::DropdownMenu; + w->widgets[WIDX_RESEARCH_FUNDING_DROPDOWN_BUTTON + widgetOffset].type = WindowWidgetType::Button; + } + + // Current funding + int32_t currentResearchLevel = gameState.ResearchFundingLevel; + w->widgets[WIDX_RESEARCH_FUNDING + widgetOffset].text = ResearchFundingLevelNames[currentResearchLevel]; + + // Checkboxes + uint8_t activeResearchTypes = gameState.ResearchPriorities; + int32_t uncompletedResearchTypes = gameState.ResearchUncompletedCategories; + for (int32_t i = 0; i < 7; i++) + { + int32_t mask = 1 << i; + int32_t widgetMask = 1uLL << (i + WIDX_TRANSPORT_RIDES + widgetOffset); + + // Set checkbox disabled if research type is complete + if (uncompletedResearchTypes & mask) + { + w->disabled_widgets &= ~widgetMask; + + // Set checkbox ticked if research type is active + if (activeResearchTypes & mask) + w->pressed_widgets |= widgetMask; + else + w->pressed_widgets &= ~widgetMask; + } + else + { + w->disabled_widgets |= widgetMask; + w->pressed_widgets &= ~widgetMask; + } } } -} -void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi) -{ - if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) - return; + void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi) + { + if (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) + return; - const auto& gameState = GetGameState(); - int32_t currentResearchLevel = gameState.ResearchFundingLevel; - auto ft = Formatter(); - ft.Add(research_cost_table[currentResearchLevel]); - DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft); -} + const auto& gameState = GetGameState(); + int32_t currentResearchLevel = gameState.ResearchFundingLevel; + auto ft = Formatter(); + ft.Add(research_cost_table[currentResearchLevel]); + DrawTextBasic(dpi, w->windowPos + ScreenCoordsXY{ 10, 77 }, STR_RESEARCH_COST_PER_MONTH, ft); + } #pragma endregion +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index e55227c195..2d09cbdff7 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -67,31 +67,31 @@ #include #include -using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; - -static constexpr StringId WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; -static constexpr int32_t WH = 207; -static constexpr int32_t WW = 316; - -enum +namespace OpenRCT2::Ui::Windows { - WINDOW_RIDE_PAGE_MAIN, - WINDOW_RIDE_PAGE_VEHICLE, - WINDOW_RIDE_PAGE_OPERATING, - WINDOW_RIDE_PAGE_MAINTENANCE, - WINDOW_RIDE_PAGE_COLOUR, - WINDOW_RIDE_PAGE_MUSIC, - WINDOW_RIDE_PAGE_MEASUREMENTS, - WINDOW_RIDE_PAGE_GRAPHS, - WINDOW_RIDE_PAGE_INCOME, - WINDOW_RIDE_PAGE_CUSTOMER, - WINDOW_RIDE_PAGE_COUNT -}; + static constexpr StringId WINDOW_TITLE = STR_RIDE_WINDOW_TITLE; + static constexpr int32_t WH = 207; + static constexpr int32_t WW = 316; + + enum + { + WINDOW_RIDE_PAGE_MAIN, + WINDOW_RIDE_PAGE_VEHICLE, + WINDOW_RIDE_PAGE_OPERATING, + WINDOW_RIDE_PAGE_MAINTENANCE, + WINDOW_RIDE_PAGE_COLOUR, + WINDOW_RIDE_PAGE_MUSIC, + WINDOW_RIDE_PAGE_MEASUREMENTS, + WINDOW_RIDE_PAGE_GRAPHS, + WINDOW_RIDE_PAGE_INCOME, + WINDOW_RIDE_PAGE_CUSTOMER, + WINDOW_RIDE_PAGE_COUNT + }; #pragma region Widgets -// clang-format off + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -427,56 +427,56 @@ static constexpr std::array PageHoldDownWidgets = { 0uLL, }; static_assert(std::size(PageHoldDownWidgets) == WINDOW_RIDE_PAGE_COUNT); -// clang-format on + // clang-format on #pragma endregion -static void CancelScenerySelection(); + static void CancelScenerySelection(); -static bool _collectTrackDesignScenery = false; -static int32_t _lastSceneryX = 0; -static int32_t _lastSceneryY = 0; -static std::unique_ptr _trackDesign; + static bool _collectTrackDesignScenery = false; + static int32_t _lastSceneryX = 0; + static int32_t _lastSceneryY = 0; + static std::unique_ptr _trackDesign; -// Cached overall view for each ride -// (Re)calculated when the ride window is opened -struct RideOverallView -{ - CoordsXYZ loc; - ZoomLevel zoom; -}; + // Cached overall view for each ride + // (Re)calculated when the ride window is opened + struct RideOverallView + { + CoordsXYZ loc; + ZoomLevel zoom; + }; -static std::vector _rideOverallViewsCache = {}; + static std::vector _rideOverallViewsCache = {}; -static constexpr std::array PageTabAnimationDivisor = { - 0, // WINDOW_RIDE_PAGE_MAIN - 0, // WINDOW_RIDE_PAGE_VEHICLE - 2, // WINDOW_RIDE_PAGE_OPERATING - 2, // WINDOW_RIDE_PAGE_MAINTENANCE - 4, // WINDOW_RIDE_PAGE_COLOUR - 2, // WINDOW_RIDE_PAGE_MUSIC - 8, // WINDOW_RIDE_PAGE_MEASUREMENTS - 8, // WINDOW_RIDE_PAGE_GRAPHS - 2, // WINDOW_RIDE_PAGE_INCOME - 0, // WINDOW_RIDE_PAGE_CUSTOMER -}; -static_assert(std::size(PageTabAnimationDivisor) == WINDOW_RIDE_PAGE_COUNT); + static constexpr std::array PageTabAnimationDivisor = { + 0, // WINDOW_RIDE_PAGE_MAIN + 0, // WINDOW_RIDE_PAGE_VEHICLE + 2, // WINDOW_RIDE_PAGE_OPERATING + 2, // WINDOW_RIDE_PAGE_MAINTENANCE + 4, // WINDOW_RIDE_PAGE_COLOUR + 2, // WINDOW_RIDE_PAGE_MUSIC + 8, // WINDOW_RIDE_PAGE_MEASUREMENTS + 8, // WINDOW_RIDE_PAGE_GRAPHS + 2, // WINDOW_RIDE_PAGE_INCOME + 0, // WINDOW_RIDE_PAGE_CUSTOMER + }; + static_assert(std::size(PageTabAnimationDivisor) == WINDOW_RIDE_PAGE_COUNT); -static constexpr std::array PageTabAnimationNumFrames = { - 0, // WINDOW_RIDE_PAGE_MAIN - 0, // WINDOW_RIDE_PAGE_VEHICLE - 4, // WINDOW_RIDE_PAGE_OPERATING - 16, // WINDOW_RIDE_PAGE_MAINTENANCE - 8, // WINDOW_RIDE_PAGE_COLOUR - 16, // WINDOW_RIDE_PAGE_MUSIC - 8, // WINDOW_RIDE_PAGE_MEASUREMENTS - 8, // WINDOW_RIDE_PAGE_GRAPHS - 8, // WINDOW_RIDE_PAGE_INCOME - 0, // WINDOW_RIDE_PAGE_CUSTOMER -}; -static_assert(std::size(PageTabAnimationNumFrames) == WINDOW_RIDE_PAGE_COUNT); + static constexpr std::array PageTabAnimationNumFrames = { + 0, // WINDOW_RIDE_PAGE_MAIN + 0, // WINDOW_RIDE_PAGE_VEHICLE + 4, // WINDOW_RIDE_PAGE_OPERATING + 16, // WINDOW_RIDE_PAGE_MAINTENANCE + 8, // WINDOW_RIDE_PAGE_COLOUR + 16, // WINDOW_RIDE_PAGE_MUSIC + 8, // WINDOW_RIDE_PAGE_MEASUREMENTS + 8, // WINDOW_RIDE_PAGE_GRAPHS + 8, // WINDOW_RIDE_PAGE_INCOME + 0, // WINDOW_RIDE_PAGE_CUSTOMER + }; + static_assert(std::size(PageTabAnimationNumFrames) == WINDOW_RIDE_PAGE_COUNT); -// clang-format off + // clang-format off static constexpr std::array RatingNames = { static_cast(STR_RATING_LOW), static_cast(STR_RATING_MEDIUM), @@ -486,689 +486,2300 @@ static constexpr std::array RatingNames = { static_cast(STR_RATING_ULTRA_EXTREME), }; static_assert(std::size(RatingNames) == 6); -// clang-format on + // clang-format on -static constexpr std::array RideBreakdownReasonNames = { - static_cast(STR_RIDE_BREAKDOWN_SAFETY_CUT_OUT), // BREAKDOWN_SAFETY_CUT_OUT - static_cast(STR_RIDE_BREAKDOWN_RESTRAINTS_STUCK_CLOSED), // BREAKDOWN_RESTRAINTS_STUCK_CLOSED - static_cast(STR_RIDE_BREAKDOWN_RESTRAINTS_STUCK_OPEN), // BREAKDOWN_RESTRAINTS_STUCK_OPEN - static_cast(STR_RIDE_BREAKDOWN_DOORS_STUCK_CLOSED), // BREAKDOWN_DOORS_STUCK_CLOSED - static_cast(STR_RIDE_BREAKDOWN_DOORS_STUCK_OPEN), // BREAKDOWN_DOORS_STUCK_OPEN - static_cast(STR_RIDE_BREAKDOWN_VEHICLE_MALFUNCTION), // BREAKDOWN_VEHICLE_MALFUNCTION - static_cast(STR_RIDE_BREAKDOWN_BRAKES_FAILURE), // BREAKDOWN_BRAKES_FAILURE - static_cast(STR_RIDE_BREAKDOWN_CONTROL_FAILURE), // BREAKDOWN_CONTROL_FAILURE -}; -static_assert(std::size(RideBreakdownReasonNames) == BREAKDOWN_COUNT); + static constexpr std::array RideBreakdownReasonNames = { + static_cast(STR_RIDE_BREAKDOWN_SAFETY_CUT_OUT), // BREAKDOWN_SAFETY_CUT_OUT + static_cast(STR_RIDE_BREAKDOWN_RESTRAINTS_STUCK_CLOSED), // BREAKDOWN_RESTRAINTS_STUCK_CLOSED + static_cast(STR_RIDE_BREAKDOWN_RESTRAINTS_STUCK_OPEN), // BREAKDOWN_RESTRAINTS_STUCK_OPEN + static_cast(STR_RIDE_BREAKDOWN_DOORS_STUCK_CLOSED), // BREAKDOWN_DOORS_STUCK_CLOSED + static_cast(STR_RIDE_BREAKDOWN_DOORS_STUCK_OPEN), // BREAKDOWN_DOORS_STUCK_OPEN + static_cast(STR_RIDE_BREAKDOWN_VEHICLE_MALFUNCTION), // BREAKDOWN_VEHICLE_MALFUNCTION + static_cast(STR_RIDE_BREAKDOWN_BRAKES_FAILURE), // BREAKDOWN_BRAKES_FAILURE + static_cast(STR_RIDE_BREAKDOWN_CONTROL_FAILURE), // BREAKDOWN_CONTROL_FAILURE + }; + static_assert(std::size(RideBreakdownReasonNames) == BREAKDOWN_COUNT); -// Used in other places as well -const StringId ColourSchemeNames[4] = { - STR_MAIN_COLOUR_SCHEME, // RIDE_COLOUR_SCHEME_MAIN - STR_ALTERNATIVE_COLOUR_SCHEME_1, // RIDE_COLOUR_SCHEME_ADDITIONAL_1 - STR_ALTERNATIVE_COLOUR_SCHEME_2, // RIDE_COLOUR_SCHEME_ADDITIONAL_2 - STR_ALTERNATIVE_COLOUR_SCHEME_3, // RIDE_COLOUR_SCHEME_ADDITIONAL_3 -}; -static_assert(std::size(ColourSchemeNames) == RIDE_COLOUR_SCHEME_COUNT); + // Used in other places as well + const StringId ColourSchemeNames[4] = { + STR_MAIN_COLOUR_SCHEME, // RIDE_COLOUR_SCHEME_MAIN + STR_ALTERNATIVE_COLOUR_SCHEME_1, // RIDE_COLOUR_SCHEME_ADDITIONAL_1 + STR_ALTERNATIVE_COLOUR_SCHEME_2, // RIDE_COLOUR_SCHEME_ADDITIONAL_2 + STR_ALTERNATIVE_COLOUR_SCHEME_3, // RIDE_COLOUR_SCHEME_ADDITIONAL_3 + }; + static_assert(std::size(ColourSchemeNames) == RIDE_COLOUR_SCHEME_COUNT); -static constexpr std::array VehicleLoadNames = { - static_cast(STR_QUARTER_LOAD), // WAIT_FOR_LOAD_QUARTER - static_cast(STR_HALF_LOAD), // WAIT_FOR_LOAD_HALF - static_cast(STR_THREE_QUARTER_LOAD), // WAIT_FOR_LOAD_THREE_QUARTER - static_cast(STR_FULL_LOAD), // WAIT_FOR_LOAD_FULL - static_cast(STR_ANY_LOAD), // WAIT_FOR_LOAD_ANY -}; -static_assert(std::size(VehicleLoadNames) == WAIT_FOR_LOAD_COUNT); + static constexpr std::array VehicleLoadNames = { + static_cast(STR_QUARTER_LOAD), // WAIT_FOR_LOAD_QUARTER + static_cast(STR_HALF_LOAD), // WAIT_FOR_LOAD_HALF + static_cast(STR_THREE_QUARTER_LOAD), // WAIT_FOR_LOAD_THREE_QUARTER + static_cast(STR_FULL_LOAD), // WAIT_FOR_LOAD_FULL + static_cast(STR_ANY_LOAD), // WAIT_FOR_LOAD_ANY + }; + static_assert(std::size(VehicleLoadNames) == WAIT_FOR_LOAD_COUNT); -static constexpr std::array VehicleColourSchemeNames = { - static_cast(STR_ALL_VEHICLES_IN_SAME_COLOURS), // RIDE_COLOUR_SCHEME_MODE_ALL_SAME, - static_cast(STR_DIFFERENT_COLOURS_PER), // RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_TRAIN, - static_cast(STR_DIFFERENT_COLOURS_PER_VEHICLE), // RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_CAR, -}; -static_assert(std::size(VehicleColourSchemeNames) == RIDE_COLOUR_SCHEME_MODE_COUNT); + static constexpr std::array VehicleColourSchemeNames = { + static_cast(STR_ALL_VEHICLES_IN_SAME_COLOURS), // RIDE_COLOUR_SCHEME_MODE_ALL_SAME, + static_cast(STR_DIFFERENT_COLOURS_PER), // RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_TRAIN, + static_cast(STR_DIFFERENT_COLOURS_PER_VEHICLE), // RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_CAR, + }; + static_assert(std::size(VehicleColourSchemeNames) == RIDE_COLOUR_SCHEME_MODE_COUNT); -static constexpr std::array VehicleStatusNames = { - static_cast(STR_MOVING_TO_END_OF), // Vehicle::Status::MovingToEndOfStation - static_cast(STR_WAITING_FOR_PASSENGERS_AT), // Vehicle::Status::WaitingForPassengers - static_cast(STR_WAITING_TO_DEPART), // Vehicle::Status::WaitingToDepart - static_cast(STR_DEPARTING), // Vehicle::Status::Departing - static_cast(STR_TRAVELLING_AT_0), // Vehicle::Status::Travelling - static_cast(STR_ARRIVING_AT), // Vehicle::Status::Arriving - static_cast(STR_UNLOADING_PASSENGERS_AT), // Vehicle::Status::UnloadingPassengers - static_cast(STR_TRAVELLING_AT_1), // Vehicle::Status::TravellingBoat - static_cast(STR_CRASHING), // Vehicle::Status::Crashing - static_cast(STR_CRASHED_0), // Vehicle::Status::Crashed - static_cast(STR_TRAVELLING_AT_2), // Vehicle::Status::TravellingDodgems - static_cast(STR_SWINGING), // Vehicle::Status::Swinging - static_cast(STR_ROTATING_0), // Vehicle::Status::Rotating - static_cast(STR_ROTATING_1), // Vehicle::Status::FerrisWheelRotating - static_cast(STR_OPERATING_0), // Vehicle::Status::SimulatorOperating - static_cast(STR_SHOWING_FILM), // Vehicle::Status::ShowingFilm - static_cast(STR_ROTATING_2), // Vehicle::Status::SpaceRingsOperating - static_cast(STR_OPERATING_1), // Vehicle::Status::TopSpinOperating - static_cast(STR_OPERATING_2), // Vehicle::Status::HauntedHouseOperating - static_cast(STR_DOING_CIRCUS_SHOW), // Vehicle::Status::DoingCircusShow - static_cast(STR_OPERATING_3), // Vehicle::Status::CrookedHouseOperating - static_cast(STR_WAITING_FOR_CABLE_LIFT), // Vehicle::Status::WaitingForCableLift - static_cast(STR_TRAVELLING_AT_3), // Vehicle::Status::TravellingCableLift - static_cast(STR_STOPPING_0), // Vehicle::Status::Stopping - static_cast(STR_WAITING_FOR_PASSENGERS), // Vehicle::Status::WaitingForPassengers17 - static_cast(STR_WAITING_TO_START), // Vehicle::Status::WaitingToStart - static_cast(STR_STARTING), // Vehicle::Status::Starting - static_cast(STR_OPERATING), // Vehicle::Status::Operating1A - static_cast(STR_STOPPING_1), // Vehicle::Status::Stopping1B - static_cast(STR_UNLOADING_PASSENGERS), // Vehicle::Status::UnloadingPassengers1C - static_cast(STR_STOPPED_BY_BLOCK_BRAKES), // Vehicle::Status::StoppedByBlockBrakes -}; -static_assert(std::size(VehicleStatusNames) == 31); + static constexpr std::array VehicleStatusNames = { + static_cast(STR_MOVING_TO_END_OF), // Vehicle::Status::MovingToEndOfStation + static_cast(STR_WAITING_FOR_PASSENGERS_AT), // Vehicle::Status::WaitingForPassengers + static_cast(STR_WAITING_TO_DEPART), // Vehicle::Status::WaitingToDepart + static_cast(STR_DEPARTING), // Vehicle::Status::Departing + static_cast(STR_TRAVELLING_AT_0), // Vehicle::Status::Travelling + static_cast(STR_ARRIVING_AT), // Vehicle::Status::Arriving + static_cast(STR_UNLOADING_PASSENGERS_AT), // Vehicle::Status::UnloadingPassengers + static_cast(STR_TRAVELLING_AT_1), // Vehicle::Status::TravellingBoat + static_cast(STR_CRASHING), // Vehicle::Status::Crashing + static_cast(STR_CRASHED_0), // Vehicle::Status::Crashed + static_cast(STR_TRAVELLING_AT_2), // Vehicle::Status::TravellingDodgems + static_cast(STR_SWINGING), // Vehicle::Status::Swinging + static_cast(STR_ROTATING_0), // Vehicle::Status::Rotating + static_cast(STR_ROTATING_1), // Vehicle::Status::FerrisWheelRotating + static_cast(STR_OPERATING_0), // Vehicle::Status::SimulatorOperating + static_cast(STR_SHOWING_FILM), // Vehicle::Status::ShowingFilm + static_cast(STR_ROTATING_2), // Vehicle::Status::SpaceRingsOperating + static_cast(STR_OPERATING_1), // Vehicle::Status::TopSpinOperating + static_cast(STR_OPERATING_2), // Vehicle::Status::HauntedHouseOperating + static_cast(STR_DOING_CIRCUS_SHOW), // Vehicle::Status::DoingCircusShow + static_cast(STR_OPERATING_3), // Vehicle::Status::CrookedHouseOperating + static_cast(STR_WAITING_FOR_CABLE_LIFT), // Vehicle::Status::WaitingForCableLift + static_cast(STR_TRAVELLING_AT_3), // Vehicle::Status::TravellingCableLift + static_cast(STR_STOPPING_0), // Vehicle::Status::Stopping + static_cast(STR_WAITING_FOR_PASSENGERS), // Vehicle::Status::WaitingForPassengers17 + static_cast(STR_WAITING_TO_START), // Vehicle::Status::WaitingToStart + static_cast(STR_STARTING), // Vehicle::Status::Starting + static_cast(STR_OPERATING), // Vehicle::Status::Operating1A + static_cast(STR_STOPPING_1), // Vehicle::Status::Stopping1B + static_cast(STR_UNLOADING_PASSENGERS), // Vehicle::Status::UnloadingPassengers1C + static_cast(STR_STOPPED_BY_BLOCK_BRAKES), // Vehicle::Status::StoppedByBlockBrakes + }; + static_assert(std::size(VehicleStatusNames) == 31); -static constexpr std::array SingleSessionVehicleStatusNames = { - static_cast(STR_STOPPING_0), // Vehicle::Status::MovingToEndOfStation - static_cast(STR_WAITING_FOR_PASSENGERS), // Vehicle::Status::WaitingForPassengers - static_cast(STR_WAITING_TO_START), // Vehicle::Status::WaitingToDepart - static_cast(STR_STARTING), // Vehicle::Status::Departing - static_cast(STR_OPERATING), // Vehicle::Status::Travelling - static_cast(STR_STOPPING_1), // Vehicle::Status::Arriving - static_cast(STR_UNLOADING_PASSENGERS), // Vehicle::Status::UnloadingPassengers -}; -static_assert(std::size(SingleSessionVehicleStatusNames) == 7); + static constexpr std::array SingleSessionVehicleStatusNames = { + static_cast(STR_STOPPING_0), // Vehicle::Status::MovingToEndOfStation + static_cast(STR_WAITING_FOR_PASSENGERS), // Vehicle::Status::WaitingForPassengers + static_cast(STR_WAITING_TO_START), // Vehicle::Status::WaitingToDepart + static_cast(STR_STARTING), // Vehicle::Status::Departing + static_cast(STR_OPERATING), // Vehicle::Status::Travelling + static_cast(STR_STOPPING_1), // Vehicle::Status::Arriving + static_cast(STR_UNLOADING_PASSENGERS), // Vehicle::Status::UnloadingPassengers + }; + static_assert(std::size(SingleSessionVehicleStatusNames) == 7); -struct WindowRideMazeDesignOption -{ - StringId text; - uint32_t sprite; -}; - -static constexpr std::array MazeOptions = { - WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_BRICK_WALLS, SPR_RIDE_DESIGN_PREVIEW_MAZE_BRICK_WALLS }, - WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_HEDGES, SPR_RIDE_DESIGN_PREVIEW_MAZE_HEDGES }, - WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_ICE_BLOCKS, SPR_RIDE_DESIGN_PREVIEW_MAZE_ICE_BLOCKS }, - WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_WOODEN_FENCES, SPR_RIDE_DESIGN_PREVIEW_MAZE_WOODEN_FENCES }, -}; -static_assert(std::size(MazeOptions) == 4); - -struct GraphsYAxis -{ - uint8_t interval; - int8_t unit; - int8_t unit_interval; - StringId label; -}; - -static constexpr const std::array GraphsYAxisDetails = { - GraphsYAxis{ 11, 0, 10, STR_RIDE_STATS_VELOCITY_FORMAT }, // GRAPH_VELOCITY - GraphsYAxis{ 10, 0, 15, STR_RIDE_STATS_ALTITUDE_FORMAT }, // GRAPH_ALTITUDE - GraphsYAxis{ 13, -3, 1, STR_RIDE_STATS_G_FORCE_FORMAT }, // GRAPH_VERTICAL - GraphsYAxis{ 13, -4, 1, STR_RIDE_STATS_G_FORCE_FORMAT }, // GRAPH_LATERAL -}; -static_assert(std::size(GraphsYAxisDetails) == 4); - -static constexpr auto RIDE_G_FORCES_RED_NEG_VERTICAL = -FIXED_2DP(2, 50); -static constexpr auto RIDE_G_FORCES_RED_LATERAL = FIXED_2DP(2, 80); - -// Used for sorting the ride type cheat dropdown. -struct RideTypeLabel -{ - ride_type_t RideTypeId; - StringId LabelId; - u8string_view LabelString; -}; - -// Used for sorting the vehicle type dropdown. -struct VehicleTypeLabel -{ - ObjectEntryIndex SubTypeId; - StringId LabelId; - u8string_view LabelString; -}; - -// Used for sorting the entrance type dropdown. -struct EntranceTypeLabel -{ - ObjectEntryIndex EntranceTypeId; - StringId LabelId; - u8string_view LabelString; -}; - -class RideWindow final : public Window -{ - int16_t _viewIndex; - std::vector _rideDropdownData; - int32_t _rideDropdownDataLanguage = LANGUAGE_UNDEFINED; - int32_t _vehicleDropdownDataLanguage = LANGUAGE_UNDEFINED; - int32_t _entranceDropdownDataLanguage = LANGUAGE_UNDEFINED; - const RideObjectEntry* _vehicleDropdownRideType = nullptr; - bool _vehicleDropdownExpanded = false; - std::vector _vehicleDropdownData; - int16_t _vehicleIndex = 0; - uint16_t _rideColour = 0; - std::vector _entranceDropdownData; - bool _autoScrollGraph = true; - -public: - RideWindow(const Ride& ride) + struct WindowRideMazeDesignOption { - rideId = ride.id; - } + StringId text; + uint32_t sprite; + }; - virtual void OnOpen() override + static constexpr std::array MazeOptions = { + WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_BRICK_WALLS, SPR_RIDE_DESIGN_PREVIEW_MAZE_BRICK_WALLS }, + WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_HEDGES, SPR_RIDE_DESIGN_PREVIEW_MAZE_HEDGES }, + WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_ICE_BLOCKS, SPR_RIDE_DESIGN_PREVIEW_MAZE_ICE_BLOCKS }, + WindowRideMazeDesignOption{ STR_RIDE_DESIGN_MAZE_WOODEN_FENCES, SPR_RIDE_DESIGN_PREVIEW_MAZE_WOODEN_FENCES }, + }; + static_assert(std::size(MazeOptions) == 4); + + struct GraphsYAxis { - widgets = PageWidgets[WINDOW_RIDE_PAGE_MAIN]; - hold_down_widgets = PageHoldDownWidgets[WINDOW_RIDE_PAGE_MAIN]; + uint8_t interval; + int8_t unit; + int8_t unit_interval; + StringId label; + }; - page = WINDOW_RIDE_PAGE_MAIN; - frame_no = 0; - list_information_type = 0; - picked_peep_frame = 0; - DisableTabs(); - min_width = 316; - min_height = 180; - max_width = 500; - max_height = 450; + static constexpr const std::array GraphsYAxisDetails = { + GraphsYAxis{ 11, 0, 10, STR_RIDE_STATS_VELOCITY_FORMAT }, // GRAPH_VELOCITY + GraphsYAxis{ 10, 0, 15, STR_RIDE_STATS_ALTITUDE_FORMAT }, // GRAPH_ALTITUDE + GraphsYAxis{ 13, -3, 1, STR_RIDE_STATS_G_FORCE_FORMAT }, // GRAPH_VERTICAL + GraphsYAxis{ 13, -4, 1, STR_RIDE_STATS_G_FORCE_FORMAT }, // GRAPH_LATERAL + }; + static_assert(std::size(GraphsYAxisDetails) == 4); - auto ride = GetRide(rideId); - if (ride == nullptr) + static constexpr auto RIDE_G_FORCES_RED_NEG_VERTICAL = -FIXED_2DP(2, 50); + static constexpr auto RIDE_G_FORCES_RED_LATERAL = FIXED_2DP(2, 80); + + // Used for sorting the ride type cheat dropdown. + struct RideTypeLabel + { + ride_type_t RideTypeId; + StringId LabelId; + u8string_view LabelString; + }; + + // Used for sorting the vehicle type dropdown. + struct VehicleTypeLabel + { + ObjectEntryIndex SubTypeId; + StringId LabelId; + u8string_view LabelString; + }; + + // Used for sorting the entrance type dropdown. + struct EntranceTypeLabel + { + ObjectEntryIndex EntranceTypeId; + StringId LabelId; + u8string_view LabelString; + }; + + class RideWindow final : public Window + { + int16_t _viewIndex; + std::vector _rideDropdownData; + int32_t _rideDropdownDataLanguage = LANGUAGE_UNDEFINED; + int32_t _vehicleDropdownDataLanguage = LANGUAGE_UNDEFINED; + int32_t _entranceDropdownDataLanguage = LANGUAGE_UNDEFINED; + const RideObjectEntry* _vehicleDropdownRideType = nullptr; + bool _vehicleDropdownExpanded = false; + std::vector _vehicleDropdownData; + int16_t _vehicleIndex = 0; + uint16_t _rideColour = 0; + std::vector _entranceDropdownData; + bool _autoScrollGraph = true; + + public: + RideWindow(const Ride& ride) { - Close(); - return; - } - UpdateOverallView(*ride); - - PopulateVehicleTypeDropdown(*ride, true); - } - - virtual void OnClose() override - { - switch (page) - { - case WINDOW_RIDE_PAGE_COLOUR: - ColourClose(); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsClose(); - break; - } - } - virtual void OnResize() override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainResize(); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleResize(); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingResize(); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceResize(); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourResize(); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicResize(); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsResize(); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsResize(); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeResize(); - break; - case WINDOW_RIDE_PAGE_CUSTOMER: - CustomerResize(); - break; - } - } - virtual void OnUpdate() override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainUpdate(); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleUpdate(); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingUpdate(); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceUpdate(); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourUpdate(); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicUpdate(); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsUpdate(); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsUpdate(); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeUpdate(); - break; - case WINDOW_RIDE_PAGE_CUSTOMER: - CustomerUpdate(); - break; - } - } - - virtual void OnPrepareDraw() override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeOnPrepareDraw(); - break; - case WINDOW_RIDE_PAGE_CUSTOMER: - CustomerOnPrepareDraw(); - break; - } - } - virtual void OnDraw(DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeOnDraw(dpi); - break; - case WINDOW_RIDE_PAGE_CUSTOMER: - CustomerOnDraw(dpi); - break; - } - } - - virtual OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_VEHICLE: - return VehicleTooltip(widgetIndex, fallback); - case WINDOW_RIDE_PAGE_GRAPHS: - return GraphsTooltip(widgetIndex, fallback); - } - return { fallback, {} }; - } - virtual void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsOnMouseDown(widgetIndex); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeOnMouseDown(widgetIndex); - break; - } - } - virtual void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeOnMouseUp(widgetIndex); - break; - case WINDOW_RIDE_PAGE_CUSTOMER: - CustomerOnMouseUp(widgetIndex); - break; - } - } - virtual void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainOnDropdown(widgetIndex, selectedIndex); - break; - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleOnDropdown(widgetIndex, selectedIndex); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingOnDropdown(widgetIndex, selectedIndex); - break; - case WINDOW_RIDE_PAGE_MAINTENANCE: - MaintenanceOnDropdown(widgetIndex, selectedIndex); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnDropdown(widgetIndex, selectedIndex); - break; - case WINDOW_RIDE_PAGE_MUSIC: - MusicOnDropdown(widgetIndex, selectedIndex); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnDropdown(widgetIndex, selectedIndex); - break; - } - } - virtual void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainOnTextInput(widgetIndex, text); - break; - case WINDOW_RIDE_PAGE_OPERATING: - OperatingOnTextInput(widgetIndex, text); - break; - case WINDOW_RIDE_PAGE_INCOME: - IncomeOnTextInput(widgetIndex, text); - break; - } - } - virtual ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_GRAPHS: - return GraphsScrollGetSize(scrollIndex); - } - return {}; - } - virtual void OnScrollSelect(int32_t scrollIndex, int32_t scrollAreaType) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsOnScrollSelect(scrollIndex, scrollAreaType); - break; - } - } - virtual void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_VEHICLE: - VehicleOnScrollDraw(dpi, scrollIndex); - break; - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnScrollDraw(dpi, scrollIndex); - break; - case WINDOW_RIDE_PAGE_GRAPHS: - GraphsOnScrollDraw(dpi, scrollIndex); - break; - } - } - virtual void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnToolDown(widgetIndex, screenCoords); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnToolDown(widgetIndex, screenCoords); - break; - } - } - virtual void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_COLOUR: - ColourOnToolDrag(widgetIndex, screenCoords); - break; - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnToolDrag(widgetIndex, screenCoords); - break; - } - } - virtual void OnToolAbort(WidgetIndex widgetIndex) override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MEASUREMENTS: - MeasurementsOnToolAbort(widgetIndex); - break; - } - } - virtual void OnViewportRotate() override - { - switch (page) - { - case WINDOW_RIDE_PAGE_MAIN: - MainViewportRotate(); - break; - } - } - - void SetPage(int32_t newPage) - { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - ToolCancel(); - - if (newPage == WINDOW_RIDE_PAGE_VEHICLE) - { - auto constructionWindow = WindowFindByClass(WindowClass::RideConstruction); - if (constructionWindow != nullptr && constructionWindow->number == number) - { - WindowCloseByClass(WindowClass::RideConstruction); - // Closing the construction window sets the tab to the first page, which we don't want here, - // as user just clicked the Vehicle page - SetPage(WINDOW_RIDE_PAGE_VEHICLE); - } + rideId = ride.id; } - // Set listen only to viewport - bool listen = false; - if (newPage == WINDOW_RIDE_PAGE_MAIN && page == WINDOW_RIDE_PAGE_MAIN && viewport != nullptr - && !(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) - listen = true; - - page = newPage; - frame_no = 0; - picked_peep_frame = 0; - - // There doesn't seem to be any need for this call, and it can sometimes modify the reported number of cars per train, - // so I've removed it if (newPage == WINDOW_RIDE_PAGE_VEHICLE) { ride_update_max_vehicles(ride); - //} - - RemoveViewport(); - - hold_down_widgets = PageHoldDownWidgets[page]; - pressed_widgets = 0; - widgets = PageWidgets[page]; - DisableTabs(); - Invalidate(); - - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - Invalidate(); - - if (listen && viewport != nullptr) - viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - } - - void SetViewIndex(int16_t newIndex) - { - _viewIndex = newIndex; - OnViewportRotate(); - } - int16_t GetViewIndex() const - { - return _viewIndex; - } - - void ResetVehicleIndex() - { - _vehicleIndex = 0; - } - -private: - void DrawTabImage(DrawPixelInfo& dpi, int32_t tab, int32_t spriteIndex) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + tab; - - if (!WidgetIsDisabled(*this, widgetIndex)) + virtual void OnOpen() override { - if (page == tab) - { - int32_t frame = frame_no / PageTabAnimationDivisor[page]; - spriteIndex += (frame % PageTabAnimationNumFrames[page]); - } + widgets = PageWidgets[WINDOW_RIDE_PAGE_MAIN]; + hold_down_widgets = PageHoldDownWidgets[WINDOW_RIDE_PAGE_MAIN]; - const auto& widget = widgets[widgetIndex]; - GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top }); - } - } + page = WINDOW_RIDE_PAGE_MAIN; + frame_no = 0; + list_information_type = 0; + picked_peep_frame = 0; + DisableTabs(); + min_width = 316; + min_height = 180; + max_width = 500; + max_height = 450; - void DrawTabMain(DrawPixelInfo& dpi) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(WINDOW_RIDE_PAGE_MAIN); - if (!WidgetIsDisabled(*this, widgetIndex)) - { auto ride = GetRide(rideId); - if (ride != nullptr) + if (ride == nullptr) { - int32_t spriteIndex = 0; - switch (ride->GetClassification()) + Close(); + return; + } + UpdateOverallView(*ride); + + PopulateVehicleTypeDropdown(*ride, true); + } + + virtual void OnClose() override + { + switch (page) + { + case WINDOW_RIDE_PAGE_COLOUR: + ColourClose(); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsClose(); + break; + } + } + virtual void OnResize() override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainResize(); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleResize(); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingResize(); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceResize(); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourResize(); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicResize(); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsResize(); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsResize(); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeResize(); + break; + case WINDOW_RIDE_PAGE_CUSTOMER: + CustomerResize(); + break; + } + } + virtual void OnUpdate() override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainUpdate(); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleUpdate(); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingUpdate(); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceUpdate(); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourUpdate(); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicUpdate(); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsUpdate(); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsUpdate(); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeUpdate(); + break; + case WINDOW_RIDE_PAGE_CUSTOMER: + CustomerUpdate(); + break; + } + } + + virtual void OnPrepareDraw() override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeOnPrepareDraw(); + break; + case WINDOW_RIDE_PAGE_CUSTOMER: + CustomerOnPrepareDraw(); + break; + } + } + virtual void OnDraw(DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeOnDraw(dpi); + break; + case WINDOW_RIDE_PAGE_CUSTOMER: + CustomerOnDraw(dpi); + break; + } + } + + virtual OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_VEHICLE: + return VehicleTooltip(widgetIndex, fallback); + case WINDOW_RIDE_PAGE_GRAPHS: + return GraphsTooltip(widgetIndex, fallback); + } + return { fallback, {} }; + } + virtual void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsOnMouseDown(widgetIndex); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeOnMouseDown(widgetIndex); + break; + } + } + virtual void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeOnMouseUp(widgetIndex); + break; + case WINDOW_RIDE_PAGE_CUSTOMER: + CustomerOnMouseUp(widgetIndex); + break; + } + } + virtual void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainOnDropdown(widgetIndex, selectedIndex); + break; + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleOnDropdown(widgetIndex, selectedIndex); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingOnDropdown(widgetIndex, selectedIndex); + break; + case WINDOW_RIDE_PAGE_MAINTENANCE: + MaintenanceOnDropdown(widgetIndex, selectedIndex); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnDropdown(widgetIndex, selectedIndex); + break; + case WINDOW_RIDE_PAGE_MUSIC: + MusicOnDropdown(widgetIndex, selectedIndex); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnDropdown(widgetIndex, selectedIndex); + break; + } + } + virtual void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainOnTextInput(widgetIndex, text); + break; + case WINDOW_RIDE_PAGE_OPERATING: + OperatingOnTextInput(widgetIndex, text); + break; + case WINDOW_RIDE_PAGE_INCOME: + IncomeOnTextInput(widgetIndex, text); + break; + } + } + virtual ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_GRAPHS: + return GraphsScrollGetSize(scrollIndex); + } + return {}; + } + virtual void OnScrollSelect(int32_t scrollIndex, int32_t scrollAreaType) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsOnScrollSelect(scrollIndex, scrollAreaType); + break; + } + } + virtual void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_VEHICLE: + VehicleOnScrollDraw(dpi, scrollIndex); + break; + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnScrollDraw(dpi, scrollIndex); + break; + case WINDOW_RIDE_PAGE_GRAPHS: + GraphsOnScrollDraw(dpi, scrollIndex); + break; + } + } + virtual void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnToolDown(widgetIndex, screenCoords); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnToolDown(widgetIndex, screenCoords); + break; + } + } + virtual void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_COLOUR: + ColourOnToolDrag(widgetIndex, screenCoords); + break; + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnToolDrag(widgetIndex, screenCoords); + break; + } + } + virtual void OnToolAbort(WidgetIndex widgetIndex) override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MEASUREMENTS: + MeasurementsOnToolAbort(widgetIndex); + break; + } + } + virtual void OnViewportRotate() override + { + switch (page) + { + case WINDOW_RIDE_PAGE_MAIN: + MainViewportRotate(); + break; + } + } + + void SetPage(int32_t newPage) + { + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) + ToolCancel(); + + if (newPage == WINDOW_RIDE_PAGE_VEHICLE) + { + auto constructionWindow = WindowFindByClass(WindowClass::RideConstruction); + if (constructionWindow != nullptr && constructionWindow->number == number) { - case RideClassification::Ride: - spriteIndex = SPR_TAB_RIDE_0; - if (page == WINDOW_RIDE_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 16; - break; - case RideClassification::ShopOrStall: - spriteIndex = SPR_TAB_SHOPS_AND_STALLS_0; - if (page == WINDOW_RIDE_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 16; - break; - case RideClassification::KioskOrFacility: - spriteIndex = SPR_TAB_KIOSKS_AND_FACILITIES_0; - if (page == WINDOW_RIDE_PAGE_MAIN) - spriteIndex += (frame_no / 4) % 8; - break; + WindowCloseByClass(WindowClass::RideConstruction); + // Closing the construction window sets the tab to the first page, which we don't want here, + // as user just clicked the Vehicle page + SetPage(WINDOW_RIDE_PAGE_VEHICLE); + } + } + + // Set listen only to viewport + bool listen = false; + if (newPage == WINDOW_RIDE_PAGE_MAIN && page == WINDOW_RIDE_PAGE_MAIN && viewport != nullptr + && !(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) + listen = true; + + page = newPage; + frame_no = 0; + picked_peep_frame = 0; + + // There doesn't seem to be any need for this call, and it can sometimes modify the reported number of cars per + // train, so I've removed it if (newPage == WINDOW_RIDE_PAGE_VEHICLE) { ride_update_max_vehicles(ride); + //} + + RemoveViewport(); + + hold_down_widgets = PageHoldDownWidgets[page]; + pressed_widgets = 0; + widgets = PageWidgets[page]; + DisableTabs(); + Invalidate(); + + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + Invalidate(); + + if (listen && viewport != nullptr) + viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + } + + void SetViewIndex(int16_t newIndex) + { + _viewIndex = newIndex; + OnViewportRotate(); + } + int16_t GetViewIndex() const + { + return _viewIndex; + } + + void ResetVehicleIndex() + { + _vehicleIndex = 0; + } + + private: + void DrawTabImage(DrawPixelInfo& dpi, int32_t tab, int32_t spriteIndex) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + tab; + + if (!WidgetIsDisabled(*this, widgetIndex)) + { + if (page == tab) + { + int32_t frame = frame_no / PageTabAnimationDivisor[page]; + spriteIndex += (frame % PageTabAnimationNumFrames[page]); } const auto& widget = widgets[widgetIndex]; GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top }); } } - } - void DrawTabVehicle(DrawPixelInfo& dpi) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(WINDOW_RIDE_PAGE_VEHICLE); - const auto& widget = widgets[widgetIndex]; - - if (!WidgetIsDisabled(*this, widgetIndex)) + void DrawTabMain(DrawPixelInfo& dpi) { - auto screenCoords = ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; - int32_t clipWidth = widget.right - screenCoords.x; - int32_t clipHeight = widget.bottom - 3 - screenCoords.y; - if (page == WINDOW_RIDE_PAGE_VEHICLE) - clipHeight += 4; - - screenCoords += windowPos; - - DrawPixelInfo clipDPI; - if (!ClipDrawPixelInfo(clipDPI, dpi, screenCoords, clipWidth, clipHeight)) + WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(WINDOW_RIDE_PAGE_MAIN); + if (!WidgetIsDisabled(*this, widgetIndex)) { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + int32_t spriteIndex = 0; + switch (ride->GetClassification()) + { + case RideClassification::Ride: + spriteIndex = SPR_TAB_RIDE_0; + if (page == WINDOW_RIDE_PAGE_MAIN) + spriteIndex += (frame_no / 4) % 16; + break; + case RideClassification::ShopOrStall: + spriteIndex = SPR_TAB_SHOPS_AND_STALLS_0; + if (page == WINDOW_RIDE_PAGE_MAIN) + spriteIndex += (frame_no / 4) % 16; + break; + case RideClassification::KioskOrFacility: + spriteIndex = SPR_TAB_KIOSKS_AND_FACILITIES_0; + if (page == WINDOW_RIDE_PAGE_MAIN) + spriteIndex += (frame_no / 4) % 8; + break; + } + + const auto& widget = widgets[widgetIndex]; + GfxDrawSprite(dpi, ImageId(spriteIndex), windowPos + ScreenCoordsXY{ widget.left, widget.top }); + } + } + } + + void DrawTabVehicle(DrawPixelInfo& dpi) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(WINDOW_RIDE_PAGE_VEHICLE); + const auto& widget = widgets[widgetIndex]; + + if (!WidgetIsDisabled(*this, widgetIndex)) + { + auto screenCoords = ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; + int32_t clipWidth = widget.right - screenCoords.x; + int32_t clipHeight = widget.bottom - 3 - screenCoords.y; + if (page == WINDOW_RIDE_PAGE_VEHICLE) + clipHeight += 4; + + screenCoords += windowPos; + + DrawPixelInfo clipDPI; + if (!ClipDrawPixelInfo(clipDPI, dpi, screenCoords, clipWidth, clipHeight)) + { + return; + } + + screenCoords = ScreenCoordsXY{ widget.width() / 2, widget.height() - 12 }; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + if (rideEntry->flags & RIDE_ENTRY_FLAG_VEHICLE_TAB_SCALE_HALF) + { + clipDPI.zoom_level = ZoomLevel{ 1 }; + clipDPI.width *= 2; + clipDPI.height *= 2; + screenCoords.x *= 2; + screenCoords.y *= 2; + clipDPI.x *= 2; + clipDPI.y *= 2; + } + + // For any suspended rides, move image higher in the vehicle tab on the rides window + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SUSPENDED)) + { + screenCoords.y /= 4; + } + + const auto vehicle = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, rideEntry->TabCar); + const auto& carEntry = rideEntry->Cars[vehicle]; + + auto vehicleId = ((ride->colour_scheme_type & 3) == VEHICLE_COLOUR_SCHEME_PER_VEHICLE) ? rideEntry->TabCar : 0; + VehicleColour vehicleColour = RideGetVehicleColour(*ride, vehicleId); + + // imageIndex represents a precision of 64 + auto imageIndex = OpenRCT2::Entity::Yaw::YawFrom4(2) * 2; + if (page == WINDOW_RIDE_PAGE_VEHICLE) + imageIndex += frame_no; + imageIndex = carEntry.SpriteByYaw(imageIndex / 2, SpriteGroupType::SlopeFlat); + imageIndex &= carEntry.TabRotationMask; + imageIndex *= carEntry.base_num_frames; + imageIndex += carEntry.base_image_id; + auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary); + GfxDrawSprite(clipDPI, imageId, screenCoords); + } + } + + void DrawTabCustomer(DrawPixelInfo& dpi) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(WINDOW_RIDE_PAGE_CUSTOMER); + + if (!WidgetIsDisabled(*this, widgetIndex)) + { + const auto& widget = widgets[widgetIndex]; + int32_t spriteIndex = 0; + if (page == WINDOW_RIDE_PAGE_CUSTOMER) + spriteIndex = picked_peep_frame & ~3; + + spriteIndex += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1; + + GfxDrawSprite( + dpi, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL), + windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 }); + } + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawTabVehicle(dpi); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_OPERATING, SPR_TAB_GEARS_0); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_MAINTENANCE, SPR_TAB_WRENCH_0); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_INCOME, SPR_TAB_ADMISSION_0); + DrawTabMain(dpi); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_MEASUREMENTS, SPR_TAB_TIMER_0); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_COLOUR, SPR_TAB_PAINT_0); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_GRAPHS, SPR_TAB_GRAPH_A_0); + DrawTabCustomer(dpi); + DrawTabImage(dpi, WINDOW_RIDE_PAGE_MUSIC, SPR_TAB_MUSIC_0); + } + + void DisableTabs() + { + uint32_t disabledTabs = 0; + auto ride = GetRide(rideId); + if (ride == nullptr) return; + + const auto& rtd = ride->GetRideTypeDescriptor(); + + if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING)) + disabledTabs |= (1uLL << WIDX_TAB_8); // 0x800 + + if (ride->type == RIDE_TYPE_MINI_GOLF) + disabledTabs |= (1uLL << WIDX_TAB_2 | 1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4); // 0xE0 + + if (rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) + disabledTabs |= (1uLL << WIDX_TAB_2); // 0x20 + + if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL) + && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS) + && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)) + { + disabledTabs |= (1uLL << WIDX_TAB_5); // 0x100 } - screenCoords = ScreenCoordsXY{ widget.width() / 2, widget.height() - 12 }; + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) + disabledTabs |= (1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_7); // 0x4C0 + + if (!rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) + { + disabledTabs |= (1uLL << WIDX_TAB_6); // 0x200 + } + + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_CASH_MACHINE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_FIRST_AID) + || (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0) + disabledTabs |= (1uLL << WIDX_TAB_9); // 0x1000 + + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) != 0) + disabledTabs |= (1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_6 | 1uLL << WIDX_TAB_9 | 1uLL << WIDX_TAB_10); // 0x3280 + + const auto* rideEntry = GetRideEntryByIndex(ride->subtype); + + if (rideEntry == nullptr) + { + disabledTabs |= 1uLL << WIDX_TAB_2 | 1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_5 + | 1uLL << WIDX_TAB_6 | 1uLL << WIDX_TAB_7 | 1uLL << WIDX_TAB_8 | 1uLL << WIDX_TAB_9 | 1uLL << WIDX_TAB_10; + } + else if ((rideEntry->flags & RIDE_ENTRY_FLAG_DISABLE_COLOUR_TAB) != 0) + { + disabledTabs |= (1uLL << WIDX_TAB_5); + } + + disabled_widgets = disabledTabs; + } + + void UpdateOverallView(const Ride& ride) const + { + // Calculate x, y, z bounds of the entire ride using its track elements + TileElementIterator it; + + TileElementIteratorBegin(&it); + + CoordsXYZ min = { std::numeric_limits::max(), std::numeric_limits::max(), + std::numeric_limits::max() }; + CoordsXYZ max = { std::numeric_limits::min(), std::numeric_limits::min(), + std::numeric_limits::min() }; + + while (TileElementIteratorNext(&it)) + { + if (it.element->GetType() != TileElementType::Track) + continue; + + if (it.element->AsTrack()->GetRideIndex() != ride.id) + continue; + + auto location = TileCoordsXY(it.x, it.y).ToCoordsXY(); + int32_t baseZ = it.element->GetBaseZ(); + int32_t clearZ = it.element->GetClearanceZ(); + + min.x = std::min(min.x, location.x); + min.y = std::min(min.y, location.y); + min.z = std::min(min.z, baseZ); + + max.x = std::max(max.x, location.x); + max.y = std::max(max.y, location.y); + max.z = std::max(max.z, clearZ); + } + + const auto rideIndex = ride.id.ToUnderlying(); + if (rideIndex >= _rideOverallViewsCache.size()) + { + _rideOverallViewsCache.resize(rideIndex + 1); + } + + auto& view = _rideOverallViewsCache[rideIndex]; + view.loc = CoordsXYZ{ (min.x + max.x) / 2, (min.y + max.y) / 2, (min.z + max.z) / 2 } + CoordsXYZ{ 16, 16, -8 }; + + // Calculate size to determine from how far away to view the ride + const auto diff = max - min; + + const int32_t size = static_cast(std::sqrt(diff.x * diff.x + diff.y * diff.y + diff.z * diff.z)); + + if (size >= 80) + { + // Each farther zoom level shows twice as many tiles (log) + // Appropriate zoom is lowered by one to fill the entire view with the ride + const auto zoomValue = static_cast(std::ceil(std::log(size / 80)) - 1); + view.zoom = std::clamp(ZoomLevel{ zoomValue }, ZoomLevel{ 0 }, ZoomLevel::max()); + } + else + { + // Small rides or stalls are zoomed in all the way. + view.zoom = ZoomLevel{ 0 }; + } + } + + void SetPressedTab() + { + int32_t i; + for (i = 0; i < WINDOW_RIDE_PAGE_COUNT; i++) + pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + } + + void AnchorBorderWidgets() + { + ResizeFrameWithPage(); + } + +#pragma region Main + + std::optional GetStationIndexFromViewSelection() const + { + const auto* ride = GetRide(RideId::FromUnderlying(number)); + if (ride == nullptr) + return std::nullopt; + + int32_t viewSelectionIndex = _viewIndex - 1 - ride->NumTrains; + if (viewSelectionIndex < 0) + { + return std::nullopt; + } + + for (const auto& station : ride->GetStations()) + { + if (!station.Start.IsNull() && viewSelectionIndex-- == 0) + { + const auto stationIndex = ride->GetStationIndex(&station); + return std::make_optional(stationIndex); + } + } + return std::nullopt; + } + + void InitViewport() + { + if (page != WINDOW_RIDE_PAGE_MAIN) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + int32_t viewSelectionIndex = _viewIndex - 1; + + std::optional newFocus; + + if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->NumTrains + && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) + { + auto vehId = ride->vehicles[viewSelectionIndex]; + const auto* rideEntry = ride->GetRideEntry(); + if (rideEntry != nullptr && rideEntry->TabCar != 0) + { + Vehicle* vehicle = GetEntity(vehId); + if (vehicle == nullptr) + { + vehId = EntityId::GetNull(); + } + else if (!vehicle->next_vehicle_on_train.IsNull()) + { + vehId = vehicle->next_vehicle_on_train; + } + } + if (!vehId.IsNull()) + { + newFocus = Focus(vehId); + } + } + else if (viewSelectionIndex >= ride->NumTrains && viewSelectionIndex < (ride->NumTrains + ride->num_stations)) + { + auto stationIndex = GetStationIndexFromViewSelection(); + if (stationIndex) + { + const auto location = ride->GetStation(*stationIndex).GetStart(); + newFocus = Focus(location); + } + } + else + { + if (viewSelectionIndex > 0) + { + _viewIndex = 0; + } + if (number < _rideOverallViewsCache.size()) + { + const auto& view = _rideOverallViewsCache[number]; + newFocus = Focus(view.loc, view.zoom); + } + } + + uint16_t newViewportFlags = 0; + if (viewport != nullptr) + { + if (focus == newFocus) + { + return; + } + newViewportFlags = viewport->flags; + RemoveViewport(); + } + else if (gConfigGeneral.AlwaysShowGridlines) + { + newViewportFlags |= VIEWPORT_FLAG_GRIDLINES; + } + + OnPrepareDraw(); + + focus = newFocus; + + // rct2: 0x006aec9c only used here so brought it into the function + if (viewport == nullptr && !ride->overall_view.IsNull() && focus.has_value()) + { + const auto& viewWidget = widgets[WIDX_VIEWPORT]; + + auto screenPos = windowPos + ScreenCoordsXY{ viewWidget.left + 1, viewWidget.top + 1 }; + int32_t viewWidth = viewWidget.width() - 1; + int32_t viewHeight = viewWidget.height() - 1; + + ViewportCreate(this, screenPos, viewWidth, viewHeight, focus.value()); + + flags |= WF_NO_SCROLLING; + Invalidate(); + } + if (viewport != nullptr) + { + viewport->flags = newViewportFlags; + Invalidate(); + } + } + + void Rename() + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + auto rideName = ride->GetName(); + WindowTextInputRawOpen( + this, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, {}, + rideName.c_str(), 32); + } + } + + void MainOnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_CONSTRUCTION: + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + RideConstructionStart(*ride); + if (WindowFindByNumber(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr) + { + Close(); + return; + } + } + break; + } + case WIDX_RENAME: + Rename(); + break; + case WIDX_DEMOLISH: + ContextOpenDetailWindow(WD_DEMOLISH_RIDE, number); + break; + case WIDX_CLOSE_LIGHT: + case WIDX_SIMULATE_LIGHT: + case WIDX_TEST_LIGHT: + case WIDX_OPEN_LIGHT: + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + RideStatus status; + switch (widgetIndex) + { + default: + case WIDX_CLOSE_LIGHT: + status = RideStatus::Closed; + break; + case WIDX_SIMULATE_LIGHT: + status = RideStatus::Simulating; + break; + case WIDX_TEST_LIGHT: + status = RideStatus::Testing; + break; + case WIDX_OPEN_LIGHT: + status = RideStatus::Open; + break; + } + auto gameAction = RideSetStatusAction(ride->id, status); + GameActions::Execute(&gameAction); + } + break; + } + } + } + + void MainResize() + { + int32_t minHeight = 180; + if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) + { + minHeight += 20 + RCT1_LIGHT_OFFSET; + + auto ride = GetRide(rideId); + if (ride != nullptr) + { +#ifdef __SIMULATE_IN_RIDE_WINDOW__ + if (ride->SupportsStatus(RideStatus::Simulating)) + { + minHeight += 14; + } +#endif + if (ride->SupportsStatus(RideStatus::Testing)) + { + minHeight += 14; + } + } + } + if (GetGameState().Cheats.AllowArbitraryRideTypeChanges) + { + minHeight += 15; + } + + flags |= WF_RESIZABLE; + WindowSetResize(*this, 316, minHeight, 500, 450); + // Unlike with other windows, the focus needs to be recentred so it’s best to just reset it. + focus = std::nullopt; + InitViewport(); + } + + size_t GetNumPeepsInTrain(const Ride& ride, int32_t trainIndex) const + { + auto numPeepsInTrain = 0; + const auto* vehicle = TryGetVehicle(ride.vehicles[trainIndex]); + while (vehicle != nullptr) + { + numPeepsInTrain += vehicle->num_peeps; + vehicle = TryGetVehicle(vehicle->next_vehicle_on_train); + } + return numPeepsInTrain; + } + + bool TrainMustBeHidden(const Ride& ride, int32_t trainIndex) const + { + if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + return true; + + const auto* rideEntry = ride.GetRideEntry(); + if (rideEntry == nullptr) + return false; + + if (!(rideEntry->flags & RIDE_ENTRY_FLAG_HIDE_EMPTY_TRAINS)) + return false; + + return GetNumPeepsInTrain(ride, trainIndex) == 0; + } + + void ShowViewDropdown(Widget* widget) + { + Widget* dropdownWidget = widget - 1; + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + const auto& rtd = ride->GetRideTypeDescriptor(); + + int32_t numItems = 1; + if (!rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) + { + numItems += ride->num_stations; + numItems += ride->NumTrains; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, 0, numItems, widget->right - dropdownWidget->left); + + // First item + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_OVERALL_VIEW; + int32_t currentItem = 1; + + // Vehicles + int32_t name = GetRideComponentName(rtd.NameConvention.vehicle).number; + for (int32_t i = 0; i < ride->NumTrains; i++) + { + gDropdownItems[currentItem].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[currentItem].Args = name | (currentItem << 16); + if (TrainMustBeHidden(*ride, i)) + { + Dropdown::SetDisabled(currentItem, true); + } + currentItem++; + } + + // Stations + name = GetRideComponentName(rtd.NameConvention.station).number; + for (int32_t i = 1; i <= ride->num_stations; i++) + { + gDropdownItems[currentItem].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[currentItem].Args = name | (i << 16); + currentItem++; + } + + // Set checked item + Dropdown::SetChecked(_viewIndex, true); + } + + RideStatus GetNextDefaultStatus(const Ride& ride) const + { + switch (ride.status) + { + default: + case RideStatus::Closed: + if ((ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED) + || (ride.lifecycle_flags & RIDE_LIFECYCLE_HAS_STALLED_VEHICLE)) + { + return RideStatus::Closed; + } + if (ride.SupportsStatus(RideStatus::Testing) && !(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED)) + { + return RideStatus::Testing; + } + return RideStatus::Open; + case RideStatus::Simulating: + return RideStatus::Testing; + case RideStatus::Testing: + return (ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED) ? RideStatus::Open : RideStatus::Closed; + case RideStatus::Open: + return RideStatus::Closed; + } + } + + struct RideStatusDropdownInfo + { + struct Ride* Ride{}; + RideStatus CurrentStatus{}; + RideStatus DefaultStatus{}; + + int32_t NumItems{}; + int32_t CheckedIndex = -1; + int32_t DefaultIndex = -1; + }; + + void SetDropdown(RideStatusDropdownInfo& info, RideStatus status, StringId text) const + { + if (info.Ride->SupportsStatus(status)) + { + auto index = info.NumItems; + gDropdownItems[index].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[index].Args = text; + if (info.CurrentStatus == status) + { + info.CheckedIndex = index; + } + if (info.DefaultStatus == status) + { + info.DefaultIndex = index; + } + info.NumItems++; + } + } + + void ShowOpenDropdown(Widget* widget) + { + RideStatusDropdownInfo info; + info.Ride = GetRide(rideId); + if (info.Ride == nullptr) + return; + + info.CurrentStatus = info.Ride->status; + info.DefaultStatus = GetNextDefaultStatus(*info.Ride); + SetDropdown(info, RideStatus::Closed, STR_CLOSE_RIDE); +#ifdef __SIMULATE_IN_RIDE_WINDOW__ + SetDropdown(info, RideStatus::Simulating, STR_SIMULATE_RIDE); +#endif + SetDropdown(info, RideStatus::Testing, STR_TEST_RIDE); + SetDropdown(info, RideStatus::Open, STR_OPEN_RIDE); + WindowDropdownShowText( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, info.NumItems); + Dropdown::SetChecked(info.CheckedIndex, true); + gDropdownDefaultIndex = info.DefaultIndex; + } + + static constexpr StringId GetRideTypeNameForDropdown(ride_type_t rideType) + { + switch (rideType) + { + case RIDE_TYPE_1D: + return STR_RIDE_NAME_1D; + case RIDE_TYPE_1F: + return STR_RIDE_NAME_1F; + case RIDE_TYPE_22: + return STR_RIDE_NAME_22; + case RIDE_TYPE_50: + return STR_RIDE_NAME_50; + case RIDE_TYPE_52: + return STR_RIDE_NAME_52; + case RIDE_TYPE_53: + return STR_RIDE_NAME_53; + case RIDE_TYPE_54: + return STR_RIDE_NAME_54; + case RIDE_TYPE_55: + return STR_RIDE_NAME_55; + case RIDE_TYPE_59: + return STR_RIDE_NAME_59; + default: + return GetRideTypeDescriptor(rideType).Naming.Name; + } + } + + void PopulateRideTypeDropdown() + { + auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); + if (_rideDropdownDataLanguage == ls.GetCurrentLanguage()) + return; + + _rideDropdownData.clear(); + + for (uint8_t i = 0; i < RIDE_TYPE_COUNT; i++) + { + auto name = GetRideTypeNameForDropdown(i); + _rideDropdownData.push_back({ i, name, u8string_view{ ls.GetString(name) } }); + } + + std::sort(_rideDropdownData.begin(), _rideDropdownData.end(), [](auto& a, auto& b) { + return a.LabelString.compare(b.LabelString) < 0; + }); + + _rideDropdownDataLanguage = ls.GetCurrentLanguage(); + } + + void ShowRideTypeDropdown(Widget* widget) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + PopulateRideTypeDropdown(); + + for (size_t i = 0; i < _rideDropdownData.size(); i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = _rideDropdownData[i].LabelId; + } + + Widget* dropdownWidget = widget - 1; + WindowDropdownShowText( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], Dropdown::Flag::StayOpen, RIDE_TYPE_COUNT); + + // Find the current ride type in the ordered list. + int32_t pos = 0; + for (int32_t i = 0; i < RIDE_TYPE_COUNT; i++) + { + if (_rideDropdownData[i].RideTypeId == ride->type) + { + pos = i; + break; + } + } + + gDropdownHighlightedIndex = pos; + gDropdownDefaultIndex = pos; + Dropdown::SetChecked(pos, true); + } + + void ShowLocateDropdown(Widget* widget) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + gDropdownItems[0].Format = STR_LOCATE_SUBJECT_TIP; + gDropdownItems[1].Format = STR_FOLLOW_SUBJECT_TIP; + + WindowDropdownShowText( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 2); + gDropdownDefaultIndex = 0; + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK) || _viewIndex == 0 + || _viewIndex > ride->NumTrains) + { + // Disable if we're a flat ride, 'overall view' is selected or a station is selected + Dropdown::SetDisabled(1, true); + } + } + + void MainFollowRide() + { + auto* ride = GetRide(rideId); + if (ride != nullptr) + { + if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) + { + if (_viewIndex > 0) + { + if (_viewIndex <= ride->NumTrains) + { + Vehicle* vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); + if (vehicle != nullptr) + { + auto headVehicleSpriteIndex = vehicle->Id; + WindowBase* w_main = WindowGetMain(); + WindowFollowSprite(*w_main, headVehicleSpriteIndex); + } + } + } + } + } + } + + void PopulateVehicleTypeDropdown(const Ride& ride, bool forceRefresh = false) + { + auto& objManager = GetContext()->GetObjectManager(); + const auto* rideEntry = ride.GetRideEntry(); + + bool selectionShouldBeExpanded; + int32_t rideTypeIterator, rideTypeIteratorMax; + + const auto& rtd = ride.GetRideTypeDescriptor(); + if (GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes + && !( + rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE) + || ride.type == RIDE_TYPE_MINI_GOLF)) + { + selectionShouldBeExpanded = true; + rideTypeIterator = 0; + rideTypeIteratorMax = RIDE_TYPE_COUNT - 1; + } + else + { + selectionShouldBeExpanded = false; + rideTypeIterator = ride.type; + rideTypeIteratorMax = ride.type; + } + + // Don't repopulate the list if we just did. + auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); + if (!forceRefresh && _vehicleDropdownExpanded == selectionShouldBeExpanded && _vehicleDropdownRideType == rideEntry + && _vehicleDropdownDataLanguage == ls.GetCurrentLanguage()) + return; + + _vehicleDropdownData.clear(); + + for (; rideTypeIterator <= rideTypeIteratorMax; rideTypeIterator++) + { + const auto& rtdIterator = GetRideTypeDescriptor(rideTypeIterator); + if (selectionShouldBeExpanded && rtdIterator.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) + continue; + if (selectionShouldBeExpanded + && (rtdIterator.HasFlag(RIDE_TYPE_FLAG_IS_MAZE) || rideTypeIterator == RIDE_TYPE_MINI_GOLF)) + continue; + + auto& rideEntries = objManager.GetAllRideEntries(rideTypeIterator); + for (auto rideEntryIndex : rideEntries) + { + const auto* currentRideEntry = GetRideEntryByIndex(rideEntryIndex); + if (currentRideEntry == nullptr) + continue; + + // Skip if vehicle type has not been invented yet + if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) + continue; + + auto name = currentRideEntry->naming.Name; + _vehicleDropdownData.push_back({ rideEntryIndex, name, u8string_view{ ls.GetString(name) } }); + } + } + + std::sort(_vehicleDropdownData.begin(), _vehicleDropdownData.end(), [](auto& a, auto& b) { + return a.LabelString.compare(b.LabelString) < 0; + }); + + _vehicleDropdownExpanded = selectionShouldBeExpanded; + _vehicleDropdownRideType = rideEntry; + _vehicleDropdownDataLanguage = ls.GetCurrentLanguage(); + } + + void ShowVehicleTypeDropdown(Widget* widget) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + PopulateVehicleTypeDropdown(*ride); + + size_t numItems = std::min(_vehicleDropdownData.size(), Dropdown::ItemsMaxSize); + + for (size_t i = 0; i < numItems; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = _vehicleDropdownData[i].LabelId; + } + + Widget* dropdownWidget = widget - 1; + auto ddWidth = WindowDropDownHasMultipleColumns(numItems) ? dropdownWidget->width() - 24 : dropdownWidget->width(); + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, numItems, ddWidth); + + // Find the current vehicle type in the ordered list. + int32_t pos = 0; + for (int32_t i = 0; i < static_cast(_vehicleDropdownData.size()); i++) + { + if (_vehicleDropdownData[i].SubTypeId == ride->subtype) + { + pos = i; + break; + } + } + + gDropdownHighlightedIndex = pos; + gDropdownDefaultIndex = pos; + Dropdown::SetChecked(pos, true); + } + + void PopulateEntranceStyleDropdown() + { + auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); + if (_entranceDropdownDataLanguage == ls.GetCurrentLanguage()) + return; + + _entranceDropdownData.clear(); + + auto& objManager = GetContext()->GetObjectManager(); + + for (ObjectEntryIndex i = 0; i < MAX_STATION_OBJECTS; i++) + { + auto stationObj = static_cast(objManager.GetLoadedObject(ObjectType::Station, i)); + if (stationObj != nullptr) + { + auto name = stationObj->NameStringId; + _entranceDropdownData.push_back({ i, name, u8string_view{ ls.GetString(name) } }); + } + } + + std::sort(_entranceDropdownData.begin(), _entranceDropdownData.end(), [](auto& a, auto& b) { + return a.LabelString.compare(b.LabelString) < 0; + }); + + _entranceDropdownDataLanguage = ls.GetCurrentLanguage(); + } + + void ShowEntranceStyleDropdown() + { + auto dropdownWidget = &widgets[WIDX_ENTRANCE_STYLE_DROPDOWN] - 1; + auto ride = GetRide(rideId); + + PopulateEntranceStyleDropdown(); + + for (size_t i = 0; i < _entranceDropdownData.size(); i++) + { + gDropdownItems[i].Args = _entranceDropdownData[i].LabelId; + gDropdownItems[i].Format = _entranceDropdownData[i].EntranceTypeId == ride->entrance_style + ? STR_DROPDOWN_MENU_LABEL_SELECTED + : STR_DROPDOWN_MENU_LABEL; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, _entranceDropdownData.size(), + widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].right - dropdownWidget->left); + } + + void MainOnMouseDown(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_VIEW_DROPDOWN: + ShowViewDropdown(&widgets[widgetIndex]); + break; + case WIDX_OPEN: + ShowOpenDropdown(&widgets[widgetIndex]); + break; + case WIDX_RIDE_TYPE_DROPDOWN: + ShowRideTypeDropdown(&widgets[widgetIndex]); + break; + case WIDX_LOCATE: + ShowLocateDropdown(&widgets[widgetIndex]); + break; + } + } + + void MainOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_VIEW_DROPDOWN: + if (dropdownIndex == -1) + { + dropdownIndex = _viewIndex + 1; + auto ride = GetRide(rideId); + if (ride != nullptr) + { + if (dropdownIndex != 0 && dropdownIndex <= ride->NumTrains + && !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + { + dropdownIndex = ride->NumTrains + 1; + } + if (dropdownIndex >= gDropdownNumItems) + { + dropdownIndex = 0; + } + } + } + + _viewIndex = dropdownIndex; + InitViewport(); + Invalidate(); + break; + case WIDX_OPEN: + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + auto status = RideStatus::Closed; + if (dropdownIndex < 0) + { + dropdownIndex = gDropdownHighlightedIndex; + } + if (dropdownIndex < static_cast(std::size(gDropdownItems))) + { + switch (gDropdownItems[dropdownIndex].Args) + { + case STR_CLOSE_RIDE: + status = RideStatus::Closed; + break; + case STR_SIMULATE_RIDE: + status = RideStatus::Simulating; + break; + case STR_TEST_RIDE: + status = RideStatus::Testing; + break; + case STR_OPEN_RIDE: + status = RideStatus::Open; + break; + } + } + auto gameAction = RideSetStatusAction(ride->id, status); + GameActions::Execute(&gameAction); + } + break; + } + case WIDX_RIDE_TYPE_DROPDOWN: + if (dropdownIndex != -1 && dropdownIndex < RIDE_TYPE_COUNT) + { + auto rideLabelId = std::clamp(dropdownIndex, 0, RIDE_TYPE_COUNT - 1); + auto rideType = _rideDropdownData[rideLabelId].RideTypeId; + if (rideType < RIDE_TYPE_COUNT) + { + auto rideSetSetting = RideSetSettingAction(rideId, RideSetSetting::RideType, rideType); + rideSetSetting.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + // Reset ghost track if ride construction window is open, prevents a crash + // Will get set to the correct Alternative variable during set_default_next_piece. + // TODO: Rework construction window to prevent the need for this. + _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; + RideConstructionSetDefaultNextPiece(); + }); + GameActions::Execute(&rideSetSetting); + } + } + break; + case WIDX_LOCATE: + { + if (dropdownIndex == 0) + { + ScrollToViewport(); + } + else if (dropdownIndex == 1) + { + MainFollowRide(); + } + break; + } + } + } + + void MainUpdate() + { + // Update tab animation + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_1); + + // Update status + auto ride = GetRide(rideId); + if (ride != nullptr) + { + if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) + { + if (_viewIndex == 0) + return; + + if (_viewIndex <= ride->NumTrains) + { + Vehicle* vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); + if (vehicle == nullptr + || (vehicle->status != Vehicle::Status::Travelling + && vehicle->status != Vehicle::Status::TravellingCableLift + && vehicle->status != Vehicle::Status::TravellingDodgems + && vehicle->status != Vehicle::Status::TravellingBoat)) + { + return; + } + } + } + ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAIN; + } + WidgetInvalidate(*this, WIDX_STATUS); + } + + void MainOnTextInput(WidgetIndex widgetIndex, std::string_view text) + { + if (widgetIndex != WIDX_RENAME || text.empty()) + return; + + auto ride = GetRide(rideId); + if (ride != nullptr) + { + auto strText = std::string(text); + auto gameAction = RideSetNameAction(ride->id, strText); + GameActions::Execute(&gameAction); + } + } + + void MainViewportRotate() + { + InitViewport(); + } + + void MainOnPrepareDraw() + { + int32_t i, widgetHeight; + + auto* newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); + if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) + && !GetGameState().Cheats.MakeAllDestructible) + disabled_widgets |= (1uLL << WIDX_DEMOLISH); + + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + uint32_t spriteIds[] = { + SPR_CLOSED, + SPR_OPEN, + SPR_TESTING, + SPR_G2_SIMULATE, + }; + widgets[WIDX_OPEN].image = ImageId(spriteIds[EnumValue(ride->status)]); + +#ifdef __SIMULATE_IN_RIDE_WINDOW__ + widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + (ride->status == RideStatus::Closed) * 2 + + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); + widgets[WIDX_SIMULATE_LIGHT].image = SPR_G2_RCT1_SIMULATE_BUTTON_0 + (ride->status == RideStatus::Simulating) * 2 + + WidgetIsPressed(*w, WIDX_SIMULATE_LIGHT); + widgets[WIDX_TEST_LIGHT].image = SPR_G2_RCT1_TEST_BUTTON_0 + (ride->status == RideStatus::Testing) * 2 + + WidgetIsPressed(*this, WIDX_TEST_LIGHT); +#else + const auto closeLightImage = SPR_G2_RCT1_CLOSE_BUTTON_0 + (ride->status == RideStatus::Closed) * 2 + + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); + widgets[WIDX_CLOSE_LIGHT].image = ImageId(closeLightImage); + + auto baseSprite = ride->status == RideStatus::Simulating ? SPR_G2_RCT1_SIMULATE_BUTTON_0 + : SPR_G2_RCT1_TEST_BUTTON_0; + const auto testLightImage = baseSprite + + (ride->status == RideStatus::Testing || ride->status == RideStatus::Simulating) * 2 + + WidgetIsPressed(*this, WIDX_TEST_LIGHT); + widgets[WIDX_TEST_LIGHT].image = ImageId(testLightImage); +#endif + const auto openLightImage = SPR_G2_RCT1_OPEN_BUTTON_0 + (ride->status == RideStatus::Open) * 2 + + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); + widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage); + + AnchorBorderWidgets(); + + const int32_t offset = GetGameState().Cheats.AllowArbitraryRideTypeChanges ? 15 : 0; + // Anchor main page specific widgets + widgets[WIDX_VIEWPORT].right = width - 26; + widgets[WIDX_VIEWPORT].bottom = height - (14 + offset); + widgets[WIDX_STATUS].right = width - 26; + widgets[WIDX_STATUS].top = height - (13 + offset); + widgets[WIDX_STATUS].bottom = height - (3 + offset); + widgets[WIDX_VIEW].right = width - 60; + widgets[WIDX_VIEW_DROPDOWN].right = width - 61; + widgets[WIDX_VIEW_DROPDOWN].left = width - 71; + widgets[WIDX_RIDE_TYPE].right = width - 26; + widgets[WIDX_RIDE_TYPE].top = height - 17; + widgets[WIDX_RIDE_TYPE].bottom = height - 4; + widgets[WIDX_RIDE_TYPE_DROPDOWN].left = width - 37; + widgets[WIDX_RIDE_TYPE_DROPDOWN].right = width - 27; + widgets[WIDX_RIDE_TYPE_DROPDOWN].top = height - 16; + widgets[WIDX_RIDE_TYPE_DROPDOWN].bottom = height - 5; + + if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges) + { + widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::Empty; + widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_RIDE_TYPE].text = ride->GetRideTypeDescriptor().Naming.Name; + widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button; + } + + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + + if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) + { + widgets[WIDX_OPEN].type = WindowWidgetType::Empty; + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::Empty; +#ifdef __SIMULATE_IN_RIDE_WINDOW__ + if (ride->SupportsStatus(RideStatus::Simulating)) + widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::ImgBtn; +#endif + widgets[WIDX_TEST_LIGHT].type = ride->SupportsStatus(RideStatus::Testing) ? WindowWidgetType::ImgBtn + : WindowWidgetType::Empty; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; + + widgetHeight = 62; + if (widgets[WIDX_SIMULATE_LIGHT].type != WindowWidgetType::Empty) + { + widgets[WIDX_SIMULATE_LIGHT].top = widgetHeight; + widgets[WIDX_SIMULATE_LIGHT].bottom = widgetHeight + 13; + widgetHeight += 14; + } + if (widgets[WIDX_TEST_LIGHT].type != WindowWidgetType::Empty) + { + widgets[WIDX_TEST_LIGHT].top = widgetHeight; + widgets[WIDX_TEST_LIGHT].bottom = widgetHeight + 13; + widgetHeight += 14; + } + widgets[WIDX_OPEN_LIGHT].top = widgetHeight; + widgets[WIDX_OPEN_LIGHT].bottom = widgetHeight + 13; + widgetHeight += 14 - 24 + RCT1_LIGHT_OFFSET; + } + else + { + widgets[WIDX_OPEN].type = WindowWidgetType::FlatBtn; + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_TEST_LIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::Empty; + widgetHeight = 46; + } + for (i = WIDX_CLOSE_LIGHT; i <= WIDX_OPEN_LIGHT; i++) + { + widgets[i].left = width - 20; + widgets[i].right = width - 7; + } + for (i = WIDX_OPEN; i <= WIDX_DEMOLISH; i++, widgetHeight += 24) + { + widgets[i].left = width - 25; + widgets[i].right = width - 2; + widgets[i].top = widgetHeight; + widgets[i].bottom = widgetHeight + 23; + } + } + + StringId GetStatusOverallView(Formatter& ft) const + { + auto stringId = STR_NONE; + auto ride = GetRide(rideId); + if (ride != nullptr) + { + ride->FormatStatusTo(ft); + stringId = STR_BLACK_STRING; + if ((ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) || (ride->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + { + stringId = STR_RED_OUTLINED_STRING; + } + } + return stringId; + } + + StringId GetStatusVehicle(Formatter& ft) const + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return STR_EMPTY; + + auto vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); + if (vehicle == nullptr) + return STR_EMPTY; + + if (vehicle->status != Vehicle::Status::Crashing && vehicle->status != Vehicle::Status::Crashed) + { + auto trackType = vehicle->GetTrackType(); + if (trackType == TrackElemType::BlockBrakes || trackType == TrackElemType::CableLiftHill + || trackType == TrackElemType::Up25ToFlat || trackType == TrackElemType::Up60ToFlat + || trackType == TrackElemType::DiagUp25ToFlat || trackType == TrackElemType::DiagUp60ToFlat + || trackType == TrackElemType::DiagBlockBrakes) + { + if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0) + { + ft.Add(STR_STOPPED_BY_BLOCK_BRAKES); + return STR_BLACK_STRING; + } + } + } + + if (ride->type == RIDE_TYPE_MINI_GOLF) + return STR_EMPTY; + + auto stringId = VehicleStatusNames[EnumValue(vehicle->status)]; + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SINGLE_SESSION) + && vehicle->status <= Vehicle::Status::UnloadingPassengers) + { + stringId = SingleSessionVehicleStatusNames[EnumValue(vehicle->status)]; + } + + ft.Add(stringId); + uint16_t speedInMph = (abs(vehicle->velocity) * 9) >> 18; + ft.Add(speedInMph); + const RideComponentName stationName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station); + ft.Add(ride->num_stations > 1 ? stationName.number : stationName.singular); + ft.Add(vehicle->current_station.ToUnderlying() + 1); + return stringId != STR_CRASHING && stringId != STR_CRASHED_0 ? STR_BLACK_STRING : STR_RED_OUTLINED_STRING; + } + + StringId GetStatusStation(Formatter& ft) const + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return STR_NONE; + + const auto stationIndex = GetStationIndexFromViewSelection(); + if (!stationIndex) + { + return STR_NONE; + } + + const auto& station = ride->GetStation(*stationIndex); + StringId stringId = STR_EMPTY; + // Entrance / exit + if (ride->status == RideStatus::Closed) + { + if (station.Entrance.IsNull()) + stringId = STR_NO_ENTRANCE; + else if (station.Exit.IsNull()) + stringId = STR_NO_EXIT; + } + else + { + if (station.Entrance.IsNull()) + stringId = STR_EXIT_ONLY; + } + // Queue length + if (stringId == STR_EMPTY) + { + stringId = STR_QUEUE_EMPTY; + uint16_t queueLength = ride->GetStation(*stationIndex).QueueLength; + if (queueLength == 1) + stringId = STR_QUEUE_ONE_PERSON; + else if (queueLength > 1) + stringId = STR_QUEUE_PEOPLE; + + ft.Add(stringId); + ft.Add(queueLength); + } + else + { + ft.Add(stringId); + } + + return STR_BLACK_STRING; + } + + StringId GetStatus(Formatter& ft) const + { + auto ride = GetRide(rideId); + if (_viewIndex == 0) + return GetStatusOverallView(ft); + if (ride != nullptr && _viewIndex <= ride->NumTrains) + return GetStatusVehicle(ft); + if (ride != nullptr && ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + return GetStatusOverallView(ft); + return GetStatusStation(ft); + } + + void MainOnDraw(DrawPixelInfo& dpi) + { + WindowDrawWidgets(*this, dpi); + DrawTabImages(dpi); + + // Viewport and ear icon + if (viewport != nullptr) + { + WindowDrawViewport(dpi, *this); + if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); + } + + // View dropdown + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto ft = Formatter(); + if (_viewIndex != 0) + { + if (_viewIndex > ride->NumTrains) + { + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number); + ft.Add(_viewIndex - ride->NumTrains); + } + else + { + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); + ft.Add(_viewIndex); + } + } + else + { + ft.Add(STR_OVERALL_VIEW); + } + + auto* widget = &widgets[WIDX_VIEW]; + DrawTextBasic( + dpi, { windowPos.x + (widget->left + widget->right - 11) / 2, windowPos.y + widget->top }, + STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); + + // Status + ft = Formatter(); + widget = &widgets[WIDX_STATUS]; + StringId rideStatus = GetStatus(ft); + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, + ft, { TextAlignment::CENTRE }); + } + +#pragma endregion + +#pragma region Vehicle + + void VehicleOnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + } + } + + void VehicleResize() + { + WindowSetResize(*this, 316, 221, 316, 221); + } + + void VehicleOnMouseDown(WidgetIndex widgetIndex) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + switch (widgetIndex) + { + case WIDX_VEHICLE_TYPE_DROPDOWN: + ShowVehicleTypeDropdown(&widgets[widgetIndex]); + break; + case WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX: + ride->SetReversedTrains(!ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)); + break; + case WIDX_VEHICLE_TRAINS_INCREASE: + if (ride->NumTrains < OpenRCT2::Limits::MaxTrainsPerRide) + ride->SetNumTrains(ride->NumTrains + 1); + break; + case WIDX_VEHICLE_TRAINS_DECREASE: + if (ride->NumTrains > 1) + ride->SetNumTrains(ride->NumTrains - 1); + break; + case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE: + if (ride->num_cars_per_train < OpenRCT2::Limits::MaxCarsPerTrain) + ride->SetNumCarsPerVehicle(ride->num_cars_per_train + 1); + break; + case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: + if (ride->num_cars_per_train > 1) + ride->SetNumCarsPerVehicle(ride->num_cars_per_train - 1); + break; + } + } + + void VehicleOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_VEHICLE_TYPE_DROPDOWN: + if (dropdownIndex >= 0 && static_cast(dropdownIndex) < _vehicleDropdownData.size()) + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + auto newRideType = _vehicleDropdownData[dropdownIndex].SubTypeId; + ride->SetRideEntry(newRideType); + } + } + break; + } + } + + void VehicleUpdate() + { + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_2); + } + + OpenRCT2String VehicleTooltip(const WidgetIndex widgetIndex, StringId fallback) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return { STR_NONE, {} }; + + switch (widgetIndex) + { + case WIDX_VEHICLE_TRAINS: + case WIDX_VEHICLE_TRAINS_DECREASE: + case WIDX_VEHICLE_TRAINS_INCREASE: + { + auto ft = Formatter(); + ft.Increment(12); + + RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; + StringId stringId = GetRideComponentName(vehicleType).count; + if (ride->max_trains > 1) + { + stringId = GetRideComponentName(vehicleType).count_plural; + } + ft.Add(stringId); + ft.Add(ride->max_trains); + return { fallback, ft }; + } + case WIDX_VEHICLE_CARS_PER_TRAIN: + case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: + case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE: + { + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return { STR_NONE, {} }; + + auto ft = Formatter(); + ft.Increment(16); + ft.Add(std::max(uint8_t(1), ride->MaxCarsPerTrain) - rideEntry->zero_cars); + + StringId stringId = GetRideComponentName(RideComponentType::Car).singular; + if (ride->MaxCarsPerTrain - rideEntry->zero_cars > 1) + { + stringId = GetRideComponentName(RideComponentType::Car).plural; + } + ft.Add(stringId); + return { fallback, ft }; + } + } + return { fallback, {} }; + } + + void VehicleOnPrepareDraw() + { + StringId stringId; + int32_t carsPerTrain; + + auto* newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + const auto* rideEntry = ride->GetRideEntry(); + + widgets[WIDX_TITLE].text = STR_ARG_20_STRINGID; + + // Widget setup + carsPerTrain = ride->num_cars_per_train - rideEntry->zero_cars; + + // Vehicle type + widgets[WIDX_VEHICLE_TYPE].text = rideEntry->naming.Name; + + // Trains + if (rideEntry->cars_per_flat_ride > 1 || GetGameState().Cheats.DisableTrainLengthLimit) + { + widgets[WIDX_VEHICLE_TRAINS].type = WindowWidgetType::Spinner; + widgets[WIDX_VEHICLE_TRAINS_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_VEHICLE_TRAINS_DECREASE].type = WindowWidgetType::Button; + } + else + { + widgets[WIDX_VEHICLE_TRAINS].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_TRAINS_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_TRAINS_DECREASE].type = WindowWidgetType::Empty; + } + + // Cars per train + if (rideEntry->zero_cars + 1 < rideEntry->max_cars_in_train || GetGameState().Cheats.DisableTrainLengthLimit) + { + widgets[WIDX_VEHICLE_CARS_PER_TRAIN].type = WindowWidgetType::Spinner; + widgets[WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE].type = WindowWidgetType::Button; + } + else + { + widgets[WIDX_VEHICLE_CARS_PER_TRAIN].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE].type = WindowWidgetType::Empty; + } + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_REVERSED_TRAINS) + || (GetGameState().Cheats.DisableTrainLengthLimit + && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))) + { + widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Checkbox; + if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) + { + pressed_widgets |= (1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); + } + else + { + pressed_widgets &= ~(1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); + } + } + else + { + widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Empty; + } + + auto ft = Formatter::Common(); + ft.Increment(6); + ft.Add(carsPerTrain); + RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; + stringId = GetRideComponentName(vehicleType).count; + if (ride->NumTrains > 1) + { + stringId = GetRideComponentName(vehicleType).count_plural; + } + ft.Add(stringId); + ft.Add(ride->NumTrains); + + ft.Increment(8); + + ride->FormatNameTo(ft); + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + + if (abs(ride->num_cars_per_train - rideEntry->zero_cars) == 1) + { + widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_1_CAR_PER_TRAIN; + } + else + { + widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_X_CARS_PER_TRAIN; + } + } + + void VehicleOnDraw(DrawPixelInfo& dpi) + { + WindowDrawWidgets(*this, dpi); + DrawTabImages(dpi); auto ride = GetRide(rideId); if (ride == nullptr) @@ -1178,2684 +2789,945 @@ private: if (rideEntry == nullptr) return; - if (rideEntry->flags & RIDE_ENTRY_FLAG_VEHICLE_TAB_SCALE_HALF) - { - clipDPI.zoom_level = ZoomLevel{ 1 }; - clipDPI.width *= 2; - clipDPI.height *= 2; - screenCoords.x *= 2; - screenCoords.y *= 2; - clipDPI.x *= 2; - clipDPI.y *= 2; - } + auto screenCoords = windowPos + ScreenCoordsXY{ 8, 64 }; - // For any suspended rides, move image higher in the vehicle tab on the rides window - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SUSPENDED)) - { - screenCoords.y /= 4; - } - - const auto vehicle = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, rideEntry->TabCar); - const auto& carEntry = rideEntry->Cars[vehicle]; - - auto vehicleId = ((ride->colour_scheme_type & 3) == VEHICLE_COLOUR_SCHEME_PER_VEHICLE) ? rideEntry->TabCar : 0; - VehicleColour vehicleColour = RideGetVehicleColour(*ride, vehicleId); - - // imageIndex represents a precision of 64 - auto imageIndex = OpenRCT2::Entity::Yaw::YawFrom4(2) * 2; - if (page == WINDOW_RIDE_PAGE_VEHICLE) - imageIndex += frame_no; - imageIndex = carEntry.SpriteByYaw(imageIndex / 2, SpriteGroupType::SlopeFlat); - imageIndex &= carEntry.TabRotationMask; - imageIndex *= carEntry.base_num_frames; - imageIndex += carEntry.base_image_id; - auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary); - GfxDrawSprite(clipDPI, imageId, screenCoords); - } - } - - void DrawTabCustomer(DrawPixelInfo& dpi) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + static_cast(WINDOW_RIDE_PAGE_CUSTOMER); - - if (!WidgetIsDisabled(*this, widgetIndex)) - { - const auto& widget = widgets[widgetIndex]; - int32_t spriteIndex = 0; - if (page == WINDOW_RIDE_PAGE_CUSTOMER) - spriteIndex = picked_peep_frame & ~3; - - spriteIndex += GetPeepAnimation(PeepSpriteType::Normal).base_image + 1; - - GfxDrawSprite( - dpi, ImageId(spriteIndex, COLOUR_BRIGHT_RED, COLOUR_TEAL), - windowPos + ScreenCoordsXY{ widget.midX(), widget.bottom - 6 }); - } - } - - void DrawTabImages(DrawPixelInfo& dpi) - { - DrawTabVehicle(dpi); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_OPERATING, SPR_TAB_GEARS_0); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_MAINTENANCE, SPR_TAB_WRENCH_0); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_INCOME, SPR_TAB_ADMISSION_0); - DrawTabMain(dpi); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_MEASUREMENTS, SPR_TAB_TIMER_0); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_COLOUR, SPR_TAB_PAINT_0); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_GRAPHS, SPR_TAB_GRAPH_A_0); - DrawTabCustomer(dpi); - DrawTabImage(dpi, WINDOW_RIDE_PAGE_MUSIC, SPR_TAB_MUSIC_0); - } - - void DisableTabs() - { - uint32_t disabledTabs = 0; - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - const auto& rtd = ride->GetRideTypeDescriptor(); - - if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_DATA_LOGGING)) - disabledTabs |= (1uLL << WIDX_TAB_8); // 0x800 - - if (ride->type == RIDE_TYPE_MINI_GOLF) - disabledTabs |= (1uLL << WIDX_TAB_2 | 1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4); // 0xE0 - - if (rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) - disabledTabs |= (1uLL << WIDX_TAB_2); // 0x20 - - if (!rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL) - && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS) && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS) - && !rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)) - { - disabledTabs |= (1uLL << WIDX_TAB_5); // 0x100 - } - - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) - disabledTabs |= (1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_7); // 0x4C0 - - if (!rtd.HasFlag(RIDE_TYPE_FLAG_ALLOW_MUSIC)) - { - disabledTabs |= (1uLL << WIDX_TAB_6); // 0x200 - } - - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_CASH_MACHINE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_FIRST_AID) - || (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0) - disabledTabs |= (1uLL << WIDX_TAB_9); // 0x1000 - - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) != 0) - disabledTabs |= (1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_6 | 1uLL << WIDX_TAB_9 | 1uLL << WIDX_TAB_10); // 0x3280 - - const auto* rideEntry = GetRideEntryByIndex(ride->subtype); - - if (rideEntry == nullptr) - { - disabledTabs |= 1uLL << WIDX_TAB_2 | 1uLL << WIDX_TAB_3 | 1uLL << WIDX_TAB_4 | 1uLL << WIDX_TAB_5 - | 1uLL << WIDX_TAB_6 | 1uLL << WIDX_TAB_7 | 1uLL << WIDX_TAB_8 | 1uLL << WIDX_TAB_9 | 1uLL << WIDX_TAB_10; - } - else if ((rideEntry->flags & RIDE_ENTRY_FLAG_DISABLE_COLOUR_TAB) != 0) - { - disabledTabs |= (1uLL << WIDX_TAB_5); - } - - disabled_widgets = disabledTabs; - } - - void UpdateOverallView(const Ride& ride) const - { - // Calculate x, y, z bounds of the entire ride using its track elements - TileElementIterator it; - - TileElementIteratorBegin(&it); - - CoordsXYZ min = { std::numeric_limits::max(), std::numeric_limits::max(), - std::numeric_limits::max() }; - CoordsXYZ max = { std::numeric_limits::min(), std::numeric_limits::min(), - std::numeric_limits::min() }; - - while (TileElementIteratorNext(&it)) - { - if (it.element->GetType() != TileElementType::Track) - continue; - - if (it.element->AsTrack()->GetRideIndex() != ride.id) - continue; - - auto location = TileCoordsXY(it.x, it.y).ToCoordsXY(); - int32_t baseZ = it.element->GetBaseZ(); - int32_t clearZ = it.element->GetClearanceZ(); - - min.x = std::min(min.x, location.x); - min.y = std::min(min.y, location.y); - min.z = std::min(min.z, baseZ); - - max.x = std::max(max.x, location.x); - max.y = std::max(max.y, location.y); - max.z = std::max(max.z, clearZ); - } - - const auto rideIndex = ride.id.ToUnderlying(); - if (rideIndex >= _rideOverallViewsCache.size()) - { - _rideOverallViewsCache.resize(rideIndex + 1); - } - - auto& view = _rideOverallViewsCache[rideIndex]; - view.loc = CoordsXYZ{ (min.x + max.x) / 2, (min.y + max.y) / 2, (min.z + max.z) / 2 } + CoordsXYZ{ 16, 16, -8 }; - - // Calculate size to determine from how far away to view the ride - const auto diff = max - min; - - const int32_t size = static_cast(std::sqrt(diff.x * diff.x + diff.y * diff.y + diff.z * diff.z)); - - if (size >= 80) - { - // Each farther zoom level shows twice as many tiles (log) - // Appropriate zoom is lowered by one to fill the entire view with the ride - const auto zoomValue = static_cast(std::ceil(std::log(size / 80)) - 1); - view.zoom = std::clamp(ZoomLevel{ zoomValue }, ZoomLevel{ 0 }, ZoomLevel::max()); - } - else - { - // Small rides or stalls are zoomed in all the way. - view.zoom = ZoomLevel{ 0 }; - } - } - - void SetPressedTab() - { - int32_t i; - for (i = 0; i < WINDOW_RIDE_PAGE_COUNT; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); - } - - void AnchorBorderWidgets() - { - ResizeFrameWithPage(); - } - -#pragma region Main - - std::optional GetStationIndexFromViewSelection() const - { - const auto* ride = GetRide(RideId::FromUnderlying(number)); - if (ride == nullptr) - return std::nullopt; - - int32_t viewSelectionIndex = _viewIndex - 1 - ride->NumTrains; - if (viewSelectionIndex < 0) - { - return std::nullopt; - } - - for (const auto& station : ride->GetStations()) - { - if (!station.Start.IsNull() && viewSelectionIndex-- == 0) - { - const auto stationIndex = ride->GetStationIndex(&station); - return std::make_optional(stationIndex); - } - } - return std::nullopt; - } - - void InitViewport() - { - if (page != WINDOW_RIDE_PAGE_MAIN) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - int32_t viewSelectionIndex = _viewIndex - 1; - - std::optional newFocus; - - if (viewSelectionIndex >= 0 && viewSelectionIndex < ride->NumTrains && ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) - { - auto vehId = ride->vehicles[viewSelectionIndex]; - const auto* rideEntry = ride->GetRideEntry(); - if (rideEntry != nullptr && rideEntry->TabCar != 0) - { - Vehicle* vehicle = GetEntity(vehId); - if (vehicle == nullptr) - { - vehId = EntityId::GetNull(); - } - else if (!vehicle->next_vehicle_on_train.IsNull()) - { - vehId = vehicle->next_vehicle_on_train; - } - } - if (!vehId.IsNull()) - { - newFocus = Focus(vehId); - } - } - else if (viewSelectionIndex >= ride->NumTrains && viewSelectionIndex < (ride->NumTrains + ride->num_stations)) - { - auto stationIndex = GetStationIndexFromViewSelection(); - if (stationIndex) - { - const auto location = ride->GetStation(*stationIndex).GetStart(); - newFocus = Focus(location); - } - } - else - { - if (viewSelectionIndex > 0) - { - _viewIndex = 0; - } - if (number < _rideOverallViewsCache.size()) - { - const auto& view = _rideOverallViewsCache[number]; - newFocus = Focus(view.loc, view.zoom); - } - } - - uint16_t newViewportFlags = 0; - if (viewport != nullptr) - { - if (focus == newFocus) - { - return; - } - newViewportFlags = viewport->flags; - RemoveViewport(); - } - else if (gConfigGeneral.AlwaysShowGridlines) - { - newViewportFlags |= VIEWPORT_FLAG_GRIDLINES; - } - - OnPrepareDraw(); - - focus = newFocus; - - // rct2: 0x006aec9c only used here so brought it into the function - if (viewport == nullptr && !ride->overall_view.IsNull() && focus.has_value()) - { - const auto& viewWidget = widgets[WIDX_VIEWPORT]; - - auto screenPos = windowPos + ScreenCoordsXY{ viewWidget.left + 1, viewWidget.top + 1 }; - int32_t viewWidth = viewWidget.width() - 1; - int32_t viewHeight = viewWidget.height() - 1; - - ViewportCreate(this, screenPos, viewWidth, viewHeight, focus.value()); - - flags |= WF_NO_SCROLLING; - Invalidate(); - } - if (viewport != nullptr) - { - viewport->flags = newViewportFlags; - Invalidate(); - } - } - - void Rename() - { - auto ride = GetRide(rideId); - if (ride != nullptr) - { - auto rideName = ride->GetName(); - WindowTextInputRawOpen( - this, WIDX_RENAME, STR_RIDE_ATTRACTION_NAME, STR_ENTER_NEW_NAME_FOR_THIS_RIDE_ATTRACTION, {}, rideName.c_str(), - 32); - } - } - - void MainOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_CONSTRUCTION: - { - auto ride = GetRide(rideId); - if (ride != nullptr) - { - RideConstructionStart(*ride); - if (WindowFindByNumber(WindowClass::RideConstruction, ride->id.ToUnderlying()) != nullptr) - { - Close(); - return; - } - } - break; - } - case WIDX_RENAME: - Rename(); - break; - case WIDX_DEMOLISH: - ContextOpenDetailWindow(WD_DEMOLISH_RIDE, number); - break; - case WIDX_CLOSE_LIGHT: - case WIDX_SIMULATE_LIGHT: - case WIDX_TEST_LIGHT: - case WIDX_OPEN_LIGHT: - { - auto ride = GetRide(rideId); - if (ride != nullptr) - { - RideStatus status; - switch (widgetIndex) - { - default: - case WIDX_CLOSE_LIGHT: - status = RideStatus::Closed; - break; - case WIDX_SIMULATE_LIGHT: - status = RideStatus::Simulating; - break; - case WIDX_TEST_LIGHT: - status = RideStatus::Testing; - break; - case WIDX_OPEN_LIGHT: - status = RideStatus::Open; - break; - } - auto gameAction = RideSetStatusAction(ride->id, status); - GameActions::Execute(&gameAction); - } - break; - } - } - } - - void MainResize() - { - int32_t minHeight = 180; - if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) - { - minHeight += 20 + RCT1_LIGHT_OFFSET; - - auto ride = GetRide(rideId); - if (ride != nullptr) - { -#ifdef __SIMULATE_IN_RIDE_WINDOW__ - if (ride->SupportsStatus(RideStatus::Simulating)) - { - minHeight += 14; - } -#endif - if (ride->SupportsStatus(RideStatus::Testing)) - { - minHeight += 14; - } - } - } - if (GetGameState().Cheats.AllowArbitraryRideTypeChanges) - { - minHeight += 15; - } - - flags |= WF_RESIZABLE; - WindowSetResize(*this, 316, minHeight, 500, 450); - // Unlike with other windows, the focus needs to be recentred so it’s best to just reset it. - focus = std::nullopt; - InitViewport(); - } - - size_t GetNumPeepsInTrain(const Ride& ride, int32_t trainIndex) const - { - auto numPeepsInTrain = 0; - const auto* vehicle = TryGetVehicle(ride.vehicles[trainIndex]); - while (vehicle != nullptr) - { - numPeepsInTrain += vehicle->num_peeps; - vehicle = TryGetVehicle(vehicle->next_vehicle_on_train); - } - return numPeepsInTrain; - } - - bool TrainMustBeHidden(const Ride& ride, int32_t trainIndex) const - { - if (!(ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) - return true; - - const auto* rideEntry = ride.GetRideEntry(); - if (rideEntry == nullptr) - return false; - - if (!(rideEntry->flags & RIDE_ENTRY_FLAG_HIDE_EMPTY_TRAINS)) - return false; - - return GetNumPeepsInTrain(ride, trainIndex) == 0; - } - - void ShowViewDropdown(Widget* widget) - { - Widget* dropdownWidget = widget - 1; - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - const auto& rtd = ride->GetRideTypeDescriptor(); - - int32_t numItems = 1; - if (!rtd.HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) - { - numItems += ride->num_stations; - numItems += ride->NumTrains; - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, 0, numItems, widget->right - dropdownWidget->left); - - // First item - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_OVERALL_VIEW; - int32_t currentItem = 1; - - // Vehicles - int32_t name = GetRideComponentName(rtd.NameConvention.vehicle).number; - for (int32_t i = 0; i < ride->NumTrains; i++) - { - gDropdownItems[currentItem].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[currentItem].Args = name | (currentItem << 16); - if (TrainMustBeHidden(*ride, i)) - { - Dropdown::SetDisabled(currentItem, true); - } - currentItem++; - } - - // Stations - name = GetRideComponentName(rtd.NameConvention.station).number; - for (int32_t i = 1; i <= ride->num_stations; i++) - { - gDropdownItems[currentItem].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[currentItem].Args = name | (i << 16); - currentItem++; - } - - // Set checked item - Dropdown::SetChecked(_viewIndex, true); - } - - RideStatus GetNextDefaultStatus(const Ride& ride) const - { - switch (ride.status) - { - default: - case RideStatus::Closed: - if ((ride.lifecycle_flags & RIDE_LIFECYCLE_CRASHED) - || (ride.lifecycle_flags & RIDE_LIFECYCLE_HAS_STALLED_VEHICLE)) - { - return RideStatus::Closed; - } - if (ride.SupportsStatus(RideStatus::Testing) && !(ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED)) - { - return RideStatus::Testing; - } - return RideStatus::Open; - case RideStatus::Simulating: - return RideStatus::Testing; - case RideStatus::Testing: - return (ride.lifecycle_flags & RIDE_LIFECYCLE_TESTED) ? RideStatus::Open : RideStatus::Closed; - case RideStatus::Open: - return RideStatus::Closed; - } - } - - struct RideStatusDropdownInfo - { - struct Ride* Ride{}; - RideStatus CurrentStatus{}; - RideStatus DefaultStatus{}; - - int32_t NumItems{}; - int32_t CheckedIndex = -1; - int32_t DefaultIndex = -1; - }; - - void SetDropdown(RideStatusDropdownInfo& info, RideStatus status, StringId text) const - { - if (info.Ride->SupportsStatus(status)) - { - auto index = info.NumItems; - gDropdownItems[index].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[index].Args = text; - if (info.CurrentStatus == status) - { - info.CheckedIndex = index; - } - if (info.DefaultStatus == status) - { - info.DefaultIndex = index; - } - info.NumItems++; - } - } - - void ShowOpenDropdown(Widget* widget) - { - RideStatusDropdownInfo info; - info.Ride = GetRide(rideId); - if (info.Ride == nullptr) - return; - - info.CurrentStatus = info.Ride->status; - info.DefaultStatus = GetNextDefaultStatus(*info.Ride); - SetDropdown(info, RideStatus::Closed, STR_CLOSE_RIDE); -#ifdef __SIMULATE_IN_RIDE_WINDOW__ - SetDropdown(info, RideStatus::Simulating, STR_SIMULATE_RIDE); -#endif - SetDropdown(info, RideStatus::Testing, STR_TEST_RIDE); - SetDropdown(info, RideStatus::Open, STR_OPEN_RIDE); - WindowDropdownShowText( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, info.NumItems); - Dropdown::SetChecked(info.CheckedIndex, true); - gDropdownDefaultIndex = info.DefaultIndex; - } - - static constexpr StringId GetRideTypeNameForDropdown(ride_type_t rideType) - { - switch (rideType) - { - case RIDE_TYPE_1D: - return STR_RIDE_NAME_1D; - case RIDE_TYPE_1F: - return STR_RIDE_NAME_1F; - case RIDE_TYPE_22: - return STR_RIDE_NAME_22; - case RIDE_TYPE_50: - return STR_RIDE_NAME_50; - case RIDE_TYPE_52: - return STR_RIDE_NAME_52; - case RIDE_TYPE_53: - return STR_RIDE_NAME_53; - case RIDE_TYPE_54: - return STR_RIDE_NAME_54; - case RIDE_TYPE_55: - return STR_RIDE_NAME_55; - case RIDE_TYPE_59: - return STR_RIDE_NAME_59; - default: - return GetRideTypeDescriptor(rideType).Naming.Name; - } - } - - void PopulateRideTypeDropdown() - { - auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - if (_rideDropdownDataLanguage == ls.GetCurrentLanguage()) - return; - - _rideDropdownData.clear(); - - for (uint8_t i = 0; i < RIDE_TYPE_COUNT; i++) - { - auto name = GetRideTypeNameForDropdown(i); - _rideDropdownData.push_back({ i, name, u8string_view{ ls.GetString(name) } }); - } - - std::sort(_rideDropdownData.begin(), _rideDropdownData.end(), [](auto& a, auto& b) { - return a.LabelString.compare(b.LabelString) < 0; - }); - - _rideDropdownDataLanguage = ls.GetCurrentLanguage(); - } - - void ShowRideTypeDropdown(Widget* widget) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - PopulateRideTypeDropdown(); - - for (size_t i = 0; i < _rideDropdownData.size(); i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = _rideDropdownData[i].LabelId; - } - - Widget* dropdownWidget = widget - 1; - WindowDropdownShowText( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - Dropdown::Flag::StayOpen, RIDE_TYPE_COUNT); - - // Find the current ride type in the ordered list. - int32_t pos = 0; - for (int32_t i = 0; i < RIDE_TYPE_COUNT; i++) - { - if (_rideDropdownData[i].RideTypeId == ride->type) - { - pos = i; - break; - } - } - - gDropdownHighlightedIndex = pos; - gDropdownDefaultIndex = pos; - Dropdown::SetChecked(pos, true); - } - - void ShowLocateDropdown(Widget* widget) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - gDropdownItems[0].Format = STR_LOCATE_SUBJECT_TIP; - gDropdownItems[1].Format = STR_FOLLOW_SUBJECT_TIP; - - WindowDropdownShowText( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 2); - gDropdownDefaultIndex = 0; - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK) || _viewIndex == 0 || _viewIndex > ride->NumTrains) - { - // Disable if we're a flat ride, 'overall view' is selected or a station is selected - Dropdown::SetDisabled(1, true); - } - } - - void MainFollowRide() - { - auto* ride = GetRide(rideId); - if (ride != nullptr) - { - if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) - { - if (_viewIndex > 0) - { - if (_viewIndex <= ride->NumTrains) - { - Vehicle* vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); - if (vehicle != nullptr) - { - auto headVehicleSpriteIndex = vehicle->Id; - WindowBase* w_main = WindowGetMain(); - WindowFollowSprite(*w_main, headVehicleSpriteIndex); - } - } - } - } - } - } - - void PopulateVehicleTypeDropdown(const Ride& ride, bool forceRefresh = false) - { - auto& objManager = GetContext()->GetObjectManager(); - const auto* rideEntry = ride.GetRideEntry(); - - bool selectionShouldBeExpanded; - int32_t rideTypeIterator, rideTypeIteratorMax; - - const auto& rtd = ride.GetRideTypeDescriptor(); - if (GetGameState().Cheats.ShowVehiclesFromOtherTrackTypes - && !( - rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) || rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE) - || ride.type == RIDE_TYPE_MINI_GOLF)) - { - selectionShouldBeExpanded = true; - rideTypeIterator = 0; - rideTypeIteratorMax = RIDE_TYPE_COUNT - 1; - } - else - { - selectionShouldBeExpanded = false; - rideTypeIterator = ride.type; - rideTypeIteratorMax = ride.type; - } - - // Don't repopulate the list if we just did. - auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - if (!forceRefresh && _vehicleDropdownExpanded == selectionShouldBeExpanded && _vehicleDropdownRideType == rideEntry - && _vehicleDropdownDataLanguage == ls.GetCurrentLanguage()) - return; - - _vehicleDropdownData.clear(); - - for (; rideTypeIterator <= rideTypeIteratorMax; rideTypeIterator++) - { - const auto& rtdIterator = GetRideTypeDescriptor(rideTypeIterator); - if (selectionShouldBeExpanded && rtdIterator.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE)) - continue; - if (selectionShouldBeExpanded - && (rtdIterator.HasFlag(RIDE_TYPE_FLAG_IS_MAZE) || rideTypeIterator == RIDE_TYPE_MINI_GOLF)) - continue; - - auto& rideEntries = objManager.GetAllRideEntries(rideTypeIterator); - for (auto rideEntryIndex : rideEntries) - { - const auto* currentRideEntry = GetRideEntryByIndex(rideEntryIndex); - if (currentRideEntry == nullptr) - continue; - - // Skip if vehicle type has not been invented yet - if (!RideEntryIsInvented(rideEntryIndex) && !GetGameState().Cheats.IgnoreResearchStatus) - continue; - - auto name = currentRideEntry->naming.Name; - _vehicleDropdownData.push_back({ rideEntryIndex, name, u8string_view{ ls.GetString(name) } }); - } - } - - std::sort(_vehicleDropdownData.begin(), _vehicleDropdownData.end(), [](auto& a, auto& b) { - return a.LabelString.compare(b.LabelString) < 0; - }); - - _vehicleDropdownExpanded = selectionShouldBeExpanded; - _vehicleDropdownRideType = rideEntry; - _vehicleDropdownDataLanguage = ls.GetCurrentLanguage(); - } - - void ShowVehicleTypeDropdown(Widget* widget) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - PopulateVehicleTypeDropdown(*ride); - - size_t numItems = std::min(_vehicleDropdownData.size(), Dropdown::ItemsMaxSize); - - for (size_t i = 0; i < numItems; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = _vehicleDropdownData[i].LabelId; - } - - Widget* dropdownWidget = widget - 1; - auto ddWidth = WindowDropDownHasMultipleColumns(numItems) ? dropdownWidget->width() - 24 : dropdownWidget->width(); - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, numItems, ddWidth); - - // Find the current vehicle type in the ordered list. - int32_t pos = 0; - for (int32_t i = 0; i < static_cast(_vehicleDropdownData.size()); i++) - { - if (_vehicleDropdownData[i].SubTypeId == ride->subtype) - { - pos = i; - break; - } - } - - gDropdownHighlightedIndex = pos; - gDropdownDefaultIndex = pos; - Dropdown::SetChecked(pos, true); - } - - void PopulateEntranceStyleDropdown() - { - auto& ls = OpenRCT2::GetContext()->GetLocalisationService(); - if (_entranceDropdownDataLanguage == ls.GetCurrentLanguage()) - return; - - _entranceDropdownData.clear(); - - auto& objManager = GetContext()->GetObjectManager(); - - for (ObjectEntryIndex i = 0; i < MAX_STATION_OBJECTS; i++) - { - auto stationObj = static_cast(objManager.GetLoadedObject(ObjectType::Station, i)); - if (stationObj != nullptr) - { - auto name = stationObj->NameStringId; - _entranceDropdownData.push_back({ i, name, u8string_view{ ls.GetString(name) } }); - } - } - - std::sort(_entranceDropdownData.begin(), _entranceDropdownData.end(), [](auto& a, auto& b) { - return a.LabelString.compare(b.LabelString) < 0; - }); - - _entranceDropdownDataLanguage = ls.GetCurrentLanguage(); - } - - void ShowEntranceStyleDropdown() - { - auto dropdownWidget = &widgets[WIDX_ENTRANCE_STYLE_DROPDOWN] - 1; - auto ride = GetRide(rideId); - - PopulateEntranceStyleDropdown(); - - for (size_t i = 0; i < _entranceDropdownData.size(); i++) - { - gDropdownItems[i].Args = _entranceDropdownData[i].LabelId; - gDropdownItems[i].Format = _entranceDropdownData[i].EntranceTypeId == ride->entrance_style - ? STR_DROPDOWN_MENU_LABEL_SELECTED - : STR_DROPDOWN_MENU_LABEL; - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, _entranceDropdownData.size(), - widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].right - dropdownWidget->left); - } - - void MainOnMouseDown(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_VIEW_DROPDOWN: - ShowViewDropdown(&widgets[widgetIndex]); - break; - case WIDX_OPEN: - ShowOpenDropdown(&widgets[widgetIndex]); - break; - case WIDX_RIDE_TYPE_DROPDOWN: - ShowRideTypeDropdown(&widgets[widgetIndex]); - break; - case WIDX_LOCATE: - ShowLocateDropdown(&widgets[widgetIndex]); - break; - } - } - - void MainOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) - { - case WIDX_VIEW_DROPDOWN: - if (dropdownIndex == -1) - { - dropdownIndex = _viewIndex + 1; - auto ride = GetRide(rideId); - if (ride != nullptr) - { - if (dropdownIndex != 0 && dropdownIndex <= ride->NumTrains - && !(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) - { - dropdownIndex = ride->NumTrains + 1; - } - if (dropdownIndex >= gDropdownNumItems) - { - dropdownIndex = 0; - } - } - } - - _viewIndex = dropdownIndex; - InitViewport(); - Invalidate(); - break; - case WIDX_OPEN: - { - auto ride = GetRide(rideId); - if (ride != nullptr) - { - auto status = RideStatus::Closed; - if (dropdownIndex < 0) - { - dropdownIndex = gDropdownHighlightedIndex; - } - if (dropdownIndex < static_cast(std::size(gDropdownItems))) - { - switch (gDropdownItems[dropdownIndex].Args) - { - case STR_CLOSE_RIDE: - status = RideStatus::Closed; - break; - case STR_SIMULATE_RIDE: - status = RideStatus::Simulating; - break; - case STR_TEST_RIDE: - status = RideStatus::Testing; - break; - case STR_OPEN_RIDE: - status = RideStatus::Open; - break; - } - } - auto gameAction = RideSetStatusAction(ride->id, status); - GameActions::Execute(&gameAction); - } - break; - } - case WIDX_RIDE_TYPE_DROPDOWN: - if (dropdownIndex != -1 && dropdownIndex < RIDE_TYPE_COUNT) - { - auto rideLabelId = std::clamp(dropdownIndex, 0, RIDE_TYPE_COUNT - 1); - auto rideType = _rideDropdownData[rideLabelId].RideTypeId; - if (rideType < RIDE_TYPE_COUNT) - { - auto rideSetSetting = RideSetSettingAction(rideId, RideSetSetting::RideType, rideType); - rideSetSetting.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - // Reset ghost track if ride construction window is open, prevents a crash - // Will get set to the correct Alternative variable during set_default_next_piece. - // TODO: Rework construction window to prevent the need for this. - _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; - RideConstructionSetDefaultNextPiece(); - }); - GameActions::Execute(&rideSetSetting); - } - } - break; - case WIDX_LOCATE: - { - if (dropdownIndex == 0) - { - ScrollToViewport(); - } - else if (dropdownIndex == 1) - { - MainFollowRide(); - } - break; - } - } - } - - void MainUpdate() - { - // Update tab animation - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_1); - - // Update status - auto ride = GetRide(rideId); - if (ride != nullptr) - { - if (!(ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAIN)) - { - if (_viewIndex == 0) - return; - - if (_viewIndex <= ride->NumTrains) - { - Vehicle* vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); - if (vehicle == nullptr - || (vehicle->status != Vehicle::Status::Travelling - && vehicle->status != Vehicle::Status::TravellingCableLift - && vehicle->status != Vehicle::Status::TravellingDodgems - && vehicle->status != Vehicle::Status::TravellingBoat)) - { - return; - } - } - } - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAIN; - } - WidgetInvalidate(*this, WIDX_STATUS); - } - - void MainOnTextInput(WidgetIndex widgetIndex, std::string_view text) - { - if (widgetIndex != WIDX_RENAME || text.empty()) - return; - - auto ride = GetRide(rideId); - if (ride != nullptr) - { - auto strText = std::string(text); - auto gameAction = RideSetNameAction(ride->id, strText); - GameActions::Execute(&gameAction); - } - } - - void MainViewportRotate() - { - InitViewport(); - } - - void MainOnPrepareDraw() - { - int32_t i, widgetHeight; - - auto* newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - disabled_widgets &= ~((1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_CONSTRUCTION)); - if (ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) - && !GetGameState().Cheats.MakeAllDestructible) - disabled_widgets |= (1uLL << WIDX_DEMOLISH); - - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - uint32_t spriteIds[] = { - SPR_CLOSED, - SPR_OPEN, - SPR_TESTING, - SPR_G2_SIMULATE, - }; - widgets[WIDX_OPEN].image = ImageId(spriteIds[EnumValue(ride->status)]); - -#ifdef __SIMULATE_IN_RIDE_WINDOW__ - widgets[WIDX_CLOSE_LIGHT].image = SPR_G2_RCT1_CLOSE_BUTTON_0 + (ride->status == RideStatus::Closed) * 2 - + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); - widgets[WIDX_SIMULATE_LIGHT].image = SPR_G2_RCT1_SIMULATE_BUTTON_0 + (ride->status == RideStatus::Simulating) * 2 - + WidgetIsPressed(*w, WIDX_SIMULATE_LIGHT); - widgets[WIDX_TEST_LIGHT].image = SPR_G2_RCT1_TEST_BUTTON_0 + (ride->status == RideStatus::Testing) * 2 - + WidgetIsPressed(*this, WIDX_TEST_LIGHT); -#else - const auto closeLightImage = SPR_G2_RCT1_CLOSE_BUTTON_0 + (ride->status == RideStatus::Closed) * 2 - + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT); - widgets[WIDX_CLOSE_LIGHT].image = ImageId(closeLightImage); - - auto baseSprite = ride->status == RideStatus::Simulating ? SPR_G2_RCT1_SIMULATE_BUTTON_0 : SPR_G2_RCT1_TEST_BUTTON_0; - const auto testLightImage = baseSprite - + (ride->status == RideStatus::Testing || ride->status == RideStatus::Simulating) * 2 - + WidgetIsPressed(*this, WIDX_TEST_LIGHT); - widgets[WIDX_TEST_LIGHT].image = ImageId(testLightImage); -#endif - const auto openLightImage = SPR_G2_RCT1_OPEN_BUTTON_0 + (ride->status == RideStatus::Open) * 2 - + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); - widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage); - - AnchorBorderWidgets(); - - const int32_t offset = GetGameState().Cheats.AllowArbitraryRideTypeChanges ? 15 : 0; - // Anchor main page specific widgets - widgets[WIDX_VIEWPORT].right = width - 26; - widgets[WIDX_VIEWPORT].bottom = height - (14 + offset); - widgets[WIDX_STATUS].right = width - 26; - widgets[WIDX_STATUS].top = height - (13 + offset); - widgets[WIDX_STATUS].bottom = height - (3 + offset); - widgets[WIDX_VIEW].right = width - 60; - widgets[WIDX_VIEW_DROPDOWN].right = width - 61; - widgets[WIDX_VIEW_DROPDOWN].left = width - 71; - widgets[WIDX_RIDE_TYPE].right = width - 26; - widgets[WIDX_RIDE_TYPE].top = height - 17; - widgets[WIDX_RIDE_TYPE].bottom = height - 4; - widgets[WIDX_RIDE_TYPE_DROPDOWN].left = width - 37; - widgets[WIDX_RIDE_TYPE_DROPDOWN].right = width - 27; - widgets[WIDX_RIDE_TYPE_DROPDOWN].top = height - 16; - widgets[WIDX_RIDE_TYPE_DROPDOWN].bottom = height - 5; - - if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges) - { - widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::Empty; - widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_RIDE_TYPE].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_RIDE_TYPE].text = ride->GetRideTypeDescriptor().Naming.Name; - widgets[WIDX_RIDE_TYPE_DROPDOWN].type = WindowWidgetType::Button; - } - - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - - if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) - { - widgets[WIDX_OPEN].type = WindowWidgetType::Empty; - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; - widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::Empty; -#ifdef __SIMULATE_IN_RIDE_WINDOW__ - if (ride->SupportsStatus(RideStatus::Simulating)) - widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::ImgBtn; -#endif - widgets[WIDX_TEST_LIGHT].type = ride->SupportsStatus(RideStatus::Testing) ? WindowWidgetType::ImgBtn - : WindowWidgetType::Empty; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; - - widgetHeight = 62; - if (widgets[WIDX_SIMULATE_LIGHT].type != WindowWidgetType::Empty) - { - widgets[WIDX_SIMULATE_LIGHT].top = widgetHeight; - widgets[WIDX_SIMULATE_LIGHT].bottom = widgetHeight + 13; - widgetHeight += 14; - } - if (widgets[WIDX_TEST_LIGHT].type != WindowWidgetType::Empty) - { - widgets[WIDX_TEST_LIGHT].top = widgetHeight; - widgets[WIDX_TEST_LIGHT].bottom = widgetHeight + 13; - widgetHeight += 14; - } - widgets[WIDX_OPEN_LIGHT].top = widgetHeight; - widgets[WIDX_OPEN_LIGHT].bottom = widgetHeight + 13; - widgetHeight += 14 - 24 + RCT1_LIGHT_OFFSET; - } - else - { - widgets[WIDX_OPEN].type = WindowWidgetType::FlatBtn; - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_SIMULATE_LIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_TEST_LIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::Empty; - widgetHeight = 46; - } - for (i = WIDX_CLOSE_LIGHT; i <= WIDX_OPEN_LIGHT; i++) - { - widgets[i].left = width - 20; - widgets[i].right = width - 7; - } - for (i = WIDX_OPEN; i <= WIDX_DEMOLISH; i++, widgetHeight += 24) - { - widgets[i].left = width - 25; - widgets[i].right = width - 2; - widgets[i].top = widgetHeight; - widgets[i].bottom = widgetHeight + 23; - } - } - - StringId GetStatusOverallView(Formatter& ft) const - { - auto stringId = STR_NONE; - auto ride = GetRide(rideId); - if (ride != nullptr) - { - ride->FormatStatusTo(ft); - stringId = STR_BLACK_STRING; - if ((ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) || (ride->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) - { - stringId = STR_RED_OUTLINED_STRING; - } - } - return stringId; - } - - StringId GetStatusVehicle(Formatter& ft) const - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return STR_EMPTY; - - auto vehicle = GetEntity(ride->vehicles[_viewIndex - 1]); - if (vehicle == nullptr) - return STR_EMPTY; - - if (vehicle->status != Vehicle::Status::Crashing && vehicle->status != Vehicle::Status::Crashed) - { - auto trackType = vehicle->GetTrackType(); - if (trackType == TrackElemType::BlockBrakes || trackType == TrackElemType::CableLiftHill - || trackType == TrackElemType::Up25ToFlat || trackType == TrackElemType::Up60ToFlat - || trackType == TrackElemType::DiagUp25ToFlat || trackType == TrackElemType::DiagUp60ToFlat - || trackType == TrackElemType::DiagBlockBrakes) - { - if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_BLOCK_BRAKES) && vehicle->velocity == 0) - { - ft.Add(STR_STOPPED_BY_BLOCK_BRAKES); - return STR_BLACK_STRING; - } - } - } - - if (ride->type == RIDE_TYPE_MINI_GOLF) - return STR_EMPTY; - - auto stringId = VehicleStatusNames[EnumValue(vehicle->status)]; - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SINGLE_SESSION) - && vehicle->status <= Vehicle::Status::UnloadingPassengers) - { - stringId = SingleSessionVehicleStatusNames[EnumValue(vehicle->status)]; - } - - ft.Add(stringId); - uint16_t speedInMph = (abs(vehicle->velocity) * 9) >> 18; - ft.Add(speedInMph); - const RideComponentName stationName = GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station); - ft.Add(ride->num_stations > 1 ? stationName.number : stationName.singular); - ft.Add(vehicle->current_station.ToUnderlying() + 1); - return stringId != STR_CRASHING && stringId != STR_CRASHED_0 ? STR_BLACK_STRING : STR_RED_OUTLINED_STRING; - } - - StringId GetStatusStation(Formatter& ft) const - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return STR_NONE; - - const auto stationIndex = GetStationIndexFromViewSelection(); - if (!stationIndex) - { - return STR_NONE; - } - - const auto& station = ride->GetStation(*stationIndex); - StringId stringId = STR_EMPTY; - // Entrance / exit - if (ride->status == RideStatus::Closed) - { - if (station.Entrance.IsNull()) - stringId = STR_NO_ENTRANCE; - else if (station.Exit.IsNull()) - stringId = STR_NO_EXIT; - } - else - { - if (station.Entrance.IsNull()) - stringId = STR_EXIT_ONLY; - } - // Queue length - if (stringId == STR_EMPTY) - { - stringId = STR_QUEUE_EMPTY; - uint16_t queueLength = ride->GetStation(*stationIndex).QueueLength; - if (queueLength == 1) - stringId = STR_QUEUE_ONE_PERSON; - else if (queueLength > 1) - stringId = STR_QUEUE_PEOPLE; - - ft.Add(stringId); - ft.Add(queueLength); - } - else - { - ft.Add(stringId); - } - - return STR_BLACK_STRING; - } - - StringId GetStatus(Formatter& ft) const - { - auto ride = GetRide(rideId); - if (_viewIndex == 0) - return GetStatusOverallView(ft); - if (ride != nullptr && _viewIndex <= ride->NumTrains) - return GetStatusVehicle(ft); - if (ride != nullptr && ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) - return GetStatusOverallView(ft); - return GetStatusStation(ft); - } - - void MainOnDraw(DrawPixelInfo& dpi) - { - WindowDrawWidgets(*this, dpi); - DrawTabImages(dpi); - - // Viewport and ear icon - if (viewport != nullptr) - { - WindowDrawViewport(dpi, *this); - if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) - GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); - } - - // View dropdown - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto ft = Formatter(); - if (_viewIndex != 0) - { - if (_viewIndex > ride->NumTrains) - { - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.station).number); - ft.Add(_viewIndex - ride->NumTrains); - } - else - { - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); - ft.Add(_viewIndex); - } - } - else - { - ft.Add(STR_OVERALL_VIEW); - } - - auto* widget = &widgets[WIDX_VIEW]; - DrawTextBasic( - dpi, { windowPos.x + (widget->left + widget->right - 11) / 2, windowPos.y + widget->top }, - STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); - - // Status - ft = Formatter(); - widget = &widgets[WIDX_STATUS]; - StringId rideStatus = GetStatus(ft); - DrawTextEllipsised( - dpi, windowPos + ScreenCoordsXY{ (widget->left + widget->right) / 2, widget->top }, widget->width(), rideStatus, ft, - { TextAlignment::CENTRE }); - } - -#pragma endregion - -#pragma region Vehicle - - void VehicleOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - } - } - - void VehicleResize() - { - WindowSetResize(*this, 316, 221, 316, 221); - } - - void VehicleOnMouseDown(WidgetIndex widgetIndex) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - switch (widgetIndex) - { - case WIDX_VEHICLE_TYPE_DROPDOWN: - ShowVehicleTypeDropdown(&widgets[widgetIndex]); - break; - case WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX: - ride->SetReversedTrains(!ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)); - break; - case WIDX_VEHICLE_TRAINS_INCREASE: - if (ride->NumTrains < OpenRCT2::Limits::MaxTrainsPerRide) - ride->SetNumTrains(ride->NumTrains + 1); - break; - case WIDX_VEHICLE_TRAINS_DECREASE: - if (ride->NumTrains > 1) - ride->SetNumTrains(ride->NumTrains - 1); - break; - case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE: - if (ride->num_cars_per_train < OpenRCT2::Limits::MaxCarsPerTrain) - ride->SetNumCarsPerVehicle(ride->num_cars_per_train + 1); - break; - case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: - if (ride->num_cars_per_train > 1) - ride->SetNumCarsPerVehicle(ride->num_cars_per_train - 1); - break; - } - } - - void VehicleOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_VEHICLE_TYPE_DROPDOWN: - if (dropdownIndex >= 0 && static_cast(dropdownIndex) < _vehicleDropdownData.size()) - { - auto ride = GetRide(rideId); - if (ride != nullptr) - { - auto newRideType = _vehicleDropdownData[dropdownIndex].SubTypeId; - ride->SetRideEntry(newRideType); - } - } - break; - } - } - - void VehicleUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_2); - } - - OpenRCT2String VehicleTooltip(const WidgetIndex widgetIndex, StringId fallback) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return { STR_NONE, {} }; - - switch (widgetIndex) - { - case WIDX_VEHICLE_TRAINS: - case WIDX_VEHICLE_TRAINS_DECREASE: - case WIDX_VEHICLE_TRAINS_INCREASE: - { - auto ft = Formatter(); - ft.Increment(12); - - RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; - StringId stringId = GetRideComponentName(vehicleType).count; - if (ride->max_trains > 1) - { - stringId = GetRideComponentName(vehicleType).count_plural; - } - ft.Add(stringId); - ft.Add(ride->max_trains); - return { fallback, ft }; - } - case WIDX_VEHICLE_CARS_PER_TRAIN: - case WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE: - case WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE: - { - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return { STR_NONE, {} }; - - auto ft = Formatter(); - ft.Increment(16); - ft.Add(std::max(uint8_t(1), ride->MaxCarsPerTrain) - rideEntry->zero_cars); - - StringId stringId = GetRideComponentName(RideComponentType::Car).singular; - if (ride->MaxCarsPerTrain - rideEntry->zero_cars > 1) - { - stringId = GetRideComponentName(RideComponentType::Car).plural; - } - ft.Add(stringId); - return { fallback, ft }; - } - } - return { fallback, {} }; - } - - void VehicleOnPrepareDraw() - { - StringId stringId; - int32_t carsPerTrain; - - auto* newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - const auto* rideEntry = ride->GetRideEntry(); - - widgets[WIDX_TITLE].text = STR_ARG_20_STRINGID; - - // Widget setup - carsPerTrain = ride->num_cars_per_train - rideEntry->zero_cars; - - // Vehicle type - widgets[WIDX_VEHICLE_TYPE].text = rideEntry->naming.Name; - - // Trains - if (rideEntry->cars_per_flat_ride > 1 || GetGameState().Cheats.DisableTrainLengthLimit) - { - widgets[WIDX_VEHICLE_TRAINS].type = WindowWidgetType::Spinner; - widgets[WIDX_VEHICLE_TRAINS_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_VEHICLE_TRAINS_DECREASE].type = WindowWidgetType::Button; - } - else - { - widgets[WIDX_VEHICLE_TRAINS].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_TRAINS_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_TRAINS_DECREASE].type = WindowWidgetType::Empty; - } - - // Cars per train - if (rideEntry->zero_cars + 1 < rideEntry->max_cars_in_train || GetGameState().Cheats.DisableTrainLengthLimit) - { - widgets[WIDX_VEHICLE_CARS_PER_TRAIN].type = WindowWidgetType::Spinner; - widgets[WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE].type = WindowWidgetType::Button; - } - else - { - widgets[WIDX_VEHICLE_CARS_PER_TRAIN].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_CARS_PER_TRAIN_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_CARS_PER_TRAIN_DECREASE].type = WindowWidgetType::Empty; - } - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_ALLOW_REVERSED_TRAINS) - || (GetGameState().Cheats.DisableTrainLengthLimit - && !ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE))) - { - widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Checkbox; - if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS)) - { - pressed_widgets |= (1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); - } - else - { - pressed_widgets &= ~(1uLL << WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX); - } - } - else - { - widgets[WIDX_VEHICLE_REVERSED_TRAINS_CHECKBOX].type = WindowWidgetType::Empty; - } - - auto ft = Formatter::Common(); - ft.Increment(6); - ft.Add(carsPerTrain); - RideComponentType vehicleType = ride->GetRideTypeDescriptor().NameConvention.vehicle; - stringId = GetRideComponentName(vehicleType).count; - if (ride->NumTrains > 1) - { - stringId = GetRideComponentName(vehicleType).count_plural; - } - ft.Add(stringId); - ft.Add(ride->NumTrains); - - ft.Increment(8); - - ride->FormatNameTo(ft); - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - - if (abs(ride->num_cars_per_train - rideEntry->zero_cars) == 1) - { - widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_1_CAR_PER_TRAIN; - } - else - { - widgets[WIDX_VEHICLE_CARS_PER_TRAIN].text = STR_X_CARS_PER_TRAIN; - } - } - - void VehicleOnDraw(DrawPixelInfo& dpi) - { - WindowDrawWidgets(*this, dpi); - DrawTabImages(dpi); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - auto screenCoords = windowPos + ScreenCoordsXY{ 8, 64 }; - - // Description - auto ft = Formatter(); - ft.Add(rideEntry->naming.Description); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT }); - screenCoords.y += 2; - - // Capacity - ft = Formatter(); - ft.Add(rideEntry->capacity); - DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); - - // Excitement Factor - if (rideEntry->excitement_multiplier != 0) - { - screenCoords.y += LIST_ROW_HEIGHT; + // Description + auto ft = Formatter(); + ft.Add(rideEntry->naming.Description); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 300, STR_BLACK_STRING, ft, { TextAlignment::LEFT }); + screenCoords.y += 2; + // Capacity ft = Formatter(); - ft.Add(abs(rideEntry->excitement_multiplier)); - StringId stringId = rideEntry->excitement_multiplier > 0 ? STR_EXCITEMENT_FACTOR : STR_EXCITEMENT_FACTOR_NEGATIVE; - DrawTextBasic(dpi, screenCoords, stringId, ft); - } + ft.Add(rideEntry->capacity); + DrawTextBasic(dpi, screenCoords, STR_CAPACITY, ft); - // Intensity Factor - if (rideEntry->intensity_multiplier != 0) - { - int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); - if (lineHeight != 10) - screenCoords.x += 150; - else + // Excitement Factor + if (rideEntry->excitement_multiplier != 0) + { screenCoords.y += LIST_ROW_HEIGHT; - ft = Formatter(); - ft.Add(abs(rideEntry->intensity_multiplier)); - StringId stringId = rideEntry->intensity_multiplier > 0 ? STR_INTENSITY_FACTOR : STR_INTENSITY_FACTOR_NEGATIVE; - DrawTextBasic(dpi, screenCoords, stringId, ft); - - if (lineHeight != 10) - screenCoords.x -= 150; - } - - // Nausea Factor - if (rideEntry->nausea_multiplier != 0) - { - screenCoords.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(abs(rideEntry->nausea_multiplier)); - StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE; - DrawTextBasic(dpi, screenCoords, stringId, ft); - } - } - - struct VehicleDrawInfo - { - int16_t x; - int16_t y; - ImageId imageId; - }; - - void VehicleOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - const auto* rideEntry = ride->GetRideEntry(); - - // Background - GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, PALETTE_INDEX_12); - - Widget* widget = &widgets[WIDX_VEHICLE_TRAINS_PREVIEW]; - int32_t startX = std::max(2, (widget->width() - ((ride->NumTrains - 1) * 36)) / 2 - 25); - int32_t startY = widget->height() - 4; - - bool isReversed = ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS); - int32_t carIndex = (isReversed) ? ride->num_cars_per_train - 1 : 0; - - const auto& firstCarEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, carIndex)]; - startY += firstCarEntry.tab_height; - - // For each train - for (int32_t i = 0; i < ride->NumTrains; i++) - { - VehicleDrawInfo trainCarImages[OpenRCT2::Limits::MaxCarsPerTrain]; - VehicleDrawInfo* nextSpriteToDraw = trainCarImages; - int32_t x = startX; - int32_t y = startY; - - // For each car in train - static_assert(std::numeric_limitsnum_cars_per_train)>::max() <= std::size(trainCarImages)); - for (int32_t j = 0; j < ride->num_cars_per_train; j++) - { - carIndex = (isReversed) ? (ride->num_cars_per_train - 1) - j : j; - - const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, carIndex)]; - x += carEntry.spacing / 17432; - y -= (carEntry.spacing / 2) / 17432; - - // Get colour of vehicle - int32_t vehicleColourIndex = 0; - switch (ride->colour_scheme_type & 3) - { - case VEHICLE_COLOUR_SCHEME_SAME: - vehicleColourIndex = 0; - break; - case VEHICLE_COLOUR_SCHEME_PER_TRAIN: - vehicleColourIndex = i; - break; - case VEHICLE_COLOUR_SCHEME_PER_VEHICLE: - vehicleColourIndex = carIndex; - break; - } - VehicleColour vehicleColour = RideGetVehicleColour(*ride, vehicleColourIndex); - - ImageIndex imageIndex = carEntry.SpriteByYaw( - OpenRCT2::Entity::Yaw::BaseRotation / 2, SpriteGroupType::SlopeFlat); - if (isReversed) - { - auto baseRotation = carEntry.NumRotationSprites(SpriteGroupType::SlopeFlat); - imageIndex = carEntry.SpriteByYaw( - (imageIndex + (baseRotation / 2)) & (baseRotation - 1), SpriteGroupType::SlopeFlat); - } - - imageIndex &= carEntry.TabRotationMask; - imageIndex *= carEntry.base_num_frames; - imageIndex += carEntry.base_image_id; - - auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary); - - nextSpriteToDraw->x = x; - nextSpriteToDraw->y = y; - nextSpriteToDraw->imageId = imageId; - nextSpriteToDraw++; - - x += carEntry.spacing / 17432; - y -= (carEntry.spacing / 2) / 17432; + ft = Formatter(); + ft.Add(abs(rideEntry->excitement_multiplier)); + StringId stringId = rideEntry->excitement_multiplier > 0 ? STR_EXCITEMENT_FACTOR + : STR_EXCITEMENT_FACTOR_NEGATIVE; + DrawTextBasic(dpi, screenCoords, stringId, ft); } - if (ride->type == RIDE_TYPE_REVERSER_ROLLER_COASTER) + // Intensity Factor + if (rideEntry->intensity_multiplier != 0) { - VehicleDrawInfo tmp = *(nextSpriteToDraw - 1); - *(nextSpriteToDraw - 1) = *(nextSpriteToDraw - 2); - *(nextSpriteToDraw - 2) = tmp; + int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); + if (lineHeight != 10) + screenCoords.x += 150; + else + screenCoords.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(abs(rideEntry->intensity_multiplier)); + StringId stringId = rideEntry->intensity_multiplier > 0 ? STR_INTENSITY_FACTOR : STR_INTENSITY_FACTOR_NEGATIVE; + DrawTextBasic(dpi, screenCoords, stringId, ft); + + if (lineHeight != 10) + screenCoords.x -= 150; } - VehicleDrawInfo* current = nextSpriteToDraw; - while (--current >= trainCarImages) - GfxDrawSprite(dpi, current->imageId, { current->x, current->y }); + // Nausea Factor + if (rideEntry->nausea_multiplier != 0) + { + screenCoords.y += LIST_ROW_HEIGHT; - startX += 36; + ft = Formatter(); + ft.Add(abs(rideEntry->nausea_multiplier)); + StringId stringId = rideEntry->nausea_multiplier > 0 ? STR_NAUSEA_FACTOR : STR_NAUSEA_FACTOR_NEGATIVE; + DrawTextBasic(dpi, screenCoords, stringId, ft); + } + } + + struct VehicleDrawInfo + { + int16_t x; + int16_t y; + ImageId imageId; + }; + + void VehicleOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + const auto* rideEntry = ride->GetRideEntry(); + + // Background + GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width, dpi.y + dpi.height } }, PALETTE_INDEX_12); + + Widget* widget = &widgets[WIDX_VEHICLE_TRAINS_PREVIEW]; + int32_t startX = std::max(2, (widget->width() - ((ride->NumTrains - 1) * 36)) / 2 - 25); + int32_t startY = widget->height() - 4; + + bool isReversed = ride->HasLifecycleFlag(RIDE_LIFECYCLE_REVERSED_TRAINS); + int32_t carIndex = (isReversed) ? ride->num_cars_per_train - 1 : 0; + + const auto& firstCarEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( + ride->subtype, ride->num_cars_per_train, carIndex)]; + startY += firstCarEntry.tab_height; + + // For each train + for (int32_t i = 0; i < ride->NumTrains; i++) + { + VehicleDrawInfo trainCarImages[OpenRCT2::Limits::MaxCarsPerTrain]; + VehicleDrawInfo* nextSpriteToDraw = trainCarImages; + int32_t x = startX; + int32_t y = startY; + + // For each car in train + static_assert(std::numeric_limitsnum_cars_per_train)>::max() <= std::size(trainCarImages)); + for (int32_t j = 0; j < ride->num_cars_per_train; j++) + { + carIndex = (isReversed) ? (ride->num_cars_per_train - 1) - j : j; + + const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( + ride->subtype, ride->num_cars_per_train, carIndex)]; + x += carEntry.spacing / 17432; + y -= (carEntry.spacing / 2) / 17432; + + // Get colour of vehicle + int32_t vehicleColourIndex = 0; + switch (ride->colour_scheme_type & 3) + { + case VEHICLE_COLOUR_SCHEME_SAME: + vehicleColourIndex = 0; + break; + case VEHICLE_COLOUR_SCHEME_PER_TRAIN: + vehicleColourIndex = i; + break; + case VEHICLE_COLOUR_SCHEME_PER_VEHICLE: + vehicleColourIndex = carIndex; + break; + } + VehicleColour vehicleColour = RideGetVehicleColour(*ride, vehicleColourIndex); + + ImageIndex imageIndex = carEntry.SpriteByYaw( + OpenRCT2::Entity::Yaw::BaseRotation / 2, SpriteGroupType::SlopeFlat); + if (isReversed) + { + auto baseRotation = carEntry.NumRotationSprites(SpriteGroupType::SlopeFlat); + imageIndex = carEntry.SpriteByYaw( + (imageIndex + (baseRotation / 2)) & (baseRotation - 1), SpriteGroupType::SlopeFlat); + } + + imageIndex &= carEntry.TabRotationMask; + imageIndex *= carEntry.base_num_frames; + imageIndex += carEntry.base_image_id; + + auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary); + + nextSpriteToDraw->x = x; + nextSpriteToDraw->y = y; + nextSpriteToDraw->imageId = imageId; + nextSpriteToDraw++; + + x += carEntry.spacing / 17432; + y -= (carEntry.spacing / 2) / 17432; + } + + if (ride->type == RIDE_TYPE_REVERSER_ROLLER_COASTER) + { + VehicleDrawInfo tmp = *(nextSpriteToDraw - 1); + *(nextSpriteToDraw - 1) = *(nextSpriteToDraw - 2); + *(nextSpriteToDraw - 2) = tmp; + } + + VehicleDrawInfo* current = nextSpriteToDraw; + while (--current >= trainCarImages) + GfxDrawSprite(dpi, current->imageId, { current->x, current->y }); + + startX += 36; + } } - } #pragma endregion #pragma region Operating - void ModeTweakIncrease() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; - uint8_t maxValue = operatingSettings.MaxValue; - uint8_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; - - if (GetGameState().Cheats.UnlockOperatingLimits) + void ModeTweakIncrease() { - maxValue = OpenRCT2::Limits::CheatsMaxOperatingLimit; - } + auto ride = GetRide(rideId); + if (ride == nullptr) + return; - uint8_t increment = ride->mode == RideMode::Dodgems ? 10 : 1; + const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + uint8_t maxValue = operatingSettings.MaxValue; + uint8_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; - SetOperatingSetting( - rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); - } - - void ModeTweakDecrease() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; - uint8_t maxValue = operatingSettings.MaxValue; - uint8_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; - if (GetGameState().Cheats.UnlockOperatingLimits) - { - maxValue = OpenRCT2::Limits::CheatsMaxOperatingLimit; - } - - uint8_t decrement = ride->mode == RideMode::Dodgems ? 10 : 1; - - SetOperatingSetting( - rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); - } - - void ModeDropdown(Widget* widget) - { - Widget* dropdownWidget; - - dropdownWidget = widget - 1; - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto availableModes = ride->GetAvailableModes(); - - // Create dropdown list - auto numAvailableModes = 0; - auto checkedIndex = -1; - for (auto i = 0; i < static_cast(RideMode::Count); i++) - { - if (availableModes & (1uLL << i)) + if (GetGameState().Cheats.UnlockOperatingLimits) { - gDropdownItems[numAvailableModes].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numAvailableModes].Args = RideModeNames[i]; + maxValue = OpenRCT2::Limits::CheatsMaxOperatingLimit; + } - if (ride->mode == static_cast(i)) - checkedIndex = numAvailableModes; + uint8_t increment = ride->mode == RideMode::Dodgems ? 10 : 1; - numAvailableModes++; + SetOperatingSetting( + rideId, RideSetSetting::Operation, std::clamp(ride->operation_option + increment, minValue, maxValue)); + } + + void ModeTweakDecrease() + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + uint8_t maxValue = operatingSettings.MaxValue; + uint8_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; + if (GetGameState().Cheats.UnlockOperatingLimits) + { + maxValue = OpenRCT2::Limits::CheatsMaxOperatingLimit; + } + + uint8_t decrement = ride->mode == RideMode::Dodgems ? 10 : 1; + + SetOperatingSetting( + rideId, RideSetSetting::Operation, std::clamp(ride->operation_option - decrement, minValue, maxValue)); + } + + void ModeDropdown(Widget* widget) + { + Widget* dropdownWidget; + + dropdownWidget = widget - 1; + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto availableModes = ride->GetAvailableModes(); + + // Create dropdown list + auto numAvailableModes = 0; + auto checkedIndex = -1; + for (auto i = 0; i < static_cast(RideMode::Count); i++) + { + if (availableModes & (1uLL << i)) + { + gDropdownItems[numAvailableModes].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numAvailableModes].Args = RideModeNames[i]; + + if (ride->mode == static_cast(i)) + checkedIndex = numAvailableModes; + + numAvailableModes++; + } + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, numAvailableModes, widget->right - dropdownWidget->left); + + if (checkedIndex != -1) + { + Dropdown::SetChecked(checkedIndex, true); } } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, numAvailableModes, widget->right - dropdownWidget->left); - - if (checkedIndex != -1) + void LoadDropdown(Widget* widget) { - Dropdown::SetChecked(checkedIndex, true); - } - } - - void LoadDropdown(Widget* widget) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto dropdownWidget = widget - 1; - for (auto i = 0; i < 5; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = VehicleLoadNames[i]; - } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, 5, widget->right - dropdownWidget->left); - - Dropdown::SetChecked(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK, true); - } - - void OperatingOnMouseUp(WidgetIndex widgetIndex) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); + auto ride = GetRide(rideId); + if (ride == nullptr) return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_LOAD_CHECKBOX: - SetOperatingSetting(rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_LOAD); - break; - case WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX: - SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES); - break; - case WIDX_MINIMUM_LENGTH_CHECKBOX: - SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH); - break; - case WIDX_MAXIMUM_LENGTH_CHECKBOX: - SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH); - break; - case WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX: - SetOperatingSetting( - rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS); - break; - } - } - void OperatingResize() - { - WindowSetResize(*this, 316, 186, 316, 186); - } - - void OperatingOnMouseDown(WidgetIndex widgetIndex) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - uint8_t upperBound, lowerBound; - switch (widgetIndex) - { - case WIDX_MODE_TWEAK: - OperatingTweakTextInput(*ride); - break; - case WIDX_MODE_TWEAK_INCREASE: - ModeTweakIncrease(); - break; - case WIDX_MODE_TWEAK_DECREASE: - ModeTweakDecrease(); - break; - case WIDX_LIFT_HILL_SPEED_INCREASE: - upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : ride->GetRideTypeDescriptor().LiftData.maximum_speed; - lowerBound = GetGameState().Cheats.UnlockOperatingLimits ? 0 - : ride->GetRideTypeDescriptor().LiftData.minimum_speed; - SetOperatingSetting( - rideId, RideSetSetting::LiftHillSpeed, - std::clamp(ride->lift_hill_speed + 1, lowerBound, upperBound)); - break; - case WIDX_LIFT_HILL_SPEED_DECREASE: - upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : ride->GetRideTypeDescriptor().LiftData.maximum_speed; - lowerBound = GetGameState().Cheats.UnlockOperatingLimits ? 0 - : ride->GetRideTypeDescriptor().LiftData.minimum_speed; - SetOperatingSetting( - rideId, RideSetSetting::LiftHillSpeed, - std::clamp(ride->lift_hill_speed - 1, lowerBound, upperBound)); - break; - case WIDX_MINIMUM_LENGTH: - OperatingLengthWindow(WIDX_MINIMUM_LENGTH); - break; - case WIDX_MAXIMUM_LENGTH: - OperatingLengthWindow(WIDX_MAXIMUM_LENGTH); - break; - case WIDX_MINIMUM_LENGTH_INCREASE: - upperBound = OpenRCT2::Limits::MaxWaitingTime; - lowerBound = 0; - SetOperatingSetting( - rideId, RideSetSetting::MinWaitingTime, - std::clamp(ride->min_waiting_time + 1, lowerBound, upperBound)); - break; - case WIDX_MINIMUM_LENGTH_DECREASE: - upperBound = OpenRCT2::Limits::MaxWaitingTime; - lowerBound = 0; - SetOperatingSetting( - rideId, RideSetSetting::MinWaitingTime, - std::clamp(ride->min_waiting_time - 1, lowerBound, upperBound)); - break; - case WIDX_MAXIMUM_LENGTH_INCREASE: - upperBound = OpenRCT2::Limits::MaxWaitingTime; - lowerBound = 0; - SetOperatingSetting( - rideId, RideSetSetting::MaxWaitingTime, - std::clamp(ride->max_waiting_time + 1, lowerBound, upperBound)); - break; - case WIDX_MAXIMUM_LENGTH_DECREASE: - upperBound = OpenRCT2::Limits::MaxWaitingTime; - lowerBound = 0; - SetOperatingSetting( - rideId, RideSetSetting::MaxWaitingTime, - std::clamp(ride->max_waiting_time - 1, lowerBound, upperBound)); - break; - case WIDX_MODE_DROPDOWN: - ModeDropdown(&widgets[widgetIndex]); - break; - case WIDX_LOAD_DROPDOWN: - LoadDropdown(&widgets[widgetIndex]); - break; - case WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE: - upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : OpenRCT2::Limits::MaxCircuitsPerRide; - lowerBound = 1; - SetOperatingSetting( - rideId, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits + 1, lowerBound, upperBound)); - break; - case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE: - upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : OpenRCT2::Limits::MaxCircuitsPerRide; - lowerBound = 1; - SetOperatingSetting( - rideId, RideSetSetting::NumCircuits, std::clamp(ride->num_circuits - 1, lowerBound, upperBound)); - break; - } - } - - void OperatingLengthWindow(WidgetIndex widgetIndex) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - uint8_t upperBound = OpenRCT2::Limits::MaxWaitingTime; - uint8_t lowerBound = 0; - Formatter ft; - ft.Add(lowerBound); - ft.Add(upperBound); - auto title = (widgetIndex == WIDX_MINIMUM_LENGTH) ? STR_MINIMUM_WAITING_TIME : STR_MAXIMUM_WAITING_TIME; - auto currentValue = (widgetIndex == WIDX_MINIMUM_LENGTH) ? ride->min_waiting_time : ride->max_waiting_time; - char buffer[5]{}; - snprintf(buffer, std::size(buffer), "%u", currentValue); - WindowTextInputRawOpen(this, widgetIndex, title, STR_ENTER_VALUE, ft, buffer, 4); - } - - void OperatingTweakTextInput(const Ride& ride) - { - switch (ride.mode) - { - case RideMode::PoweredLaunchPasstrough: - case RideMode::PoweredLaunch: - case RideMode::UpwardLaunch: - case RideMode::PoweredLaunchBlockSectioned: - case RideMode::StationToStation: - case RideMode::Dodgems: - return; - default: - break; - } - - const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; - int16_t maxValue = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : operatingSettings.MaxValue; - int16_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; - - const auto& title = widgets[WIDX_MODE_TWEAK_LABEL].text; - Formatter ft; - ft.Add(minValue * operatingSettings.OperatingSettingMultiplier); - ft.Add(maxValue * operatingSettings.OperatingSettingMultiplier); - - uint16_t currentValue = static_cast(ride.operation_option) * operatingSettings.OperatingSettingMultiplier; - char buffer[6]{}; - snprintf(buffer, std::size(buffer), "%u", currentValue); - - WindowTextInputRawOpen(this, WIDX_MODE_TWEAK, title, STR_ENTER_VALUE, ft, buffer, 4); - } - - void OperatingOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (dropdownIndex == -1) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - switch (widgetIndex) - { - case WIDX_MODE_DROPDOWN: + auto dropdownWidget = widget - 1; + for (auto i = 0; i < 5; i++) { - RideMode rideMode = RideMode::NullMode; - auto availableModes = ride->GetAvailableModes(); - auto modeInDropdownIndex = -1; - for (RideMode rideModeIndex = RideMode::Normal; rideModeIndex < RideMode::Count; rideModeIndex++) + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = VehicleLoadNames[i]; + } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, 5, widget->right - dropdownWidget->left); + + Dropdown::SetChecked(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK, true); + } + + void OperatingOnMouseUp(WidgetIndex widgetIndex) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_LOAD_CHECKBOX: + SetOperatingSetting(rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_LOAD); + break; + case WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX: + SetOperatingSetting( + rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES); + break; + case WIDX_MINIMUM_LENGTH_CHECKBOX: + SetOperatingSetting( + rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH); + break; + case WIDX_MAXIMUM_LENGTH_CHECKBOX: + SetOperatingSetting( + rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH); + break; + case WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX: + SetOperatingSetting( + rideId, RideSetSetting::Departure, ride->depart_flags ^ RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS); + break; + } + } + + void OperatingResize() + { + WindowSetResize(*this, 316, 186, 316, 186); + } + + void OperatingOnMouseDown(WidgetIndex widgetIndex) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + uint8_t upperBound, lowerBound; + switch (widgetIndex) + { + case WIDX_MODE_TWEAK: + OperatingTweakTextInput(*ride); + break; + case WIDX_MODE_TWEAK_INCREASE: + ModeTweakIncrease(); + break; + case WIDX_MODE_TWEAK_DECREASE: + ModeTweakDecrease(); + break; + case WIDX_LIFT_HILL_SPEED_INCREASE: + upperBound = GetGameState().Cheats.UnlockOperatingLimits + ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : ride->GetRideTypeDescriptor().LiftData.maximum_speed; + lowerBound = GetGameState().Cheats.UnlockOperatingLimits + ? 0 + : ride->GetRideTypeDescriptor().LiftData.minimum_speed; + SetOperatingSetting( + rideId, RideSetSetting::LiftHillSpeed, + std::clamp(ride->lift_hill_speed + 1, lowerBound, upperBound)); + break; + case WIDX_LIFT_HILL_SPEED_DECREASE: + upperBound = GetGameState().Cheats.UnlockOperatingLimits + ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : ride->GetRideTypeDescriptor().LiftData.maximum_speed; + lowerBound = GetGameState().Cheats.UnlockOperatingLimits + ? 0 + : ride->GetRideTypeDescriptor().LiftData.minimum_speed; + SetOperatingSetting( + rideId, RideSetSetting::LiftHillSpeed, + std::clamp(ride->lift_hill_speed - 1, lowerBound, upperBound)); + break; + case WIDX_MINIMUM_LENGTH: + OperatingLengthWindow(WIDX_MINIMUM_LENGTH); + break; + case WIDX_MAXIMUM_LENGTH: + OperatingLengthWindow(WIDX_MAXIMUM_LENGTH); + break; + case WIDX_MINIMUM_LENGTH_INCREASE: + upperBound = OpenRCT2::Limits::MaxWaitingTime; + lowerBound = 0; + SetOperatingSetting( + rideId, RideSetSetting::MinWaitingTime, + std::clamp(ride->min_waiting_time + 1, lowerBound, upperBound)); + break; + case WIDX_MINIMUM_LENGTH_DECREASE: + upperBound = OpenRCT2::Limits::MaxWaitingTime; + lowerBound = 0; + SetOperatingSetting( + rideId, RideSetSetting::MinWaitingTime, + std::clamp(ride->min_waiting_time - 1, lowerBound, upperBound)); + break; + case WIDX_MAXIMUM_LENGTH_INCREASE: + upperBound = OpenRCT2::Limits::MaxWaitingTime; + lowerBound = 0; + SetOperatingSetting( + rideId, RideSetSetting::MaxWaitingTime, + std::clamp(ride->max_waiting_time + 1, lowerBound, upperBound)); + break; + case WIDX_MAXIMUM_LENGTH_DECREASE: + upperBound = OpenRCT2::Limits::MaxWaitingTime; + lowerBound = 0; + SetOperatingSetting( + rideId, RideSetSetting::MaxWaitingTime, + std::clamp(ride->max_waiting_time - 1, lowerBound, upperBound)); + break; + case WIDX_MODE_DROPDOWN: + ModeDropdown(&widgets[widgetIndex]); + break; + case WIDX_LOAD_DROPDOWN: + LoadDropdown(&widgets[widgetIndex]); + break; + case WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE: + upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : OpenRCT2::Limits::MaxCircuitsPerRide; + lowerBound = 1; + SetOperatingSetting( + rideId, RideSetSetting::NumCircuits, + std::clamp(ride->num_circuits + 1, lowerBound, upperBound)); + break; + case WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE: + upperBound = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : OpenRCT2::Limits::MaxCircuitsPerRide; + lowerBound = 1; + SetOperatingSetting( + rideId, RideSetSetting::NumCircuits, + std::clamp(ride->num_circuits - 1, lowerBound, upperBound)); + break; + } + } + + void OperatingLengthWindow(WidgetIndex widgetIndex) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + uint8_t upperBound = OpenRCT2::Limits::MaxWaitingTime; + uint8_t lowerBound = 0; + Formatter ft; + ft.Add(lowerBound); + ft.Add(upperBound); + auto title = (widgetIndex == WIDX_MINIMUM_LENGTH) ? STR_MINIMUM_WAITING_TIME : STR_MAXIMUM_WAITING_TIME; + auto currentValue = (widgetIndex == WIDX_MINIMUM_LENGTH) ? ride->min_waiting_time : ride->max_waiting_time; + char buffer[5]{}; + snprintf(buffer, std::size(buffer), "%u", currentValue); + WindowTextInputRawOpen(this, widgetIndex, title, STR_ENTER_VALUE, ft, buffer, 4); + } + + void OperatingTweakTextInput(const Ride& ride) + { + switch (ride.mode) + { + case RideMode::PoweredLaunchPasstrough: + case RideMode::PoweredLaunch: + case RideMode::UpwardLaunch: + case RideMode::PoweredLaunchBlockSectioned: + case RideMode::StationToStation: + case RideMode::Dodgems: + return; + default: + break; + } + + const auto& operatingSettings = ride.GetRideTypeDescriptor().OperatingSettings; + int16_t maxValue = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : operatingSettings.MaxValue; + int16_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; + + const auto& title = widgets[WIDX_MODE_TWEAK_LABEL].text; + Formatter ft; + ft.Add(minValue * operatingSettings.OperatingSettingMultiplier); + ft.Add(maxValue * operatingSettings.OperatingSettingMultiplier); + + uint16_t currentValue = static_cast(ride.operation_option) * operatingSettings.OperatingSettingMultiplier; + char buffer[6]{}; + snprintf(buffer, std::size(buffer), "%u", currentValue); + + WindowTextInputRawOpen(this, WIDX_MODE_TWEAK, title, STR_ENTER_VALUE, ft, buffer, 4); + } + + void OperatingOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + switch (widgetIndex) + { + case WIDX_MODE_DROPDOWN: { - if (availableModes & EnumToFlag(rideModeIndex)) + RideMode rideMode = RideMode::NullMode; + auto availableModes = ride->GetAvailableModes(); + auto modeInDropdownIndex = -1; + for (RideMode rideModeIndex = RideMode::Normal; rideModeIndex < RideMode::Count; rideModeIndex++) { - modeInDropdownIndex++; - if (modeInDropdownIndex == dropdownIndex) + if (availableModes & EnumToFlag(rideModeIndex)) { - rideMode = rideModeIndex; - break; + modeInDropdownIndex++; + if (modeInDropdownIndex == dropdownIndex) + { + rideMode = rideModeIndex; + break; + } } } + if (rideMode != RideMode::NullMode) + SetOperatingSetting(rideId, RideSetSetting::Mode, static_cast(rideMode)); + break; } - if (rideMode != RideMode::NullMode) - SetOperatingSetting(rideId, RideSetSetting::Mode, static_cast(rideMode)); - break; + case WIDX_LOAD_DROPDOWN: + SetOperatingSetting( + rideId, RideSetSetting::Departure, + (ride->depart_flags & ~RIDE_DEPART_WAIT_FOR_LOAD_MASK) | dropdownIndex); + break; } - case WIDX_LOAD_DROPDOWN: - SetOperatingSetting( - rideId, RideSetSetting::Departure, (ride->depart_flags & ~RIDE_DEPART_WAIT_FOR_LOAD_MASK) | dropdownIndex); - break; } - } - void OperatingUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_3); - - auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) + void OperatingUpdate() { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_OPERATING; - Invalidate(); + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_3); + + auto ride = GetRide(rideId); + if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_OPERATING) + { + ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_OPERATING; + Invalidate(); + } } - } - void OperatingOnTextInput(WidgetIndex widgetIndex, std::string_view text) - { - if (text.empty()) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - if (widgetIndex == WIDX_MODE_TWEAK) + void OperatingOnTextInput(WidgetIndex widgetIndex, std::string_view text) { - const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; - uint32_t maxValue = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit - : operatingSettings.MaxValue; - uint32_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; + if (text.empty()) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + if (widgetIndex == WIDX_MODE_TWEAK) + { + const auto& operatingSettings = ride->GetRideTypeDescriptor().OperatingSettings; + uint32_t maxValue = GetGameState().Cheats.UnlockOperatingLimits ? OpenRCT2::Limits::CheatsMaxOperatingLimit + : operatingSettings.MaxValue; + uint32_t minValue = GetGameState().Cheats.UnlockOperatingLimits ? 0 : operatingSettings.MinValue; + auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; + + try + { + uint32_t origSize = std::stol(std::string(text)) / multiplier; + uint8_t size = static_cast(std::clamp(origSize, minValue, maxValue)); + SetOperatingSetting(ride->id, RideSetSetting::Operation, size); + } + catch (const std::logic_error&) + { + // std::stol can throw std::out_of_range or std::invalid_argument + } + } + else if (widgetIndex == WIDX_MINIMUM_LENGTH || widgetIndex == WIDX_MAXIMUM_LENGTH) + { + try + { + auto rideSetSetting = widgetIndex == WIDX_MINIMUM_LENGTH ? RideSetSetting::MinWaitingTime + : RideSetSetting::MaxWaitingTime; + + uint16_t upperBound = OpenRCT2::Limits::MaxWaitingTime; + uint16_t lowerBound = 0; + uint16_t size = std::stol(std::string(text)); + size = std::clamp(size, lowerBound, upperBound); + SetOperatingSetting(ride->id, rideSetSetting, size); + } + catch (const std::logic_error&) + { + // std::stol can throw std::out_of_range or std::invalid_argument + } + } + } + + void OperatingOnPrepareDraw() + { + StringId format, caption, tooltip; + + auto* newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + // Widget setup + pressed_widgets &= ~( + (1uLL << WIDX_LOAD_CHECKBOX) | (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX) + | (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX) | (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX) + | (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX)); + + // Sometimes, only one of the alternatives support lift hill pieces. Make sure to check both. + bool hasAlternativeType = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE); + if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL) + || (hasAlternativeType + && GetRideTypeDescriptor(ride->GetRideTypeDescriptor().AlternateType).SupportsTrackPiece(TRACK_LIFT_HILL))) + { + widgets[WIDX_LIFT_HILL_SPEED_LABEL].type = WindowWidgetType::Label; + widgets[WIDX_LIFT_HILL_SPEED].type = WindowWidgetType::Spinner; + widgets[WIDX_LIFT_HILL_SPEED_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_LIFT_HILL_SPEED_DECREASE].type = WindowWidgetType::Button; + ft.Rewind(); + ft.Increment(20); + ft.Add(ride->lift_hill_speed); + } + else + { + widgets[WIDX_LIFT_HILL_SPEED_LABEL].type = WindowWidgetType::Empty; + widgets[WIDX_LIFT_HILL_SPEED].type = WindowWidgetType::Empty; + widgets[WIDX_LIFT_HILL_SPEED_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_LIFT_HILL_SPEED_DECREASE].type = WindowWidgetType::Empty; + } + + // Number of circuits + if (ride->CanHaveMultipleCircuits()) + { + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_LABEL].type = WindowWidgetType::Label; + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS].type = WindowWidgetType::Spinner; + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE].type = WindowWidgetType::Button; + ft.Rewind(); + ft.Increment(22); + ft.Add(ride->num_circuits); + } + else + { + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_LABEL].type = WindowWidgetType::Empty; + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS].type = WindowWidgetType::Empty; + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE].type = WindowWidgetType::Empty; + } + + // Leave if another vehicle arrives at station + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION) + && ride->NumTrains > 1 && !ride->IsBlockSectioned()) + { + widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Checkbox; + widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].tooltip = STR_LEAVE_IF_ANOTHER_VEHICLE_ARRIVES_TIP; + widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = ride->GetRideTypeDescriptor().NameConvention.vehicle + == RideComponentType::Boat + ? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES + : STR_LEAVE_IF_ANOTHER_TRAIN_ARRIVES; + } + else + { + widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Empty; + } + + // Synchronise with adjacent stations + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS)) + { + widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Checkbox; + widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].text = STR_SYNCHRONISE_WITH_ADJACENT_STATIONS; + widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].tooltip = STR_SYNCHRONISE_WITH_ADJACENT_STATIONS_TIP; + } + else + { + widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Empty; + } + + // Mode + widgets[WIDX_MODE].text = RideModeNames[EnumValue(ride->mode)]; + + // Waiting + widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)]; + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)) + { + widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Checkbox; + widgets[WIDX_LOAD].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_LOAD_DROPDOWN].type = WindowWidgetType::Button; + + widgets[WIDX_MINIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Checkbox; + widgets[WIDX_MINIMUM_LENGTH].type = WindowWidgetType::Spinner; + widgets[WIDX_MINIMUM_LENGTH_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_MINIMUM_LENGTH_DECREASE].type = WindowWidgetType::Button; + + widgets[WIDX_MAXIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Checkbox; + widgets[WIDX_MAXIMUM_LENGTH].type = WindowWidgetType::Spinner; + widgets[WIDX_MAXIMUM_LENGTH_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_MAXIMUM_LENGTH_DECREASE].type = WindowWidgetType::Button; + + ft.Rewind(); + ft.Increment(10); + ft.Add(STR_FORMAT_SECONDS); + ft.Add(ride->min_waiting_time); + ft.Add(STR_FORMAT_SECONDS); + ft.Add(ride->max_waiting_time); + + if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD) + pressed_widgets |= (1uLL << WIDX_LOAD_CHECKBOX); + } + else + { + widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Empty; + widgets[WIDX_LOAD].type = WindowWidgetType::Empty; + widgets[WIDX_LOAD_DROPDOWN].type = WindowWidgetType::Empty; + + widgets[WIDX_MINIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Empty; + widgets[WIDX_MINIMUM_LENGTH].type = WindowWidgetType::Empty; + widgets[WIDX_MINIMUM_LENGTH_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_MINIMUM_LENGTH_DECREASE].type = WindowWidgetType::Empty; + + widgets[WIDX_MAXIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Empty; + widgets[WIDX_MAXIMUM_LENGTH].type = WindowWidgetType::Empty; + widgets[WIDX_MAXIMUM_LENGTH_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_MAXIMUM_LENGTH_DECREASE].type = WindowWidgetType::Empty; + } + + if (ride->depart_flags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) + pressed_widgets |= (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); + if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) + pressed_widgets |= (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); + if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) + pressed_widgets |= (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX); + if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) + pressed_widgets |= (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX); + + // Mode specific functionality auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; - - try - { - uint32_t origSize = std::stol(std::string(text)) / multiplier; - uint8_t size = static_cast(std::clamp(origSize, minValue, maxValue)); - SetOperatingSetting(ride->id, RideSetSetting::Operation, size); - } - catch (const std::logic_error&) - { - // std::stol can throw std::out_of_range or std::invalid_argument - } - } - else if (widgetIndex == WIDX_MINIMUM_LENGTH || widgetIndex == WIDX_MAXIMUM_LENGTH) - { - try - { - auto rideSetSetting = widgetIndex == WIDX_MINIMUM_LENGTH ? RideSetSetting::MinWaitingTime - : RideSetSetting::MaxWaitingTime; - - uint16_t upperBound = OpenRCT2::Limits::MaxWaitingTime; - uint16_t lowerBound = 0; - uint16_t size = std::stol(std::string(text)); - size = std::clamp(size, lowerBound, upperBound); - SetOperatingSetting(ride->id, rideSetSetting, size); - } - catch (const std::logic_error&) - { - // std::stol can throw std::out_of_range or std::invalid_argument - } - } - } - - void OperatingOnPrepareDraw() - { - StringId format, caption, tooltip; - - auto* newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - // Widget setup - pressed_widgets &= ~( - (1uLL << WIDX_LOAD_CHECKBOX) | (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX) - | (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX) | (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX) - | (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX)); - - // Sometimes, only one of the alternatives support lift hill pieces. Make sure to check both. - bool hasAlternativeType = ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ALTERNATIVE_TRACK_TYPE); - if (ride->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_LIFT_HILL) - || (hasAlternativeType - && GetRideTypeDescriptor(ride->GetRideTypeDescriptor().AlternateType).SupportsTrackPiece(TRACK_LIFT_HILL))) - { - widgets[WIDX_LIFT_HILL_SPEED_LABEL].type = WindowWidgetType::Label; - widgets[WIDX_LIFT_HILL_SPEED].type = WindowWidgetType::Spinner; - widgets[WIDX_LIFT_HILL_SPEED_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_LIFT_HILL_SPEED_DECREASE].type = WindowWidgetType::Button; ft.Rewind(); - ft.Increment(20); - ft.Add(ride->lift_hill_speed); + ft.Increment(18); + ft.Add(static_cast(ride->operation_option) * multiplier); + switch (ride->mode) + { + case RideMode::PoweredLaunchPasstrough: + case RideMode::PoweredLaunch: + case RideMode::UpwardLaunch: + case RideMode::PoweredLaunchBlockSectioned: + ft.Rewind(); + ft.Increment(18); + ft.Add((ride->launch_speed * 9) / 4); + format = STR_RIDE_MODE_SPEED_VALUE; + caption = STR_LAUNCH_SPEED; + tooltip = STR_LAUNCH_SPEED_TIP; + break; + case RideMode::StationToStation: + ft.Rewind(); + ft.Increment(18); + ft.Add((ride->speed * 9) / 4); + format = STR_RIDE_MODE_SPEED_VALUE; + caption = STR_SPEED; + tooltip = STR_SPEED_TIP; + break; + case RideMode::Race: + ft.Rewind(); + ft.Increment(18); + ft.Add(ride->NumLaps); + format = STR_NUMBER_OF_LAPS_VALUE; + caption = STR_NUMBER_OF_LAPS; + tooltip = STR_NUMBER_OF_LAPS_TIP; + break; + case RideMode::Dodgems: + format = STR_RIDE_MODE_TIME_LIMIT_VALUE; + caption = STR_TIME_LIMIT; + tooltip = STR_TIME_LIMIT_TIP; + break; + case RideMode::Swing: + format = STR_RIDE_MODE_NUMBER_OF_SWINGS_VALUE; + caption = STR_NUMBER_OF_SWINGS; + tooltip = STR_NUMBER_OF_SWINGS_TIP; + break; + case RideMode::Rotation: + case RideMode::ForwardRotation: + case RideMode::BackwardRotation: + format = STR_NUMBER_OF_ROTATIONS_VALUE; + caption = STR_NUMBER_OF_ROTATIONS; + tooltip = STR_NUMBER_OF_ROTATIONS_TIP; + break; + default: + format = STR_MAX_PEOPLE_ON_RIDE_VALUE; + caption = STR_MAX_PEOPLE_ON_RIDE; + tooltip = STR_MAX_PEOPLE_ON_RIDE_TIP; + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) + format = 0; + break; + } + + if (format != 0) + { + widgets[WIDX_MODE_TWEAK_LABEL].type = WindowWidgetType::Label; + widgets[WIDX_MODE_TWEAK_LABEL].text = caption; + widgets[WIDX_MODE_TWEAK_LABEL].tooltip = tooltip; + widgets[WIDX_MODE_TWEAK].type = WindowWidgetType::Spinner; + widgets[WIDX_MODE_TWEAK].text = format; + widgets[WIDX_MODE_TWEAK_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_MODE_TWEAK_DECREASE].type = WindowWidgetType::Button; + pressed_widgets &= ~(1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); + } + else + { + widgets[WIDX_MODE_TWEAK_LABEL].type = WindowWidgetType::Empty; + widgets[WIDX_MODE_TWEAK].type = WindowWidgetType::Empty; + widgets[WIDX_MODE_TWEAK_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_MODE_TWEAK_DECREASE].type = WindowWidgetType::Empty; + } + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); } - else + + void OperatingOnDraw(DrawPixelInfo& dpi) { - widgets[WIDX_LIFT_HILL_SPEED_LABEL].type = WindowWidgetType::Empty; - widgets[WIDX_LIFT_HILL_SPEED].type = WindowWidgetType::Empty; - widgets[WIDX_LIFT_HILL_SPEED_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_LIFT_HILL_SPEED_DECREASE].type = WindowWidgetType::Empty; + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + // Horizontal rule between mode settings and depart settings + GfxFillRectInset( + dpi, + { windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, 103 }, + windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].right - 5, 104 } }, + colours[1], INSET_RECT_FLAG_BORDER_INSET); + + // Number of block sections + if (ride->IsBlockSectioned()) + { + auto ft = Formatter(); + ft.Add(ride->num_block_brakes + ride->num_stations); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 }, + STR_BLOCK_SECTIONS, ft, COLOUR_BLACK); + } } - // Number of circuits - if (ride->CanHaveMultipleCircuits()) - { - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_LABEL].type = WindowWidgetType::Label; - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS].type = WindowWidgetType::Spinner; - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE].type = WindowWidgetType::Button; - ft.Rewind(); - ft.Increment(22); - ft.Add(ride->num_circuits); - } - else - { - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_LABEL].type = WindowWidgetType::Empty; - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS].type = WindowWidgetType::Empty; - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_OPERATE_NUMBER_OF_CIRCUITS_DECREASE].type = WindowWidgetType::Empty; - } - - // Leave if another vehicle arrives at station - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION) - && ride->NumTrains > 1 && !ride->IsBlockSectioned()) - { - widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Checkbox; - widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].tooltip = STR_LEAVE_IF_ANOTHER_VEHICLE_ARRIVES_TIP; - widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].text = ride->GetRideTypeDescriptor().NameConvention.vehicle - == RideComponentType::Boat - ? STR_LEAVE_IF_ANOTHER_BOAT_ARRIVES - : STR_LEAVE_IF_ANOTHER_TRAIN_ARRIVES; - } - else - { - widgets[WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX].type = WindowWidgetType::Empty; - } - - // Synchronise with adjacent stations - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_CAN_SYNCHRONISE_ADJACENT_STATIONS)) - { - widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Checkbox; - widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].text = STR_SYNCHRONISE_WITH_ADJACENT_STATIONS; - widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].tooltip = STR_SYNCHRONISE_WITH_ADJACENT_STATIONS_TIP; - } - else - { - widgets[WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX].type = WindowWidgetType::Empty; - } - - // Mode - widgets[WIDX_MODE].text = RideModeNames[EnumValue(ride->mode)]; - - // Waiting - widgets[WIDX_LOAD].text = VehicleLoadNames[(ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD_MASK)]; - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_LOAD_OPTIONS)) - { - widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Checkbox; - widgets[WIDX_LOAD].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_LOAD_DROPDOWN].type = WindowWidgetType::Button; - - widgets[WIDX_MINIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Checkbox; - widgets[WIDX_MINIMUM_LENGTH].type = WindowWidgetType::Spinner; - widgets[WIDX_MINIMUM_LENGTH_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_MINIMUM_LENGTH_DECREASE].type = WindowWidgetType::Button; - - widgets[WIDX_MAXIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Checkbox; - widgets[WIDX_MAXIMUM_LENGTH].type = WindowWidgetType::Spinner; - widgets[WIDX_MAXIMUM_LENGTH_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_MAXIMUM_LENGTH_DECREASE].type = WindowWidgetType::Button; - - ft.Rewind(); - ft.Increment(10); - ft.Add(STR_FORMAT_SECONDS); - ft.Add(ride->min_waiting_time); - ft.Add(STR_FORMAT_SECONDS); - ft.Add(ride->max_waiting_time); - - if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_LOAD) - pressed_widgets |= (1uLL << WIDX_LOAD_CHECKBOX); - } - else - { - widgets[WIDX_LOAD_CHECKBOX].type = WindowWidgetType::Empty; - widgets[WIDX_LOAD].type = WindowWidgetType::Empty; - widgets[WIDX_LOAD_DROPDOWN].type = WindowWidgetType::Empty; - - widgets[WIDX_MINIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Empty; - widgets[WIDX_MINIMUM_LENGTH].type = WindowWidgetType::Empty; - widgets[WIDX_MINIMUM_LENGTH_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_MINIMUM_LENGTH_DECREASE].type = WindowWidgetType::Empty; - - widgets[WIDX_MAXIMUM_LENGTH_CHECKBOX].type = WindowWidgetType::Empty; - widgets[WIDX_MAXIMUM_LENGTH].type = WindowWidgetType::Empty; - widgets[WIDX_MAXIMUM_LENGTH_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_MAXIMUM_LENGTH_DECREASE].type = WindowWidgetType::Empty; - } - - if (ride->depart_flags & RIDE_DEPART_LEAVE_WHEN_ANOTHER_ARRIVES) - pressed_widgets |= (1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); - if (ride->depart_flags & RIDE_DEPART_SYNCHRONISE_WITH_ADJACENT_STATIONS) - pressed_widgets |= (1uLL << WIDX_SYNCHRONISE_WITH_ADJACENT_STATIONS_CHECKBOX); - if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) - pressed_widgets |= (1uLL << WIDX_MINIMUM_LENGTH_CHECKBOX); - if (ride->depart_flags & RIDE_DEPART_WAIT_FOR_MAXIMUM_LENGTH) - pressed_widgets |= (1uLL << WIDX_MAXIMUM_LENGTH_CHECKBOX); - - // Mode specific functionality - auto multiplier = ride->GetRideTypeDescriptor().OperatingSettings.OperatingSettingMultiplier; - ft.Rewind(); - ft.Increment(18); - ft.Add(static_cast(ride->operation_option) * multiplier); - switch (ride->mode) - { - case RideMode::PoweredLaunchPasstrough: - case RideMode::PoweredLaunch: - case RideMode::UpwardLaunch: - case RideMode::PoweredLaunchBlockSectioned: - ft.Rewind(); - ft.Increment(18); - ft.Add((ride->launch_speed * 9) / 4); - format = STR_RIDE_MODE_SPEED_VALUE; - caption = STR_LAUNCH_SPEED; - tooltip = STR_LAUNCH_SPEED_TIP; - break; - case RideMode::StationToStation: - ft.Rewind(); - ft.Increment(18); - ft.Add((ride->speed * 9) / 4); - format = STR_RIDE_MODE_SPEED_VALUE; - caption = STR_SPEED; - tooltip = STR_SPEED_TIP; - break; - case RideMode::Race: - ft.Rewind(); - ft.Increment(18); - ft.Add(ride->NumLaps); - format = STR_NUMBER_OF_LAPS_VALUE; - caption = STR_NUMBER_OF_LAPS; - tooltip = STR_NUMBER_OF_LAPS_TIP; - break; - case RideMode::Dodgems: - format = STR_RIDE_MODE_TIME_LIMIT_VALUE; - caption = STR_TIME_LIMIT; - tooltip = STR_TIME_LIMIT_TIP; - break; - case RideMode::Swing: - format = STR_RIDE_MODE_NUMBER_OF_SWINGS_VALUE; - caption = STR_NUMBER_OF_SWINGS; - tooltip = STR_NUMBER_OF_SWINGS_TIP; - break; - case RideMode::Rotation: - case RideMode::ForwardRotation: - case RideMode::BackwardRotation: - format = STR_NUMBER_OF_ROTATIONS_VALUE; - caption = STR_NUMBER_OF_ROTATIONS; - tooltip = STR_NUMBER_OF_ROTATIONS_TIP; - break; - default: - format = STR_MAX_PEOPLE_ON_RIDE_VALUE; - caption = STR_MAX_PEOPLE_ON_RIDE; - tooltip = STR_MAX_PEOPLE_ON_RIDE_TIP; - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) - format = 0; - break; - } - - if (format != 0) - { - widgets[WIDX_MODE_TWEAK_LABEL].type = WindowWidgetType::Label; - widgets[WIDX_MODE_TWEAK_LABEL].text = caption; - widgets[WIDX_MODE_TWEAK_LABEL].tooltip = tooltip; - widgets[WIDX_MODE_TWEAK].type = WindowWidgetType::Spinner; - widgets[WIDX_MODE_TWEAK].text = format; - widgets[WIDX_MODE_TWEAK_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_MODE_TWEAK_DECREASE].type = WindowWidgetType::Button; - pressed_widgets &= ~(1uLL << WIDX_LEAVE_WHEN_ANOTHER_ARRIVES_CHECKBOX); - } - else - { - widgets[WIDX_MODE_TWEAK_LABEL].type = WindowWidgetType::Empty; - widgets[WIDX_MODE_TWEAK].type = WindowWidgetType::Empty; - widgets[WIDX_MODE_TWEAK_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_MODE_TWEAK_DECREASE].type = WindowWidgetType::Empty; - } - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } - - void OperatingOnDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - // Horizontal rule between mode settings and depart settings - GfxFillRectInset( - dpi, - { windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, 103 }, - windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].right - 5, 104 } }, - colours[1], INSET_RECT_FLAG_BORDER_INSET); - - // Number of block sections - if (ride->IsBlockSectioned()) - { - auto ft = Formatter(); - ft.Add(ride->num_block_brakes + ride->num_stations); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 21, ride->mode == RideMode::PoweredLaunchBlockSectioned ? 89 : 61 }, - STR_BLOCK_SECTIONS, ft, COLOUR_BLACK); - } - } - #pragma endregion #pragma region Maintenance - void LocateMechanic() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - // First check if there is a mechanic assigned - Peep* mechanic = RideGetAssignedMechanic(*ride); - - // Otherwise find the closest mechanic - if (mechanic == nullptr) - mechanic = RideFindClosestMechanic(*ride, 1); - - if (mechanic == nullptr) - ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, STR_NONE, {}); - else + void LocateMechanic() { - auto intent = Intent(WindowClass::Peep); - intent.PutExtra(INTENT_EXTRA_PEEP, mechanic); - ContextOpenIntent(&intent); - } - } - - void MaintenanceDrawBar(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour) const - { - GfxFillRectInset(dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, colours[1], INSET_RECT_F_30); - if (colour & kBarBlink) - { - colour &= ~kBarBlink; - if (GameIsNotPaused() && (gCurrentRealTimeTicks & 8)) + auto ride = GetRide(rideId); + if (ride == nullptr) return; + + // First check if there is a mechanic assigned + Peep* mechanic = RideGetAssignedMechanic(*ride); + + // Otherwise find the closest mechanic + if (mechanic == nullptr) + mechanic = RideFindClosestMechanic(*ride, 1); + + if (mechanic == nullptr) + ContextShowError(STR_UNABLE_TO_LOCATE_MECHANIC, STR_NONE, {}); + else + { + auto intent = Intent(WindowClass::Peep); + intent.PutExtra(INTENT_EXTRA_PEEP, mechanic); + ContextOpenIntent(&intent); + } } - value = ((186 * ((value * 2) & 0xFF)) >> 8) & 0xFF; - if (value > 2) + void MaintenanceDrawBar(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, int32_t value, int32_t colour) const { - GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 1 }, coords + ScreenCoordsXY{ value + 1, 7 } }, colour, 0); + GfxFillRectInset(dpi, { coords, coords + ScreenCoordsXY{ 149, 8 } }, colours[1], INSET_RECT_F_30); + if (colour & kBarBlink) + { + colour &= ~kBarBlink; + if (GameIsNotPaused() && (gCurrentRealTimeTicks & 8)) + return; + } + + value = ((186 * ((value * 2) & 0xFF)) >> 8) & 0xFF; + if (value > 2) + { + GfxFillRectInset(dpi, { coords + ScreenCoordsXY{ 2, 1 }, coords + ScreenCoordsXY{ value + 1, 7 } }, colour, 0); + } } - } - void MaintenanceOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void MaintenanceOnMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_LOCATE_MECHANIC: - LocateMechanic(); - break; - case WIDX_REFURBISH_RIDE: - ContextOpenDetailWindow(WD_REFURBISH_RIDE, number); - break; - } - } - - void MaintenanceResize() - { - WindowSetResize(*this, 316, 135, 316, 135); - } - - void MaintenanceOnMouseDown(WidgetIndex widgetIndex) - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - Widget* dropdownWidget = &widgets[widgetIndex]; - int32_t j, numItems; - - switch (widgetIndex) - { - case WIDX_INSPECTION_INTERVAL_DROPDOWN: - dropdownWidget--; - for (int32_t i = 0; i < 7; i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = RideInspectionIntervalNames[i]; - } - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, 7, widgets[widgetIndex].right - dropdownWidget->left); - - Dropdown::SetChecked(ride->inspection_interval, true); - break; - - case WIDX_FORCE_BREAKDOWN: - numItems = 1; - for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) - { - if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) - break; - } - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_DEBUG_FIX_RIDE; - for (int32_t i = 0; i < 8; i++) - { - assert(j < static_cast(std::size(rideEntry->ride_type))); - if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast(1 << i)) - { - if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) - { - if (ride->NumTrains != 1) - continue; - } - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numItems].Args = RideBreakdownReasonNames[i]; - numItems++; - } - } - if (numItems == 1) - { - ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, STR_NONE, {}); - } - else - { - WindowDropdownShowText( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], Dropdown::Flag::StayOpen, numItems); - - numItems = 1; - int32_t breakdownReason = ride->breakdown_reason_pending; - if (breakdownReason != BREAKDOWN_NONE && (ride->lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING)) - { - for (int32_t i = 0; i < 8; i++) - { - if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns - & static_cast(1 << i)) - { - if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) - { - if (ride->NumTrains != 1) - continue; - } - if (i == breakdownReason) - { - Dropdown::SetChecked(numItems, true); - break; - } - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numItems].Args = RideBreakdownReasonNames[i]; - numItems++; - } - } - } - - if ((ride->lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING) == 0) - { - Dropdown::SetDisabled(0, true); - } - } - break; - } - } - - void MaintenanceOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (dropdownIndex == -1) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - switch (widgetIndex) - { - case WIDX_INSPECTION_INTERVAL_DROPDOWN: - SetOperatingSetting(rideId, RideSetSetting::InspectionInterval, dropdownIndex); - break; - - case WIDX_FORCE_BREAKDOWN: - if (dropdownIndex == 0) - { - Vehicle* vehicle; - switch (ride->breakdown_reason_pending) - { - case BREAKDOWN_SAFETY_CUT_OUT: - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) - break; - for (int32_t i = 0; i < ride->NumTrains; ++i) - { - for (vehicle = GetEntity(ride->vehicles[i]); vehicle != nullptr; - vehicle = GetEntity(vehicle->next_vehicle_on_train)) - { - vehicle->ClearFlag( - VehicleFlags::CarIsBroken | VehicleFlags::StoppedOnLift | VehicleFlags::TrainIsBroken); - } - } - break; - case BREAKDOWN_RESTRAINTS_STUCK_CLOSED: - case BREAKDOWN_RESTRAINTS_STUCK_OPEN: - case BREAKDOWN_DOORS_STUCK_CLOSED: - case BREAKDOWN_DOORS_STUCK_OPEN: - vehicle = GetEntity(ride->vehicles[ride->broken_vehicle]); - if (vehicle != nullptr) - { - vehicle->ClearFlag(VehicleFlags::CarIsBroken); - } - break; - case BREAKDOWN_VEHICLE_MALFUNCTION: - vehicle = GetEntity(ride->vehicles[ride->broken_vehicle]); - if (vehicle != nullptr) - { - vehicle->ClearFlag(VehicleFlags::TrainIsBroken); - } - break; - } - ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); - WindowInvalidateByNumber(WindowClass::Ride, number); + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); break; - } - if (ride->lifecycle_flags - & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) - { - ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_ALREADY_BROKEN, {}); - } - else if (ride->status == RideStatus::Closed) - { - ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_IS_CLOSED, {}); - } - else - { - int32_t j; + case WIDX_LOCATE_MECHANIC: + LocateMechanic(); + break; + case WIDX_REFURBISH_RIDE: + ContextOpenDetailWindow(WD_REFURBISH_RIDE, number); + break; + } + } + + void MaintenanceResize() + { + WindowSetResize(*this, 316, 135, 316, 135); + } + + void MaintenanceOnMouseDown(WidgetIndex widgetIndex) + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + Widget* dropdownWidget = &widgets[widgetIndex]; + int32_t j, numItems; + + switch (widgetIndex) + { + case WIDX_INSPECTION_INTERVAL_DROPDOWN: + dropdownWidget--; + for (int32_t i = 0; i < 7; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = RideInspectionIntervalNames[i]; + } + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, 7, widgets[widgetIndex].right - dropdownWidget->left); + + Dropdown::SetChecked(ride->inspection_interval, true); + break; + + case WIDX_FORCE_BREAKDOWN: + numItems = 1; for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) { if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) break; } - int32_t i; - int32_t numItems = 1; - for (i = 0; i < BREAKDOWN_COUNT; i++) + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_DEBUG_FIX_RIDE; + for (int32_t i = 0; i < 8; i++) { assert(j < static_cast(std::size(rideEntry->ride_type))); if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns & static_cast(1 << i)) @@ -3865,1441 +3737,2807 @@ private: if (ride->NumTrains != 1) continue; } - if (numItems == dropdownIndex) - break; + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numItems].Args = RideBreakdownReasonNames[i]; numItems++; } } - RidePrepareBreakdown(*ride, i); - } - break; - } - } - - void MaintenanceUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_4); - - auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) - { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; - Invalidate(); - } - } - - void MaintenanceOnPrepareDraw() - { - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - widgets[WIDX_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[ride->inspection_interval]; - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - - if (gConfigGeneral.DebuggingTools && NetworkGetMode() == NETWORK_MODE_NONE) - { - widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::FlatBtn; - } - else - { - widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::Empty; - } - - if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0 - || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) - { - disabled_widgets |= (1uLL << WIDX_REFURBISH_RIDE); - widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED; - } - else - { - disabled_widgets &= ~(1uLL << WIDX_REFURBISH_RIDE); - widgets[WIDX_REFURBISH_RIDE].tooltip = STR_REFURBISH_RIDE_TIP; - } - } - - void MaintenanceOnDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - // Locate mechanic button image - Widget* widget = &widgets[WIDX_LOCATE_MECHANIC]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; - auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, GetGameState().StaffMechanicColour); - GfxDrawSprite(dpi, image, screenCoords); - - // Inspection label - widget = &widgets[WIDX_INSPECTION_INTERVAL]; - screenCoords = windowPos + ScreenCoordsXY{ 4, widget->top + 1 }; - DrawTextBasic(dpi, screenCoords, STR_INSPECTION); - - // Reliability - widget = &widgets[WIDX_PAGE_BACKGROUND]; - screenCoords = windowPos + ScreenCoordsXY{ widget->left + 4, widget->top + 4 }; - - uint16_t reliability = ride->reliability_percentage; - auto ft = Formatter(); - ft.Add(reliability); - DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft); - MaintenanceDrawBar( - dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max(10, reliability), COLOUR_BRIGHT_GREEN); - screenCoords.y += 11; - - uint16_t downTime = ride->downtime; - ft = Formatter(); - ft.Add(downTime); - DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft); - MaintenanceDrawBar(dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED); - screenCoords.y += 26; - - // Last inspection - StringId stringId; - if (ride->last_inspection <= 1) - stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE; - else if (ride->last_inspection <= 240) - stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTES; - else - stringId = STR_TIME_SINCE_LAST_INSPECTION_MORE_THAN_4_HOURS; - - ft = Formatter(); - ft.Add(ride->last_inspection); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += 12; - - // Last / current breakdown - if (ride->breakdown_reason == BREAKDOWN_NONE) - return; - - stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; - ft = Formatter(); - ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += 12; - - // Mechanic status - if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) - { - switch (ride->mechanic_status) - { - case RIDE_MECHANIC_STATUS_CALLING: - { - stringId = STR_NO_MECHANICS_ARE_HIRED_MESSAGE; - - for (auto peep : EntityList()) + if (numItems == 1) { - if (peep->IsMechanic()) + ContextShowError(STR_DEBUG_NO_BREAKDOWNS_AVAILABLE, STR_NONE, {}); + } + else + { + WindowDropdownShowText( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, + dropdownWidget->height() + 1, colours[1], Dropdown::Flag::StayOpen, numItems); + + numItems = 1; + int32_t breakdownReason = ride->breakdown_reason_pending; + if (breakdownReason != BREAKDOWN_NONE && (ride->lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING)) { - stringId = STR_CALLING_MECHANIC; - break; + for (int32_t i = 0; i < 8; i++) + { + if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns + & static_cast(1 << i)) + { + if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) + { + if (ride->NumTrains != 1) + continue; + } + if (i == breakdownReason) + { + Dropdown::SetChecked(numItems, true); + break; + } + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numItems].Args = RideBreakdownReasonNames[i]; + numItems++; + } + } + } + + if ((ride->lifecycle_flags & RIDE_LIFECYCLE_BREAKDOWN_PENDING) == 0) + { + Dropdown::SetDisabled(0, true); } } break; - } - case RIDE_MECHANIC_STATUS_HEADING: - stringId = STR_MEHCANIC_IS_HEADING_FOR_THE_RIDE; + } + } + + void MaintenanceOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + switch (widgetIndex) + { + case WIDX_INSPECTION_INTERVAL_DROPDOWN: + SetOperatingSetting(rideId, RideSetSetting::InspectionInterval, dropdownIndex); break; - case RIDE_MECHANIC_STATUS_FIXING: - case RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES: - stringId = STR_MEHCANIC_IS_FIXING_THE_RIDE; - break; - default: - stringId = STR_EMPTY; + + case WIDX_FORCE_BREAKDOWN: + if (dropdownIndex == 0) + { + Vehicle* vehicle; + switch (ride->breakdown_reason_pending) + { + case BREAKDOWN_SAFETY_CUT_OUT: + if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK)) + break; + for (int32_t i = 0; i < ride->NumTrains; ++i) + { + for (vehicle = GetEntity(ride->vehicles[i]); vehicle != nullptr; + vehicle = GetEntity(vehicle->next_vehicle_on_train)) + { + vehicle->ClearFlag( + VehicleFlags::CarIsBroken | VehicleFlags::StoppedOnLift + | VehicleFlags::TrainIsBroken); + } + } + break; + case BREAKDOWN_RESTRAINTS_STUCK_CLOSED: + case BREAKDOWN_RESTRAINTS_STUCK_OPEN: + case BREAKDOWN_DOORS_STUCK_CLOSED: + case BREAKDOWN_DOORS_STUCK_OPEN: + vehicle = GetEntity(ride->vehicles[ride->broken_vehicle]); + if (vehicle != nullptr) + { + vehicle->ClearFlag(VehicleFlags::CarIsBroken); + } + break; + case BREAKDOWN_VEHICLE_MALFUNCTION: + vehicle = GetEntity(ride->vehicles[ride->broken_vehicle]); + if (vehicle != nullptr) + { + vehicle->ClearFlag(VehicleFlags::TrainIsBroken); + } + break; + } + ride->lifecycle_flags &= ~(RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN); + WindowInvalidateByNumber(WindowClass::Ride, number); + break; + } + if (ride->lifecycle_flags + & (RIDE_LIFECYCLE_BREAKDOWN_PENDING | RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) + { + ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_ALREADY_BROKEN, {}); + } + else if (ride->status == RideStatus::Closed) + { + ContextShowError(STR_DEBUG_CANT_FORCE_BREAKDOWN, STR_DEBUG_RIDE_IS_CLOSED, {}); + } + else + { + int32_t j; + for (j = 0; j < RCT2::ObjectLimits::MaxRideTypesPerRideEntry; j++) + { + if (rideEntry->ride_type[j] != RIDE_TYPE_NULL) + break; + } + int32_t i; + int32_t numItems = 1; + for (i = 0; i < BREAKDOWN_COUNT; i++) + { + assert(j < static_cast(std::size(rideEntry->ride_type))); + if (GetRideTypeDescriptor(rideEntry->ride_type[j]).AvailableBreakdowns + & static_cast(1 << i)) + { + if (i == BREAKDOWN_BRAKES_FAILURE && ride->IsBlockSectioned()) + { + if (ride->NumTrains != 1) + continue; + } + if (numItems == dropdownIndex) + break; + numItems++; + } + } + RidePrepareBreakdown(*ride, i); + } break; } + } - if (stringId != STR_EMPTY) + void MaintenanceUpdate() + { + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_4); + + auto ride = GetRide(rideId); + if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_MAINTENANCE) { - if (stringId == STR_CALLING_MECHANIC || stringId == STR_NO_MECHANICS_ARE_HIRED_MESSAGE) + ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_MAINTENANCE; + Invalidate(); + } + } + + void MaintenanceOnPrepareDraw() + { + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + widgets[WIDX_INSPECTION_INTERVAL].text = RideInspectionIntervalNames[ride->inspection_interval]; + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + + if (gConfigGeneral.DebuggingTools && NetworkGetMode() == NETWORK_MODE_NONE) + { + widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::FlatBtn; + } + else + { + widgets[WIDX_FORCE_BREAKDOWN].type = WindowWidgetType::Empty; + } + + if (ride->GetRideTypeDescriptor().AvailableBreakdowns == 0 + || !(ride->lifecycle_flags & RIDE_LIFECYCLE_EVER_BEEN_OPENED)) + { + disabled_widgets |= (1uLL << WIDX_REFURBISH_RIDE); + widgets[WIDX_REFURBISH_RIDE].tooltip = STR_CANT_REFURBISH_NOT_NEEDED; + } + else + { + disabled_widgets &= ~(1uLL << WIDX_REFURBISH_RIDE); + widgets[WIDX_REFURBISH_RIDE].tooltip = STR_REFURBISH_RIDE_TIP; + } + } + + void MaintenanceOnDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + // Locate mechanic button image + Widget* widget = &widgets[WIDX_LOCATE_MECHANIC]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; + auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, GetGameState().StaffMechanicColour); + GfxDrawSprite(dpi, image, screenCoords); + + // Inspection label + widget = &widgets[WIDX_INSPECTION_INTERVAL]; + screenCoords = windowPos + ScreenCoordsXY{ 4, widget->top + 1 }; + DrawTextBasic(dpi, screenCoords, STR_INSPECTION); + + // Reliability + widget = &widgets[WIDX_PAGE_BACKGROUND]; + screenCoords = windowPos + ScreenCoordsXY{ widget->left + 4, widget->top + 4 }; + + uint16_t reliability = ride->reliability_percentage; + auto ft = Formatter(); + ft.Add(reliability); + DrawTextBasic(dpi, screenCoords, STR_RELIABILITY_LABEL_1757, ft); + MaintenanceDrawBar( + dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, std::max(10, reliability), COLOUR_BRIGHT_GREEN); + screenCoords.y += 11; + + uint16_t downTime = ride->downtime; + ft = Formatter(); + ft.Add(downTime); + DrawTextBasic(dpi, screenCoords, STR_DOWN_TIME_LABEL_1889, ft); + MaintenanceDrawBar(dpi, screenCoords + ScreenCoordsXY{ 103, 0 }, downTime, COLOUR_BRIGHT_RED); + screenCoords.y += 26; + + // Last inspection + StringId stringId; + if (ride->last_inspection <= 1) + stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTE; + else if (ride->last_inspection <= 240) + stringId = STR_TIME_SINCE_LAST_INSPECTION_MINUTES; + else + stringId = STR_TIME_SINCE_LAST_INSPECTION_MORE_THAN_4_HOURS; + + ft = Formatter(); + ft.Add(ride->last_inspection); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += 12; + + // Last / current breakdown + if (ride->breakdown_reason == BREAKDOWN_NONE) + return; + + stringId = (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) ? STR_CURRENT_BREAKDOWN : STR_LAST_BREAKDOWN; + ft = Formatter(); + ft.Add(RideBreakdownReasonNames[ride->breakdown_reason]); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += 12; + + // Mechanic status + if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + { + switch (ride->mechanic_status) { - DrawTextWrapped(dpi, screenCoords, 280, stringId, {}, { TextAlignment::LEFT }); - } - else - { - auto staff = GetEntity(ride->mechanic); - if (staff != nullptr && staff->IsMechanic()) + case RIDE_MECHANIC_STATUS_CALLING: { - ft = Formatter(); - staff->FormatNameTo(ft); - DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT }); + stringId = STR_NO_MECHANICS_ARE_HIRED_MESSAGE; + + for (auto peep : EntityList()) + { + if (peep->IsMechanic()) + { + stringId = STR_CALLING_MECHANIC; + break; + } + } + break; + } + case RIDE_MECHANIC_STATUS_HEADING: + stringId = STR_MEHCANIC_IS_HEADING_FOR_THE_RIDE; + break; + case RIDE_MECHANIC_STATUS_FIXING: + case RIDE_MECHANIC_STATUS_HAS_FIXED_STATION_BRAKES: + stringId = STR_MEHCANIC_IS_FIXING_THE_RIDE; + break; + default: + stringId = STR_EMPTY; + break; + } + + if (stringId != STR_EMPTY) + { + if (stringId == STR_CALLING_MECHANIC || stringId == STR_NO_MECHANICS_ARE_HIRED_MESSAGE) + { + DrawTextWrapped(dpi, screenCoords, 280, stringId, {}, { TextAlignment::LEFT }); + } + else + { + auto staff = GetEntity(ride->mechanic); + if (staff != nullptr && staff->IsMechanic()) + { + ft = Formatter(); + staff->FormatNameTo(ft); + DrawTextWrapped(dpi, screenCoords, 280, stringId, ft, { TextAlignment::LEFT }); + } } } } } - } #pragma endregion #pragma region Colour - int32_t HasTrackColour(const Ride& ride, int32_t trackColour) - { - // Get station flags (shops don't have them) - auto stationObjFlags = 0; - if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) + int32_t HasTrackColour(const Ride& ride, int32_t trackColour) { - auto stationObj = ride.GetStationObject(); - if (stationObj != nullptr) + // Get station flags (shops don't have them) + auto stationObjFlags = 0; + if (!ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) { - stationObjFlags = stationObj->Flags; + auto stationObj = ride.GetStationObject(); + if (stationObj != nullptr) + { + stationObjFlags = stationObj->Flags; + } + } + + switch (trackColour) + { + case 0: + return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR) + || ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN); + case 1: + return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR) + || ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL); + case 2: + return ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS); + default: + return 0; } } - switch (trackColour) + void SetTrackColourScheme(const ScreenCoordsXY& screenPos) { - case 0: - return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_PRIMARY_COLOUR) - || ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN); - case 1: - return (stationObjFlags & STATION_OBJECT_FLAGS::HAS_SECONDARY_COLOUR) - || ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL); - case 2: - return ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS); - default: - return 0; - } - } + auto newColourScheme = static_cast(_rideColour); + auto info = GetMapCoordinatesFromPos(screenPos, EnumsToFlags(ViewportInteractionItem::Ride)); - void SetTrackColourScheme(const ScreenCoordsXY& screenPos) - { - auto newColourScheme = static_cast(_rideColour); - auto info = GetMapCoordinatesFromPos(screenPos, EnumsToFlags(ViewportInteractionItem::Ride)); - - if (info.SpriteType != ViewportInteractionItem::Ride) - return; - if (info.Element->GetType() != TileElementType::Track) - return; - if (info.Element->AsTrack()->GetRideIndex() != rideId) - return; - if (info.Element->AsTrack()->GetColourScheme() == newColourScheme) - return; - - auto z = info.Element->GetBaseZ(); - auto direction = info.Element->GetDirection(); - auto gameAction = RideSetColourSchemeAction( - CoordsXYZD{ info.Loc, z, static_cast(direction) }, info.Element->AsTrack()->GetTrackType(), - newColourScheme); - GameActions::Execute(&gameAction); - } - - void ColourClose() - { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return; - - if (gCurrentToolWidget.window_classification != classification) - return; - - if (gCurrentToolWidget.window_number != number) - return; - - ToolCancel(); - } - - void ColourOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); + if (info.SpriteType != ViewportInteractionItem::Ride) return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_PAINT_INDIVIDUAL_AREA: - ToolSet(*this, WIDX_PAINT_INDIVIDUAL_AREA, Tool::PaintDown); - break; - case WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX: - auto ride = GetRide(rideId); - if (ride != nullptr) + if (info.Element->GetType() != TileElementType::Track) + return; + if (info.Element->AsTrack()->GetRideIndex() != rideId) + return; + if (info.Element->AsTrack()->GetColourScheme() == newColourScheme) + return; + + auto z = info.Element->GetBaseZ(); + auto direction = info.Element->GetDirection(); + auto gameAction = RideSetColourSchemeAction( + CoordsXYZD{ info.Loc, z, static_cast(direction) }, info.Element->AsTrack()->GetTrackType(), + newColourScheme); + GameActions::Execute(&gameAction); + } + + void ColourClose() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return; + + if (gCurrentToolWidget.window_classification != classification) + return; + + if (gCurrentToolWidget.window_number != number) + return; + + ToolCancel(); + } + + void ColourOnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_PAINT_INDIVIDUAL_AREA: + ToolSet(*this, WIDX_PAINT_INDIVIDUAL_AREA, Tool::PaintDown); + break; + case WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX: + auto ride = GetRide(rideId); + if (ride != nullptr) + { + const bool currentlyEnabled = ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::SellingItemColourIsRandom, currentlyEnabled ? 0 : 1, 0); + GameActions::Execute(&rideSetAppearanceAction); + } + break; + } + } + + void ColourResize() + { + WindowSetResize(*this, 316, 207, 316, 207); + } + + void ColourOnMouseDown(WidgetIndex widgetIndex) + { + VehicleColour vehicleColour; + int32_t i, numItems; + StringId stringId; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + auto colourSchemeIndex = _rideColour; + auto dropdownWidget = &widgets[widgetIndex] - 1; + + switch (widgetIndex) + { + case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: + for (i = 0; i < OpenRCT2::Limits::NumColourSchemes; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = ColourSchemeNames[i]; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, 4, widgets[widgetIndex].right - dropdownWidget->left); + + Dropdown::SetChecked(colourSchemeIndex, true); + break; + case WIDX_TRACK_MAIN_COLOUR: + WindowDropdownShowColour( + this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].main); + break; + case WIDX_TRACK_ADDITIONAL_COLOUR: + WindowDropdownShowColour( + this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].additional); + break; + case WIDX_TRACK_SUPPORT_COLOUR: + WindowDropdownShowColour( + this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].supports); + break; + case WIDX_MAZE_STYLE_DROPDOWN: + for (i = 0; i < 4; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = MazeOptions[i].text; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, 4, widgets[widgetIndex].right - dropdownWidget->left); + + Dropdown::SetChecked(ride->track_colour[colourSchemeIndex].supports, true); + break; + case WIDX_ENTRANCE_STYLE_DROPDOWN: + ShowEntranceStyleDropdown(); + break; + case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN: + for (i = 0; i < 3; i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = (GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle) + .singular + << 16) + | VehicleColourSchemeNames[i]; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, rideEntry->max_cars_in_train > 1 ? 3 : 2, + widgets[widgetIndex].right - dropdownWidget->left); + + Dropdown::SetChecked(ride->colour_scheme_type & 3, true); + break; + case WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN: + numItems = ride->NumTrains; + if ((ride->colour_scheme_type & 3) != VEHICLE_COLOUR_SCHEME_PER_TRAIN) + numItems = ride->num_cars_per_train; + + stringId = (ride->colour_scheme_type & 3) == VEHICLE_COLOUR_SCHEME_PER_TRAIN + ? STR_RIDE_COLOUR_TRAIN_OPTION + : STR_RIDE_COLOUR_VEHICLE_OPTION; + for (i = 0; i < std::min(numItems, Dropdown::ItemsMaxSize); i++) + { + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = (static_cast(i + 1) << 32) + | ((GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised) << 16) + | stringId; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, numItems, widgets[widgetIndex].right - dropdownWidget->left); + + Dropdown::SetChecked(_vehicleIndex, true); + break; + case WIDX_VEHICLE_BODY_COLOUR: + vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Body); + break; + case WIDX_VEHICLE_TRIM_COLOUR: + vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Trim); + break; + case WIDX_VEHICLE_TERNARY_COLOUR: + vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Tertiary); + break; + } + } + + void ColourOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (dropdownIndex == -1) + return; + + switch (widgetIndex) + { + case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: + _rideColour = static_cast(dropdownIndex); + Invalidate(); + break; + case WIDX_TRACK_MAIN_COLOUR: { - const bool currentlyEnabled = ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS); auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::SellingItemColourIsRandom, currentlyEnabled ? 0 : 1, 0); + rideId, RideSetAppearanceType::TrackColourMain, ColourDropDownIndexToColour(dropdownIndex), + _rideColour); GameActions::Execute(&rideSetAppearanceAction); } break; - } - } - - void ColourResize() - { - WindowSetResize(*this, 316, 207, 316, 207); - } - - void ColourOnMouseDown(WidgetIndex widgetIndex) - { - VehicleColour vehicleColour; - int32_t i, numItems; - StringId stringId; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - auto colourSchemeIndex = _rideColour; - auto dropdownWidget = &widgets[widgetIndex] - 1; - - switch (widgetIndex) - { - case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: - for (i = 0; i < OpenRCT2::Limits::NumColourSchemes; i++) + case WIDX_TRACK_ADDITIONAL_COLOUR: { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = ColourSchemeNames[i]; + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::TrackColourAdditional, ColourDropDownIndexToColour(dropdownIndex), + _rideColour); + GameActions::Execute(&rideSetAppearanceAction); } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, 4, widgets[widgetIndex].right - dropdownWidget->left); - - Dropdown::SetChecked(colourSchemeIndex, true); break; - case WIDX_TRACK_MAIN_COLOUR: - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].main); - break; - case WIDX_TRACK_ADDITIONAL_COLOUR: - WindowDropdownShowColour( - this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].additional); - break; - case WIDX_TRACK_SUPPORT_COLOUR: - WindowDropdownShowColour( - this, &widgets[widgetIndex], colours[1], ride->track_colour[colourSchemeIndex].supports); - break; - case WIDX_MAZE_STYLE_DROPDOWN: - for (i = 0; i < 4; i++) + case WIDX_TRACK_SUPPORT_COLOUR: { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = MazeOptions[i].text; + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::TrackColourSupports, ColourDropDownIndexToColour(dropdownIndex), + _rideColour); + GameActions::Execute(&rideSetAppearanceAction); } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, 4, widgets[widgetIndex].right - dropdownWidget->left); - - Dropdown::SetChecked(ride->track_colour[colourSchemeIndex].supports, true); break; - case WIDX_ENTRANCE_STYLE_DROPDOWN: - ShowEntranceStyleDropdown(); - break; - case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN: - for (i = 0; i < 3; i++) + case WIDX_MAZE_STYLE_DROPDOWN: { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = (GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle) - .singular - << 16) - | VehicleColourSchemeNames[i]; + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::MazeStyle, dropdownIndex, _rideColour); + GameActions::Execute(&rideSetAppearanceAction); } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, rideEntry->max_cars_in_train > 1 ? 3 : 2, - widgets[widgetIndex].right - dropdownWidget->left); - - Dropdown::SetChecked(ride->colour_scheme_type & 3, true); break; - case WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN: - numItems = ride->NumTrains; - if ((ride->colour_scheme_type & 3) != VEHICLE_COLOUR_SCHEME_PER_TRAIN) - numItems = ride->num_cars_per_train; - - stringId = (ride->colour_scheme_type & 3) == VEHICLE_COLOUR_SCHEME_PER_TRAIN ? STR_RIDE_COLOUR_TRAIN_OPTION - : STR_RIDE_COLOUR_VEHICLE_OPTION; - for (i = 0; i < std::min(numItems, Dropdown::ItemsMaxSize); i++) - { - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = (static_cast(i + 1) << 32) - | ((GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised) << 16) - | stringId; - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, - colours[1], 0, Dropdown::Flag::StayOpen, numItems, widgets[widgetIndex].right - dropdownWidget->left); - - Dropdown::SetChecked(_vehicleIndex, true); - break; - case WIDX_VEHICLE_BODY_COLOUR: - vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Body); - break; - case WIDX_VEHICLE_TRIM_COLOUR: - vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Trim); - break; - case WIDX_VEHICLE_TERNARY_COLOUR: - vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Tertiary); - break; - } - } - - void ColourOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (dropdownIndex == -1) - return; - - switch (widgetIndex) - { - case WIDX_TRACK_COLOUR_SCHEME_DROPDOWN: - _rideColour = static_cast(dropdownIndex); - Invalidate(); - break; - case WIDX_TRACK_MAIN_COLOUR: - { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::TrackColourMain, ColourDropDownIndexToColour(dropdownIndex), _rideColour); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - case WIDX_TRACK_ADDITIONAL_COLOUR: - { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::TrackColourAdditional, ColourDropDownIndexToColour(dropdownIndex), - _rideColour); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - case WIDX_TRACK_SUPPORT_COLOUR: - { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::TrackColourSupports, ColourDropDownIndexToColour(dropdownIndex), - _rideColour); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - case WIDX_MAZE_STYLE_DROPDOWN: - { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::MazeStyle, dropdownIndex, _rideColour); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - case WIDX_ENTRANCE_STYLE_DROPDOWN: - { - if (static_cast(dropdownIndex) >= _entranceDropdownData.size()) + case WIDX_ENTRANCE_STYLE_DROPDOWN: { + if (static_cast(dropdownIndex) >= _entranceDropdownData.size()) + { + break; + } + auto objIndex = _entranceDropdownData[dropdownIndex].EntranceTypeId; + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::EntranceStyle, objIndex, 0); + rideSetAppearanceAction.SetCallback([objIndex](const GameAction*, const GameActions::Result* res) { + if (res->Error != GameActions::Status::Ok) + return; + GetGameState().LastEntranceStyle = objIndex; + }); + GameActions::Execute(&rideSetAppearanceAction); break; } - auto objIndex = _entranceDropdownData[dropdownIndex].EntranceTypeId; - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::EntranceStyle, objIndex, 0); - rideSetAppearanceAction.SetCallback([objIndex](const GameAction*, const GameActions::Result* res) { - if (res->Error != GameActions::Status::Ok) - return; - GetGameState().LastEntranceStyle = objIndex; - }); - GameActions::Execute(&rideSetAppearanceAction); + case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN: + { + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::VehicleColourScheme, dropdownIndex, 0); + GameActions::Execute(&rideSetAppearanceAction); + _vehicleIndex = 0; + } + break; + case WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN: + _vehicleIndex = dropdownIndex; + Invalidate(); + break; + case WIDX_VEHICLE_BODY_COLOUR: + { + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::VehicleColourBody, ColourDropDownIndexToColour(dropdownIndex), + _vehicleIndex); + GameActions::Execute(&rideSetAppearanceAction); + } + break; + case WIDX_VEHICLE_TRIM_COLOUR: + { + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::VehicleColourTrim, ColourDropDownIndexToColour(dropdownIndex), + _vehicleIndex); + GameActions::Execute(&rideSetAppearanceAction); + } + break; + case WIDX_VEHICLE_TERNARY_COLOUR: + { + auto rideSetAppearanceAction = RideSetAppearanceAction( + rideId, RideSetAppearanceType::VehicleColourTernary, ColourDropDownIndexToColour(dropdownIndex), + _vehicleIndex); + GameActions::Execute(&rideSetAppearanceAction); + } break; } - case WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN: + } + + void ColourUpdate() + { + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_5); + WidgetInvalidate(*this, WIDX_VEHICLE_PREVIEW); + } + + void ColourOnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA) + SetTrackColourScheme(screenCoords); + } + + void ColourOnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA) + SetTrackColourScheme(screenCoords); + } + + void ColourOnPrepareDraw() + { + TrackColour trackColour; + VehicleColour vehicleColour; + + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::VehicleColourScheme, dropdownIndex, 0); - GameActions::Execute(&rideSetAppearanceAction); - _vehicleIndex = 0; + widgets = newWidgets; + InitScrollWidgets(); } - break; - case WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN: - _vehicleIndex = dropdownIndex; - Invalidate(); - break; - case WIDX_VEHICLE_BODY_COLOUR: + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + widgets[WIDX_TITLE].text = STR_ARG_16_STRINGID; + auto ft = Formatter::Common(); + ft.Increment(16); + ride->FormatNameTo(ft); + + // Track colours + int32_t colourScheme = _rideColour; + trackColour = ride->track_colour[colourScheme]; + + // Maze style + const auto& rtd = ride->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::VehicleColourBody, ColourDropDownIndexToColour(dropdownIndex), - _vehicleIndex); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - case WIDX_VEHICLE_TRIM_COLOUR: - { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::VehicleColourTrim, ColourDropDownIndexToColour(dropdownIndex), - _vehicleIndex); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - case WIDX_VEHICLE_TERNARY_COLOUR: - { - auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::VehicleColourTernary, ColourDropDownIndexToColour(dropdownIndex), - _vehicleIndex); - GameActions::Execute(&rideSetAppearanceAction); - } - break; - } - } - - void ColourUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_5); - WidgetInvalidate(*this, WIDX_VEHICLE_PREVIEW); - } - - void ColourOnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA) - SetTrackColourScheme(screenCoords); - } - - void ColourOnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (widgetIndex == WIDX_PAINT_INDIVIDUAL_AREA) - SetTrackColourScheme(screenCoords); - } - - void ColourOnPrepareDraw() - { - TrackColour trackColour; - VehicleColour vehicleColour; - - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - widgets[WIDX_TITLE].text = STR_ARG_16_STRINGID; - auto ft = Formatter::Common(); - ft.Increment(16); - ride->FormatNameTo(ft); - - // Track colours - int32_t colourScheme = _rideColour; - trackColour = ride->track_colour[colourScheme]; - - // Maze style - const auto& rtd = ride->GetRideTypeDescriptor(); - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { - widgets[WIDX_MAZE_STYLE].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_MAZE_STYLE_DROPDOWN].type = WindowWidgetType::Button; - widgets[WIDX_MAZE_STYLE].text = MazeOptions[trackColour.supports].text; - } - else - { - widgets[WIDX_MAZE_STYLE].type = WindowWidgetType::Empty; - widgets[WIDX_MAZE_STYLE_DROPDOWN].type = WindowWidgetType::Empty; - } - - // Track, multiple colour schemes - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR)) - { - widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button; - widgets[WIDX_PAINT_INDIVIDUAL_AREA].type = WindowWidgetType::FlatBtn; - } - else - { - widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::Empty; - widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_PAINT_INDIVIDUAL_AREA].type = WindowWidgetType::Empty; - } - - // Track main colour - if (HasTrackColour(*ride, 0)) - { - widgets[WIDX_TRACK_MAIN_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_TRACK_MAIN_COLOUR].image = GetColourButtonImage(trackColour.main); - } - else - { - widgets[WIDX_TRACK_MAIN_COLOUR].type = WindowWidgetType::Empty; - } - - // Track additional colour - if (HasTrackColour(*ride, 1)) - { - widgets[WIDX_TRACK_ADDITIONAL_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_TRACK_ADDITIONAL_COLOUR].image = GetColourButtonImage(trackColour.additional); - } - else - { - widgets[WIDX_TRACK_ADDITIONAL_COLOUR].type = WindowWidgetType::Empty; - } - - // Selling item random colour checkbox - if (ride->HasRecolourableShopItems()) - { - widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WindowWidgetType::Checkbox; - if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) - { - pressed_widgets |= (1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); + widgets[WIDX_MAZE_STYLE].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_MAZE_STYLE_DROPDOWN].type = WindowWidgetType::Button; + widgets[WIDX_MAZE_STYLE].text = MazeOptions[trackColour.supports].text; } else { - pressed_widgets &= ~(1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); - } - } - else - { - widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WindowWidgetType::Empty; - } - - // Track supports colour - if (HasTrackColour(*ride, 2) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { - widgets[WIDX_TRACK_SUPPORT_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_TRACK_SUPPORT_COLOUR].image = GetColourButtonImage(trackColour.supports); - } - else - { - widgets[WIDX_TRACK_SUPPORT_COLOUR].type = WindowWidgetType::Empty; - } - - // Track preview - if (ride->GetRideTypeDescriptor().HasFlag( - RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL - | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS)) - widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Spinner; - else - widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Empty; - - // Entrance style - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)) - { - widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Spinner; - widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Button; - - auto stringId = STR_NONE; - auto stationObj = ride->GetStationObject(); - if (stationObj != nullptr) - { - stringId = stationObj->NameStringId; - } - widgets[WIDX_ENTRANCE_STYLE].text = stringId; - } - else - { - widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Empty; - widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::Empty; - widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Empty; - } - - // Vehicle colours - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES) - && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS)) - { - int32_t vehicleColourSchemeType = ride->colour_scheme_type & 3; - if (vehicleColourSchemeType == 0) - _vehicleIndex = 0; - - vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); - - widgets[WIDX_VEHICLE_PREVIEW].type = WindowWidgetType::Scroll; - widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_VEHICLE_BODY_COLOUR].image = GetColourButtonImage(vehicleColour.Body); - - bool allowChangingTrimColour = false; - bool allowChangingTernaryColour = false; - - for (int32_t i = 0; i < ride->num_cars_per_train; i++) - { - uint8_t vehicleTypeIndex = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, i); - - if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TRIM_COLOUR) - { - allowChangingTrimColour = true; - } - if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TERNARY_COLOUR) - { - allowChangingTernaryColour = true; - } + widgets[WIDX_MAZE_STYLE].type = WindowWidgetType::Empty; + widgets[WIDX_MAZE_STYLE_DROPDOWN].type = WindowWidgetType::Empty; } - // Additional colours - if (allowChangingTrimColour) + // Track, multiple colour schemes + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_SUPPORTS_MULTIPLE_TRACK_COLOUR)) { - widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_VEHICLE_TRIM_COLOUR].image = GetColourButtonImage(vehicleColour.Trim); - if (allowChangingTernaryColour) + widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button; + widgets[WIDX_PAINT_INDIVIDUAL_AREA].type = WindowWidgetType::FlatBtn; + } + else + { + widgets[WIDX_TRACK_COLOUR_SCHEME].type = WindowWidgetType::Empty; + widgets[WIDX_TRACK_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_PAINT_INDIVIDUAL_AREA].type = WindowWidgetType::Empty; + } + + // Track main colour + if (HasTrackColour(*ride, 0)) + { + widgets[WIDX_TRACK_MAIN_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_TRACK_MAIN_COLOUR].image = GetColourButtonImage(trackColour.main); + } + else + { + widgets[WIDX_TRACK_MAIN_COLOUR].type = WindowWidgetType::Empty; + } + + // Track additional colour + if (HasTrackColour(*ride, 1)) + { + widgets[WIDX_TRACK_ADDITIONAL_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_TRACK_ADDITIONAL_COLOUR].image = GetColourButtonImage(trackColour.additional); + } + else + { + widgets[WIDX_TRACK_ADDITIONAL_COLOUR].type = WindowWidgetType::Empty; + } + + // Selling item random colour checkbox + if (ride->HasRecolourableShopItems()) + { + widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WindowWidgetType::Checkbox; + if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) { - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_VEHICLE_TERNARY_COLOUR].image = GetColourButtonImage(vehicleColour.Tertiary); + pressed_widgets |= (1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } else { - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + pressed_widgets &= ~(1uLL << WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX); } } else { + widgets[WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX].type = WindowWidgetType::Empty; + } + + // Track supports colour + if (HasTrackColour(*ride, 2) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + widgets[WIDX_TRACK_SUPPORT_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_TRACK_SUPPORT_COLOUR].image = GetColourButtonImage(trackColour.supports); + } + else + { + widgets[WIDX_TRACK_SUPPORT_COLOUR].type = WindowWidgetType::Empty; + } + + // Track preview + if (ride->GetRideTypeDescriptor().HasFlag( + RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_MAIN | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_ADDITIONAL + | RIDE_TYPE_FLAG_HAS_TRACK_COLOUR_SUPPORTS)) + widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Spinner; + else + widgets[WIDX_TRACK_PREVIEW].type = WindowWidgetType::Empty; + + // Entrance style + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)) + { + widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Spinner; + widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Button; + + auto stringId = STR_NONE; + auto stationObj = ride->GetStationObject(); + if (stationObj != nullptr) + { + stringId = stationObj->NameStringId; + } + widgets[WIDX_ENTRANCE_STYLE].text = stringId; + } + else + { + widgets[WIDX_ENTRANCE_PREVIEW].type = WindowWidgetType::Empty; + widgets[WIDX_ENTRANCE_STYLE].type = WindowWidgetType::Empty; + widgets[WIDX_ENTRANCE_STYLE_DROPDOWN].type = WindowWidgetType::Empty; + } + + // Vehicle colours + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES) + && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_VEHICLE_COLOURS)) + { + int32_t vehicleColourSchemeType = ride->colour_scheme_type & 3; + if (vehicleColourSchemeType == 0) + _vehicleIndex = 0; + + vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); + + widgets[WIDX_VEHICLE_PREVIEW].type = WindowWidgetType::Scroll; + widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_VEHICLE_BODY_COLOUR].image = GetColourButtonImage(vehicleColour.Body); + + bool allowChangingTrimColour = false; + bool allowChangingTernaryColour = false; + + for (int32_t i = 0; i < ride->num_cars_per_train; i++) + { + uint8_t vehicleTypeIndex = RideEntryGetVehicleAtPosition(ride->subtype, ride->num_cars_per_train, i); + + if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TRIM_COLOUR) + { + allowChangingTrimColour = true; + } + if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TERNARY_COLOUR) + { + allowChangingTernaryColour = true; + } + } + + // Additional colours + if (allowChangingTrimColour) + { + widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_VEHICLE_TRIM_COLOUR].image = GetColourButtonImage(vehicleColour.Trim); + if (allowChangingTernaryColour) + { + widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_VEHICLE_TERNARY_COLOUR].image = GetColourButtonImage(vehicleColour.Tertiary); + } + else + { + widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + } + } + else + { + widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + } + + // Vehicle colour scheme type + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL) + && (ride->num_cars_per_train | ride->NumTrains) > 1) + { + widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button; + } + else + { + widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; + } + ft.Rewind(); + ft.Increment(6); + ft.Add(VehicleColourSchemeNames[vehicleColourSchemeType]); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised); + ft.Add(_vehicleIndex + 1); + + // Vehicle index + if (vehicleColourSchemeType != 0) + { + widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Button; + widgets[WIDX_VEHICLE_COLOUR_INDEX].text = vehicleColourSchemeType == 1 ? STR_RIDE_COLOUR_TRAIN_VALUE + : STR_RIDE_COLOUR_VEHICLE_VALUE; + } + else + { + widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Empty; + } + } + else + { + widgets[WIDX_VEHICLE_PREVIEW].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::Empty; widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::Empty; widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; } - // Vehicle colour scheme type - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_VEHICLE_IS_INTEGRAL) - && (ride->num_cars_per_train | ride->NumTrains) > 1) - { - widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Button; - } - else - { - widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; - } ft.Rewind(); - ft.Increment(6); - ft.Add(VehicleColourSchemeNames[vehicleColourSchemeType]); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).singular); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).capitalised); - ft.Add(_vehicleIndex + 1); + ft.Increment(14); + ft.Add(ColourSchemeNames[colourScheme]); - // Vehicle index - if (vehicleColourSchemeType != 0) - { - widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Button; - widgets[WIDX_VEHICLE_COLOUR_INDEX].text = vehicleColourSchemeType == 1 ? STR_RIDE_COLOUR_TRAIN_VALUE - : STR_RIDE_COLOUR_VEHICLE_VALUE; - } - else - { - widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Empty; - } - } - else - { - widgets[WIDX_VEHICLE_PREVIEW].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_COLOUR_SCHEME].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_COLOUR_SCHEME_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_COLOUR_INDEX].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); } - ft.Rewind(); - ft.Increment(14); - ft.Add(ColourSchemeNames[colourScheme]); - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } - - void ColourOnDraw(DrawPixelInfo& dpi) - { - // TODO: This should use lists and identified sprites - DrawPixelInfo clippedDpi; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - DrawWidgets(dpi); - DrawTabImages(dpi); - - // Track / shop item preview - const auto& trackPreviewWidget = widgets[WIDX_TRACK_PREVIEW]; - if (trackPreviewWidget.type != WindowWidgetType::Empty) - GfxFillRect( - dpi, - { { windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } }, - { windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } }, - PALETTE_INDEX_12); - - auto trackColour = ride->track_colour[_rideColour]; - - // - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr || rideEntry->shop_item[0] == ShopItem::None) + void ColourOnDraw(DrawPixelInfo& dpi) { - auto screenCoords = windowPos + ScreenCoordsXY{ trackPreviewWidget.left, trackPreviewWidget.top }; + // TODO: This should use lists and identified sprites + DrawPixelInfo clippedDpi; - // Track - const auto& rtd = ride->GetRideTypeDescriptor(); - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + DrawWidgets(dpi); + DrawTabImages(dpi); + + // Track / shop item preview + const auto& trackPreviewWidget = widgets[WIDX_TRACK_PREVIEW]; + if (trackPreviewWidget.type != WindowWidgetType::Empty) + GfxFillRect( + dpi, + { { windowPos + ScreenCoordsXY{ trackPreviewWidget.left + 1, trackPreviewWidget.top + 1 } }, + { windowPos + ScreenCoordsXY{ trackPreviewWidget.right - 1, trackPreviewWidget.bottom - 1 } } }, + PALETTE_INDEX_12); + + auto trackColour = ride->track_colour[_rideColour]; + + // + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr || rideEntry->shop_item[0] == ShopItem::None) { - GfxDrawSprite(dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords); - } - else - { - auto typeDescriptor = ride->GetRideTypeDescriptor(); - int32_t spriteIndex = typeDescriptor.ColourPreview.Track; - if (spriteIndex != 0) + auto screenCoords = windowPos + ScreenCoordsXY{ trackPreviewWidget.left, trackPreviewWidget.top }; + + // Track + const auto& rtd = ride->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) { - GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.main, trackColour.additional), screenCoords); + GfxDrawSprite(dpi, ImageId(MazeOptions[trackColour.supports].sprite), screenCoords); } - - // Supports - spriteIndex = typeDescriptor.ColourPreview.Supports; - if (spriteIndex != 0) + else { - GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.supports), screenCoords); - } - } - } - else - { - auto screenCoords = windowPos - + ScreenCoordsXY{ (trackPreviewWidget.left + trackPreviewWidget.right) / 2 - 8, - (trackPreviewWidget.bottom + trackPreviewWidget.top) / 2 - 6 }; - - ShopItem shopItem = rideEntry->shop_item[1] == ShopItem::None ? rideEntry->shop_item[0] : rideEntry->shop_item[1]; - if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) - { - colour_t spriteColour = COLOUR_BLACK; - // Limit update rate of preview to avoid making people dizzy. - if ((GetGameState().CurrentTicks % 64) == 0) - { - spriteColour++; - if (spriteColour >= COLOUR_NUM_NORMAL) + auto typeDescriptor = ride->GetRideTypeDescriptor(); + int32_t spriteIndex = typeDescriptor.ColourPreview.Track; + if (spriteIndex != 0) { - spriteColour = COLOUR_BLACK; + GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.main, trackColour.additional), screenCoords); } - } - GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, spriteColour), screenCoords); - } - else - { - GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords); - } - } - - // Entrance preview - trackColour = ride->track_colour[0]; - const auto& entrancePreviewWidget = widgets[WIDX_ENTRANCE_PREVIEW]; - if (entrancePreviewWidget.type != WindowWidgetType::Empty) - { - if (ClipDrawPixelInfo( - clippedDpi, dpi, - windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 }, - entrancePreviewWidget.width(), entrancePreviewWidget.height())) - { - GfxClear(&clippedDpi, PALETTE_INDEX_12); - - auto stationObj = ride->GetStationObject(); - if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined) - { - auto imageId = ImageId(stationObj->BaseImageId, trackColour.main, trackColour.additional); - - // Back - GfxDrawSprite(clippedDpi, imageId, { 34, 20 }); - - // Front - GfxDrawSprite(clippedDpi, imageId.WithIndexOffset(4), { 34, 20 }); - - // Glass - if (stationObj->Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT) + // Supports + spriteIndex = typeDescriptor.ColourPreview.Supports; + if (spriteIndex != 0) { - auto glassImageId = ImageId(stationObj->BaseImageId + 20).WithTransparency(trackColour.main); - GfxDrawSprite(clippedDpi, glassImageId, { 34, 20 }); + GfxDrawSprite(dpi, ImageId(spriteIndex, trackColour.supports), screenCoords); } } } + else + { + auto screenCoords = windowPos + + ScreenCoordsXY{ (trackPreviewWidget.left + trackPreviewWidget.right) / 2 - 8, + (trackPreviewWidget.bottom + trackPreviewWidget.top) / 2 - 6 }; - DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + 103 }, 97, STR_STATION_STYLE, {}); + ShopItem shopItem = rideEntry->shop_item[1] == ShopItem::None ? rideEntry->shop_item[0] + : rideEntry->shop_item[1]; + if (ride->HasLifecycleFlag(RIDE_LIFECYCLE_RANDOM_SHOP_COLOURS)) + { + colour_t spriteColour = COLOUR_BLACK; + // Limit update rate of preview to avoid making people dizzy. + if ((GetGameState().CurrentTicks % 64) == 0) + { + spriteColour++; + if (spriteColour >= COLOUR_NUM_NORMAL) + { + spriteColour = COLOUR_BLACK; + } + } + + GfxDrawSprite(dpi, ImageId(GetShopItemDescriptor(shopItem).Image, spriteColour), screenCoords); + } + else + { + GfxDrawSprite( + dpi, ImageId(GetShopItemDescriptor(shopItem).Image, ride->track_colour[0].main), screenCoords); + } + } + + // Entrance preview + trackColour = ride->track_colour[0]; + const auto& entrancePreviewWidget = widgets[WIDX_ENTRANCE_PREVIEW]; + if (entrancePreviewWidget.type != WindowWidgetType::Empty) + { + if (ClipDrawPixelInfo( + clippedDpi, dpi, + windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 }, + entrancePreviewWidget.width(), entrancePreviewWidget.height())) + { + GfxClear(&clippedDpi, PALETTE_INDEX_12); + + auto stationObj = ride->GetStationObject(); + if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined) + { + auto imageId = ImageId(stationObj->BaseImageId, trackColour.main, trackColour.additional); + + // Back + GfxDrawSprite(clippedDpi, imageId, { 34, 20 }); + + // Front + GfxDrawSprite(clippedDpi, imageId.WithIndexOffset(4), { 34, 20 }); + + // Glass + if (stationObj->Flags & STATION_OBJECT_FLAGS::IS_TRANSPARENT) + { + auto glassImageId = ImageId(stationObj->BaseImageId + 20).WithTransparency(trackColour.main); + GfxDrawSprite(clippedDpi, glassImageId, { 34, 20 }); + } + } + } + + DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + 103 }, 97, STR_STATION_STYLE, {}); + } } - } - void ColourOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) const - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; + void ColourOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) const + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; - auto vehiclePreviewWidget = &widgets[WIDX_VEHICLE_PREVIEW]; - auto vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); + auto vehiclePreviewWidget = &widgets[WIDX_VEHICLE_PREVIEW]; + auto vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); - // Background colour - GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, PALETTE_INDEX_12); + // Background colour + GfxFillRect(dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, PALETTE_INDEX_12); - // ? - auto screenCoords = ScreenCoordsXY{ vehiclePreviewWidget->width() / 2, vehiclePreviewWidget->height() - 15 }; + // ? + auto screenCoords = ScreenCoordsXY{ vehiclePreviewWidget->width() / 2, vehiclePreviewWidget->height() - 15 }; - // ? - auto trainCarIndex = (ride->colour_scheme_type & 3) == RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_CAR ? _vehicleIndex - : rideEntry->TabCar; + // ? + auto trainCarIndex = (ride->colour_scheme_type & 3) == RIDE_COLOUR_SCHEME_MODE_DIFFERENT_PER_CAR + ? _vehicleIndex + : rideEntry->TabCar; - const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( - ride->subtype, ride->num_cars_per_train, trainCarIndex)]; + const auto& carEntry = rideEntry->Cars[RideEntryGetVehicleAtPosition( + ride->subtype, ride->num_cars_per_train, trainCarIndex)]; - screenCoords.y += carEntry.tab_height; + screenCoords.y += carEntry.tab_height; - // Draw the coloured spinning vehicle - // frame_no represents a SpritePrecision of 64 - ImageIndex imageIndex = carEntry.SpriteByYaw(frame_no / 2, SpriteGroupType::SlopeFlat); - imageIndex &= carEntry.TabRotationMask; - imageIndex *= carEntry.base_num_frames; - imageIndex += carEntry.base_image_id; - auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary); - GfxDrawSprite(dpi, imageId, screenCoords); - } + // Draw the coloured spinning vehicle + // frame_no represents a SpritePrecision of 64 + ImageIndex imageIndex = carEntry.SpriteByYaw(frame_no / 2, SpriteGroupType::SlopeFlat); + imageIndex &= carEntry.TabRotationMask; + imageIndex *= carEntry.base_num_frames; + imageIndex += carEntry.base_image_id; + auto imageId = ImageId(imageIndex, vehicleColour.Body, vehicleColour.Trim, vehicleColour.Tertiary); + GfxDrawSprite(dpi, imageId, screenCoords); + } #pragma endregion #pragma region Music - std::vector window_ride_current_music_style_order; + std::vector window_ride_current_music_style_order; - void ToggleMusic() - { - auto ride = GetRide(rideId); - if (ride != nullptr) + void ToggleMusic() { - int32_t activateMusic = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) ? 0 : 1; - SetOperatingSetting(rideId, RideSetSetting::Music, activateMusic); - } - } - - void MusicOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_PLAY_MUSIC: - ToggleMusic(); - break; - } - } - - void MusicResize() - { - flags |= WF_RESIZABLE; - WindowSetResize(*this, 316, 81, 316, 81); - } - - static std::string GetMusicString(ObjectEntryIndex musicObjectIndex) - { - auto& objManager = GetContext()->GetObjectManager(); - auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, musicObjectIndex)); - - auto name = musicObj->NameStringId; - return FormatStringID(name, {}); - } - - /** - * - * rct2: 0x006B1EFC - */ - void MusicOnMouseDown(WidgetIndex widgetIndex) - { - if (widgetIndex != WIDX_MUSIC_DROPDOWN) - return; - - auto dropdownWidget = &widgets[widgetIndex] - 1; - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - // Construct list of available music - auto& musicOrder = window_ride_current_music_style_order; - musicOrder.clear(); - auto& objManager = GetContext()->GetObjectManager(); - for (ObjectEntryIndex i = 0; i < MAX_MUSIC_OBJECTS; i++) - { - auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, i)); - if (musicObj != nullptr) + auto ride = GetRide(rideId); + if (ride != nullptr) { - // Hide custom music if the WAV file does not exist - auto originalStyleId = musicObj->GetOriginalStyleId(); - if (originalStyleId.has_value() - && (originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_1 || originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_2)) + int32_t activateMusic = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) ? 0 : 1; + SetOperatingSetting(rideId, RideSetSetting::Music, activateMusic); + } + } + + void MusicOnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_PLAY_MUSIC: + ToggleMusic(); + break; + } + } + + void MusicResize() + { + flags |= WF_RESIZABLE; + WindowSetResize(*this, 316, 81, 316, 81); + } + + static std::string GetMusicString(ObjectEntryIndex musicObjectIndex) + { + auto& objManager = GetContext()->GetObjectManager(); + auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, musicObjectIndex)); + + auto name = musicObj->NameStringId; + return FormatStringID(name, {}); + } + + /** + * + * rct2: 0x006B1EFC + */ + void MusicOnMouseDown(WidgetIndex widgetIndex) + { + if (widgetIndex != WIDX_MUSIC_DROPDOWN) + return; + + auto dropdownWidget = &widgets[widgetIndex] - 1; + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + // Construct list of available music + auto& musicOrder = window_ride_current_music_style_order; + musicOrder.clear(); + auto& objManager = GetContext()->GetObjectManager(); + for (ObjectEntryIndex i = 0; i < MAX_MUSIC_OBJECTS; i++) + { + auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, i)); + if (musicObj != nullptr) { - auto numTracks = musicObj->GetTrackCount(); - if (numTracks != 0) + // Hide custom music if the WAV file does not exist + auto originalStyleId = musicObj->GetOriginalStyleId(); + if (originalStyleId.has_value() + && (originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_1 || originalStyleId == MUSIC_STYLE_CUSTOM_MUSIC_2)) { - auto track0 = musicObj->GetTrack(0); - if (!track0->Asset.IsAvailable()) + auto numTracks = musicObj->GetTrackCount(); + if (numTracks != 0) + { + auto track0 = musicObj->GetTrack(0); + if (!track0->Asset.IsAvailable()) + { + continue; + } + } + else { continue; } } - else + + if (GetGameState().Cheats.UnlockOperatingLimits || musicObj->SupportsRideType(ride->type)) { - continue; + musicOrder.push_back(i); } } + } - if (GetGameState().Cheats.UnlockOperatingLimits || musicObj->SupportsRideType(ride->type)) + // Sort available music by the alphabetical order + std::stable_sort(musicOrder.begin(), musicOrder.end(), [](const ObjectEntryIndex& a, const ObjectEntryIndex& b) { + return String::Compare(GetMusicString(b), GetMusicString(a), false) > 0; + }); + + // Setup dropdown list + auto numItems = musicOrder.size(); + for (size_t i = 0; i < numItems; i++) + { + auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, musicOrder[i])); + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[i].Args = musicObj->NameStringId; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, + colours[1], 0, Dropdown::Flag::StayOpen, numItems, widgets[widgetIndex].right - dropdownWidget->left); + + // Set currently checked item + for (size_t i = 0; i < numItems; i++) + { + if (musicOrder[i] == ride->music) { - musicOrder.push_back(i); + Dropdown::SetChecked(static_cast(i), true); } } } - // Sort available music by the alphabetical order - std::stable_sort(musicOrder.begin(), musicOrder.end(), [](const ObjectEntryIndex& a, const ObjectEntryIndex& b) { - return String::Compare(GetMusicString(b), GetMusicString(a), false) > 0; - }); - - // Setup dropdown list - auto numItems = musicOrder.size(); - for (size_t i = 0; i < numItems; i++) + void MusicOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) { - auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, musicOrder[i])); - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[i].Args = musicObj->NameStringId; - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + dropdownWidget->left, windowPos.y + dropdownWidget->top }, dropdownWidget->height() + 1, colours[1], - 0, Dropdown::Flag::StayOpen, numItems, widgets[widgetIndex].right - dropdownWidget->left); - - // Set currently checked item - for (size_t i = 0; i < numItems; i++) - { - if (musicOrder[i] == ride->music) + if (widgetIndex == WIDX_MUSIC_DROPDOWN && dropdownIndex >= 0 + && static_cast(dropdownIndex) < window_ride_current_music_style_order.size()) { - Dropdown::SetChecked(static_cast(i), true); + auto musicStyle = window_ride_current_music_style_order[dropdownIndex]; + SetOperatingSetting(rideId, RideSetSetting::MusicType, musicStyle); } } - } - void MusicOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (widgetIndex == WIDX_MUSIC_DROPDOWN && dropdownIndex >= 0 - && static_cast(dropdownIndex) < window_ride_current_music_style_order.size()) + void MusicUpdate() { - auto musicStyle = window_ride_current_music_style_order[dropdownIndex]; - SetOperatingSetting(rideId, RideSetSetting::MusicType, musicStyle); - } - } - - void MusicUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_6); - } - - void MusicOnPrepareDraw() - { - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_6); } - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - // Set selected music - StringId musicName = STR_NONE; - auto& objManager = GetContext()->GetObjectManager(); - auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, ride->music)); - if (musicObj != nullptr) + void MusicOnPrepareDraw() { - musicName = musicObj->NameStringId; - } - widgets[WIDX_MUSIC].text = musicName; + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } - // Set music activated - auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; - if (isMusicActivated) - { - pressed_widgets |= (1uLL << WIDX_PLAY_MUSIC); - disabled_widgets &= ~(1uLL << WIDX_MUSIC); - disabled_widgets &= ~(1uLL << WIDX_MUSIC_DROPDOWN); - } - else - { - pressed_widgets &= ~(1uLL << WIDX_PLAY_MUSIC); - disabled_widgets |= (1uLL << WIDX_MUSIC); - disabled_widgets |= (1uLL << WIDX_MUSIC_DROPDOWN); + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + // Set selected music + StringId musicName = STR_NONE; + auto& objManager = GetContext()->GetObjectManager(); + auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, ride->music)); + if (musicObj != nullptr) + { + musicName = musicObj->NameStringId; + } + widgets[WIDX_MUSIC].text = musicName; + + // Set music activated + auto isMusicActivated = (ride->lifecycle_flags & RIDE_LIFECYCLE_MUSIC) != 0; + if (isMusicActivated) + { + pressed_widgets |= (1uLL << WIDX_PLAY_MUSIC); + disabled_widgets &= ~(1uLL << WIDX_MUSIC); + disabled_widgets &= ~(1uLL << WIDX_MUSIC_DROPDOWN); + } + else + { + pressed_widgets &= ~(1uLL << WIDX_PLAY_MUSIC); + disabled_widgets |= (1uLL << WIDX_MUSIC); + disabled_widgets |= (1uLL << WIDX_MUSIC_DROPDOWN); + } + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); } - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } - - void MusicOnDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - } + void MusicOnDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + } #pragma endregion #pragma region Measurements - static constexpr StringId GetRatingName(ride_rating rating) - { - int32_t index = std::clamp(rating >> 8, 0, static_cast(std::size(RatingNames)) - 1); - return RatingNames[index]; - } - - void SetupScenerySelection() - { - if (gTrackDesignSaveMode) + static constexpr StringId GetRatingName(ride_rating rating) { - CancelScenerySelection(); + int32_t index = std::clamp(rating >> 8, 0, static_cast(std::size(RatingNames)) - 1); + return RatingNames[index]; } - while (ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair)) - ; - - gTrackDesignSaveRideIndex = rideId; - - TrackDesignSaveInit(); - gGamePaused |= GAME_PAUSED_SAVING_TRACK; - gTrackDesignSaveMode = true; - - OpenRCT2::Audio::StopAll(); - - WindowBase* w_main = WindowGetMain(); - if (w_main != nullptr) + void SetupScenerySelection() { - w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); - } - - GfxInvalidateScreen(); - } - - void MeasurementsDesignReset() - { - TrackDesignSaveResetScenery(); - } - - void MeasurementsDesignSelectNearbyScenery() - { - TrackDesignSaveSelectNearbyScenery(gTrackDesignSaveRideIndex); - } - - void MeasurementsDesignCancel() - { - if (gTrackDesignSaveMode) - { - CancelScenerySelection(); - } - } - - static void TrackDesignCallback(int32_t result, [[maybe_unused]] const utf8* path) - { - if (result == MODAL_RESULT_OK) - { - TrackRepositoryScan(); - } - GfxInvalidateScreen(); - }; - - void MeasurementsDesignSave() - { - TrackDesignState tds{}; - - Ride* ride = GetRide(rideId); - _trackDesign = ride->SaveToTrackDesign(tds); - if (!_trackDesign) - { - return; - } - - if (gTrackDesignSaveMode) - { - auto errMessage = _trackDesign->CreateTrackDesignScenery(tds); - if (!errMessage.Successful) + if (gTrackDesignSaveMode) { - ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, errMessage.Message, {}); - return; + CancelScenerySelection(); } - if (errMessage.HasMessage()) + + while (ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair)) + ; + + gTrackDesignSaveRideIndex = rideId; + + TrackDesignSaveInit(); + gGamePaused |= GAME_PAUSED_SAVING_TRACK; + gTrackDesignSaveMode = true; + + OpenRCT2::Audio::StopAll(); + + WindowBase* w_main = WindowGetMain(); + if (w_main != nullptr) { - ContextShowError(errMessage.Message, STR_EMPTY, {}); + w_main->viewport->flags |= (VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); + } + + GfxInvalidateScreen(); + } + + void MeasurementsDesignReset() + { + TrackDesignSaveResetScenery(); + } + + void MeasurementsDesignSelectNearbyScenery() + { + TrackDesignSaveSelectNearbyScenery(gTrackDesignSaveRideIndex); + } + + void MeasurementsDesignCancel() + { + if (gTrackDesignSaveMode) + { + CancelScenerySelection(); } } - auto trackName = ride->GetName(); - auto intent = Intent(WindowClass::Loadsave); - intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK); - intent.PutExtra(INTENT_EXTRA_TRACK_DESIGN, _trackDesign.get()); - intent.PutExtra(INTENT_EXTRA_PATH, trackName); - intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(&TrackDesignCallback)); - - ContextOpenIntent(&intent); - } - - void MeasurementsClose() - { - MeasurementsDesignCancel(); - } - - void MeasurementsOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + static void TrackDesignCallback(int32_t result, [[maybe_unused]] const utf8* path) { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_SELECT_NEARBY_SCENERY: - MeasurementsDesignSelectNearbyScenery(); - break; - case WIDX_RESET_SELECTION: - MeasurementsDesignReset(); - break; - case WIDX_SAVE_DESIGN: - MeasurementsDesignSave(); - break; - case WIDX_CANCEL_DESIGN: - MeasurementsDesignCancel(); - break; - } - } - - void MeasurementsResize() - { - WindowSetResize(*this, 316, 234, 316, 234); - } - - void MeasurementsOnMouseDown(WidgetIndex widgetIndex) - { - if (widgetIndex != WIDX_SAVE_TRACK_DESIGN) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - gDropdownItems[0].Format = STR_SAVE_TRACK_DESIGN_ITEM; - gDropdownItems[1].Format = STR_SAVE_TRACK_DESIGN_WITH_SCENERY_ITEM; - - WindowDropdownShowText( - { windowPos.x + widgets[widgetIndex].left, windowPos.y + widgets[widgetIndex].top }, - widgets[widgetIndex].height() + 1, colours[1], Dropdown::Flag::StayOpen, 2); - gDropdownDefaultIndex = 0; - if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) - { - // Disable saving without scenery if we're a flat ride - Dropdown::SetDisabled(0, true); - gDropdownDefaultIndex = 1; - } - } - - void MeasurementsOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (widgetIndex != WIDX_SAVE_TRACK_DESIGN) - return; - - if (dropdownIndex == -1) - dropdownIndex = gDropdownHighlightedIndex; - - if (dropdownIndex == 0) - { - MeasurementsDesignSave(); - } - else - SetupScenerySelection(); - } - - void MeasurementsUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_7); - } - - void MeasurementsOnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - _lastSceneryX = screenCoords.x; - _lastSceneryY = screenCoords.y; - _collectTrackDesignScenery = true; // Default to true in case user does not select anything valid - - constexpr auto interactionFlags = EnumsToFlags( - ViewportInteractionItem::Scenery, ViewportInteractionItem::Footpath, ViewportInteractionItem::Wall, - ViewportInteractionItem::LargeScenery); - auto info = GetMapCoordinatesFromPos(screenCoords, interactionFlags); - switch (info.SpriteType) - { - case ViewportInteractionItem::Scenery: - case ViewportInteractionItem::LargeScenery: - case ViewportInteractionItem::Wall: - case ViewportInteractionItem::Footpath: - _collectTrackDesignScenery = !TrackDesignSaveContainsTileElement(info.Element); - TrackDesignSaveSelectTileElement(info.SpriteType, info.Loc, info.Element, _collectTrackDesignScenery); - break; - default: - break; - } - } - - void MeasurementsOnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (screenCoords.x == _lastSceneryX && screenCoords.y == _lastSceneryY) - return; - _lastSceneryX = screenCoords.x; - _lastSceneryY = screenCoords.y; - - auto interactionFlags = EnumsToFlags( - ViewportInteractionItem::Scenery, ViewportInteractionItem::Footpath, ViewportInteractionItem::Wall, - ViewportInteractionItem::LargeScenery); - auto info = GetMapCoordinatesFromPos(screenCoords, interactionFlags); - switch (info.SpriteType) - { - case ViewportInteractionItem::Scenery: - case ViewportInteractionItem::LargeScenery: - case ViewportInteractionItem::Wall: - case ViewportInteractionItem::Footpath: - TrackDesignSaveSelectTileElement(info.SpriteType, info.Loc, info.Element, _collectTrackDesignScenery); - break; - default: - break; - } - } - - void MeasurementsOnToolAbort(WidgetIndex widgetIndex) - { - MeasurementsDesignCancel(); - } - - void MeasurementsOnPrepareDraw() - { - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN_NOT_POSSIBLE; - widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::Empty; - if (gTrackDesignSaveMode && gTrackDesignSaveRideIndex == rideId) - { - widgets[WIDX_SELECT_NEARBY_SCENERY].type = WindowWidgetType::Button; - widgets[WIDX_RESET_SELECTION].type = WindowWidgetType::Button; - widgets[WIDX_SAVE_DESIGN].type = WindowWidgetType::Button; - widgets[WIDX_CANCEL_DESIGN].type = WindowWidgetType::Button; - } - else - { - widgets[WIDX_SELECT_NEARBY_SCENERY].type = WindowWidgetType::Empty; - widgets[WIDX_RESET_SELECTION].type = WindowWidgetType::Empty; - widgets[WIDX_SAVE_DESIGN].type = WindowWidgetType::Empty; - widgets[WIDX_CANCEL_DESIGN].type = WindowWidgetType::Empty; - - widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::FlatBtn; - disabled_widgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); - if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) + if (result == MODAL_RESULT_OK) { - if (ride->excitement != RIDE_RATING_UNDEFINED) + TrackRepositoryScan(); + } + GfxInvalidateScreen(); + }; + + void MeasurementsDesignSave() + { + TrackDesignState tds{}; + + Ride* ride = GetRide(rideId); + _trackDesign = ride->SaveToTrackDesign(tds); + if (!_trackDesign) + { + return; + } + + if (gTrackDesignSaveMode) + { + auto errMessage = _trackDesign->CreateTrackDesignScenery(tds); + if (!errMessage.Successful) { - disabled_widgets &= ~(1uLL << WIDX_SAVE_TRACK_DESIGN); - widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN; + ContextShowError(STR_CANT_SAVE_TRACK_DESIGN, errMessage.Message, {}); + return; + } + if (errMessage.HasMessage()) + { + ContextShowError(errMessage.Message, STR_EMPTY, {}); + } + } + + auto trackName = ride->GetName(); + auto intent = Intent(WindowClass::Loadsave); + intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_TRACK); + intent.PutExtra(INTENT_EXTRA_TRACK_DESIGN, _trackDesign.get()); + intent.PutExtra(INTENT_EXTRA_PATH, trackName); + intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(&TrackDesignCallback)); + + ContextOpenIntent(&intent); + } + + void MeasurementsClose() + { + MeasurementsDesignCancel(); + } + + void MeasurementsOnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_SELECT_NEARBY_SCENERY: + MeasurementsDesignSelectNearbyScenery(); + break; + case WIDX_RESET_SELECTION: + MeasurementsDesignReset(); + break; + case WIDX_SAVE_DESIGN: + MeasurementsDesignSave(); + break; + case WIDX_CANCEL_DESIGN: + MeasurementsDesignCancel(); + break; + } + } + + void MeasurementsResize() + { + WindowSetResize(*this, 316, 234, 316, 234); + } + + void MeasurementsOnMouseDown(WidgetIndex widgetIndex) + { + if (widgetIndex != WIDX_SAVE_TRACK_DESIGN) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + gDropdownItems[0].Format = STR_SAVE_TRACK_DESIGN_ITEM; + gDropdownItems[1].Format = STR_SAVE_TRACK_DESIGN_WITH_SCENERY_ITEM; + + WindowDropdownShowText( + { windowPos.x + widgets[widgetIndex].left, windowPos.y + widgets[widgetIndex].top }, + widgets[widgetIndex].height() + 1, colours[1], Dropdown::Flag::StayOpen, 2); + gDropdownDefaultIndex = 0; + if (!ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + { + // Disable saving without scenery if we're a flat ride + Dropdown::SetDisabled(0, true); + gDropdownDefaultIndex = 1; + } + } + + void MeasurementsOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + if (widgetIndex != WIDX_SAVE_TRACK_DESIGN) + return; + + if (dropdownIndex == -1) + dropdownIndex = gDropdownHighlightedIndex; + + if (dropdownIndex == 0) + { + MeasurementsDesignSave(); + } + else + SetupScenerySelection(); + } + + void MeasurementsUpdate() + { + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_7); + } + + void MeasurementsOnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + _lastSceneryX = screenCoords.x; + _lastSceneryY = screenCoords.y; + _collectTrackDesignScenery = true; // Default to true in case user does not select anything valid + + constexpr auto interactionFlags = EnumsToFlags( + ViewportInteractionItem::Scenery, ViewportInteractionItem::Footpath, ViewportInteractionItem::Wall, + ViewportInteractionItem::LargeScenery); + auto info = GetMapCoordinatesFromPos(screenCoords, interactionFlags); + switch (info.SpriteType) + { + case ViewportInteractionItem::Scenery: + case ViewportInteractionItem::LargeScenery: + case ViewportInteractionItem::Wall: + case ViewportInteractionItem::Footpath: + _collectTrackDesignScenery = !TrackDesignSaveContainsTileElement(info.Element); + TrackDesignSaveSelectTileElement(info.SpriteType, info.Loc, info.Element, _collectTrackDesignScenery); + break; + default: + break; + } + } + + void MeasurementsOnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (screenCoords.x == _lastSceneryX && screenCoords.y == _lastSceneryY) + return; + _lastSceneryX = screenCoords.x; + _lastSceneryY = screenCoords.y; + + auto interactionFlags = EnumsToFlags( + ViewportInteractionItem::Scenery, ViewportInteractionItem::Footpath, ViewportInteractionItem::Wall, + ViewportInteractionItem::LargeScenery); + auto info = GetMapCoordinatesFromPos(screenCoords, interactionFlags); + switch (info.SpriteType) + { + case ViewportInteractionItem::Scenery: + case ViewportInteractionItem::LargeScenery: + case ViewportInteractionItem::Wall: + case ViewportInteractionItem::Footpath: + TrackDesignSaveSelectTileElement(info.SpriteType, info.Loc, info.Element, _collectTrackDesignScenery); + break; + default: + break; + } + } + + void MeasurementsOnToolAbort(WidgetIndex widgetIndex) + { + MeasurementsDesignCancel(); + } + + void MeasurementsOnPrepareDraw() + { + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN_NOT_POSSIBLE; + widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::Empty; + if (gTrackDesignSaveMode && gTrackDesignSaveRideIndex == rideId) + { + widgets[WIDX_SELECT_NEARBY_SCENERY].type = WindowWidgetType::Button; + widgets[WIDX_RESET_SELECTION].type = WindowWidgetType::Button; + widgets[WIDX_SAVE_DESIGN].type = WindowWidgetType::Button; + widgets[WIDX_CANCEL_DESIGN].type = WindowWidgetType::Button; + } + else + { + widgets[WIDX_SELECT_NEARBY_SCENERY].type = WindowWidgetType::Empty; + widgets[WIDX_RESET_SELECTION].type = WindowWidgetType::Empty; + widgets[WIDX_SAVE_DESIGN].type = WindowWidgetType::Empty; + widgets[WIDX_CANCEL_DESIGN].type = WindowWidgetType::Empty; + + widgets[WIDX_SAVE_TRACK_DESIGN].type = WindowWidgetType::FlatBtn; + disabled_widgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); + if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) + { + if (ride->excitement != RIDE_RATING_UNDEFINED) + { + disabled_widgets &= ~(1uLL << WIDX_SAVE_TRACK_DESIGN); + widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN; + } + } + } + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + } + + void MeasurementsOnDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + if (widgets[WIDX_SAVE_DESIGN].type == WindowWidgetType::Button) + { + Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; + + ScreenCoordsXY widgetCoords(windowPos.x + widget->width() / 2, windowPos.y + widget->top + 40); + DrawTextWrapped( + dpi, widgetCoords, width - 8, STR_CLICK_ITEMS_OF_SCENERY_TO_SELECT, {}, { TextAlignment::CENTRE }); + + widgetCoords.x = windowPos.x + 4; + widgetCoords.y = windowPos.y + widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17; + GfxFillRectInset( + dpi, { widgetCoords, { windowPos.x + 312, widgetCoords.y + 1 } }, colours[1], INSET_RECT_FLAG_BORDER_INSET); + } + else + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; + + if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) + { + // Excitement + StringId ratingName = GetRatingName(ride->excitement); + auto ft = Formatter(); + ft.Add(ride->excitement); + ft.Add(ratingName); + StringId stringId = !RideHasRatings(*ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE + : STR_EXCITEMENT_RATING; + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Intensity + ratingName = GetRatingName(ride->intensity); + ft = Formatter(); + ft.Add(ride->intensity); + ft.Add(ratingName); + + stringId = STR_INTENSITY_RATING; + if (!RideHasRatings(*ride)) + stringId = STR_INTENSITY_RATING_NOT_YET_AVAILABLE; + else if (ride->intensity >= RIDE_RATING(10, 00)) + stringId = STR_INTENSITY_RATING_RED; + + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Nausea + ratingName = GetRatingName(ride->nausea); + ft = Formatter(); + ft.Add(ride->nausea); + ft.Add(ratingName); + stringId = !RideHasRatings(*ride) ? STR_NAUSEA_RATING_NOT_YET_AVAILABLE : STR_NAUSEA_RATING; + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += 2 * LIST_ROW_HEIGHT; + + // Horizontal rule + GfxFillRectInset( + dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, colours[1], + INSET_RECT_FLAG_BORDER_INSET); + + if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_NO_RAW_STATS)) + { + if (ride->type == RIDE_TYPE_MINI_GOLF) + { + // Holes + ft = Formatter(); + ft.Add(ride->holes); + DrawTextBasic(dpi, screenCoords, STR_HOLES, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + else + { + // Max speed + ft = Formatter(); + ft.Add((ride->max_speed * 9) >> 18); + DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Average speed + ft = Formatter(); + ft.Add((ride->average_speed * 9) >> 18); + DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Ride time + ft = Formatter(); + int32_t numTimes = 0; + // TODO: STR_RIDE_TIME only takes up to 4 stations modify to take more + // also if modified may need to be split into multiple format strings + // as formatter cannot take more than 256 bytes + for (int32_t i = 0; i < std::min(ride->num_stations, 4); i++) + { + StationIndex stationIndex = StationIndex::FromUnderlying(numTimes); + auto time = ride->GetStation(stationIndex).SegmentTime; + if (time != 0) + { + ft.Add(STR_RIDE_TIME_ENTRY_WITH_SEPARATOR); + ft.Add(time); + numTimes++; + } + } + if (numTimes == 0) + { + ft.Add(STR_RIDE_TIME_ENTRY); + ft.Add(0); + numTimes++; + } + else + { + // sadly, STR_RIDE_TIME_ENTRY_WITH_SEPARATOR are defined with the separator AFTER an entry + // therefore we set the last entry to use the no-separator format now, post-format + ft.Rewind(); + ft.Increment((numTimes - 1) * 4); + ft.Add(STR_RIDE_TIME_ENTRY); + } + ft.Rewind(); + ft.Increment(numTimes * 4); + ft.Add(0); + ft.Add(0); + ft.Add(0); + ft.Add(0); + DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_TIME, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + // Ride length + ft = Formatter(); + int32_t numLengths = 0; + // TODO: see above STR_RIDE_LENGTH is also only able to display max 4 + for (int32_t i = 0; i < std::min(ride->num_stations, 4); i++) + { + StationIndex stationIndex = StationIndex::FromUnderlying(i); + auto length = ride->GetStation(stationIndex).SegmentLength; + if (length != 0) + { + length >>= 16; + ft.Add(STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR); + ft.Add(length & 0xFFFF); + numLengths++; + } + } + if (numLengths == 0) + { + ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(0); + numLengths++; + } + else + { + // sadly, STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR are defined with the separator AFTER an entry + // therefore we set the last entry to use the no-separator format now, post-format + ft.Rewind(); + ft.Increment((numLengths - 1) * 4); + ft.Add(STR_RIDE_LENGTH_ENTRY); + } + ft.Rewind(); + ft.Increment(numLengths * 4); + ft.Add(0); + ft.Add(0); + ft.Add(0); + ft.Add(0); + DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_LENGTH, ft); + + screenCoords.y += LIST_ROW_HEIGHT; + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) + { + // Max. positive vertical G's + stringId = STR_MAX_POSITIVE_VERTICAL_G; + + ft = Formatter(); + ft.Add(ride->max_positive_vertical_g); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Max. negative vertical G's + stringId = ride->max_negative_vertical_g <= RIDE_G_FORCES_RED_NEG_VERTICAL + ? STR_MAX_NEGATIVE_VERTICAL_G_RED + : STR_MAX_NEGATIVE_VERTICAL_G; + ft = Formatter(); + ft.Add(ride->max_negative_vertical_g); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Max lateral G's + stringId = ride->max_lateral_g > RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED + : STR_MAX_LATERAL_G; + ft = Formatter(); + ft.Add(ride->max_lateral_g); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Total 'air' time + ft = Formatter(); + ft.Add(ride->total_air_time * 3); + DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) + { + // Drops + auto drops = ride->drops & 0x3F; + ft = Formatter(); + ft.Add(drops); + DrawTextBasic(dpi, screenCoords, STR_DROPS, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Highest drop height + auto highestDropHeight = (ride->highest_drop_height * 3) / 4; + ft = Formatter(); + ft.Add(highestDropHeight); + DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + if (ride->type != RIDE_TYPE_MINI_GOLF) + { + // Inversions + if (ride->inversions != 0) + { + ft = Formatter(); + ft.Add(ride->inversions); + DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + } + } + } + else + { + DrawTextBasic(dpi, screenCoords, STR_NO_TEST_RESULTS_YET); } } } - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } +#pragma endregion - void MeasurementsOnDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); +#pragma region Graphs - if (widgets[WIDX_SAVE_DESIGN].type == WindowWidgetType::Button) + enum { - Widget* widget = &widgets[WIDX_PAGE_BACKGROUND]; + GRAPH_VELOCITY, + GRAPH_ALTITUDE, + GRAPH_VERTICAL, + GRAPH_LATERAL + }; - ScreenCoordsXY widgetCoords(windowPos.x + widget->width() / 2, windowPos.y + widget->top + 40); - DrawTextWrapped(dpi, widgetCoords, width - 8, STR_CLICK_ITEMS_OF_SCENERY_TO_SELECT, {}, { TextAlignment::CENTRE }); - - widgetCoords.x = windowPos.x + 4; - widgetCoords.y = windowPos.y + widgets[WIDX_SELECT_NEARBY_SCENERY].bottom + 17; - GfxFillRectInset( - dpi, { widgetCoords, { windowPos.x + 312, widgetCoords.y + 1 } }, colours[1], INSET_RECT_FLAG_BORDER_INSET); + void SetGraph(int32_t type) + { + if (list_information_type == type) + { + _autoScrollGraph = !_autoScrollGraph; + } + else + { + list_information_type = type; + } + Invalidate(); } - else + + void GraphsOnMouseUp(WidgetIndex widgetIndex) { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + } + } + + void GraphsResize() + { + WindowSetResize(*this, 316, 182, 500, 450); + } + + void GraphsOnMouseDown(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_GRAPH_VELOCITY: + SetGraph(GRAPH_VELOCITY); + break; + case WIDX_GRAPH_ALTITUDE: + SetGraph(GRAPH_ALTITUDE); + break; + case WIDX_GRAPH_VERTICAL: + SetGraph(GRAPH_VERTICAL); + break; + case WIDX_GRAPH_LATERAL: + SetGraph(GRAPH_LATERAL); + break; + } + } + + void GraphsUpdate() + { + Widget* widget; + int32_t x; + + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_8); + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_GRAPH); + + widget = &widgets[WIDX_GRAPH]; + x = scrolls[0].h_left; + if (_autoScrollGraph) + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + RideMeasurement* measurement{}; + std::tie(measurement, std::ignore) = ride->GetMeasurement(); + x = measurement == nullptr ? 0 : measurement->current_item - ((widget->width() / 4) * 3); + } + } + + scrolls[0].h_left = std::clamp(x, 0, scrolls[0].h_right - (widget->width() - 2)); + WidgetScrollUpdateThumbs(*this, WIDX_GRAPH); + } + + ScreenSize GraphsScrollGetSize(int32_t scrollIndex) + { + OnPrepareDraw(); + + ScreenSize size{}; + // Set minimum size + size.width = widgets[WIDX_GRAPH].width() - 2; + + // Get measurement size + auto ride = GetRide(rideId); + if (ride != nullptr) + { + RideMeasurement* measurement{}; + std::tie(measurement, std::ignore) = ride->GetMeasurement(); + if (measurement != nullptr) + { + size.width = std::max(size.width, measurement->num_items); + } + } + return size; + } + + void GraphsOnScrollSelect(int32_t scrollIndex, int32_t scrollAreaType) + { + _autoScrollGraph = false; + } + + OpenRCT2String GraphsTooltip(const WidgetIndex widgetIndex, const StringId fallback) + { + if (widgetIndex == WIDX_GRAPH) + { + auto ride = GetRide(rideId); + if (ride != nullptr) + { + auto [measurement, message] = ride->GetMeasurement(); + if (measurement != nullptr && (measurement->flags & RIDE_MEASUREMENT_FLAG_RUNNING)) + { + auto ft = Formatter(); + ft.Increment(2); + ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); + ft.Add(measurement->vehicle_index + 1); + return { fallback, ft }; + } + + return message; + } + } + else + { + return { STR_NONE, {} }; + } + return { fallback, {} }; + } + + void GraphsOnPrepareDraw() + { + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + // Set pressed graph button type + pressed_widgets &= ~(1uLL << WIDX_GRAPH_VELOCITY); + pressed_widgets &= ~(1uLL << WIDX_GRAPH_ALTITUDE); + pressed_widgets &= ~(1uLL << WIDX_GRAPH_VERTICAL); + pressed_widgets &= ~(1uLL << WIDX_GRAPH_LATERAL); + pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + list_information_type)); + + // Hide graph buttons that are not applicable + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) + { + widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Button; + widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Button; + } + else + { + widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Empty; + widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Empty; + } + + // Anchor graph widget + auto x = width - 4; + auto y = height - BUTTON_FACE_HEIGHT - 8; + + widgets[WIDX_GRAPH].right = x; + widgets[WIDX_GRAPH].bottom = y; + y += 3; + widgets[WIDX_GRAPH_VELOCITY].top = y; + widgets[WIDX_GRAPH_ALTITUDE].top = y; + widgets[WIDX_GRAPH_VERTICAL].top = y; + widgets[WIDX_GRAPH_LATERAL].top = y; + y += BUTTON_FACE_HEIGHT + 1; + widgets[WIDX_GRAPH_VELOCITY].bottom = y; + widgets[WIDX_GRAPH_ALTITUDE].bottom = y; + widgets[WIDX_GRAPH_VERTICAL].bottom = y; + widgets[WIDX_GRAPH_LATERAL].bottom = y; + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + } + + void GraphsOnDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + DrawTabImages(dpi); + } + + void GraphsOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) + { + GfxClear(&dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker); + + auto widget = &widgets[WIDX_GRAPH]; + auto ride = GetRide(rideId); + if (ride == nullptr) + { + return; + } + + auto [measurement, message] = ride->GetMeasurement(); + + if (measurement == nullptr) + { + // No measurement message + ScreenCoordsXY stringCoords(widget->width() / 2, widget->height() / 2 - 5); + int32_t txtWidth = widget->width() - 2; + DrawTextWrapped(dpi, stringCoords, txtWidth, message.str, message.args, { TextAlignment::CENTRE }); + return; + } + + // Vertical grid lines + const uint8_t lightColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_light; + const uint8_t darkColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_dark; + + int32_t time = 0; + for (int32_t x = 0; x < dpi.x + dpi.width; x += 80) + { + if (x + 80 >= dpi.x) + { + auto coord1 = ScreenCoordsXY{ x, dpi.y }; + auto coord2 = ScreenCoordsXY{ x, dpi.y + dpi.height - 1 }; + GfxFillRect(dpi, { coord1, coord2 }, lightColour); + GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour); + GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour); + GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour); + GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour); + } + time += 5; + } + + // Horizontal grid lines + int32_t listType = list_information_type; + int16_t yUnit = GraphsYAxisDetails[listType].unit; + StringId stringID = GraphsYAxisDetails[listType].label; + int16_t yUnitInterval = GraphsYAxisDetails[listType].unit_interval; + int16_t yInterval = GraphsYAxisDetails[listType].interval; + + // Scale modifier + if (listType == GRAPH_ALTITUDE) + { + yUnit -= kMapBaseZ * 3; + } + + for (int32_t y = widget->height() - 13; y >= 8; y -= yInterval, yUnit += yUnitInterval) + { + // Minor / major line + int32_t colour = yUnit == 0 ? lightColour : darkColour; + GfxFillRect(dpi, { { dpi.x, y }, { dpi.x + dpi.width - 1, y } }, colour); + + int16_t scaled_yUnit = yUnit; + // Scale modifier + if (listType == GRAPH_ALTITUDE) + scaled_yUnit /= 2; + + auto ft = Formatter(); + ft.Add(scaled_yUnit); + + DrawTextBasic(dpi, { scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small }); + } + + // Time marks + time = 0; + for (int32_t x = 0; x < dpi.x + dpi.width; x += 80) + { + auto ft = Formatter(); + ft.Add(time); + if (x + 80 >= dpi.x) + DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small }); + time += 5; + } + + // Plot + int32_t x = dpi.x; + int32_t firstPoint, secondPoint; + // Uses the force limits (used to draw extreme G's in red on measurement tab) to determine if line should be drawn + // red. + int32_t intensityThresholdPositive = 0; + int32_t intensityThresholdNegative = 0; + for (int32_t graphWidth = 0; graphWidth < dpi.width; graphWidth++, x++) + { + if (x < 0 || x >= measurement->num_items - 1) + continue; + + constexpr int32_t VerticalGraphHeightOffset = 39; + constexpr int32_t LateralGraphHeightOffset = 52; + + switch (listType) + { + case GRAPH_VELOCITY: + firstPoint = measurement->velocity[x] / 2; + secondPoint = measurement->velocity[x + 1] / 2; + break; + case GRAPH_ALTITUDE: + firstPoint = measurement->altitude[x]; + secondPoint = measurement->altitude[x + 1]; + break; + case GRAPH_VERTICAL: + firstPoint = measurement->vertical[x] + VerticalGraphHeightOffset; + secondPoint = measurement->vertical[x + 1] + VerticalGraphHeightOffset; + intensityThresholdNegative = (RIDE_G_FORCES_RED_NEG_VERTICAL / 8) + VerticalGraphHeightOffset; + break; + case GRAPH_LATERAL: + firstPoint = measurement->lateral[x] + LateralGraphHeightOffset; + secondPoint = measurement->lateral[x + 1] + LateralGraphHeightOffset; + intensityThresholdPositive = (RIDE_G_FORCES_RED_LATERAL / 8) + LateralGraphHeightOffset; + intensityThresholdNegative = -(RIDE_G_FORCES_RED_LATERAL / 8) + LateralGraphHeightOffset; + break; + default: + LOG_ERROR("Wrong graph type %d", listType); + firstPoint = secondPoint = 0; + break; + } + + // Adjust line to match graph widget position. + firstPoint = widget->height() - firstPoint - 13; + secondPoint = widget->height() - secondPoint - 13; + if (firstPoint > secondPoint) + { + std::swap(firstPoint, secondPoint); + } + + // Adjust threshold line position as well + if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL) + { + intensityThresholdPositive = widget->height() - intensityThresholdPositive - 13; + intensityThresholdNegative = widget->height() - intensityThresholdNegative - 13; + } + + const bool previousMeasurement = x > measurement->current_item; + + // Draw the current line in grey. + GfxFillRect( + dpi, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PALETTE_INDEX_17 : PALETTE_INDEX_21); + + // Draw red over extreme values (if supported by graph type). + if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL) + { + const auto redLineColour = previousMeasurement ? PALETTE_INDEX_171 : PALETTE_INDEX_173; + + // Line exceeds negative threshold (at bottom of graph). + if (secondPoint >= intensityThresholdNegative) + { + const auto redLineTop = ScreenCoordsXY{ x, std::max(firstPoint, intensityThresholdNegative) }; + const auto redLineBottom = ScreenCoordsXY{ x, std::max(secondPoint, intensityThresholdNegative) }; + GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour); + } + + // Line exceeds positive threshold (at top of graph). + if (listType == GRAPH_LATERAL && firstPoint < intensityThresholdPositive) + { + const auto redLineTop = ScreenCoordsXY{ x, std::min(firstPoint, intensityThresholdPositive) }; + const auto redLineBottom = ScreenCoordsXY{ x, std::min(secondPoint, intensityThresholdPositive) }; + GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour); + } + } + } + } + +#pragma endregion + +#pragma region Income + + static void UpdateSamePriceThroughoutFlags(ShopItem shop_item) + { + const auto& gameState = GetGameState(); + const auto existingFlags = gameState.SamePriceThroughoutPark; + + auto newFlags = existingFlags; + if (GetShopItemDescriptor(shop_item).IsPhoto()) + { + if (existingFlags & EnumToFlag(shop_item)) + newFlags &= ~EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); + else + newFlags |= EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); + } + else + { + newFlags ^= EnumToFlag(shop_item); + } + + auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); + GameActions::Execute(&parkSetParameter); + } + + void IncomeTogglePrimaryPrice() + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + ShopItem shopItem; + const auto& rtd = ride->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) + { + shopItem = ShopItem::Admission; + } + else + { + auto rideEntry = GetRideEntryByIndex(ride->subtype); + if (rideEntry != nullptr) + { + shopItem = rideEntry->shop_item[0]; + if (shopItem == ShopItem::None) + return; + } + else + { + return; + } + } + + UpdateSamePriceThroughoutFlags(shopItem); + + auto rideSetPriceAction = RideSetPriceAction(rideId, ride->price[0], true); + GameActions::Execute(&rideSetPriceAction); + } + + void IncomeToggleSecondaryPrice() + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = GetRideEntryByIndex(ride->subtype); + if (rideEntry == nullptr) + return; + + auto shop_item = rideEntry->shop_item[1]; + if (shop_item == ShopItem::None) + shop_item = ride->GetRideTypeDescriptor().PhotoItem; + + UpdateSamePriceThroughoutFlags(shop_item); + + auto rideSetPriceAction = RideSetPriceAction(rideId, ride->price[1], false); + GameActions::Execute(&rideSetPriceAction); + } + + void IncomeSetPrimaryPrice(money64 price) + { + auto rideSetPriceAction = RideSetPriceAction(rideId, price, true); + GameActions::Execute(&rideSetPriceAction); + } + + void IncomeIncreasePrimaryPrice() + { + if (!IncomeCanModifyPrimaryPrice()) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto price = ride->price[0]; + if (price < 20.00_GBP) + price++; + + IncomeSetPrimaryPrice(price); + } + + void IncomeDecreasePrimaryPrice() + { + if (!IncomeCanModifyPrimaryPrice()) + return; + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto price = ride->price[0]; + if (price > 0.00_GBP) + price--; + + IncomeSetPrimaryPrice(price); + } + + money64 IncomeGetSecondaryPrice() + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return 0; + + return ride->price[1]; + } + + void IncomeSetSecondaryPrice(money64 price) + { + auto rideSetPriceAction = RideSetPriceAction(rideId, price, false); + GameActions::Execute(&rideSetPriceAction); + } + + bool IncomeCanModifyPrimaryPrice() + { + auto ride = GetRide(rideId); + if (ride == nullptr) + return false; + + auto rideEntry = ride->GetRideEntry(); + const auto& rtd = ride->GetRideTypeDescriptor(); + return ParkRidePricesUnlocked() || rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) + || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::None); + } + + void IncomeIncreaseSecondaryPrice() + { + auto price = IncomeGetSecondaryPrice(); + + if (price < 20.00_GBP) + price++; + + IncomeSetSecondaryPrice(price); + } + + void IncomeDecreaseSecondaryPrice() + { + auto price = IncomeGetSecondaryPrice(); + + if (price > 0.00_GBP) + price--; + + IncomeSetSecondaryPrice(price); + } + + void IncomeOnMouseUp(WidgetIndex widgetIndex) + { + utf8 _moneyInputText[MONEY_STRING_MAXLENGTH] = {}; + + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_PRIMARY_PRICE: + { + if (!IncomeCanModifyPrimaryPrice()) + return; + + auto ride = GetRide(rideId); + if (ride != nullptr) + { + MoneyToString(ride->price[0], _moneyInputText, MONEY_STRING_MAXLENGTH, true); + WindowTextInputRawOpen( + this, WIDX_PRIMARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneyInputText, + MONEY_STRING_MAXLENGTH); + } + break; + } + case WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK: + IncomeTogglePrimaryPrice(); + break; + case WIDX_SECONDARY_PRICE: + { + auto price64 = IncomeGetSecondaryPrice(); + + MoneyToString(price64, _moneyInputText, MONEY_STRING_MAXLENGTH, true); + WindowTextInputRawOpen( + this, WIDX_SECONDARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneyInputText, + MONEY_STRING_MAXLENGTH); + } + break; + case WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK: + IncomeToggleSecondaryPrice(); + break; + } + } + + void IncomeResize() + { + WindowSetResize(*this, 316, 194, 316, 194); + } + + void IncomeOnMouseDown(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_PRIMARY_PRICE_INCREASE: + IncomeIncreasePrimaryPrice(); + break; + case WIDX_PRIMARY_PRICE_DECREASE: + IncomeDecreasePrimaryPrice(); + break; + case WIDX_SECONDARY_PRICE_INCREASE: + IncomeIncreaseSecondaryPrice(); + break; + case WIDX_SECONDARY_PRICE_DECREASE: + IncomeDecreaseSecondaryPrice(); + break; + } + } + + void IncomeUpdate() + { + frame_no++; + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_9); + + auto ride = GetRide(rideId); + if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) + { + ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_INCOME; + Invalidate(); + } + } + + void IncomeOnTextInput(WidgetIndex widgetIndex, std::string_view text) + { + if ((widgetIndex != WIDX_PRIMARY_PRICE && widgetIndex != WIDX_SECONDARY_PRICE) || text.empty()) + return; + + std::string strText{ text }; + money64 price = StringToMoney(strText.c_str()); + if (price == kMoney64Undefined) + { + return; + } + + price = std::clamp(price, 0.00_GBP, 20.00_GBP); + + if (widgetIndex == WIDX_PRIMARY_PRICE) + { + IncomeSetPrimaryPrice(price); + } + else + { + IncomeSetSecondaryPrice(price); + } + } + + void IncomeOnPrepareDraw() + { + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + widgets[WIDX_TITLE].text = STR_ARG_18_STRINGID; + + auto ft = Formatter::Common(); + ft.Increment(18); + ride->FormatNameTo(ft); + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + // Primary item + 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; + + // 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(); + if (!ParkRidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None + && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) + { + disabled_widgets |= (1uLL << WIDX_PRIMARY_PRICE); + widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; + widgets[WIDX_PRIMARY_PRICE].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; + } + + widgets[WIDX_PRIMARY_PRICE_LABEL].text = STR_RIDE_INCOME_ADMISSION_PRICE; + widgets[WIDX_SECONDARY_PRICE_LABEL].text = STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO; + widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Empty; + + widgets[WIDX_PRIMARY_PRICE].text = STR_BOTTOM_TOOLBAR_CASH; + auto ridePrimaryPrice = RideGetPrice(*ride); + ft.Rewind(); + ft.Add(ridePrimaryPrice); + if (ridePrimaryPrice == 0) + widgets[WIDX_PRIMARY_PRICE].text = STR_FREE; + + ShopItem primaryItem = ShopItem::Admission; + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) || ((primaryItem = rideEntry->shop_item[0]) != ShopItem::None)) + { + widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Checkbox; + + if (ShopItemHasCommonPrice(primaryItem)) + pressed_widgets |= (1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); + + widgets[WIDX_PRIMARY_PRICE_LABEL].text = GetShopItemDescriptor(primaryItem).Naming.PriceLabel; + } + + // Get secondary item + auto secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; + if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) + { + if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::None) + { + widgets[WIDX_SECONDARY_PRICE_LABEL].text = GetShopItemDescriptor(secondaryItem).Naming.PriceLabel; + } + } + + if (secondaryItem == ShopItem::None) + { + // Hide secondary item widgets + widgets[WIDX_SECONDARY_PRICE_LABEL].type = WindowWidgetType::Empty; + widgets[WIDX_SECONDARY_PRICE].type = WindowWidgetType::Empty; + widgets[WIDX_SECONDARY_PRICE_INCREASE].type = WindowWidgetType::Empty; + widgets[WIDX_SECONDARY_PRICE_DECREASE].type = WindowWidgetType::Empty; + widgets[WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Empty; + } + else + { + // Set same price throughout park checkbox + pressed_widgets &= ~(1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); + if (ShopItemHasCommonPrice(secondaryItem)) + pressed_widgets |= (1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); + + // Show widgets + widgets[WIDX_SECONDARY_PRICE_LABEL].type = WindowWidgetType::Label; + widgets[WIDX_SECONDARY_PRICE].type = WindowWidgetType::Spinner; + widgets[WIDX_SECONDARY_PRICE_INCREASE].type = WindowWidgetType::Button; + widgets[WIDX_SECONDARY_PRICE_DECREASE].type = WindowWidgetType::Button; + widgets[WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Checkbox; + + // Set secondary item price + widgets[WIDX_SECONDARY_PRICE].text = STR_RIDE_SECONDARY_PRICE_VALUE; + ft.Rewind(); + ft.Increment(10); + ft.Add(ride->price[1]); + if (ride->price[1] == 0) + widgets[WIDX_SECONDARY_PRICE].text = STR_FREE; + } + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + } + + void IncomeOnDraw(DrawPixelInfo& dpi) + { + StringId stringId; + money64 profit; + ShopItem primaryItem, secondaryItem; + + DrawWidgets(dpi); + DrawTabImages(dpi); + + auto ride = GetRide(rideId); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + auto screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 33 }; + + // Primary item profit / loss per item sold + primaryItem = rideEntry->shop_item[0]; + if (primaryItem != ShopItem::None) + { + profit = ride->price[0]; + + stringId = STR_PROFIT_PER_ITEM_SOLD; + profit -= GetShopItemDescriptor(primaryItem).Cost; + if (profit < 0) + { + profit *= -1; + stringId = STR_LOSS_PER_ITEM_SOLD; + } + + auto ft = Formatter(); + ft.Add(profit); + + DrawTextBasic(dpi, screenCoords, stringId, ft); + } + screenCoords.y += 44; + + // Secondary item profit / loss per item sold + secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; + if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) + secondaryItem = rideEntry->shop_item[1]; + + if (secondaryItem != ShopItem::None) + { + profit = ride->price[1]; + + stringId = STR_PROFIT_PER_ITEM_SOLD; + profit -= GetShopItemDescriptor(secondaryItem).Cost; + if (profit < 0) + { + profit *= -1; + stringId = STR_LOSS_PER_ITEM_SOLD; + } + + auto ft = Formatter(); + ft.Add(profit); + + DrawTextBasic(dpi, screenCoords, stringId, ft); + } + screenCoords.y += 18; + + // Income per hour + if (ride->income_per_hour != kMoney64Undefined) + { + auto ft = Formatter(); + ft.Add(ride->income_per_hour); + + DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + // Running cost per hour + money64 costPerHour = ride->upkeep_cost * 16; + stringId = ride->upkeep_cost == kMoney64Undefined ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; + auto ft = Formatter(); + ft.Add(costPerHour); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Profit per hour + if (ride->profit != kMoney64Undefined) + { + ft = Formatter(); + ft.Add(ride->profit); + DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + screenCoords.y += 5; + + // Total profit + ft = Formatter(); + ft.Add(ride->total_profit); + DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft); + } + +#pragma endregion + +#pragma region Customer + + void CustomerOnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + case WIDX_TAB_4: + case WIDX_TAB_5: + case WIDX_TAB_6: + case WIDX_TAB_7: + case WIDX_TAB_8: + case WIDX_TAB_9: + case WIDX_TAB_10: + SetPage(widgetIndex - WIDX_TAB_1); + break; + case WIDX_SHOW_GUESTS_THOUGHTS: + { + auto intent = Intent(WindowClass::GuestList); + intent.PutExtra( + INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsThinkingAboutRide)); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, number); + ContextOpenIntent(&intent); + break; + } + case WIDX_SHOW_GUESTS_ON_RIDE: + { + auto intent = Intent(WindowClass::GuestList); + intent.PutExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsOnRide)); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, number); + ContextOpenIntent(&intent); + break; + } + case WIDX_SHOW_GUESTS_QUEUING: + { + auto intent = Intent(WindowClass::GuestList); + intent.PutExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsInQueue)); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, number); + ContextOpenIntent(&intent); + break; + } + } + } + + void CustomerResize() + { + flags |= WF_RESIZABLE; + WindowSetResize(*this, 316, 163, 316, 163); + } + + void CustomerUpdate() + { + picked_peep_frame++; + if (picked_peep_frame >= 24) + picked_peep_frame = 0; + + OnPrepareDraw(); + WidgetInvalidate(*this, WIDX_TAB_10); + + auto ride = GetRide(rideId); + if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) + { + ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; + Invalidate(); + } + } + + void CustomerOnPrepareDraw() + { + auto newWidgets = PageWidgets[page]; + if (widgets != newWidgets) + { + widgets = newWidgets; + InitScrollWidgets(); + } + + SetPressedTab(); + + auto ride = GetRide(rideId); + if (ride != nullptr) + { + auto ft = Formatter::Common(); + ride->FormatNameTo(ft); + + widgets[WIDX_SHOW_GUESTS_THOUGHTS].type = WindowWidgetType::FlatBtn; + if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) + { + widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::Empty; + widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::FlatBtn; + widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::FlatBtn; + } + + AnchorBorderWidgets(); + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); + } + } + + void CustomerOnDraw(DrawPixelInfo& dpi) + { + ShopItem shopItem; + int16_t popularity, satisfaction, queueTime; + StringId stringId; + + DrawWidgets(dpi); + DrawTabImages(dpi); + auto ride = GetRide(rideId); if (ride == nullptr) return; @@ -5307,1485 +6545,181 @@ private: auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) + // Customers currently on ride + if (ride->IsRide()) { - // Excitement - StringId ratingName = GetRatingName(ride->excitement); auto ft = Formatter(); - ft.Add(ride->excitement); - ft.Add(ratingName); - StringId stringId = !RideHasRatings(*ride) ? STR_EXCITEMENT_RATING_NOT_YET_AVAILABLE : STR_EXCITEMENT_RATING; - DrawTextBasic(dpi, screenCoords, stringId, ft); + ft.Add(ride->num_riders); + DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); screenCoords.y += LIST_ROW_HEIGHT; + } - // Intensity - ratingName = GetRatingName(ride->intensity); - ft = Formatter(); - ft.Add(ride->intensity); - ft.Add(ratingName); + // Customers per hour + auto ft = Formatter(); + ft.Add(RideCustomersPerHour(*ride)); + DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft); + screenCoords.y += LIST_ROW_HEIGHT; - stringId = STR_INTENSITY_RATING; - if (!RideHasRatings(*ride)) - stringId = STR_INTENSITY_RATING_NOT_YET_AVAILABLE; - else if (ride->intensity >= RIDE_RATING(10, 00)) - stringId = STR_INTENSITY_RATING_RED; - - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Nausea - ratingName = GetRatingName(ride->nausea); - ft = Formatter(); - ft.Add(ride->nausea); - ft.Add(ratingName); - stringId = !RideHasRatings(*ride) ? STR_NAUSEA_RATING_NOT_YET_AVAILABLE : STR_NAUSEA_RATING; - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += 2 * LIST_ROW_HEIGHT; - - // Horizontal rule - GfxFillRectInset( - dpi, { screenCoords - ScreenCoordsXY{ 0, 6 }, screenCoords + ScreenCoordsXY{ 303, -5 } }, colours[1], - INSET_RECT_FLAG_BORDER_INSET); - - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_NO_RAW_STATS)) - { - if (ride->type == RIDE_TYPE_MINI_GOLF) - { - // Holes - ft = Formatter(); - ft.Add(ride->holes); - DrawTextBasic(dpi, screenCoords, STR_HOLES, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - else - { - // Max speed - ft = Formatter(); - ft.Add((ride->max_speed * 9) >> 18); - DrawTextBasic(dpi, screenCoords, STR_MAX_SPEED, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Average speed - ft = Formatter(); - ft.Add((ride->average_speed * 9) >> 18); - DrawTextBasic(dpi, screenCoords, STR_AVERAGE_SPEED, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Ride time - ft = Formatter(); - int32_t numTimes = 0; - // TODO: STR_RIDE_TIME only takes up to 4 stations modify to take more - // also if modified may need to be split into multiple format strings - // as formatter cannot take more than 256 bytes - for (int32_t i = 0; i < std::min(ride->num_stations, 4); i++) - { - StationIndex stationIndex = StationIndex::FromUnderlying(numTimes); - auto time = ride->GetStation(stationIndex).SegmentTime; - if (time != 0) - { - ft.Add(STR_RIDE_TIME_ENTRY_WITH_SEPARATOR); - ft.Add(time); - numTimes++; - } - } - if (numTimes == 0) - { - ft.Add(STR_RIDE_TIME_ENTRY); - ft.Add(0); - numTimes++; - } - else - { - // sadly, STR_RIDE_TIME_ENTRY_WITH_SEPARATOR are defined with the separator AFTER an entry - // therefore we set the last entry to use the no-separator format now, post-format - ft.Rewind(); - ft.Increment((numTimes - 1) * 4); - ft.Add(STR_RIDE_TIME_ENTRY); - } - ft.Rewind(); - ft.Increment(numTimes * 4); - ft.Add(0); - ft.Add(0); - ft.Add(0); - ft.Add(0); - DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_TIME, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - // Ride length - ft = Formatter(); - int32_t numLengths = 0; - // TODO: see above STR_RIDE_LENGTH is also only able to display max 4 - for (int32_t i = 0; i < std::min(ride->num_stations, 4); i++) - { - StationIndex stationIndex = StationIndex::FromUnderlying(i); - auto length = ride->GetStation(stationIndex).SegmentLength; - if (length != 0) - { - length >>= 16; - ft.Add(STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR); - ft.Add(length & 0xFFFF); - numLengths++; - } - } - if (numLengths == 0) - { - ft.Add(STR_RIDE_LENGTH_ENTRY); - ft.Add(0); - numLengths++; - } - else - { - // sadly, STR_RIDE_LENGTH_ENTRY_WITH_SEPARATOR are defined with the separator AFTER an entry - // therefore we set the last entry to use the no-separator format now, post-format - ft.Rewind(); - ft.Increment((numLengths - 1) * 4); - ft.Add(STR_RIDE_LENGTH_ENTRY); - } - ft.Rewind(); - ft.Increment(numLengths * 4); - ft.Add(0); - ft.Add(0); - ft.Add(0); - ft.Add(0); - DrawTextEllipsised(dpi, screenCoords, 308, STR_RIDE_LENGTH, ft); - - screenCoords.y += LIST_ROW_HEIGHT; - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) - { - // Max. positive vertical G's - stringId = STR_MAX_POSITIVE_VERTICAL_G; - - ft = Formatter(); - ft.Add(ride->max_positive_vertical_g); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Max. negative vertical G's - stringId = ride->max_negative_vertical_g <= RIDE_G_FORCES_RED_NEG_VERTICAL - ? STR_MAX_NEGATIVE_VERTICAL_G_RED - : STR_MAX_NEGATIVE_VERTICAL_G; - ft = Formatter(); - ft.Add(ride->max_negative_vertical_g); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Max lateral G's - stringId = ride->max_lateral_g > RIDE_G_FORCES_RED_LATERAL ? STR_MAX_LATERAL_G_RED : STR_MAX_LATERAL_G; - ft = Formatter(); - ft.Add(ride->max_lateral_g); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Total 'air' time - ft = Formatter(); - ft.Add(ride->total_air_time * 3); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_AIR_TIME, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) - { - // Drops - auto drops = ride->drops & 0x3F; - ft = Formatter(); - ft.Add(drops); - DrawTextBasic(dpi, screenCoords, STR_DROPS, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Highest drop height - auto highestDropHeight = (ride->highest_drop_height * 3) / 4; - ft = Formatter(); - ft.Add(highestDropHeight); - DrawTextBasic(dpi, screenCoords, STR_HIGHEST_DROP_HEIGHT, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - if (ride->type != RIDE_TYPE_MINI_GOLF) - { - // Inversions - if (ride->inversions != 0) - { - ft = Formatter(); - ft.Add(ride->inversions); - DrawTextBasic(dpi, screenCoords, STR_INVERSIONS, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - } - } + // Popularity + popularity = ride->popularity; + if (popularity == 255) + { + stringId = STR_POPULARITY_UNKNOWN; } else { - DrawTextBasic(dpi, screenCoords, STR_NO_TEST_RESULTS_YET); + stringId = STR_POPULARITY_PERCENT; + popularity *= 4; } + ft = Formatter(); + ft.Add(popularity); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Satisfaction + satisfaction = ride->satisfaction; + if (satisfaction == 255) + { + stringId = STR_SATISFACTION_UNKNOWN; + } + else + { + stringId = STR_SATISFACTION_PERCENT; + satisfaction *= 5; + } + ft = Formatter(); + ft.Add(satisfaction); + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Queue time + if (ride->IsRide()) + { + queueTime = ride->GetMaxQueueTime(); + stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES; + ft = Formatter(); + ft.Add(queueTime); + screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT }); + screenCoords.y += 5; + } + + // Primary shop items sold + shopItem = ride->GetRideEntry()->shop_item[0]; + if (shopItem != ShopItem::None) + { + ft = Formatter(); + ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); + ft.Add(ride->no_primary_items_sold); + DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + // Secondary shop items sold / on-ride photos sold + shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->GetRideTypeDescriptor().PhotoItem + : ride->GetRideEntry()->shop_item[1]; + if (shopItem != ShopItem::None) + { + ft = Formatter(); + ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); + ft.Add(ride->no_secondary_items_sold); + DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + + // Total customers + ft = Formatter(); + ft.Add(ride->total_customers); + DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + // Guests favourite + if (ride->IsRide()) + { + ft = Formatter(); + ft.Add(ride->guests_favourite); + stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; + DrawTextBasic(dpi, screenCoords, stringId, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } + screenCoords.y += 2; + + // Age + // If the ride has a build date that is in the future, show it as built this year. + int16_t age = std::max(DateGetYear(ride->GetAge()), 0); + stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO; + ft = Formatter(); + ft.Add(age); + DrawTextBasic(dpi, screenCoords, stringId, ft); } - } #pragma endregion - -#pragma region Graphs - - enum - { - GRAPH_VELOCITY, - GRAPH_ALTITUDE, - GRAPH_VERTICAL, - GRAPH_LATERAL }; - void SetGraph(int32_t type) + /** + * + * rct2: 0x006AEAB4 + */ + static RideWindow* WindowRideOpen(const Ride& ride) { - if (list_information_type == type) - { - _autoScrollGraph = !_autoScrollGraph; - } - else - { - list_information_type = type; - } - Invalidate(); + return WindowCreate(WindowClass::Ride, 316, 207, WF_10 | WF_RESIZABLE, ride); } - void GraphsOnMouseUp(WidgetIndex widgetIndex) + /** + * + * rct2: 0x006ACC28 + */ + WindowBase* WindowRideMainOpen(const Ride& ride) { - switch (widgetIndex) + if (ride.type >= RIDE_TYPE_COUNT) { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; + return nullptr; } - } - void GraphsResize() - { - WindowSetResize(*this, 316, 182, 500, 450); - } - - void GraphsOnMouseDown(WidgetIndex widgetIndex) - { - switch (widgetIndex) + RideWindow* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); + if (w == nullptr) { - case WIDX_GRAPH_VELOCITY: - SetGraph(GRAPH_VELOCITY); - break; - case WIDX_GRAPH_ALTITUDE: - SetGraph(GRAPH_ALTITUDE); - break; - case WIDX_GRAPH_VERTICAL: - SetGraph(GRAPH_VERTICAL); - break; - case WIDX_GRAPH_LATERAL: - SetGraph(GRAPH_LATERAL); - break; + w = WindowRideOpen(ride); + w->SetViewIndex(0); } - } - - void GraphsUpdate() - { - Widget* widget; - int32_t x; - - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_8); - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_GRAPH); - - widget = &widgets[WIDX_GRAPH]; - x = scrolls[0].h_left; - if (_autoScrollGraph) + else if (w->GetViewIndex() >= (1 + ride.NumTrains + ride.num_stations)) { - auto ride = GetRide(rideId); - if (ride != nullptr) + w->SetViewIndex(0); + } + + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + { + if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number) { - RideMeasurement* measurement{}; - std::tie(measurement, std::ignore) = ride->GetMeasurement(); - x = measurement == nullptr ? 0 : measurement->current_item - ((widget->width() / 4) * 3); + ToolCancel(); } } - scrolls[0].h_left = std::clamp(x, 0, scrolls[0].h_right - (widget->width() - 2)); - WidgetScrollUpdateThumbs(*this, WIDX_GRAPH); + if (w->page != WINDOW_RIDE_PAGE_MAIN) + { + w->SetPage(WINDOW_RIDE_PAGE_MAIN); + } + + w->OnViewportRotate(); + return w; } - ScreenSize GraphsScrollGetSize(int32_t scrollIndex) + /** + * + * rct2: 0x006ACCCE + */ + static WindowBase* WindowRideOpenStation(const Ride& ride, StationIndex stationIndex) { - OnPrepareDraw(); + if (ride.type >= RIDE_TYPE_COUNT) + return nullptr; - ScreenSize size{}; - // Set minimum size - size.width = widgets[WIDX_GRAPH].width() - 2; + if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) + return WindowRideMainOpen(ride); - // Get measurement size - auto ride = GetRide(rideId); - if (ride != nullptr) + auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); + if (w == nullptr) { - RideMeasurement* measurement{}; - std::tie(measurement, std::ignore) = ride->GetMeasurement(); - if (measurement != nullptr) - { - size.width = std::max(size.width, measurement->num_items); - } + w = WindowRideOpen(ride); } - return size; - } - - void GraphsOnScrollSelect(int32_t scrollIndex, int32_t scrollAreaType) - { - _autoScrollGraph = false; - } - - OpenRCT2String GraphsTooltip(const WidgetIndex widgetIndex, const StringId fallback) - { - if (widgetIndex == WIDX_GRAPH) - { - auto ride = GetRide(rideId); - if (ride != nullptr) - { - auto [measurement, message] = ride->GetMeasurement(); - if (measurement != nullptr && (measurement->flags & RIDE_MEASUREMENT_FLAG_RUNNING)) - { - auto ft = Formatter(); - ft.Increment(2); - ft.Add(GetRideComponentName(ride->GetRideTypeDescriptor().NameConvention.vehicle).number); - ft.Add(measurement->vehicle_index + 1); - return { fallback, ft }; - } - - return message; - } - } - else - { - return { STR_NONE, {} }; - } - return { fallback, {} }; - } - - void GraphsOnPrepareDraw() - { - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - // Set pressed graph button type - pressed_widgets &= ~(1uLL << WIDX_GRAPH_VELOCITY); - pressed_widgets &= ~(1uLL << WIDX_GRAPH_ALTITUDE); - pressed_widgets &= ~(1uLL << WIDX_GRAPH_VERTICAL); - pressed_widgets &= ~(1uLL << WIDX_GRAPH_LATERAL); - pressed_widgets |= (1LL << (WIDX_GRAPH_VELOCITY + list_information_type)); - - // Hide graph buttons that are not applicable - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) - { - widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Button; - widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Button; - } - else - { - widgets[WIDX_GRAPH_VERTICAL].type = WindowWidgetType::Empty; - widgets[WIDX_GRAPH_LATERAL].type = WindowWidgetType::Empty; - } - - // Anchor graph widget - auto x = width - 4; - auto y = height - BUTTON_FACE_HEIGHT - 8; - - widgets[WIDX_GRAPH].right = x; - widgets[WIDX_GRAPH].bottom = y; - y += 3; - widgets[WIDX_GRAPH_VELOCITY].top = y; - widgets[WIDX_GRAPH_ALTITUDE].top = y; - widgets[WIDX_GRAPH_VERTICAL].top = y; - widgets[WIDX_GRAPH_LATERAL].top = y; - y += BUTTON_FACE_HEIGHT + 1; - widgets[WIDX_GRAPH_VELOCITY].bottom = y; - widgets[WIDX_GRAPH_ALTITUDE].bottom = y; - widgets[WIDX_GRAPH_VERTICAL].bottom = y; - widgets[WIDX_GRAPH_LATERAL].bottom = y; - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } - - void GraphsOnDraw(DrawPixelInfo& dpi) - { - DrawWidgets(dpi); - DrawTabImages(dpi); - } - - void GraphsOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) - { - GfxClear(&dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker); - - auto widget = &widgets[WIDX_GRAPH]; - auto ride = GetRide(rideId); - if (ride == nullptr) - { - return; - } - - auto [measurement, message] = ride->GetMeasurement(); - - if (measurement == nullptr) - { - // No measurement message - ScreenCoordsXY stringCoords(widget->width() / 2, widget->height() / 2 - 5); - int32_t txtWidth = widget->width() - 2; - DrawTextWrapped(dpi, stringCoords, txtWidth, message.str, message.args, { TextAlignment::CENTRE }); - return; - } - - // Vertical grid lines - const uint8_t lightColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_light; - const uint8_t darkColour = ColourMapA[COLOUR_SATURATED_GREEN].mid_dark; - - int32_t time = 0; - for (int32_t x = 0; x < dpi.x + dpi.width; x += 80) - { - if (x + 80 >= dpi.x) - { - auto coord1 = ScreenCoordsXY{ x, dpi.y }; - auto coord2 = ScreenCoordsXY{ x, dpi.y + dpi.height - 1 }; - GfxFillRect(dpi, { coord1, coord2 }, lightColour); - GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 16, 0 }, coord2 + ScreenCoordsXY{ 16, 0 } }, darkColour); - GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 32, 0 }, coord2 + ScreenCoordsXY{ 32, 0 } }, darkColour); - GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 48, 0 }, coord2 + ScreenCoordsXY{ 48, 0 } }, darkColour); - GfxFillRect(dpi, { coord1 + ScreenCoordsXY{ 64, 0 }, coord2 + ScreenCoordsXY{ 64, 0 } }, darkColour); - } - time += 5; - } - - // Horizontal grid lines - int32_t listType = list_information_type; - int16_t yUnit = GraphsYAxisDetails[listType].unit; - StringId stringID = GraphsYAxisDetails[listType].label; - int16_t yUnitInterval = GraphsYAxisDetails[listType].unit_interval; - int16_t yInterval = GraphsYAxisDetails[listType].interval; - - // Scale modifier - if (listType == GRAPH_ALTITUDE) - { - yUnit -= kMapBaseZ * 3; - } - - for (int32_t y = widget->height() - 13; y >= 8; y -= yInterval, yUnit += yUnitInterval) - { - // Minor / major line - int32_t colour = yUnit == 0 ? lightColour : darkColour; - GfxFillRect(dpi, { { dpi.x, y }, { dpi.x + dpi.width - 1, y } }, colour); - - int16_t scaled_yUnit = yUnit; - // Scale modifier - if (listType == GRAPH_ALTITUDE) - scaled_yUnit /= 2; - - auto ft = Formatter(); - ft.Add(scaled_yUnit); - - DrawTextBasic(dpi, { scrolls[0].h_left + 1, y - 4 }, stringID, ft, { FontStyle::Small }); - } - - // Time marks - time = 0; - for (int32_t x = 0; x < dpi.x + dpi.width; x += 80) - { - auto ft = Formatter(); - ft.Add(time); - if (x + 80 >= dpi.x) - DrawTextBasic(dpi, { x + 2, 1 }, STR_RIDE_STATS_TIME, ft, { FontStyle::Small }); - time += 5; - } - - // Plot - int32_t x = dpi.x; - int32_t firstPoint, secondPoint; - // Uses the force limits (used to draw extreme G's in red on measurement tab) to determine if line should be drawn red. - int32_t intensityThresholdPositive = 0; - int32_t intensityThresholdNegative = 0; - for (int32_t graphWidth = 0; graphWidth < dpi.width; graphWidth++, x++) - { - if (x < 0 || x >= measurement->num_items - 1) - continue; - - constexpr int32_t VerticalGraphHeightOffset = 39; - constexpr int32_t LateralGraphHeightOffset = 52; - - switch (listType) - { - case GRAPH_VELOCITY: - firstPoint = measurement->velocity[x] / 2; - secondPoint = measurement->velocity[x + 1] / 2; - break; - case GRAPH_ALTITUDE: - firstPoint = measurement->altitude[x]; - secondPoint = measurement->altitude[x + 1]; - break; - case GRAPH_VERTICAL: - firstPoint = measurement->vertical[x] + VerticalGraphHeightOffset; - secondPoint = measurement->vertical[x + 1] + VerticalGraphHeightOffset; - intensityThresholdNegative = (RIDE_G_FORCES_RED_NEG_VERTICAL / 8) + VerticalGraphHeightOffset; - break; - case GRAPH_LATERAL: - firstPoint = measurement->lateral[x] + LateralGraphHeightOffset; - secondPoint = measurement->lateral[x + 1] + LateralGraphHeightOffset; - intensityThresholdPositive = (RIDE_G_FORCES_RED_LATERAL / 8) + LateralGraphHeightOffset; - intensityThresholdNegative = -(RIDE_G_FORCES_RED_LATERAL / 8) + LateralGraphHeightOffset; - break; - default: - LOG_ERROR("Wrong graph type %d", listType); - firstPoint = secondPoint = 0; - break; - } - - // Adjust line to match graph widget position. - firstPoint = widget->height() - firstPoint - 13; - secondPoint = widget->height() - secondPoint - 13; - if (firstPoint > secondPoint) - { - std::swap(firstPoint, secondPoint); - } - - // Adjust threshold line position as well - if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL) - { - intensityThresholdPositive = widget->height() - intensityThresholdPositive - 13; - intensityThresholdNegative = widget->height() - intensityThresholdNegative - 13; - } - - const bool previousMeasurement = x > measurement->current_item; - - // Draw the current line in grey. - GfxFillRect( - dpi, { { x, firstPoint }, { x, secondPoint } }, previousMeasurement ? PALETTE_INDEX_17 : PALETTE_INDEX_21); - - // Draw red over extreme values (if supported by graph type). - if (listType == GRAPH_VERTICAL || listType == GRAPH_LATERAL) - { - const auto redLineColour = previousMeasurement ? PALETTE_INDEX_171 : PALETTE_INDEX_173; - - // Line exceeds negative threshold (at bottom of graph). - if (secondPoint >= intensityThresholdNegative) - { - const auto redLineTop = ScreenCoordsXY{ x, std::max(firstPoint, intensityThresholdNegative) }; - const auto redLineBottom = ScreenCoordsXY{ x, std::max(secondPoint, intensityThresholdNegative) }; - GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour); - } - - // Line exceeds positive threshold (at top of graph). - if (listType == GRAPH_LATERAL && firstPoint < intensityThresholdPositive) - { - const auto redLineTop = ScreenCoordsXY{ x, std::min(firstPoint, intensityThresholdPositive) }; - const auto redLineBottom = ScreenCoordsXY{ x, std::min(secondPoint, intensityThresholdPositive) }; - GfxFillRect(dpi, { redLineTop, redLineBottom }, redLineColour); - } - } - } - } - -#pragma endregion - -#pragma region Income - - static void UpdateSamePriceThroughoutFlags(ShopItem shop_item) - { - const auto& gameState = GetGameState(); - const auto existingFlags = gameState.SamePriceThroughoutPark; - - auto newFlags = existingFlags; - if (GetShopItemDescriptor(shop_item).IsPhoto()) - { - if (existingFlags & EnumToFlag(shop_item)) - newFlags &= ~EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); - else - newFlags |= EnumsToFlags(ShopItem::Photo, ShopItem::Photo2, ShopItem::Photo3, ShopItem::Photo4); - } - else - { - newFlags ^= EnumToFlag(shop_item); - } - - auto parkSetParameter = ParkSetParameterAction(ParkParameter::SamePriceInPark, newFlags); - GameActions::Execute(&parkSetParameter); - } - - void IncomeTogglePrimaryPrice() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - ShopItem shopItem; - const auto& rtd = ride->GetRideTypeDescriptor(); - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) - { - shopItem = ShopItem::Admission; - } - else - { - auto rideEntry = GetRideEntryByIndex(ride->subtype); - if (rideEntry != nullptr) - { - shopItem = rideEntry->shop_item[0]; - if (shopItem == ShopItem::None) - return; - } - else - { - return; - } - } - - UpdateSamePriceThroughoutFlags(shopItem); - - auto rideSetPriceAction = RideSetPriceAction(rideId, ride->price[0], true); - GameActions::Execute(&rideSetPriceAction); - } - - void IncomeToggleSecondaryPrice() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = GetRideEntryByIndex(ride->subtype); - if (rideEntry == nullptr) - return; - - auto shop_item = rideEntry->shop_item[1]; - if (shop_item == ShopItem::None) - shop_item = ride->GetRideTypeDescriptor().PhotoItem; - - UpdateSamePriceThroughoutFlags(shop_item); - - auto rideSetPriceAction = RideSetPriceAction(rideId, ride->price[1], false); - GameActions::Execute(&rideSetPriceAction); - } - - void IncomeSetPrimaryPrice(money64 price) - { - auto rideSetPriceAction = RideSetPriceAction(rideId, price, true); - GameActions::Execute(&rideSetPriceAction); - } - - void IncomeIncreasePrimaryPrice() - { - if (!IncomeCanModifyPrimaryPrice()) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto price = ride->price[0]; - if (price < 20.00_GBP) - price++; - - IncomeSetPrimaryPrice(price); - } - - void IncomeDecreasePrimaryPrice() - { - if (!IncomeCanModifyPrimaryPrice()) - return; - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto price = ride->price[0]; - if (price > 0.00_GBP) - price--; - - IncomeSetPrimaryPrice(price); - } - - money64 IncomeGetSecondaryPrice() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return 0; - - return ride->price[1]; - } - - void IncomeSetSecondaryPrice(money64 price) - { - auto rideSetPriceAction = RideSetPriceAction(rideId, price, false); - GameActions::Execute(&rideSetPriceAction); - } - - bool IncomeCanModifyPrimaryPrice() - { - auto ride = GetRide(rideId); - if (ride == nullptr) - return false; - - auto rideEntry = ride->GetRideEntry(); - const auto& rtd = ride->GetRideTypeDescriptor(); - return ParkRidePricesUnlocked() || rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) - || (rideEntry != nullptr && rideEntry->shop_item[0] != ShopItem::None); - } - - void IncomeIncreaseSecondaryPrice() - { - auto price = IncomeGetSecondaryPrice(); - - if (price < 20.00_GBP) - price++; - - IncomeSetSecondaryPrice(price); - } - - void IncomeDecreaseSecondaryPrice() - { - auto price = IncomeGetSecondaryPrice(); - - if (price > 0.00_GBP) - price--; - - IncomeSetSecondaryPrice(price); - } - - void IncomeOnMouseUp(WidgetIndex widgetIndex) - { - utf8 _moneyInputText[MONEY_STRING_MAXLENGTH] = {}; - - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_PRIMARY_PRICE: - { - if (!IncomeCanModifyPrimaryPrice()) - return; - - auto ride = GetRide(rideId); - if (ride != nullptr) - { - MoneyToString(ride->price[0], _moneyInputText, MONEY_STRING_MAXLENGTH, true); - WindowTextInputRawOpen( - this, WIDX_PRIMARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneyInputText, - MONEY_STRING_MAXLENGTH); - } - break; - } - case WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK: - IncomeTogglePrimaryPrice(); - break; - case WIDX_SECONDARY_PRICE: - { - auto price64 = IncomeGetSecondaryPrice(); - - MoneyToString(price64, _moneyInputText, MONEY_STRING_MAXLENGTH, true); - WindowTextInputRawOpen( - this, WIDX_SECONDARY_PRICE, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneyInputText, - MONEY_STRING_MAXLENGTH); - } - break; - case WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK: - IncomeToggleSecondaryPrice(); - break; - } - } - - void IncomeResize() - { - WindowSetResize(*this, 316, 194, 316, 194); - } - - void IncomeOnMouseDown(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_PRIMARY_PRICE_INCREASE: - IncomeIncreasePrimaryPrice(); - break; - case WIDX_PRIMARY_PRICE_DECREASE: - IncomeDecreasePrimaryPrice(); - break; - case WIDX_SECONDARY_PRICE_INCREASE: - IncomeIncreaseSecondaryPrice(); - break; - case WIDX_SECONDARY_PRICE_DECREASE: - IncomeDecreaseSecondaryPrice(); - break; - } - } - - void IncomeUpdate() - { - frame_no++; - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_9); - - auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_INCOME) - { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_INCOME; - Invalidate(); - } - } - - void IncomeOnTextInput(WidgetIndex widgetIndex, std::string_view text) - { - if ((widgetIndex != WIDX_PRIMARY_PRICE && widgetIndex != WIDX_SECONDARY_PRICE) || text.empty()) - return; - - std::string strText{ text }; - money64 price = StringToMoney(strText.c_str()); - if (price == kMoney64Undefined) - { - return; - } - - price = std::clamp(price, 0.00_GBP, 20.00_GBP); - - if (widgetIndex == WIDX_PRIMARY_PRICE) - { - IncomeSetPrimaryPrice(price); - } - else - { - IncomeSetSecondaryPrice(price); - } - } - - void IncomeOnPrepareDraw() - { - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - widgets[WIDX_TITLE].text = STR_ARG_18_STRINGID; - - auto ft = Formatter::Common(); - ft.Increment(18); - ride->FormatNameTo(ft); - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - // Primary item - 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; - - // 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(); - if (!ParkRidePricesUnlocked() && rideEntry->shop_item[0] == ShopItem::None && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET)) - { - disabled_widgets |= (1uLL << WIDX_PRIMARY_PRICE); - widgets[WIDX_PRIMARY_PRICE_LABEL].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; - widgets[WIDX_PRIMARY_PRICE].tooltip = STR_RIDE_INCOME_ADMISSION_PAY_FOR_ENTRY_TIP; - } - - widgets[WIDX_PRIMARY_PRICE_LABEL].text = STR_RIDE_INCOME_ADMISSION_PRICE; - widgets[WIDX_SECONDARY_PRICE_LABEL].text = STR_SHOP_ITEM_PRICE_LABEL_ON_RIDE_PHOTO; - widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Empty; - - widgets[WIDX_PRIMARY_PRICE].text = STR_BOTTOM_TOOLBAR_CASH; - auto ridePrimaryPrice = RideGetPrice(*ride); - ft.Rewind(); - ft.Add(ridePrimaryPrice); - if (ridePrimaryPrice == 0) - widgets[WIDX_PRIMARY_PRICE].text = STR_FREE; - - ShopItem primaryItem = ShopItem::Admission; - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_TOILET) || ((primaryItem = rideEntry->shop_item[0]) != ShopItem::None)) - { - widgets[WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Checkbox; - - if (ShopItemHasCommonPrice(primaryItem)) - pressed_widgets |= (1uLL << WIDX_PRIMARY_PRICE_SAME_THROUGHOUT_PARK); - - widgets[WIDX_PRIMARY_PRICE_LABEL].text = GetShopItemDescriptor(primaryItem).Naming.PriceLabel; - } - - // Get secondary item - auto secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) - { - if ((secondaryItem = rideEntry->shop_item[1]) != ShopItem::None) - { - widgets[WIDX_SECONDARY_PRICE_LABEL].text = GetShopItemDescriptor(secondaryItem).Naming.PriceLabel; - } - } - - if (secondaryItem == ShopItem::None) - { - // Hide secondary item widgets - widgets[WIDX_SECONDARY_PRICE_LABEL].type = WindowWidgetType::Empty; - widgets[WIDX_SECONDARY_PRICE].type = WindowWidgetType::Empty; - widgets[WIDX_SECONDARY_PRICE_INCREASE].type = WindowWidgetType::Empty; - widgets[WIDX_SECONDARY_PRICE_DECREASE].type = WindowWidgetType::Empty; - widgets[WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Empty; - } - else - { - // Set same price throughout park checkbox - pressed_widgets &= ~(1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); - if (ShopItemHasCommonPrice(secondaryItem)) - pressed_widgets |= (1uLL << WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK); - - // Show widgets - widgets[WIDX_SECONDARY_PRICE_LABEL].type = WindowWidgetType::Label; - widgets[WIDX_SECONDARY_PRICE].type = WindowWidgetType::Spinner; - widgets[WIDX_SECONDARY_PRICE_INCREASE].type = WindowWidgetType::Button; - widgets[WIDX_SECONDARY_PRICE_DECREASE].type = WindowWidgetType::Button; - widgets[WIDX_SECONDARY_PRICE_SAME_THROUGHOUT_PARK].type = WindowWidgetType::Checkbox; - - // Set secondary item price - widgets[WIDX_SECONDARY_PRICE].text = STR_RIDE_SECONDARY_PRICE_VALUE; - ft.Rewind(); - ft.Increment(10); - ft.Add(ride->price[1]); - if (ride->price[1] == 0) - widgets[WIDX_SECONDARY_PRICE].text = STR_FREE; - } - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } - - void IncomeOnDraw(DrawPixelInfo& dpi) - { - StringId stringId; - money64 profit; - ShopItem primaryItem, secondaryItem; - - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 33 }; - - // Primary item profit / loss per item sold - primaryItem = rideEntry->shop_item[0]; - if (primaryItem != ShopItem::None) - { - profit = ride->price[0]; - - stringId = STR_PROFIT_PER_ITEM_SOLD; - profit -= GetShopItemDescriptor(primaryItem).Cost; - if (profit < 0) - { - profit *= -1; - stringId = STR_LOSS_PER_ITEM_SOLD; - } - - auto ft = Formatter(); - ft.Add(profit); - - DrawTextBasic(dpi, screenCoords, stringId, ft); - } - screenCoords.y += 44; - - // Secondary item profit / loss per item sold - secondaryItem = ride->GetRideTypeDescriptor().PhotoItem; - if (!(ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO)) - secondaryItem = rideEntry->shop_item[1]; - - if (secondaryItem != ShopItem::None) - { - profit = ride->price[1]; - - stringId = STR_PROFIT_PER_ITEM_SOLD; - profit -= GetShopItemDescriptor(secondaryItem).Cost; - if (profit < 0) - { - profit *= -1; - stringId = STR_LOSS_PER_ITEM_SOLD; - } - - auto ft = Formatter(); - ft.Add(profit); - - DrawTextBasic(dpi, screenCoords, stringId, ft); - } - screenCoords.y += 18; - - // Income per hour - if (ride->income_per_hour != kMoney64Undefined) - { - auto ft = Formatter(); - ft.Add(ride->income_per_hour); - - DrawTextBasic(dpi, screenCoords, STR_INCOME_PER_HOUR, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - // Running cost per hour - money64 costPerHour = ride->upkeep_cost * 16; - stringId = ride->upkeep_cost == kMoney64Undefined ? STR_RUNNING_COST_UNKNOWN : STR_RUNNING_COST_PER_HOUR; - auto ft = Formatter(); - ft.Add(costPerHour); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Profit per hour - if (ride->profit != kMoney64Undefined) - { - ft = Formatter(); - ft.Add(ride->profit); - DrawTextBasic(dpi, screenCoords, STR_PROFIT_PER_HOUR, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - screenCoords.y += 5; - - // Total profit - ft = Formatter(); - ft.Add(ride->total_profit); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_PROFIT, ft); - } - -#pragma endregion - -#pragma region Customer - - void CustomerOnMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - return; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - case WIDX_TAB_4: - case WIDX_TAB_5: - case WIDX_TAB_6: - case WIDX_TAB_7: - case WIDX_TAB_8: - case WIDX_TAB_9: - case WIDX_TAB_10: - SetPage(widgetIndex - WIDX_TAB_1); - break; - case WIDX_SHOW_GUESTS_THOUGHTS: - { - auto intent = Intent(WindowClass::GuestList); - intent.PutExtra( - INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsThinkingAboutRide)); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, number); - ContextOpenIntent(&intent); - break; - } - case WIDX_SHOW_GUESTS_ON_RIDE: - { - auto intent = Intent(WindowClass::GuestList); - intent.PutExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsOnRide)); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, number); - ContextOpenIntent(&intent); - break; - } - case WIDX_SHOW_GUESTS_QUEUING: - { - auto intent = Intent(WindowClass::GuestList); - intent.PutExtra(INTENT_EXTRA_GUEST_LIST_FILTER, static_cast(GuestListFilterType::GuestsInQueue)); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, number); - ContextOpenIntent(&intent); - break; - } - } - } - - void CustomerResize() - { - flags |= WF_RESIZABLE; - WindowSetResize(*this, 316, 163, 316, 163); - } - - void CustomerUpdate() - { - picked_peep_frame++; - if (picked_peep_frame >= 24) - picked_peep_frame = 0; - - OnPrepareDraw(); - WidgetInvalidate(*this, WIDX_TAB_10); - - auto ride = GetRide(rideId); - if (ride != nullptr && ride->window_invalidate_flags & RIDE_INVALIDATE_RIDE_CUSTOMER) - { - ride->window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_CUSTOMER; - Invalidate(); - } - } - - void CustomerOnPrepareDraw() - { - auto newWidgets = PageWidgets[page]; - if (widgets != newWidgets) - { - widgets = newWidgets; - InitScrollWidgets(); - } - - SetPressedTab(); - - auto ride = GetRide(rideId); - if (ride != nullptr) - { - auto ft = Formatter::Common(); - ride->FormatNameTo(ft); - - widgets[WIDX_SHOW_GUESTS_THOUGHTS].type = WindowWidgetType::FlatBtn; - if (ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) - { - widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::Empty; - widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_SHOW_GUESTS_ON_RIDE].type = WindowWidgetType::FlatBtn; - widgets[WIDX_SHOW_GUESTS_QUEUING].type = WindowWidgetType::FlatBtn; - } - - AnchorBorderWidgets(); - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_10); - } - } - - void CustomerOnDraw(DrawPixelInfo& dpi) - { - ShopItem shopItem; - int16_t popularity, satisfaction, queueTime; - StringId stringId; - - DrawWidgets(dpi); - DrawTabImages(dpi); - - auto ride = GetRide(rideId); - if (ride == nullptr) - return; - - auto screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - - // Customers currently on ride - if (ride->IsRide()) - { - auto ft = Formatter(); - ft.Add(ride->num_riders); - DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_ON_RIDE, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - // Customers per hour - auto ft = Formatter(); - ft.Add(RideCustomersPerHour(*ride)); - DrawTextBasic(dpi, screenCoords, STR_CUSTOMERS_PER_HOUR, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Popularity - popularity = ride->popularity; - if (popularity == 255) - { - stringId = STR_POPULARITY_UNKNOWN; - } - else - { - stringId = STR_POPULARITY_PERCENT; - popularity *= 4; - } - ft = Formatter(); - ft.Add(popularity); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Satisfaction - satisfaction = ride->satisfaction; - if (satisfaction == 255) - { - stringId = STR_SATISFACTION_UNKNOWN; - } - else - { - stringId = STR_SATISFACTION_PERCENT; - satisfaction *= 5; - } - ft = Formatter(); - ft.Add(satisfaction); - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Queue time - if (ride->IsRide()) - { - queueTime = ride->GetMaxQueueTime(); - stringId = queueTime == 1 ? STR_QUEUE_TIME_MINUTE : STR_QUEUE_TIME_MINUTES; - ft = Formatter(); - ft.Add(queueTime); - screenCoords.y += DrawTextWrapped(dpi, screenCoords, 308, stringId, ft, { TextAlignment::LEFT }); - screenCoords.y += 5; - } - - // Primary shop items sold - shopItem = ride->GetRideEntry()->shop_item[0]; - if (shopItem != ShopItem::None) - { - ft = Formatter(); - ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); - ft.Add(ride->no_primary_items_sold); - DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - // Secondary shop items sold / on-ride photos sold - shopItem = (ride->lifecycle_flags & RIDE_LIFECYCLE_ON_RIDE_PHOTO) ? ride->GetRideTypeDescriptor().PhotoItem - : ride->GetRideEntry()->shop_item[1]; - if (shopItem != ShopItem::None) - { - ft = Formatter(); - ft.Add(GetShopItemDescriptor(shopItem).Naming.Plural); - ft.Add(ride->no_secondary_items_sold); - DrawTextBasic(dpi, screenCoords, STR_ITEMS_SOLD, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - // Total customers - ft = Formatter(); - ft.Add(ride->total_customers); - DrawTextBasic(dpi, screenCoords, STR_TOTAL_CUSTOMERS, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - // Guests favourite - if (ride->IsRide()) - { - ft = Formatter(); - ft.Add(ride->guests_favourite); - stringId = ride->guests_favourite == 1 ? STR_FAVOURITE_RIDE_OF_GUEST : STR_FAVOURITE_RIDE_OF_GUESTS; - DrawTextBasic(dpi, screenCoords, stringId, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - screenCoords.y += 2; - - // Age - // If the ride has a build date that is in the future, show it as built this year. - int16_t age = std::max(DateGetYear(ride->GetAge()), 0); - stringId = age == 0 ? STR_BUILT_THIS_YEAR : age == 1 ? STR_BUILT_LAST_YEAR : STR_BUILT_YEARS_AGO; - ft = Formatter(); - ft.Add(age); - DrawTextBasic(dpi, screenCoords, stringId, ft); - } - -#pragma endregion -}; - -/** - * - * rct2: 0x006AEAB4 - */ -static RideWindow* WindowRideOpen(const Ride& ride) -{ - return WindowCreate(WindowClass::Ride, 316, 207, WF_10 | WF_RESIZABLE, ride); -} - -/** - * - * rct2: 0x006ACC28 - */ -WindowBase* WindowRideMainOpen(const Ride& ride) -{ - if (ride.type >= RIDE_TYPE_COUNT) - { - return nullptr; - } - - RideWindow* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); - if (w == nullptr) - { - w = WindowRideOpen(ride); - w->SetViewIndex(0); - } - else if (w->GetViewIndex() >= (1 + ride.NumTrains + ride.num_stations)) - { - w->SetViewIndex(0); - } - - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - { - if (w->classification == gCurrentToolWidget.window_classification && w->number == gCurrentToolWidget.window_number) - { - ToolCancel(); - } - } - - if (w->page != WINDOW_RIDE_PAGE_MAIN) - { - w->SetPage(WINDOW_RIDE_PAGE_MAIN); - } - - w->OnViewportRotate(); - return w; -} - -/** - * - * rct2: 0x006ACCCE - */ -static WindowBase* WindowRideOpenStation(const Ride& ride, StationIndex stationIndex) -{ - if (ride.type >= RIDE_TYPE_COUNT) - return nullptr; - - if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) - return WindowRideMainOpen(ride); - - auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); - if (w == nullptr) - { - w = WindowRideOpen(ride); - } - - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification - && gCurrentToolWidget.window_number == w->number) - { - ToolCancel(); - } - - // View - for (int32_t i = stationIndex.ToUnderlying(); i >= 0; i--) - { - if (ride.GetStations()[i].Start.IsNull()) - { - stationIndex = StationIndex::FromUnderlying(stationIndex.ToUnderlying() - 1); - } - } - - w->SetViewIndex(1 + ride.NumTrains + stationIndex.ToUnderlying()); - - return w; -} - -WindowBase* WindowRideOpenTrack(TileElement* tileElement) -{ - assert(tileElement != nullptr); - auto rideIndex = tileElement->GetRideIndex(); - if (!rideIndex.IsNull()) - { - auto ride = GetRide(rideIndex); - if (ride != nullptr) - { - const auto type = tileElement->GetType(); - if (type == TileElementType::Entrance) - { - // Open ride window in station view - auto entranceElement = tileElement->AsEntrance(); - auto stationIndex = entranceElement->GetStationIndex(); - return WindowRideOpenStation(*ride, stationIndex); - } - else if (type == TileElementType::Track) - { - // Open ride window in station view - auto trackElement = tileElement->AsTrack(); - auto trackType = trackElement->GetTrackType(); - const auto& ted = GetTrackElementDescriptor(trackType); - if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) - { - auto stationIndex = trackElement->GetStationIndex(); - return WindowRideOpenStation(*ride, stationIndex); - } - } - - // Open ride window in overview mode - return WindowRideMainOpen(*ride); - } - } - return nullptr; -} - -/** - * - * rct2: 0x006ACAC2 - */ -WindowBase* WindowRideOpenVehicle(Vehicle* vehicle) -{ - if (vehicle == nullptr) - return nullptr; - - Vehicle* headVehicle = vehicle->TrainHead(); - if (headVehicle == nullptr) - return nullptr; - - EntityId headVehicleSpriteIndex = headVehicle->Id; - auto ride = headVehicle->GetRide(); - if (ride == nullptr) - return nullptr; - - // Get view index - int16_t view = 1; - for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++) - { - if (ride->vehicles[i] == headVehicleSpriteIndex) - break; - - view++; - } - - auto* w = static_cast(WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying())); - if (w != nullptr) - { - w->Invalidate(); if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification && gCurrentToolWidget.window_number == w->number) @@ -6793,96 +6727,187 @@ WindowBase* WindowRideOpenVehicle(Vehicle* vehicle) ToolCancel(); } - int32_t openedPeepWindow = 0; - if (w->GetViewIndex() == view) + // View + for (int32_t i = stationIndex.ToUnderlying(); i >= 0; i--) { - int32_t numPeepsLeft = vehicle->num_peeps; - for (int32_t i = 0; i < 32 && numPeepsLeft > 0; i++) + if (ride.GetStations()[i].Start.IsNull()) { - Peep* peep = GetEntity(vehicle->peep[i]); - if (peep == nullptr) - continue; - - numPeepsLeft--; - WindowBase* w2 = WindowFindByNumber(WindowClass::Peep, vehicle->peep[i]); - if (w2 == nullptr) - { - auto intent = Intent(WindowClass::Peep); - intent.PutExtra(INTENT_EXTRA_PEEP, peep); - ContextOpenIntent(&intent); - openedPeepWindow = 1; - - break; - } + stationIndex = StationIndex::FromUnderlying(stationIndex.ToUnderlying() - 1); } } - w = static_cast( - openedPeepWindow ? WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying()) - : WindowBringToFrontByNumber(WindowClass::Ride, ride->id.ToUnderlying())); + w->SetViewIndex(1 + ride.NumTrains + stationIndex.ToUnderlying()); + + return w; } - if (w == nullptr) + WindowBase* WindowRideOpenTrack(TileElement* tileElement) { - w = WindowRideOpen(*ride); - } - - w->SetViewIndex(view); - w->Invalidate(); - - return w; -} - -void WindowRideInvalidateVehicle(const Vehicle& vehicle) -{ - auto* w = static_cast(WindowFindByNumber(WindowClass::Ride, vehicle.ride.ToUnderlying())); - if (w == nullptr) - return; - - auto ride = vehicle.GetRide(); - auto viewVehicleIndex = w->GetViewIndex() - 1; - if (ride == nullptr || viewVehicleIndex < 0 || viewVehicleIndex >= ride->NumTrains) - return; - - if (vehicle.Id != ride->vehicles[viewVehicleIndex]) - return; - - w->Invalidate(); -} - -void WindowRidePaintResetVehicle(RideId rideIndex) -{ - auto w = static_cast(WindowFindByNumber(WindowClass::Ride, rideIndex.ToUnderlying())); - if (w != nullptr) - { - if (w->page == 4) // WINDOW_RIDE_PAGE_COLOUR + assert(tileElement != nullptr); + auto rideIndex = tileElement->GetRideIndex(); + if (!rideIndex.IsNull()) { - w->ResetVehicleIndex(); + auto ride = GetRide(rideIndex); + if (ride != nullptr) + { + const auto type = tileElement->GetType(); + if (type == TileElementType::Entrance) + { + // Open ride window in station view + auto entranceElement = tileElement->AsEntrance(); + auto stationIndex = entranceElement->GetStationIndex(); + return WindowRideOpenStation(*ride, stationIndex); + } + else if (type == TileElementType::Track) + { + // Open ride window in station view + auto trackElement = tileElement->AsTrack(); + auto trackType = trackElement->GetTrackType(); + const auto& ted = GetTrackElementDescriptor(trackType); + if (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + { + auto stationIndex = trackElement->GetStationIndex(); + return WindowRideOpenStation(*ride, stationIndex); + } + } + + // Open ride window in overview mode + return WindowRideMainOpen(*ride); + } } + return nullptr; + } + + /** + * + * rct2: 0x006ACAC2 + */ + WindowBase* WindowRideOpenVehicle(Vehicle* vehicle) + { + if (vehicle == nullptr) + return nullptr; + + Vehicle* headVehicle = vehicle->TrainHead(); + if (headVehicle == nullptr) + return nullptr; + + EntityId headVehicleSpriteIndex = headVehicle->Id; + auto ride = headVehicle->GetRide(); + if (ride == nullptr) + return nullptr; + + // Get view index + int16_t view = 1; + for (int32_t i = 0; i <= OpenRCT2::Limits::MaxTrainsPerRide; i++) + { + if (ride->vehicles[i] == headVehicleSpriteIndex) + break; + + view++; + } + + auto* w = static_cast(WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying())); + if (w != nullptr) + { + w->Invalidate(); + + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == w->classification + && gCurrentToolWidget.window_number == w->number) + { + ToolCancel(); + } + + int32_t openedPeepWindow = 0; + if (w->GetViewIndex() == view) + { + int32_t numPeepsLeft = vehicle->num_peeps; + for (int32_t i = 0; i < 32 && numPeepsLeft > 0; i++) + { + Peep* peep = GetEntity(vehicle->peep[i]); + if (peep == nullptr) + continue; + + numPeepsLeft--; + WindowBase* w2 = WindowFindByNumber(WindowClass::Peep, vehicle->peep[i]); + if (w2 == nullptr) + { + auto intent = Intent(WindowClass::Peep); + intent.PutExtra(INTENT_EXTRA_PEEP, peep); + ContextOpenIntent(&intent); + openedPeepWindow = 1; + + break; + } + } + } + + w = static_cast( + openedPeepWindow ? WindowFindByNumber(WindowClass::Ride, ride->id.ToUnderlying()) + : WindowBringToFrontByNumber(WindowClass::Ride, ride->id.ToUnderlying())); + } + + if (w == nullptr) + { + w = WindowRideOpen(*ride); + } + + w->SetViewIndex(view); + w->Invalidate(); + + return w; + } + + void WindowRideInvalidateVehicle(const Vehicle& vehicle) + { + auto* w = static_cast(WindowFindByNumber(WindowClass::Ride, vehicle.ride.ToUnderlying())); + if (w == nullptr) + return; + + auto ride = vehicle.GetRide(); + auto viewVehicleIndex = w->GetViewIndex() - 1; + if (ride == nullptr || viewVehicleIndex < 0 || viewVehicleIndex >= ride->NumTrains) + return; + + if (vehicle.Id != ride->vehicles[viewVehicleIndex]) + return; + w->Invalidate(); } -} -static void CancelScenerySelection() -{ - gGamePaused &= ~GAME_PAUSED_SAVING_TRACK; - gTrackDesignSaveMode = false; - OpenRCT2::Audio::Resume(); - - WindowBase* main_w = WindowGetMain(); - if (main_w != nullptr) + void WindowRidePaintResetVehicle(RideId rideIndex) { - main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); + auto w = static_cast(WindowFindByNumber(WindowClass::Ride, rideIndex.ToUnderlying())); + if (w != nullptr) + { + if (w->page == 4) // WINDOW_RIDE_PAGE_COLOUR + { + w->ResetVehicleIndex(); + } + w->Invalidate(); + } } - GfxInvalidateScreen(); - ToolCancel(); -} - -void WindowRideMeasurementsDesignCancel() -{ - if (gTrackDesignSaveMode) + static void CancelScenerySelection() { - CancelScenerySelection(); + gGamePaused &= ~GAME_PAUSED_SAVING_TRACK; + gTrackDesignSaveMode = false; + OpenRCT2::Audio::Resume(); + + WindowBase* main_w = WindowGetMain(); + if (main_w != nullptr) + { + main_w->viewport->flags &= ~(VIEWPORT_FLAG_HIDE_VERTICAL | VIEWPORT_FLAG_HIDE_BASE); + } + + GfxInvalidateScreen(); + ToolCancel(); } -} + + void WindowRideMeasurementsDesignCancel() + { + if (gTrackDesignSaveMode) + { + CancelScenerySelection(); + } + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 8fd3259692..82c99a013c 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -47,73 +47,73 @@ #include #include -using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; + static constexpr int32_t WH = 394; + static constexpr int32_t WW = 210; -static constexpr StringId WINDOW_TITLE = STR_RIDE_CONSTRUCTION_WINDOW_TITLE; -static constexpr int32_t WH = 394; -static constexpr int32_t WW = 210; - -static constexpr uint16_t ARROW_PULSE_DURATION = 200; -// Width of the group boxes, e.g. “Banking” -static constexpr int32_t GW = WW - 6; + static constexpr uint16_t ARROW_PULSE_DURATION = 200; + // Width of the group boxes, e.g. “Banking” + static constexpr int32_t GW = WW - 6; #pragma region Widgets -enum -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_DIRECTION_GROUPBOX, - WIDX_SLOPE_GROUPBOX, - WIDX_BANKING_GROUPBOX, - WIDX_LEFT_CURVE_VERY_SMALL, - WIDX_LEFT_CURVE_SMALL, - WIDX_LEFT_CURVE, - WIDX_LEFT_CURVE_LARGE, - WIDX_STRAIGHT, - WIDX_RIGHT_CURVE_LARGE, - WIDX_RIGHT_CURVE, - WIDX_RIGHT_CURVE_SMALL, - WIDX_RIGHT_CURVE_VERY_SMALL, - WIDX_SPECIAL_TRACK_DROPDOWN, - WIDX_SLOPE_DOWN_STEEP, - WIDX_SLOPE_DOWN, - WIDX_LEVEL, - WIDX_SLOPE_UP, - WIDX_SLOPE_UP_STEEP, - WIDX_CHAIN_LIFT, - WIDX_BANK_LEFT, - WIDX_BANK_STRAIGHT, - WIDX_BANK_RIGHT, - WIDX_CONSTRUCT, - WIDX_DEMOLISH, - WIDX_PREVIOUS_SECTION, - WIDX_NEXT_SECTION, - WIDX_ENTRANCE_EXIT_GROUPBOX, - WIDX_ENTRANCE, - WIDX_EXIT, - WIDX_ROTATE, - WIDX_U_TRACK, - WIDX_O_TRACK, - WIDX_SEAT_ROTATION_GROUPBOX, - WIDX_SEAT_ROTATION_ANGLE_SPINNER, - WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP, - WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN, - WIDX_SIMULATE, - WIDX_SPEED_GROUPBOX = WIDX_BANKING_GROUPBOX, - WIDX_SPEED_SETTING_SPINNER = WIDX_BANK_LEFT, - WIDX_SPEED_SETTING_SPINNER_UP = WIDX_BANK_STRAIGHT, - WIDX_SPEED_SETTING_SPINNER_DOWN = WIDX_BANK_RIGHT, -}; + enum + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_DIRECTION_GROUPBOX, + WIDX_SLOPE_GROUPBOX, + WIDX_BANKING_GROUPBOX, + WIDX_LEFT_CURVE_VERY_SMALL, + WIDX_LEFT_CURVE_SMALL, + WIDX_LEFT_CURVE, + WIDX_LEFT_CURVE_LARGE, + WIDX_STRAIGHT, + WIDX_RIGHT_CURVE_LARGE, + WIDX_RIGHT_CURVE, + WIDX_RIGHT_CURVE_SMALL, + WIDX_RIGHT_CURVE_VERY_SMALL, + WIDX_SPECIAL_TRACK_DROPDOWN, + WIDX_SLOPE_DOWN_STEEP, + WIDX_SLOPE_DOWN, + WIDX_LEVEL, + WIDX_SLOPE_UP, + WIDX_SLOPE_UP_STEEP, + WIDX_CHAIN_LIFT, + WIDX_BANK_LEFT, + WIDX_BANK_STRAIGHT, + WIDX_BANK_RIGHT, + WIDX_CONSTRUCT, + WIDX_DEMOLISH, + WIDX_PREVIOUS_SECTION, + WIDX_NEXT_SECTION, + WIDX_ENTRANCE_EXIT_GROUPBOX, + WIDX_ENTRANCE, + WIDX_EXIT, + WIDX_ROTATE, + WIDX_U_TRACK, + WIDX_O_TRACK, + WIDX_SEAT_ROTATION_GROUPBOX, + WIDX_SEAT_ROTATION_ANGLE_SPINNER, + WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP, + WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN, + WIDX_SIMULATE, + WIDX_SPEED_GROUPBOX = WIDX_BANKING_GROUPBOX, + WIDX_SPEED_SETTING_SPINNER = WIDX_BANK_LEFT, + WIDX_SPEED_SETTING_SPINNER_UP = WIDX_BANK_STRAIGHT, + WIDX_SPEED_SETTING_SPINNER_DOWN = WIDX_BANK_RIGHT, + }; -validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_CONSTRUCT); -validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_ENTRANCE); -validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_EXIT); -validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_ROTATE); + validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_CONSTRUCT); + validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_ENTRANCE); + validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_EXIT); + validate_global_widx(WC_RIDE_CONSTRUCTION, WIDX_ROTATE); -// clang-format off + // clang-format off static Widget _rideConstructionWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget ({ 3, 17}, { GW, 57}, WindowWidgetType::Groupbox, WindowColour::Primary , STR_RIDE_CONSTRUCTION_DIRECTION ), @@ -153,205 +153,216 @@ static Widget _rideConstructionWidgets[] = { MakeWidget ({161, 338}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_SIMULATE), STR_SIMULATE_RIDE_TIP ), kWidgetsEnd, }; -// clang-format on + // clang-format on #pragma endregion -static bool _trackPlaceCtrlState; -static int32_t _trackPlaceCtrlZ; -static bool _trackPlaceShiftState; -static ScreenCoordsXY _trackPlaceShiftStart; -static int32_t _trackPlaceShiftZ; -static int32_t _trackPlaceZ; -static money64 _trackPlaceCost; -static StringId _trackPlaceErrorMessage; -static bool _autoRotatingShop; -static bool _gotoStartPlacementMode = false; + static bool _trackPlaceCtrlState; + static int32_t _trackPlaceCtrlZ; + static bool _trackPlaceShiftState; + static ScreenCoordsXY _trackPlaceShiftStart; + static int32_t _trackPlaceShiftZ; + static int32_t _trackPlaceZ; + static money64 _trackPlaceCost; + static StringId _trackPlaceErrorMessage; + static bool _autoRotatingShop; + static bool _gotoStartPlacementMode = false; -static constexpr StringId RideConstructionSeatAngleRotationStrings[] = { - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_135, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_90, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_45, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_0, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_45, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_90, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_135, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_180, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_225, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_270, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_315, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_360, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_405, - STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_450, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_495, -}; + static constexpr StringId RideConstructionSeatAngleRotationStrings[] = { + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_180, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_135, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_90, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_NEG_45, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_0, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_45, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_90, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_135, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_180, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_225, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_270, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_315, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_360, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_405, + STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_450, STR_RIDE_CONSTRUCTION_SEAT_ROTATION_ANGLE_495, + }; -static void WindowRideConstructionMouseUpDemolishNextPiece(const CoordsXYZD& piecePos, int32_t type); + static void WindowRideConstructionMouseUpDemolishNextPiece(const CoordsXYZD& piecePos, int32_t type); -static int32_t RideGetAlternativeType(const Ride& ride) -{ - return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? ride.GetRideTypeDescriptor().AlternateType - : ride.type; -} - -/* move to ride.c */ -static void CloseRideWindowForConstruction(RideId rideId) -{ - WindowBase* w = WindowFindByNumber(WindowClass::Ride, rideId.ToUnderlying()); - if (w != nullptr && w->page == 1) - WindowClose(*w); -} - -static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); -static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); -static void CloseConstructWindowOnCompletion(const Ride& ride); - -class RideConstructionWindow final : public Window -{ -private: - uint8_t _currentlyShowingBrakeOrBoosterSpeed{}; - SpecialElementsDropdownState _specialElementDropdownState; - bool _autoOpeningShop{}; - -public: - void OnOpen() override + static int32_t RideGetAlternativeType(const Ride& ride) { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; - } - - widgets = _rideConstructionWidgets; - number = _currentRideIndex.ToUnderlying(); - - InitScrollWidgets(); - - WindowPushOthersRight(*this); - ShowGridlines(); - - _currentTrackPrice = kMoney64Undefined; - _currentBrakeSpeed2 = 8; - _currentSeatRotationAngle = 4; - - _currentTrackCurve = currentRide->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected; - _currentTrackPitchEnd = TrackPitch::None; - _currentTrackRollEnd = TrackRoll::None; - _currentTrackLiftHill = 0; - _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; - - if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)) - _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; - - _previousTrackRollEnd = TrackRoll::None; - _previousTrackPitchEnd = TrackPitch::None; - - _currentTrackPieceDirection = 0; - _rideConstructionState = RideConstructionState::Place; - _currentTrackSelectionFlags = 0; - _autoOpeningShop = false; - _autoRotatingShop = true; - _trackPlaceCtrlState = false; - _trackPlaceShiftState = false; + return (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_TYPE) ? ride.GetRideTypeDescriptor().AlternateType + : ride.type; } - void OnClose() override + /* move to ride.c */ + static void CloseRideWindowForConstruction(RideId rideId) { - RideConstructionInvalidateCurrentTrack(); - ViewportSetVisibility(ViewportVisibility::Default); + WindowBase* w = WindowFindByNumber(WindowClass::Ride, rideId.ToUnderlying()); + if (w != nullptr && w->page == 1) + WindowClose(*w); + } - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); + static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const GameActions::Result* result); + static void CloseConstructWindowOnCompletion(const Ride& ride); - // In order to cancel the yellow arrow correctly the - // selection tool should be cancelled. Don't do a tool cancel if - // another window has already taken control of tool. - if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) - ToolCancel(); + class RideConstructionWindow final : public Window + { + private: + uint8_t _currentlyShowingBrakeOrBoosterSpeed{}; + SpecialElementsDropdownState _specialElementDropdownState; + bool _autoOpeningShop{}; - HideGridlines(); - - // If we demolish a currentRide all windows will be closed including the construction window, - // the currentRide at this point is already gone. - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) + public: + void OnOpen() override { - return; + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) + { + return; + } + + widgets = _rideConstructionWidgets; + number = _currentRideIndex.ToUnderlying(); + + InitScrollWidgets(); + + WindowPushOthersRight(*this); + ShowGridlines(); + + _currentTrackPrice = kMoney64Undefined; + _currentBrakeSpeed2 = 8; + _currentSeatRotationAngle = 4; + + _currentTrackCurve = currentRide->GetRideTypeDescriptor().StartTrackPiece | RideConstructionSpecialPieceSelected; + _currentTrackPitchEnd = TrackPitch::None; + _currentTrackRollEnd = TrackRoll::None; + _currentTrackLiftHill = 0; + _currentTrackAlternative = RIDE_TYPE_NO_ALTERNATIVES; + + if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_START_CONSTRUCTION_INVERTED)) + _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_TYPE; + + _previousTrackRollEnd = TrackRoll::None; + _previousTrackPitchEnd = TrackPitch::None; + + _currentTrackPieceDirection = 0; + _rideConstructionState = RideConstructionState::Place; + _currentTrackSelectionFlags = 0; + _autoOpeningShop = false; + _autoRotatingShop = true; + _trackPlaceCtrlState = false; + _trackPlaceShiftState = false; } - if (RideTryGetOriginElement(*currentRide, nullptr)) + void OnClose() override { - // Auto open shops if required. - if (currentRide->mode == RideMode::ShopStall && gConfigGeneral.AutoOpenShops) + RideConstructionInvalidateCurrentTrack(); + ViewportSetVisibility(ViewportVisibility::Default); + + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + // In order to cancel the yellow arrow correctly the + // selection tool should be cancelled. Don't do a tool cancel if + // another window has already taken control of tool. + if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) + ToolCancel(); + + HideGridlines(); + + // If we demolish a currentRide all windows will be closed including the construction window, + // the currentRide at this point is already gone. + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) { - // HACK: Until we find a good a way to defer the game command for opening the shop, stop this - // from getting stuck in an infinite loop as opening the currentRide will try to close this window - if (!_autoOpeningShop) + return; + } + + if (RideTryGetOriginElement(*currentRide, nullptr)) + { + // Auto open shops if required. + if (currentRide->mode == RideMode::ShopStall && gConfigGeneral.AutoOpenShops) { - _autoOpeningShop = true; - auto gameAction = RideSetStatusAction(currentRide->id, RideStatus::Open); - GameActions::Execute(&gameAction); - _autoOpeningShop = false; + // HACK: Until we find a good a way to defer the game command for opening the shop, stop this + // from getting stuck in an infinite loop as opening the currentRide will try to close this window + if (!_autoOpeningShop) + { + _autoOpeningShop = true; + auto gameAction = RideSetStatusAction(currentRide->id, RideStatus::Open); + GameActions::Execute(&gameAction); + _autoOpeningShop = false; + } + } + + currentRide->SetToDefaultInspectionInterval(); + auto intent = Intent(WindowClass::Ride); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); + ContextOpenIntent(&intent); + } + else + { + auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH); + gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + GameActions::Execute(&gameAction); + } + } + + void OnResize() override + { + ResizeFrame(); + WindowRideConstructionUpdateEnabledTrackPieces(); + + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) + { + return; + } + + int32_t rideType = RideGetAlternativeType(*currentRide); + + uint64_t disabledWidgets = 0; + + if (_currentTrackCurve & RideConstructionSpecialPieceSelected) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) + | (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) + | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT) + | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT); + } + + // Disable large curves if the start or end of the track is sloped and large sloped curves are not available + if ((_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None)) + { + if (!IsTrackEnabled(TRACK_SLOPE_CURVE_LARGE) + || !(_previousTrackPitchEnd == TrackPitch::Up25 || _previousTrackPitchEnd == TrackPitch::Down25) + || !(_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Down25)) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); } } - - currentRide->SetToDefaultInspectionInterval(); - auto intent = Intent(WindowClass::Ride); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, currentRide->id.ToUnderlying()); - ContextOpenIntent(&intent); - } - else - { - auto gameAction = RideDemolishAction(currentRide->id, RIDE_MODIFY_DEMOLISH); - gameAction.SetFlags(GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - GameActions::Execute(&gameAction); - } - } - - void OnResize() override - { - ResizeFrame(); - WindowRideConstructionUpdateEnabledTrackPieces(); - - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; - } - - int32_t rideType = RideGetAlternativeType(*currentRide); - - uint64_t disabledWidgets = 0; - - if (_currentTrackCurve & RideConstructionSpecialPieceSelected) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_SLOPE_DOWN_STEEP) - | (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP) - | (1uLL << WIDX_CHAIN_LIFT) | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) - | (1uLL << WIDX_BANK_RIGHT); - } - - // Disable large curves if the start or end of the track is sloped and large sloped curves are not available - if ((_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None)) - { - if (!IsTrackEnabled(TRACK_SLOPE_CURVE_LARGE) - || !(_previousTrackPitchEnd == TrackPitch::Up25 || _previousTrackPitchEnd == TrackPitch::Down25) - || !(_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Down25)) + if (IsTrackEnabled(TRACK_SLOPE_CURVE) && IsTrackEnabled(TRACK_CURVE_VERY_SMALL)) { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); - } - } - if (IsTrackEnabled(TRACK_SLOPE_CURVE) && IsTrackEnabled(TRACK_CURVE_VERY_SMALL)) - { - // Disable small curves if the start or end of the track is sloped. - if (_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) - | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); - } - } - if (!IsTrackEnabled(TRACK_SLOPE_CURVE)) - { - if (IsTrackEnabled(TRACK_CURVE_VERTICAL)) - { - // Disable all curves only on vertical track - if (_previousTrackPitchEnd != TrackPitch::Up90 || _currentTrackPitchEnd != TrackPitch::Up90) + // Disable small curves if the start or end of the track is sloped. + if (_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None) { - if (_previousTrackPitchEnd != TrackPitch::Down90 || _currentTrackPitchEnd != TrackPitch::Down90) + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); + } + } + if (!IsTrackEnabled(TRACK_SLOPE_CURVE)) + { + if (IsTrackEnabled(TRACK_CURVE_VERTICAL)) + { + // Disable all curves only on vertical track + if (_previousTrackPitchEnd != TrackPitch::Up90 || _currentTrackPitchEnd != TrackPitch::Up90) + { + if (_previousTrackPitchEnd != TrackPitch::Down90 || _currentTrackPitchEnd != TrackPitch::Down90) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); + } + } + } + else + { + // Disable all curves on sloped track + if (_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None) { disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) @@ -359,2915 +370,2962 @@ public: } } } - else + if (!IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) { - // Disable all curves on sloped track - if (_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) - | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) - | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); - } + // Disable banking + disabledWidgets |= (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) + | (1uLL << WIDX_BANK_RIGHT); } - } - if (!IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) - { - // Disable banking - disabledWidgets |= (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) - | (1uLL << WIDX_BANK_RIGHT); - } - // Disable banking if the start track is steep and the end of the track becomes flat. - if ((_previousTrackPitchEnd == TrackPitch::Down60 || _previousTrackPitchEnd == TrackPitch::Up60) - && _currentTrackPitchEnd == TrackPitch::None) - { - disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); - } - if (!IsTrackEnabled(TRACK_SLOPE) && !IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN) && !IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) - { - if (!currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) - { - // Disable all slopes - disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN) - | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); - } - } - // If ride type does not have access to diagonal sloped turns, disallow simultaneous use of banked and sloped diagonals - if (!IsTrackEnabled(TRACK_SLOPE_CURVE_LARGE) && TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection)) - { - if (_currentTrackPitchEnd != TrackPitch::None) + // Disable banking if the start track is steep and the end of the track becomes flat. + if ((_previousTrackPitchEnd == TrackPitch::Down60 || _previousTrackPitchEnd == TrackPitch::Up60) + && _currentTrackPitchEnd == TrackPitch::None) { disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } - else if (_currentTrackRollEnd != TrackRoll::None) + if (!IsTrackEnabled(TRACK_SLOPE) && !IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN) + && !IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); + if (!currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + { + // Disable all slopes + disabledWidgets |= (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_SLOPE_DOWN_STEEP) + | (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) + | (1uLL << WIDX_SLOPE_UP_STEEP); + } } - } - if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) - && !GetGameState().Cheats.EnableAllDrawableTrackPieces) - { - // Disable lift hill toggle and banking if current track piece is uphill - if (_previousTrackPitchEnd == TrackPitch::Up25 || _previousTrackPitchEnd == TrackPitch::Up60 - || _currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60) - disabledWidgets |= 1uLL << WIDX_CHAIN_LIFT | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); - // Disable upward slope if current track piece is not flat - if ((_previousTrackPitchEnd != TrackPitch::None || _previousTrackRollEnd != TrackRoll::None) - && !(_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED)) - disabledWidgets |= (1uLL << WIDX_SLOPE_UP); - } - if (_rideConstructionState == RideConstructionState::State0) - { - disabledWidgets |= (1uLL << WIDX_CONSTRUCT) | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) - | (1uLL << WIDX_NEXT_SECTION); - } - switch (_currentTrackCurve) - { - case EnumValue(TrackCurve::LeftVerySmall): - case EnumValue(TrackCurve::LeftSmall): - case EnumValue(TrackCurve::Left): - case EnumValue(TrackCurve::LeftLarge): - disabledWidgets |= (1uLL << WIDX_BANK_RIGHT); - if (_previousTrackRollEnd == TrackRoll::None) + // If ride type does not have access to diagonal sloped turns, disallow simultaneous use of banked and sloped + // diagonals + if (!IsTrackEnabled(TRACK_SLOPE_CURVE_LARGE) && TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection)) + { + if (_currentTrackPitchEnd != TrackPitch::None) { - disabledWidgets |= (1uLL << WIDX_BANK_LEFT); + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } - else + else if (_currentTrackRollEnd != TrackRoll::None) { - disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); } - break; - case EnumValue(TrackCurve::RightLarge): - case EnumValue(TrackCurve::Right): - case EnumValue(TrackCurve::RightSmall): - case EnumValue(TrackCurve::RightVerySmall): - disabledWidgets |= (1uLL << WIDX_BANK_LEFT); - if (_previousTrackRollEnd == TrackRoll::None) - { + } + if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + && !GetGameState().Cheats.EnableAllDrawableTrackPieces) + { + // Disable lift hill toggle and banking if current track piece is uphill + if (_previousTrackPitchEnd == TrackPitch::Up25 || _previousTrackPitchEnd == TrackPitch::Up60 + || _currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60) + disabledWidgets |= 1uLL << WIDX_CHAIN_LIFT | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); + // Disable upward slope if current track piece is not flat + if ((_previousTrackPitchEnd != TrackPitch::None || _previousTrackRollEnd != TrackRoll::None) + && !(_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED)) + disabledWidgets |= (1uLL << WIDX_SLOPE_UP); + } + if (_rideConstructionState == RideConstructionState::State0) + { + disabledWidgets |= (1uLL << WIDX_CONSTRUCT) | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) + | (1uLL << WIDX_NEXT_SECTION); + } + switch (_currentTrackCurve) + { + case EnumValue(TrackCurve::LeftVerySmall): + case EnumValue(TrackCurve::LeftSmall): + case EnumValue(TrackCurve::Left): + case EnumValue(TrackCurve::LeftLarge): disabledWidgets |= (1uLL << WIDX_BANK_RIGHT); - } - else + if (_previousTrackRollEnd == TrackRoll::None) + { + disabledWidgets |= (1uLL << WIDX_BANK_LEFT); + } + else + { + disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT); + } + break; + case EnumValue(TrackCurve::RightLarge): + case EnumValue(TrackCurve::Right): + case EnumValue(TrackCurve::RightSmall): + case EnumValue(TrackCurve::RightVerySmall): + disabledWidgets |= (1uLL << WIDX_BANK_LEFT); + if (_previousTrackRollEnd == TrackRoll::None) + { + disabledWidgets |= (1uLL << WIDX_BANK_RIGHT); + } + else + { + disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT); + } + break; + } + if (!IsTrackEnabled(TRACK_SLOPE_ROLL_BANKING)) + { + if (_currentTrackRollEnd != TrackRoll::None) { - disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT); + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); } - break; - } - if (!IsTrackEnabled(TRACK_SLOPE_ROLL_BANKING)) - { - if (_currentTrackRollEnd != TrackRoll::None) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); } - } - if (_previousTrackPitchEnd == _currentTrackPitchEnd) - { - switch (_currentTrackPitchEnd) + if (_previousTrackPitchEnd == _currentTrackPitchEnd) { - case TrackPitch::Up60: - case TrackPitch::Down60: - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) - | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); - if (!IsTrackEnabled(TRACK_SLOPE_CURVE_STEEP)) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_SMALL); - } - break; - case TrackPitch::Up90: - case TrackPitch::Down90: - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) - | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); - if (!IsTrackEnabled(TRACK_CURVE_VERTICAL)) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_SMALL); - } - break; - default: - break; + switch (_currentTrackPitchEnd) + { + case TrackPitch::Up60: + case TrackPitch::Down60: + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); + if (!IsTrackEnabled(TRACK_SLOPE_CURVE_STEEP)) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_SMALL); + } + break; + case TrackPitch::Up90: + case TrackPitch::Down90: + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); + if (!IsTrackEnabled(TRACK_CURVE_VERTICAL)) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_SMALL); + } + break; + default: + break; + } + } + else + { + // Disable all curves + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); } - } - else - { - // Disable all curves - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) - | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) - | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); - } - switch (_previousTrackPitchEnd) - { - case TrackPitch::None: - if (_currentTrackCurve != EnumValue(TrackCurve::None) - || (IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) && TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) + switch (_previousTrackPitchEnd) + { + case TrackPitch::None: + if (_currentTrackCurve != EnumValue(TrackCurve::None) + || (IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) + && TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); + } + break; + case TrackPitch::Down25: + disabledWidgets |= (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); + break; + case TrackPitch::Down60: + disabledWidgets |= (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); + if (!IsTrackEnabled(TRACK_SLOPE_LONG) + && !( + IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) + && !TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) + { + disabledWidgets |= (1uLL << WIDX_LEVEL); + } + break; + case TrackPitch::Up25: + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN); + break; + case TrackPitch::Up60: + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN); + if (!IsTrackEnabled(TRACK_SLOPE_LONG) + && !( + IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) + && !TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) + { + disabledWidgets |= (1uLL << WIDX_LEVEL); + } + break; + case TrackPitch::Down90: + case TrackPitch::Up90: + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP); + break; + } + if (_previousTrackPitchEnd == TrackPitch::None) + { + if (!IsTrackEnabled(TRACK_SLOPE_LONG) && !IsTrackEnabled(TRACK_SLOPE_STEEP_LONG)) { disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); } - break; - case TrackPitch::Down25: - disabledWidgets |= (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); - break; - case TrackPitch::Down60: - disabledWidgets |= (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP); - if (!IsTrackEnabled(TRACK_SLOPE_LONG) - && !(IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) && !TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) + } + if (IsTrackEnabled(TRACK_SLOPE_VERTICAL)) + { + if (_previousTrackPitchEnd == TrackPitch::Up60 && _currentTrackPieceDirection < 4) { - disabledWidgets |= (1uLL << WIDX_LEVEL); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); } - break; - case TrackPitch::Up25: - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN); - break; - case TrackPitch::Up60: - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN); - if (!IsTrackEnabled(TRACK_SLOPE_LONG) - && !(IsTrackEnabled(TRACK_SLOPE_STEEP_LONG) && !TrackPieceDirectionIsDiagonal(_currentTrackPieceDirection))) + if (_previousTrackPitchEnd == TrackPitch::Up90) { - disabledWidgets |= (1uLL << WIDX_LEVEL); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); } - break; - case TrackPitch::Down90: - case TrackPitch::Up90: - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP); - break; - } - if (_previousTrackPitchEnd == TrackPitch::None) - { - if (!IsTrackEnabled(TRACK_SLOPE_LONG) && !IsTrackEnabled(TRACK_SLOPE_STEEP_LONG)) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); - } - } - if (IsTrackEnabled(TRACK_SLOPE_VERTICAL)) - { - if (_previousTrackPitchEnd == TrackPitch::Up60 && _currentTrackPieceDirection < 4) - { - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); - } - if (_previousTrackPitchEnd == TrackPitch::Up90) - { - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); - } - if (_previousTrackPitchEnd == TrackPitch::Down60 && _currentTrackPieceDirection < 4) - { - disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); - } - } - if (_previousTrackRollEnd == TrackRoll::Left) - { - disabledWidgets |= (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_LARGE) - | (1uLL << WIDX_BANK_RIGHT); - } - if (_previousTrackRollEnd == TrackRoll::Right) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) - | (1uLL << WIDX_BANK_LEFT); - } - if (_currentTrackRollEnd != _previousTrackRollEnd) - { - disabledWidgets |= (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_LARGE) - | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE); - } - if (_currentTrackPitchEnd != TrackPitch::None) - { - if (IsTrackEnabled(TRACK_SLOPE_ROLL_BANKING)) - { - if (_previousTrackPitchEnd == TrackPitch::None) + if (_previousTrackPitchEnd == TrackPitch::Down60 && _currentTrackPieceDirection < 4) { - if (_currentTrackPitchEnd != TrackPitch::Up25 && _currentTrackPitchEnd != TrackPitch::Down25) - { - disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); - } + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); } - else + } + if (_previousTrackRollEnd == TrackRoll::Left) + { + disabledWidgets |= (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_LARGE) | (1uLL << WIDX_BANK_RIGHT); + } + if (_previousTrackRollEnd == TrackRoll::Right) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) + | (1uLL << WIDX_BANK_LEFT); + } + if (_currentTrackRollEnd != _previousTrackRollEnd) + { + disabledWidgets |= (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_LARGE) | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_LEFT_CURVE_LARGE); + } + if (_currentTrackPitchEnd != TrackPitch::None) + { + if (IsTrackEnabled(TRACK_SLOPE_ROLL_BANKING)) { - if (_currentTrackPitchEnd != _previousTrackPitchEnd) - { - disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); - } - else + if (_previousTrackPitchEnd == TrackPitch::None) { if (_currentTrackPitchEnd != TrackPitch::Up25 && _currentTrackPitchEnd != TrackPitch::Down25) { disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); } } - } - } - else - { - disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); - } - } - if (_currentTrackRollEnd != TrackRoll::None || _previousTrackRollEnd != TrackRoll::None) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT); - } - if (_currentTrackCurve != EnumValue(TrackCurve::None)) - { - if (!IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) - { - disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); - } - if (_currentTrackPitchEnd == TrackPitch::None) - { - disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); - } - if (_currentTrackPitchEnd == TrackPitch::Up60) - { - disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); - } - if (_currentTrackPitchEnd == TrackPitch::Down60) - { - disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); - } - } - if (_currentTrackPitchEnd == TrackPitch::Up90 || _previousTrackPitchEnd == TrackPitch::Up90) - { - disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); - } - if (!IsTrackEnabled(TRACK_LIFT_HILL_STEEP)) - { - if (_previousTrackPitchEnd == TrackPitch::Up60 || _currentTrackPitchEnd == TrackPitch::Up60) - { - disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); - } - } - if (_previousTrackRollEnd == TrackRoll::UpsideDown) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) - | (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) - | (1uLL << WIDX_RIGHT_CURVE_LARGE); - } - if (_currentTrackCurve != EnumValue(TrackCurve::None)) - { - if (_currentTrackPitchEnd == TrackPitch::None) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); - } - if (_currentTrackPitchEnd == _previousTrackPitchEnd) - { - if (_currentTrackPitchEnd == TrackPitch::Up25) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); - if (_currentTrackCurve == EnumValue(TrackCurve::Left) || _currentTrackCurve == EnumValue(TrackCurve::Right) - || _rideConstructionState != RideConstructionState::Back || !IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) + else { - disabledWidgets |= (1uLL << WIDX_LEVEL); + if (_currentTrackPitchEnd != _previousTrackPitchEnd) + { + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); + } + else + { + if (_currentTrackPitchEnd != TrackPitch::Up25 && _currentTrackPitchEnd != TrackPitch::Down25) + { + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); + } + } } } - if (_currentTrackPitchEnd == TrackPitch::Down25) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP); - if (_currentTrackCurve == EnumValue(TrackCurve::Left) || _currentTrackCurve == EnumValue(TrackCurve::Right) - || _rideConstructionState != RideConstructionState::Front || !IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) - { - disabledWidgets |= (1uLL << WIDX_LEVEL); - } - } - } - else if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); - if (_currentTrackRollEnd == TrackRoll::Left) - { - disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT); - disabledWidgets &= ~(1uLL << WIDX_BANK_LEFT); - } - if (_currentTrackRollEnd == TrackRoll::Right) - { - disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT); - disabledWidgets &= ~(1uLL << WIDX_BANK_RIGHT); - } - if (_currentTrackRollEnd == TrackRoll::None) + else { disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); - disabledWidgets &= ~(1uLL << WIDX_BANK_STRAIGHT); + } + } + if (_currentTrackRollEnd != TrackRoll::None || _previousTrackRollEnd != TrackRoll::None) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT); + } + if (_currentTrackCurve != EnumValue(TrackCurve::None)) + { + if (!IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) + { + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } if (_currentTrackPitchEnd == TrackPitch::None) { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); - disabledWidgets &= ~(1uLL << WIDX_LEVEL); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } - if (_currentTrackPitchEnd == TrackPitch::Up25) + if (_currentTrackPitchEnd == TrackPitch::Up60) { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL); - disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } - if (_currentTrackPitchEnd == TrackPitch::Down25) + if (_currentTrackPitchEnd == TrackPitch::Down60) { - disabledWidgets |= (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP); - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN); - } - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall)) - { - disabledWidgets &= ~(1uLL << WIDX_LEFT_CURVE_SMALL); - } - if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall)) - { - disabledWidgets &= ~(1uLL << WIDX_RIGHT_CURVE_SMALL); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } } - } - if (_currentTrackCurve != EnumValue(TrackCurve::None) && _currentTrackPitchEnd == TrackPitch::Up60) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_UP); - } - if (_currentTrackCurve != EnumValue(TrackCurve::None) && _currentTrackPitchEnd == TrackPitch::Down60) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN); - } - if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !GetGameState().Cheats.EnableChainLiftOnAllTrack) - { - if (_currentTrackPitchEnd != TrackPitch::None && !IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) + if (_currentTrackPitchEnd == TrackPitch::Up90 || _previousTrackPitchEnd == TrackPitch::Up90) { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) - | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); } if (!IsTrackEnabled(TRACK_LIFT_HILL_STEEP)) { - if (widgets[WIDX_SLOPE_UP_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP) + if (_previousTrackPitchEnd == TrackPitch::Up60 || _currentTrackPitchEnd == TrackPitch::Up60) + { + disabledWidgets |= (1uLL << WIDX_CHAIN_LIFT); + } + } + if (_previousTrackRollEnd == TrackRoll::UpsideDown) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_LEFT_CURVE_LARGE) + | (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_LARGE); + } + if (_currentTrackCurve != EnumValue(TrackCurve::None)) + { + if (_currentTrackPitchEnd == TrackPitch::None) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); + } + if (_currentTrackPitchEnd == _previousTrackPitchEnd) + { + if (_currentTrackPitchEnd == TrackPitch::Up25) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); + if (_currentTrackCurve == EnumValue(TrackCurve::Left) + || _currentTrackCurve == EnumValue(TrackCurve::Right) + || _rideConstructionState != RideConstructionState::Back + || !IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) + { + disabledWidgets |= (1uLL << WIDX_LEVEL); + } + } + if (_currentTrackPitchEnd == TrackPitch::Down25) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP); + if (_currentTrackCurve == EnumValue(TrackCurve::Left) + || _currentTrackCurve == EnumValue(TrackCurve::Right) + || _rideConstructionState != RideConstructionState::Front + || !IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) + { + disabledWidgets |= (1uLL << WIDX_LEVEL); + } + } + } + else if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_UP_STEEP); + if (_currentTrackRollEnd == TrackRoll::Left) + { + disabledWidgets |= (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_LEFT); + } + if (_currentTrackRollEnd == TrackRoll::Right) + { + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_RIGHT); + } + if (_currentTrackRollEnd == TrackRoll::None) + { + disabledWidgets |= (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_RIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_STRAIGHT); + } + if (_currentTrackPitchEnd == TrackPitch::None) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_SLOPE_UP); + disabledWidgets &= ~(1uLL << WIDX_LEVEL); + } + if (_currentTrackPitchEnd == TrackPitch::Up25) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN) | (1uLL << WIDX_LEVEL); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); + } + if (_currentTrackPitchEnd == TrackPitch::Down25) + { + disabledWidgets |= (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP); + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN); + } + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall)) + { + disabledWidgets &= ~(1uLL << WIDX_LEFT_CURVE_SMALL); + } + if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + { + disabledWidgets &= ~(1uLL << WIDX_RIGHT_CURVE_SMALL); + } + } + } + if (_currentTrackCurve != EnumValue(TrackCurve::None) && _currentTrackPitchEnd == TrackPitch::Up60) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_UP); + } + if (_currentTrackCurve != EnumValue(TrackCurve::None) && _currentTrackPitchEnd == TrackPitch::Down60) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN); + } + if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) && !GetGameState().Cheats.EnableChainLiftOnAllTrack) + { + if (_currentTrackPitchEnd != TrackPitch::None && !IsTrackEnabled(TRACK_LIFT_HILL_CURVE)) + { + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE) + | (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_LARGE); + } + if (!IsTrackEnabled(TRACK_LIFT_HILL_STEEP)) + { + if (widgets[WIDX_SLOPE_UP_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); + } + } + } + if (_previousTrackPitchEnd == TrackPitch::Up60 && _currentTrackCurve != EnumValue(TrackCurve::None)) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_LEVEL); + } + if (_previousTrackPitchEnd == TrackPitch::Down60 && _currentTrackCurve != EnumValue(TrackCurve::None)) + { + disabledWidgets |= (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP_STEEP); + } + if (_currentTrackPitchEnd == TrackPitch::Up90 || _previousTrackPitchEnd == TrackPitch::Up90) + { + if (_currentTrackCurve != EnumValue(TrackCurve::None)) { disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); } + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); + if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + { + disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); + } } - } - if (_previousTrackPitchEnd == TrackPitch::Up60 && _currentTrackCurve != EnumValue(TrackCurve::None)) - { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_LEVEL); - } - if (_previousTrackPitchEnd == TrackPitch::Down60 && _currentTrackCurve != EnumValue(TrackCurve::None)) - { - disabledWidgets |= (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP_STEEP); - } - if (_currentTrackPitchEnd == TrackPitch::Up90 || _previousTrackPitchEnd == TrackPitch::Up90) - { - if (_currentTrackCurve != EnumValue(TrackCurve::None)) + else if (_currentTrackPitchEnd == TrackPitch::Down90 || _previousTrackPitchEnd == TrackPitch::Down90) { - disabledWidgets |= (1uLL << WIDX_SLOPE_UP_STEEP); + if (_currentTrackCurve != EnumValue(TrackCurve::None)) + { + disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP); + } + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); + if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + { + disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); + } } - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); - if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + // If the previous track is flat and the next track is flat, attempt to show buttons for helixes + if (_currentTrackPitchEnd == TrackPitch::None && _currentTrackPitchEnd == _previousTrackPitchEnd) { - disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) - | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); + // If the bank is none, attempt to show unbanked quarter helixes + if (_currentTrackRollEnd == TrackRoll::None + && (_currentTrackCurve == EnumValue(TrackCurve::Left) + || _currentTrackCurve == EnumValue(TrackCurve::Right))) + { + if (IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER)) + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); + if (IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); + } + // If the track is banked left or right and curvature is standard size (2.5 tile radius), attempt to show + // buttons for half or quarter helixes + else if ( + (_currentTrackRollEnd == TrackRoll::Left || _currentTrackRollEnd == TrackRoll::Right) + && (_currentTrackCurve == EnumValue(TrackCurve::Left) + || _currentTrackCurve == EnumValue(TrackCurve::Right))) + { + if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER)) + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); + if (IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER)) + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); + } + // If the track is banked left or right and curvature is small size (1.5 tile radius), attempt to show buttons + // for half helixes + else if ( + (_currentTrackRollEnd == TrackRoll::Left || _currentTrackRollEnd == TrackRoll::Right) + && (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) + || _currentTrackCurve == EnumValue(TrackCurve::RightSmall))) + { + if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF)) + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); + if (IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); + } } - } - else if (_currentTrackPitchEnd == TrackPitch::Down90 || _previousTrackPitchEnd == TrackPitch::Down90) - { - if (_currentTrackCurve != EnumValue(TrackCurve::None)) + if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) { - disabledWidgets |= (1uLL << WIDX_SLOPE_DOWN_STEEP); + if (_rideConstructionState == RideConstructionState::Front) + { + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) + || _currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + { + if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None + && (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + || GetGameState().Cheats.EnableAllDrawableTrackPieces)) + { + disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); + } + } + } + else if (_rideConstructionState == RideConstructionState::Back) + { + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) + || _currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + { + if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None) + { + disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN); + } + } + } } - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); - if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + if (_currentTrackPieceDirection >= 4) { - disabledWidgets |= (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) - | (1uLL << WIDX_LEFT_CURVE_SMALL) | (1uLL << WIDX_LEFT_CURVE); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) + | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); } - } - // If the previous track is flat and the next track is flat, attempt to show buttons for helixes - if (_currentTrackPitchEnd == TrackPitch::None && _currentTrackPitchEnd == _previousTrackPitchEnd) - { - // If the bank is none, attempt to show unbanked quarter helixes - if (_currentTrackRollEnd == TrackRoll::None - && (_currentTrackCurve == EnumValue(TrackCurve::Left) || _currentTrackCurve == EnumValue(TrackCurve::Right))) - { - if (IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER)) - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); - if (IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) - disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); - } - // If the track is banked left or right and curvature is standard size (2.5 tile radius), attempt to show buttons - // for half or quarter helixes - else if ( - (_currentTrackRollEnd == TrackRoll::Left || _currentTrackRollEnd == TrackRoll::Right) - && (_currentTrackCurve == EnumValue(TrackCurve::Left) || _currentTrackCurve == EnumValue(TrackCurve::Right))) - { - if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER)) - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); - if (IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER)) - disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); - } - // If the track is banked left or right and curvature is small size (1.5 tile radius), attempt to show buttons for - // half helixes - else if ( - (_currentTrackRollEnd == TrackRoll::Left || _currentTrackRollEnd == TrackRoll::Right) - && (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) - || _currentTrackCurve == EnumValue(TrackCurve::RightSmall))) - { - if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF)) - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN_STEEP); - if (IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) - disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP_STEEP); - } - } - if (IsTrackEnabled(TRACK_SLOPE_CURVE_BANKED)) - { if (_rideConstructionState == RideConstructionState::Front) { - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) - || _currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + disabledWidgets |= (1uLL << WIDX_NEXT_SECTION); + if (WindowRideConstructionUpdateState(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { - if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None - && (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) - || GetGameState().Cheats.EnableAllDrawableTrackPieces)) - { - disabledWidgets &= ~(1uLL << WIDX_SLOPE_UP); - } + disabledWidgets |= (1uLL << WIDX_CONSTRUCT); } } else if (_rideConstructionState == RideConstructionState::Back) { - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) - || _currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + disabledWidgets |= (1uLL << WIDX_PREVIOUS_SECTION); + if (WindowRideConstructionUpdateState(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) { - if (_currentTrackPitchEnd == TrackPitch::None && _previousTrackRollEnd != TrackRoll::None) - { - disabledWidgets &= ~(1uLL << WIDX_SLOPE_DOWN); - } + disabledWidgets |= (1uLL << WIDX_CONSTRUCT); } } - } - if (_currentTrackPieceDirection >= 4) - { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) - | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_SMALL) - | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); - } - if (_rideConstructionState == RideConstructionState::Front) - { - disabledWidgets |= (1uLL << WIDX_NEXT_SECTION); - if (WindowRideConstructionUpdateState(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) { - disabledWidgets |= (1uLL << WIDX_CONSTRUCT); + disabledWidgets &= ~(1uLL << WIDX_BANKING_GROUPBOX); } - } - else if (_rideConstructionState == RideConstructionState::Back) - { - disabledWidgets |= (1uLL << WIDX_PREVIOUS_SECTION); - if (WindowRideConstructionUpdateState(nullptr, nullptr, nullptr, nullptr, nullptr, nullptr)) + if (_rideConstructionState == RideConstructionState::EntranceExit + || _rideConstructionState == RideConstructionState::Selected) { - disabledWidgets |= (1uLL << WIDX_CONSTRUCT); + disabledWidgets |= (1uLL << WIDX_DIRECTION_GROUPBOX) | (1uLL << WIDX_SLOPE_GROUPBOX) + | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) + | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) + | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL) + | (1uLL << WIDX_SPECIAL_TRACK_DROPDOWN) | (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN) + | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT) + | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT) + | (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); } - } - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) - { - disabledWidgets &= ~(1uLL << WIDX_BANKING_GROUPBOX); - } - if (_rideConstructionState == RideConstructionState::EntranceExit - || _rideConstructionState == RideConstructionState::Selected) - { - disabledWidgets |= (1uLL << WIDX_DIRECTION_GROUPBOX) | (1uLL << WIDX_SLOPE_GROUPBOX) - | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE_SMALL) - | (1uLL << WIDX_LEFT_CURVE) | (1uLL << WIDX_STRAIGHT) | (1uLL << WIDX_RIGHT_CURVE) - | (1uLL << WIDX_RIGHT_CURVE_SMALL) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL) - | (1uLL << WIDX_SPECIAL_TRACK_DROPDOWN) | (1uLL << WIDX_SLOPE_DOWN_STEEP) | (1uLL << WIDX_SLOPE_DOWN) - | (1uLL << WIDX_LEVEL) | (1uLL << WIDX_SLOPE_UP) | (1uLL << WIDX_SLOPE_UP_STEEP) | (1uLL << WIDX_CHAIN_LIFT) - | (1uLL << WIDX_BANK_LEFT) | (1uLL << WIDX_BANK_STRAIGHT) | (1uLL << WIDX_BANK_RIGHT) - | (1uLL << WIDX_LEFT_CURVE_LARGE) | (1uLL << WIDX_RIGHT_CURVE_LARGE); - } - if (_currentlyShowingBrakeOrBoosterSpeed) - { - disabledWidgets &= ~(1uLL << WIDX_BANKING_GROUPBOX); - disabledWidgets &= ~(1uLL << WIDX_BANK_LEFT); - disabledWidgets &= ~(1uLL << WIDX_BANK_STRAIGHT); - disabledWidgets &= ~(1uLL << WIDX_BANK_RIGHT); - } - - // If chain lift cheat is enabled then show the chain lift widget no matter what - if (GetGameState().Cheats.EnableChainLiftOnAllTrack) - { - disabledWidgets &= ~(1uLL << WIDX_CHAIN_LIFT); - } - - // Set and invalidate the changed widgets - uint64_t currentDisabledWidgets = disabled_widgets; - if (currentDisabledWidgets == disabledWidgets) - return; - - for (WidgetIndex i = 0; i < 64; i++) - { - if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) + if (_currentlyShowingBrakeOrBoosterSpeed) { - WidgetInvalidate(*this, i); + disabledWidgets &= ~(1uLL << WIDX_BANKING_GROUPBOX); + disabledWidgets &= ~(1uLL << WIDX_BANK_LEFT); + disabledWidgets &= ~(1uLL << WIDX_BANK_STRAIGHT); + disabledWidgets &= ~(1uLL << WIDX_BANK_RIGHT); } - } - disabled_widgets = disabledWidgets; - } - void OnUpdate() override - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; + // If chain lift cheat is enabled then show the chain lift widget no matter what + if (GetGameState().Cheats.EnableChainLiftOnAllTrack) + { + disabledWidgets &= ~(1uLL << WIDX_CHAIN_LIFT); + } + + // Set and invalidate the changed widgets + uint64_t currentDisabledWidgets = disabled_widgets; + if (currentDisabledWidgets == disabledWidgets) + return; + + for (WidgetIndex i = 0; i < 64; i++) + { + if ((disabledWidgets & (1uLL << i)) != (currentDisabledWidgets & (1uLL << i))) + { + WidgetInvalidate(*this, i); + } + } + disabled_widgets = disabledWidgets; } - // Close construction window if currentRide is not closed, - // editing currentRide while open will cause many issues until properly handled - if (currentRide->status != RideStatus::Closed && currentRide->status != RideStatus::Simulating) + void OnUpdate() override { - Close(); - return; - } + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) + { + return; + } - switch (_currentTrackCurve) - { - case TrackElemType::SpinningTunnel | RideConstructionSpecialPieceSelected: - case TrackElemType::Whirlpool | RideConstructionSpecialPieceSelected: - case TrackElemType::Rapids | RideConstructionSpecialPieceSelected: - case TrackElemType::Waterfall | RideConstructionSpecialPieceSelected: - WidgetInvalidate(*this, WIDX_CONSTRUCT); - break; - } - - if (_rideConstructionState == RideConstructionState::Place) - { - if (!WidgetIsActiveTool(*this, WIDX_CONSTRUCT)) + // Close construction window if currentRide is not closed, + // editing currentRide while open will cause many issues until properly handled + if (currentRide->status != RideStatus::Closed && currentRide->status != RideStatus::Simulating) { Close(); return; } + + switch (_currentTrackCurve) + { + case TrackElemType::SpinningTunnel | RideConstructionSpecialPieceSelected: + case TrackElemType::Whirlpool | RideConstructionSpecialPieceSelected: + case TrackElemType::Rapids | RideConstructionSpecialPieceSelected: + case TrackElemType::Waterfall | RideConstructionSpecialPieceSelected: + WidgetInvalidate(*this, WIDX_CONSTRUCT); + break; + } + + if (_rideConstructionState == RideConstructionState::Place) + { + if (!WidgetIsActiveTool(*this, WIDX_CONSTRUCT)) + { + Close(); + return; + } + } + + if (_rideConstructionState == RideConstructionState::EntranceExit) + { + if (!WidgetIsActiveTool(*this, WIDX_ENTRANCE) && !WidgetIsActiveTool(*this, WIDX_EXIT)) + { + _rideConstructionState = gRideEntranceExitPlacePreviousRideConstructionState; + WindowRideConstructionUpdateActiveElements(); + } + } + + switch (_rideConstructionState) + { + case RideConstructionState::Front: + case RideConstructionState::Back: + case RideConstructionState::Selected: + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + && gCurrentToolWidget.window_classification == WindowClass::RideConstruction) + { + ToolCancel(); + } + break; + default: + break; + } + + UpdateGhostTrackAndArrow(); } - if (_rideConstructionState == RideConstructionState::EntranceExit) + void OnMouseUp(WidgetIndex widgetIndex) override { - if (!WidgetIsActiveTool(*this, WIDX_ENTRANCE) && !WidgetIsActiveTool(*this, WIDX_EXIT)) + WindowRideConstructionUpdateEnabledTrackPieces(); + switch (widgetIndex) { - _rideConstructionState = gRideEntranceExitPlacePreviousRideConstructionState; - WindowRideConstructionUpdateActiveElements(); + case WIDX_CLOSE: + Close(); + break; + case WIDX_NEXT_SECTION: + RideSelectNextSection(); + break; + case WIDX_PREVIOUS_SECTION: + RideSelectPreviousSection(); + break; + case WIDX_CONSTRUCT: + Construct(); + // Force any footpath construction to recheck the area. + gProvisionalFootpath.Flags |= PROVISIONAL_PATH_FLAG_2; + break; + case WIDX_DEMOLISH: + MouseUpDemolish(); + break; + case WIDX_ROTATE: + Rotate(); + break; + case WIDX_ENTRANCE: + EntranceClick(); + break; + case WIDX_EXIT: + ExitClick(); + break; + case WIDX_SIMULATE: + { + auto currentRide = GetRide(_currentRideIndex); + if (currentRide != nullptr) + { + auto status = currentRide->status == RideStatus::Simulating ? RideStatus::Closed + : RideStatus::Simulating; + auto gameAction = RideSetStatusAction(currentRide->id, status); + GameActions::Execute(&gameAction); + } + break; + } } } - switch (_rideConstructionState) + void OnMouseDown(WidgetIndex widgetIndex) override { - case RideConstructionState::Front: - case RideConstructionState::Back: - case RideConstructionState::Selected: - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - && gCurrentToolWidget.window_classification == WindowClass::RideConstruction) - { - ToolCancel(); - } - break; - default: - break; - } - - UpdateGhostTrackAndArrow(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - WindowRideConstructionUpdateEnabledTrackPieces(); - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_NEXT_SECTION: - RideSelectNextSection(); - break; - case WIDX_PREVIOUS_SECTION: - RideSelectPreviousSection(); - break; - case WIDX_CONSTRUCT: - Construct(); - // Force any footpath construction to recheck the area. - gProvisionalFootpath.Flags |= PROVISIONAL_PATH_FLAG_2; - break; - case WIDX_DEMOLISH: - MouseUpDemolish(); - break; - case WIDX_ROTATE: - Rotate(); - break; - case WIDX_ENTRANCE: - EntranceClick(); - break; - case WIDX_EXIT: - ExitClick(); - break; - case WIDX_SIMULATE: + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide != nullptr) - { - auto status = currentRide->status == RideStatus::Simulating ? RideStatus::Closed : RideStatus::Simulating; - auto gameAction = RideSetStatusAction(currentRide->id, status); - GameActions::Execute(&gameAction); - } - break; + return; } - } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; - } - - WindowRideConstructionUpdateEnabledTrackPieces(); - switch (widgetIndex) - { - case WIDX_LEFT_CURVE: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::Left); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_RIGHT_CURVE: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::Right); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_LEFT_CURVE_SMALL: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::LeftSmall); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_RIGHT_CURVE_SMALL: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::RightSmall); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_LEFT_CURVE_VERY_SMALL: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::LeftVerySmall); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_RIGHT_CURVE_VERY_SMALL: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::RightVerySmall); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_LEFT_CURVE_LARGE: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::LeftLarge); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_RIGHT_CURVE_LARGE: - RideConstructionInvalidateCurrentTrack(); - _currentTrackCurve = EnumValue(TrackCurve::RightLarge); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_STRAIGHT: - RideConstructionInvalidateCurrentTrack(); - if (_currentTrackCurve != EnumValue(TrackCurve::None)) - _currentTrackRollEnd = TrackRoll::None; - _currentTrackCurve = EnumValue(TrackCurve::None); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_SLOPE_DOWN_STEEP: - RideConstructionInvalidateCurrentTrack(); - if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) - { - if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) + WindowRideConstructionUpdateEnabledTrackPieces(); + switch (widgetIndex) + { + case WIDX_LEFT_CURVE: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::Left); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_RIGHT_CURVE: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::Right); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_LEFT_CURVE_SMALL: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::LeftSmall); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_RIGHT_CURVE_SMALL: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::RightSmall); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_LEFT_CURVE_VERY_SMALL: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::LeftVerySmall); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_RIGHT_CURVE_VERY_SMALL: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::RightVerySmall); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_LEFT_CURVE_LARGE: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::LeftLarge); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_RIGHT_CURVE_LARGE: + RideConstructionInvalidateCurrentTrack(); + _currentTrackCurve = EnumValue(TrackCurve::RightLarge); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_STRAIGHT: + RideConstructionInvalidateCurrentTrack(); + if (_currentTrackCurve != EnumValue(TrackCurve::None)) + _currentTrackRollEnd = TrackRoll::None; + _currentTrackCurve = EnumValue(TrackCurve::None); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_SLOPE_DOWN_STEEP: + RideConstructionInvalidateCurrentTrack(); + if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) { - _currentTrackCurve = TrackElemType::LeftHalfBankedHelixDownLarge | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) - { - _currentTrackCurve = TrackElemType::RightHalfBankedHelixDownLarge - | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) && _currentTrackRollEnd == TrackRoll::Left) - { - _currentTrackCurve = TrackElemType::LeftHalfBankedHelixDownSmall | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall) && _currentTrackRollEnd == TrackRoll::Right) - { - _currentTrackCurve = TrackElemType::RightHalfBankedHelixDownSmall - | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - } - if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER)) - { - if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) - { - _currentTrackCurve = TrackElemType::LeftQuarterBankedHelixLargeDown - | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) - { - _currentTrackCurve = TrackElemType::RightQuarterBankedHelixLargeDown - | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - } - if (IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) - { - if (_currentTrackRollEnd == TrackRoll::None) - { - if (_currentTrackCurve == EnumValue(TrackCurve::Left)) + if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) { - _currentTrackCurve = TrackElemType::LeftQuarterHelixLargeDown + _currentTrackCurve = TrackElemType::LeftHalfBankedHelixDownLarge | RideConstructionSpecialPieceSelected; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); break; } - if (_currentTrackCurve == EnumValue(TrackCurve::Right)) + if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) { - _currentTrackCurve = TrackElemType::RightQuarterHelixLargeDown + _currentTrackCurve = TrackElemType::RightHalfBankedHelixDownLarge + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) && _currentTrackRollEnd == TrackRoll::Left) + { + _currentTrackCurve = TrackElemType::LeftHalfBankedHelixDownSmall + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall) && _currentTrackRollEnd == TrackRoll::Right) + { + _currentTrackCurve = TrackElemType::RightHalfBankedHelixDownSmall | RideConstructionSpecialPieceSelected; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); break; } } - } - if (widgets[WIDX_SLOPE_DOWN_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP) - { - UpdateLiftHillSelected(TrackPitch::Down60); - } - else - { - UpdateLiftHillSelected(TrackPitch::Up90); - } - break; - case WIDX_SLOPE_DOWN: - RideConstructionInvalidateCurrentTrack(); - if (_rideConstructionState == RideConstructionState::Back && _currentTrackRollEnd != TrackRoll::None) - { - _currentTrackRollEnd = TrackRoll::None; - } - UpdateLiftHillSelected(TrackPitch::Down25); - break; - case WIDX_LEVEL: - RideConstructionInvalidateCurrentTrack(); - if (_rideConstructionState == RideConstructionState::Front && _previousTrackPitchEnd == TrackPitch::Down25) - { - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall)) + if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER)) { - _currentTrackRollEnd = TrackRoll::Left; - } - else if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall)) - { - _currentTrackRollEnd = TrackRoll::Right; - } - } - else if (_rideConstructionState == RideConstructionState::Back && _previousTrackPitchEnd == TrackPitch::Up25) - { - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall)) - { - _currentTrackRollEnd = TrackRoll::Left; - } - else if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall)) - { - _currentTrackRollEnd = TrackRoll::Right; - } - } - UpdateLiftHillSelected(TrackPitch::None); - break; - case WIDX_SLOPE_UP: - RideConstructionInvalidateCurrentTrack(); - if (_rideConstructionState == RideConstructionState::Front && _currentTrackRollEnd != TrackRoll::None) - { - _currentTrackRollEnd = TrackRoll::None; - } - if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) - { - if (_rideConstructionState == RideConstructionState::Front - && _currentTrackCurve == EnumValue(TrackCurve::None)) - { - _currentTrackCurve = TrackElemType::ReverseFreefallSlope | RideConstructionSpecialPieceSelected; - WindowRideConstructionUpdateActiveElements(); - } - } - else - { - UpdateLiftHillSelected(TrackPitch::Up25); - } - break; - case WIDX_SLOPE_UP_STEEP: - RideConstructionInvalidateCurrentTrack(); - if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) - { - if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) - { - _currentTrackCurve = TrackElemType::LeftHalfBankedHelixUpLarge | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) - { - _currentTrackCurve = TrackElemType::RightHalfBankedHelixUpLarge | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) && _currentTrackRollEnd == TrackRoll::Left) - { - _currentTrackCurve = TrackElemType::LeftHalfBankedHelixUpSmall | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall) && _currentTrackRollEnd == TrackRoll::Right) - { - _currentTrackCurve = TrackElemType::RightHalfBankedHelixUpSmall | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - } - if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER)) - { - if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) - { - _currentTrackCurve = TrackElemType::LeftQuarterBankedHelixLargeUp - | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) - { - _currentTrackCurve = TrackElemType::RightQuarterBankedHelixLargeUp - | RideConstructionSpecialPieceSelected; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - } - } - if (IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) - { - if (_currentTrackRollEnd == TrackRoll::None) - { - if (_currentTrackCurve == EnumValue(TrackCurve::Left)) + if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) { - _currentTrackCurve = TrackElemType::LeftQuarterHelixLargeUp | RideConstructionSpecialPieceSelected; + _currentTrackCurve = TrackElemType::LeftQuarterBankedHelixLargeDown + | RideConstructionSpecialPieceSelected; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); break; } - if (_currentTrackCurve == EnumValue(TrackCurve::Right)) + if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) { - _currentTrackCurve = TrackElemType::RightQuarterHelixLargeUp | RideConstructionSpecialPieceSelected; + _currentTrackCurve = TrackElemType::RightQuarterBankedHelixLargeDown + | RideConstructionSpecialPieceSelected; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); break; } } - } - if (widgets[WIDX_SLOPE_UP_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP) - { - UpdateLiftHillSelected(TrackPitch::Up60); - } - else - { - UpdateLiftHillSelected(TrackPitch::Down90); - } - break; - case WIDX_CHAIN_LIFT: - RideConstructionInvalidateCurrentTrack(); - _currentTrackLiftHill ^= CONSTRUCTION_LIFT_HILL_SELECTED; - if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) - && !GetGameState().Cheats.EnableChainLiftOnAllTrack) + if (IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) + { + if (_currentTrackRollEnd == TrackRoll::None) + { + if (_currentTrackCurve == EnumValue(TrackCurve::Left)) + { + _currentTrackCurve = TrackElemType::LeftQuarterHelixLargeDown + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::Right)) + { + _currentTrackCurve = TrackElemType::RightQuarterHelixLargeDown + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + } + } + if (widgets[WIDX_SLOPE_DOWN_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP) + { + UpdateLiftHillSelected(TrackPitch::Down60); + } + else + { + UpdateLiftHillSelected(TrackPitch::Up90); + } + break; + case WIDX_SLOPE_DOWN: + RideConstructionInvalidateCurrentTrack(); + if (_rideConstructionState == RideConstructionState::Back && _currentTrackRollEnd != TrackRoll::None) + { + _currentTrackRollEnd = TrackRoll::None; + } + UpdateLiftHillSelected(TrackPitch::Down25); + break; + case WIDX_LEVEL: + RideConstructionInvalidateCurrentTrack(); + if (_rideConstructionState == RideConstructionState::Front && _previousTrackPitchEnd == TrackPitch::Down25) + { + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall)) + { + _currentTrackRollEnd = TrackRoll::Left; + } + else if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + { + _currentTrackRollEnd = TrackRoll::Right; + } + } + else if ( + _rideConstructionState == RideConstructionState::Back && _previousTrackPitchEnd == TrackPitch::Up25) + { + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall)) + { + _currentTrackRollEnd = TrackRoll::Left; + } + else if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall)) + { + _currentTrackRollEnd = TrackRoll::Right; + } + } + UpdateLiftHillSelected(TrackPitch::None); + break; + case WIDX_SLOPE_UP: + RideConstructionInvalidateCurrentTrack(); + if (_rideConstructionState == RideConstructionState::Front && _currentTrackRollEnd != TrackRoll::None) + { + _currentTrackRollEnd = TrackRoll::None; + } + if (currentRide->GetRideTypeDescriptor().SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + { + if (_rideConstructionState == RideConstructionState::Front + && _currentTrackCurve == EnumValue(TrackCurve::None)) + { + _currentTrackCurve = TrackElemType::ReverseFreefallSlope | RideConstructionSpecialPieceSelected; + WindowRideConstructionUpdateActiveElements(); + } + } + else + { + UpdateLiftHillSelected(TrackPitch::Up25); + } + break; + case WIDX_SLOPE_UP_STEEP: + RideConstructionInvalidateCurrentTrack(); + if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) + { + if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) + { + _currentTrackCurve = TrackElemType::LeftHalfBankedHelixUpLarge + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) + { + _currentTrackCurve = TrackElemType::RightHalfBankedHelixUpLarge + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::LeftSmall) && _currentTrackRollEnd == TrackRoll::Left) + { + _currentTrackCurve = TrackElemType::LeftHalfBankedHelixUpSmall + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::RightSmall) && _currentTrackRollEnd == TrackRoll::Right) + { + _currentTrackCurve = TrackElemType::RightHalfBankedHelixUpSmall + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + } + if (IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER)) + { + if (_currentTrackCurve == EnumValue(TrackCurve::Left) && _currentTrackRollEnd == TrackRoll::Left) + { + _currentTrackCurve = TrackElemType::LeftQuarterBankedHelixLargeUp + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::Right) && _currentTrackRollEnd == TrackRoll::Right) + { + _currentTrackCurve = TrackElemType::RightQuarterBankedHelixLargeUp + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + } + if (IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) + { + if (_currentTrackRollEnd == TrackRoll::None) + { + if (_currentTrackCurve == EnumValue(TrackCurve::Left)) + { + _currentTrackCurve = TrackElemType::LeftQuarterHelixLargeUp + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + if (_currentTrackCurve == EnumValue(TrackCurve::Right)) + { + _currentTrackCurve = TrackElemType::RightQuarterHelixLargeUp + | RideConstructionSpecialPieceSelected; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + } + } + } + if (widgets[WIDX_SLOPE_UP_STEEP].tooltip == STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP) + { + UpdateLiftHillSelected(TrackPitch::Up60); + } + else + { + UpdateLiftHillSelected(TrackPitch::Down90); + } + break; + case WIDX_CHAIN_LIFT: + RideConstructionInvalidateCurrentTrack(); + _currentTrackLiftHill ^= CONSTRUCTION_LIFT_HILL_SELECTED; + if ((_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) + && !GetGameState().Cheats.EnableChainLiftOnAllTrack) + _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_BANK_LEFT: + RideConstructionInvalidateCurrentTrack(); + if (!_currentlyShowingBrakeOrBoosterSpeed) + { + _currentTrackRollEnd = TrackRoll::Left; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + } + break; + case WIDX_BANK_STRAIGHT: + RideConstructionInvalidateCurrentTrack(); + if (!_currentlyShowingBrakeOrBoosterSpeed) + { + _currentTrackRollEnd = TrackRoll::None; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + } + else + { + uint8_t* brakesSpeedPtr = &_currentBrakeSpeed2; + uint8_t maxBrakesSpeed = 30; + uint8_t brakesSpeed = *brakesSpeedPtr + 2; + if (brakesSpeed <= maxBrakesSpeed) + { + if (_rideConstructionState == RideConstructionState::Selected) + { + SetBrakeSpeed(brakesSpeed); + } + else + { + *brakesSpeedPtr = brakesSpeed; + WindowRideConstructionUpdateActiveElements(); + } + } + } + break; + case WIDX_BANK_RIGHT: + RideConstructionInvalidateCurrentTrack(); + if (!_currentlyShowingBrakeOrBoosterSpeed) + { + _currentTrackRollEnd = TrackRoll::Right; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + } + else + { + uint8_t* brakesSpeedPtr = &_currentBrakeSpeed2; + uint8_t brakesSpeed = *brakesSpeedPtr - 2; + if (brakesSpeed >= 2) + { + if (_rideConstructionState == RideConstructionState::Selected) + { + SetBrakeSpeed(brakesSpeed); + } + else + { + *brakesSpeedPtr = brakesSpeed; + WindowRideConstructionUpdateActiveElements(); + } + } + } + break; + case WIDX_SPECIAL_TRACK_DROPDOWN: + ShowSpecialTrackDropdown(&widgets[widgetIndex]); + break; + case WIDX_U_TRACK: + RideConstructionInvalidateCurrentTrack(); _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_BANK_LEFT: - RideConstructionInvalidateCurrentTrack(); - if (!_currentlyShowingBrakeOrBoosterSpeed) - { - _currentTrackRollEnd = TrackRoll::Left; _currentTrackPrice = kMoney64Undefined; WindowRideConstructionUpdateActiveElements(); - } - break; - case WIDX_BANK_STRAIGHT: - RideConstructionInvalidateCurrentTrack(); - if (!_currentlyShowingBrakeOrBoosterSpeed) - { + break; + case WIDX_O_TRACK: + RideConstructionInvalidateCurrentTrack(); + _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; + if (!GetGameState().Cheats.EnableChainLiftOnAllTrack) + _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + break; + case WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP: + if (_currentSeatRotationAngle < 15) + { + if (_rideConstructionState == RideConstructionState::Selected) + { + RideSelectedTrackSetSeatRotation(_currentSeatRotationAngle + 1); + } + else + { + _currentSeatRotationAngle++; + WindowRideConstructionUpdateActiveElements(); + } + } + break; + case WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN: + if (_currentSeatRotationAngle > 0) + { + if (_rideConstructionState == RideConstructionState::Selected) + { + RideSelectedTrackSetSeatRotation(_currentSeatRotationAngle - 1); + } + else + { + _currentSeatRotationAngle--; + WindowRideConstructionUpdateActiveElements(); + } + } + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (widgetIndex != WIDX_SPECIAL_TRACK_DROPDOWN) + return; + if (selectedIndex == -1) + return; + + RideConstructionInvalidateCurrentTrack(); + _currentTrackPrice = kMoney64Undefined; + track_type_t trackPiece = _specialElementDropdownState.Elements[selectedIndex].TrackType; + switch (trackPiece) + { + case TrackElemType::EndStation: + case TrackElemType::SBendLeft: + case TrackElemType::SBendRight: + _currentTrackPitchEnd = TrackPitch::None; + break; + case TrackElemType::LeftVerticalLoop: + case TrackElemType::RightVerticalLoop: _currentTrackRollEnd = TrackRoll::None; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - } - else - { - uint8_t* brakesSpeedPtr = &_currentBrakeSpeed2; - uint8_t maxBrakesSpeed = 30; - uint8_t brakesSpeed = *brakesSpeedPtr + 2; - if (brakesSpeed <= maxBrakesSpeed) - { - if (_rideConstructionState == RideConstructionState::Selected) - { - SetBrakeSpeed(brakesSpeed); - } - else - { - *brakesSpeedPtr = brakesSpeed; - WindowRideConstructionUpdateActiveElements(); - } - } - } - break; - case WIDX_BANK_RIGHT: - RideConstructionInvalidateCurrentTrack(); - if (!_currentlyShowingBrakeOrBoosterSpeed) - { - _currentTrackRollEnd = TrackRoll::Right; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - } - else - { - uint8_t* brakesSpeedPtr = &_currentBrakeSpeed2; - uint8_t brakesSpeed = *brakesSpeedPtr - 2; - if (brakesSpeed >= 2) - { - if (_rideConstructionState == RideConstructionState::Selected) - { - SetBrakeSpeed(brakesSpeed); - } - else - { - *brakesSpeedPtr = brakesSpeed; - WindowRideConstructionUpdateActiveElements(); - } - } - } - break; - case WIDX_SPECIAL_TRACK_DROPDOWN: - ShowSpecialTrackDropdown(&widgets[widgetIndex]); - break; - case WIDX_U_TRACK: - RideConstructionInvalidateCurrentTrack(); - _currentTrackAlternative &= ~RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_O_TRACK: - RideConstructionInvalidateCurrentTrack(); - _currentTrackAlternative |= RIDE_TYPE_ALTERNATIVE_TRACK_PIECES; - if (!GetGameState().Cheats.EnableChainLiftOnAllTrack) _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - break; - case WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP: - if (_currentSeatRotationAngle < 15) - { - if (_rideConstructionState == RideConstructionState::Selected) - { - RideSelectedTrackSetSeatRotation(_currentSeatRotationAngle + 1); - } - else - { - _currentSeatRotationAngle++; - WindowRideConstructionUpdateActiveElements(); - } - } - break; - case WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN: - if (_currentSeatRotationAngle > 0) - { - if (_rideConstructionState == RideConstructionState::Selected) - { - RideSelectedTrackSetSeatRotation(_currentSeatRotationAngle - 1); - } - else - { - _currentSeatRotationAngle--; - WindowRideConstructionUpdateActiveElements(); - } - } - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (widgetIndex != WIDX_SPECIAL_TRACK_DROPDOWN) - return; - if (selectedIndex == -1) - return; - - RideConstructionInvalidateCurrentTrack(); - _currentTrackPrice = kMoney64Undefined; - track_type_t trackPiece = _specialElementDropdownState.Elements[selectedIndex].TrackType; - switch (trackPiece) - { - case TrackElemType::EndStation: - case TrackElemType::SBendLeft: - case TrackElemType::SBendRight: - _currentTrackPitchEnd = TrackPitch::None; - break; - case TrackElemType::LeftVerticalLoop: - case TrackElemType::RightVerticalLoop: - _currentTrackRollEnd = TrackRoll::None; - _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; - break; - case TrackElemType::BlockBrakes: - case TrackElemType::DiagBlockBrakes: - _currentBrakeSpeed2 = kRCT2DefaultBlockBrakeSpeed; - } - _currentTrackCurve = trackPiece | RideConstructionSpecialPieceSelected; - WindowRideConstructionUpdateActiveElements(); - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_CONSTRUCT: - RideConstructionToolupdateConstruct(screenCoords); - break; - case WIDX_ENTRANCE: - case WIDX_EXIT: - RideConstructionToolupdateEntranceExit(screenCoords); - break; - } - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_CONSTRUCT: - RideConstructionTooldownConstruct(screenCoords); - break; - case WIDX_ENTRANCE: - case WIDX_EXIT: - ToolDownEntranceExit(screenCoords); - break; - } - } - - void OnPrepareDraw() override - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; + break; + case TrackElemType::BlockBrakes: + case TrackElemType::DiagBlockBrakes: + _currentBrakeSpeed2 = kRCT2DefaultBlockBrakeSpeed; + } + _currentTrackCurve = trackPiece | RideConstructionSpecialPieceSelected; + WindowRideConstructionUpdateActiveElements(); } - StringId stringId = STR_RIDE_CONSTRUCTION_SPECIAL; - if (_currentTrackCurve & RideConstructionSpecialPieceSelected) + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - const auto& rtd = currentRide->GetRideTypeDescriptor(); - const auto& ted = GetTrackElementDescriptor(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); - stringId = ted.Description; - if (stringId == STR_RAPIDS && rtd.Category != RIDE_CATEGORY_WATER) + switch (widgetIndex) { - stringId = STR_LOG_BUMPS; + case WIDX_CONSTRUCT: + RideConstructionToolupdateConstruct(screenCoords); + break; + case WIDX_ENTRANCE: + case WIDX_EXIT: + RideConstructionToolupdateEntranceExit(screenCoords); + break; } } - auto ft = Formatter::Common(); - ft.Add(stringId); - if (_currentlyShowingBrakeOrBoosterSpeed) + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - uint16_t brakeSpeed2 = ((_currentBrakeSpeed2 * 9) >> 2) & 0xFFFF; - if (TrackTypeIsBooster(_selectedTrackType) - || TrackTypeIsBooster(_currentTrackCurve & ~RideConstructionSpecialPieceSelected)) + switch (widgetIndex) { - brakeSpeed2 = GetBoosterSpeed(currentRide->type, brakeSpeed2); + case WIDX_CONSTRUCT: + RideConstructionTooldownConstruct(screenCoords); + break; + case WIDX_ENTRANCE: + case WIDX_EXIT: + ToolDownEntranceExit(screenCoords); + break; } - ft.Add(brakeSpeed2); } - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].text = RideConstructionSeatAngleRotationStrings[_currentSeatRotationAngle]; - - // Simulate button - auto& simulateWidget = widgets[WIDX_SIMULATE]; - simulateWidget.type = WindowWidgetType::Empty; - if (currentRide->SupportsStatus(RideStatus::Simulating)) + void OnPrepareDraw() override { - simulateWidget.type = WindowWidgetType::FlatBtn; - if (currentRide->status == RideStatus::Simulating) + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) { - pressed_widgets |= (1uLL << WIDX_SIMULATE); + return; + } + + StringId stringId = STR_RIDE_CONSTRUCTION_SPECIAL; + if (_currentTrackCurve & RideConstructionSpecialPieceSelected) + { + const auto& rtd = currentRide->GetRideTypeDescriptor(); + const auto& ted = GetTrackElementDescriptor(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); + stringId = ted.Description; + if (stringId == STR_RAPIDS && rtd.Category != RIDE_CATEGORY_WATER) + { + stringId = STR_LOG_BUMPS; + } + } + auto ft = Formatter::Common(); + ft.Add(stringId); + + if (_currentlyShowingBrakeOrBoosterSpeed) + { + uint16_t brakeSpeed2 = ((_currentBrakeSpeed2 * 9) >> 2) & 0xFFFF; + if (TrackTypeIsBooster(_selectedTrackType) + || TrackTypeIsBooster(_currentTrackCurve & ~RideConstructionSpecialPieceSelected)) + { + brakeSpeed2 = GetBoosterSpeed(currentRide->type, brakeSpeed2); + } + ft.Add(brakeSpeed2); + } + + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].text = RideConstructionSeatAngleRotationStrings + [_currentSeatRotationAngle]; + + // Simulate button + auto& simulateWidget = widgets[WIDX_SIMULATE]; + simulateWidget.type = WindowWidgetType::Empty; + if (currentRide->SupportsStatus(RideStatus::Simulating)) + { + simulateWidget.type = WindowWidgetType::FlatBtn; + if (currentRide->status == RideStatus::Simulating) + { + pressed_widgets |= (1uLL << WIDX_SIMULATE); + } + else + { + pressed_widgets &= ~(1uLL << WIDX_SIMULATE); + } + } + + // Set window title arguments + ft = Formatter::Common(); + ft.Increment(4); + currentRide->FormatNameTo(ft); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawPixelInfo clipdpi; + Widget* widget; + int32_t widgetWidth, widgetHeight; + + DrawWidgets(dpi); + + widget = &widgets[WIDX_CONSTRUCT]; + if (widget->type == WindowWidgetType::Empty) + return; + + RideId rideIndex; + int32_t trackType, trackDirection, liftHillAndInvertedState; + if (WindowRideConstructionUpdateState( + &trackType, &trackDirection, &rideIndex, &liftHillAndInvertedState, nullptr, nullptr)) + return; + + // Draw track piece + auto screenCoords = ScreenCoordsXY{ windowPos.x + widget->left + 1, windowPos.y + widget->top + 1 }; + widgetWidth = widget->width() - 1; + widgetHeight = widget->height() - 1; + if (ClipDrawPixelInfo(clipdpi, dpi, screenCoords, widgetWidth, widgetHeight)) + { + DrawTrackPiece( + clipdpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, widgetWidth, widgetHeight); + } + + // Draw cost + screenCoords = { windowPos.x + widget->midX(), windowPos.y + widget->bottom - 23 }; + if (_rideConstructionState != RideConstructionState::Place) + DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); + + screenCoords.y += 11; + if (_currentTrackPrice != kMoney64Undefined && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(_currentTrackPrice); + DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); + } + } + + void UpdateWidgets() + { + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) + { + return; + } + int32_t rideType = RideGetAlternativeType(*currentRide); + + hold_down_widgets = 0; + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY) || !currentRide->HasStation()) + { + widgets[WIDX_ENTRANCE_EXIT_GROUPBOX].type = WindowWidgetType::Empty; + widgets[WIDX_ENTRANCE].type = WindowWidgetType::Empty; + widgets[WIDX_EXIT].type = WindowWidgetType::Empty; } else { - pressed_widgets &= ~(1uLL << WIDX_SIMULATE); + widgets[WIDX_ENTRANCE_EXIT_GROUPBOX].type = WindowWidgetType::Groupbox; + widgets[WIDX_ENTRANCE].type = WindowWidgetType::Button; + widgets[WIDX_EXIT].type = WindowWidgetType::Button; } - } - // Set window title arguments - ft = Formatter::Common(); - ft.Increment(4); - currentRide->FormatNameTo(ft); - } + if (_specialElementDropdownState.HasActiveElements) + { + widgets[WIDX_SPECIAL_TRACK_DROPDOWN].type = WindowWidgetType::Button; + } + else + { + widgets[WIDX_SPECIAL_TRACK_DROPDOWN].type = WindowWidgetType::Empty; + } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawPixelInfo clipdpi; - Widget* widget; - int32_t widgetWidth, widgetHeight; + if (IsTrackEnabled(TRACK_STRAIGHT)) + { + widgets[WIDX_STRAIGHT].type = WindowWidgetType::FlatBtn; + } + else + { + widgets[WIDX_STRAIGHT].type = WindowWidgetType::Empty; + } - DrawWidgets(dpi); + if (IsTrackEnabled(TRACK_CURVE_LARGE)) + { + widgets[WIDX_LEFT_CURVE_LARGE].type = WindowWidgetType::FlatBtn; + widgets[WIDX_RIGHT_CURVE_LARGE].type = WindowWidgetType::FlatBtn; + } + else + { + widgets[WIDX_LEFT_CURVE_LARGE].type = WindowWidgetType::Empty; + widgets[WIDX_RIGHT_CURVE_LARGE].type = WindowWidgetType::Empty; + } - widget = &widgets[WIDX_CONSTRUCT]; - if (widget->type == WindowWidgetType::Empty) - return; + widgets[WIDX_LEFT_CURVE].type = WindowWidgetType::Empty; + widgets[WIDX_RIGHT_CURVE].type = WindowWidgetType::Empty; + widgets[WIDX_LEFT_CURVE_SMALL].type = WindowWidgetType::Empty; + widgets[WIDX_RIGHT_CURVE_SMALL].type = WindowWidgetType::Empty; + widgets[WIDX_LEFT_CURVE_VERY_SMALL].type = WindowWidgetType::Empty; + widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type = WindowWidgetType::Empty; + if (IsTrackEnabled(TRACK_CURVE_VERTICAL)) + { + widgets[WIDX_LEFT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; + widgets[WIDX_RIGHT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; + } + if (IsTrackEnabled(TRACK_CURVE)) + { + widgets[WIDX_LEFT_CURVE].type = WindowWidgetType::FlatBtn; + widgets[WIDX_RIGHT_CURVE].type = WindowWidgetType::FlatBtn; + } + if (IsTrackEnabled(TRACK_CURVE_SMALL)) + { + widgets[WIDX_LEFT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; + widgets[WIDX_RIGHT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; + } + if (IsTrackEnabled(TRACK_CURVE_VERY_SMALL)) + { + widgets[WIDX_LEFT_CURVE_VERY_SMALL].type = WindowWidgetType::FlatBtn; + widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type = WindowWidgetType::FlatBtn; + } - RideId rideIndex; - int32_t trackType, trackDirection, liftHillAndInvertedState; - if (WindowRideConstructionUpdateState( - &trackType, &trackDirection, &rideIndex, &liftHillAndInvertedState, nullptr, nullptr)) - return; + widgets[WIDX_SLOPE_DOWN_STEEP].type = WindowWidgetType::Empty; + widgets[WIDX_SLOPE_DOWN].type = WindowWidgetType::Empty; + widgets[WIDX_LEVEL].type = WindowWidgetType::Empty; + widgets[WIDX_SLOPE_UP].type = WindowWidgetType::Empty; + widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::Empty; + widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN_STEEP); + widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP; + widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP); + widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP; + if (GetRideTypeDescriptor(rideType).SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) + { + widgets[WIDX_LEVEL].type = WindowWidgetType::FlatBtn; + widgets[WIDX_SLOPE_UP].type = WindowWidgetType::FlatBtn; + } + if (IsTrackEnabled(TRACK_SLOPE) || IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN) || IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) + { + widgets[WIDX_LEVEL].type = WindowWidgetType::FlatBtn; + } + if (IsTrackEnabled(TRACK_SLOPE)) + { + widgets[WIDX_SLOPE_DOWN].type = WindowWidgetType::FlatBtn; + widgets[WIDX_SLOPE_UP].type = WindowWidgetType::FlatBtn; + } + if ((IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) + && _currentTrackRollEnd != TrackRoll::None && _currentTrackPitchEnd == TrackPitch::None) + { + if (_currentTrackCurve >= EnumValue(TrackCurve::Left) + && _currentTrackCurve <= EnumValue(TrackCurve::RightSmall)) + { + // Enable helix + widgets[WIDX_SLOPE_DOWN_STEEP].type = WindowWidgetType::FlatBtn; + if (rideType != RIDE_TYPE_SPLASH_BOATS && rideType != RIDE_TYPE_RIVER_RAFTS) + widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::FlatBtn; + } + } - // Draw track piece - auto screenCoords = ScreenCoordsXY{ windowPos.x + widget->left + 1, windowPos.y + widget->top + 1 }; - widgetWidth = widget->width() - 1; - widgetHeight = widget->height() - 1; - if (ClipDrawPixelInfo(clipdpi, dpi, screenCoords, widgetWidth, widgetHeight)) - { - DrawTrackPiece(clipdpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, widgetWidth, widgetHeight); - } - - // Draw cost - screenCoords = { windowPos.x + widget->midX(), windowPos.y + widget->bottom - 23 }; - if (_rideConstructionState != RideConstructionState::Place) - DrawTextBasic(dpi, screenCoords, STR_BUILD_THIS, {}, { TextAlignment::CENTRE }); - - screenCoords.y += 11; - if (_currentTrackPrice != kMoney64Undefined && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(_currentTrackPrice); - DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); - } - } - - void UpdateWidgets() - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; - } - int32_t rideType = RideGetAlternativeType(*currentRide); - - hold_down_widgets = 0; - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY) || !currentRide->HasStation()) - { - widgets[WIDX_ENTRANCE_EXIT_GROUPBOX].type = WindowWidgetType::Empty; - widgets[WIDX_ENTRANCE].type = WindowWidgetType::Empty; - widgets[WIDX_EXIT].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_ENTRANCE_EXIT_GROUPBOX].type = WindowWidgetType::Groupbox; - widgets[WIDX_ENTRANCE].type = WindowWidgetType::Button; - widgets[WIDX_EXIT].type = WindowWidgetType::Button; - } - - if (_specialElementDropdownState.HasActiveElements) - { - widgets[WIDX_SPECIAL_TRACK_DROPDOWN].type = WindowWidgetType::Button; - } - else - { - widgets[WIDX_SPECIAL_TRACK_DROPDOWN].type = WindowWidgetType::Empty; - } - - if (IsTrackEnabled(TRACK_STRAIGHT)) - { - widgets[WIDX_STRAIGHT].type = WindowWidgetType::FlatBtn; - } - else - { - widgets[WIDX_STRAIGHT].type = WindowWidgetType::Empty; - } - - if (IsTrackEnabled(TRACK_CURVE_LARGE)) - { - widgets[WIDX_LEFT_CURVE_LARGE].type = WindowWidgetType::FlatBtn; - widgets[WIDX_RIGHT_CURVE_LARGE].type = WindowWidgetType::FlatBtn; - } - else - { - widgets[WIDX_LEFT_CURVE_LARGE].type = WindowWidgetType::Empty; - widgets[WIDX_RIGHT_CURVE_LARGE].type = WindowWidgetType::Empty; - } - - widgets[WIDX_LEFT_CURVE].type = WindowWidgetType::Empty; - widgets[WIDX_RIGHT_CURVE].type = WindowWidgetType::Empty; - widgets[WIDX_LEFT_CURVE_SMALL].type = WindowWidgetType::Empty; - widgets[WIDX_RIGHT_CURVE_SMALL].type = WindowWidgetType::Empty; - widgets[WIDX_LEFT_CURVE_VERY_SMALL].type = WindowWidgetType::Empty; - widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type = WindowWidgetType::Empty; - if (IsTrackEnabled(TRACK_CURVE_VERTICAL)) - { - widgets[WIDX_LEFT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; - widgets[WIDX_RIGHT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; - } - if (IsTrackEnabled(TRACK_CURVE)) - { - widgets[WIDX_LEFT_CURVE].type = WindowWidgetType::FlatBtn; - widgets[WIDX_RIGHT_CURVE].type = WindowWidgetType::FlatBtn; - } - if (IsTrackEnabled(TRACK_CURVE_SMALL)) - { - widgets[WIDX_LEFT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; - widgets[WIDX_RIGHT_CURVE_SMALL].type = WindowWidgetType::FlatBtn; - } - if (IsTrackEnabled(TRACK_CURVE_VERY_SMALL)) - { - widgets[WIDX_LEFT_CURVE_VERY_SMALL].type = WindowWidgetType::FlatBtn; - widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type = WindowWidgetType::FlatBtn; - } - - widgets[WIDX_SLOPE_DOWN_STEEP].type = WindowWidgetType::Empty; - widgets[WIDX_SLOPE_DOWN].type = WindowWidgetType::Empty; - widgets[WIDX_LEVEL].type = WindowWidgetType::Empty; - widgets[WIDX_SLOPE_UP].type = WindowWidgetType::Empty; - widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::Empty; - widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN_STEEP); - widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP; - widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP); - widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP; - if (GetRideTypeDescriptor(rideType).SupportsTrackPiece(TRACK_REVERSE_FREEFALL)) - { - widgets[WIDX_LEVEL].type = WindowWidgetType::FlatBtn; - widgets[WIDX_SLOPE_UP].type = WindowWidgetType::FlatBtn; - } - if (IsTrackEnabled(TRACK_SLOPE) || IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN) || IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) - { - widgets[WIDX_LEVEL].type = WindowWidgetType::FlatBtn; - } - if (IsTrackEnabled(TRACK_SLOPE)) - { - widgets[WIDX_SLOPE_DOWN].type = WindowWidgetType::FlatBtn; - widgets[WIDX_SLOPE_UP].type = WindowWidgetType::FlatBtn; - } - if ((IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) - && _currentTrackRollEnd != TrackRoll::None && _currentTrackPitchEnd == TrackPitch::None) - { - if (_currentTrackCurve >= EnumValue(TrackCurve::Left) && _currentTrackCurve <= EnumValue(TrackCurve::RightSmall)) + if (IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN)) { - // Enable helix widgets[WIDX_SLOPE_DOWN_STEEP].type = WindowWidgetType::FlatBtn; - if (rideType != RIDE_TYPE_SPLASH_BOATS && rideType != RIDE_TYPE_RIVER_RAFTS) - widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::FlatBtn; } - } - - if (IsTrackEnabled(TRACK_SLOPE_STEEP_DOWN)) - { - widgets[WIDX_SLOPE_DOWN_STEEP].type = WindowWidgetType::FlatBtn; - } - if (IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) - { - widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::FlatBtn; - } - - if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) - && (_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60) - && !GetGameState().Cheats.EnableAllDrawableTrackPieces) - { - _currentTrackLiftHill |= CONSTRUCTION_LIFT_HILL_SELECTED; - } - - if ((IsTrackEnabled(TRACK_LIFT_HILL) && (_currentTrackCurve & RideConstructionSpecialPieceSelected) == 0) - || (GetGameState().Cheats.EnableChainLiftOnAllTrack - && currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))) - { - widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn; - } - else - { - widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::Empty; - } - - int32_t x = 45; - for (int32_t i = WIDX_SLOPE_DOWN_STEEP; i <= WIDX_SLOPE_UP_STEEP; i++) - { - widgets[i].left = x; - widgets[i].right = x + 23; - x += 24; - } - - widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP); - widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP; - widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN_STEEP); - widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP; - if (IsTrackEnabled(TRACK_SLOPE_VERTICAL)) - { - if (_previousTrackPitchEnd == TrackPitch::Up60 || _previousTrackPitchEnd == TrackPitch::Up90) + if (IsTrackEnabled(TRACK_SLOPE_STEEP_UP)) { - int32_t originalSlopeUpSteepLeft = widgets[WIDX_SLOPE_UP_STEEP].left; - int32_t originalSlopeUpSteepRight = widgets[WIDX_SLOPE_UP_STEEP].right; - for (int32_t i = WIDX_SLOPE_UP_STEEP; i > WIDX_SLOPE_DOWN_STEEP; i--) + widgets[WIDX_SLOPE_UP_STEEP].type = WindowWidgetType::FlatBtn; + } + + if (currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_UP_INCLINE_REQUIRES_LIFT) + && (_currentTrackPitchEnd == TrackPitch::Up25 || _currentTrackPitchEnd == TrackPitch::Up60) + && !GetGameState().Cheats.EnableAllDrawableTrackPieces) + { + _currentTrackLiftHill |= CONSTRUCTION_LIFT_HILL_SELECTED; + } + + if ((IsTrackEnabled(TRACK_LIFT_HILL) && (_currentTrackCurve & RideConstructionSpecialPieceSelected) == 0) + || (GetGameState().Cheats.EnableChainLiftOnAllTrack + && currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK))) + { + widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::FlatBtn; + } + else + { + widgets[WIDX_CHAIN_LIFT].type = WindowWidgetType::Empty; + } + + int32_t x = 45; + for (int32_t i = WIDX_SLOPE_DOWN_STEEP; i <= WIDX_SLOPE_UP_STEEP; i++) + { + widgets[i].left = x; + widgets[i].right = x + 23; + x += 24; + } + + widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_UP_STEEP); + widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_UP_TIP; + widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_SLOPE_DOWN_STEEP); + widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_STEEP_SLOPE_DOWN_TIP; + if (IsTrackEnabled(TRACK_SLOPE_VERTICAL)) + { + if (_previousTrackPitchEnd == TrackPitch::Up60 || _previousTrackPitchEnd == TrackPitch::Up90) { - widgets[i].left = widgets[i - 1].left; - widgets[i].right = widgets[i - 1].right; - } - widgets[WIDX_SLOPE_DOWN_STEEP].left = originalSlopeUpSteepLeft; - widgets[WIDX_SLOPE_DOWN_STEEP].right = originalSlopeUpSteepRight; - widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_RISE); - widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_VERTICAL_RISE_TIP; - } - else if (_previousTrackPitchEnd == TrackPitch::Down60 || _previousTrackPitchEnd == TrackPitch::Down90) - { - int32_t originalSlopeDownSteepLeft = widgets[WIDX_SLOPE_DOWN_STEEP].left; - int32_t originalSlopeDownSteepRight = widgets[WIDX_SLOPE_DOWN_STEEP].right; - for (int32_t i = WIDX_SLOPE_DOWN_STEEP; i < WIDX_SLOPE_UP_STEEP; i++) - { - widgets[i].left = widgets[i + 1].left; - widgets[i].right = widgets[i + 1].right; - } - widgets[WIDX_SLOPE_UP_STEEP].left = originalSlopeDownSteepLeft; - widgets[WIDX_SLOPE_UP_STEEP].right = originalSlopeDownSteepRight; - widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_DROP); - widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_VERTICAL_DROP_TIP; - } - } - - if ((IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) - && _currentTrackPitchEnd == TrackPitch::None && _currentTrackRollEnd == TrackRoll::None - && (_currentTrackCurve == EnumValue(TrackCurve::Left) || _currentTrackCurve == EnumValue(TrackCurve::Right))) - { - widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_DOWN); - widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_DOWN_TIP; - widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_UP); - widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_UP_TIP; - - int32_t tmp = widgets[WIDX_SLOPE_DOWN_STEEP].left; - widgets[WIDX_SLOPE_DOWN_STEEP].left = widgets[WIDX_SLOPE_DOWN].left; - widgets[WIDX_SLOPE_DOWN].left = tmp; - - tmp = widgets[WIDX_SLOPE_DOWN_STEEP].right; - widgets[WIDX_SLOPE_DOWN_STEEP].right = widgets[WIDX_SLOPE_DOWN].right; - widgets[WIDX_SLOPE_DOWN].right = tmp; - - tmp = widgets[WIDX_SLOPE_UP_STEEP].left; - widgets[WIDX_SLOPE_UP_STEEP].left = widgets[WIDX_SLOPE_UP].left; - widgets[WIDX_SLOPE_UP].left = tmp; - - tmp = widgets[WIDX_SLOPE_UP_STEEP].right; - widgets[WIDX_SLOPE_UP_STEEP].right = widgets[WIDX_SLOPE_UP].right; - widgets[WIDX_SLOPE_UP].right = tmp; - } - - if ((IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER) - || IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) - && (_currentTrackCurve >= EnumValue(TrackCurve::Left) && _currentTrackCurve <= EnumValue(TrackCurve::RightSmall)) - && _currentTrackPitchEnd == TrackPitch::None && _currentTrackRollEnd != TrackRoll::None) - { - widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_DOWN); - widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_DOWN_TIP; - widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_UP); - widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_UP_TIP; - - int32_t tmp = widgets[WIDX_SLOPE_DOWN_STEEP].left; - widgets[WIDX_SLOPE_DOWN_STEEP].left = widgets[WIDX_SLOPE_DOWN].left; - widgets[WIDX_SLOPE_DOWN].left = tmp; - - tmp = widgets[WIDX_SLOPE_DOWN_STEEP].right; - widgets[WIDX_SLOPE_DOWN_STEEP].right = widgets[WIDX_SLOPE_DOWN].right; - widgets[WIDX_SLOPE_DOWN].right = tmp; - - tmp = widgets[WIDX_SLOPE_UP_STEEP].left; - widgets[WIDX_SLOPE_UP_STEEP].left = widgets[WIDX_SLOPE_UP].left; - widgets[WIDX_SLOPE_UP].left = tmp; - - tmp = widgets[WIDX_SLOPE_UP_STEEP].right; - widgets[WIDX_SLOPE_UP_STEEP].right = widgets[WIDX_SLOPE_UP].right; - widgets[WIDX_SLOPE_UP].right = tmp; - } - - widgets[WIDX_BANKING_GROUPBOX].image = ImageId(STR_RIDE_CONSTRUCTION_ROLL_BANKING); - widgets[WIDX_BANK_LEFT].image = ImageId(SPR_RIDE_CONSTRUCTION_LEFT_BANK); - widgets[WIDX_BANK_LEFT].tooltip = STR_RIDE_CONSTRUCTION_ROLL_FOR_LEFT_CURVE_TIP; - widgets[WIDX_BANK_LEFT].left = 69; - widgets[WIDX_BANK_LEFT].right = 92; - widgets[WIDX_BANK_LEFT].top = 132; - widgets[WIDX_BANK_LEFT].bottom = 155; - widgets[WIDX_BANK_STRAIGHT].image = ImageId(SPR_RIDE_CONSTRUCTION_NO_BANK); - widgets[WIDX_BANK_STRAIGHT].tooltip = STR_RIDE_CONSTRUCTION_NO_ROLL_TIP; - widgets[WIDX_BANK_STRAIGHT].left = 93; - widgets[WIDX_BANK_STRAIGHT].right = 116; - widgets[WIDX_BANK_STRAIGHT].top = 132; - widgets[WIDX_BANK_STRAIGHT].bottom = 155; - widgets[WIDX_BANK_RIGHT].image = ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_BANK); - widgets[WIDX_BANK_RIGHT].tooltip = STR_RIDE_CONSTRUCTION_ROLL_FOR_RIGHT_CURVE_TIP; - widgets[WIDX_BANK_RIGHT].left = 117; - widgets[WIDX_BANK_RIGHT].right = 140; - widgets[WIDX_BANK_RIGHT].top = 132; - widgets[WIDX_BANK_RIGHT].bottom = 155; - widgets[WIDX_BANK_LEFT].type = WindowWidgetType::Empty; - widgets[WIDX_BANK_STRAIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_BANK_RIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_U_TRACK].type = WindowWidgetType::Empty; - widgets[WIDX_O_TRACK].type = WindowWidgetType::Empty; - - bool trackHasSpeedSetting = TrackTypeHasSpeedSetting(_selectedTrackType) - || TrackTypeHasSpeedSetting(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); - bool boosterTrackSelected = TrackTypeIsBooster(_selectedTrackType) - || TrackTypeIsBooster(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); - - // Only necessary because TD6 writes speed and seat rotation to the same bits. Remove for new track design format. - bool trackHasSpeedAndSeatRotation = _selectedTrackType == TrackElemType::BlockBrakes - || _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::BlockBrakes) - || _selectedTrackType > TrackElemType::HighestAlias - || _currentTrackCurve > (RideConstructionSpecialPieceSelected | TrackElemType::HighestAlias); - - const auto& rtd = GetRideTypeDescriptor(rideType); - bool rideHasSeatRotation = rtd.HasFlag(RIDE_TYPE_FLAG_HAS_SEAT_ROTATION); - - if (!trackHasSpeedSetting) - { - if (IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) - { - widgets[WIDX_BANK_LEFT].type = WindowWidgetType::FlatBtn; - widgets[WIDX_BANK_STRAIGHT].type = WindowWidgetType::FlatBtn; - widgets[WIDX_BANK_RIGHT].type = WindowWidgetType::FlatBtn; - } - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) - { - if (rideType == RIDE_TYPE_WATER_COASTER) - { - widgets[WIDX_U_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_RC_TRACK); - widgets[WIDX_O_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_WATER_CHANNEL); - widgets[WIDX_U_TRACK].tooltip = STR_RIDE_CONSTRUCTION_STANDARD_RC_TRACK_TIP; - widgets[WIDX_O_TRACK].tooltip = STR_RIDE_CONSTRUCTION_WATER_CHANNEL_TIP; - if ((_currentTrackCurve < EnumValue(TrackCurve::LeftSmall) - || _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::SBendLeft) - || _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::SBendRight)) - && _currentTrackPitchEnd == TrackPitch::None && _currentTrackRollEnd == TrackRoll::None) + int32_t originalSlopeUpSteepLeft = widgets[WIDX_SLOPE_UP_STEEP].left; + int32_t originalSlopeUpSteepRight = widgets[WIDX_SLOPE_UP_STEEP].right; + for (int32_t i = WIDX_SLOPE_UP_STEEP; i > WIDX_SLOPE_DOWN_STEEP; i--) { + widgets[i].left = widgets[i - 1].left; + widgets[i].right = widgets[i - 1].right; + } + widgets[WIDX_SLOPE_DOWN_STEEP].left = originalSlopeUpSteepLeft; + widgets[WIDX_SLOPE_DOWN_STEEP].right = originalSlopeUpSteepRight; + widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_RISE); + widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_VERTICAL_RISE_TIP; + } + else if (_previousTrackPitchEnd == TrackPitch::Down60 || _previousTrackPitchEnd == TrackPitch::Down90) + { + int32_t originalSlopeDownSteepLeft = widgets[WIDX_SLOPE_DOWN_STEEP].left; + int32_t originalSlopeDownSteepRight = widgets[WIDX_SLOPE_DOWN_STEEP].right; + for (int32_t i = WIDX_SLOPE_DOWN_STEEP; i < WIDX_SLOPE_UP_STEEP; i++) + { + widgets[i].left = widgets[i + 1].left; + widgets[i].right = widgets[i + 1].right; + } + widgets[WIDX_SLOPE_UP_STEEP].left = originalSlopeDownSteepLeft; + widgets[WIDX_SLOPE_UP_STEEP].right = originalSlopeDownSteepRight; + widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_VERTICAL_DROP); + widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_VERTICAL_DROP_TIP; + } + } + + if ((IsTrackEnabled(TRACK_HELIX_DOWN_UNBANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_UNBANKED_QUARTER)) + && _currentTrackPitchEnd == TrackPitch::None && _currentTrackRollEnd == TrackRoll::None + && (_currentTrackCurve == EnumValue(TrackCurve::Left) || _currentTrackCurve == EnumValue(TrackCurve::Right))) + { + widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_DOWN); + widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_DOWN_TIP; + widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_UP); + widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_UP_TIP; + + int32_t tmp = widgets[WIDX_SLOPE_DOWN_STEEP].left; + widgets[WIDX_SLOPE_DOWN_STEEP].left = widgets[WIDX_SLOPE_DOWN].left; + widgets[WIDX_SLOPE_DOWN].left = tmp; + + tmp = widgets[WIDX_SLOPE_DOWN_STEEP].right; + widgets[WIDX_SLOPE_DOWN_STEEP].right = widgets[WIDX_SLOPE_DOWN].right; + widgets[WIDX_SLOPE_DOWN].right = tmp; + + tmp = widgets[WIDX_SLOPE_UP_STEEP].left; + widgets[WIDX_SLOPE_UP_STEEP].left = widgets[WIDX_SLOPE_UP].left; + widgets[WIDX_SLOPE_UP].left = tmp; + + tmp = widgets[WIDX_SLOPE_UP_STEEP].right; + widgets[WIDX_SLOPE_UP_STEEP].right = widgets[WIDX_SLOPE_UP].right; + widgets[WIDX_SLOPE_UP].right = tmp; + } + + if ((IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_QUARTER) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_QUARTER) + || IsTrackEnabled(TRACK_HELIX_DOWN_BANKED_HALF) || IsTrackEnabled(TRACK_HELIX_UP_BANKED_HALF)) + && (_currentTrackCurve >= EnumValue(TrackCurve::Left) + && _currentTrackCurve <= EnumValue(TrackCurve::RightSmall)) + && _currentTrackPitchEnd == TrackPitch::None && _currentTrackRollEnd != TrackRoll::None) + { + widgets[WIDX_SLOPE_DOWN_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_DOWN); + widgets[WIDX_SLOPE_DOWN_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_DOWN_TIP; + widgets[WIDX_SLOPE_UP_STEEP].image = ImageId(SPR_RIDE_CONSTRUCTION_HELIX_UP); + widgets[WIDX_SLOPE_UP_STEEP].tooltip = STR_RIDE_CONSTRUCTION_HELIX_UP_TIP; + + int32_t tmp = widgets[WIDX_SLOPE_DOWN_STEEP].left; + widgets[WIDX_SLOPE_DOWN_STEEP].left = widgets[WIDX_SLOPE_DOWN].left; + widgets[WIDX_SLOPE_DOWN].left = tmp; + + tmp = widgets[WIDX_SLOPE_DOWN_STEEP].right; + widgets[WIDX_SLOPE_DOWN_STEEP].right = widgets[WIDX_SLOPE_DOWN].right; + widgets[WIDX_SLOPE_DOWN].right = tmp; + + tmp = widgets[WIDX_SLOPE_UP_STEEP].left; + widgets[WIDX_SLOPE_UP_STEEP].left = widgets[WIDX_SLOPE_UP].left; + widgets[WIDX_SLOPE_UP].left = tmp; + + tmp = widgets[WIDX_SLOPE_UP_STEEP].right; + widgets[WIDX_SLOPE_UP_STEEP].right = widgets[WIDX_SLOPE_UP].right; + widgets[WIDX_SLOPE_UP].right = tmp; + } + + widgets[WIDX_BANKING_GROUPBOX].image = ImageId(STR_RIDE_CONSTRUCTION_ROLL_BANKING); + widgets[WIDX_BANK_LEFT].image = ImageId(SPR_RIDE_CONSTRUCTION_LEFT_BANK); + widgets[WIDX_BANK_LEFT].tooltip = STR_RIDE_CONSTRUCTION_ROLL_FOR_LEFT_CURVE_TIP; + widgets[WIDX_BANK_LEFT].left = 69; + widgets[WIDX_BANK_LEFT].right = 92; + widgets[WIDX_BANK_LEFT].top = 132; + widgets[WIDX_BANK_LEFT].bottom = 155; + widgets[WIDX_BANK_STRAIGHT].image = ImageId(SPR_RIDE_CONSTRUCTION_NO_BANK); + widgets[WIDX_BANK_STRAIGHT].tooltip = STR_RIDE_CONSTRUCTION_NO_ROLL_TIP; + widgets[WIDX_BANK_STRAIGHT].left = 93; + widgets[WIDX_BANK_STRAIGHT].right = 116; + widgets[WIDX_BANK_STRAIGHT].top = 132; + widgets[WIDX_BANK_STRAIGHT].bottom = 155; + widgets[WIDX_BANK_RIGHT].image = ImageId(SPR_RIDE_CONSTRUCTION_RIGHT_BANK); + widgets[WIDX_BANK_RIGHT].tooltip = STR_RIDE_CONSTRUCTION_ROLL_FOR_RIGHT_CURVE_TIP; + widgets[WIDX_BANK_RIGHT].left = 117; + widgets[WIDX_BANK_RIGHT].right = 140; + widgets[WIDX_BANK_RIGHT].top = 132; + widgets[WIDX_BANK_RIGHT].bottom = 155; + widgets[WIDX_BANK_LEFT].type = WindowWidgetType::Empty; + widgets[WIDX_BANK_STRAIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_BANK_RIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_U_TRACK].type = WindowWidgetType::Empty; + widgets[WIDX_O_TRACK].type = WindowWidgetType::Empty; + + bool trackHasSpeedSetting = TrackTypeHasSpeedSetting(_selectedTrackType) + || TrackTypeHasSpeedSetting(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); + bool boosterTrackSelected = TrackTypeIsBooster(_selectedTrackType) + || TrackTypeIsBooster(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); + + // Only necessary because TD6 writes speed and seat rotation to the same bits. Remove for new track design format. + bool trackHasSpeedAndSeatRotation = _selectedTrackType == TrackElemType::BlockBrakes + || _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::BlockBrakes) + || _selectedTrackType > TrackElemType::HighestAlias + || _currentTrackCurve > (RideConstructionSpecialPieceSelected | TrackElemType::HighestAlias); + + const auto& rtd = GetRideTypeDescriptor(rideType); + bool rideHasSeatRotation = rtd.HasFlag(RIDE_TYPE_FLAG_HAS_SEAT_ROTATION); + + if (!trackHasSpeedSetting) + { + if (IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) + { + widgets[WIDX_BANK_LEFT].type = WindowWidgetType::FlatBtn; + widgets[WIDX_BANK_STRAIGHT].type = WindowWidgetType::FlatBtn; + widgets[WIDX_BANK_RIGHT].type = WindowWidgetType::FlatBtn; + } + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) + { + if (rideType == RIDE_TYPE_WATER_COASTER) + { + widgets[WIDX_U_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_RC_TRACK); + widgets[WIDX_O_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_WATER_CHANNEL); + widgets[WIDX_U_TRACK].tooltip = STR_RIDE_CONSTRUCTION_STANDARD_RC_TRACK_TIP; + widgets[WIDX_O_TRACK].tooltip = STR_RIDE_CONSTRUCTION_WATER_CHANNEL_TIP; + if ((_currentTrackCurve < EnumValue(TrackCurve::LeftSmall) + || _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::SBendLeft) + || _currentTrackCurve == (RideConstructionSpecialPieceSelected | TrackElemType::SBendRight)) + && _currentTrackPitchEnd == TrackPitch::None && _currentTrackRollEnd == TrackRoll::None) + { + widgets[WIDX_BANKING_GROUPBOX].text = STR_RIDE_CONSTRUCTION_TRACK_STYLE; + widgets[WIDX_U_TRACK].type = WindowWidgetType::FlatBtn; + widgets[WIDX_O_TRACK].type = WindowWidgetType::FlatBtn; + } + } + else + { + widgets[WIDX_U_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_U_SHAPED_TRACK); + widgets[WIDX_O_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_O_SHAPED_TRACK); + widgets[WIDX_U_TRACK].tooltip = STR_RIDE_CONSTRUCTION_U_SHAPED_OPEN_TRACK_TIP; + widgets[WIDX_O_TRACK].tooltip = STR_RIDE_CONSTRUCTION_O_SHAPED_ENCLOSED_TRACK_TIP; widgets[WIDX_BANKING_GROUPBOX].text = STR_RIDE_CONSTRUCTION_TRACK_STYLE; widgets[WIDX_U_TRACK].type = WindowWidgetType::FlatBtn; widgets[WIDX_O_TRACK].type = WindowWidgetType::FlatBtn; } } - else - { - widgets[WIDX_U_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_U_SHAPED_TRACK); - widgets[WIDX_O_TRACK].image = ImageId(SPR_RIDE_CONSTRUCTION_O_SHAPED_TRACK); - widgets[WIDX_U_TRACK].tooltip = STR_RIDE_CONSTRUCTION_U_SHAPED_OPEN_TRACK_TIP; - widgets[WIDX_O_TRACK].tooltip = STR_RIDE_CONSTRUCTION_O_SHAPED_ENCLOSED_TRACK_TIP; - widgets[WIDX_BANKING_GROUPBOX].text = STR_RIDE_CONSTRUCTION_TRACK_STYLE; - widgets[WIDX_U_TRACK].type = WindowWidgetType::FlatBtn; - widgets[WIDX_O_TRACK].type = WindowWidgetType::FlatBtn; - } - } - } - else - { - if (!boosterTrackSelected) - { - widgets[WIDX_SPEED_GROUPBOX].text = STR_RIDE_CONSTRUCTION_BRAKE_SPEED; - widgets[WIDX_SPEED_SETTING_SPINNER].tooltip = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_LIMIT_TIP; - widgets[WIDX_SPEED_SETTING_SPINNER_UP].tooltip = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_LIMIT_TIP; - widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].tooltip = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_LIMIT_TIP; } else { - widgets[WIDX_SPEED_GROUPBOX].text = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED; - widgets[WIDX_SPEED_SETTING_SPINNER].tooltip = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED_LIMIT_TIP; - widgets[WIDX_SPEED_SETTING_SPINNER_UP].tooltip = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED_LIMIT_TIP; - widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].tooltip = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED_LIMIT_TIP; - } - - _currentlyShowingBrakeOrBoosterSpeed = true; - widgets[WIDX_SPEED_SETTING_SPINNER].text = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_VELOCITY; - - widgets[WIDX_SPEED_SETTING_SPINNER].type = WindowWidgetType::Spinner; - widgets[WIDX_SPEED_SETTING_SPINNER_UP].type = WindowWidgetType::Button; - widgets[WIDX_SPEED_SETTING_SPINNER_UP].text = STR_NUMERIC_UP; - widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].type = WindowWidgetType::Button; - widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].text = STR_NUMERIC_DOWN; - - ResizeSpinner(WIDX_SPEED_SETTING_SPINNER, { 12, 138 }, { 85, SPINNER_HEIGHT }); - - hold_down_widgets |= (1uLL << WIDX_SPEED_SETTING_SPINNER_UP) | (1uLL << WIDX_SPEED_SETTING_SPINNER_DOWN); - } - - static constexpr int16_t bankingGroupboxRightNoSeatRotation = GW; - static constexpr int16_t bankingGroupboxRightWithSeatRotation = 114; - - widgets[WIDX_BANKING_GROUPBOX].right = bankingGroupboxRightNoSeatRotation; - widgets[WIDX_SEAT_ROTATION_GROUPBOX].type = WindowWidgetType::Empty; - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].type = WindowWidgetType::Empty; - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP].type = WindowWidgetType::Empty; - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN].type = WindowWidgetType::Empty; - - // Simplify this condition to "rideHasSeatRotation" for new track design format - if ((rideHasSeatRotation && !trackHasSpeedSetting) - || (rideHasSeatRotation && trackHasSpeedSetting && trackHasSpeedAndSeatRotation)) - { - widgets[WIDX_SEAT_ROTATION_GROUPBOX].type = WindowWidgetType::Groupbox; - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].type = WindowWidgetType::Spinner; - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP].type = WindowWidgetType::Button; - widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN].type = WindowWidgetType::Button; - widgets[WIDX_BANKING_GROUPBOX].right = bankingGroupboxRightWithSeatRotation; - - // squishes the track speed spinner slightly to make room for the seat rotation widgets - if (trackHasSpeedSetting) - { - widgets[WIDX_SPEED_SETTING_SPINNER].left -= 4; - widgets[WIDX_SPEED_SETTING_SPINNER].right -= 8; - widgets[WIDX_SPEED_SETTING_SPINNER_UP].right -= 8; - widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].right -= 8; - widgets[WIDX_SPEED_SETTING_SPINNER_UP].left -= 8; - widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].left -= 8; - } - // moves banking buttons to the left to make room for the seat rotation widgets - else if (IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) - { - for (int32_t i = WIDX_BANK_LEFT; i <= WIDX_BANK_RIGHT; i++) + if (!boosterTrackSelected) { - widgets[i].left -= 36; - widgets[i].right -= 36; - } - } - } - - uint64_t pressedWidgets = pressed_widgets - & ((1uLL << WIDX_BACKGROUND) | (1uLL << WIDX_TITLE) | (1uLL << WIDX_CLOSE) | (1uLL << WIDX_DIRECTION_GROUPBOX) - | (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_CONSTRUCT) - | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) | (1uLL << WIDX_NEXT_SECTION) - | (1uLL << WIDX_ENTRANCE_EXIT_GROUPBOX) | (1uLL << WIDX_ENTRANCE) | (1uLL << WIDX_EXIT)); - - widgets[WIDX_CONSTRUCT].type = WindowWidgetType::Empty; - widgets[WIDX_DEMOLISH].type = WindowWidgetType::FlatBtn; - widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS)) - { - widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; - widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::FlatBtn; - widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::FlatBtn; - } - - switch (_rideConstructionState) - { - case RideConstructionState::Front: - widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; - widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; - break; - case RideConstructionState::Back: - widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; - widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; - break; - case RideConstructionState::Place: - widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; - widgets[WIDX_DEMOLISH].type = WindowWidgetType::Empty; - widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; - widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; - widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; - break; - case RideConstructionState::EntranceExit: - widgets[WIDX_DEMOLISH].type = WindowWidgetType::Empty; - widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; - widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; - break; - default: - pressed_widgets = pressedWidgets; - Invalidate(); - return; - } - - WidgetIndex widgetIndex; - switch (_currentTrackCurve) - { - case EnumValue(TrackCurve::None): - widgetIndex = WIDX_STRAIGHT; - break; - case EnumValue(TrackCurve::Left): - widgetIndex = WIDX_LEFT_CURVE; - break; - case EnumValue(TrackCurve::Right): - widgetIndex = WIDX_RIGHT_CURVE; - break; - case EnumValue(TrackCurve::LeftSmall): - widgetIndex = WIDX_LEFT_CURVE_SMALL; - break; - case EnumValue(TrackCurve::RightSmall): - widgetIndex = WIDX_RIGHT_CURVE_SMALL; - break; - case EnumValue(TrackCurve::LeftVerySmall): - widgetIndex = WIDX_LEFT_CURVE_VERY_SMALL; - break; - case EnumValue(TrackCurve::RightVerySmall): - widgetIndex = WIDX_RIGHT_CURVE_VERY_SMALL; - break; - case EnumValue(TrackCurve::LeftLarge): - widgetIndex = WIDX_LEFT_CURVE_LARGE; - break; - case EnumValue(TrackCurve::RightLarge): - widgetIndex = WIDX_RIGHT_CURVE_LARGE; - break; - default: - widgetIndex = WIDX_SPECIAL_TRACK_DROPDOWN; - break; - } - pressedWidgets |= (1uLL << widgetIndex); - - switch (_currentTrackPitchEnd) - { - case TrackPitch::Down60: - case TrackPitch::Up90: - widgetIndex = WIDX_SLOPE_DOWN_STEEP; - break; - case TrackPitch::Down25: - widgetIndex = WIDX_SLOPE_DOWN; - break; - case TrackPitch::Up25: - widgetIndex = WIDX_SLOPE_UP; - break; - case TrackPitch::Up60: - case TrackPitch::Down90: - widgetIndex = WIDX_SLOPE_UP_STEEP; - break; - default: - widgetIndex = WIDX_LEVEL; - break; - } - pressedWidgets |= (1uLL << widgetIndex); - - if (!_currentlyShowingBrakeOrBoosterSpeed) - { - if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) - { - if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES) - { - pressed_widgets |= (1uLL << WIDX_O_TRACK); + widgets[WIDX_SPEED_GROUPBOX].text = STR_RIDE_CONSTRUCTION_BRAKE_SPEED; + widgets[WIDX_SPEED_SETTING_SPINNER].tooltip = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_LIMIT_TIP; + widgets[WIDX_SPEED_SETTING_SPINNER_UP].tooltip = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_LIMIT_TIP; + widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].tooltip = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_LIMIT_TIP; } else { - pressed_widgets |= (1uLL << WIDX_U_TRACK); + widgets[WIDX_SPEED_GROUPBOX].text = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED; + widgets[WIDX_SPEED_SETTING_SPINNER].tooltip = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED_LIMIT_TIP; + widgets[WIDX_SPEED_SETTING_SPINNER_UP].tooltip = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED_LIMIT_TIP; + widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].tooltip = STR_RIDE_CONSTRUCTION_BOOSTER_SPEED_LIMIT_TIP; + } + + _currentlyShowingBrakeOrBoosterSpeed = true; + widgets[WIDX_SPEED_SETTING_SPINNER].text = STR_RIDE_CONSTRUCTION_BRAKE_SPEED_VELOCITY; + + widgets[WIDX_SPEED_SETTING_SPINNER].type = WindowWidgetType::Spinner; + widgets[WIDX_SPEED_SETTING_SPINNER_UP].type = WindowWidgetType::Button; + widgets[WIDX_SPEED_SETTING_SPINNER_UP].text = STR_NUMERIC_UP; + widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].type = WindowWidgetType::Button; + widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].text = STR_NUMERIC_DOWN; + + ResizeSpinner(WIDX_SPEED_SETTING_SPINNER, { 12, 138 }, { 85, SPINNER_HEIGHT }); + + hold_down_widgets |= (1uLL << WIDX_SPEED_SETTING_SPINNER_UP) | (1uLL << WIDX_SPEED_SETTING_SPINNER_DOWN); + } + + static constexpr int16_t bankingGroupboxRightNoSeatRotation = GW; + static constexpr int16_t bankingGroupboxRightWithSeatRotation = 114; + + widgets[WIDX_BANKING_GROUPBOX].right = bankingGroupboxRightNoSeatRotation; + widgets[WIDX_SEAT_ROTATION_GROUPBOX].type = WindowWidgetType::Empty; + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].type = WindowWidgetType::Empty; + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP].type = WindowWidgetType::Empty; + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN].type = WindowWidgetType::Empty; + + // Simplify this condition to "rideHasSeatRotation" for new track design format + if ((rideHasSeatRotation && !trackHasSpeedSetting) + || (rideHasSeatRotation && trackHasSpeedSetting && trackHasSpeedAndSeatRotation)) + { + widgets[WIDX_SEAT_ROTATION_GROUPBOX].type = WindowWidgetType::Groupbox; + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER].type = WindowWidgetType::Spinner; + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_UP].type = WindowWidgetType::Button; + widgets[WIDX_SEAT_ROTATION_ANGLE_SPINNER_DOWN].type = WindowWidgetType::Button; + widgets[WIDX_BANKING_GROUPBOX].right = bankingGroupboxRightWithSeatRotation; + + // squishes the track speed spinner slightly to make room for the seat rotation widgets + if (trackHasSpeedSetting) + { + widgets[WIDX_SPEED_SETTING_SPINNER].left -= 4; + widgets[WIDX_SPEED_SETTING_SPINNER].right -= 8; + widgets[WIDX_SPEED_SETTING_SPINNER_UP].right -= 8; + widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].right -= 8; + widgets[WIDX_SPEED_SETTING_SPINNER_UP].left -= 8; + widgets[WIDX_SPEED_SETTING_SPINNER_DOWN].left -= 8; + } + // moves banking buttons to the left to make room for the seat rotation widgets + else if (IsTrackEnabled(TRACK_FLAT_ROLL_BANKING)) + { + for (int32_t i = WIDX_BANK_LEFT; i <= WIDX_BANK_RIGHT; i++) + { + widgets[i].left -= 36; + widgets[i].right -= 36; + } } } - switch (_currentTrackRollEnd) + + uint64_t pressedWidgets = pressed_widgets + & ((1uLL << WIDX_BACKGROUND) | (1uLL << WIDX_TITLE) | (1uLL << WIDX_CLOSE) | (1uLL << WIDX_DIRECTION_GROUPBOX) + | (1uLL << WIDX_SLOPE_GROUPBOX) | (1uLL << WIDX_BANKING_GROUPBOX) | (1uLL << WIDX_CONSTRUCT) + | (1uLL << WIDX_DEMOLISH) | (1uLL << WIDX_PREVIOUS_SECTION) | (1uLL << WIDX_NEXT_SECTION) + | (1uLL << WIDX_ENTRANCE_EXIT_GROUPBOX) | (1uLL << WIDX_ENTRANCE) | (1uLL << WIDX_EXIT)); + + widgets[WIDX_CONSTRUCT].type = WindowWidgetType::Empty; + widgets[WIDX_DEMOLISH].type = WindowWidgetType::FlatBtn; + widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_CANNOT_HAVE_GAPS)) { - case TrackRoll::Left: - widgetIndex = WIDX_BANK_LEFT; + widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; + widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; + } + else + { + widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::FlatBtn; + widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::FlatBtn; + } + + switch (_rideConstructionState) + { + case RideConstructionState::Front: + widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; break; - case TrackRoll::None: - widgetIndex = WIDX_BANK_STRAIGHT; + case RideConstructionState::Back: + widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; + break; + case RideConstructionState::Place: + widgets[WIDX_CONSTRUCT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_DEMOLISH].type = WindowWidgetType::Empty; + widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; + widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; + widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; + break; + case RideConstructionState::EntranceExit: + widgets[WIDX_DEMOLISH].type = WindowWidgetType::Empty; + widgets[WIDX_NEXT_SECTION].type = WindowWidgetType::Empty; + widgets[WIDX_PREVIOUS_SECTION].type = WindowWidgetType::Empty; break; default: - widgetIndex = WIDX_BANK_RIGHT; + pressed_widgets = pressedWidgets; + Invalidate(); + return; + } + + WidgetIndex widgetIndex; + switch (_currentTrackCurve) + { + case EnumValue(TrackCurve::None): + widgetIndex = WIDX_STRAIGHT; + break; + case EnumValue(TrackCurve::Left): + widgetIndex = WIDX_LEFT_CURVE; + break; + case EnumValue(TrackCurve::Right): + widgetIndex = WIDX_RIGHT_CURVE; + break; + case EnumValue(TrackCurve::LeftSmall): + widgetIndex = WIDX_LEFT_CURVE_SMALL; + break; + case EnumValue(TrackCurve::RightSmall): + widgetIndex = WIDX_RIGHT_CURVE_SMALL; + break; + case EnumValue(TrackCurve::LeftVerySmall): + widgetIndex = WIDX_LEFT_CURVE_VERY_SMALL; + break; + case EnumValue(TrackCurve::RightVerySmall): + widgetIndex = WIDX_RIGHT_CURVE_VERY_SMALL; + break; + case EnumValue(TrackCurve::LeftLarge): + widgetIndex = WIDX_LEFT_CURVE_LARGE; + break; + case EnumValue(TrackCurve::RightLarge): + widgetIndex = WIDX_RIGHT_CURVE_LARGE; + break; + default: + widgetIndex = WIDX_SPECIAL_TRACK_DROPDOWN; break; } pressedWidgets |= (1uLL << widgetIndex); - } - if (_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) - pressedWidgets |= (1uLL << WIDX_CHAIN_LIFT); + switch (_currentTrackPitchEnd) + { + case TrackPitch::Down60: + case TrackPitch::Up90: + widgetIndex = WIDX_SLOPE_DOWN_STEEP; + break; + case TrackPitch::Down25: + widgetIndex = WIDX_SLOPE_DOWN; + break; + case TrackPitch::Up25: + widgetIndex = WIDX_SLOPE_UP; + break; + case TrackPitch::Up60: + case TrackPitch::Down90: + widgetIndex = WIDX_SLOPE_UP_STEEP; + break; + default: + widgetIndex = WIDX_LEVEL; + break; + } + pressedWidgets |= (1uLL << widgetIndex); - pressed_widgets = pressedWidgets; - Invalidate(); - } - - void UpdatePossibleRideConfigurations() - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; - } - _specialElementDropdownState = BuildSpecialElementsList( - *currentRide, _currentTrackPieceDirection, _previousTrackPitchEnd, _previousTrackRollEnd, _rideConstructionState); - _currentlyShowingBrakeOrBoosterSpeed = false; - } - - void UpdateMapSelection() - { - int32_t trackType, trackDirection; - CoordsXYZ trackPos{}; - - MapInvalidateMapSelectionTiles(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; - - switch (_rideConstructionState) - { - case RideConstructionState::State0: - trackDirection = _currentTrackPieceDirection; - trackType = 0; - trackPos = _currentTrackBegin; - break; - case RideConstructionState::Selected: - trackDirection = _currentTrackPieceDirection; - trackType = _currentTrackPieceType; - trackPos = _currentTrackBegin; - break; - case RideConstructionState::EntranceExit: - gMapSelectionTiles.clear(); - return; - default: - if (WindowRideConstructionUpdateState(&trackType, &trackDirection, nullptr, nullptr, &trackPos, nullptr)) + if (!_currentlyShowingBrakeOrBoosterSpeed) + { + if (GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_TRACK_ELEMENTS_HAVE_TWO_VARIETIES)) { + if (_currentTrackAlternative & RIDE_TYPE_ALTERNATIVE_TRACK_PIECES) + { + pressed_widgets |= (1uLL << WIDX_O_TRACK); + } + else + { + pressed_widgets |= (1uLL << WIDX_U_TRACK); + } + } + switch (_currentTrackRollEnd) + { + case TrackRoll::Left: + widgetIndex = WIDX_BANK_LEFT; + break; + case TrackRoll::None: + widgetIndex = WIDX_BANK_STRAIGHT; + break; + default: + widgetIndex = WIDX_BANK_RIGHT; + break; + } + pressedWidgets |= (1uLL << widgetIndex); + } + + if (_currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) + pressedWidgets |= (1uLL << WIDX_CHAIN_LIFT); + + pressed_widgets = pressedWidgets; + Invalidate(); + } + + void UpdatePossibleRideConfigurations() + { + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) + { + return; + } + _specialElementDropdownState = BuildSpecialElementsList( + *currentRide, _currentTrackPieceDirection, _previousTrackPitchEnd, _previousTrackRollEnd, + _rideConstructionState); + _currentlyShowingBrakeOrBoosterSpeed = false; + } + + void UpdateMapSelection() + { + int32_t trackType, trackDirection; + CoordsXYZ trackPos{}; + + MapInvalidateMapSelectionTiles(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags |= MAP_SELECT_FLAG_GREEN; + + switch (_rideConstructionState) + { + case RideConstructionState::State0: trackDirection = _currentTrackPieceDirection; trackType = 0; trackPos = _currentTrackBegin; - } - break; + break; + case RideConstructionState::Selected: + trackDirection = _currentTrackPieceDirection; + trackType = _currentTrackPieceType; + trackPos = _currentTrackBegin; + break; + case RideConstructionState::EntranceExit: + gMapSelectionTiles.clear(); + return; + default: + if (WindowRideConstructionUpdateState(&trackType, &trackDirection, nullptr, nullptr, &trackPos, nullptr)) + { + trackDirection = _currentTrackPieceDirection; + trackType = 0; + trackPos = _currentTrackBegin; + } + break; + } + + if (GetRide(_currentRideIndex)) + { + SelectMapTiles(trackType, trackDirection, trackPos); + MapInvalidateMapSelectionTiles(); + } } - if (GetRide(_currentRideIndex)) + void SelectMapTiles(int32_t trackType, int32_t trackDirection, const CoordsXY& tileCoords) { - SelectMapTiles(trackType, trackDirection, trackPos); - MapInvalidateMapSelectionTiles(); - } - } + // If the scenery tool is active, we do not display our tiles as it + // will conflict with larger scenery objects selecting tiles + if (SceneryToolIsActive()) + { + return; + } - void SelectMapTiles(int32_t trackType, int32_t trackDirection, const CoordsXY& tileCoords) - { - // If the scenery tool is active, we do not display our tiles as it - // will conflict with larger scenery objects selecting tiles - if (SceneryToolIsActive()) - { - return; + const PreviewTrack* trackBlock; + + const auto& ted = GetTrackElementDescriptor(trackType); + trackBlock = ted.Block; + trackDirection &= 3; + gMapSelectionTiles.clear(); + while (trackBlock->index != 255) + { + CoordsXY offsets = { trackBlock->x, trackBlock->y }; + CoordsXY currentTileCoords = tileCoords + offsets.Rotate(trackDirection); + + gMapSelectionTiles.push_back(currentTileCoords); + trackBlock++; + } } - const PreviewTrack* trackBlock; - - const auto& ted = GetTrackElementDescriptor(trackType); - trackBlock = ted.Block; - trackDirection &= 3; - gMapSelectionTiles.clear(); - while (trackBlock->index != 255) + private: + void Construct() { - CoordsXY offsets = { trackBlock->x, trackBlock->y }; - CoordsXY currentTileCoords = tileCoords + offsets.Rotate(trackDirection); + RideId rideIndex; + int32_t trackType, trackDirection, liftHillAndAlternativeState, properties; + CoordsXYZ trackPos{}; - gMapSelectionTiles.push_back(currentTileCoords); - trackBlock++; - } - } - -private: - void Construct() - { - RideId rideIndex; - int32_t trackType, trackDirection, liftHillAndAlternativeState, properties; - CoordsXYZ trackPos{}; - - _currentTrackPrice = kMoney64Undefined; - _trackPlaceCost = kMoney64Undefined; - _trackPlaceErrorMessage = STR_NONE; - RideConstructionInvalidateCurrentTrack(); - if (WindowRideConstructionUpdateState( - &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, &properties)) - { - WindowRideConstructionUpdateActiveElements(); - return; - } - - auto currentRide = GetRide(_currentRideIndex); - if (currentRide == nullptr) - { - return; - } - - auto trackPlaceAction = TrackPlaceAction( - rideIndex, trackType, currentRide->type, { trackPos, static_cast(trackDirection) }, properties & 0xFF, - (properties >> 8) & 0x0F, (properties >> 12) & 0x0F, liftHillAndAlternativeState, false); - if (_rideConstructionState == RideConstructionState::Back) - { - trackPlaceAction.SetCallback(RideConstructPlacedBackwardGameActionCallback); - } - else if (_rideConstructionState == RideConstructionState::Front) - { - trackPlaceAction.SetCallback(RideConstructPlacedForwardGameActionCallback); - } - auto res = GameActions::Execute(&trackPlaceAction); - // Used by some functions - if (res.Error != GameActions::Status::Ok) - { + _currentTrackPrice = kMoney64Undefined; _trackPlaceCost = kMoney64Undefined; - _trackPlaceErrorMessage = std::get(res.ErrorMessage); - } - else - { - _trackPlaceCost = res.Cost; _trackPlaceErrorMessage = STR_NONE; - } - - if (res.Error != GameActions::Status::Ok) - { - return; - } - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackPos); - - if (NetworkGetMode() != NETWORK_MODE_NONE) - { - _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK_PLACE_ACTION_QUEUED; - } - - const auto resultData = res.GetData(); - if (resultData.GroundFlags & ELEMENT_IS_UNDERGROUND) - { - ViewportSetVisibility(ViewportVisibility::UndergroundViewOn); - } - - const bool helixSelected = (_currentTrackCurve & RideConstructionSpecialPieceSelected) - && TrackTypeIsHelix(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); - if (helixSelected || (_currentTrackPitchEnd != TrackPitch::None)) - { - ViewportSetVisibility(ViewportVisibility::TrackHeights); - } - } - - void MouseUpDemolish() - { - int32_t direction; - TileElement* tileElement; - CoordsXYE inputElement, outputElement; - TrackBeginEnd trackBeginEnd; - - _currentTrackPrice = kMoney64Undefined; - RideConstructionInvalidateCurrentTrack(); - - // Select the track element that is to be deleted - _rideConstructionState2 = RideConstructionState::Selected; - if (_rideConstructionState == RideConstructionState::Front) - { - if (!RideSelectBackwardsFromFront()) + RideConstructionInvalidateCurrentTrack(); + if (WindowRideConstructionUpdateState( + &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, &properties)) { WindowRideConstructionUpdateActiveElements(); return; } - _rideConstructionState2 = RideConstructionState::Front; - } - else if (_rideConstructionState == RideConstructionState::Back) - { - if (!RideSelectForwardsFromBack()) + + auto currentRide = GetRide(_currentRideIndex); + if (currentRide == nullptr) { - WindowRideConstructionUpdateActiveElements(); return; } - _rideConstructionState2 = RideConstructionState::Back; + + auto trackPlaceAction = TrackPlaceAction( + rideIndex, trackType, currentRide->type, { trackPos, static_cast(trackDirection) }, properties & 0xFF, + (properties >> 8) & 0x0F, (properties >> 12) & 0x0F, liftHillAndAlternativeState, false); + if (_rideConstructionState == RideConstructionState::Back) + { + trackPlaceAction.SetCallback(RideConstructPlacedBackwardGameActionCallback); + } + else if (_rideConstructionState == RideConstructionState::Front) + { + trackPlaceAction.SetCallback(RideConstructPlacedForwardGameActionCallback); + } + auto res = GameActions::Execute(&trackPlaceAction); + // Used by some functions + if (res.Error != GameActions::Status::Ok) + { + _trackPlaceCost = kMoney64Undefined; + _trackPlaceErrorMessage = std::get(res.ErrorMessage); + } + else + { + _trackPlaceCost = res.Cost; + _trackPlaceErrorMessage = STR_NONE; + } + + if (res.Error != GameActions::Status::Ok) + { + return; + } + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackPos); + + if (NetworkGetMode() != NETWORK_MODE_NONE) + { + _currentTrackSelectionFlags |= TRACK_SELECTION_FLAG_TRACK_PLACE_ACTION_QUEUED; + } + + const auto resultData = res.GetData(); + if (resultData.GroundFlags & ELEMENT_IS_UNDERGROUND) + { + ViewportSetVisibility(ViewportVisibility::UndergroundViewOn); + } + + const bool helixSelected = (_currentTrackCurve & RideConstructionSpecialPieceSelected) + && TrackTypeIsHelix(_currentTrackCurve & ~RideConstructionSpecialPieceSelected); + if (helixSelected || (_currentTrackPitchEnd != TrackPitch::None)) + { + ViewportSetVisibility(ViewportVisibility::TrackHeights); + } } - // Invalidate the selected track element or make sure it's at origin??? - direction = _currentTrackPieceDirection; - // The direction is reset by ride_initialise_construction_window(), but we need it to remove flat rides properly. - Direction currentDirection = _currentTrackPieceDirection; - track_type_t type = _currentTrackPieceType; - auto newCoords = GetTrackElementOriginAndApplyChanges( - { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (!newCoords.has_value()) + void MouseUpDemolish() { - WindowRideConstructionUpdateActiveElements(); - return; - } + int32_t direction; + TileElement* tileElement; + CoordsXYE inputElement, outputElement; + TrackBeginEnd trackBeginEnd; - // Get the previous track element to go to after the selected track element is deleted - inputElement.x = newCoords->x; - inputElement.y = newCoords->y; - inputElement.element = tileElement; - if (TrackBlockGetPrevious({ *newCoords, tileElement }, &trackBeginEnd)) - { - *newCoords = { trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z }; - direction = trackBeginEnd.begin_direction; - type = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); - _gotoStartPlacementMode = false; - } - else if (TrackBlockGetNext(&inputElement, &outputElement, &newCoords->z, &direction)) - { - newCoords->x = outputElement.x; - newCoords->y = outputElement.y; - direction = outputElement.element->GetDirection(); - type = outputElement.element->AsTrack()->GetTrackType(); - _gotoStartPlacementMode = false; - } - else - { + _currentTrackPrice = kMoney64Undefined; + RideConstructionInvalidateCurrentTrack(); + + // Select the track element that is to be deleted + _rideConstructionState2 = RideConstructionState::Selected; + if (_rideConstructionState == RideConstructionState::Front) + { + if (!RideSelectBackwardsFromFront()) + { + WindowRideConstructionUpdateActiveElements(); + return; + } + _rideConstructionState2 = RideConstructionState::Front; + } + else if (_rideConstructionState == RideConstructionState::Back) + { + if (!RideSelectForwardsFromBack()) + { + WindowRideConstructionUpdateActiveElements(); + return; + } + _rideConstructionState2 = RideConstructionState::Back; + } + + // Invalidate the selected track element or make sure it's at origin??? direction = _currentTrackPieceDirection; - type = _currentTrackPieceType; - newCoords = GetTrackElementOriginAndApplyChanges( + // The direction is reset by ride_initialise_construction_window(), but we need it to remove flat rides properly. + Direction currentDirection = _currentTrackPieceDirection; + track_type_t type = _currentTrackPieceType; + auto newCoords = GetTrackElementOriginAndApplyChanges( { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); - if (!newCoords.has_value()) { WindowRideConstructionUpdateActiveElements(); return; } - const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); - const PreviewTrack* trackBlock = ted.Block; - newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; - _gotoStartPlacementMode = true; - - // When flat rides are deleted, the window should be reset so the currentRide can be placed again. - auto currentRide = GetRide(_currentRideIndex); - const auto& rtd = currentRide->GetRideTypeDescriptor(); - if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) + // Get the previous track element to go to after the selected track element is deleted + inputElement.x = newCoords->x; + inputElement.y = newCoords->y; + inputElement.element = tileElement; + if (TrackBlockGetPrevious({ *newCoords, tileElement }, &trackBeginEnd)) { - RideInitialiseConstructionWindow(*currentRide); + *newCoords = { trackBeginEnd.begin_x, trackBeginEnd.begin_y, trackBeginEnd.begin_z }; + direction = trackBeginEnd.begin_direction; + type = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); + _gotoStartPlacementMode = false; } - } - - auto trackRemoveAction = TrackRemoveAction( - _currentTrackPieceType, 0, { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, currentDirection }); - - trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) + else if (TrackBlockGetNext(&inputElement, &outputElement, &newCoords->z, &direction)) { - WindowRideConstructionUpdateActiveElements(); + newCoords->x = outputElement.x; + newCoords->y = outputElement.y; + direction = outputElement.element->GetDirection(); + type = outputElement.element->AsTrack()->GetTrackType(); + _gotoStartPlacementMode = false; } else { + direction = _currentTrackPieceDirection; + type = _currentTrackPieceType; + newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction & 3) }, type, 0, &tileElement, 0); + + if (!newCoords.has_value()) + { + WindowRideConstructionUpdateActiveElements(); + return; + } + + const auto& ted = GetTrackElementDescriptor(tileElement->AsTrack()->GetTrackType()); + const PreviewTrack* trackBlock = ted.Block; + newCoords->z = (tileElement->GetBaseZ()) - trackBlock->z; + _gotoStartPlacementMode = true; + + // When flat rides are deleted, the window should be reset so the currentRide can be placed again. auto currentRide = GetRide(_currentRideIndex); - if (currentRide != nullptr) + const auto& rtd = currentRide->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_FLAT_RIDE) && !rtd.HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) { - WindowRideConstructionMouseUpDemolishNextPiece({ *newCoords, static_cast(direction) }, type); + RideInitialiseConstructionWindow(*currentRide); } } - }); - GameActions::Execute(&trackRemoveAction); - } + auto trackRemoveAction = TrackRemoveAction( + _currentTrackPieceType, 0, + { _currentTrackBegin.x, _currentTrackBegin.y, _currentTrackBegin.z, currentDirection }); - void Rotate() - { - _autoRotatingShop = false; - _currentTrackPieceDirection = (_currentTrackPieceDirection + 1) & 3; - RideConstructionInvalidateCurrentTrack(); - _currentTrackPrice = kMoney64Undefined; - WindowRideConstructionUpdateActiveElements(); - } - - void EntranceClick() - { - if (ToolSet(*this, WIDX_ENTRANCE, Tool::Crosshair)) - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide != nullptr && !RideTryGetOriginElement(*currentRide, nullptr)) - { - RideInitialiseConstructionWindow(*currentRide); - } - } - else - { - gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_ENTRANCE; - gRideEntranceExitPlaceRideIndex = _currentRideIndex; - gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0); - InputSetFlag(INPUT_FLAG_6, true); - RideConstructionInvalidateCurrentTrack(); - if (_rideConstructionState != RideConstructionState::EntranceExit) - { - gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - _rideConstructionState = RideConstructionState::EntranceExit; - } - WindowRideConstructionUpdateActiveElements(); - } - } - - void ExitClick() - { - if (ToolSet(*this, WIDX_EXIT, Tool::Crosshair)) - { - auto currentRide = GetRide(_currentRideIndex); - if (!RideTryGetOriginElement(*currentRide, nullptr)) - { - RideInitialiseConstructionWindow(*currentRide); - } - } - else - { - gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_EXIT; - gRideEntranceExitPlaceRideIndex = _currentRideIndex; - gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0); - InputSetFlag(INPUT_FLAG_6, true); - RideConstructionInvalidateCurrentTrack(); - if (_rideConstructionState != RideConstructionState::EntranceExit) - { - gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; - _rideConstructionState = RideConstructionState::EntranceExit; - } - WindowRideConstructionUpdateActiveElements(); - } - } - - void UpdateLiftHillSelected(TrackPitch slope) - { - _currentTrackPitchEnd = slope; - _currentTrackPrice = kMoney64Undefined; - if (_rideConstructionState == RideConstructionState::Front && !GetGameState().Cheats.EnableChainLiftOnAllTrack) - { - switch (slope) - { - case TrackPitch::None: - case TrackPitch::Up25: - case TrackPitch::Up60: - break; - default: - _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; - break; - } - } - WindowRideConstructionUpdateActiveElements(); - } - - void SetBrakeSpeed(int32_t brakesSpeed) - { - TileElement* tileElement; - - if (GetTrackElementOriginAndApplyChanges( - { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, - &tileElement, 0) - != std::nullopt) - { - auto trackSetBrakeSpeed = TrackSetBrakeSpeedAction( - _currentTrackBegin, tileElement->AsTrack()->GetTrackType(), brakesSpeed); - trackSetBrakeSpeed.SetCallback( - [](const GameAction* ga, const GameActions::Result* result) { WindowRideConstructionUpdateActiveElements(); }); - GameActions::Execute(&trackSetBrakeSpeed); - return; - } - WindowRideConstructionUpdateActiveElements(); - } - - void ShowSpecialTrackDropdown(Widget* widget) - { - int32_t defaultIndex = -1; - for (size_t i = 0; i < _specialElementDropdownState.Elements.size(); i++) - { - track_type_t trackPiece = _specialElementDropdownState.Elements[i].TrackType; - - const auto& ted = GetTrackElementDescriptor(trackPiece); - StringId trackPieceStringId = ted.Description; - if (trackPieceStringId == STR_RAPIDS) - { - auto currentRide = GetRide(_currentRideIndex); - if (currentRide != nullptr) + trackRemoveAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) { - const auto& rtd = currentRide->GetRideTypeDescriptor(); - if (rtd.Category != RIDE_CATEGORY_WATER) - trackPieceStringId = STR_LOG_BUMPS; - } - } - gDropdownItems[i].Format = trackPieceStringId; - if ((trackPiece | RideConstructionSpecialPieceSelected) == _currentTrackCurve) - { - defaultIndex = static_cast(i); - } - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 0, - _specialElementDropdownState.Elements.size(), widget->width()); - - for (size_t i = 0; i < _specialElementDropdownState.Elements.size(); i++) - { - Dropdown::SetDisabled(static_cast(i), _specialElementDropdownState.Elements[i].Disabled); - } - gDropdownDefaultIndex = defaultIndex; - } - - void RideSelectedTrackSetSeatRotation(int32_t seatRotation) - { - GetTrackElementOriginAndApplyChanges( - { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, - seatRotation, nullptr, TRACK_ELEMENT_SET_SEAT_ROTATION); - WindowRideConstructionUpdateActiveElements(); - } - - void ToolDownEntranceExit(const ScreenCoordsXY& screenCoords) - { - RideConstructionInvalidateCurrentTrack(); - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords); - if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) - return; - - auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( - entranceOrExitCoords, DirectionReverse(gRideEntranceExitPlaceDirection), gRideEntranceExitPlaceRideIndex, - gRideEntranceExitPlaceStationIndex, gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_EXIT); - - rideEntranceExitPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - return; - - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - - auto currentRide = GetRide(gRideEntranceExitPlaceRideIndex); - if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful) - { - ToolCancel(); - if (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) - { - WindowCloseByClass(WindowClass::RideConstruction); - } - } - else - { - gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1; - WindowInvalidateByClass(WindowClass::RideConstruction); - gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE) - ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE - : WC_RIDE_CONSTRUCTION__WIDX_EXIT; - } - }); - auto res = GameActions::Execute(&rideEntranceExitPlaceAction); - } - - void DrawTrackPiece( - DrawPixelInfo& dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, - int32_t widgetWidth, int32_t widgetHeight) - { - auto currentRide = GetRide(rideIndex); - if (currentRide == nullptr) - { - return; - } - - const auto& ted = GetTrackElementDescriptor(trackType); - const auto* trackBlock = ted.Block; - while ((trackBlock + 1)->index != 0xFF) - trackBlock++; - - CoordsXYZ mapCoords{ trackBlock->x, trackBlock->y, trackBlock->z }; - if (trackBlock->flags & RCT_PREVIEW_TRACK_FLAG_1) - { - mapCoords.x = 0; - mapCoords.y = 0; - } - - auto rotatedMapCoords = mapCoords.Rotate(trackDirection); - // this is actually case 0, but the other cases all jump to it - mapCoords.x = 4112 + (rotatedMapCoords.x / 2); - mapCoords.y = 4112 + (rotatedMapCoords.y / 2); - mapCoords.z = 1024 + mapCoords.z; - - auto previewZOffset = ted.Definition.PreviewZOffset; - mapCoords.z -= previewZOffset; - - const ScreenCoordsXY rotatedScreenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), mapCoords); - - dpi.x += rotatedScreenCoords.x - widgetWidth / 2; - dpi.y += rotatedScreenCoords.y - widgetHeight / 2 - 16; - - DrawTrackPieceHelper(dpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, { 4096, 4096 }, 1024); - } - - void DrawTrackPieceHelper( - DrawPixelInfo& dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, - const CoordsXY& originCoords, int32_t originZ) - { - TileElement tempSideTrackTileElement{ 0x80, 0x8F, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - TileElement tempTrackTileElement{}; - TileElement* backupTileElementArrays[5]{}; - PaintSession* session = PaintSessionAlloc(dpi, 0, GetCurrentRotation()); - trackDirection &= 3; - - auto currentRide = GetRide(rideIndex); - if (currentRide == nullptr) - { - return; - } - - auto& gameState = OpenRCT2::GetGameState(); - auto preserveMapSize = gameState.MapSize; - - gameState.MapSize = { MAXIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL }; - - // Setup non changing parts of the temporary track tile element - tempTrackTileElement.SetType(TileElementType::Track); - tempTrackTileElement.SetDirection(trackDirection); - tempTrackTileElement.AsTrack()->SetHasChain((liftHillAndInvertedState & CONSTRUCTION_LIFT_HILL_SELECTED) != 0); - tempTrackTileElement.SetLastForTile(true); - tempTrackTileElement.AsTrack()->SetTrackType(trackType); - tempTrackTileElement.AsTrack()->SetRideType(currentRide->type); - tempTrackTileElement.AsTrack()->SetHasCableLift(false); - tempTrackTileElement.AsTrack()->SetInverted((liftHillAndInvertedState & CONSTRUCTION_INVERTED_TRACK_SELECTED) != 0); - tempTrackTileElement.AsTrack()->SetColourScheme(RIDE_COLOUR_SCHEME_MAIN); - // Skipping seat rotation, should not be necessary for a temporary piece. - tempTrackTileElement.AsTrack()->SetRideIndex(rideIndex); - - const auto& ted = GetTrackElementDescriptor(trackType); - const auto* trackBlock = ted.Block; - const auto* rideEntry = currentRide->GetRideEntry(); - auto clearanceHeight = (rideEntry != nullptr) ? rideEntry->Clearance - : currentRide->GetRideTypeDescriptor().Heights.ClearanceHeight; - - while (trackBlock->index != 255) - { - auto quarterTile = trackBlock->var_08.Rotate(trackDirection); - CoordsXY offsets = { trackBlock->x, trackBlock->y }; - CoordsXY coords = originCoords + offsets.Rotate(trackDirection); - - int32_t baseZ = originZ + trackBlock->z; - int32_t clearanceZ = trackBlock->ClearanceZ + clearanceHeight + baseZ + (4 * COORDS_Z_STEP); - - auto centreTileCoords = TileCoordsXY{ coords }; - auto eastTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_EAST]; - auto westTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_WEST]; - auto northTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_NORTH]; - auto southTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_SOUTH]; - - // Replace map elements with temporary ones containing track - backupTileElementArrays[0] = MapGetFirstElementAt(centreTileCoords); - backupTileElementArrays[1] = MapGetFirstElementAt(eastTileCoords); - backupTileElementArrays[2] = MapGetFirstElementAt(westTileCoords); - backupTileElementArrays[3] = MapGetFirstElementAt(northTileCoords); - backupTileElementArrays[4] = MapGetFirstElementAt(southTileCoords); - MapSetTileElement(centreTileCoords, &tempTrackTileElement); - MapSetTileElement(eastTileCoords, &tempSideTrackTileElement); - MapSetTileElement(westTileCoords, &tempSideTrackTileElement); - MapSetTileElement(northTileCoords, &tempSideTrackTileElement); - MapSetTileElement(southTileCoords, &tempSideTrackTileElement); - - // Set the temporary track element - tempTrackTileElement.SetOccupiedQuadrants(quarterTile.GetBaseQuarterOccupied()); - tempTrackTileElement.SetBaseZ(baseZ); - tempTrackTileElement.SetClearanceZ(clearanceZ); - tempTrackTileElement.AsTrack()->SetSequenceIndex(trackBlock->index); - - // Draw this map tile - TileElementPaintSetup(*session, coords, true); - - // Restore map elements - MapSetTileElement(centreTileCoords, backupTileElementArrays[0]); - MapSetTileElement(eastTileCoords, backupTileElementArrays[1]); - MapSetTileElement(westTileCoords, backupTileElementArrays[2]); - MapSetTileElement(northTileCoords, backupTileElementArrays[3]); - MapSetTileElement(southTileCoords, backupTileElementArrays[4]); - - trackBlock++; - } - - gameState.MapSize = preserveMapSize; - - PaintSessionArrange(*session); - PaintDrawStructs(*session); - PaintSessionFree(session); - } -}; - -static void WindowRideConstructionUpdateDisabledPieces(ObjectEntryIndex rideType) -{ - RideTrackGroup disabledPieces{}; - const auto& rtd = GetRideTypeDescriptor(rideType); - if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) - { - // Set all pieces as “disabled”. When looping over the ride entries, - // pieces will be re-enabled as soon as a single entry supports it. - disabledPieces.flip(); - - auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); - auto& rideEntries = objManager.GetAllRideEntries(rideType); - // If there are no vehicles for this ride type, enable all the track pieces. - if (rideEntries.size() == 0) - { - disabledPieces.reset(); - } - - for (auto rideEntryIndex : rideEntries) - { - const auto* currentRideEntry = GetRideEntryByIndex(rideEntryIndex); - if (currentRideEntry == nullptr) - continue; - - // Non-default vehicle visuals do not use this system, so we have to assume it supports all the track pieces. - if (currentRideEntry->Cars[0].PaintStyle != VEHICLE_VISUAL_DEFAULT || rideType == RIDE_TYPE_CHAIRLIFT - || (currentRideEntry->Cars[0].flags & CAR_ENTRY_FLAG_SLIDE_SWING)) - { - disabledPieces.reset(); - break; - } - - // Any pieces that this ride entry supports must be taken out of the array. - auto supportedPieces = RideEntryGetSupportedTrackPieces(*currentRideEntry); - disabledPieces &= supportedPieces.flip(); - } - } - - UpdateDisabledRidePieces(disabledPieces); -} - -/** - * - * rct2: 0x006CB481 - */ -WindowBase* WindowRideConstructionOpen() -{ - RideId rideIndex = _currentRideIndex; - CloseRideWindowForConstruction(rideIndex); - - auto currentRide = GetRide(rideIndex); - if (currentRide == nullptr) - { - return nullptr; - } - - WindowRideConstructionUpdateDisabledPieces(currentRide->type); - - const auto& rtd = currentRide->GetRideTypeDescriptor(); - switch (rtd.ConstructionWindowContext) - { - case RideConstructionWindowContext::Maze: - return ContextOpenWindowView(WV_MAZE_CONSTRUCTION); - case RideConstructionWindowContext::Default: - return WindowCreate( - WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); - } - return WindowCreate(WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); -} - -static void CloseConstructWindowOnCompletion(const Ride& ride) -{ - if (_rideConstructionState == RideConstructionState::State0) - { - auto w = WindowFindByClass(WindowClass::RideConstruction); - if (w != nullptr) - { - if (RideAreAllPossibleEntrancesAndExitsBuilt(ride).Successful) - { - WindowClose(*w); - } - else - { - w->OnMouseUp(WIDX_ENTRANCE); - } - } - } -} - -static void WindowRideConstructionDoEntranceExitCheck() -{ - auto w = WindowFindByClass(WindowClass::RideConstruction); - auto ride = GetRide(_currentRideIndex); - if (w == nullptr || ride == nullptr) - { - return; - } - - if (_rideConstructionState == RideConstructionState::State0) - { - w = WindowFindByClass(WindowClass::RideConstruction); - if (w != nullptr) - { - if (!RideAreAllPossibleEntrancesAndExitsBuilt(*ride).Successful) - { - w->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); - } - } - } -} - -static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result) -{ - if (result->Error != GameActions::Status::Ok) - { - WindowRideConstructionUpdateActiveElements(); - return; - } - auto ride = GetRide(_currentRideIndex); - if (ride != nullptr) - { - int32_t trackDirection = _currentTrackPieceDirection; - auto trackPos = _currentTrackBegin; - if (!(trackDirection & 4)) - { - trackPos -= CoordsDirectionDelta[trackDirection]; - } - - CoordsXYE next_track; - if (TrackBlockGetNextFromZero(trackPos, *ride, trackDirection, &next_track, &trackPos.z, &trackDirection, false)) - { - _currentTrackBegin.x = next_track.x; - _currentTrackBegin.y = next_track.y; - _currentTrackBegin.z = trackPos.z; - _currentTrackPieceDirection = next_track.element->GetDirection(); - _currentTrackPieceType = next_track.element->AsTrack()->GetTrackType(); - _currentTrackSelectionFlags = 0; - _rideConstructionState = RideConstructionState::Selected; - _rideConstructionNextArrowPulse = 0; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - RideSelectNextSection(); - } - else - { - _rideConstructionState = RideConstructionState::State0; - } - - WindowRideConstructionDoEntranceExitCheck(); - WindowRideConstructionUpdateActiveElements(); - } - - WindowCloseByClass(WindowClass::Error); - if (ride != nullptr) - CloseConstructWindowOnCompletion(*ride); -} - -static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const GameActions::Result* result) -{ - if (result->Error != GameActions::Status::Ok) - { - WindowRideConstructionUpdateActiveElements(); - return; - } - auto ride = GetRide(_currentRideIndex); - if (ride != nullptr) - { - auto trackDirection = DirectionReverse(_currentTrackPieceDirection); - auto trackPos = _currentTrackBegin; - if (!(trackDirection & 4)) - { - trackPos += CoordsDirectionDelta[trackDirection]; - } - - TrackBeginEnd trackBeginEnd; - if (TrackBlockGetPreviousFromZero(trackPos, *ride, trackDirection, &trackBeginEnd)) - { - _currentTrackBegin.x = trackBeginEnd.begin_x; - _currentTrackBegin.y = trackBeginEnd.begin_y; - _currentTrackBegin.z = trackBeginEnd.begin_z; - _currentTrackPieceDirection = trackBeginEnd.begin_direction; - _currentTrackPieceType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); - _currentTrackSelectionFlags = 0; - _rideConstructionState = RideConstructionState::Selected; - _rideConstructionNextArrowPulse = 0; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - RideSelectPreviousSection(); - } - else - { - _rideConstructionState = RideConstructionState::State0; - } - - WindowRideConstructionUpdateActiveElements(); - } - - WindowCloseByClass(WindowClass::Error); - if (ride != nullptr) - CloseConstructWindowOnCompletion(*ride); -} - -/** - * - * rct2: 0x006CC538 - */ -static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoordsXY screenCoords) -{ - CoordsXY mapCoords; - - if (!_trackPlaceCtrlState) - { - if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_COPY_Z) - { - auto info = GetMapCoordinatesFromPos(screenCoords, 0xFCCA); - if (info.SpriteType != ViewportInteractionItem::None) - { - _trackPlaceCtrlZ = info.Element->GetBaseZ(); - _trackPlaceCtrlState = true; - } - } - } - else - { - if (!(gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_COPY_Z)) - { - _trackPlaceCtrlState = false; - } - } - - if (!_trackPlaceShiftState) - { - if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) - { - _trackPlaceShiftState = true; - _trackPlaceShiftStart = screenCoords; - _trackPlaceShiftZ = 0; - } - } - else - { - if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) - { - uint16_t maxHeight = ZoomLevel::max().ApplyTo(std::numeric_limits::max() - 32); - - _trackPlaceShiftZ = _trackPlaceShiftStart.y - screenCoords.y + 4; - // Scale delta by zoom to match mouse position. - auto* mainWnd = WindowGetMain(); - if (mainWnd != nullptr && mainWnd->viewport != nullptr) - { - _trackPlaceShiftZ = mainWnd->viewport->zoom.ApplyTo(_trackPlaceShiftZ); - } - _trackPlaceShiftZ = Floor2(_trackPlaceShiftZ, 8); - - // Clamp to maximum possible value of BaseHeight can offer. - _trackPlaceShiftZ = std::min(_trackPlaceShiftZ, maxHeight); - - screenCoords = _trackPlaceShiftStart; - } - else - { - _trackPlaceShiftState = false; - } - } - - if (!_trackPlaceCtrlState) - { - mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - if (mapCoords.IsNull()) - return std::nullopt; - - _trackPlaceZ = 0; - if (_trackPlaceShiftState) - { - auto surfaceElement = MapGetSurfaceElementAt(mapCoords); - if (surfaceElement == nullptr) - return std::nullopt; - auto mapZ = Floor2(surfaceElement->GetBaseZ(), 16); - mapZ += _trackPlaceShiftZ; - mapZ = std::max(mapZ, 16); - _trackPlaceZ = mapZ; - } - } - else - { - auto mapZ = _trackPlaceCtrlZ; - auto mapXYCoords = ScreenGetMapXYWithZ(screenCoords, mapZ); - if (mapXYCoords.has_value()) - { - mapCoords = mapXYCoords.value(); - } - else - { - return std::nullopt; - } - - if (_trackPlaceShiftState != 0) - { - mapZ += _trackPlaceShiftZ; - } - _trackPlaceZ = std::max(mapZ, 16); - } - - if (mapCoords.x == LOCATION_NULL) - return std::nullopt; - - return mapCoords.ToTileStart(); -} - -/** - * - * rct2: 0x006C84CE - */ -void WindowRideConstructionUpdateActiveElementsImpl() -{ - WindowRideConstructionUpdateEnabledTrackPieces(); - if (auto currentRide = GetRide(_currentRideIndex); - !currentRide || currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { - return; - } - - auto window = static_cast(WindowFindByClass(WindowClass::RideConstruction)); - if (!window) - { - return; - } - - window->UpdateMapSelection(); - - _selectedTrackType = TrackElemType::None; - if (_rideConstructionState == RideConstructionState::Selected) - { - TileElement* tileElement; - if (GetTrackElementOriginAndApplyChanges( - { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, - &tileElement, 0) - != std::nullopt) - { - _selectedTrackType = tileElement->AsTrack()->GetTrackType(); - if (TrackTypeHasSpeedSetting(tileElement->AsTrack()->GetTrackType())) - _currentBrakeSpeed2 = tileElement->AsTrack()->GetBrakeBoosterSpeed(); - _currentSeatRotationAngle = tileElement->AsTrack()->GetSeatRotation(); - } - } - - window->UpdatePossibleRideConfigurations(); - window->UpdateWidgets(); -} - -/** - * - * rct2: 0x006C6A77 - */ -void WindowRideConstructionUpdateEnabledTrackPieces() -{ - auto ride = GetRide(_currentRideIndex); - if (ride == nullptr) - return; - - auto rideEntry = ride->GetRideEntry(); - if (rideEntry == nullptr) - return; - - int32_t rideType = RideGetAlternativeType(*ride); - UpdateEnabledRidePieces(rideType); -} - -/** - * - * rct2: 0x006C94D8 - */ -void UpdateGhostTrackAndArrow() -{ - RideId rideIndex; - int32_t direction, type, liftHillAndAlternativeState; - CoordsXYZ trackPos{}; - - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK_PLACE_ACTION_QUEUED) - { - return; - } - - // Recheck if area is fine for new track. - // Set by footpath placement - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_RECHECK) - { - RideConstructionInvalidateCurrentTrack(); - _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_RECHECK; - } - - switch (_rideConstructionState) - { - case RideConstructionState::Front: - case RideConstructionState::Back: - { - // place ghost piece - if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) - { - if (WindowRideConstructionUpdateState( - &type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) - { - RideConstructionRemoveGhosts(); + WindowRideConstructionUpdateActiveElements(); } else { - _currentTrackPrice = PlaceProvisionalTrackPiece( - rideIndex, type, direction, liftHillAndAlternativeState, trackPos); - WindowRideConstructionUpdateActiveElements(); + auto currentRide = GetRide(_currentRideIndex); + if (currentRide != nullptr) + { + WindowRideConstructionMouseUpDemolishNextPiece({ *newCoords, static_cast(direction) }, type); + } + } + }); + + GameActions::Execute(&trackRemoveAction); + } + + void Rotate() + { + _autoRotatingShop = false; + _currentTrackPieceDirection = (_currentTrackPieceDirection + 1) & 3; + RideConstructionInvalidateCurrentTrack(); + _currentTrackPrice = kMoney64Undefined; + WindowRideConstructionUpdateActiveElements(); + } + + void EntranceClick() + { + if (ToolSet(*this, WIDX_ENTRANCE, Tool::Crosshair)) + { + auto currentRide = GetRide(_currentRideIndex); + if (currentRide != nullptr && !RideTryGetOriginElement(*currentRide, nullptr)) + { + RideInitialiseConstructionWindow(*currentRide); } } - // update flashing arrow - auto curTime = Platform::GetTicks(); - if (_rideConstructionNextArrowPulse >= curTime) - break; - _rideConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; - - _currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW; - trackPos = _currentTrackBegin; - direction = _currentTrackPieceDirection; - type = _currentTrackPieceType; - // diagonal pieces trigger this - if (direction >= 4) - direction += 4; - if (_rideConstructionState == RideConstructionState::Back) - direction = DirectionReverse(direction); - gMapSelectArrowPosition = trackPos; - gMapSelectArrowDirection = direction; + else + { + gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_ENTRANCE; + gRideEntranceExitPlaceRideIndex = _currentRideIndex; + gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0); + InputSetFlag(INPUT_FLAG_6, true); + RideConstructionInvalidateCurrentTrack(); + if (_rideConstructionState != RideConstructionState::EntranceExit) + { + gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; + _rideConstructionState = RideConstructionState::EntranceExit; + } + WindowRideConstructionUpdateActiveElements(); + } + } + + void ExitClick() + { + if (ToolSet(*this, WIDX_EXIT, Tool::Crosshair)) + { + auto currentRide = GetRide(_currentRideIndex); + if (!RideTryGetOriginElement(*currentRide, nullptr)) + { + RideInitialiseConstructionWindow(*currentRide); + } + } + else + { + gRideEntranceExitPlaceType = ENTRANCE_TYPE_RIDE_EXIT; + gRideEntranceExitPlaceRideIndex = _currentRideIndex; + gRideEntranceExitPlaceStationIndex = StationIndex::FromUnderlying(0); + InputSetFlag(INPUT_FLAG_6, true); + RideConstructionInvalidateCurrentTrack(); + if (_rideConstructionState != RideConstructionState::EntranceExit) + { + gRideEntranceExitPlacePreviousRideConstructionState = _rideConstructionState; + _rideConstructionState = RideConstructionState::EntranceExit; + } + WindowRideConstructionUpdateActiveElements(); + } + } + + void UpdateLiftHillSelected(TrackPitch slope) + { + _currentTrackPitchEnd = slope; + _currentTrackPrice = kMoney64Undefined; + if (_rideConstructionState == RideConstructionState::Front && !GetGameState().Cheats.EnableChainLiftOnAllTrack) + { + switch (slope) + { + case TrackPitch::None: + case TrackPitch::Up25: + case TrackPitch::Up60: + break; + default: + _currentTrackLiftHill &= ~CONSTRUCTION_LIFT_HILL_SELECTED; + break; + } + } + WindowRideConstructionUpdateActiveElements(); + } + + void SetBrakeSpeed(int32_t brakesSpeed) + { + TileElement* tileElement; + + if (GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, + &tileElement, 0) + != std::nullopt) + { + auto trackSetBrakeSpeed = TrackSetBrakeSpeedAction( + _currentTrackBegin, tileElement->AsTrack()->GetTrackType(), brakesSpeed); + trackSetBrakeSpeed.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + WindowRideConstructionUpdateActiveElements(); + }); + GameActions::Execute(&trackSetBrakeSpeed); + return; + } + WindowRideConstructionUpdateActiveElements(); + } + + void ShowSpecialTrackDropdown(Widget* widget) + { + int32_t defaultIndex = -1; + for (size_t i = 0; i < _specialElementDropdownState.Elements.size(); i++) + { + track_type_t trackPiece = _specialElementDropdownState.Elements[i].TrackType; + + const auto& ted = GetTrackElementDescriptor(trackPiece); + StringId trackPieceStringId = ted.Description; + if (trackPieceStringId == STR_RAPIDS) + { + auto currentRide = GetRide(_currentRideIndex); + if (currentRide != nullptr) + { + const auto& rtd = currentRide->GetRideTypeDescriptor(); + if (rtd.Category != RIDE_CATEGORY_WATER) + trackPieceStringId = STR_LOG_BUMPS; + } + } + gDropdownItems[i].Format = trackPieceStringId; + if ((trackPiece | RideConstructionSpecialPieceSelected) == _currentTrackCurve) + { + defaultIndex = static_cast(i); + } + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 0, + _specialElementDropdownState.Elements.size(), widget->width()); + + for (size_t i = 0; i < _specialElementDropdownState.Elements.size(); i++) + { + Dropdown::SetDisabled(static_cast(i), _specialElementDropdownState.Elements[i].Disabled); + } + gDropdownDefaultIndex = defaultIndex; + } + + void RideSelectedTrackSetSeatRotation(int32_t seatRotation) + { + GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, + seatRotation, nullptr, TRACK_ELEMENT_SET_SEAT_ROTATION); + WindowRideConstructionUpdateActiveElements(); + } + + void ToolDownEntranceExit(const ScreenCoordsXY& screenCoords) + { + RideConstructionInvalidateCurrentTrack(); + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - MapInvalidateTileFull(trackPos); - break; - } - case RideConstructionState::Selected: - { - auto curTime = Platform::GetTicks(); - if (_rideConstructionNextArrowPulse >= curTime) - break; - _rideConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; - - _currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW; - direction = _currentTrackPieceDirection & 3; - type = _currentTrackPieceType; - uint16_t flags = _currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW ? TRACK_ELEMENT_SET_HIGHLIGHT_TRUE - : TRACK_ELEMENT_SET_HIGHLIGHT_FALSE; - auto newCoords = GetTrackElementOriginAndApplyChanges( - { _currentTrackBegin, static_cast(direction) }, type, 0, nullptr, flags); - if (!newCoords.has_value()) + + CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords); + if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) + return; + + auto rideEntranceExitPlaceAction = RideEntranceExitPlaceAction( + entranceOrExitCoords, DirectionReverse(gRideEntranceExitPlaceDirection), gRideEntranceExitPlaceRideIndex, + gRideEntranceExitPlaceStationIndex, gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_EXIT); + + rideEntranceExitPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + + auto currentRide = GetRide(gRideEntranceExitPlaceRideIndex); + if (currentRide != nullptr && RideAreAllPossibleEntrancesAndExitsBuilt(*currentRide).Successful) + { + ToolCancel(); + if (!currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + { + WindowCloseByClass(WindowClass::RideConstruction); + } + } + else + { + gRideEntranceExitPlaceType = gRideEntranceExitPlaceType ^ 1; + WindowInvalidateByClass(WindowClass::RideConstruction); + gCurrentToolWidget.widget_index = (gRideEntranceExitPlaceType == ENTRANCE_TYPE_RIDE_ENTRANCE) + ? WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE + : WC_RIDE_CONSTRUCTION__WIDX_EXIT; + } + }); + auto res = GameActions::Execute(&rideEntranceExitPlaceAction); + } + + void DrawTrackPiece( + DrawPixelInfo& dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, + int32_t widgetWidth, int32_t widgetHeight) + { + auto currentRide = GetRide(rideIndex); + if (currentRide == nullptr) + { + return; + } + + const auto& ted = GetTrackElementDescriptor(trackType); + const auto* trackBlock = ted.Block; + while ((trackBlock + 1)->index != 0xFF) + trackBlock++; + + CoordsXYZ mapCoords{ trackBlock->x, trackBlock->y, trackBlock->z }; + if (trackBlock->flags & RCT_PREVIEW_TRACK_FLAG_1) + { + mapCoords.x = 0; + mapCoords.y = 0; + } + + auto rotatedMapCoords = mapCoords.Rotate(trackDirection); + // this is actually case 0, but the other cases all jump to it + mapCoords.x = 4112 + (rotatedMapCoords.x / 2); + mapCoords.y = 4112 + (rotatedMapCoords.y / 2); + mapCoords.z = 1024 + mapCoords.z; + + auto previewZOffset = ted.Definition.PreviewZOffset; + mapCoords.z -= previewZOffset; + + const ScreenCoordsXY rotatedScreenCoords = Translate3DTo2DWithZ(GetCurrentRotation(), mapCoords); + + dpi.x += rotatedScreenCoords.x - widgetWidth / 2; + dpi.y += rotatedScreenCoords.y - widgetHeight / 2 - 16; + + DrawTrackPieceHelper(dpi, rideIndex, trackType, trackDirection, liftHillAndInvertedState, { 4096, 4096 }, 1024); + } + + void DrawTrackPieceHelper( + DrawPixelInfo& dpi, RideId rideIndex, int32_t trackType, int32_t trackDirection, int32_t liftHillAndInvertedState, + const CoordsXY& originCoords, int32_t originZ) + { + TileElement tempSideTrackTileElement{ 0x80, 0x8F, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; + TileElement tempTrackTileElement{}; + TileElement* backupTileElementArrays[5]{}; + PaintSession* session = PaintSessionAlloc(dpi, 0, GetCurrentRotation()); + trackDirection &= 3; + + auto currentRide = GetRide(rideIndex); + if (currentRide == nullptr) + { + return; + } + + auto& gameState = OpenRCT2::GetGameState(); + auto preserveMapSize = gameState.MapSize; + + gameState.MapSize = { MAXIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL }; + + // Setup non changing parts of the temporary track tile element + tempTrackTileElement.SetType(TileElementType::Track); + tempTrackTileElement.SetDirection(trackDirection); + tempTrackTileElement.AsTrack()->SetHasChain((liftHillAndInvertedState & CONSTRUCTION_LIFT_HILL_SELECTED) != 0); + tempTrackTileElement.SetLastForTile(true); + tempTrackTileElement.AsTrack()->SetTrackType(trackType); + tempTrackTileElement.AsTrack()->SetRideType(currentRide->type); + tempTrackTileElement.AsTrack()->SetHasCableLift(false); + tempTrackTileElement.AsTrack()->SetInverted((liftHillAndInvertedState & CONSTRUCTION_INVERTED_TRACK_SELECTED) != 0); + tempTrackTileElement.AsTrack()->SetColourScheme(RIDE_COLOUR_SCHEME_MAIN); + // Skipping seat rotation, should not be necessary for a temporary piece. + tempTrackTileElement.AsTrack()->SetRideIndex(rideIndex); + + const auto& ted = GetTrackElementDescriptor(trackType); + const auto* trackBlock = ted.Block; + const auto* rideEntry = currentRide->GetRideEntry(); + auto clearanceHeight = (rideEntry != nullptr) ? rideEntry->Clearance + : currentRide->GetRideTypeDescriptor().Heights.ClearanceHeight; + + while (trackBlock->index != 255) + { + auto quarterTile = trackBlock->var_08.Rotate(trackDirection); + CoordsXY offsets = { trackBlock->x, trackBlock->y }; + CoordsXY coords = originCoords + offsets.Rotate(trackDirection); + + int32_t baseZ = originZ + trackBlock->z; + int32_t clearanceZ = trackBlock->ClearanceZ + clearanceHeight + baseZ + (4 * COORDS_Z_STEP); + + auto centreTileCoords = TileCoordsXY{ coords }; + auto eastTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_EAST]; + auto westTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_WEST]; + auto northTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_NORTH]; + auto southTileCoords = centreTileCoords + TileDirectionDelta[TILE_ELEMENT_DIRECTION_SOUTH]; + + // Replace map elements with temporary ones containing track + backupTileElementArrays[0] = MapGetFirstElementAt(centreTileCoords); + backupTileElementArrays[1] = MapGetFirstElementAt(eastTileCoords); + backupTileElementArrays[2] = MapGetFirstElementAt(westTileCoords); + backupTileElementArrays[3] = MapGetFirstElementAt(northTileCoords); + backupTileElementArrays[4] = MapGetFirstElementAt(southTileCoords); + MapSetTileElement(centreTileCoords, &tempTrackTileElement); + MapSetTileElement(eastTileCoords, &tempSideTrackTileElement); + MapSetTileElement(westTileCoords, &tempSideTrackTileElement); + MapSetTileElement(northTileCoords, &tempSideTrackTileElement); + MapSetTileElement(southTileCoords, &tempSideTrackTileElement); + + // Set the temporary track element + tempTrackTileElement.SetOccupiedQuadrants(quarterTile.GetBaseQuarterOccupied()); + tempTrackTileElement.SetBaseZ(baseZ); + tempTrackTileElement.SetClearanceZ(clearanceZ); + tempTrackTileElement.AsTrack()->SetSequenceIndex(trackBlock->index); + + // Draw this map tile + TileElementPaintSetup(*session, coords, true); + + // Restore map elements + MapSetTileElement(centreTileCoords, backupTileElementArrays[0]); + MapSetTileElement(eastTileCoords, backupTileElementArrays[1]); + MapSetTileElement(westTileCoords, backupTileElementArrays[2]); + MapSetTileElement(northTileCoords, backupTileElementArrays[3]); + MapSetTileElement(southTileCoords, backupTileElementArrays[4]); + + trackBlock++; + } + + gameState.MapSize = preserveMapSize; + + PaintSessionArrange(*session); + PaintDrawStructs(*session); + PaintSessionFree(session); + } + }; + + static void WindowRideConstructionUpdateDisabledPieces(ObjectEntryIndex rideType) + { + RideTrackGroup disabledPieces{}; + const auto& rtd = GetRideTypeDescriptor(rideType); + if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + { + // Set all pieces as “disabled”. When looping over the ride entries, + // pieces will be re-enabled as soon as a single entry supports it. + disabledPieces.flip(); + + auto& objManager = OpenRCT2::GetContext()->GetObjectManager(); + auto& rideEntries = objManager.GetAllRideEntries(rideType); + // If there are no vehicles for this ride type, enable all the track pieces. + if (rideEntries.size() == 0) + { + disabledPieces.reset(); + } + + for (auto rideEntryIndex : rideEntries) + { + const auto* currentRideEntry = GetRideEntryByIndex(rideEntryIndex); + if (currentRideEntry == nullptr) + continue; + + // Non-default vehicle visuals do not use this system, so we have to assume it supports all the track pieces. + if (currentRideEntry->Cars[0].PaintStyle != VEHICLE_VISUAL_DEFAULT || rideType == RIDE_TYPE_CHAIRLIFT + || (currentRideEntry->Cars[0].flags & CAR_ENTRY_FLAG_SLIDE_SWING)) + { + disabledPieces.reset(); + break; + } + + // Any pieces that this ride entry supports must be taken out of the array. + auto supportedPieces = RideEntryGetSupportedTrackPieces(*currentRideEntry); + disabledPieces &= supportedPieces.flip(); + } + } + + UpdateDisabledRidePieces(disabledPieces); + } + + /** + * + * rct2: 0x006CB481 + */ + WindowBase* WindowRideConstructionOpen() + { + RideId rideIndex = _currentRideIndex; + CloseRideWindowForConstruction(rideIndex); + + auto currentRide = GetRide(rideIndex); + if (currentRide == nullptr) + { + return nullptr; + } + + WindowRideConstructionUpdateDisabledPieces(currentRide->type); + + const auto& rtd = currentRide->GetRideTypeDescriptor(); + switch (rtd.ConstructionWindowContext) + { + case RideConstructionWindowContext::Maze: + return ContextOpenWindowView(WV_MAZE_CONSTRUCTION); + case RideConstructionWindowContext::Default: + return WindowCreate( + WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); + } + return WindowCreate( + WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); + } + + static void CloseConstructWindowOnCompletion(const Ride& ride) + { + if (_rideConstructionState == RideConstructionState::State0) + { + auto w = WindowFindByClass(WindowClass::RideConstruction); + if (w != nullptr) + { + if (RideAreAllPossibleEntrancesAndExitsBuilt(ride).Successful) + { + WindowClose(*w); + } + else + { + w->OnMouseUp(WIDX_ENTRANCE); + } + } + } + } + + static void WindowRideConstructionDoEntranceExitCheck() + { + auto w = WindowFindByClass(WindowClass::RideConstruction); + auto ride = GetRide(_currentRideIndex); + if (w == nullptr || ride == nullptr) + { + return; + } + + if (_rideConstructionState == RideConstructionState::State0) + { + w = WindowFindByClass(WindowClass::RideConstruction); + if (w != nullptr) + { + if (!RideAreAllPossibleEntrancesAndExitsBuilt(*ride).Successful) + { + w->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); + } + } + } + } + + static void RideConstructPlacedForwardGameActionCallback(const GameAction* ga, const GameActions::Result* result) + { + if (result->Error != GameActions::Status::Ok) + { + WindowRideConstructionUpdateActiveElements(); + return; + } + auto ride = GetRide(_currentRideIndex); + if (ride != nullptr) + { + int32_t trackDirection = _currentTrackPieceDirection; + auto trackPos = _currentTrackBegin; + if (!(trackDirection & 4)) + { + trackPos -= CoordsDirectionDelta[trackDirection]; + } + + CoordsXYE next_track; + if (TrackBlockGetNextFromZero(trackPos, *ride, trackDirection, &next_track, &trackPos.z, &trackDirection, false)) + { + _currentTrackBegin.x = next_track.x; + _currentTrackBegin.y = next_track.y; + _currentTrackBegin.z = trackPos.z; + _currentTrackPieceDirection = next_track.element->GetDirection(); + _currentTrackPieceType = next_track.element->AsTrack()->GetTrackType(); + _currentTrackSelectionFlags = 0; + _rideConstructionState = RideConstructionState::Selected; + _rideConstructionNextArrowPulse = 0; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + RideSelectNextSection(); + } + else { - RideConstructionRemoveGhosts(); _rideConstructionState = RideConstructionState::State0; } - break; - } - case RideConstructionState::MazeBuild: - case RideConstructionState::MazeMove: - case RideConstructionState::MazeFill: - { - auto curTime = Platform::GetTicks(); - if (_rideConstructionNextArrowPulse >= curTime) - break; - _rideConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; - _currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW; - trackPos = CoordsXYZ{ _currentTrackBegin.x & 0xFFE0, _currentTrackBegin.y & 0xFFE0, _currentTrackBegin.z + 15 }; - gMapSelectArrowPosition = trackPos; - gMapSelectArrowDirection = 4; - if (((_currentTrackBegin.x & 0x1F) | (_currentTrackBegin.y & 0x1F)) != 0) + WindowRideConstructionDoEntranceExitCheck(); + WindowRideConstructionUpdateActiveElements(); + } + + WindowCloseByClass(WindowClass::Error); + if (ride != nullptr) + CloseConstructWindowOnCompletion(*ride); + } + + static void RideConstructPlacedBackwardGameActionCallback(const GameAction* ga, const GameActions::Result* result) + { + if (result->Error != GameActions::Status::Ok) + { + WindowRideConstructionUpdateActiveElements(); + return; + } + auto ride = GetRide(_currentRideIndex); + if (ride != nullptr) + { + auto trackDirection = DirectionReverse(_currentTrackPieceDirection); + auto trackPos = _currentTrackBegin; + if (!(trackDirection & 4)) { - gMapSelectArrowDirection = 6; - if (((_currentTrackBegin.x & 0x1F) & (_currentTrackBegin.y & 0x1F)) == 0) + trackPos += CoordsDirectionDelta[trackDirection]; + } + + TrackBeginEnd trackBeginEnd; + if (TrackBlockGetPreviousFromZero(trackPos, *ride, trackDirection, &trackBeginEnd)) + { + _currentTrackBegin.x = trackBeginEnd.begin_x; + _currentTrackBegin.y = trackBeginEnd.begin_y; + _currentTrackBegin.z = trackBeginEnd.begin_z; + _currentTrackPieceDirection = trackBeginEnd.begin_direction; + _currentTrackPieceType = trackBeginEnd.begin_element->AsTrack()->GetTrackType(); + _currentTrackSelectionFlags = 0; + _rideConstructionState = RideConstructionState::Selected; + _rideConstructionNextArrowPulse = 0; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + RideSelectPreviousSection(); + } + else + { + _rideConstructionState = RideConstructionState::State0; + } + + WindowRideConstructionUpdateActiveElements(); + } + + WindowCloseByClass(WindowClass::Error); + if (ride != nullptr) + CloseConstructWindowOnCompletion(*ride); + } + + /** + * + * rct2: 0x006CC538 + */ + static std::optional RideGetPlacePositionFromScreenPosition(ScreenCoordsXY screenCoords) + { + CoordsXY mapCoords; + + if (!_trackPlaceCtrlState) + { + if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_COPY_Z) + { + auto info = GetMapCoordinatesFromPos(screenCoords, 0xFCCA); + if (info.SpriteType != ViewportInteractionItem::None) { - gMapSelectArrowDirection = 5; - if ((_currentTrackBegin.y & 0x1F) == 0) - gMapSelectArrowDirection = 7; + _trackPlaceCtrlZ = info.Element->GetBaseZ(); + _trackPlaceCtrlState = true; } } - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - MapInvalidateTileFull(trackPos); - break; } - default: - break; - } -} + else + { + if (!(gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_COPY_Z)) + { + _trackPlaceCtrlState = false; + } + } -/** - * - * rct2: 0x006CC6A8 - */ -void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords) -{ - int32_t z; - const PreviewTrack* trackBlock; + if (!_trackPlaceShiftState) + { + if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) + { + _trackPlaceShiftState = true; + _trackPlaceShiftStart = screenCoords; + _trackPlaceShiftZ = 0; + } + } + else + { + if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) + { + uint16_t maxHeight = ZoomLevel::max().ApplyTo( + std::numeric_limits::max() - 32); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - auto mapCoords = RideGetPlacePositionFromScreenPosition(screenCoords); - if (!mapCoords) - { - RideConstructionInvalidateCurrentTrack(); - MapInvalidateMapSelectionTiles(); - return; + _trackPlaceShiftZ = _trackPlaceShiftStart.y - screenCoords.y + 4; + // Scale delta by zoom to match mouse position. + auto* mainWnd = WindowGetMain(); + if (mainWnd != nullptr && mainWnd->viewport != nullptr) + { + _trackPlaceShiftZ = mainWnd->viewport->zoom.ApplyTo(_trackPlaceShiftZ); + } + _trackPlaceShiftZ = Floor2(_trackPlaceShiftZ, 8); + + // Clamp to maximum possible value of BaseHeight can offer. + _trackPlaceShiftZ = std::min(_trackPlaceShiftZ, maxHeight); + + screenCoords = _trackPlaceShiftStart; + } + else + { + _trackPlaceShiftState = false; + } + } + + if (!_trackPlaceCtrlState) + { + mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); + if (mapCoords.IsNull()) + return std::nullopt; + + _trackPlaceZ = 0; + if (_trackPlaceShiftState) + { + auto surfaceElement = MapGetSurfaceElementAt(mapCoords); + if (surfaceElement == nullptr) + return std::nullopt; + auto mapZ = Floor2(surfaceElement->GetBaseZ(), 16); + mapZ += _trackPlaceShiftZ; + mapZ = std::max(mapZ, 16); + _trackPlaceZ = mapZ; + } + } + else + { + auto mapZ = _trackPlaceCtrlZ; + auto mapXYCoords = ScreenGetMapXYWithZ(screenCoords, mapZ); + if (mapXYCoords.has_value()) + { + mapCoords = mapXYCoords.value(); + } + else + { + return std::nullopt; + } + + if (_trackPlaceShiftState != 0) + { + mapZ += _trackPlaceShiftZ; + } + _trackPlaceZ = std::max(mapZ, 16); + } + + if (mapCoords.x == LOCATION_NULL) + return std::nullopt; + + return mapCoords.ToTileStart(); } - z = _trackPlaceZ; - if (z == 0) - z = MapGetHighestZ(*mapCoords); - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - gMapSelectFlags &= ~MAP_SELECT_FLAG_GREEN; - gMapSelectArrowPosition = CoordsXYZ{ *mapCoords, z }; - gMapSelectArrowDirection = _currentTrackPieceDirection; - gMapSelectionTiles.clear(); - gMapSelectionTiles.push_back(*mapCoords); - - RideId rideIndex; - int32_t trackType, trackDirection, liftHillAndAlternativeState; - if (WindowRideConstructionUpdateState( - &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) + /** + * + * rct2: 0x006C84CE + */ + void WindowRideConstructionUpdateActiveElementsImpl() { - RideConstructionInvalidateCurrentTrack(); - MapInvalidateMapSelectionTiles(); - return; - } - _currentTrackPieceType = trackType; - auto ride = GetRide(_currentRideIndex); - if (!ride) - { - return; - } + WindowRideConstructionUpdateEnabledTrackPieces(); + if (auto currentRide = GetRide(_currentRideIndex); + !currentRide || currentRide->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + return; + } - const auto& rtd = ride->GetRideTypeDescriptor(); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { auto window = static_cast(WindowFindByClass(WindowClass::RideConstruction)); if (!window) { return; } - // Re-using this other code, very slight difference from original - // - Original code checks for MSB mask instead of 255 on trackPart->var_00 - // - Original code checks this first as its already set origin tile, probably just a micro optimisation - window->SelectMapTiles(trackType, trackDirection, *mapCoords); - } - gMapSelectArrowPosition.z = z; - if (_trackPlaceZ == 0) - { - // Raise z above all slopes and water - if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) + window->UpdateMapSelection(); + + _selectedTrackType = TrackElemType::None; + if (_rideConstructionState == RideConstructionState::Selected) { - int32_t highestZ = 0; - for (const auto& selectedTile : gMapSelectionTiles) + TileElement* tileElement; + if (GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(_currentTrackPieceDirection & 3) }, _currentTrackPieceType, 0, + &tileElement, 0) + != std::nullopt) { - if (MapIsLocationValid(selectedTile)) - { - z = MapGetHighestZ(selectedTile); - if (z > highestZ) - highestZ = z; - } + _selectedTrackType = tileElement->AsTrack()->GetTrackType(); + if (TrackTypeHasSpeedSetting(tileElement->AsTrack()->GetTrackType())) + _currentBrakeSpeed2 = tileElement->AsTrack()->GetBrakeBoosterSpeed(); + _currentSeatRotationAngle = tileElement->AsTrack()->GetSeatRotation(); } } - // Loc6CC8BF: - // z = MapGetHighestZ(x >> 5, y >> 5); - } - // Loc6CC91B: - const auto& ted = GetTrackElementDescriptor(trackType); - trackBlock = ted.Block; - int32_t bx = 0; - do - { - bx = std::min(bx, trackBlock->z); - trackBlock++; - } while (trackBlock->index != 255); - z -= bx; - gMapSelectArrowPosition.z = z; - _currentTrackBegin.x = mapCoords->x; - _currentTrackBegin.y = mapCoords->y; - _currentTrackBegin.z = z; - if ((_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) && _currentTrackBegin == _previousTrackPiece) + window->UpdatePossibleRideConfigurations(); + window->UpdateWidgets(); + } + + /** + * + * rct2: 0x006C6A77 + */ + void WindowRideConstructionUpdateEnabledTrackPieces() { + auto ride = GetRide(_currentRideIndex); + if (ride == nullptr) + return; + + auto rideEntry = ride->GetRideEntry(); + if (rideEntry == nullptr) + return; + + int32_t rideType = RideGetAlternativeType(*ride); + UpdateEnabledRidePieces(rideType); + } + + /** + * + * rct2: 0x006C94D8 + */ + void UpdateGhostTrackAndArrow() + { + RideId rideIndex; + int32_t direction, type, liftHillAndAlternativeState; + CoordsXYZ trackPos{}; + + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK_PLACE_ACTION_QUEUED) + { + return; + } + + // Recheck if area is fine for new track. + // Set by footpath placement + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_RECHECK) + { + RideConstructionInvalidateCurrentTrack(); + _currentTrackSelectionFlags &= ~TRACK_SELECTION_FLAG_RECHECK; + } + + switch (_rideConstructionState) + { + case RideConstructionState::Front: + case RideConstructionState::Back: + { + // place ghost piece + if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK)) + { + if (WindowRideConstructionUpdateState( + &type, &direction, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr)) + { + RideConstructionRemoveGhosts(); + } + else + { + _currentTrackPrice = PlaceProvisionalTrackPiece( + rideIndex, type, direction, liftHillAndAlternativeState, trackPos); + WindowRideConstructionUpdateActiveElements(); + } + } + // update flashing arrow + auto curTime = Platform::GetTicks(); + if (_rideConstructionNextArrowPulse >= curTime) + break; + _rideConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; + + _currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW; + trackPos = _currentTrackBegin; + direction = _currentTrackPieceDirection; + type = _currentTrackPieceType; + // diagonal pieces trigger this + if (direction >= 4) + direction += 4; + if (_rideConstructionState == RideConstructionState::Back) + direction = DirectionReverse(direction); + gMapSelectArrowPosition = trackPos; + gMapSelectArrowDirection = direction; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + MapInvalidateTileFull(trackPos); + break; + } + case RideConstructionState::Selected: + { + auto curTime = Platform::GetTicks(); + if (_rideConstructionNextArrowPulse >= curTime) + break; + _rideConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; + + _currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW; + direction = _currentTrackPieceDirection & 3; + type = _currentTrackPieceType; + uint16_t flags = _currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW ? TRACK_ELEMENT_SET_HIGHLIGHT_TRUE + : TRACK_ELEMENT_SET_HIGHLIGHT_FALSE; + auto newCoords = GetTrackElementOriginAndApplyChanges( + { _currentTrackBegin, static_cast(direction) }, type, 0, nullptr, flags); + if (!newCoords.has_value()) + { + RideConstructionRemoveGhosts(); + _rideConstructionState = RideConstructionState::State0; + } + break; + } + case RideConstructionState::MazeBuild: + case RideConstructionState::MazeMove: + case RideConstructionState::MazeFill: + { + auto curTime = Platform::GetTicks(); + if (_rideConstructionNextArrowPulse >= curTime) + break; + _rideConstructionNextArrowPulse = curTime + ARROW_PULSE_DURATION; + + _currentTrackSelectionFlags ^= TRACK_SELECTION_FLAG_ARROW; + trackPos = CoordsXYZ{ _currentTrackBegin.x & 0xFFE0, _currentTrackBegin.y & 0xFFE0, _currentTrackBegin.z + 15 }; + gMapSelectArrowPosition = trackPos; + gMapSelectArrowDirection = 4; + if (((_currentTrackBegin.x & 0x1F) | (_currentTrackBegin.y & 0x1F)) != 0) + { + gMapSelectArrowDirection = 6; + if (((_currentTrackBegin.x & 0x1F) & (_currentTrackBegin.y & 0x1F)) == 0) + { + gMapSelectArrowDirection = 5; + if ((_currentTrackBegin.y & 0x1F) == 0) + gMapSelectArrowDirection = 7; + } + } + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + if (_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ARROW) + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + MapInvalidateTileFull(trackPos); + break; + } + default: + break; + } + } + + /** + * + * rct2: 0x006CC6A8 + */ + void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords) + { + int32_t z; + const PreviewTrack* trackBlock; + MapInvalidateMapSelectionTiles(); - return; - } + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + auto mapCoords = RideGetPlacePositionFromScreenPosition(screenCoords); + if (!mapCoords) + { + RideConstructionInvalidateCurrentTrack(); + MapInvalidateMapSelectionTiles(); + return; + } - _previousTrackPiece = _currentTrackBegin; - // search for appropriate z value for ghost, up to max ride height - int numAttempts = (z <= MAX_TRACK_HEIGHT ? ((MAX_TRACK_HEIGHT - z) / COORDS_Z_STEP + 1) : 2); + z = _trackPlaceZ; + if (z == 0) + z = MapGetHighestZ(*mapCoords); + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + gMapSelectFlags &= ~MAP_SELECT_FLAG_GREEN; + gMapSelectArrowPosition = CoordsXYZ{ *mapCoords, z }; + gMapSelectArrowDirection = _currentTrackPieceDirection; + gMapSelectionTiles.clear(); + gMapSelectionTiles.push_back(*mapCoords); + + RideId rideIndex; + int32_t trackType, trackDirection, liftHillAndAlternativeState; + if (WindowRideConstructionUpdateState( + &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, nullptr, nullptr)) + { + RideConstructionInvalidateCurrentTrack(); + MapInvalidateMapSelectionTiles(); + return; + } + _currentTrackPieceType = trackType; + auto ride = GetRide(_currentRideIndex); + if (!ride) + { + return; + } + + const auto& rtd = ride->GetRideTypeDescriptor(); + if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + auto window = static_cast(WindowFindByClass(WindowClass::RideConstruction)); + if (!window) + { + return; + } + // Re-using this other code, very slight difference from original + // - Original code checks for MSB mask instead of 255 on trackPart->var_00 + // - Original code checks this first as its already set origin tile, probably just a micro optimisation + window->SelectMapTiles(trackType, trackDirection, *mapCoords); + } + + gMapSelectArrowPosition.z = z; + if (_trackPlaceZ == 0) + { + // Raise z above all slopes and water + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) + { + int32_t highestZ = 0; + for (const auto& selectedTile : gMapSelectionTiles) + { + if (MapIsLocationValid(selectedTile)) + { + z = MapGetHighestZ(selectedTile); + if (z > highestZ) + highestZ = z; + } + } + } + // Loc6CC8BF: + // z = MapGetHighestZ(x >> 5, y >> 5); + } + // Loc6CC91B: + const auto& ted = GetTrackElementDescriptor(trackType); + trackBlock = ted.Block; + int32_t bx = 0; + do + { + bx = std::min(bx, trackBlock->z); + trackBlock++; + } while (trackBlock->index != 255); + z -= bx; + + gMapSelectArrowPosition.z = z; + _currentTrackBegin.x = mapCoords->x; + _currentTrackBegin.y = mapCoords->y; + _currentTrackBegin.z = z; + if ((_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_TRACK) && _currentTrackBegin == _previousTrackPiece) + { + MapInvalidateMapSelectionTiles(); + return; + } + + _previousTrackPiece = _currentTrackBegin; + // search for appropriate z value for ghost, up to max ride height + int numAttempts = (z <= MAX_TRACK_HEIGHT ? ((MAX_TRACK_HEIGHT - z) / COORDS_Z_STEP + 1) : 2); + + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + for (int zAttempts = 0; zAttempts < numAttempts; ++zAttempts) + { + CoordsXYZ trackPos{}; + WindowRideConstructionUpdateState( + &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); + _currentTrackPrice = PlaceProvisionalTrackPiece( + rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); + if (_currentTrackPrice != kMoney64Undefined) + break; + + _currentTrackBegin.z -= 8; + if (_currentTrackBegin.z < 0) + break; + + _currentTrackBegin.z += 16; + } + + auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); + ContextBroadcastIntent(&intent); + MapInvalidateMapSelectionTiles(); + return; + } - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { for (int zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { CoordsXYZ trackPos{}; @@ -3275,6 +3333,8 @@ void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords) &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); _currentTrackPrice = PlaceProvisionalTrackPiece( rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); + mapCoords = trackPos; + z = trackPos.z; if (_currentTrackPrice != kMoney64Undefined) break; @@ -3285,1287 +3345,1274 @@ void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords) _currentTrackBegin.z += 16; } - auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - ContextBroadcastIntent(&intent); - MapInvalidateMapSelectionTiles(); - return; - } - - for (int zAttempts = 0; zAttempts < numAttempts; ++zAttempts) - { - CoordsXYZ trackPos{}; - WindowRideConstructionUpdateState( - &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); - _currentTrackPrice = PlaceProvisionalTrackPiece( - rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); - mapCoords = trackPos; - z = trackPos.z; - if (_currentTrackPrice != kMoney64Undefined) - break; - - _currentTrackBegin.z -= 8; - if (_currentTrackBegin.z < 0) - break; - - _currentTrackBegin.z += 16; - } - - if (_autoRotatingShop && _rideConstructionState == RideConstructionState::Place - && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) - { - PathElement* pathsByDir[NumOrthogonalDirections]; - - bool keepOrientation = false; - for (int8_t i = 0; i < NumOrthogonalDirections; i++) + if (_autoRotatingShop && _rideConstructionState == RideConstructionState::Place + && ride->GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_IS_SHOP_OR_FACILITY)) { - const auto testLoc = CoordsXYZ{ *mapCoords + CoordsDirectionDelta[i], z }; - if (!MapIsLocationOwned(testLoc)) + PathElement* pathsByDir[NumOrthogonalDirections]; + + bool keepOrientation = false; + for (int8_t i = 0; i < NumOrthogonalDirections; i++) { - pathsByDir[i] = nullptr; - continue; - } + const auto testLoc = CoordsXYZ{ *mapCoords + CoordsDirectionDelta[i], z }; + if (!MapIsLocationOwned(testLoc)) + { + pathsByDir[i] = nullptr; + continue; + } - pathsByDir[i] = MapGetFootpathElement(testLoc); + pathsByDir[i] = MapGetFootpathElement(testLoc); - if (pathsByDir[i] != nullptr && pathsByDir[i]->IsSloped() && pathsByDir[i]->GetSlopeDirection() != i) - { - pathsByDir[i] = nullptr; - } - - // Sloped path on the level below - if (pathsByDir[i] == nullptr) - { - pathsByDir[i] = MapGetFootpathElement({ *mapCoords + CoordsDirectionDelta[i], z - PATH_HEIGHT_STEP }); - - if (pathsByDir[i] != nullptr - && (!pathsByDir[i]->IsSloped() || pathsByDir[i]->GetSlopeDirection() != DirectionReverse(i))) + if (pathsByDir[i] != nullptr && pathsByDir[i]->IsSloped() && pathsByDir[i]->GetSlopeDirection() != i) { pathsByDir[i] = nullptr; } - } - if (pathsByDir[i] != nullptr && pathsByDir[i]->IsQueue()) - { - pathsByDir[i] = nullptr; - } - - if (pathsByDir[i] != nullptr && i == _currentTrackPieceDirection) - { - keepOrientation = true; - break; - } - } - - if (!keepOrientation) - { - for (int8_t i = 0; i < NumOrthogonalDirections; i++) - { - if (pathsByDir[i] != nullptr) + // Sloped path on the level below + if (pathsByDir[i] == nullptr) { - _currentTrackPieceDirection = i; + pathsByDir[i] = MapGetFootpathElement({ *mapCoords + CoordsDirectionDelta[i], z - PATH_HEIGHT_STEP }); - CoordsXYZ trackPos{}; - WindowRideConstructionUpdateState( - &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); - PlaceProvisionalTrackPiece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); - gMapSelectArrowDirection = _currentTrackPieceDirection; + if (pathsByDir[i] != nullptr + && (!pathsByDir[i]->IsSloped() || pathsByDir[i]->GetSlopeDirection() != DirectionReverse(i))) + { + pathsByDir[i] = nullptr; + } + } + + if (pathsByDir[i] != nullptr && pathsByDir[i]->IsQueue()) + { + pathsByDir[i] = nullptr; + } + + if (pathsByDir[i] != nullptr && i == _currentTrackPieceDirection) + { + keepOrientation = true; break; } } + + if (!keepOrientation) + { + for (int8_t i = 0; i < NumOrthogonalDirections; i++) + { + if (pathsByDir[i] != nullptr) + { + _currentTrackPieceDirection = i; + + CoordsXYZ trackPos{}; + WindowRideConstructionUpdateState( + &trackType, &trackDirection, &rideIndex, &liftHillAndAlternativeState, &trackPos, nullptr); + PlaceProvisionalTrackPiece(rideIndex, trackType, trackDirection, liftHillAndAlternativeState, trackPos); + gMapSelectArrowDirection = _currentTrackPieceDirection; + break; + } + } + } } - } - WindowRideConstructionUpdateActiveElements(); - MapInvalidateMapSelectionTiles(); -} - -/** - * - * rct2: 0x006CD354 - */ -void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords) -{ - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords); - if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) - { - RideConstructionInvalidateCurrentTrack(); - return; - } - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = entranceOrExitCoords; - gMapSelectPositionB = entranceOrExitCoords; - gMapSelectArrowPosition = entranceOrExitCoords; - gMapSelectArrowDirection = DirectionReverse(entranceOrExitCoords.direction); - MapInvalidateSelectionRect(); - - entranceOrExitCoords.direction = DirectionReverse(gRideEntranceExitPlaceDirection); - StationIndex stationNum = gRideEntranceExitPlaceStationIndex; - if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) - || entranceOrExitCoords != gRideEntranceExitGhostPosition || stationNum != gRideEntranceExitGhostStationIndex) - { - auto ride = GetRide(_currentRideIndex); - if (ride != nullptr) - { - _currentTrackPrice = RideEntranceExitPlaceGhost( - *ride, entranceOrExitCoords, entranceOrExitCoords.direction, gRideEntranceExitPlaceType, stationNum); - } WindowRideConstructionUpdateActiveElements(); + MapInvalidateMapSelectionTiles(); } -} -/** - * - * rct2: 0x006CCA73 - */ -void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords) -{ - const CursorState* state = ContextGetCursorState(); - - WindowBase* w; - - MapInvalidateMapSelectionTiles(); - RideConstructionInvalidateCurrentTrack(); - - CoordsXYZ mapCoords{}; - int32_t trackType, z, highestZ; - - if (WindowRideConstructionUpdateState(&trackType, nullptr, nullptr, nullptr, nullptr, nullptr)) - return; - - z = mapCoords.z; - _currentTrackPieceType = trackType; - - // Raise z above all slopes and water - highestZ = 0; - if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) + /** + * + * rct2: 0x006CD354 + */ + void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords) { - for (const auto& selectedTile : gMapSelectionTiles) + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + CoordsXYZD entranceOrExitCoords = RideGetEntranceOrExitPositionFromScreenPosition(screenCoords); + if (gRideEntranceExitPlaceDirection == INVALID_DIRECTION) { - if (!MapIsLocationValid(selectedTile)) - continue; + RideConstructionInvalidateCurrentTrack(); + return; + } + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_ARROW; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = entranceOrExitCoords; + gMapSelectPositionB = entranceOrExitCoords; + gMapSelectArrowPosition = entranceOrExitCoords; + gMapSelectArrowDirection = DirectionReverse(entranceOrExitCoords.direction); + MapInvalidateSelectionRect(); - z = MapGetHighestZ(selectedTile); - if (z > highestZ) - highestZ = z; + entranceOrExitCoords.direction = DirectionReverse(gRideEntranceExitPlaceDirection); + StationIndex stationNum = gRideEntranceExitPlaceStationIndex; + if (!(_currentTrackSelectionFlags & TRACK_SELECTION_FLAG_ENTRANCE_OR_EXIT) + || entranceOrExitCoords != gRideEntranceExitGhostPosition || stationNum != gRideEntranceExitGhostStationIndex) + { + auto ride = GetRide(_currentRideIndex); + if (ride != nullptr) + { + _currentTrackPrice = RideEntranceExitPlaceGhost( + *ride, entranceOrExitCoords, entranceOrExitCoords.direction, gRideEntranceExitPlaceType, stationNum); + } + WindowRideConstructionUpdateActiveElements(); } } - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - auto ridePlacePosition = RideGetPlacePositionFromScreenPosition(screenCoords); - if (!ridePlacePosition) - return; - - mapCoords = { *ridePlacePosition, z }; - - z = _trackPlaceZ; - if (z == 0) - z = MapGetHighestZ(mapCoords); - - ToolCancel(); - - auto ride = GetRide(_currentRideIndex); - if (ride == nullptr) - return; - - if (_trackPlaceZ == 0) + /** + * + * rct2: 0x006CCA73 + */ + void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords) { - const auto& ted = GetTrackElementDescriptor(_currentTrackPieceType); - const PreviewTrack* trackBlock = ted.Block; - int32_t bx = 0; - do - { - bx = std::min(bx, trackBlock->z); - trackBlock++; - } while (trackBlock->index != 255); - z -= bx; + const CursorState* state = ContextGetCursorState(); - // FIX not sure exactly why it starts trial and error place from a lower Z, but it causes issues with disable clearance - if (!GetGameState().Cheats.DisableClearanceChecks && z > kMinimumLandZ) + WindowBase* w; + + MapInvalidateMapSelectionTiles(); + RideConstructionInvalidateCurrentTrack(); + + CoordsXYZ mapCoords{}; + int32_t trackType, z, highestZ; + + if (WindowRideConstructionUpdateState(&trackType, nullptr, nullptr, nullptr, nullptr, nullptr)) + return; + + z = mapCoords.z; + _currentTrackPieceType = trackType; + + // Raise z above all slopes and water + highestZ = 0; + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE_CONSTRUCT) { - z -= LAND_HEIGHT_STEP; + for (const auto& selectedTile : gMapSelectionTiles) + { + if (!MapIsLocationValid(selectedTile)) + continue; + + z = MapGetHighestZ(selectedTile); + if (z > highestZ) + highestZ = z; + } } - } - else - { + + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + auto ridePlacePosition = RideGetPlacePositionFromScreenPosition(screenCoords); + if (!ridePlacePosition) + return; + + mapCoords = { *ridePlacePosition, z }; + z = _trackPlaceZ; - } + if (z == 0) + z = MapGetHighestZ(mapCoords); - // search for z value to build at, up to max ride height - int numAttempts = (z <= MAX_TRACK_HEIGHT ? ((MAX_TRACK_HEIGHT - z) / COORDS_Z_STEP + 1) : 2); + ToolCancel(); + + auto ride = GetRide(_currentRideIndex); + if (ride == nullptr) + return; + + if (_trackPlaceZ == 0) + { + const auto& ted = GetTrackElementDescriptor(_currentTrackPieceType); + const PreviewTrack* trackBlock = ted.Block; + int32_t bx = 0; + do + { + bx = std::min(bx, trackBlock->z); + trackBlock++; + } while (trackBlock->index != 255); + z -= bx; + + // FIX not sure exactly why it starts trial and error place from a lower Z, but it causes issues with disable + // clearance + if (!GetGameState().Cheats.DisableClearanceChecks && z > kMinimumLandZ) + { + z -= LAND_HEIGHT_STEP; + } + } + else + { + z = _trackPlaceZ; + } + + // search for z value to build at, up to max ride height + int numAttempts = (z <= MAX_TRACK_HEIGHT ? ((MAX_TRACK_HEIGHT - z) / COORDS_Z_STEP + 1) : 2); + + const auto& rtd = ride->GetRideTypeDescriptor(); + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) + { + _rideConstructionState = RideConstructionState::MazeBuild; + _currentTrackBegin.x = mapCoords.x; + _currentTrackBegin.y = mapCoords.y; + _currentTrackBegin.z = z; + _currentTrackSelectionFlags = 0; + auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); + ContextBroadcastIntent(&intent); + w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr) + break; + + gDisableErrorWindowSound = true; + + auto gameAction = MazeSetTrackAction( + CoordsXYZD{ _currentTrackBegin, 0 }, true, _currentRideIndex, GC_SET_MAZE_TRACK_BUILD); + auto mazeSetTrackResult = GameActions::Execute(&gameAction); + if (mazeSetTrackResult.Error == GameActions::Status::Ok) + { + _trackPlaceCost = mazeSetTrackResult.Cost; + _trackPlaceErrorMessage = STR_NONE; + } + else + { + _trackPlaceCost = kMoney64Undefined; + _trackPlaceErrorMessage = std::get(mazeSetTrackResult.ErrorMessage); + } + + gDisableErrorWindowSound = false; + + if (mazeSetTrackResult.Error != GameActions::Status::Ok) + { + _rideConstructionState = RideConstructionState::Place; + StringId errorText = std::get(mazeSetTrackResult.ErrorMessage); + z -= 8; + if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER + || errorText == STR_CAN_ONLY_BUILD_THIS_ON_WATER || errorText == STR_RIDE_CANT_BUILD_THIS_UNDERWATER + || errorText == STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND || errorText == STR_TOO_HIGH_FOR_SUPPORTS + || zAttempts == (numAttempts - 1) || z < 0) + { + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, state->position.x); + w = WindowFindByClass(WindowClass::RideConstruction); + if (w != nullptr) + { + ToolSet(*w, WIDX_CONSTRUCT, Tool::Crosshair); + InputSetFlag(INPUT_FLAG_6, true); + _trackPlaceCtrlState = false; + _trackPlaceShiftState = false; + } + auto intent2 = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); + ContextBroadcastIntent(&intent2); + break; + } + z += 16; + } + else + { + WindowCloseByClass(WindowClass::Error); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, _currentTrackBegin); + break; + } + } + return; + } - const auto& rtd = ride->GetRideTypeDescriptor(); - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) { - _rideConstructionState = RideConstructionState::MazeBuild; + _rideConstructionState = RideConstructionState::Front; _currentTrackBegin.x = mapCoords.x; _currentTrackBegin.y = mapCoords.y; _currentTrackBegin.z = z; _currentTrackSelectionFlags = 0; - auto intent = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - ContextBroadcastIntent(&intent); + WindowRideConstructionUpdateActiveElements(); w = WindowFindByClass(WindowClass::RideConstruction); if (w == nullptr) break; gDisableErrorWindowSound = true; - - auto gameAction = MazeSetTrackAction( - CoordsXYZD{ _currentTrackBegin, 0 }, true, _currentRideIndex, GC_SET_MAZE_TRACK_BUILD); - auto mazeSetTrackResult = GameActions::Execute(&gameAction); - if (mazeSetTrackResult.Error == GameActions::Status::Ok) - { - _trackPlaceCost = mazeSetTrackResult.Cost; - _trackPlaceErrorMessage = STR_NONE; - } - else - { - _trackPlaceCost = kMoney64Undefined; - _trackPlaceErrorMessage = std::get(mazeSetTrackResult.ErrorMessage); - } - + w->OnMouseUp(WIDX_CONSTRUCT); gDisableErrorWindowSound = false; - if (mazeSetTrackResult.Error != GameActions::Status::Ok) + if (_trackPlaceCost == kMoney64Undefined) { - _rideConstructionState = RideConstructionState::Place; - StringId errorText = std::get(mazeSetTrackResult.ErrorMessage); + StringId errorText = _trackPlaceErrorMessage; z -= 8; if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER - || errorText == STR_CAN_ONLY_BUILD_THIS_ON_WATER || errorText == STR_RIDE_CANT_BUILD_THIS_UNDERWATER - || errorText == STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND || errorText == STR_TOO_HIGH_FOR_SUPPORTS + || errorText == STR_CAN_ONLY_BUILD_THIS_ON_WATER || errorText == STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND + || errorText == STR_TOO_HIGH_FOR_SUPPORTS || errorText == STR_TOO_HIGH + || errorText == STR_LOCAL_AUTHORITY_WONT_ALLOW_CONSTRUCTION_ABOVE_TREE_HEIGHT || zAttempts == (numAttempts - 1) || z < 0) { + int32_t saveTrackDirection = _currentTrackPieceDirection; + auto saveCurrentTrackCurve = _currentTrackCurve; + auto savePreviousTrackPitchEnd = _previousTrackPitchEnd; + auto saveCurrentTrackPitchEnd = _currentTrackPitchEnd; + auto savePreviousTrackRollEnd = _previousTrackRollEnd; + auto saveCurrentTrackRollEnd = _currentTrackRollEnd; + int32_t saveCurrentTrackAlternative = _currentTrackAlternative; + int32_t saveCurrentTrackLiftHill = _currentTrackLiftHill; + + RideInitialiseConstructionWindow(*ride); + + _currentTrackPieceDirection = saveTrackDirection; + _currentTrackCurve = saveCurrentTrackCurve; + _previousTrackPitchEnd = savePreviousTrackPitchEnd; + _currentTrackPitchEnd = saveCurrentTrackPitchEnd; + _previousTrackRollEnd = savePreviousTrackRollEnd; + _currentTrackRollEnd = saveCurrentTrackRollEnd; + _currentTrackAlternative = saveCurrentTrackAlternative; + _currentTrackLiftHill = saveCurrentTrackLiftHill; + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, state->position.x); - w = WindowFindByClass(WindowClass::RideConstruction); - if (w != nullptr) - { - ToolSet(*w, WIDX_CONSTRUCT, Tool::Crosshair); - InputSetFlag(INPUT_FLAG_6, true); - _trackPlaceCtrlState = false; - _trackPlaceShiftState = false; - } - auto intent2 = Intent(INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION); - ContextBroadcastIntent(&intent2); break; } + z += 16; } else { - WindowCloseByClass(WindowClass::Error); - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, _currentTrackBegin); break; } } - return; } - for (int32_t zAttempts = 0; zAttempts < numAttempts; ++zAttempts) + void WindowRideConstructionKeyboardShortcutTurnLeft() { - _rideConstructionState = RideConstructionState::Front; - _currentTrackBegin.x = mapCoords.x; - _currentTrackBegin.y = mapCoords.y; - _currentTrackBegin.z = z; - _currentTrackSelectionFlags = 0; - WindowRideConstructionUpdateActiveElements(); - w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr) - break; - - gDisableErrorWindowSound = true; - w->OnMouseUp(WIDX_CONSTRUCT); - gDisableErrorWindowSound = false; - - if (_trackPlaceCost == kMoney64Undefined) + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { - StringId errorText = _trackPlaceErrorMessage; - z -= 8; - if (errorText == STR_NOT_ENOUGH_CASH_REQUIRES || errorText == STR_CAN_ONLY_BUILD_THIS_UNDERWATER - || errorText == STR_CAN_ONLY_BUILD_THIS_ON_WATER || errorText == STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND - || errorText == STR_TOO_HIGH_FOR_SUPPORTS || errorText == STR_TOO_HIGH - || errorText == STR_LOCAL_AUTHORITY_WONT_ALLOW_CONSTRUCTION_ABOVE_TREE_HEIGHT || zAttempts == (numAttempts - 1) - || z < 0) - { - int32_t saveTrackDirection = _currentTrackPieceDirection; - auto saveCurrentTrackCurve = _currentTrackCurve; - auto savePreviousTrackPitchEnd = _previousTrackPitchEnd; - auto saveCurrentTrackPitchEnd = _currentTrackPitchEnd; - auto savePreviousTrackRollEnd = _previousTrackRollEnd; - auto saveCurrentTrackRollEnd = _currentTrackRollEnd; - int32_t saveCurrentTrackAlternative = _currentTrackAlternative; - int32_t saveCurrentTrackLiftHill = _currentTrackLiftHill; + return; + } - RideInitialiseConstructionWindow(*ride); - - _currentTrackPieceDirection = saveTrackDirection; - _currentTrackCurve = saveCurrentTrackCurve; - _previousTrackPitchEnd = savePreviousTrackPitchEnd; - _currentTrackPitchEnd = saveCurrentTrackPitchEnd; - _previousTrackRollEnd = savePreviousTrackRollEnd; - _currentTrackRollEnd = saveCurrentTrackRollEnd; - _currentTrackAlternative = saveCurrentTrackAlternative; - _currentTrackLiftHill = saveCurrentTrackLiftHill; - - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Error, 0, state->position.x); + switch (_currentTrackCurve) + { + case EnumValue(TrackCurve::LeftSmall): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } break; - } - - z += 16; + case EnumValue(TrackCurve::Left): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::LeftLarge): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::None): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::RightLarge): + if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::Right): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::RightSmall): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::RightVerySmall): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) + && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + default: + return; } - else + } + + void WindowRideConstructionKeyboardShortcutTurnRight() + { + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) { - break; + return; + } + + switch (_currentTrackCurve) + { + case EnumValue(TrackCurve::RightSmall): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + break; + case EnumValue(TrackCurve::Right): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::RightLarge): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::None): + if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::LeftLarge): + if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::Left): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::LeftSmall): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + case EnumValue(TrackCurve::LeftVerySmall): + if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) + && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); + } + else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) + && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); + } + else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) + && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); + } + else if ( + !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) + && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); + } + else + { + return; + } + break; + default: + return; } } -} -void WindowRideConstructionKeyboardShortcutTurnLeft() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) + void WindowRideConstructionKeyboardShortcutUseTrackDefault() { - return; - } - - switch (_currentTrackCurve) - { - case EnumValue(TrackCurve::LeftSmall): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - break; - case EnumValue(TrackCurve::Left): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::LeftLarge): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::None): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::RightLarge): - if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::Right): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::RightSmall): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::RightVerySmall): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_VERY_SMALL) - && w->widgets[WIDX_LEFT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - default: + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) + { return; - } -} + } -void WindowRideConstructionKeyboardShortcutTurnRight() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) - { - return; + if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_STRAIGHT); + } + + if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEVEL); + } + + if (!WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) && w->widgets[WIDX_CHAIN_LIFT].type != WindowWidgetType::Empty + && _currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) + { + w->OnMouseDown(WIDX_CHAIN_LIFT); + } + + if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_STRAIGHT); + } } - switch (_currentTrackCurve) + void WindowRideConstructionKeyboardShortcutSlopeDown() { - case EnumValue(TrackCurve::RightSmall): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - break; - case EnumValue(TrackCurve::Right): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::RightLarge): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::None): - if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::LeftLarge): - if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::Left): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::LeftSmall): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - case EnumValue(TrackCurve::LeftVerySmall): - if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE_SMALL) - && w->widgets[WIDX_LEFT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_SMALL); - } - else if (!WidgetIsDisabled(*w, WIDX_LEFT_CURVE) && w->widgets[WIDX_LEFT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_LEFT_CURVE_LARGE) - && w->widgets[WIDX_LEFT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEFT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_STRAIGHT); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_LARGE) - && w->widgets[WIDX_RIGHT_CURVE_LARGE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_LARGE); - } - else if (!WidgetIsDisabled(*w, WIDX_RIGHT_CURVE) && w->widgets[WIDX_RIGHT_CURVE].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_SMALL); - } - else if ( - !WidgetIsDisabled(*w, WIDX_RIGHT_CURVE_VERY_SMALL) - && w->widgets[WIDX_RIGHT_CURVE_VERY_SMALL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_RIGHT_CURVE_VERY_SMALL); - } - else - { - return; - } - break; - default: + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) + { return; - } -} + } -void WindowRideConstructionKeyboardShortcutUseTrackDefault() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) - { - return; + switch (_currentTrackPitchEnd) + { + case TrackPitch::Down60: + if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) + && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP + && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); + } + break; + case TrackPitch::Down25: + if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); + } + break; + case TrackPitch::None: + if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN); + } + else if ( + IsTrackEnabled(TRACK_SLOPE_VERTICAL) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE) + { + return; + } + else if ( + !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); + } + else + { + return; + } + break; + case TrackPitch::Up25: + if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEVEL); + } + else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN); + } + else if ( + !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); + } + else + { + return; + } + break; + case TrackPitch::Up60: + if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP); + } + else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEVEL); + } + else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN); + } + else if ( + IsTrackEnabled(TRACK_SLOPE_VERTICAL) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE) + { + return; + } + else if ( + !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); + } + else + { + return; + } + break; + case TrackPitch::Up90: + if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); + } + break; + default: + return; + } } - if (!WidgetIsDisabled(*w, WIDX_STRAIGHT) && w->widgets[WIDX_STRAIGHT].type != WindowWidgetType::Empty) + void WindowRideConstructionKeyboardShortcutSlopeUp() { - w->OnMouseDown(WIDX_STRAIGHT); + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) + { + return; + } + + switch (_currentTrackPitchEnd) + { + case TrackPitch::Up60: + if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) + && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); + } + break; + case TrackPitch::Up25: + if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) + && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); + } + break; + case TrackPitch::None: + if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP); + } + else if ( + IsTrackEnabled(TRACK_SLOPE_VERTICAL) + && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP) + { + return; + } + else if ( + !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) + && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); + } + else + { + return; + } + break; + case TrackPitch::Down25: + if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEVEL); + } + else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP); + } + else if ( + !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) + && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); + } + else + { + return; + } + break; + case TrackPitch::Down60: + if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN); + } + else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_LEVEL); + } + else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP); + } + else if ( + IsTrackEnabled(TRACK_SLOPE_VERTICAL) + && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP) + { + return; + } + else if ( + !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) + && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_UP_STEEP); + } + else + { + return; + } + break; + case TrackPitch::Down90: + if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) + && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP + && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); + } + break; + default: + return; + } } - if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) + void WindowRideConstructionKeyboardShortcutChainLiftToggle() { - w->OnMouseDown(WIDX_LEVEL); - } + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) + || w->widgets[WIDX_CHAIN_LIFT].type == WindowWidgetType::Empty) + { + return; + } - if (!WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) && w->widgets[WIDX_CHAIN_LIFT].type != WindowWidgetType::Empty - && _currentTrackLiftHill & CONSTRUCTION_LIFT_HILL_SELECTED) - { w->OnMouseDown(WIDX_CHAIN_LIFT); } - if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) + void WindowRideConstructionKeyboardShortcutBankLeft() { - w->OnMouseDown(WIDX_BANK_STRAIGHT); - } -} - -void WindowRideConstructionKeyboardShortcutSlopeDown() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) - { - return; - } - - switch (_currentTrackPitchEnd) - { - case TrackPitch::Down60: - if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) - && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP - && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP_STEEP); - } - break; - case TrackPitch::Down25: - if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); - } - break; - case TrackPitch::None: - if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN); - } - else if ( - IsTrackEnabled(TRACK_SLOPE_VERTICAL) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE) - { - return; - } - else if ( - !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); - } - else - { - return; - } - break; - case TrackPitch::Up25: - if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEVEL); - } - else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN); - } - else if ( - !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); - } - else - { - return; - } - break; - case TrackPitch::Up60: - if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP); - } - else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEVEL); - } - else if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN); - } - else if ( - IsTrackEnabled(TRACK_SLOPE_VERTICAL) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE) - { - return; - } - else if ( - !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); - } - else - { - return; - } - break; - case TrackPitch::Up90: - if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP_STEEP); - } - break; - default: - return; - } -} - -void WindowRideConstructionKeyboardShortcutSlopeUp() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_STRAIGHT) || w->widgets[WIDX_STRAIGHT].type == WindowWidgetType::Empty) - { - return; - } - - switch (_currentTrackPitchEnd) - { - case TrackPitch::Up60: - if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) - && w->widgets[WIDX_SLOPE_DOWN_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_RISE - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); - } - break; - case TrackPitch::Up25: - if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP_STEEP); - } - break; - case TrackPitch::None: - if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP); - } - else if ( - IsTrackEnabled(TRACK_SLOPE_VERTICAL) - && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP) - { - return; - } - else if ( - !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP_STEEP); - } - else - { - return; - } - break; - case TrackPitch::Down25: - if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEVEL); - } - else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP); - } - else if ( - !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP_STEEP); - } - else - { - return; - } - break; - case TrackPitch::Down60: - if (!WidgetIsDisabled(*w, WIDX_SLOPE_DOWN) && w->widgets[WIDX_SLOPE_DOWN].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN); - } - else if (!WidgetIsDisabled(*w, WIDX_LEVEL) && w->widgets[WIDX_LEVEL].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_LEVEL); - } - else if (!WidgetIsDisabled(*w, WIDX_SLOPE_UP) && w->widgets[WIDX_SLOPE_UP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP); - } - else if ( - IsTrackEnabled(TRACK_SLOPE_VERTICAL) - && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP) - { - return; - } - else if ( - !WidgetIsDisabled(*w, WIDX_SLOPE_UP_STEEP) && w->widgets[WIDX_SLOPE_UP_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_UP_STEEP); - } - else - { - return; - } - break; - case TrackPitch::Down90: - if (IsTrackEnabled(TRACK_SLOPE_VERTICAL) && !WidgetIsDisabled(*w, WIDX_SLOPE_DOWN_STEEP) - && w->widgets[WIDX_SLOPE_UP_STEEP].image.GetIndex() == SPR_RIDE_CONSTRUCTION_VERTICAL_DROP - && w->widgets[WIDX_SLOPE_DOWN_STEEP].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_SLOPE_DOWN_STEEP); - } - break; - default: - return; - } -} - -void WindowRideConstructionKeyboardShortcutChainLiftToggle() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_CHAIN_LIFT) || w->widgets[WIDX_CHAIN_LIFT].type == WindowWidgetType::Empty) - { - return; - } - - w->OnMouseDown(WIDX_CHAIN_LIFT); -} - -void WindowRideConstructionKeyboardShortcutBankLeft() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) - || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) - { - return; - } - - switch (_currentTrackRollEnd) - { - case TrackRoll::None: - if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_BANK_LEFT); - } - break; - case TrackRoll::Right: - if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_BANK_STRAIGHT); - } - else if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_BANK_LEFT); - } - else - { - return; - } - break; - default: - return; - } -} - -void WindowRideConstructionKeyboardShortcutBankRight() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) - || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) - { - return; - } - - switch (_currentTrackRollEnd) - { - case TrackRoll::None: - if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_BANK_RIGHT); - } - break; - case TrackRoll::Left: - if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_BANK_STRAIGHT); - } - else if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) - { - w->OnMouseDown(WIDX_BANK_RIGHT); - } - else - { - return; - } - break; - default: - return; - } -} - -void WindowRideConstructionKeyboardShortcutPreviousTrack() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_PREVIOUS_SECTION) - || w->widgets[WIDX_PREVIOUS_SECTION].type == WindowWidgetType::Empty) - { - return; - } - - w->OnMouseUp(WIDX_PREVIOUS_SECTION); -} - -void WindowRideConstructionKeyboardShortcutNextTrack() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_NEXT_SECTION) - || w->widgets[WIDX_NEXT_SECTION].type == WindowWidgetType::Empty) - { - return; - } - - w->OnMouseUp(WIDX_NEXT_SECTION); -} - -void WindowRideConstructionKeyboardShortcutBuildCurrent() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_CONSTRUCT) || w->widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) - { - return; - } - - w->OnMouseUp(WIDX_CONSTRUCT); -} - -void WindowRideConstructionKeyboardShortcutDemolishCurrent() -{ - WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); - if (w == nullptr || WidgetIsDisabled(*w, WIDX_DEMOLISH) || w->widgets[WIDX_DEMOLISH].type == WindowWidgetType::Empty) - { - return; - } - - w->OnMouseUp(WIDX_DEMOLISH); -} - -static void WindowRideConstructionMouseUpDemolishNextPiece(const CoordsXYZD& piecePos, int32_t type) -{ - if (_gotoStartPlacementMode) - { - _currentTrackBegin.z = Floor2(piecePos.z, COORDS_Z_STEP); - _rideConstructionState = RideConstructionState::Front; - _currentTrackSelectionFlags = 0; - _currentTrackPieceDirection = piecePos.direction & 3; - auto savedCurrentTrackCurve = _currentTrackCurve; - auto savedPreviousTrackPitchEnd = _previousTrackPitchEnd; - auto savedCurrentTrackPitchEnd = _currentTrackPitchEnd; - auto savedPreviousTrackRollEnd = _previousTrackRollEnd; - auto savedCurrentTrackRollEnd = _currentTrackRollEnd; - int32_t savedCurrentTrackAlternative = _currentTrackAlternative; - int32_t savedCurrentTrackLiftHill = _currentTrackLiftHill; - RideConstructionSetDefaultNextPiece(); - WindowRideConstructionUpdateActiveElements(); - auto ride = GetRide(_currentRideIndex); - if (!RideTryGetOriginElement(*ride, nullptr)) + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) + || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) { - RideInitialiseConstructionWindow(*ride); + return; + } + + switch (_currentTrackRollEnd) + { + case TrackRoll::None: + if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_LEFT); + } + break; + case TrackRoll::Right: + if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_STRAIGHT); + } + else if (!WidgetIsDisabled(*w, WIDX_BANK_LEFT) && w->widgets[WIDX_BANK_LEFT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_LEFT); + } + else + { + return; + } + break; + default: + return; + } + } + + void WindowRideConstructionKeyboardShortcutBankRight() + { + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) + || w->widgets[WIDX_BANK_STRAIGHT].type == WindowWidgetType::Empty) + { + return; + } + + switch (_currentTrackRollEnd) + { + case TrackRoll::None: + if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_RIGHT); + } + break; + case TrackRoll::Left: + if (!WidgetIsDisabled(*w, WIDX_BANK_STRAIGHT) && w->widgets[WIDX_BANK_STRAIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_STRAIGHT); + } + else if (!WidgetIsDisabled(*w, WIDX_BANK_RIGHT) && w->widgets[WIDX_BANK_RIGHT].type != WindowWidgetType::Empty) + { + w->OnMouseDown(WIDX_BANK_RIGHT); + } + else + { + return; + } + break; + default: + return; + } + } + + void WindowRideConstructionKeyboardShortcutPreviousTrack() + { + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_PREVIOUS_SECTION) + || w->widgets[WIDX_PREVIOUS_SECTION].type == WindowWidgetType::Empty) + { + return; + } + + w->OnMouseUp(WIDX_PREVIOUS_SECTION); + } + + void WindowRideConstructionKeyboardShortcutNextTrack() + { + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_NEXT_SECTION) + || w->widgets[WIDX_NEXT_SECTION].type == WindowWidgetType::Empty) + { + return; + } + + w->OnMouseUp(WIDX_NEXT_SECTION); + } + + void WindowRideConstructionKeyboardShortcutBuildCurrent() + { + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_CONSTRUCT) || w->widgets[WIDX_CONSTRUCT].type == WindowWidgetType::Empty) + { + return; + } + + w->OnMouseUp(WIDX_CONSTRUCT); + } + + void WindowRideConstructionKeyboardShortcutDemolishCurrent() + { + WindowBase* w = WindowFindByClass(WindowClass::RideConstruction); + if (w == nullptr || WidgetIsDisabled(*w, WIDX_DEMOLISH) || w->widgets[WIDX_DEMOLISH].type == WindowWidgetType::Empty) + { + return; + } + + w->OnMouseUp(WIDX_DEMOLISH); + } + + static void WindowRideConstructionMouseUpDemolishNextPiece(const CoordsXYZD& piecePos, int32_t type) + { + if (_gotoStartPlacementMode) + { + _currentTrackBegin.z = Floor2(piecePos.z, COORDS_Z_STEP); + _rideConstructionState = RideConstructionState::Front; + _currentTrackSelectionFlags = 0; _currentTrackPieceDirection = piecePos.direction & 3; - if (!(savedCurrentTrackCurve & RideConstructionSpecialPieceSelected)) + auto savedCurrentTrackCurve = _currentTrackCurve; + auto savedPreviousTrackPitchEnd = _previousTrackPitchEnd; + auto savedCurrentTrackPitchEnd = _currentTrackPitchEnd; + auto savedPreviousTrackRollEnd = _previousTrackRollEnd; + auto savedCurrentTrackRollEnd = _currentTrackRollEnd; + int32_t savedCurrentTrackAlternative = _currentTrackAlternative; + int32_t savedCurrentTrackLiftHill = _currentTrackLiftHill; + RideConstructionSetDefaultNextPiece(); + WindowRideConstructionUpdateActiveElements(); + auto ride = GetRide(_currentRideIndex); + if (!RideTryGetOriginElement(*ride, nullptr)) { - _currentTrackCurve = savedCurrentTrackCurve; - _previousTrackPitchEnd = savedPreviousTrackPitchEnd; - _currentTrackPitchEnd = savedCurrentTrackPitchEnd; - _previousTrackRollEnd = savedPreviousTrackRollEnd; - _currentTrackRollEnd = savedCurrentTrackRollEnd; - _currentTrackAlternative = savedCurrentTrackAlternative; - _currentTrackLiftHill = savedCurrentTrackLiftHill; - WindowRideConstructionUpdateActiveElements(); + RideInitialiseConstructionWindow(*ride); + _currentTrackPieceDirection = piecePos.direction & 3; + if (!(savedCurrentTrackCurve & RideConstructionSpecialPieceSelected)) + { + _currentTrackCurve = savedCurrentTrackCurve; + _previousTrackPitchEnd = savedPreviousTrackPitchEnd; + _currentTrackPitchEnd = savedCurrentTrackPitchEnd; + _previousTrackRollEnd = savedPreviousTrackRollEnd; + _currentTrackRollEnd = savedCurrentTrackRollEnd; + _currentTrackAlternative = savedCurrentTrackAlternative; + _currentTrackLiftHill = savedCurrentTrackLiftHill; + WindowRideConstructionUpdateActiveElements(); + } } } + else + { + if (_rideConstructionState2 == RideConstructionState::Selected + || _rideConstructionState2 == RideConstructionState::Front) + { + if (type == TrackElemType::MiddleStation || type == TrackElemType::BeginStation) + { + type = TrackElemType::EndStation; + } + } + if (_rideConstructionState2 == RideConstructionState::Back) + { + if (type == TrackElemType::MiddleStation) + { + type = TrackElemType::BeginStation; + } + } + if (NetworkGetMode() == NETWORK_MODE_CLIENT) + { + // rideConstructionState needs to be set again to the proper value, this only affects the client + _rideConstructionState = RideConstructionState::Selected; + } + _currentTrackBegin = piecePos; + _currentTrackPieceDirection = piecePos.direction; + _currentTrackPieceType = type; + _currentTrackSelectionFlags = 0; + if (_rideConstructionState2 == RideConstructionState::Front) + { + RideSelectNextSection(); + } + else if (_rideConstructionState2 == RideConstructionState::Back) + { + RideSelectPreviousSection(); + } + WindowRideConstructionUpdateActiveElements(); + } } - else - { - if (_rideConstructionState2 == RideConstructionState::Selected - || _rideConstructionState2 == RideConstructionState::Front) - { - if (type == TrackElemType::MiddleStation || type == TrackElemType::BeginStation) - { - type = TrackElemType::EndStation; - } - } - if (_rideConstructionState2 == RideConstructionState::Back) - { - if (type == TrackElemType::MiddleStation) - { - type = TrackElemType::BeginStation; - } - } - if (NetworkGetMode() == NETWORK_MODE_CLIENT) - { - // rideConstructionState needs to be set again to the proper value, this only affects the client - _rideConstructionState = RideConstructionState::Selected; - } - _currentTrackBegin = piecePos; - _currentTrackPieceDirection = piecePos.direction; - _currentTrackPieceType = type; - _currentTrackSelectionFlags = 0; - if (_rideConstructionState2 == RideConstructionState::Front) - { - RideSelectNextSection(); - } - else if (_rideConstructionState2 == RideConstructionState::Back) - { - RideSelectPreviousSection(); - } - WindowRideConstructionUpdateActiveElements(); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 2d7692e76d..3a4426c6f0 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -29,40 +29,40 @@ #include #include -using namespace OpenRCT2; - -static constexpr StringId WINDOW_TITLE = STR_NONE; -static constexpr int32_t WH = 240; -static constexpr int32_t WW = 340; - -enum +namespace OpenRCT2::Ui::Windows { - PAGE_RIDES, - PAGE_SHOPS_AND_STALLS, - PAGE_KIOSKS_AND_FACILITIES, - PAGE_COUNT -}; + static constexpr StringId WINDOW_TITLE = STR_NONE; + static constexpr int32_t WH = 240; + static constexpr int32_t WW = 340; -enum WindowRideListWidgetIdx -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PAGE_BACKGROUND, - WIDX_OPEN_CLOSE_ALL, - WIDX_CURRENT_INFORMATION_TYPE, - WIDX_INFORMATION_TYPE_DROPDOWN, - WIDX_SORT, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, - WIDX_LIST, - WIDX_CLOSE_LIGHT, - WIDX_OPEN_LIGHT, - WIDX_QUICK_DEMOLISH, -}; + enum + { + PAGE_RIDES, + PAGE_SHOPS_AND_STALLS, + PAGE_KIOSKS_AND_FACILITIES, + PAGE_COUNT + }; -// clang-format off + enum WindowRideListWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PAGE_BACKGROUND, + WIDX_OPEN_CLOSE_ALL, + WIDX_CURRENT_INFORMATION_TYPE, + WIDX_INFORMATION_TYPE_DROPDOWN, + WIDX_SORT, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, + WIDX_LIST, + WIDX_CLOSE_LIGHT, + WIDX_OPEN_LIGHT, + WIDX_QUICK_DEMOLISH, + }; + + // clang-format off static Widget _rideListWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, {340, 197}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab page background @@ -79,894 +79,901 @@ static Widget _rideListWidgets[] = { MakeWidget({315, 90}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_DEMOLISH), STR_QUICK_DEMOLISH_RIDE ), kWidgetsEnd, }; -// clang-format on + // clang-format on -enum -{ - INFORMATION_TYPE_STATUS, - INFORMATION_TYPE_POPULARITY, - INFORMATION_TYPE_SATISFACTION, - INFORMATION_TYPE_PROFIT, - INFORMATION_TYPE_TOTAL_CUSTOMERS, - INFORMATION_TYPE_TOTAL_PROFIT, - INFORMATION_TYPE_CUSTOMERS, - INFORMATION_TYPE_AGE, - INFORMATION_TYPE_INCOME, - INFORMATION_TYPE_RUNNING_COST, - INFORMATION_TYPE_QUEUE_LENGTH, - INFORMATION_TYPE_QUEUE_TIME, - INFORMATION_TYPE_RELIABILITY, - INFORMATION_TYPE_DOWN_TIME, - INFORMATION_TYPE_GUESTS_FAVOURITE, - INFORMATION_TYPE_EXCITEMENT, - INFORMATION_TYPE_INTENSITY, - INFORMATION_TYPE_NAUSEA, - DROPDOWN_LIST_COUNT, -}; - -static constexpr StringId ride_info_type_string_mapping[DROPDOWN_LIST_COUNT] = { - STR_STATUS, - STR_POPULARITY, - STR_SATISFACTION, - STR_PROFIT, - STR_RIDE_LIST_TOTAL_CUSTOMERS, - STR_RIDE_LIST_TOTAL_PROFIT, - STR_RIDE_LIST_CUSTOMERS_PER_HOUR, - STR_RIDE_LIST_AGE, - STR_RIDE_LIST_INCOME, - STR_RIDE_LIST_RUNNING_COST, - STR_QUEUE_LENGTH, - STR_QUEUE_TIME, - STR_RELIABILITY, - STR_DOWN_TIME, - STR_GUESTS_FAVOURITE, - STR_RIDE_LIST_EXCITEMENT, - STR_RIDE_LIST_INTENSITY, - STR_RIDE_LIST_NAUSEA, -}; - -static constexpr StringId ride_list_statusbar_count_strings[PAGE_COUNT] = { - STR_NUMBER_RIDES, - STR_NUMBER_SHOPS_AND_STALLS, - STR_NUMBER_TOILETS_AND_INFORMATION_KIOSKS, -}; - -static constexpr bool ride_info_type_money_mapping[DROPDOWN_LIST_COUNT] = { - false, // Status - false, // Popularity - false, // Satisfaction - true, // Profit - false, // Total customers - true, // Total profit - false, // Customers - false, // Age - true, // Income - true, // Running_cost - false, // Queue length - false, // Queue time - false, // Reliability - false, // Down time - false, // Guests favourite - false, // Excitement - false, // Intensity - false, // Nausea -}; - -static constexpr StringId page_names[] = { - STR_RIDES, - STR_SHOPS_AND_STALLS, - STR_TOILETS_AND_INFORMATION_KIOSKS, -}; - -class RideListWindow final : public Window -{ -private: - bool _quickDemolishMode = false; - int32_t _windowRideListInformationType = INFORMATION_TYPE_STATUS; - - struct RideListEntry + enum { - RideId Id; - u8string Name; + INFORMATION_TYPE_STATUS, + INFORMATION_TYPE_POPULARITY, + INFORMATION_TYPE_SATISFACTION, + INFORMATION_TYPE_PROFIT, + INFORMATION_TYPE_TOTAL_CUSTOMERS, + INFORMATION_TYPE_TOTAL_PROFIT, + INFORMATION_TYPE_CUSTOMERS, + INFORMATION_TYPE_AGE, + INFORMATION_TYPE_INCOME, + INFORMATION_TYPE_RUNNING_COST, + INFORMATION_TYPE_QUEUE_LENGTH, + INFORMATION_TYPE_QUEUE_TIME, + INFORMATION_TYPE_RELIABILITY, + INFORMATION_TYPE_DOWN_TIME, + INFORMATION_TYPE_GUESTS_FAVOURITE, + INFORMATION_TYPE_EXCITEMENT, + INFORMATION_TYPE_INTENSITY, + INFORMATION_TYPE_NAUSEA, + DROPDOWN_LIST_COUNT, }; - std::vector _rideList; -public: - void OnOpen() override + static constexpr StringId ride_info_type_string_mapping[DROPDOWN_LIST_COUNT] = { + STR_STATUS, + STR_POPULARITY, + STR_SATISFACTION, + STR_PROFIT, + STR_RIDE_LIST_TOTAL_CUSTOMERS, + STR_RIDE_LIST_TOTAL_PROFIT, + STR_RIDE_LIST_CUSTOMERS_PER_HOUR, + STR_RIDE_LIST_AGE, + STR_RIDE_LIST_INCOME, + STR_RIDE_LIST_RUNNING_COST, + STR_QUEUE_LENGTH, + STR_QUEUE_TIME, + STR_RELIABILITY, + STR_DOWN_TIME, + STR_GUESTS_FAVOURITE, + STR_RIDE_LIST_EXCITEMENT, + STR_RIDE_LIST_INTENSITY, + STR_RIDE_LIST_NAUSEA, + }; + + static constexpr StringId ride_list_statusbar_count_strings[PAGE_COUNT] = { + STR_NUMBER_RIDES, + STR_NUMBER_SHOPS_AND_STALLS, + STR_NUMBER_TOILETS_AND_INFORMATION_KIOSKS, + }; + + static constexpr bool ride_info_type_money_mapping[DROPDOWN_LIST_COUNT] = { + false, // Status + false, // Popularity + false, // Satisfaction + true, // Profit + false, // Total customers + true, // Total profit + false, // Customers + false, // Age + true, // Income + true, // Running_cost + false, // Queue length + false, // Queue time + false, // Reliability + false, // Down time + false, // Guests favourite + false, // Excitement + false, // Intensity + false, // Nausea + }; + + static constexpr StringId page_names[] = { + STR_RIDES, + STR_SHOPS_AND_STALLS, + STR_TOILETS_AND_INFORMATION_KIOSKS, + }; + + class RideListWindow final : public Window { - widgets = _rideListWidgets; - WindowInitScrollWidgets(*this); - page = PAGE_RIDES; - selected_list_item = -1; - frame_no = 0; - min_width = 340; - min_height = 240; - max_width = 400; - max_height = 700; - RefreshList(); + private: + bool _quickDemolishMode = false; + int32_t _windowRideListInformationType = INFORMATION_TYPE_STATUS; - list_information_type = 0; - - _windowRideListInformationType = INFORMATION_TYPE_STATUS; - _quickDemolishMode = false; - } - - /** - * - * rct2: 0x006B38A7 - */ - void OnResize() override - { - if (width < min_width) + struct RideListEntry { - Invalidate(); - width = min_width; - } - if (height < min_height) + RideId Id; + u8string Name; + }; + std::vector _rideList; + + public: + void OnOpen() override { - Invalidate(); - height = min_height; + widgets = _rideListWidgets; + WindowInitScrollWidgets(*this); + page = PAGE_RIDES; + selected_list_item = -1; + frame_no = 0; + min_width = 340; + min_height = 240; + max_width = 400; + max_height = 700; + RefreshList(); + + list_information_type = 0; + + _windowRideListInformationType = INFORMATION_TYPE_STATUS; + _quickDemolishMode = false; } - widgets[WIDX_SORT].left = width - 60; - widgets[WIDX_SORT].right = width - 60 + 54; + /** + * + * rct2: 0x006B38A7 + */ + void OnResize() override + { + if (width < min_width) + { + Invalidate(); + width = min_width; + } + if (height < min_height) + { + Invalidate(); + height = min_height; + } - ResizeDropdown(WIDX_CURRENT_INFORMATION_TYPE, { 150, 46 }, { width - 216, DROPDOWN_HEIGHT }); + widgets[WIDX_SORT].left = width - 60; + widgets[WIDX_SORT].right = width - 60 + 54; - // Refreshing the list can be a very intensive operation - // owing to its use of ride_has_any_track_elements(). - // This makes sure it's only refreshed every 64 ticks. - if (!(gCurrentRealTimeTicks & 0x3f)) + ResizeDropdown(WIDX_CURRENT_INFORMATION_TYPE, { 150, 46 }, { width - 216, DROPDOWN_HEIGHT }); + + // Refreshing the list can be a very intensive operation + // owing to its use of ride_has_any_track_elements(). + // This makes sure it's only refreshed every 64 ticks. + if (!(gCurrentRealTimeTicks & 0x3f)) + { + RefreshList(); + } + } + + /** + * + * rct2: 0x006B3511 + */ + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + WindowClose(*this); + break; + case WIDX_SORT: + list_information_type = _windowRideListInformationType; + selected_list_item = -1; + RefreshList(); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + if (page != widgetIndex - WIDX_TAB_1) + { + page = widgetIndex - WIDX_TAB_1; + frame_no = 0; + selected_list_item = -1; + if (page != PAGE_RIDES && _windowRideListInformationType > INFORMATION_TYPE_RUNNING_COST) + { + _windowRideListInformationType = INFORMATION_TYPE_STATUS; + } + RefreshList(); + } + break; + case WIDX_CLOSE_LIGHT: + CloseAllRides(); + break; + case WIDX_OPEN_LIGHT: + OpenAllRides(); + break; + case WIDX_QUICK_DEMOLISH: + if (NetworkGetMode() != NETWORK_MODE_CLIENT) + { + _quickDemolishMode = !_quickDemolishMode; + } + else + { + _quickDemolishMode = false; + } + Invalidate(); + break; + } + } + + /** + * + * rct2: 0x006B3532 + */ + void OnMouseDown(WidgetIndex widgetIndex) override + { + if (widgetIndex == WIDX_OPEN_CLOSE_ALL) + { + const auto& widget = widgets[widgetIndex]; + gDropdownItems[0].Format = STR_CLOSE_ALL; + gDropdownItems[1].Format = STR_OPEN_ALL; + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height(), colours[1], 0, 2); + } + else if (widgetIndex == WIDX_INFORMATION_TYPE_DROPDOWN) + { + const auto& widget = widgets[widgetIndex - 1]; + + int32_t lastType; + if (page == PAGE_RIDES) + lastType = INFORMATION_TYPE_NAUSEA; + else + lastType = INFORMATION_TYPE_RUNNING_COST; + + int32_t numItems = 0; + int32_t selectedIndex = -1; + for (int32_t type = INFORMATION_TYPE_STATUS; type <= lastType; type++) + { + if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + if (ride_info_type_money_mapping[type]) + { + continue; + } + } + + if (type == _windowRideListInformationType) + { + selectedIndex = numItems; + } + + gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[numItems].Args = ride_info_type_string_mapping[type]; + numItems++; + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height(), colours[1], 0, + Dropdown::Flag::StayOpen, numItems, widget.width() - 3); + if (selectedIndex != -1) + { + Dropdown::SetChecked(selectedIndex, true); + } + } + } + + /** + * + * rct2: 0x006B3547 + */ + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (widgetIndex == WIDX_OPEN_CLOSE_ALL) + { + if (dropdownIndex == 0) + { + CloseAllRides(); + } + else if (dropdownIndex == 1) + { + OpenAllRides(); + } + + Invalidate(); + } + else if (widgetIndex == WIDX_INFORMATION_TYPE_DROPDOWN) + { + if (dropdownIndex == -1) + return; + + int32_t informationType = INFORMATION_TYPE_STATUS; + uint32_t arg = static_cast(gDropdownItems[dropdownIndex].Args); + for (size_t i = 0; i < std::size(ride_info_type_string_mapping); i++) + { + if (arg == ride_info_type_string_mapping[i]) + { + informationType = static_cast(i); + } + } + + _windowRideListInformationType = informationType; + Invalidate(); + } + } + + /** + * + * rct2: 0x006B386B + */ + void OnUpdate() override + { + frame_no = (frame_no + 1) % 64; + WidgetInvalidate(*this, WIDX_TAB_1 + page); + if (_windowRideListInformationType != INFORMATION_TYPE_STATUS) + Invalidate(); + } + + /** + * + * rct2: 0x006B35A1 + */ + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + const auto newHeight = static_cast(_rideList.size() * SCROLLABLE_ROW_HEIGHT); + if (selected_list_item != -1) + { + selected_list_item = -1; + Invalidate(); + } + + auto top = newHeight - widgets[WIDX_LIST].bottom + widgets[WIDX_LIST].top + 21; + if (top < 0) + top = 0; + if (top < scrolls[0].v_top) + { + scrolls[0].v_top = top; + Invalidate(); + } + + return { 0, newHeight }; + } + + /** + * + * rct2: 0x006B361F + */ + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + const auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index < 0 || static_cast(index) >= _rideList.size()) + return; + + // Open ride window + const auto selectedRideId = _rideList[index].Id; + if (_quickDemolishMode && NetworkGetMode() != NETWORK_MODE_CLIENT) + { + auto gameAction = RideDemolishAction(selectedRideId, RIDE_MODIFY_DEMOLISH); + GameActions::Execute(&gameAction); + RefreshList(); + } + else + { + auto intent = Intent(WindowClass::Ride); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, selectedRideId.ToUnderlying()); + ContextOpenIntent(&intent); + } + } + + /** + * + * rct2: 0x006B35EF + */ + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + const auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index < 0 || static_cast(index) >= _rideList.size()) + return; + + selected_list_item = index; + Invalidate(); + } + + /** + * + * rct2: 0x006B3182 + */ + void OnPrepareDraw() override + { + widgets[WIDX_CURRENT_INFORMATION_TYPE].text = ride_info_type_string_mapping[_windowRideListInformationType]; + + // Set correct active tab + for (int32_t i = 0; i < 3; i++) + pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); + pressed_widgets |= 1LL << (WIDX_TAB_1 + page); + + widgets[WIDX_TITLE].text = page_names[page]; + + if (_quickDemolishMode) + pressed_widgets |= (1uLL << WIDX_QUICK_DEMOLISH); + else + pressed_widgets &= ~(1uLL << WIDX_QUICK_DEMOLISH); + + ResizeFrameWithPage(); + + widgets[WIDX_LIST].right = width - 26; + widgets[WIDX_LIST].bottom = height - 15; + widgets[WIDX_OPEN_CLOSE_ALL].right = width - 2; + widgets[WIDX_OPEN_CLOSE_ALL].left = width - 25; + widgets[WIDX_CLOSE_LIGHT].right = width - 7; + widgets[WIDX_CLOSE_LIGHT].left = width - 20; + widgets[WIDX_OPEN_LIGHT].right = width - 7; + widgets[WIDX_OPEN_LIGHT].left = width - 20; + widgets[WIDX_QUICK_DEMOLISH].right = width - 2; + widgets[WIDX_QUICK_DEMOLISH].left = width - 25; + + if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) + { + widgets[WIDX_OPEN_CLOSE_ALL].type = WindowWidgetType::Empty; + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; + + const auto& rideManager = GetRideManager(); + auto allClosed = true; + auto allOpen = false; + if (_rideList.size() > 0 && std::size(rideManager) != 0) + { + auto c = static_cast(page); + allClosed = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& rideRef) { + return rideRef.GetClassification() == c && rideRef.status == RideStatus::Open; + }); + allOpen = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& rideRef) { + return rideRef.GetClassification() == c && rideRef.status != RideStatus::Open; + }); + } + + const auto closeLightImage( + SPR_G2_RCT1_CLOSE_BUTTON_0 + (allClosed ? 1 : 0) * 2 + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT)); + widgets[WIDX_CLOSE_LIGHT].image = ImageId(closeLightImage); + const auto openLightImage = SPR_G2_RCT1_OPEN_BUTTON_0 + (allOpen ? 1 : 0) * 2 + + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); + widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage); + widgets[WIDX_QUICK_DEMOLISH].top = widgets[WIDX_OPEN_LIGHT].bottom + 3; + } + else + { + widgets[WIDX_OPEN_CLOSE_ALL].type = WindowWidgetType::FlatBtn; + widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::Empty; + widgets[WIDX_QUICK_DEMOLISH].top = widgets[WIDX_OPEN_CLOSE_ALL].bottom + 3; + } + widgets[WIDX_QUICK_DEMOLISH].bottom = widgets[WIDX_QUICK_DEMOLISH].top + 23; + widgets[WIDX_QUICK_DEMOLISH].type = NetworkGetMode() != NETWORK_MODE_CLIENT ? WindowWidgetType::FlatBtn + : WindowWidgetType::Empty; + } + + /** + * + * rct2: 0x006B3235 + */ + void OnDraw(DrawPixelInfo& dpi) override + { + WindowDrawWidgets(*this, dpi); + DrawTabImages(dpi); + + // Draw number of attractions on bottom + auto ft = Formatter(); + ft.Add(static_cast(_rideList.size())); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[page], + ft); + } + + /** + * + * rct2: 0x006B3240 + */ + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + GfxFillRect( + dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width, dpi.height } }, ColourMapA[colours[1]].mid_light); + + auto y = 0; + for (size_t i = 0; i < _rideList.size(); i++) + { + StringId format = (_quickDemolishMode ? STR_RED_STRINGID : STR_BLACK_STRING); + if (i == static_cast(selected_list_item)) + { + // Background highlight + GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); + format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); + } + + // Get ride + const auto* ridePtr = GetRide(_rideList[i].Id); + if (ridePtr == nullptr) + continue; + + // Ride name + auto ft = Formatter(); + ridePtr->FormatNameTo(ft); + DrawTextEllipsised(dpi, { 0, y - 1 }, 159, format, ft); + + // Ride information + ft = Formatter(); + ft.Increment(2); + auto formatSecondaryEnabled = true; + StringId formatSecondary = 0; + switch (_windowRideListInformationType) + { + case INFORMATION_TYPE_STATUS: + formatSecondaryEnabled = false; + ft.Rewind(); + ridePtr->FormatStatusTo(ft); + + // Make test red and bold if broken down or crashed + if ((ridePtr->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) + || (ridePtr->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) + { + format = STR_RED_OUTLINED_STRING; + } + break; + case INFORMATION_TYPE_POPULARITY: + formatSecondary = STR_POPULARITY_UNKNOWN_LABEL; + if (ridePtr->popularity != 255) + { + formatSecondary = STR_POPULARITY_LABEL; + ft.Add(ridePtr->popularity * 4); + } + break; + case INFORMATION_TYPE_SATISFACTION: + formatSecondary = STR_SATISFACTION_UNKNOWN_LABEL; + if (ridePtr->satisfaction != 255) + { + formatSecondary = STR_SATISFACTION_LABEL; + ft.Add(ridePtr->satisfaction * 5); + } + break; + case INFORMATION_TYPE_PROFIT: + formatSecondary = 0; + if (ridePtr->profit != kMoney64Undefined) + { + formatSecondary = STR_PROFIT_LABEL; + ft.Add(ridePtr->profit); + } + break; + case INFORMATION_TYPE_TOTAL_CUSTOMERS: + formatSecondary = STR_RIDE_LIST_TOTAL_CUSTOMERS_LABEL; + ft.Add(ridePtr->total_customers); + break; + case INFORMATION_TYPE_TOTAL_PROFIT: + formatSecondary = 0; + if (ridePtr->total_profit != kMoney64Undefined) + { + formatSecondary = STR_RIDE_LIST_TOTAL_PROFIT_LABEL; + ft.Add(ridePtr->total_profit); + } + break; + case INFORMATION_TYPE_CUSTOMERS: + formatSecondary = STR_RIDE_LIST_CUSTOMERS_PER_HOUR_LABEL; + ft.Add(RideCustomersPerHour(*ridePtr)); + break; + case INFORMATION_TYPE_AGE: + { + const auto age = DateGetYear(ridePtr->GetAge()); + switch (age) + { + case 0: + formatSecondary = STR_RIDE_LIST_BUILT_THIS_YEAR_LABEL; + break; + case 1: + formatSecondary = STR_RIDE_LIST_BUILT_LAST_YEAR_LABEL; + break; + default: + formatSecondary = STR_RIDE_LIST_BUILT_X_YEARS_AGO_LABEL; + break; + } + ft.Add(age); + break; + } + case INFORMATION_TYPE_INCOME: + formatSecondary = 0; + if (ridePtr->income_per_hour != kMoney64Undefined) + { + formatSecondary = STR_RIDE_LIST_INCOME_LABEL; + ft.Add(ridePtr->income_per_hour); + } + break; + case INFORMATION_TYPE_RUNNING_COST: + formatSecondary = STR_RIDE_LIST_RUNNING_COST_UNKNOWN; + if (ridePtr->upkeep_cost != kMoney64Undefined) + { + formatSecondary = STR_RIDE_LIST_RUNNING_COST_LABEL; + ft.Add(ridePtr->upkeep_cost * 16); + } + break; + case INFORMATION_TYPE_QUEUE_LENGTH: + { + const auto queueLength = ridePtr->GetTotalQueueLength(); + ft.Add(queueLength); + + if (queueLength == 1) + { + formatSecondary = STR_QUEUE_ONE_PERSON; + } + else if (queueLength > 1) + { + formatSecondary = STR_QUEUE_PEOPLE; + } + else + { + formatSecondary = STR_QUEUE_EMPTY; + } + break; + } + case INFORMATION_TYPE_QUEUE_TIME: + { + const auto maxQueueTime = ridePtr->GetMaxQueueTime(); + ft.Add(maxQueueTime); + + if (maxQueueTime > 1) + { + formatSecondary = STR_QUEUE_TIME_PLURAL_LABEL; + } + else + { + formatSecondary = STR_QUEUE_TIME_LABEL; + } + break; + } + case INFORMATION_TYPE_RELIABILITY: + ft.Add(ridePtr->reliability_percentage); + formatSecondary = STR_RELIABILITY_LABEL; + break; + case INFORMATION_TYPE_DOWN_TIME: + ft.Add(ridePtr->downtime); + formatSecondary = STR_DOWN_TIME_LABEL; + break; + case INFORMATION_TYPE_GUESTS_FAVOURITE: + formatSecondary = 0; + if (ridePtr->IsRide()) + { + ft.Add(ridePtr->guests_favourite); + formatSecondary = ridePtr->guests_favourite == 1 ? STR_GUESTS_FAVOURITE_LABEL + : STR_GUESTS_FAVOURITE_PLURAL_LABEL; + } + break; + case INFORMATION_TYPE_EXCITEMENT: + formatSecondary = STR_RATING_UKNOWN_LABEL; + if (RideHasRatings(*ridePtr)) + { + formatSecondary = STR_EXCITEMENT_LABEL; + ft.Add(ridePtr->excitement); + } + break; + case INFORMATION_TYPE_INTENSITY: + formatSecondary = STR_RATING_UKNOWN_LABEL; + if (RideHasRatings(*ridePtr)) + { + formatSecondary = STR_INTENSITY_LABEL; + ft.Add(ridePtr->intensity); + } + break; + case INFORMATION_TYPE_NAUSEA: + formatSecondary = STR_RATING_UKNOWN_LABEL; + if (RideHasRatings(*ridePtr)) + { + formatSecondary = STR_NAUSEA_LABEL; + ft.Add(ridePtr->nausea); + } + break; + } + + if (formatSecondaryEnabled) + { + ft.Rewind(); + ft.Add(formatSecondary); + } + DrawTextEllipsised(dpi, { 160, y - 1 }, 157, format, ft); + y += SCROLLABLE_ROW_HEIGHT; + } + } + + void RefreshListWrapper() { RefreshList(); } - } - /** - * - * rct2: 0x006B3511 - */ - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + private: + /** + * + * rct2: 0x006B38EA + */ + void DrawTabImages(DrawPixelInfo& dpi) { - case WIDX_CLOSE: - WindowClose(*this); - break; - case WIDX_SORT: - list_information_type = _windowRideListInformationType; - selected_list_item = -1; - RefreshList(); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - if (page != widgetIndex - WIDX_TAB_1) - { - page = widgetIndex - WIDX_TAB_1; - frame_no = 0; - selected_list_item = -1; - if (page != PAGE_RIDES && _windowRideListInformationType > INFORMATION_TYPE_RUNNING_COST) - { - _windowRideListInformationType = INFORMATION_TYPE_STATUS; - } - RefreshList(); - } - break; - case WIDX_CLOSE_LIGHT: - CloseAllRides(); - break; - case WIDX_OPEN_LIGHT: - OpenAllRides(); - break; - case WIDX_QUICK_DEMOLISH: - if (NetworkGetMode() != NETWORK_MODE_CLIENT) - { - _quickDemolishMode = !_quickDemolishMode; - } - else - { - _quickDemolishMode = false; - } - Invalidate(); - break; - } - } + int32_t sprite_idx; - /** - * - * rct2: 0x006B3532 - */ - void OnMouseDown(WidgetIndex widgetIndex) override - { - if (widgetIndex == WIDX_OPEN_CLOSE_ALL) - { - const auto& widget = widgets[widgetIndex]; - gDropdownItems[0].Format = STR_CLOSE_ALL; - gDropdownItems[1].Format = STR_OPEN_ALL; - WindowDropdownShowText({ windowPos.x + widget.left, windowPos.y + widget.top }, widget.height(), colours[1], 0, 2); - } - else if (widgetIndex == WIDX_INFORMATION_TYPE_DROPDOWN) - { - const auto& widget = widgets[widgetIndex - 1]; - - int32_t lastType; + // Rides tab + sprite_idx = SPR_TAB_RIDE_0; if (page == PAGE_RIDES) - lastType = INFORMATION_TYPE_NAUSEA; - else - lastType = INFORMATION_TYPE_RUNNING_COST; + sprite_idx += frame_no / 4; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); - int32_t numItems = 0; - int32_t selectedIndex = -1; - for (int32_t type = INFORMATION_TYPE_STATUS; type <= lastType; type++) - { - if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + // Shops and stalls tab + sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0; + if (page == PAGE_SHOPS_AND_STALLS) + sprite_idx += frame_no / 4; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); + + // Information kiosks and facilities tab + sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0; + if (page == PAGE_KIOSKS_AND_FACILITIES) + sprite_idx += (frame_no / 4) % 8; + GfxDrawSprite( + dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); + } + + /** + * Used in RefreshList() to handle the sorting of the list. + * Uses a lambda function (predicate) as exit criteria for the algorithm. + */ + template void SortListByPredicate(const TSortPred& pred) + { + std::sort(_rideList.begin(), _rideList.end(), [&pred](const auto& lhs, const auto& rhs) { + const Ride* rideLhs = GetRide(lhs.Id); + const Ride* rideRhs = GetRide(rhs.Id); + if (rideLhs == nullptr || rideRhs == nullptr) { - if (ride_info_type_money_mapping[type]) - { - continue; - } + return false; + } + return !pred(*rideLhs, *rideRhs); + }); + } + + void SortListByName() + { + std::sort(_rideList.begin(), _rideList.end(), [](const auto& lhs, const auto& rhs) { + return !(0 <= StrLogicalCmp(lhs.Name.c_str(), rhs.Name.c_str())); + }); + } + + /** + * + * rct2: 0x006B39A8 + */ + void RefreshList() + { + _rideList.clear(); + for (auto& rideRef : GetRideManager()) + { + if (rideRef.GetClassification() != static_cast(page) + || (rideRef.status == RideStatus::Closed && !RideHasAnyTrackElements(rideRef))) + { + continue; } - if (type == _windowRideListInformationType) + if (rideRef.window_invalidate_flags & RIDE_INVALIDATE_RIDE_LIST) { - selectedIndex = numItems; + rideRef.window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_LIST; } - gDropdownItems[numItems].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[numItems].Args = ride_info_type_string_mapping[type]; - numItems++; + RideListEntry entry{}; + entry.Id = rideRef.id; + entry.Name = rideRef.GetName(); + + _rideList.push_back(std::move(entry)); } - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height(), colours[1], 0, - Dropdown::Flag::StayOpen, numItems, widget.width() - 3); - if (selectedIndex != -1) + switch (list_information_type) { - Dropdown::SetChecked(selectedIndex, true); - } - } - } - - /** - * - * rct2: 0x006B3547 - */ - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (widgetIndex == WIDX_OPEN_CLOSE_ALL) - { - if (dropdownIndex == 0) - { - CloseAllRides(); - } - else if (dropdownIndex == 1) - { - OpenAllRides(); + case INFORMATION_TYPE_STATUS: + SortListByName(); + break; + case INFORMATION_TYPE_POPULARITY: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.popularity * 4 <= otherRide.popularity * 4; + }); + break; + case INFORMATION_TYPE_SATISFACTION: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.satisfaction * 5 <= otherRide.satisfaction * 5; + }); + break; + case INFORMATION_TYPE_PROFIT: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.profit <= otherRide.profit; + }); + break; + case INFORMATION_TYPE_TOTAL_CUSTOMERS: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.total_customers <= otherRide.total_customers; + }); + break; + case INFORMATION_TYPE_TOTAL_PROFIT: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.total_profit <= otherRide.total_profit; + }); + break; + case INFORMATION_TYPE_CUSTOMERS: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return RideCustomersPerHour(thisRide) <= RideCustomersPerHour(otherRide); + }); + break; + case INFORMATION_TYPE_AGE: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.build_date <= otherRide.build_date; + }); + break; + case INFORMATION_TYPE_INCOME: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.income_per_hour <= otherRide.income_per_hour; + }); + break; + case INFORMATION_TYPE_RUNNING_COST: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.upkeep_cost <= otherRide.upkeep_cost; + }); + break; + case INFORMATION_TYPE_QUEUE_LENGTH: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.GetTotalQueueLength() <= otherRide.GetTotalQueueLength(); + }); + break; + case INFORMATION_TYPE_QUEUE_TIME: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.GetMaxQueueTime() <= otherRide.GetMaxQueueTime(); + }); + break; + case INFORMATION_TYPE_RELIABILITY: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.reliability_percentage <= otherRide.reliability_percentage; + }); + break; + case INFORMATION_TYPE_DOWN_TIME: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.downtime <= otherRide.downtime; + }); + break; + case INFORMATION_TYPE_GUESTS_FAVOURITE: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.guests_favourite <= otherRide.guests_favourite; + }); + break; + case INFORMATION_TYPE_EXCITEMENT: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.excitement <= otherRide.excitement; + }); + break; + case INFORMATION_TYPE_INTENSITY: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.intensity <= otherRide.intensity; + }); + break; + case INFORMATION_TYPE_NAUSEA: + SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { + return thisRide.nausea <= otherRide.nausea; + }); + break; } - Invalidate(); - } - else if (widgetIndex == WIDX_INFORMATION_TYPE_DROPDOWN) - { - if (dropdownIndex == -1) - return; - - int32_t informationType = INFORMATION_TYPE_STATUS; - uint32_t arg = static_cast(gDropdownItems[dropdownIndex].Args); - for (size_t i = 0; i < std::size(ride_info_type_string_mapping); i++) - { - if (arg == ride_info_type_string_mapping[i]) - { - informationType = static_cast(i); - } - } - - _windowRideListInformationType = informationType; - Invalidate(); - } - } - - /** - * - * rct2: 0x006B386B - */ - void OnUpdate() override - { - frame_no = (frame_no + 1) % 64; - WidgetInvalidate(*this, WIDX_TAB_1 + page); - if (_windowRideListInformationType != INFORMATION_TYPE_STATUS) - Invalidate(); - } - - /** - * - * rct2: 0x006B35A1 - */ - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - const auto newHeight = static_cast(_rideList.size() * SCROLLABLE_ROW_HEIGHT); - if (selected_list_item != -1) - { selected_list_item = -1; Invalidate(); } - auto top = newHeight - widgets[WIDX_LIST].bottom + widgets[WIDX_LIST].top + 21; - if (top < 0) - top = 0; - if (top < scrolls[0].v_top) + // window_ride_list_close_all + void CloseAllRides() { - scrolls[0].v_top = top; - Invalidate(); - } - - return { 0, newHeight }; - } - - /** - * - * rct2: 0x006B361F - */ - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - const auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index < 0 || static_cast(index) >= _rideList.size()) - return; - - // Open ride window - const auto selectedRideId = _rideList[index].Id; - if (_quickDemolishMode && NetworkGetMode() != NETWORK_MODE_CLIENT) - { - auto gameAction = RideDemolishAction(selectedRideId, RIDE_MODIFY_DEMOLISH); - GameActions::Execute(&gameAction); - RefreshList(); - } - else - { - auto intent = Intent(WindowClass::Ride); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, selectedRideId.ToUnderlying()); - ContextOpenIntent(&intent); - } - } - - /** - * - * rct2: 0x006B35EF - */ - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - const auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index < 0 || static_cast(index) >= _rideList.size()) - return; - - selected_list_item = index; - Invalidate(); - } - - /** - * - * rct2: 0x006B3182 - */ - void OnPrepareDraw() override - { - widgets[WIDX_CURRENT_INFORMATION_TYPE].text = ride_info_type_string_mapping[_windowRideListInformationType]; - - // Set correct active tab - for (int32_t i = 0; i < 3; i++) - pressed_widgets &= ~(1 << (WIDX_TAB_1 + i)); - pressed_widgets |= 1LL << (WIDX_TAB_1 + page); - - widgets[WIDX_TITLE].text = page_names[page]; - - if (_quickDemolishMode) - pressed_widgets |= (1uLL << WIDX_QUICK_DEMOLISH); - else - pressed_widgets &= ~(1uLL << WIDX_QUICK_DEMOLISH); - - ResizeFrameWithPage(); - - widgets[WIDX_LIST].right = width - 26; - widgets[WIDX_LIST].bottom = height - 15; - widgets[WIDX_OPEN_CLOSE_ALL].right = width - 2; - widgets[WIDX_OPEN_CLOSE_ALL].left = width - 25; - widgets[WIDX_CLOSE_LIGHT].right = width - 7; - widgets[WIDX_CLOSE_LIGHT].left = width - 20; - widgets[WIDX_OPEN_LIGHT].right = width - 7; - widgets[WIDX_OPEN_LIGHT].left = width - 20; - widgets[WIDX_QUICK_DEMOLISH].right = width - 2; - widgets[WIDX_QUICK_DEMOLISH].left = width - 25; - - if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE) - { - widgets[WIDX_OPEN_CLOSE_ALL].type = WindowWidgetType::Empty; - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::ImgBtn; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::ImgBtn; - - const auto& rideManager = GetRideManager(); - auto allClosed = true; - auto allOpen = false; - if (_rideList.size() > 0 && std::size(rideManager) != 0) + for (auto& rideRef : GetRideManager()) { - auto c = static_cast(page); - allClosed = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& rideRef) { - return rideRef.GetClassification() == c && rideRef.status == RideStatus::Open; - }); - allOpen = std::none_of(rideManager.begin(), rideManager.end(), [c](const Ride& rideRef) { - return rideRef.GetClassification() == c && rideRef.status != RideStatus::Open; - }); - } - - const auto closeLightImage( - SPR_G2_RCT1_CLOSE_BUTTON_0 + (allClosed ? 1 : 0) * 2 + WidgetIsPressed(*this, WIDX_CLOSE_LIGHT)); - widgets[WIDX_CLOSE_LIGHT].image = ImageId(closeLightImage); - const auto openLightImage = SPR_G2_RCT1_OPEN_BUTTON_0 + (allOpen ? 1 : 0) * 2 - + WidgetIsPressed(*this, WIDX_OPEN_LIGHT); - widgets[WIDX_OPEN_LIGHT].image = ImageId(openLightImage); - widgets[WIDX_QUICK_DEMOLISH].top = widgets[WIDX_OPEN_LIGHT].bottom + 3; - } - else - { - widgets[WIDX_OPEN_CLOSE_ALL].type = WindowWidgetType::FlatBtn; - widgets[WIDX_CLOSE_LIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_OPEN_LIGHT].type = WindowWidgetType::Empty; - widgets[WIDX_QUICK_DEMOLISH].top = widgets[WIDX_OPEN_CLOSE_ALL].bottom + 3; - } - widgets[WIDX_QUICK_DEMOLISH].bottom = widgets[WIDX_QUICK_DEMOLISH].top + 23; - widgets[WIDX_QUICK_DEMOLISH].type = NetworkGetMode() != NETWORK_MODE_CLIENT ? WindowWidgetType::FlatBtn - : WindowWidgetType::Empty; - } - - /** - * - * rct2: 0x006B3235 - */ - void OnDraw(DrawPixelInfo& dpi) override - { - WindowDrawWidgets(*this, dpi); - DrawTabImages(dpi); - - // Draw number of attractions on bottom - auto ft = Formatter(); - ft.Add(static_cast(_rideList.size())); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_LIST].bottom + 2 }, ride_list_statusbar_count_strings[page], ft); - } - - /** - * - * rct2: 0x006B3240 - */ - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; - GfxFillRect(dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width, dpi.height } }, ColourMapA[colours[1]].mid_light); - - auto y = 0; - for (size_t i = 0; i < _rideList.size(); i++) - { - StringId format = (_quickDemolishMode ? STR_RED_STRINGID : STR_BLACK_STRING); - if (i == static_cast(selected_list_item)) - { - // Background highlight - GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1); - format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); - } - - // Get ride - const auto* ridePtr = GetRide(_rideList[i].Id); - if (ridePtr == nullptr) - continue; - - // Ride name - auto ft = Formatter(); - ridePtr->FormatNameTo(ft); - DrawTextEllipsised(dpi, { 0, y - 1 }, 159, format, ft); - - // Ride information - ft = Formatter(); - ft.Increment(2); - auto formatSecondaryEnabled = true; - StringId formatSecondary = 0; - switch (_windowRideListInformationType) - { - case INFORMATION_TYPE_STATUS: - formatSecondaryEnabled = false; - ft.Rewind(); - ridePtr->FormatStatusTo(ft); - - // Make test red and bold if broken down or crashed - if ((ridePtr->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) - || (ridePtr->lifecycle_flags & RIDE_LIFECYCLE_CRASHED)) - { - format = STR_RED_OUTLINED_STRING; - } - break; - case INFORMATION_TYPE_POPULARITY: - formatSecondary = STR_POPULARITY_UNKNOWN_LABEL; - if (ridePtr->popularity != 255) - { - formatSecondary = STR_POPULARITY_LABEL; - ft.Add(ridePtr->popularity * 4); - } - break; - case INFORMATION_TYPE_SATISFACTION: - formatSecondary = STR_SATISFACTION_UNKNOWN_LABEL; - if (ridePtr->satisfaction != 255) - { - formatSecondary = STR_SATISFACTION_LABEL; - ft.Add(ridePtr->satisfaction * 5); - } - break; - case INFORMATION_TYPE_PROFIT: - formatSecondary = 0; - if (ridePtr->profit != kMoney64Undefined) - { - formatSecondary = STR_PROFIT_LABEL; - ft.Add(ridePtr->profit); - } - break; - case INFORMATION_TYPE_TOTAL_CUSTOMERS: - formatSecondary = STR_RIDE_LIST_TOTAL_CUSTOMERS_LABEL; - ft.Add(ridePtr->total_customers); - break; - case INFORMATION_TYPE_TOTAL_PROFIT: - formatSecondary = 0; - if (ridePtr->total_profit != kMoney64Undefined) - { - formatSecondary = STR_RIDE_LIST_TOTAL_PROFIT_LABEL; - ft.Add(ridePtr->total_profit); - } - break; - case INFORMATION_TYPE_CUSTOMERS: - formatSecondary = STR_RIDE_LIST_CUSTOMERS_PER_HOUR_LABEL; - ft.Add(RideCustomersPerHour(*ridePtr)); - break; - case INFORMATION_TYPE_AGE: + if (rideRef.status != RideStatus::Closed + && rideRef.GetClassification() == static_cast(page)) { - const auto age = DateGetYear(ridePtr->GetAge()); - switch (age) - { - case 0: - formatSecondary = STR_RIDE_LIST_BUILT_THIS_YEAR_LABEL; - break; - case 1: - formatSecondary = STR_RIDE_LIST_BUILT_LAST_YEAR_LABEL; - break; - default: - formatSecondary = STR_RIDE_LIST_BUILT_X_YEARS_AGO_LABEL; - break; - } - ft.Add(age); - break; + auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::Closed); + GameActions::Execute(&gameAction); } - case INFORMATION_TYPE_INCOME: - formatSecondary = 0; - if (ridePtr->income_per_hour != kMoney64Undefined) - { - formatSecondary = STR_RIDE_LIST_INCOME_LABEL; - ft.Add(ridePtr->income_per_hour); - } - break; - case INFORMATION_TYPE_RUNNING_COST: - formatSecondary = STR_RIDE_LIST_RUNNING_COST_UNKNOWN; - if (ridePtr->upkeep_cost != kMoney64Undefined) - { - formatSecondary = STR_RIDE_LIST_RUNNING_COST_LABEL; - ft.Add(ridePtr->upkeep_cost * 16); - } - break; - case INFORMATION_TYPE_QUEUE_LENGTH: - { - const auto queueLength = ridePtr->GetTotalQueueLength(); - ft.Add(queueLength); - - if (queueLength == 1) - { - formatSecondary = STR_QUEUE_ONE_PERSON; - } - else if (queueLength > 1) - { - formatSecondary = STR_QUEUE_PEOPLE; - } - else - { - formatSecondary = STR_QUEUE_EMPTY; - } - break; - } - case INFORMATION_TYPE_QUEUE_TIME: - { - const auto maxQueueTime = ridePtr->GetMaxQueueTime(); - ft.Add(maxQueueTime); - - if (maxQueueTime > 1) - { - formatSecondary = STR_QUEUE_TIME_PLURAL_LABEL; - } - else - { - formatSecondary = STR_QUEUE_TIME_LABEL; - } - break; - } - case INFORMATION_TYPE_RELIABILITY: - ft.Add(ridePtr->reliability_percentage); - formatSecondary = STR_RELIABILITY_LABEL; - break; - case INFORMATION_TYPE_DOWN_TIME: - ft.Add(ridePtr->downtime); - formatSecondary = STR_DOWN_TIME_LABEL; - break; - case INFORMATION_TYPE_GUESTS_FAVOURITE: - formatSecondary = 0; - if (ridePtr->IsRide()) - { - ft.Add(ridePtr->guests_favourite); - formatSecondary = ridePtr->guests_favourite == 1 ? STR_GUESTS_FAVOURITE_LABEL - : STR_GUESTS_FAVOURITE_PLURAL_LABEL; - } - break; - case INFORMATION_TYPE_EXCITEMENT: - formatSecondary = STR_RATING_UKNOWN_LABEL; - if (RideHasRatings(*ridePtr)) - { - formatSecondary = STR_EXCITEMENT_LABEL; - ft.Add(ridePtr->excitement); - } - break; - case INFORMATION_TYPE_INTENSITY: - formatSecondary = STR_RATING_UKNOWN_LABEL; - if (RideHasRatings(*ridePtr)) - { - formatSecondary = STR_INTENSITY_LABEL; - ft.Add(ridePtr->intensity); - } - break; - case INFORMATION_TYPE_NAUSEA: - formatSecondary = STR_RATING_UKNOWN_LABEL; - if (RideHasRatings(*ridePtr)) - { - formatSecondary = STR_NAUSEA_LABEL; - ft.Add(ridePtr->nausea); - } - break; } - - if (formatSecondaryEnabled) - { - ft.Rewind(); - ft.Add(formatSecondary); - } - DrawTextEllipsised(dpi, { 160, y - 1 }, 157, format, ft); - y += SCROLLABLE_ROW_HEIGHT; } - } - void RefreshListWrapper() - { - RefreshList(); - } - -private: - /** - * - * rct2: 0x006B38EA - */ - void DrawTabImages(DrawPixelInfo& dpi) - { - int32_t sprite_idx; - - // Rides tab - sprite_idx = SPR_TAB_RIDE_0; - if (page == PAGE_RIDES) - sprite_idx += frame_no / 4; - GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_1].left, widgets[WIDX_TAB_1].top }); - - // Shops and stalls tab - sprite_idx = SPR_TAB_SHOPS_AND_STALLS_0; - if (page == PAGE_SHOPS_AND_STALLS) - sprite_idx += frame_no / 4; - GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_2].left, widgets[WIDX_TAB_2].top }); - - // Information kiosks and facilities tab - sprite_idx = SPR_TAB_KIOSKS_AND_FACILITIES_0; - if (page == PAGE_KIOSKS_AND_FACILITIES) - sprite_idx += (frame_no / 4) % 8; - GfxDrawSprite( - dpi, ImageId(sprite_idx), windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top }); - } - - /** - * Used in RefreshList() to handle the sorting of the list. - * Uses a lambda function (predicate) as exit criteria for the algorithm. - */ - template void SortListByPredicate(const TSortPred& pred) - { - std::sort(_rideList.begin(), _rideList.end(), [&pred](const auto& lhs, const auto& rhs) { - const Ride* rideLhs = GetRide(lhs.Id); - const Ride* rideRhs = GetRide(rhs.Id); - if (rideLhs == nullptr || rideRhs == nullptr) + // window_ride_list_open_all + void OpenAllRides() + { + for (auto& rideRef : GetRideManager()) { - return false; + if (rideRef.status != RideStatus::Open && rideRef.GetClassification() == static_cast(page)) + { + auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::Open); + GameActions::Execute(&gameAction); + } } - return !pred(*rideLhs, *rideRhs); - }); - } - - void SortListByName() - { - std::sort(_rideList.begin(), _rideList.end(), [](const auto& lhs, const auto& rhs) { - return !(0 <= StrLogicalCmp(lhs.Name.c_str(), rhs.Name.c_str())); - }); - } + } + }; /** * - * rct2: 0x006B39A8 + * rct2: 0x006B30BC */ - void RefreshList() + WindowBase* WindowRideListOpen() { - _rideList.clear(); - for (auto& rideRef : GetRideManager()) + // Check if window is already open + auto* window = WindowBringToFrontByClass(WindowClass::RideList); + if (window == nullptr) { - if (rideRef.GetClassification() != static_cast(page) - || (rideRef.status == RideStatus::Closed && !RideHasAnyTrackElements(rideRef))) - { - continue; - } - - if (rideRef.window_invalidate_flags & RIDE_INVALIDATE_RIDE_LIST) - { - rideRef.window_invalidate_flags &= ~RIDE_INVALIDATE_RIDE_LIST; - } - - RideListEntry entry{}; - entry.Id = rideRef.id; - entry.Name = rideRef.GetName(); - - _rideList.push_back(std::move(entry)); + window = WindowCreate(WindowClass::RideList, ScreenCoordsXY(32, 32), WW, WH, WF_10 | WF_RESIZABLE); } - - switch (list_information_type) - { - case INFORMATION_TYPE_STATUS: - SortListByName(); - break; - case INFORMATION_TYPE_POPULARITY: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.popularity * 4 <= otherRide.popularity * 4; - }); - break; - case INFORMATION_TYPE_SATISFACTION: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.satisfaction * 5 <= otherRide.satisfaction * 5; - }); - break; - case INFORMATION_TYPE_PROFIT: - SortListByPredicate( - [](const Ride& thisRide, const Ride& otherRide) -> bool { return thisRide.profit <= otherRide.profit; }); - break; - case INFORMATION_TYPE_TOTAL_CUSTOMERS: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.total_customers <= otherRide.total_customers; - }); - break; - case INFORMATION_TYPE_TOTAL_PROFIT: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.total_profit <= otherRide.total_profit; - }); - break; - case INFORMATION_TYPE_CUSTOMERS: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return RideCustomersPerHour(thisRide) <= RideCustomersPerHour(otherRide); - }); - break; - case INFORMATION_TYPE_AGE: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.build_date <= otherRide.build_date; - }); - break; - case INFORMATION_TYPE_INCOME: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.income_per_hour <= otherRide.income_per_hour; - }); - break; - case INFORMATION_TYPE_RUNNING_COST: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.upkeep_cost <= otherRide.upkeep_cost; - }); - break; - case INFORMATION_TYPE_QUEUE_LENGTH: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.GetTotalQueueLength() <= otherRide.GetTotalQueueLength(); - }); - break; - case INFORMATION_TYPE_QUEUE_TIME: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.GetMaxQueueTime() <= otherRide.GetMaxQueueTime(); - }); - break; - case INFORMATION_TYPE_RELIABILITY: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.reliability_percentage <= otherRide.reliability_percentage; - }); - break; - case INFORMATION_TYPE_DOWN_TIME: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.downtime <= otherRide.downtime; - }); - break; - case INFORMATION_TYPE_GUESTS_FAVOURITE: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.guests_favourite <= otherRide.guests_favourite; - }); - break; - case INFORMATION_TYPE_EXCITEMENT: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.excitement <= otherRide.excitement; - }); - break; - case INFORMATION_TYPE_INTENSITY: - SortListByPredicate([](const Ride& thisRide, const Ride& otherRide) -> bool { - return thisRide.intensity <= otherRide.intensity; - }); - break; - case INFORMATION_TYPE_NAUSEA: - SortListByPredicate( - [](const Ride& thisRide, const Ride& otherRide) -> bool { return thisRide.nausea <= otherRide.nausea; }); - break; - } - - selected_list_item = -1; - Invalidate(); + return window; } - // window_ride_list_close_all - void CloseAllRides() + void WindowRideListRefreshList(WindowBase* w) { - for (auto& rideRef : GetRideManager()) - { - if (rideRef.status != RideStatus::Closed && rideRef.GetClassification() == static_cast(page)) - { - auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::Closed); - GameActions::Execute(&gameAction); - } - } + dynamic_cast(w)->RefreshListWrapper(); } - - // window_ride_list_open_all - void OpenAllRides() - { - for (auto& rideRef : GetRideManager()) - { - if (rideRef.status != RideStatus::Open && rideRef.GetClassification() == static_cast(page)) - { - auto gameAction = RideSetStatusAction(rideRef.id, RideStatus::Open); - GameActions::Execute(&gameAction); - } - } - } -}; - -/** - * - * rct2: 0x006B30BC - */ -WindowBase* WindowRideListOpen() -{ - // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::RideList); - if (window == nullptr) - { - window = WindowCreate(WindowClass::RideList, ScreenCoordsXY(32, 32), WW, WH, WF_10 | WF_RESIZABLE); - } - return window; -} - -void WindowRideListRefreshList(WindowBase* w) -{ - dynamic_cast(w)->RefreshListWrapper(); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index ffd9039d66..6171ca20c7 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -21,14 +21,14 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr int32_t WH_SAVE = 54; + static constexpr int32_t WW_SAVE = 260; + static constexpr int32_t WH_QUIT = 38; + static constexpr int32_t WW_QUIT = 177; -static constexpr int32_t WH_SAVE = 54; -static constexpr int32_t WW_SAVE = 260; -static constexpr int32_t WH_QUIT = 38; -static constexpr int32_t WW_QUIT = 177; - -// clang-format off + // clang-format off enum WindowSavePromptWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -69,184 +69,185 @@ static constexpr StringId window_save_prompt_labels[][2] = { { STR_QUIT_GAME_2_PROMPT_TITLE, STR_SAVE_BEFORE_QUITTING_2 }, { STR_NEW_GAME, STR_SAVE_BEFORE_QUITTING }, }; -// clang-format on + // clang-format on -static void WindowSavePromptCallback(int32_t result, const utf8* path) -{ - if (result == MODAL_RESULT_OK) + static void WindowSavePromptCallback(int32_t result, const utf8* path) { - GameLoadOrQuitNoSavePrompt(); + if (result == MODAL_RESULT_OK) + { + GameLoadOrQuitNoSavePrompt(); + } } -} -class SavePromptWindow final : public Window -{ -private: - PromptMode _promptMode; - -public: - SavePromptWindow(PromptMode promptMode) - : _promptMode(promptMode) - { - } - - void OnOpen() override + class SavePromptWindow final : public Window { - bool canSave = !(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)); - - widgets = canSave ? _savePromptWidgets : _quitPromptWidgets; - - InitScrollWidgets(); + private: + PromptMode _promptMode; - // Pause the game if not network play. - if (NetworkGetMode() == NETWORK_MODE_NONE) + public: + SavePromptWindow(PromptMode promptMode) + : _promptMode(promptMode) { - gGamePaused |= GAME_PAUSED_MODAL; - Audio::StopAll(); } - WindowInvalidateByClass(WindowClass::TopToolbar); - - if (canSave) + void OnOpen() override { - StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0]; - if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + bool canSave = !(gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)); + + widgets = canSave ? _savePromptWidgets : _quitPromptWidgets; + + InitScrollWidgets(); + + // Pause the game if not network play. + if (NetworkGetMode() == NETWORK_MODE_NONE) { - stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE; + gGamePaused |= GAME_PAUSED_MODAL; + Audio::StopAll(); } - else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + + WindowInvalidateByClass(WindowClass::TopToolbar); + + if (canSave) { - stringId = STR_QUIT_SCENARIO_EDITOR; + StringId stringId = window_save_prompt_labels[EnumValue(_promptMode)][0]; + if (stringId == STR_LOAD_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + stringId = STR_LOAD_LANDSCAPE_PROMPT_TITLE; + } + else if (stringId == STR_QUIT_GAME_PROMPT_TITLE && gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + stringId = STR_QUIT_SCENARIO_EDITOR; + } + widgets[WIDX_TITLE].text = stringId; + widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1]; } - widgets[WIDX_TITLE].text = stringId; - widgets[WIDX_LABEL].text = window_save_prompt_labels[EnumValue(_promptMode)][1]; - } - } - - void OnClose() override - { - // Unpause the game - if (NetworkGetMode() == NETWORK_MODE_NONE) - { - gGamePaused &= ~GAME_PAUSED_MODAL; - Audio::Resume(); } - WindowInvalidateByClass(WindowClass::TopToolbar); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + void OnClose() override { + // Unpause the game + if (NetworkGetMode() == NETWORK_MODE_NONE) + { + gGamePaused &= ~GAME_PAUSED_MODAL; + Audio::Resume(); + } + + WindowInvalidateByClass(WindowClass::TopToolbar); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + if (gScreenFlags & (SCREEN_FLAGS_TITLE_DEMO | SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + { + switch (widgetIndex) + { + case WQIDX_OK: + GameLoadOrQuitNoSavePrompt(); + break; + case WQIDX_CLOSE: + case WQIDX_CANCEL: + Close(); + break; + } + return; + } + switch (widgetIndex) { - case WQIDX_OK: - GameLoadOrQuitNoSavePrompt(); - break; - case WQIDX_CLOSE: - case WQIDX_CANCEL: + case WIDX_SAVE: + { + std::unique_ptr intent; + + if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) + { + intent = std::make_unique(WindowClass::Loadsave); + intent->PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent->PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName); + } + else + { + intent = CreateSaveGameAsIntent(); + } Close(); + intent->PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(WindowSavePromptCallback)); + ContextOpenIntent(intent.get()); break; + } + case WIDX_DONT_SAVE: + GameLoadOrQuitNoSavePrompt(); + return; + case WIDX_CLOSE: + case WIDX_CANCEL: + Close(); + return; } - return; } - switch (widgetIndex) + void OnDraw(DrawPixelInfo& dpi) override { - case WIDX_SAVE: - { - std::unique_ptr intent; - - if (gScreenFlags & (SCREEN_FLAGS_EDITOR)) - { - intent = std::make_unique(WindowClass::Loadsave); - intent->PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent->PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName); - } - else - { - intent = CreateSaveGameAsIntent(); - } - Close(); - intent->PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(WindowSavePromptCallback)); - ContextOpenIntent(intent.get()); - break; - } - case WIDX_DONT_SAVE: - GameLoadOrQuitNoSavePrompt(); - return; - case WIDX_CLOSE: - case WIDX_CANCEL: - Close(); - return; + DrawWidgets(dpi); } - } - void OnDraw(DrawPixelInfo& dpi) override + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowSavePromptOpen() { - DrawWidgets(dpi); - } + PromptMode prompt_mode = gSavePromptMode; + if (prompt_mode == PromptMode::Quit) + { + prompt_mode = PromptMode::SaveBeforeQuit; + } - void OnResize() override - { - ResizeFrame(); - } -}; - -WindowBase* WindowSavePromptOpen() -{ - PromptMode prompt_mode = gSavePromptMode; - if (prompt_mode == PromptMode::Quit) - { - prompt_mode = PromptMode::SaveBeforeQuit; - } - - // do not show save prompt if we're in the title demo and click on load game - if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) - { - GameLoadOrQuitNoSavePrompt(); - return nullptr; - } - - if (!gConfigGeneral.ConfirmationPrompt) - { - /* game_load_or_quit_no_save_prompt() will exec requested task and close this window - * immediately again. - * TODO restructure these functions when we're sure game_load_or_quit_no_save_prompt() - * and game_load_or_quit() are not called by the original binary anymore. - */ - - if (gScreenAge < 3840 && NetworkGetMode() == NETWORK_MODE_NONE) + // do not show save prompt if we're in the title demo and click on load game + if (gScreenFlags & SCREEN_FLAGS_TITLE_DEMO) { GameLoadOrQuitNoSavePrompt(); return nullptr; } - } - // Check if window is already open - WindowBase* window = WindowBringToFrontByClass(WindowClass::SavePrompt); - if (window != nullptr) - { - WindowClose(*window); - } + if (!gConfigGeneral.ConfirmationPrompt) + { + /* game_load_or_quit_no_save_prompt() will exec requested task and close this window + * immediately again. + * TODO restructure these functions when we're sure game_load_or_quit_no_save_prompt() + * and game_load_or_quit() are not called by the original binary anymore. + */ - if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels)) - { - LOG_WARNING("Invalid save prompt mode %u", prompt_mode); - return nullptr; - } + if (gScreenAge < 3840 && NetworkGetMode() == NETWORK_MODE_NONE) + { + GameLoadOrQuitNoSavePrompt(); + return nullptr; + } + } - int32_t width = WW_SAVE; - int32_t height = WH_SAVE; - if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - { - width = WW_QUIT; - height = WH_QUIT; - } + // Check if window is already open + WindowBase* window = WindowBringToFrontByClass(WindowClass::SavePrompt); + if (window != nullptr) + { + WindowClose(*window); + } - auto savePromptWindow = std::make_unique(prompt_mode); - return WindowCreate( - std::move(savePromptWindow), WindowClass::SavePrompt, {}, width, height, - WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); -} + if (EnumValue(prompt_mode) >= std::size(window_save_prompt_labels)) + { + LOG_WARNING("Invalid save prompt mode %u", prompt_mode); + return nullptr; + } + + int32_t width = WW_SAVE; + int32_t height = WH_SAVE; + if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + { + width = WW_QUIT; + height = WH_QUIT; + } + + auto savePromptWindow = std::make_unique(prompt_mode); + return WindowCreate( + std::move(savePromptWindow), WindowClass::SavePrompt, {}, width, height, + WF_TRANSPARENT | WF_STICK_TO_FRONT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 6a13c831e3..795a87fda5 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -28,68 +28,70 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_SELECT_SCENARIO; -static constexpr int32_t WW = 734; -static constexpr int32_t WH = 384; -static constexpr int32_t SidebarWidth = 180; -static constexpr int32_t TabWidth = 92; -static constexpr int32_t TabHeight = 34; -static constexpr int32_t TrueFontSize = 24; -static constexpr int32_t WidgetsStart = 17; -static constexpr int32_t TabsStart = WidgetsStart; -static constexpr int32_t InitialNumUnlockedScenarios = 5; -constexpr uint8_t NumTabs = 10; - -enum class ListItemType : uint8_t +namespace OpenRCT2::Ui::Windows { - Heading, - Scenario, -}; + static constexpr StringId WINDOW_TITLE = STR_SELECT_SCENARIO; + static constexpr int32_t WW = 734; + static constexpr int32_t WH = 384; + static constexpr int32_t SidebarWidth = 180; + static constexpr int32_t TabWidth = 92; + static constexpr int32_t TabHeight = 34; + static constexpr int32_t TrueFontSize = 24; + static constexpr int32_t WidgetsStart = 17; + static constexpr int32_t TabsStart = WidgetsStart; + static constexpr int32_t InitialNumUnlockedScenarios = 5; + constexpr uint8_t NumTabs = 10; -struct ScenarioListItem -{ - ListItemType type; - union + enum class ListItemType : uint8_t { - struct - { - StringId string_id; - } heading; - struct - { - const ScenarioIndexEntry* scenario; - bool is_locked; - } scenario; + Heading, + Scenario, }; -}; -enum -{ - WIDX_BACKGROUND, - WIDX_TITLEBAR, - WIDX_CLOSE, - WIDX_TABCONTENT, - WIDX_TAB1, - WIDX_TAB2, - WIDX_TAB3, - WIDX_TAB4, - WIDX_TAB5, - WIDX_TAB6, - WIDX_TAB7, - WIDX_TAB8, - WIDX_TAB9, - WIDX_TAB10, - WIDX_SCENARIOLIST -}; + struct ScenarioListItem + { + ListItemType type; + union + { + struct + { + StringId string_id; + } heading; + struct + { + const ScenarioIndexEntry* scenario; + bool is_locked; + } scenario; + }; + }; -static constexpr StringId kScenarioOriginStringIds[] = { - STR_SCENARIO_CATEGORY_RCT1, STR_SCENARIO_CATEGORY_RCT1_AA, STR_SCENARIO_CATEGORY_RCT1_LL, - STR_SCENARIO_CATEGORY_RCT2, STR_SCENARIO_CATEGORY_RCT2_WW, STR_SCENARIO_CATEGORY_RCT2_TT, - STR_SCENARIO_CATEGORY_UCES, STR_SCENARIO_CATEGORY_REAL_PARKS, STR_SCENARIO_CATEGORY_EXTRAS_PARKS, - STR_SCENARIO_CATEGORY_OTHER_PARKS, -}; + enum + { + WIDX_BACKGROUND, + WIDX_TITLEBAR, + WIDX_CLOSE, + WIDX_TABCONTENT, + WIDX_TAB1, + WIDX_TAB2, + WIDX_TAB3, + WIDX_TAB4, + WIDX_TAB5, + WIDX_TAB6, + WIDX_TAB7, + WIDX_TAB8, + WIDX_TAB9, + WIDX_TAB10, + WIDX_SCENARIOLIST + }; -// clang-format off + static constexpr StringId kScenarioOriginStringIds[] = { + STR_SCENARIO_CATEGORY_RCT1, STR_SCENARIO_CATEGORY_RCT1_AA, STR_SCENARIO_CATEGORY_RCT1_LL, + STR_SCENARIO_CATEGORY_RCT2, STR_SCENARIO_CATEGORY_RCT2_WW, STR_SCENARIO_CATEGORY_RCT2_TT, + STR_SCENARIO_CATEGORY_UCES, STR_SCENARIO_CATEGORY_REAL_PARKS, STR_SCENARIO_CATEGORY_EXTRAS_PARKS, + STR_SCENARIO_CATEGORY_OTHER_PARKS, + }; + + // clang-format off static Widget _scenarioSelectWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ TabWidth + 1, WidgetsStart }, { WW, 284 }, WindowWidgetType::Resize, WindowColour::Secondary), // tab content panel @@ -106,674 +108,677 @@ static Widget _scenarioSelectWidgets[] = { MakeWidget({ TabWidth + 3, WidgetsStart + 1 }, { WW - SidebarWidth, 362 }, WindowWidgetType::Scroll, WindowColour::Secondary, SCROLL_VERTICAL), // level list kWidgetsEnd, }; -// clang-format on + // clang-format on -class ScenarioSelectWindow final : public Window -{ -private: - bool _showLockedInformation = false; - std::function _callback; - std::vector _listItems; - const ScenarioIndexEntry* _highlightedScenario = nullptr; - -public: - ScenarioSelectWindow(std::function callback) - : _callback(callback) + class ScenarioSelectWindow final : public Window { - } + private: + bool _showLockedInformation = false; + std::function _callback; + std::vector _listItems; + const ScenarioIndexEntry* _highlightedScenario = nullptr; - void OnOpen() override - { - // Load scenario list - ScenarioRepositoryScan(); - - widgets = _scenarioSelectWidgets; - _highlightedScenario = nullptr; - InitTabs(); - InitialiseListItems(); - InitScrollWidgets(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - if (widgetIndex == WIDX_CLOSE) + public: + ScenarioSelectWindow(std::function callback) + : _callback(callback) { - Close(); } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB10) + void OnOpen() override { - selected_tab = widgetIndex - 4; + // Load scenario list + ScenarioRepositoryScan(); + + widgets = _scenarioSelectWidgets; _highlightedScenario = nullptr; - gConfigInterface.ScenarioselectLastTab = selected_tab; - ConfigSaveDefault(); + InitTabs(); InitialiseListItems(); - Invalidate(); - OnResize(); - OnPrepareDraw(); InitScrollWidgets(); - Invalidate(); } - } - void OnDraw(DrawPixelInfo& dpi) override - { - int32_t format; - const ScenarioIndexEntry* scenario; - - DrawWidgets(dpi); - - format = ScenarioSelectUseSmallFont() ? STR_SMALL_WINDOW_COLOUR_2_STRINGID : STR_WINDOW_COLOUR_2_STRINGID; - FontStyle fontStyle = ScenarioSelectUseSmallFont() ? FontStyle::Small : FontStyle::Medium; - - // Text for each tab - for (uint32_t i = 0; i < std::size(kScenarioOriginStringIds); i++) + void OnMouseUp(WidgetIndex widgetIndex) override { - const Widget& widget = widgets[WIDX_TAB1 + i]; - if (widget.type == WindowWidgetType::Empty) - continue; - - auto ft = Formatter(); - if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) + if (widgetIndex == WIDX_CLOSE) { - ft.Add(kScenarioOriginStringIds[i]); - } - else - { // old-style - ft.Add(ScenarioCategoryStringIds[i]); - } - - auto stringCoords = windowPos + ScreenCoordsXY{ widget.midX(), widget.midY() - 3 }; - DrawTextWrapped(dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE }); - } - - // Return if no scenario highlighted - scenario = _highlightedScenario; - if (scenario == nullptr) - { - if (_showLockedInformation) - { - // Show locked information - auto screenPos = windowPos - + ScreenCoordsXY{ widgets[WIDX_SCENARIOLIST].right + 4, widgets[WIDX_TABCONTENT].top + 5 }; - DrawTextEllipsised( - dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, { TextAlignment::CENTRE }); - - DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC); - } - else - { - // Show general information about how to start. - auto screenPos = windowPos - + ScreenCoordsXY{ widgets[WIDX_SCENARIOLIST].right + 4, widgets[WIDX_TABCONTENT].top + 5 }; - - DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_HOVER_HINT); - } - return; - } - - // Scenario path - if (gConfigGeneral.DebuggingTools) - { - const auto shortPath = ShortenPath(scenario->Path, width - 6 - TabWidth, FontStyle::Medium); - - auto ft = Formatter(); - ft.Add(shortPath.c_str()); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ TabWidth + 3, height - 3 - 11 }, STR_STRING, ft, { colours[1] }); - } - - // Scenario name - auto screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_SCENARIOLIST].right + 4, widgets[WIDX_TABCONTENT].top + 5 }; - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(scenario->Name); - DrawTextEllipsised( - dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); - screenPos.y += 15; - - // Scenario details - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(scenario->Details); - screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5; - - // Scenario objective - ft = Formatter(); - ft.Add(ObjectiveNames[scenario->ObjectiveType]); - if (scenario->ObjectiveType == OBJECTIVE_BUILD_THE_BEST) - { - StringId rideTypeString = STR_NONE; - auto rideTypeId = scenario->ObjectiveArg3; - if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) - { - rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; - } - ft.Add(rideTypeString); - } - else - { - ft.Add(scenario->ObjectiveArg3); - ft.Add(DateGetTotalMonths(MONTH_OCTOBER, scenario->ObjectiveArg1)); - if (scenario->ObjectiveType == OBJECTIVE_FINISH_5_ROLLERCOASTERS) - ft.Add(scenario->ObjectiveArg2); - else - ft.Add(scenario->ObjectiveArg2); - } - screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5; - - // Scenario score - if (scenario->Highscore != nullptr) - { - // TODO: Should probably be translatable - u8string completedByName = "???"; - if (!scenario->Highscore->name.empty()) - { - completedByName = scenario->Highscore->name; - } - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(completedByName.c_str()); - ft.Add(scenario->Highscore->company_value); - screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft); - } - } - - void OnPrepareDraw() override - { - pressed_widgets &= ~( - (1uLL << WIDX_CLOSE) | (1uLL << WIDX_TAB1) | (1uLL << WIDX_TAB2) | (1uLL << WIDX_TAB3) | (1uLL << WIDX_TAB4) - | (1uLL << WIDX_TAB5) | (1uLL << WIDX_TAB6) | (1uLL << WIDX_TAB7) | (1uLL << WIDX_TAB8) | (1uLL << WIDX_TAB9) - | (1uLL << WIDX_TAB10)); - - pressed_widgets |= 1LL << (selected_tab + WIDX_TAB1); - - ResizeFrameWithPage(); - const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? 17 : 5; - widgets[WIDX_SCENARIOLIST].right = width - 179; - widgets[WIDX_SCENARIOLIST].bottom = height - bottomMargin; - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - const int32_t scenarioItemHeight = GetScenarioListItemSize(); - - int32_t y = 0; - for (const auto& listItem : _listItems) - { - switch (listItem.type) - { - case ListItemType::Heading: - y += 18; - break; - case ListItemType::Scenario: - y += scenarioItemHeight; - break; + Close(); } } - return { WW, y }; - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - const int32_t scenarioItemHeight = GetScenarioListItemSize(); - - bool originalShowLockedInformation = _showLockedInformation; - _showLockedInformation = false; - const ScenarioIndexEntry* selected = nullptr; - auto mutableScreenCoords = screenCoords; - for (const auto& listItem : _listItems) + void OnMouseDown(WidgetIndex widgetIndex) override { - switch (listItem.type) + if (widgetIndex >= WIDX_TAB1 && widgetIndex <= WIDX_TAB10) { - case ListItemType::Heading: - mutableScreenCoords.y -= 18; - break; - case ListItemType::Scenario: - mutableScreenCoords.y -= scenarioItemHeight; - if (mutableScreenCoords.y < 0) - { - if (listItem.scenario.is_locked) - { - _showLockedInformation = true; - } - else - { - selected = listItem.scenario.scenario; - } - } - break; - } - if (mutableScreenCoords.y < 0) - { - break; + selected_tab = widgetIndex - 4; + _highlightedScenario = nullptr; + gConfigInterface.ScenarioselectLastTab = selected_tab; + ConfigSaveDefault(); + InitialiseListItems(); + Invalidate(); + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + Invalidate(); } } - if (_highlightedScenario != selected) + void OnDraw(DrawPixelInfo& dpi) override { - _highlightedScenario = selected; - Invalidate(); - } - else if (_showLockedInformation != originalShowLockedInformation) - { - Invalidate(); - } - } + int32_t format; + const ScenarioIndexEntry* scenario; - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - const int32_t scenarioItemHeight = GetScenarioListItemSize(); + DrawWidgets(dpi); - auto mutableScreenCoords = screenCoords; - for (const auto& listItem : _listItems) - { - switch (listItem.type) + format = ScenarioSelectUseSmallFont() ? STR_SMALL_WINDOW_COLOUR_2_STRINGID : STR_WINDOW_COLOUR_2_STRINGID; + FontStyle fontStyle = ScenarioSelectUseSmallFont() ? FontStyle::Small : FontStyle::Medium; + + // Text for each tab + for (uint32_t i = 0; i < std::size(kScenarioOriginStringIds); i++) { - case ListItemType::Heading: - mutableScreenCoords.y -= 18; - break; - case ListItemType::Scenario: - mutableScreenCoords.y -= scenarioItemHeight; - if (mutableScreenCoords.y < 0 && !listItem.scenario.is_locked) - { - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); - gFirstTimeSaving = true; - // Callback will likely close this window! So should always return after it. - _callback(listItem.scenario.scenario->Path); - return; - } - break; - } - if (mutableScreenCoords.y < 0) - { - break; - } - } - } + const Widget& widget = widgets[WIDX_TAB1 + i]; + if (widget.type == WindowWidgetType::Empty) + continue; - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); - - StringId highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; - StringId unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING; - - const auto& listWidget = widgets[WIDX_SCENARIOLIST]; - int32_t listWidth = listWidget.width() - 12; - - const int32_t scenarioItemHeight = GetScenarioListItemSize(); - - // Scenario title - int32_t scenarioTitleHeight = FontGetLineHeight(FontStyle::Medium); - - int32_t y = 0; - for (const auto& listItem : _listItems) - { - if (y > dpi.y + dpi.height) - { - continue; - } - - switch (listItem.type) - { - case ListItemType::Heading: + auto ft = Formatter(); + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) { - const int32_t horizontalRuleMargin = 4; - DrawCategoryHeading( - dpi, horizontalRuleMargin, listWidth - horizontalRuleMargin, y + 2, listItem.heading.string_id); - y += 18; - break; + ft.Add(kScenarioOriginStringIds[i]); } - case ListItemType::Scenario: - { - // Draw hover highlight - const ScenarioIndexEntry* scenario = listItem.scenario.scenario; - bool isHighlighted = _highlightedScenario == scenario; - if (isHighlighted) - { - GfxFilterRect(dpi, { 0, y, width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1); - } - - bool isCompleted = scenario->Highscore != nullptr; - bool isDisabled = listItem.scenario.is_locked; - - // Draw scenario name - char buffer[64]; - SafeStrCpy(buffer, scenario->Name, sizeof(buffer)); - StringId format = isDisabled ? static_cast(STR_STRINGID) - : (isHighlighted ? highlighted_format : unhighlighted_format); - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(buffer); - colour_t colour = isDisabled ? colours[1] | COLOUR_FLAG_INSET : COLOUR_BLACK; - auto darkness = isDisabled ? TextDarkness::Dark : TextDarkness::Regular; - const auto scrollCentre = widgets[WIDX_SCENARIOLIST].width() / 2; - - DrawTextBasic( - dpi, { scrollCentre, y + 1 }, format, ft, - { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness }); - - // Check if scenario is completed - if (isCompleted) - { - // Draw completion tick - GfxDrawSprite(dpi, ImageId(SPR_MENU_CHECKMARK), { widgets[WIDX_SCENARIOLIST].width() - 45, y + 1 }); - - // Draw completion score - u8string completedByName = "???"; - if (!scenario->Highscore->name.empty()) - { - completedByName = scenario->Highscore->name; - } - ft = Formatter(); - ft.Add(STR_COMPLETED_BY); - ft.Add(STR_STRING); - ft.Add(completedByName.c_str()); - DrawTextBasic( - dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft, - { FontStyle::Small, TextAlignment::CENTRE }); - } - - y += scenarioItemHeight; - break; + else + { // old-style + ft.Add(ScenarioCategoryStringIds[i]); } - } - } - } -private: - void DrawCategoryHeading(DrawPixelInfo& dpi, int32_t left, int32_t right, int32_t y, StringId stringId) const - { - colour_t baseColour = colours[1]; - colour_t lightColour = ColourMapA[baseColour].lighter; - colour_t darkColour = ColourMapA[baseColour].mid_dark; - - // Draw string - int32_t centreX = (left + right) / 2; - DrawTextBasic(dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE }); - - // Get string dimensions - utf8 buffer[CommonTextBufferSize]; - auto bufferPtr = buffer; - OpenRCT2::FormatStringLegacy(bufferPtr, sizeof(buffer), stringId, nullptr); - int32_t categoryStringHalfWidth = (GfxGetStringWidth(bufferPtr, FontStyle::Medium) / 2) + 4; - int32_t strLeft = centreX - categoryStringHalfWidth; - int32_t strRight = centreX + categoryStringHalfWidth; - - // Draw light horizontal rule - int32_t lineY = y + 4; - auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY }; - auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY }; - GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour); - - auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY }; - auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY }; - GfxDrawLine(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour); - - // Draw dark horizontal rule - lineY++; - auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY }; - auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY }; - GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour); - - auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY }; - auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY }; - GfxDrawLine(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour); - } - - void InitialiseListItems() - { - size_t numScenarios = ScenarioRepositoryGetCount(); - _listItems.clear(); - - // Mega park unlock - const uint32_t rct1RequiredCompletedScenarios = (1 << SC_MEGA_PARK) - 1; - uint32_t rct1CompletedScenarios = 0; - std::optional megaParkListItemIndex = std::nullopt; - - int32_t numUnlocks = InitialNumUnlockedScenarios; - uint8_t currentHeading = UINT8_MAX; - for (size_t i = 0; i < numScenarios; i++) - { - const ScenarioIndexEntry* scenario = ScenarioRepositoryGetByIndex(i); - - if (!IsScenarioVisible(*scenario)) - continue; - - // Category heading - StringId headingStringId = STR_NONE; - if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) - { - if (selected_tab != static_cast(ScenarioSource::Real) && currentHeading != scenario->Category) - { - currentHeading = scenario->Category; - headingStringId = ScenarioCategoryStringIds[currentHeading]; - } - } - else - { - if (selected_tab <= SCENARIO_CATEGORY_EXPERT) - { - if (currentHeading != static_cast(scenario->SourceGame)) - { - currentHeading = static_cast(scenario->SourceGame); - headingStringId = kScenarioOriginStringIds[currentHeading]; - } - } - else if (selected_tab == SCENARIO_CATEGORY_OTHER) - { - int32_t category = scenario->Category; - if (category <= SCENARIO_CATEGORY_REAL) - { - category = SCENARIO_CATEGORY_OTHER; - } - if (currentHeading != category) - { - currentHeading = category; - headingStringId = ScenarioCategoryStringIds[category]; - } - } + auto stringCoords = windowPos + ScreenCoordsXY{ widget.midX(), widget.midY() - 3 }; + DrawTextWrapped(dpi, stringCoords, 87, format, ft, { COLOUR_AQUAMARINE, fontStyle, TextAlignment::CENTRE }); } - if (headingStringId != STR_NONE) + // Return if no scenario highlighted + scenario = _highlightedScenario; + if (scenario == nullptr) { - ScenarioListItem headerItem; - headerItem.type = ListItemType::Heading; - headerItem.heading.string_id = headingStringId; - _listItems.push_back(std::move(headerItem)); - } - - // Scenario - ScenarioListItem scenarioItem; - scenarioItem.type = ListItemType::Scenario; - scenarioItem.scenario.scenario = scenario; - if (IsLockingEnabled()) - { - scenarioItem.scenario.is_locked = numUnlocks <= 0; - if (scenario->Highscore == nullptr) + if (_showLockedInformation) { - numUnlocks--; + // Show locked information + auto screenPos = windowPos + + ScreenCoordsXY{ widgets[WIDX_SCENARIOLIST].right + 4, widgets[WIDX_TABCONTENT].top + 5 }; + DrawTextEllipsised( + dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_SCENARIO_LOCKED, {}, { TextAlignment::CENTRE }); + + DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_LOCKED_DESC); } else { - // Mark RCT1 scenario as completed - if (scenario->ScenarioId < SC_MEGA_PARK) - { - rct1CompletedScenarios |= 1 << scenario->ScenarioId; - } - } + // Show general information about how to start. + auto screenPos = windowPos + + ScreenCoordsXY{ widgets[WIDX_SCENARIOLIST].right + 4, widgets[WIDX_TABCONTENT].top + 5 }; - // If scenario is Mega Park, keep a reference to it - if (scenario->ScenarioId == SC_MEGA_PARK) - { - megaParkListItemIndex = _listItems.size() - 1; + DrawTextWrapped(dpi, screenPos + ScreenCoordsXY{ 0, 15 }, 170, STR_SCENARIO_HOVER_HINT); } + return; + } + + // Scenario path + if (gConfigGeneral.DebuggingTools) + { + const auto shortPath = ShortenPath(scenario->Path, width - 6 - TabWidth, FontStyle::Medium); + + auto ft = Formatter(); + ft.Add(shortPath.c_str()); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ TabWidth + 3, height - 3 - 11 }, STR_STRING, ft, { colours[1] }); + } + + // Scenario name + auto screenPos = windowPos + + ScreenCoordsXY{ widgets[WIDX_SCENARIOLIST].right + 4, widgets[WIDX_TABCONTENT].top + 5 }; + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(scenario->Name); + DrawTextEllipsised( + dpi, screenPos + ScreenCoordsXY{ 85, 0 }, 170, STR_WINDOW_COLOUR_2_STRINGID, ft, { TextAlignment::CENTRE }); + screenPos.y += 15; + + // Scenario details + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(scenario->Details); + screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5; + + // Scenario objective + ft = Formatter(); + ft.Add(ObjectiveNames[scenario->ObjectiveType]); + if (scenario->ObjectiveType == OBJECTIVE_BUILD_THE_BEST) + { + StringId rideTypeString = STR_NONE; + auto rideTypeId = scenario->ObjectiveArg3; + if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) + { + rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; + } + ft.Add(rideTypeString); } else { - scenarioItem.scenario.is_locked = false; + ft.Add(scenario->ObjectiveArg3); + ft.Add(DateGetTotalMonths(MONTH_OCTOBER, scenario->ObjectiveArg1)); + if (scenario->ObjectiveType == OBJECTIVE_FINISH_5_ROLLERCOASTERS) + ft.Add(scenario->ObjectiveArg2); + else + ft.Add(scenario->ObjectiveArg2); + } + screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5; + + // Scenario score + if (scenario->Highscore != nullptr) + { + // TODO: Should probably be translatable + u8string completedByName = "???"; + if (!scenario->Highscore->name.empty()) + { + completedByName = scenario->Highscore->name; + } + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(completedByName.c_str()); + ft.Add(scenario->Highscore->company_value); + screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_COMPLETED_BY_WITH_COMPANY_VALUE, ft); } - _listItems.push_back(std::move(scenarioItem)); } - // Mega park handling - if (megaParkListItemIndex.has_value()) + void OnPrepareDraw() override { - bool megaParkLocked = (rct1CompletedScenarios & rct1RequiredCompletedScenarios) != rct1RequiredCompletedScenarios; - _listItems[megaParkListItemIndex.value()].scenario.is_locked = megaParkLocked; - if (megaParkLocked && gConfigGeneral.ScenarioHideMegaPark) - { - // Remove mega park - _listItems.pop_back(); + pressed_widgets &= ~( + (1uLL << WIDX_CLOSE) | (1uLL << WIDX_TAB1) | (1uLL << WIDX_TAB2) | (1uLL << WIDX_TAB3) | (1uLL << WIDX_TAB4) + | (1uLL << WIDX_TAB5) | (1uLL << WIDX_TAB6) | (1uLL << WIDX_TAB7) | (1uLL << WIDX_TAB8) | (1uLL << WIDX_TAB9) + | (1uLL << WIDX_TAB10)); - // Remove empty headings - for (auto it = _listItems.begin(); it != _listItems.end();) + pressed_widgets |= 1LL << (selected_tab + WIDX_TAB1); + + ResizeFrameWithPage(); + const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? 17 : 5; + widgets[WIDX_SCENARIOLIST].right = width - 179; + widgets[WIDX_SCENARIOLIST].bottom = height - bottomMargin; + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + const int32_t scenarioItemHeight = GetScenarioListItemSize(); + + int32_t y = 0; + for (const auto& listItem : _listItems) + { + switch (listItem.type) { - const auto& listItem = *it; - if (listItem.type == ListItemType::Heading) - { - auto nextIt = std::next(it); - if (nextIt == _listItems.end() || nextIt->type == ListItemType::Heading) + case ListItemType::Heading: + y += 18; + break; + case ListItemType::Scenario: + y += scenarioItemHeight; + break; + } + } + + return { WW, y }; + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + const int32_t scenarioItemHeight = GetScenarioListItemSize(); + + bool originalShowLockedInformation = _showLockedInformation; + _showLockedInformation = false; + const ScenarioIndexEntry* selected = nullptr; + auto mutableScreenCoords = screenCoords; + for (const auto& listItem : _listItems) + { + switch (listItem.type) + { + case ListItemType::Heading: + mutableScreenCoords.y -= 18; + break; + case ListItemType::Scenario: + mutableScreenCoords.y -= scenarioItemHeight; + if (mutableScreenCoords.y < 0) { - it = _listItems.erase(it); - continue; + if (listItem.scenario.is_locked) + { + _showLockedInformation = true; + } + else + { + selected = listItem.scenario.scenario; + } + } + break; + } + if (mutableScreenCoords.y < 0) + { + break; + } + } + + if (_highlightedScenario != selected) + { + _highlightedScenario = selected; + Invalidate(); + } + else if (_showLockedInformation != originalShowLockedInformation) + { + Invalidate(); + } + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + const int32_t scenarioItemHeight = GetScenarioListItemSize(); + + auto mutableScreenCoords = screenCoords; + for (const auto& listItem : _listItems) + { + switch (listItem.type) + { + case ListItemType::Heading: + mutableScreenCoords.y -= 18; + break; + case ListItemType::Scenario: + mutableScreenCoords.y -= scenarioItemHeight; + if (mutableScreenCoords.y < 0 && !listItem.scenario.is_locked) + { + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); + gFirstTimeSaving = true; + // Callback will likely close this window! So should always return after it. + _callback(listItem.scenario.scenario->Path); + return; + } + break; + } + if (mutableScreenCoords.y < 0) + { + break; + } + } + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; + GfxClear(&dpi, paletteIndex); + + StringId highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; + StringId unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING; + + const auto& listWidget = widgets[WIDX_SCENARIOLIST]; + int32_t listWidth = listWidget.width() - 12; + + const int32_t scenarioItemHeight = GetScenarioListItemSize(); + + // Scenario title + int32_t scenarioTitleHeight = FontGetLineHeight(FontStyle::Medium); + + int32_t y = 0; + for (const auto& listItem : _listItems) + { + if (y > dpi.y + dpi.height) + { + continue; + } + + switch (listItem.type) + { + case ListItemType::Heading: + { + const int32_t horizontalRuleMargin = 4; + DrawCategoryHeading( + dpi, horizontalRuleMargin, listWidth - horizontalRuleMargin, y + 2, listItem.heading.string_id); + y += 18; + break; + } + case ListItemType::Scenario: + { + // Draw hover highlight + const ScenarioIndexEntry* scenario = listItem.scenario.scenario; + bool isHighlighted = _highlightedScenario == scenario; + if (isHighlighted) + { + GfxFilterRect(dpi, { 0, y, width, y + scenarioItemHeight - 1 }, FilterPaletteID::PaletteDarken1); + } + + bool isCompleted = scenario->Highscore != nullptr; + bool isDisabled = listItem.scenario.is_locked; + + // Draw scenario name + char buffer[64]; + SafeStrCpy(buffer, scenario->Name, sizeof(buffer)); + StringId format = isDisabled ? static_cast(STR_STRINGID) + : (isHighlighted ? highlighted_format : unhighlighted_format); + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(buffer); + colour_t colour = isDisabled ? colours[1] | COLOUR_FLAG_INSET : COLOUR_BLACK; + auto darkness = isDisabled ? TextDarkness::Dark : TextDarkness::Regular; + const auto scrollCentre = widgets[WIDX_SCENARIOLIST].width() / 2; + + DrawTextBasic( + dpi, { scrollCentre, y + 1 }, format, ft, + { colour, FontStyle::Medium, TextAlignment::CENTRE, darkness }); + + // Check if scenario is completed + if (isCompleted) + { + // Draw completion tick + GfxDrawSprite(dpi, ImageId(SPR_MENU_CHECKMARK), { widgets[WIDX_SCENARIOLIST].width() - 45, y + 1 }); + + // Draw completion score + u8string completedByName = "???"; + if (!scenario->Highscore->name.empty()) + { + completedByName = scenario->Highscore->name; + } + ft = Formatter(); + ft.Add(STR_COMPLETED_BY); + ft.Add(STR_STRING); + ft.Add(completedByName.c_str()); + DrawTextBasic( + dpi, { scrollCentre, y + scenarioTitleHeight + 1 }, format, ft, + { FontStyle::Small, TextAlignment::CENTRE }); + } + + y += scenarioItemHeight; + break; + } + } + } + } + + private: + void DrawCategoryHeading(DrawPixelInfo& dpi, int32_t left, int32_t right, int32_t y, StringId stringId) const + { + colour_t baseColour = colours[1]; + colour_t lightColour = ColourMapA[baseColour].lighter; + colour_t darkColour = ColourMapA[baseColour].mid_dark; + + // Draw string + int32_t centreX = (left + right) / 2; + DrawTextBasic(dpi, { centreX, y }, stringId, {}, { baseColour, TextAlignment::CENTRE }); + + // Get string dimensions + utf8 buffer[CommonTextBufferSize]; + auto bufferPtr = buffer; + OpenRCT2::FormatStringLegacy(bufferPtr, sizeof(buffer), stringId, nullptr); + int32_t categoryStringHalfWidth = (GfxGetStringWidth(bufferPtr, FontStyle::Medium) / 2) + 4; + int32_t strLeft = centreX - categoryStringHalfWidth; + int32_t strRight = centreX + categoryStringHalfWidth; + + // Draw light horizontal rule + int32_t lineY = y + 4; + auto lightLineLeftTop1 = ScreenCoordsXY{ left, lineY }; + auto lightLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY }; + GfxDrawLine(dpi, { lightLineLeftTop1, lightLineRightBottom1 }, lightColour); + + auto lightLineLeftTop2 = ScreenCoordsXY{ strRight, lineY }; + auto lightLineRightBottom2 = ScreenCoordsXY{ right, lineY }; + GfxDrawLine(dpi, { lightLineLeftTop2, lightLineRightBottom2 }, lightColour); + + // Draw dark horizontal rule + lineY++; + auto darkLineLeftTop1 = ScreenCoordsXY{ left, lineY }; + auto darkLineRightBottom1 = ScreenCoordsXY{ strLeft, lineY }; + GfxDrawLine(dpi, { darkLineLeftTop1, darkLineRightBottom1 }, darkColour); + + auto darkLineLeftTop2 = ScreenCoordsXY{ strRight, lineY }; + auto darkLineRightBottom2 = ScreenCoordsXY{ right, lineY }; + GfxDrawLine(dpi, { darkLineLeftTop2, darkLineRightBottom2 }, darkColour); + } + + void InitialiseListItems() + { + size_t numScenarios = ScenarioRepositoryGetCount(); + _listItems.clear(); + + // Mega park unlock + const uint32_t rct1RequiredCompletedScenarios = (1 << SC_MEGA_PARK) - 1; + uint32_t rct1CompletedScenarios = 0; + std::optional megaParkListItemIndex = std::nullopt; + + int32_t numUnlocks = InitialNumUnlockedScenarios; + uint8_t currentHeading = UINT8_MAX; + for (size_t i = 0; i < numScenarios; i++) + { + const ScenarioIndexEntry* scenario = ScenarioRepositoryGetByIndex(i); + + if (!IsScenarioVisible(*scenario)) + continue; + + // Category heading + StringId headingStringId = STR_NONE; + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) + { + if (selected_tab != static_cast(ScenarioSource::Real) && currentHeading != scenario->Category) + { + currentHeading = scenario->Category; + headingStringId = ScenarioCategoryStringIds[currentHeading]; + } + } + else + { + if (selected_tab <= SCENARIO_CATEGORY_EXPERT) + { + if (currentHeading != static_cast(scenario->SourceGame)) + { + currentHeading = static_cast(scenario->SourceGame); + headingStringId = kScenarioOriginStringIds[currentHeading]; } } - ++it; + else if (selected_tab == SCENARIO_CATEGORY_OTHER) + { + int32_t category = scenario->Category; + if (category <= SCENARIO_CATEGORY_REAL) + { + category = SCENARIO_CATEGORY_OTHER; + } + if (currentHeading != category) + { + currentHeading = category; + headingStringId = ScenarioCategoryStringIds[category]; + } + } + } + + if (headingStringId != STR_NONE) + { + ScenarioListItem headerItem; + headerItem.type = ListItemType::Heading; + headerItem.heading.string_id = headingStringId; + _listItems.push_back(std::move(headerItem)); + } + + // Scenario + ScenarioListItem scenarioItem; + scenarioItem.type = ListItemType::Scenario; + scenarioItem.scenario.scenario = scenario; + if (IsLockingEnabled()) + { + scenarioItem.scenario.is_locked = numUnlocks <= 0; + if (scenario->Highscore == nullptr) + { + numUnlocks--; + } + else + { + // Mark RCT1 scenario as completed + if (scenario->ScenarioId < SC_MEGA_PARK) + { + rct1CompletedScenarios |= 1 << scenario->ScenarioId; + } + } + + // If scenario is Mega Park, keep a reference to it + if (scenario->ScenarioId == SC_MEGA_PARK) + { + megaParkListItemIndex = _listItems.size() - 1; + } + } + else + { + scenarioItem.scenario.is_locked = false; + } + _listItems.push_back(std::move(scenarioItem)); + } + + // Mega park handling + if (megaParkListItemIndex.has_value()) + { + bool megaParkLocked = (rct1CompletedScenarios & rct1RequiredCompletedScenarios) + != rct1RequiredCompletedScenarios; + _listItems[megaParkListItemIndex.value()].scenario.is_locked = megaParkLocked; + if (megaParkLocked && gConfigGeneral.ScenarioHideMegaPark) + { + // Remove mega park + _listItems.pop_back(); + + // Remove empty headings + for (auto it = _listItems.begin(); it != _listItems.end();) + { + const auto& listItem = *it; + if (listItem.type == ListItemType::Heading) + { + auto nextIt = std::next(it); + if (nextIt == _listItems.end() || nextIt->type == ListItemType::Heading) + { + it = _listItems.erase(it); + continue; + } + } + ++it; + } } } } - } - bool IsScenarioVisible(const ScenarioIndexEntry& scenario) const - { - if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) + bool IsScenarioVisible(const ScenarioIndexEntry& scenario) const { - if (static_cast(scenario.SourceGame) != selected_tab) - { - return false; - } - } - else - { - int32_t category = scenario.Category; - if (category > SCENARIO_CATEGORY_OTHER) - { - category = SCENARIO_CATEGORY_OTHER; - } - if (category != selected_tab) - { - return false; - } - } - return true; - } - - bool IsLockingEnabled() const - { - if (gConfigGeneral.ScenarioSelectMode != SCENARIO_SELECT_MODE_ORIGIN) - return false; - if (!gConfigGeneral.ScenarioUnlockingEnabled) - return false; - if (selected_tab >= 6) - return false; - - return true; - } - - void InitTabs() - { - int32_t showPages = 0; - size_t numScenarios = ScenarioRepositoryGetCount(); - for (size_t i = 0; i < numScenarios; i++) - { - const ScenarioIndexEntry* scenario = ScenarioRepositoryGetByIndex(i); if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) { - showPages |= 1 << static_cast(scenario->SourceGame); + if (static_cast(scenario.SourceGame) != selected_tab) + { + return false; + } } else { - int32_t category = scenario->Category; + int32_t category = scenario.Category; if (category > SCENARIO_CATEGORY_OTHER) { category = SCENARIO_CATEGORY_OTHER; } - showPages |= 1 << category; + if (category != selected_tab) + { + return false; + } } + return true; } - if (showPages & (1 << gConfigInterface.ScenarioselectLastTab)) + bool IsLockingEnabled() const { - selected_tab = gConfigInterface.ScenarioselectLastTab; + if (gConfigGeneral.ScenarioSelectMode != SCENARIO_SELECT_MODE_ORIGIN) + return false; + if (!gConfigGeneral.ScenarioUnlockingEnabled) + return false; + if (selected_tab >= 6) + return false; + + return true; } - else + + void InitTabs() { - int32_t firstPage = UtilBitScanForward(showPages); - if (firstPage != -1) + int32_t showPages = 0; + size_t numScenarios = ScenarioRepositoryGetCount(); + for (size_t i = 0; i < numScenarios; i++) { - selected_tab = firstPage; + const ScenarioIndexEntry* scenario = ScenarioRepositoryGetByIndex(i); + if (gConfigGeneral.ScenarioSelectMode == SCENARIO_SELECT_MODE_ORIGIN) + { + showPages |= 1 << static_cast(scenario->SourceGame); + } + else + { + int32_t category = scenario->Category; + if (category > SCENARIO_CATEGORY_OTHER) + { + category = SCENARIO_CATEGORY_OTHER; + } + showPages |= 1 << category; + } } - } - int32_t y = TabsStart; - for (int32_t i = 0; i < NumTabs; i++) - { - auto& widget = widgets[i + WIDX_TAB1]; - if (!(showPages & (1 << i))) + if (showPages & (1 << gConfigInterface.ScenarioselectLastTab)) { - widget.type = WindowWidgetType::Empty; - continue; + selected_tab = gConfigInterface.ScenarioselectLastTab; + } + else + { + int32_t firstPage = UtilBitScanForward(showPages); + if (firstPage != -1) + { + selected_tab = firstPage; + } } - widget.type = WindowWidgetType::Tab; - widget.top = y; - widget.bottom = y + (TabHeight - 1); - y += TabHeight; + int32_t y = TabsStart; + for (int32_t i = 0; i < NumTabs; i++) + { + auto& widget = widgets[i + WIDX_TAB1]; + if (!(showPages & (1 << i))) + { + widget.type = WindowWidgetType::Empty; + continue; + } + + widget.type = WindowWidgetType::Tab; + widget.top = y; + widget.bottom = y + (TabHeight - 1); + y += TabHeight; + } } + + static bool ScenarioSelectUseSmallFont() + { + return ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT; + } + + static int32_t GetScenarioListItemSize() + { + if (!LocalisationService_UseTrueTypeFont()) + return TrueFontSize; + + // Scenario title + int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); + + // 'Completed by' line + lineHeight += FontGetLineHeight(FontStyle::Small); + + return lineHeight; + } + }; + + WindowBase* WindowScenarioselectOpen(scenarioselect_callback callback) + { + return WindowScenarioselectOpen([callback](std::string_view scenario) { callback(std::string(scenario).c_str()); }); } - static bool ScenarioSelectUseSmallFont() + WindowBase* WindowScenarioselectOpen(std::function callback) { - return ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT; - } + auto* window = static_cast(WindowBringToFrontByClass(WindowClass::ScenarioSelect)); + if (window != nullptr) + { + return window; + } - static int32_t GetScenarioListItemSize() - { - if (!LocalisationService_UseTrueTypeFont()) - return TrueFontSize; - - // Scenario title - int32_t lineHeight = FontGetLineHeight(FontStyle::Medium); - - // 'Completed by' line - lineHeight += FontGetLineHeight(FontStyle::Small); - - return lineHeight; - } -}; - -WindowBase* WindowScenarioselectOpen(scenarioselect_callback callback) -{ - return WindowScenarioselectOpen([callback](std::string_view scenario) { callback(std::string(scenario).c_str()); }); -} - -WindowBase* WindowScenarioselectOpen(std::function callback) -{ - auto* window = static_cast(WindowBringToFrontByClass(WindowClass::ScenarioSelect)); - if (window != nullptr) - { + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + ScreenCoordsXY screenPos = { (screenWidth - WW) / 2, std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - WH) / 2) }; + window = WindowCreate(WindowClass::ScenarioSelect, screenPos, WW, WH, 0, callback); return window; } - - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - ScreenCoordsXY screenPos = { (screenWidth - WW) / 2, std::max(TOP_TOOLBAR_HEIGHT + 1, (screenHeight - WH) / 2) }; - window = WindowCreate(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 75250faffc..5b8f444d42 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -38,48 +38,48 @@ #include #include -using namespace OpenRCT2; - -static constexpr StringId WINDOW_TITLE = STR_NONE; -constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634; -constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 195; -constexpr int32_t SCENERY_BUTTON_WIDTH = 66; -constexpr int32_t SCENERY_BUTTON_HEIGHT = 80; -constexpr int32_t InitTabPosX = 3; -constexpr int32_t InitTabPosY = 17; -constexpr int32_t TabWidth = 31; -constexpr int32_t TabHeight = 28; -constexpr int32_t ReservedTabCount = 2; -constexpr int32_t MaxTabs = 257; // 255 selected tabs + misc + all -constexpr int32_t MaxTabsPerRow = 20; - -constexpr uint8_t SceneryContentScrollIndex = 0; - -enum WindowSceneryListWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_SCENERY_BACKGROUND, - WIDX_SCENERY_TITLE, - WIDX_SCENERY_CLOSE, - WIDX_SCENERY_TAB_CONTENT_PANEL, - WIDX_SCENERY_LIST, - WIDX_SCENERY_ROTATE_OBJECTS_BUTTON, - WIDX_SCENERY_REPAINT_SCENERY_BUTTON, - WIDX_SCENERY_PRIMARY_COLOUR_BUTTON, - WIDX_SCENERY_SECONDARY_COLOUR_BUTTON, - WIDX_SCENERY_TERTIARY_COLOUR_BUTTON, - WIDX_SCENERY_EYEDROPPER_BUTTON, - WIDX_SCENERY_BUILD_CLUSTER_BUTTON, - WIDX_FILTER_TEXT_BOX, - WIDX_FILTER_CLEAR_BUTTON, - WIDX_RESTRICT_SCENERY, - WIDX_SCENERY_TAB_1, -}; + static constexpr StringId WINDOW_TITLE = STR_NONE; + constexpr int32_t WINDOW_SCENERY_MIN_WIDTH = 634; + constexpr int32_t WINDOW_SCENERY_MIN_HEIGHT = 195; + constexpr int32_t SCENERY_BUTTON_WIDTH = 66; + constexpr int32_t SCENERY_BUTTON_HEIGHT = 80; + constexpr int32_t InitTabPosX = 3; + constexpr int32_t InitTabPosY = 17; + constexpr int32_t TabWidth = 31; + constexpr int32_t TabHeight = 28; + constexpr int32_t ReservedTabCount = 2; + constexpr int32_t MaxTabs = 257; // 255 selected tabs + misc + all + constexpr int32_t MaxTabsPerRow = 20; -validate_global_widx(WC_SCENERY, WIDX_SCENERY_TAB_1); -validate_global_widx(WC_SCENERY, WIDX_SCENERY_ROTATE_OBJECTS_BUTTON); -validate_global_widx(WC_SCENERY, WIDX_SCENERY_EYEDROPPER_BUTTON); + constexpr uint8_t SceneryContentScrollIndex = 0; -// clang-format off + enum WindowSceneryListWidgetIdx + { + WIDX_SCENERY_BACKGROUND, + WIDX_SCENERY_TITLE, + WIDX_SCENERY_CLOSE, + WIDX_SCENERY_TAB_CONTENT_PANEL, + WIDX_SCENERY_LIST, + WIDX_SCENERY_ROTATE_OBJECTS_BUTTON, + WIDX_SCENERY_REPAINT_SCENERY_BUTTON, + WIDX_SCENERY_PRIMARY_COLOUR_BUTTON, + WIDX_SCENERY_SECONDARY_COLOUR_BUTTON, + WIDX_SCENERY_TERTIARY_COLOUR_BUTTON, + WIDX_SCENERY_EYEDROPPER_BUTTON, + WIDX_SCENERY_BUILD_CLUSTER_BUTTON, + WIDX_FILTER_TEXT_BOX, + WIDX_FILTER_CLEAR_BUTTON, + WIDX_RESTRICT_SCENERY, + WIDX_SCENERY_TAB_1, + }; + + validate_global_widx(WC_SCENERY, WIDX_SCENERY_TAB_1); + validate_global_widx(WC_SCENERY, WIDX_SCENERY_ROTATE_OBJECTS_BUTTON); + validate_global_widx(WC_SCENERY, WIDX_SCENERY_EYEDROPPER_BUTTON); + + // clang-format off static Widget WindowSceneryBaseWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WINDOW_SCENERY_MIN_WIDTH, WINDOW_SCENERY_MIN_HEIGHT), MakeWidget ({ 0, 43}, {634, 99}, WindowWidgetType::Resize, WindowColour::Secondary ), // 8 0x009DE2C8 @@ -96,1657 +96,1670 @@ static Widget WindowSceneryBaseWidgets[] = { MakeWidget ({539, 46}, { 70, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_RESTRICT_SCENERY, STR_RESTRICT_SCENERY_TIP ), kWidgetsEnd, }; -// clang-format on + // clang-format on -// Persistent between window instances -static size_t _activeTabIndex; -static std::vector _tabSelections; + // Persistent between window instances + static size_t _activeTabIndex; + static std::vector _tabSelections; -uint8_t gWindowSceneryPaintEnabled; -uint8_t gWindowSceneryRotation; -colour_t gWindowSceneryPrimaryColour; -colour_t gWindowScenerySecondaryColour; -colour_t gWindowSceneryTertiaryColour; -bool gWindowSceneryEyedropperEnabled; + uint8_t gWindowSceneryPaintEnabled; + uint8_t gWindowSceneryRotation; + colour_t gWindowSceneryPrimaryColour; + colour_t gWindowScenerySecondaryColour; + colour_t gWindowSceneryTertiaryColour; + bool gWindowSceneryEyedropperEnabled; -class SceneryWindow final : public Window -{ -private: - enum SceneryTabType + class SceneryWindow final : public Window { - SCENERY_TAB_TYPE_GROUP, - SCENERY_TAB_TYPE_MISC, - SCENERY_TAB_TYPE_ALL, - }; - - struct SceneryItem - { - int32_t allRows; - int32_t selected_item; - ScenerySelection scenerySelection; - }; - - struct SceneryTabInfo - { - SceneryTabType Type = SCENERY_TAB_TYPE_GROUP; - ObjectEntryIndex SceneryGroupIndex = OBJECT_ENTRY_INDEX_NULL; - std::deque Entries{}; - u8string Filter = ""; - - bool IsMisc() const + private: + enum SceneryTabType { - return Type == SCENERY_TAB_TYPE_MISC; - } + SCENERY_TAB_TYPE_GROUP, + SCENERY_TAB_TYPE_MISC, + SCENERY_TAB_TYPE_ALL, + }; - bool IsAll() const + struct SceneryItem { - return Type == SCENERY_TAB_TYPE_ALL; - } + int32_t allRows; + int32_t selected_item; + ScenerySelection scenerySelection; + }; - bool IsSceneryGroup() const + struct SceneryTabInfo { - return Type == SCENERY_TAB_TYPE_GROUP; - } + SceneryTabType Type = SCENERY_TAB_TYPE_GROUP; + ObjectEntryIndex SceneryGroupIndex = OBJECT_ENTRY_INDEX_NULL; + std::deque Entries{}; + u8string Filter = ""; - bool Contains(const ScenerySelection& entry) const - { - return std::find(std::begin(Entries), std::end(Entries), entry) != std::end(Entries); - } - - void AddEntryToBack(const ScenerySelection& entry) - { - if (!Contains(entry)) + bool IsMisc() const { - Entries.push_back(entry); + return Type == SCENERY_TAB_TYPE_MISC; + } + + bool IsAll() const + { + return Type == SCENERY_TAB_TYPE_ALL; + } + + bool IsSceneryGroup() const + { + return Type == SCENERY_TAB_TYPE_GROUP; + } + + bool Contains(const ScenerySelection& entry) const + { + return std::find(std::begin(Entries), std::end(Entries), entry) != std::end(Entries); + } + + void AddEntryToBack(const ScenerySelection& entry) + { + if (!Contains(entry)) + { + Entries.push_back(entry); + } + } + + void AddEntryToFront(const ScenerySelection& entry) + { + if (!Contains(entry)) + { + Entries.push_front(entry); + } + } + + const SceneryGroupEntry* GetSceneryGroupEntry() const + { + return OpenRCT2::ObjectManager::GetObjectEntry(SceneryGroupIndex); + } + }; + + std::vector _tabEntries; + std::vector _widgets; + int32_t _requiredWidth; + int32_t _actualMinHeight; + ScenerySelection _selectedScenery; + int16_t _hoverCounter; + SceneryTabInfo _filteredSceneryTab; + + public: + void OnOpen() override + { + Init(); + + InitScrollWidgets(); + ContentUpdateScroll(); + ShowGridlines(); + gWindowSceneryRotation = 3; + gSceneryCtrlPressed = false; + gSceneryShiftPressed = false; + _selectedScenery = {}; + _hoverCounter = 0; + gSceneryGhostType = 0; + gSceneryPlaceCost = kMoney64Undefined; + gSceneryPlaceRotation = 0; + gWindowSceneryPaintEnabled = 0; // repaint coloured scenery tool state + gWindowSceneryEyedropperEnabled = false; + + width = GetRequiredWidth(); + min_width = width; + max_width = width; + height = _actualMinHeight; + min_height = height; + max_height = height; + if (_activeTabIndex > _tabSelections.size()) + { + _activeTabIndex = 0; + } + + WindowMovePosition(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D }); + WindowPushOthersBelow(*this); + } + + void OnClose() override + { + SceneryRemoveGhostToolPlacement(); + HideGridlines(); + ViewportSetVisibility(ViewportVisibility::Default); + + if (gWindowSceneryScatterEnabled) + WindowCloseByClass(WindowClass::SceneryScatter); + + if (SceneryToolIsActive()) + ToolCancel(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_SCENERY_CLOSE: + Close(); + break; + case WIDX_SCENERY_ROTATE_OBJECTS_BUTTON: + gWindowSceneryRotation++; + gWindowSceneryRotation = gWindowSceneryRotation % 4; + SceneryRemoveGhostToolPlacement(); + Invalidate(); + break; + case WIDX_SCENERY_REPAINT_SCENERY_BUTTON: + gWindowSceneryPaintEnabled ^= 1; + gWindowSceneryEyedropperEnabled = false; + if (gWindowSceneryScatterEnabled) + WindowCloseByClass(WindowClass::SceneryScatter); + Invalidate(); + break; + case WIDX_SCENERY_EYEDROPPER_BUTTON: + gWindowSceneryPaintEnabled = 0; + gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled; + if (gWindowSceneryScatterEnabled) + WindowCloseByClass(WindowClass::SceneryScatter); + SceneryRemoveGhostToolPlacement(); + Invalidate(); + break; + case WIDX_SCENERY_BUILD_CLUSTER_BUTTON: + gWindowSceneryPaintEnabled = 0; + gWindowSceneryEyedropperEnabled = false; + if (gWindowSceneryScatterEnabled) + WindowCloseByClass(WindowClass::SceneryScatter); + else if ( + NetworkGetMode() != NETWORK_MODE_CLIENT + || NetworkCanPerformCommand(NetworkGetCurrentPlayerGroupIndex(), -2)) + { + WindowSceneryScatterOpen(); + } + else + { + ContextShowError(STR_CANT_DO_THIS, STR_PERMISSION_DENIED, {}); + } + Invalidate(); + break; + case WIDX_FILTER_TEXT_BOX: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _filteredSceneryTab.Filter.data(), TEXT_INPUT_SIZE); + break; + case WIDX_FILTER_CLEAR_BUTTON: + _tabEntries[_activeTabIndex].Filter.clear(); + ContentUpdateScroll(); + scrolls->v_top = 0; + Invalidate(); + break; + case WIDX_RESTRICT_SCENERY: + { + const auto tabIndex = _activeTabIndex; + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); + if (!tabSelectedScenery.IsUndefined()) + { + const auto newStatus = !IsSceneryItemRestricted(tabSelectedScenery); + const auto objectType = GetObjectTypeFromSceneryType(tabSelectedScenery.SceneryType); + auto action = ScenerySetRestrictedAction(objectType, tabSelectedScenery.EntryIndex, newStatus); + GameActions::Execute(&action); + } + break; + } } } - void AddEntryToFront(const ScenerySelection& entry) + void OnResize() override { - if (!Contains(entry)) + if (width < min_width) { - Entries.push_front(entry); + Invalidate(); + width = min_width; + Invalidate(); } - } - const SceneryGroupEntry* GetSceneryGroupEntry() const - { - return OpenRCT2::ObjectManager::GetObjectEntry(SceneryGroupIndex); - } - }; - - std::vector _tabEntries; - std::vector _widgets; - int32_t _requiredWidth; - int32_t _actualMinHeight; - ScenerySelection _selectedScenery; - int16_t _hoverCounter; - SceneryTabInfo _filteredSceneryTab; - -public: - void OnOpen() override - { - Init(); - - InitScrollWidgets(); - ContentUpdateScroll(); - ShowGridlines(); - gWindowSceneryRotation = 3; - gSceneryCtrlPressed = false; - gSceneryShiftPressed = false; - _selectedScenery = {}; - _hoverCounter = 0; - gSceneryGhostType = 0; - gSceneryPlaceCost = kMoney64Undefined; - gSceneryPlaceRotation = 0; - gWindowSceneryPaintEnabled = 0; // repaint coloured scenery tool state - gWindowSceneryEyedropperEnabled = false; - - width = GetRequiredWidth(); - min_width = width; - max_width = width; - height = _actualMinHeight; - min_height = height; - max_height = height; - if (_activeTabIndex > _tabSelections.size()) - { - _activeTabIndex = 0; - } - - WindowMovePosition(*this, { ContextGetWidth() - GetRequiredWidth(), 0x1D }); - WindowPushOthersBelow(*this); - } - - void OnClose() override - { - SceneryRemoveGhostToolPlacement(); - HideGridlines(); - ViewportSetVisibility(ViewportVisibility::Default); - - if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); - - if (SceneryToolIsActive()) - ToolCancel(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_SCENERY_CLOSE: - Close(); - break; - case WIDX_SCENERY_ROTATE_OBJECTS_BUTTON: - gWindowSceneryRotation++; - gWindowSceneryRotation = gWindowSceneryRotation % 4; - SceneryRemoveGhostToolPlacement(); + if (width > max_width) + { Invalidate(); - break; - case WIDX_SCENERY_REPAINT_SCENERY_BUTTON: - gWindowSceneryPaintEnabled ^= 1; - gWindowSceneryEyedropperEnabled = false; - if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); + width = max_width; Invalidate(); - break; - case WIDX_SCENERY_EYEDROPPER_BUTTON: - gWindowSceneryPaintEnabled = 0; - gWindowSceneryEyedropperEnabled = !gWindowSceneryEyedropperEnabled; - if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); - SceneryRemoveGhostToolPlacement(); + } + + if (height < min_height) + { Invalidate(); - break; - case WIDX_SCENERY_BUILD_CLUSTER_BUTTON: - gWindowSceneryPaintEnabled = 0; - gWindowSceneryEyedropperEnabled = false; - if (gWindowSceneryScatterEnabled) - WindowCloseByClass(WindowClass::SceneryScatter); - else if ( - NetworkGetMode() != NETWORK_MODE_CLIENT - || NetworkCanPerformCommand(NetworkGetCurrentPlayerGroupIndex(), -2)) - { - WindowSceneryScatterOpen(); - } - else - { - ContextShowError(STR_CANT_DO_THIS, STR_PERMISSION_DENIED, {}); - } + height = min_height; Invalidate(); - break; - case WIDX_FILTER_TEXT_BOX: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _filteredSceneryTab.Filter.data(), TEXT_INPUT_SIZE); - break; - case WIDX_FILTER_CLEAR_BUTTON: - _tabEntries[_activeTabIndex].Filter.clear(); + // HACK: For some reason invalidate has not been called + OnPrepareDraw(); ContentUpdateScroll(); - scrolls->v_top = 0; + } + + if (height > max_height) + { Invalidate(); - break; - case WIDX_RESTRICT_SCENERY: + height = max_height; + Invalidate(); + // HACK: For some reason invalidate has not been called + OnPrepareDraw(); + ContentUpdateScroll(); + } + + ResizeFrameWithPage(); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_SCENERY_PRIMARY_COLOUR_BUTTON: + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], gWindowSceneryPrimaryColour); + break; + case WIDX_SCENERY_SECONDARY_COLOUR_BUTTON: + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], gWindowScenerySecondaryColour); + break; + case WIDX_SCENERY_TERTIARY_COLOUR_BUTTON: + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], gWindowSceneryTertiaryColour); + break; + } + + if (widgetIndex >= WIDX_SCENERY_TAB_1) + { + _activeTabIndex = widgetIndex - WIDX_SCENERY_TAB_1; + Invalidate(); + gSceneryPlaceCost = kMoney64Undefined; + + ContentUpdateScroll(); + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (dropdownIndex == -1) + return; + + if (widgetIndex == WIDX_SCENERY_PRIMARY_COLOUR_BUTTON) + { + gWindowSceneryPrimaryColour = ColourDropDownIndexToColour(dropdownIndex); + } + else if (widgetIndex == WIDX_SCENERY_SECONDARY_COLOUR_BUTTON) + { + gWindowScenerySecondaryColour = ColourDropDownIndexToColour(dropdownIndex); + } + else if (widgetIndex == WIDX_SCENERY_TERTIARY_COLOUR_BUTTON) + { + gWindowSceneryTertiaryColour = ColourDropDownIndexToColour(dropdownIndex); + } + + Invalidate(); + } + + void OnPeriodicUpdate() override + { + if (!_selectedScenery.IsUndefined()) + { + // Find out what scenery the cursor is over + const CursorState* state = ContextGetCursorState(); + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position); + if (widgetIndex == WIDX_SCENERY_LIST) + { + ScreenCoordsXY scrollPos = {}; + int32_t scrollArea = 0; + int32_t scrollId = 0; + WidgetScrollGetPart(*this, &widgets[WIDX_SCENERY_LIST], state->position, scrollPos, &scrollArea, &scrollId); + if (scrollArea == SCROLL_PART_VIEW) + { + const ScenerySelection scenery = GetSceneryIdByCursorPos(scrollPos); + if (scenery == _selectedScenery) + { + return; + } + } + } + + // Cursor was not over the currently hover selected scenery so reset hover selection. + // This will happen when the mouse leaves the scroll window and is required so that the cost and description + // switch to the tool scenery selection. + _selectedScenery = {}; + } + } + + void OnUpdate() override + { + const CursorState* state = ContextGetCursorState(); + WindowBase* other = WindowFindFromPoint(state->position); + if (other == this) + { + ScreenCoordsXY window = state->position - ScreenCoordsXY{ windowPos.x - 26, windowPos.y }; + + if (window.y < 44 || window.x <= width) + { + WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position); + if (widgetIndex >= WIDX_SCENERY_TAB_CONTENT_PANEL) + { + _hoverCounter++; + if (_hoverCounter < 8) + { + if (InputGetState() != InputState::ScrollLeft) + { + min_height = _actualMinHeight; + max_height = _actualMinHeight; + } + } + else + { + const auto& listWidget = widgets[WIDX_SCENERY_LIST]; + const auto nonListHeight = height - listWidget.height() + 12; + + const auto numRows = static_cast(CountRows()); + const auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT; + const auto maxWindowHeight = maxContentHeight + nonListHeight; + const auto windowHeight = std::clamp(maxWindowHeight, _actualMinHeight, 473); + + min_height = windowHeight; + max_height = windowHeight; + } + } + } + } + else + { + _hoverCounter = 0; + if (InputGetState() != InputState::ScrollLeft) + { + min_height = _actualMinHeight; + max_height = _actualMinHeight; + } + } + + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + { + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); + } + + Invalidate(); + + if (!SceneryToolIsActive()) + { + Close(); + return; + } + + if (gWindowSceneryEyedropperEnabled) + { + gCurrentToolId = Tool::Crosshair; + } + else if (gWindowSceneryPaintEnabled == 1) + { + gCurrentToolId = Tool::PaintDown; + } + else { const auto tabIndex = _activeTabIndex; const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { - const auto newStatus = !IsSceneryItemRestricted(tabSelectedScenery); - const auto objectType = GetObjectTypeFromSceneryType(tabSelectedScenery.SceneryType); - auto action = ScenerySetRestrictedAction(objectType, tabSelectedScenery.EntryIndex, newStatus); - GameActions::Execute(&action); - } - break; - } - } - } - - void OnResize() override - { - if (width < min_width) - { - Invalidate(); - width = min_width; - Invalidate(); - } - - if (width > max_width) - { - Invalidate(); - width = max_width; - Invalidate(); - } - - if (height < min_height) - { - Invalidate(); - height = min_height; - Invalidate(); - // HACK: For some reason invalidate has not been called - OnPrepareDraw(); - ContentUpdateScroll(); - } - - if (height > max_height) - { - Invalidate(); - height = max_height; - Invalidate(); - // HACK: For some reason invalidate has not been called - OnPrepareDraw(); - ContentUpdateScroll(); - } - - ResizeFrameWithPage(); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_SCENERY_PRIMARY_COLOUR_BUTTON: - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], gWindowSceneryPrimaryColour); - break; - case WIDX_SCENERY_SECONDARY_COLOUR_BUTTON: - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], gWindowScenerySecondaryColour); - break; - case WIDX_SCENERY_TERTIARY_COLOUR_BUTTON: - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], gWindowSceneryTertiaryColour); - break; - } - - if (widgetIndex >= WIDX_SCENERY_TAB_1) - { - _activeTabIndex = widgetIndex - WIDX_SCENERY_TAB_1; - Invalidate(); - gSceneryPlaceCost = kMoney64Undefined; - - ContentUpdateScroll(); - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - return; - - if (widgetIndex == WIDX_SCENERY_PRIMARY_COLOUR_BUTTON) - { - gWindowSceneryPrimaryColour = ColourDropDownIndexToColour(dropdownIndex); - } - else if (widgetIndex == WIDX_SCENERY_SECONDARY_COLOUR_BUTTON) - { - gWindowScenerySecondaryColour = ColourDropDownIndexToColour(dropdownIndex); - } - else if (widgetIndex == WIDX_SCENERY_TERTIARY_COLOUR_BUTTON) - { - gWindowSceneryTertiaryColour = ColourDropDownIndexToColour(dropdownIndex); - } - - Invalidate(); - } - - void OnPeriodicUpdate() override - { - if (!_selectedScenery.IsUndefined()) - { - // Find out what scenery the cursor is over - const CursorState* state = ContextGetCursorState(); - WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position); - if (widgetIndex == WIDX_SCENERY_LIST) - { - ScreenCoordsXY scrollPos = {}; - int32_t scrollArea = 0; - int32_t scrollId = 0; - WidgetScrollGetPart(*this, &widgets[WIDX_SCENERY_LIST], state->position, scrollPos, &scrollArea, &scrollId); - if (scrollArea == SCROLL_PART_VIEW) - { - const ScenerySelection scenery = GetSceneryIdByCursorPos(scrollPos); - if (scenery == _selectedScenery) + if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) { - return; + gCurrentToolId = Tool::EntranceDown; } - } - } - - // Cursor was not over the currently hover selected scenery so reset hover selection. - // This will happen when the mouse leaves the scroll window and is required so that the cost and description switch - // to the tool scenery selection. - _selectedScenery = {}; - } - } - - void OnUpdate() override - { - const CursorState* state = ContextGetCursorState(); - WindowBase* other = WindowFindFromPoint(state->position); - if (other == this) - { - ScreenCoordsXY window = state->position - ScreenCoordsXY{ windowPos.x - 26, windowPos.y }; - - if (window.y < 44 || window.x <= width) - { - WidgetIndex widgetIndex = WindowFindWidgetFromPoint(*this, state->position); - if (widgetIndex >= WIDX_SCENERY_TAB_CONTENT_PANEL) - { - _hoverCounter++; - if (_hoverCounter < 8) + else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) { - if (InputGetState() != InputState::ScrollLeft) - { - min_height = _actualMinHeight; - max_height = _actualMinHeight; - } + gCurrentToolId = static_cast( + OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); + } + else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) + { + gCurrentToolId = static_cast( + OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); + } + else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_PATH_ITEM) + { + gCurrentToolId = static_cast( + OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); } else - { - const auto& listWidget = widgets[WIDX_SCENERY_LIST]; - const auto nonListHeight = height - listWidget.height() + 12; - - const auto numRows = static_cast(CountRows()); - const auto maxContentHeight = numRows * SCENERY_BUTTON_HEIGHT; - const auto maxWindowHeight = maxContentHeight + nonListHeight; - const auto windowHeight = std::clamp(maxWindowHeight, _actualMinHeight, 473); - - min_height = windowHeight; - max_height = windowHeight; + { // small scenery + gCurrentToolId = static_cast( + OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); } } + else + { + gCurrentToolId = Tool::Arrow; + } } } - else + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - _hoverCounter = 0; - if (InputGetState() != InputState::ScrollLeft) + if (widgetIndex != WIDX_FILTER_TEXT_BOX) + return; + + if (text == _tabEntries[_activeTabIndex].Filter) + return; + + _tabEntries[_activeTabIndex].Filter.assign(text); + ContentUpdateScroll(); + + scrolls->v_top = 0; + Invalidate(); + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + if (scrollIndex == SceneryContentScrollIndex) { - min_height = _actualMinHeight; - max_height = _actualMinHeight; + return ContentScrollGetSize(); + } + return {}; + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (scrollIndex == SceneryContentScrollIndex) + { + ContentScrollMouseDown(screenCoords); } } - if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - WindowUpdateTextboxCaret(); - WidgetInvalidate(*this, WIDX_FILTER_TEXT_BOX); + if (scrollIndex == SceneryContentScrollIndex) + { + ContentScrollMouseOver(screenCoords); + } } - Invalidate(); - - if (!SceneryToolIsActive()) + OpenRCT2String OnTooltip(const WidgetIndex widgetIndex, const StringId fallback) override { - Close(); - return; + if (widgetIndex >= WIDX_SCENERY_TAB_1) + { + const auto tabIndex = static_cast(widgetIndex - WIDX_SCENERY_TAB_1); + if (_tabEntries.size() > tabIndex) + { + const auto& tabInfo = _tabEntries[tabIndex]; + if (tabInfo.IsMisc()) + { + auto ft = Formatter(); + ft.Add(STR_MISCELLANEOUS); + return { fallback, ft }; + } + + if (tabInfo.IsAll()) + { + auto ft = Formatter(); + ft.Add(STR_ALL_SCENERY); + return { fallback, ft }; + } + + const auto* sceneryEntry = tabInfo.GetSceneryGroupEntry(); + if (sceneryEntry != nullptr) + { + auto ft = Formatter(); + ft.Add(sceneryEntry->name); + return { fallback, ft }; + } + } + } + return { STR_NONE, Formatter() }; } - if (gWindowSceneryEyedropperEnabled) - { - gCurrentToolId = Tool::Crosshair; - } - else if (gWindowSceneryPaintEnabled == 1) - { - gCurrentToolId = Tool::PaintDown; - } - else + void OnPrepareDraw() override { + // Set the window title + StringId titleStringId = STR_MISCELLANEOUS; const auto tabIndex = _activeTabIndex; + if (tabIndex < _tabEntries.size()) + { + const auto& tabInfo = _tabEntries[tabIndex]; + if (tabInfo.IsAll()) + { + titleStringId = STR_ALL_SCENERY; + } + else + { + const auto* sgEntry = tabInfo.GetSceneryGroupEntry(); + if (sgEntry != nullptr) + { + titleStringId = sgEntry->name; + } + } + } + widgets[WIDX_SCENERY_TITLE].text = titleStringId; + widgets[WIDX_FILTER_TEXT_BOX].string = _filteredSceneryTab.Filter.data(); + + pressed_widgets = 0; + pressed_widgets |= 1uLL << (tabIndex + WIDX_SCENERY_TAB_1); + if (gWindowSceneryPaintEnabled == 1) + pressed_widgets |= (1uLL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON); + if (gWindowSceneryEyedropperEnabled) + pressed_widgets |= (1uLL << WIDX_SCENERY_EYEDROPPER_BUTTON); + if (gWindowSceneryScatterEnabled) + pressed_widgets |= (1uLL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); + + widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Empty; + + if (!(gWindowSceneryPaintEnabled & 1)) + { + widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::FlatBtn; + } + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { - if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) + if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) { - gCurrentToolId = Tool::EntranceDown; + if (!(gWindowSceneryPaintEnabled & 1)) + { + widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; + } + + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + tabSelectedScenery.EntryIndex); + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + { + widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; + } } - else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) - { - gCurrentToolId = static_cast( - OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); - } - else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) - { - gCurrentToolId = static_cast( - OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); - } - else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_PATH_ITEM) - { - gCurrentToolId = static_cast( - OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); - } - else - { // small scenery - gCurrentToolId = static_cast( - OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex)->tool_id); - } - } - else - { - gCurrentToolId = Tool::Arrow; - } - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex != WIDX_FILTER_TEXT_BOX) - return; - - if (text == _tabEntries[_activeTabIndex].Filter) - return; - - _tabEntries[_activeTabIndex].Filter.assign(text); - ContentUpdateScroll(); - - scrolls->v_top = 0; - Invalidate(); - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - if (scrollIndex == SceneryContentScrollIndex) - { - return ContentScrollGetSize(); - } - return {}; - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (scrollIndex == SceneryContentScrollIndex) - { - ContentScrollMouseDown(screenCoords); - } - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (scrollIndex == SceneryContentScrollIndex) - { - ContentScrollMouseOver(screenCoords); - } - } - - OpenRCT2String OnTooltip(const WidgetIndex widgetIndex, const StringId fallback) override - { - if (widgetIndex >= WIDX_SCENERY_TAB_1) - { - const auto tabIndex = static_cast(widgetIndex - WIDX_SCENERY_TAB_1); - if (_tabEntries.size() > tabIndex) - { - const auto& tabInfo = _tabEntries[tabIndex]; - if (tabInfo.IsMisc()) - { - auto ft = Formatter(); - ft.Add(STR_MISCELLANEOUS); - return { fallback, ft }; - } - - if (tabInfo.IsAll()) - { - auto ft = Formatter(); - ft.Add(STR_ALL_SCENERY); - return { fallback, ft }; - } - - const auto* sceneryEntry = tabInfo.GetSceneryGroupEntry(); - if (sceneryEntry != nullptr) - { - auto ft = Formatter(); - ft.Add(sceneryEntry->name); - return { fallback, ft }; - } - } - } - return { STR_NONE, Formatter() }; - } - - void OnPrepareDraw() override - { - // Set the window title - StringId titleStringId = STR_MISCELLANEOUS; - const auto tabIndex = _activeTabIndex; - if (tabIndex < _tabEntries.size()) - { - const auto& tabInfo = _tabEntries[tabIndex]; - if (tabInfo.IsAll()) - { - titleStringId = STR_ALL_SCENERY; - } - else - { - const auto* sgEntry = tabInfo.GetSceneryGroupEntry(); - if (sgEntry != nullptr) - { - titleStringId = sgEntry->name; - } - } - } - widgets[WIDX_SCENERY_TITLE].text = titleStringId; - widgets[WIDX_FILTER_TEXT_BOX].string = _filteredSceneryTab.Filter.data(); - - pressed_widgets = 0; - pressed_widgets |= 1uLL << (tabIndex + WIDX_SCENERY_TAB_1); - if (gWindowSceneryPaintEnabled == 1) - pressed_widgets |= (1uLL << WIDX_SCENERY_REPAINT_SCENERY_BUTTON); - if (gWindowSceneryEyedropperEnabled) - pressed_widgets |= (1uLL << WIDX_SCENERY_EYEDROPPER_BUTTON); - if (gWindowSceneryScatterEnabled) - pressed_widgets |= (1uLL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); - - widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Empty; - - if (!(gWindowSceneryPaintEnabled & 1)) - { - widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::FlatBtn; - } - - const auto tabSelectedScenery = GetSelectedScenery(tabIndex); - if (!tabSelectedScenery.IsUndefined()) - { - if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) - { - if (!(gWindowSceneryPaintEnabled & 1)) - { - widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; - } - - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex); - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + else if (tabSelectedScenery.SceneryType >= SCENERY_TYPE_LARGE) { widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; } - } - else if (tabSelectedScenery.SceneryType >= SCENERY_TYPE_LARGE) - { - widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::FlatBtn; - } - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) - { - widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Button; - if (IsSceneryItemRestricted(tabSelectedScenery)) - pressed_widgets |= (1uLL << WIDX_RESTRICT_SCENERY); - else - pressed_widgets &= ~(1uLL << WIDX_RESTRICT_SCENERY); - } - } - - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowSceneryPrimaryColour); - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowScenerySecondaryColour); - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowSceneryTertiaryColour); - - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; - - if (gWindowSceneryPaintEnabled & 1) - { // repaint coloured scenery tool is on - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; - } - else if (!tabSelectedScenery.IsUndefined()) - { - if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) - { - auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex); - if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) { - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Button; + if (IsSceneryItemRestricted(tabSelectedScenery)) + pressed_widgets |= (1uLL << WIDX_RESTRICT_SCENERY); + else + pressed_widgets &= ~(1uLL << WIDX_RESTRICT_SCENERY); } } - else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex); - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR - && !(sceneryEntry->flags & LARGE_SCENERY_FLAG_HIDE_PRIMARY_REMAP_BUTTON)) - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR - && !(sceneryEntry->flags & LARGE_SCENERY_FLAG_HIDE_SECONDARY_REMAP_BUTTON)) - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_TERTIARY_COLOUR) - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowSceneryPrimaryColour); + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowScenerySecondaryColour); + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].image = GetColourButtonImage(gWindowSceneryTertiaryColour); + + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + + if (gWindowSceneryPaintEnabled & 1) + { // repaint coloured scenery tool is on + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; } - else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) + else if (!tabSelectedScenery.IsUndefined()) { - auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex); - if (wallEntry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS)) + if (tabSelectedScenery.SceneryType == SCENERY_TYPE_BANNER) { - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - - if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry( + tabSelectedScenery.EntryIndex); + if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) { - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + } + } + else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_LARGE) + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + tabSelectedScenery.EntryIndex); - if (wallEntry->flags2 & WALL_SCENERY_2_NO_SELECT_PRIMARY_COLOUR) - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; - if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR + && !(sceneryEntry->flags & LARGE_SCENERY_FLAG_HIDE_PRIMARY_REMAP_BUTTON)) + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR + && !(sceneryEntry->flags & LARGE_SCENERY_FLAG_HIDE_SECONDARY_REMAP_BUTTON)) + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_TERTIARY_COLOUR) + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + } + else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_WALL) + { + auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex); + if (wallEntry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS)) + { + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + + if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + { + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + + if (wallEntry->flags2 & WALL_SCENERY_2_NO_SELECT_PRIMARY_COLOUR) + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::Empty; + if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + } + } + } + else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + tabSelectedScenery.EntryIndex); + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) + { + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_TERTIARY_COLOUR)) widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; } } } - else if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) + + auto windowWidth = width; + if (_tabEntries.size() > 0) { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(tabSelectedScenery.EntryIndex); + const auto lastTabIndex = GetMaxTabCountInARow() == MaxTabsPerRow ? MaxTabsPerRow - 1 : _tabEntries.size() - 1; + const auto lastTabWidget = &widgets[WIDX_SCENERY_TAB_1 + lastTabIndex]; + windowWidth = std::max(windowWidth, lastTabWidget->right + 3); - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) + if (GetSceneryTabInfoForMisc() != nullptr) { - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + auto miscTabWidget = &widgets[WIDX_SCENERY_TAB_1 + _tabEntries.size() - 2]; + miscTabWidget->left = windowWidth - 2 * TabWidth - 6; + miscTabWidget->right = windowWidth - TabWidth - 7; + miscTabWidget->top = InitTabPosY; + miscTabWidget->bottom = InitTabPosY + TabHeight; + } - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_TERTIARY_COLOUR)) - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; + if (_tabEntries.back().IsAll()) + { + auto allTabWidget = &widgets[WIDX_SCENERY_TAB_1 + _tabEntries.size() - 1]; + allTabWidget->left = windowWidth - TabWidth - 6; + allTabWidget->right = windowWidth - 7; + allTabWidget->top = InitTabPosY; + allTabWidget->bottom = InitTabPosY + TabHeight; } } + + ResizeFrameWithPage(); + widgets[WIDX_SCENERY_LIST].right = windowWidth - 26; + widgets[WIDX_SCENERY_LIST].bottom = height - 24; + + widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].left = windowWidth - 25; + widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].left = windowWidth - 25; + widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].left = windowWidth - 25; + widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].left = windowWidth - 25; + widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].right = windowWidth - 2; + widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].right = windowWidth - 2; + widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].right = windowWidth - 2; + widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].right = windowWidth - 2; + + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].left = windowWidth - 19; + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].left = windowWidth - 19; + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].left = windowWidth - 19; + widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].right = windowWidth - 8; + widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].right = windowWidth - 8; + widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].right = windowWidth - 8; } - auto windowWidth = width; - if (_tabEntries.size() > 0) + void OnDraw(DrawPixelInfo& dpi) override { - const auto lastTabIndex = GetMaxTabCountInARow() == MaxTabsPerRow ? MaxTabsPerRow - 1 : _tabEntries.size() - 1; - const auto lastTabWidget = &widgets[WIDX_SCENERY_TAB_1 + lastTabIndex]; - windowWidth = std::max(windowWidth, lastTabWidget->right + 3); + DrawWidgets(dpi); + DrawTabs(dpi, windowPos); - if (GetSceneryTabInfoForMisc() != nullptr) - { - auto miscTabWidget = &widgets[WIDX_SCENERY_TAB_1 + _tabEntries.size() - 2]; - miscTabWidget->left = windowWidth - 2 * TabWidth - 6; - miscTabWidget->right = windowWidth - TabWidth - 7; - miscTabWidget->top = InitTabPosY; - miscTabWidget->bottom = InitTabPosY + TabHeight; - } - - if (_tabEntries.back().IsAll()) - { - auto allTabWidget = &widgets[WIDX_SCENERY_TAB_1 + _tabEntries.size() - 1]; - allTabWidget->left = windowWidth - TabWidth - 6; - allTabWidget->right = windowWidth - 7; - allTabWidget->top = InitTabPosY; - allTabWidget->bottom = InitTabPosY + TabHeight; - } - } - - ResizeFrameWithPage(); - widgets[WIDX_SCENERY_LIST].right = windowWidth - 26; - widgets[WIDX_SCENERY_LIST].bottom = height - 24; - - widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].left = windowWidth - 25; - widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].left = windowWidth - 25; - widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].left = windowWidth - 25; - widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].left = windowWidth - 25; - widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].right = windowWidth - 2; - widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].right = windowWidth - 2; - widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].right = windowWidth - 2; - widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].right = windowWidth - 2; - - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].left = windowWidth - 19; - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].left = windowWidth - 19; - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].left = windowWidth - 19; - widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].right = windowWidth - 8; - widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].right = windowWidth - 8; - widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].right = windowWidth - 8; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabs(dpi, windowPos); - - auto selectedSceneryEntry = _selectedScenery; - if (selectedSceneryEntry.IsUndefined()) - { - if (gWindowSceneryPaintEnabled & 1) // repaint coloured scenery tool is on - return; - if (gWindowSceneryEyedropperEnabled) - return; - - selectedSceneryEntry = GetSelectedScenery(_activeTabIndex); + auto selectedSceneryEntry = _selectedScenery; if (selectedSceneryEntry.IsUndefined()) - return; - } - - auto [name, price] = GetNameAndPrice(selectedSceneryEntry); - if (price != kMoney64Undefined && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(price); - - // -14 - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ width - 0x1A, height - 13 }, STR_COST_LABEL, ft, { TextAlignment::RIGHT }); - } - - auto ft = Formatter(); - ft.Add(name); - DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + height - 23 }, width - 19, STR_BLACK_STRING, ft); - - auto sceneryObjectType = GetObjectTypeFromSceneryType(selectedSceneryEntry.SceneryType); - auto& objManager = GetContext()->GetObjectManager(); - auto sceneryObject = objManager.GetLoadedObject(sceneryObjectType, selectedSceneryEntry.EntryIndex); - if (sceneryObject != nullptr && sceneryObject->GetAuthors().size() > 0) - { - std::string authorsString; - const auto& authors = sceneryObject->GetAuthors(); - for (size_t i = 0; i < authors.size(); ++i) { - if (i > 0) - { - authorsString.append(", "); - } - authorsString.append(authors[i]); + if (gWindowSceneryPaintEnabled & 1) // repaint coloured scenery tool is on + return; + if (gWindowSceneryEyedropperEnabled) + return; + + selectedSceneryEntry = GetSelectedScenery(_activeTabIndex); + if (selectedSceneryEntry.IsUndefined()) + return; } - ft = Formatter(); - ft.Add(authorsString.c_str()); - DrawTextEllipsised( - dpi, windowPos + ScreenCoordsXY{ 3, height - 13 }, width - 19, - (sceneryObject->GetAuthors().size() == 1 ? STR_SCENERY_AUTHOR : STR_SCENERY_AUTHOR_PLURAL), ft); - } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - if (scrollIndex == SceneryContentScrollIndex) + auto [name, price] = GetNameAndPrice(selectedSceneryEntry); + if (price != kMoney64Undefined && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(price); + + // -14 + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ width - 0x1A, height - 13 }, STR_COST_LABEL, ft, { TextAlignment::RIGHT }); + } + + auto ft = Formatter(); + ft.Add(name); + DrawTextEllipsised(dpi, { windowPos.x + 3, windowPos.y + height - 23 }, width - 19, STR_BLACK_STRING, ft); + + auto sceneryObjectType = GetObjectTypeFromSceneryType(selectedSceneryEntry.SceneryType); + auto& objManager = GetContext()->GetObjectManager(); + auto sceneryObject = objManager.GetLoadedObject(sceneryObjectType, selectedSceneryEntry.EntryIndex); + if (sceneryObject != nullptr && sceneryObject->GetAuthors().size() > 0) + { + std::string authorsString; + const auto& authors = sceneryObject->GetAuthors(); + for (size_t i = 0; i < authors.size(); ++i) + { + if (i > 0) + { + authorsString.append(", "); + } + authorsString.append(authors[i]); + } + ft = Formatter(); + ft.Add(authorsString.c_str()); + DrawTextEllipsised( + dpi, windowPos + ScreenCoordsXY{ 3, height - 13 }, width - 19, + (sceneryObject->GetAuthors().size() == 1 ? STR_SCENERY_AUTHOR : STR_SCENERY_AUTHOR_PLURAL), ft); + } + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - ContentScrollDraw(dpi); + if (scrollIndex == SceneryContentScrollIndex) + { + ContentScrollDraw(dpi); + } } + + void SetSelectedItem( + const ScenerySelection& scenery, const std::optional primary, const std::optional secondary, + const std::optional tertiary, const std::optional rotation) + { + auto tabIndex = FindTabWithScenery(scenery); + if (!tabIndex.has_value()) + { + return; + } + + _activeTabIndex = tabIndex.value(); + SetSelectedScenery(tabIndex.value(), scenery); + if (primary.has_value()) + { + gWindowSceneryPrimaryColour = primary.value(); + } + if (secondary.has_value()) + { + gWindowScenerySecondaryColour = secondary.value(); + } + if (tertiary.has_value()) + { + gWindowSceneryTertiaryColour = tertiary.value(); + } + if (rotation.has_value()) + { + gWindowSceneryRotation = rotation.value(); + } + gWindowSceneryEyedropperEnabled = false; + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, ContextGetWidth() / 2); + _hoverCounter = -16; + gSceneryPlaceCost = kMoney64Undefined; + Invalidate(); + } + + void SetSelectedTab(const ObjectEntryIndex sceneryGroupIndex) + { + const auto* tabInfo = GetSceneryTabInfoForGroup(sceneryGroupIndex); + if (tabInfo == nullptr) + { + tabInfo = &_tabEntries.back(); + } + const auto tabId = std::distance(&*_tabEntries.cbegin(), tabInfo); + + OnMouseDown(WIDX_SCENERY_TAB_1 + tabId); + } + + const ScenerySelection GetTabSelection() + { + return GetSelectedScenery(_activeTabIndex); + } + + void Init() + { + _tabEntries.clear(); + + for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < MaxTabs - ReservedTabCount; scenerySetIndex++) + { + const auto* sceneryGroupEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySetIndex); + if (sceneryGroupEntry != nullptr && SceneryGroupIsInvented(scenerySetIndex)) + { + SceneryTabInfo tabInfo; + tabInfo.SceneryGroupIndex = scenerySetIndex; + for (const auto& sceneryEntry : sceneryGroupEntry->SceneryEntries) + { + if (IsSceneryAvailableToBuild(sceneryEntry)) + { + tabInfo.AddEntryToBack(sceneryEntry); + } + } + if (tabInfo.Entries.size() > 0) + { + _tabEntries.push_back(std::move(tabInfo)); + } + } + } + + // Sort scenery group tabs before adding other tabs + SortTabs(); + + // Add misc and all tab + _tabEntries.emplace_back(SceneryWindow::SceneryTabInfo{ SCENERY_TAB_TYPE_MISC }); + _tabEntries.emplace_back(SceneryWindow::SceneryTabInfo{ SCENERY_TAB_TYPE_ALL }); + + // small scenery + for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++) + { + const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); + if (sceneryEntry != nullptr) + { + InitSceneryEntry({ SCENERY_TYPE_SMALL, sceneryId }, sceneryEntry->scenery_tab_id); + } + } + + // large scenery + for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_LARGE_SCENERY_OBJECTS; sceneryId++) + { + const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); + if (sceneryEntry != nullptr) + { + InitSceneryEntry({ SCENERY_TYPE_LARGE, sceneryId }, sceneryEntry->scenery_tab_id); + } + } + + // walls + for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++) + { + const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); + if (sceneryEntry != nullptr) + { + InitSceneryEntry({ SCENERY_TYPE_WALL, sceneryId }, sceneryEntry->scenery_tab_id); + } + } + + // banners + for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++) + { + const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); + if (sceneryEntry != nullptr) + { + InitSceneryEntry({ SCENERY_TYPE_BANNER, sceneryId }, sceneryEntry->scenery_tab_id); + } + } + + for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++) + { + const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); + if (sceneryEntry != nullptr) + { + InitSceneryEntry({ SCENERY_TYPE_PATH_ITEM, sceneryId }, sceneryEntry->scenery_tab_id); + } + } + + // Remove empty tabs + _tabEntries.erase( + std::remove_if( + _tabEntries.begin(), _tabEntries.end(), + [](const SceneryTabInfo& tabInfo) { return tabInfo.Entries.empty(); }), + _tabEntries.end()); + + // Set required width + _requiredWidth = std::min(static_cast(_tabEntries.size()), MaxTabsPerRow) * TabWidth + 5; + + PrepareWidgets(); + WindowInvalidateByClass(WindowClass::Scenery); + } + + int32_t GetRequiredWidth() const + { + return std::max(_requiredWidth, WINDOW_SCENERY_MIN_WIDTH); + } + + private: + int32_t GetNumColumns() const + { + const auto& listWidget = widgets[WIDX_SCENERY_LIST]; + const auto contentWidth = listWidget.width() - kScrollBarWidth; + return contentWidth / SCENERY_BUTTON_WIDTH; + } + + template T CountRows(T items) const + { + const auto rows = items / GetNumColumns(); + return rows; + } + + size_t CountRows() const + { + const auto tabIndex = _activeTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return 0; + } + + const auto totalItems = _filteredSceneryTab.Entries.size(); + const auto numColumns = GetNumColumns(); + const auto rows = CountRows(totalItems + numColumns - 1); + return rows; + } + + int32_t constexpr ContentRowsHeight(const size_t rows) const + { + return static_cast(rows * SCENERY_BUTTON_HEIGHT); + } + + void ContentUpdateScroll() + { + const auto tabIndex = _activeTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return; + } + + SetFilteredScenery(tabIndex); + + const int32_t listHeight = height - 14 - widgets[WIDX_SCENERY_LIST].top - 1; + + const auto sceneryItem = ContentCountRowsWithSelectedItem(tabIndex); + scrolls[SceneryContentScrollIndex].v_bottom = ContentRowsHeight(sceneryItem.allRows) + 1; + + const int32_t maxTop = std::max(0, scrolls[SceneryContentScrollIndex].v_bottom - listHeight); + auto rowSelected = CountRows(sceneryItem.selected_item); + if (sceneryItem.scenerySelection.IsUndefined()) + { + auto& oldScenery = GetSelectedScenery(tabIndex); + if (!oldScenery.IsUndefined()) + { + // Make sure last selected scenery for tab is always present + _filteredSceneryTab.AddEntryToFront(oldScenery); + } + else + { + // No last selection was made, use blank ScenerySelection + SetSelectedScenery(tabIndex, ScenerySelection()); + rowSelected = 0; + if (!_filteredSceneryTab.Entries.empty()) + { + // Select first item in current filtered tab if available + const auto& scenery = _filteredSceneryTab.Entries.front(); + if (!scenery.IsUndefined()) + { + SetSelectedScenery(tabIndex, scenery); + } + } + } + } + + scrolls[SceneryContentScrollIndex].v_top = ContentRowsHeight(rowSelected); + scrolls[SceneryContentScrollIndex].v_top = std::min(maxTop, scrolls[SceneryContentScrollIndex].v_top); + + WidgetScrollUpdateThumbs(*this, WIDX_SCENERY_LIST); + } + + SceneryItem ContentCountRowsWithSelectedItem(const size_t tabIndex) + { + SceneryItem sceneryItem = { 0, 0, ScenerySelection() }; + const auto scenerySelection = GetSelectedScenery(tabIndex); + for (size_t i = 0; i < _filteredSceneryTab.Entries.size(); i++) + { + const auto& currentEntry = _filteredSceneryTab.Entries[i]; + if (currentEntry == scenerySelection) + { + sceneryItem.selected_item = static_cast(i); + sceneryItem.scenerySelection = scenerySelection; + } + } + sceneryItem.allRows = static_cast(CountRows(_filteredSceneryTab.Entries.size() + 8)); + return sceneryItem; + } + + const ScenerySelection GetSelectedScenery(const size_t tabIndex) + { + if (_tabSelections.size() > tabIndex) + { + return _tabSelections[tabIndex]; + } + return {}; + } + + void SetSelectedScenery(const size_t tabIndex, const ScenerySelection& value) + { + if (_tabSelections.size() <= tabIndex) + { + _tabSelections.resize(tabIndex + 1); + } + _tabSelections[tabIndex] = value; + } + + SceneryTabInfo* GetSceneryTabInfoForMisc() + { + if (_tabEntries.size() >= 2) + { + if (_tabEntries[_tabEntries.size() - 2].IsMisc()) + return &_tabEntries[_tabEntries.size() - 2]; + } + + return nullptr; + } + + SceneryTabInfo* GetSceneryTabInfoForAll() + { + if (!_tabEntries.empty()) + { + if (_tabEntries.back().IsAll()) + return &_tabEntries.back(); + } + + return nullptr; + } + + SceneryTabInfo* GetSceneryTabInfoForGroup(const ObjectEntryIndex sceneryGroupIndex) + { + for (auto& tabEntry : _tabEntries) + { + if (tabEntry.SceneryGroupIndex == sceneryGroupIndex) + return &tabEntry; + } + + return nullptr; + } + + std::optional FindTabWithScenery(const ScenerySelection& scenery) + { + for (size_t i = 0; i < _tabEntries.size(); i++) + { + const auto& tabInfo = _tabEntries[i]; + if (tabInfo.IsAll()) + { + // The scenery will be always added here so exclude this one. + continue; + } + if (tabInfo.Contains(scenery)) + { + return i; + } + } + return std::nullopt; + } + + void InitSceneryEntry(const ScenerySelection& selection, const ObjectEntryIndex sceneryGroupIndex) + { + Guard::ArgumentInRange(selection.EntryIndex, 0, OBJECT_ENTRY_INDEX_NULL); + + if (IsSceneryAvailableToBuild(selection)) + { + // Add scenery to all tab + auto* allTabInfo = GetSceneryTabInfoForAll(); + if (allTabInfo != nullptr) + { + allTabInfo->AddEntryToBack(selection); + } + + // Add scenery to primary group (usually trees or path additions) + if (sceneryGroupIndex != OBJECT_ENTRY_INDEX_NULL) + { + auto* tabInfo = GetSceneryTabInfoForGroup(sceneryGroupIndex); + if (tabInfo != nullptr) + { + tabInfo->AddEntryToBack(selection); + return; + } + } + + // If scenery has no tab, add it to misc + const auto tabIndex = FindTabWithScenery(selection); + if (!tabIndex.has_value()) + { + auto* tabInfo = GetSceneryTabInfoForMisc(); + if (tabInfo != nullptr) + { + tabInfo->AddEntryToBack(selection); + } + } + } + } + + void SetFilteredScenery(const size_t tabIndex) + { + auto currentTab = _tabEntries[tabIndex]; + + _filteredSceneryTab.Entries.clear(); + _filteredSceneryTab.Filter = currentTab.Filter; + + for (auto selection : currentTab.Entries) + { + if (MatchFilter(selection)) + _filteredSceneryTab.AddEntryToBack(selection); + } + } + + bool MatchFilter(const ScenerySelection& selection) + { + if (_filteredSceneryTab.Filter.empty()) + return true; + + auto& objManager = GetContext()->GetObjectManager(); + auto sceneryObjectType = GetObjectTypeFromSceneryType(selection.SceneryType); + auto sceneryObject = objManager.GetLoadedObject(sceneryObjectType, selection.EntryIndex); + + return IsFilterInName(*sceneryObject) || IsFilterInAuthors(*sceneryObject) || IsFilterInIdentifier(*sceneryObject) + || IsFilterInFilename(*sceneryObject); + } + + bool IsFilterInName(const Object& object) + { + return String::Contains(object.GetName(), _filteredSceneryTab.Filter, true); + } + + bool IsFilterInAuthors(const Object& object) + { + for (auto author : object.GetAuthors()) + if (String::Contains(author, _filteredSceneryTab.Filter, true)) + return true; + + return false; + } + + bool IsFilterInIdentifier(const Object& object) + { + return String::Contains(object.GetIdentifier(), _filteredSceneryTab.Filter, true); + } + + bool IsFilterInFilename(const Object& object) + { + auto repoItem = ObjectRepositoryFindObjectByEntry(&(object.GetObjectEntry())); + return String::Contains(repoItem->Path, _filteredSceneryTab.Filter, true); + } + + void SortTabs() + { + std::sort(_tabEntries.begin(), _tabEntries.end(), [](const SceneryTabInfo& a, const SceneryTabInfo& b) { + if (a.SceneryGroupIndex == b.SceneryGroupIndex) + return false; + + if (a.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) + return false; + if (b.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) + return true; + + const auto* entryA = a.GetSceneryGroupEntry(); + const auto* entryB = b.GetSceneryGroupEntry(); + return entryA->priority < entryB->priority; + }); + } + + int32_t GetTabRowCount() + { + return std::max((static_cast(_tabEntries.size()) + MaxTabsPerRow - 1) / MaxTabsPerRow, 0); + } + + int32_t GetMaxTabCountInARow() + { + int32_t tabEntries = static_cast(_tabEntries.size()); + return std::min(tabEntries, MaxTabsPerRow); + } + + void PrepareWidgets() + { + // Add the base widgets + _widgets.clear(); + for (const auto& widget : WindowSceneryBaseWidgets) + { + _widgets.push_back(widget); + } + + // Remove WWT_LAST + auto lastWidget = _widgets.back(); + _widgets.pop_back(); + + // Add tabs + _actualMinHeight = WINDOW_SCENERY_MIN_HEIGHT; + int32_t xInit = InitTabPosX; + int32_t tabsInThisRow = 0; + + auto hasMisc = GetSceneryTabInfoForMisc() != nullptr; + auto maxTabsInThisRow = MaxTabsPerRow - 1 - (hasMisc ? 1 : 0); + + ScreenCoordsXY pos = { xInit, InitTabPosY }; + for (const auto& tabInfo : _tabEntries) + { + auto widget = MakeTab(pos, STR_STRING_DEFINED_TOOLTIP); + pos.x += TabWidth; + + if (tabInfo.IsMisc()) + { + widget.image = ImageId(SPR_TAB_QUESTION, FilterPaletteID::PaletteNull); + } + else if (tabInfo.IsAll()) + { + widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull); + } + else if (tabInfo.IsSceneryGroup()) + { + // Default tab image + widget.image = ImageId(SPR_TAB_QUESTION, FilterPaletteID::PaletteNull); + + // Scenery Group image + auto scgEntry = tabInfo.GetSceneryGroupEntry(); + if (scgEntry != nullptr) + { + widget.image = ImageId(scgEntry->image, colours[1]); + } + } + + _widgets.push_back(widget); + + tabsInThisRow++; + if (tabsInThisRow >= maxTabsInThisRow) + { + pos.x = xInit; + pos.y += TabHeight; + tabsInThisRow = 0; + _actualMinHeight += TabHeight; + maxTabsInThisRow = MaxTabsPerRow; + } + } + + _widgets.push_back(lastWidget); + + // Shift base widgets based on number of tab rows + int32_t shiftAmount = (GetTabRowCount() - 1) * TabHeight; + if (shiftAmount > 0) + { + _widgets[WIDX_SCENERY_LIST].top += shiftAmount; + _widgets[WIDX_SCENERY_LIST].bottom += shiftAmount; + _widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].bottom += shiftAmount; + _widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].bottom += shiftAmount; + _widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].bottom += shiftAmount; + _widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].bottom += shiftAmount; + _widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].bottom += shiftAmount; + _widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].bottom += shiftAmount; + _widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].top += shiftAmount; + _widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].bottom += shiftAmount; + _widgets[WIDX_FILTER_TEXT_BOX].top += shiftAmount; + _widgets[WIDX_FILTER_TEXT_BOX].bottom += shiftAmount; + _widgets[WIDX_FILTER_CLEAR_BUTTON].top += shiftAmount; + _widgets[WIDX_FILTER_CLEAR_BUTTON].bottom += shiftAmount; + } + + widgets = _widgets.data(); + } + + ScenerySelection GetSceneryIdByCursorPos(const ScreenCoordsXY& screenCoords) const + { + ScenerySelection scenery{}; + + const auto numColumns = GetNumColumns(); + const auto colIndex = screenCoords.x / SCENERY_BUTTON_WIDTH; + const auto rowIndex = screenCoords.y / SCENERY_BUTTON_HEIGHT; + if (colIndex >= 0 && colIndex < numColumns && rowIndex >= 0) + { + const auto tabSceneryIndex = static_cast((rowIndex * numColumns) + colIndex); + if (tabSceneryIndex < _filteredSceneryTab.Entries.size()) + { + return _filteredSceneryTab.Entries[tabSceneryIndex]; + } + } + return scenery; + } + + ScreenSize ContentScrollGetSize() const + { + auto rows = CountRows(); + return { 0, ContentRowsHeight(rows) }; + } + + void ContentScrollMouseDown(const ScreenCoordsXY& screenCoords) + { + const auto scenery = GetSceneryIdByCursorPos(screenCoords); + if (scenery.IsUndefined()) + return; + + auto lastScenery = GetSelectedScenery(_activeTabIndex); + if (lastScenery != scenery && !MatchFilter(lastScenery)) + { + _filteredSceneryTab.Entries.pop_front(); + } + SetSelectedScenery(_activeTabIndex, scenery); + + gWindowSceneryPaintEnabled &= 0xFE; + gWindowSceneryEyedropperEnabled = false; + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); + _hoverCounter = -16; + gSceneryPlaceCost = kMoney64Undefined; + Invalidate(); + } + + void ContentScrollMouseOver(const ScreenCoordsXY& screenCoords) + { + ScenerySelection scenery = GetSceneryIdByCursorPos(screenCoords); + if (!scenery.IsUndefined()) + { + _selectedScenery = scenery; + Invalidate(); + } + } + + std::pair GetNameAndPrice(ScenerySelection selectedScenery) + { + StringId name = STR_UNKNOWN_OBJECT_TYPE; + money64 price = kMoney64Undefined; + if (selectedScenery.IsUndefined() && gSceneryPlaceCost != kMoney64Undefined) + { + price = gSceneryPlaceCost; + } + else + { + switch (selectedScenery.SceneryType) + { + case SCENERY_TYPE_SMALL: + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_PATH_ITEM: + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_WALL: + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_LARGE: + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + case SCENERY_TYPE_BANNER: + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( + selectedScenery.EntryIndex); + if (sceneryEntry != nullptr) + { + price = sceneryEntry->price; + name = sceneryEntry->name; + } + break; + } + } + } + return { name, price }; + } + + void DrawTabs(DrawPixelInfo& dpi, const ScreenCoordsXY& offset) + { + for (size_t tabIndex = 0; tabIndex < _tabEntries.size(); tabIndex++) + { + auto widgetIndex = static_cast(WIDX_SCENERY_TAB_1 + tabIndex); + auto widgetCoordsXY = ScreenCoordsXY(widgets[widgetIndex].left, widgets[widgetIndex].top); + + if (_tabEntries[tabIndex].IsAll()) + { + auto imageId = ImageId(SPR_G2_INFINITY, FilterPaletteID::PaletteNull); + GfxDrawSprite(dpi, imageId, offset + widgetCoordsXY + ScreenCoordsXY(2, 6)); + } + } + } + + void DrawSceneryItem(DrawPixelInfo& dpi, ScenerySelection scenerySelection) + { + if (scenerySelection.SceneryType == SCENERY_TYPE_BANNER) + { + auto bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); + auto imageId = ImageId(bannerEntry->image + gWindowSceneryRotation * 2, gWindowSceneryPrimaryColour); + GfxDrawSprite(dpi, imageId, { 33, 40 }); + GfxDrawSprite(dpi, imageId.WithIndexOffset(1), { 33, 40 }); + } + else if (scenerySelection.SceneryType == SCENERY_TYPE_LARGE) + { + auto sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); + auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) + imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR) + imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_TERTIARY_COLOUR) + imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour); + GfxDrawSprite(dpi, imageId, { 33, 0 }); + } + else if (scenerySelection.SceneryType == SCENERY_TYPE_WALL) + { + auto wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); + auto imageId = ImageId(wallEntry->image); + auto spriteTop = (wallEntry->height * 2) + 0x32; + if (wallEntry->flags & WALL_SCENERY_HAS_GLASS) + { + imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); + if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + { + imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); + } + GfxDrawSprite(dpi, imageId, { 47, spriteTop }); + + auto glassImageId = ImageId(wallEntry->image + 6).WithTransparency(gWindowSceneryPrimaryColour); + GfxDrawSprite(dpi, glassImageId, { 47, spriteTop }); + } + else + { + imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); + if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + { + imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); + if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) + { + imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour); + } + } + GfxDrawSprite(dpi, imageId, { 47, spriteTop }); + + if (wallEntry->flags & WALL_SCENERY_IS_DOOR) + { + GfxDrawSprite(dpi, imageId.WithIndexOffset(1), { 47, spriteTop }); + } + } + } + else if (scenerySelection.SceneryType == SCENERY_TYPE_PATH_ITEM) + { + auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry( + scenerySelection.EntryIndex); + auto imageId = ImageId(pathAdditionEntry->image); + GfxDrawSprite(dpi, imageId, { 11, 16 }); + } + else + { + auto sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); + auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + { + imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) + { + imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); + } + } + if (sceneryEntry->flags & SMALL_SCENERY_FLAG_HAS_TERTIARY_COLOUR) + { + imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour); + } + + auto spriteTop = (sceneryEntry->height / 4) + 43; + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) + && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) + { + spriteTop -= 12; + } + + GfxDrawSprite(dpi, imageId, { 32, spriteTop }); + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) + { + imageId = ImageId(sceneryEntry->image + 4 + gWindowSceneryRotation) + .WithTransparency(gWindowSceneryPrimaryColour); + GfxDrawSprite(dpi, imageId, { 32, spriteTop }); + } + + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG)) + { + imageId = ImageId(sceneryEntry->image + 4 + gWindowSceneryRotation); + GfxDrawSprite(dpi, imageId, { 32, spriteTop }); + } + } + } + + void ContentScrollDraw(DrawPixelInfo& dpi) + { + GfxClear(&dpi, ColourMapA[colours[1]].mid_light); + + auto numColumns = GetNumColumns(); + auto tabIndex = _activeTabIndex; + if (tabIndex >= _tabEntries.size()) + { + return; + } + + ScreenCoordsXY topLeft{ 0, 0 }; + + for (size_t sceneryTabItemIndex = 0; sceneryTabItemIndex < _filteredSceneryTab.Entries.size(); + sceneryTabItemIndex++) + { + const auto& currentSceneryGlobal = _filteredSceneryTab.Entries[sceneryTabItemIndex]; + const auto tabSelectedScenery = GetSelectedScenery(tabIndex); + if (gWindowSceneryPaintEnabled == 1 || gWindowSceneryEyedropperEnabled) + { + if (_selectedScenery == currentSceneryGlobal) + { + GfxFillRectInset( + dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, + colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT); + } + } + else + { + if (tabSelectedScenery == currentSceneryGlobal) + { + GfxFillRectInset( + dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, + colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT)); + } + else if (_selectedScenery == currentSceneryGlobal) + { + GfxFillRectInset( + dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, + colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT); + } + } + + DrawPixelInfo clipdpi; + if (ClipDrawPixelInfo( + clipdpi, dpi, topLeft + ScreenCoordsXY{ 1, 1 }, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2)) + { + DrawSceneryItem(clipdpi, currentSceneryGlobal); + } + + topLeft.x += SCENERY_BUTTON_WIDTH; + if (topLeft.x >= numColumns * SCENERY_BUTTON_WIDTH) + { + topLeft.y += SCENERY_BUTTON_HEIGHT; + topLeft.x = 0; + } + } + } + }; + + WindowBase* WindowSceneryOpen() + { + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); + if (w == nullptr) + { + w = WindowCreate(WindowClass::Scenery); + } + return w; } - void SetSelectedItem( + void WindowScenerySetSelectedItem( const ScenerySelection& scenery, const std::optional primary, const std::optional secondary, const std::optional tertiary, const std::optional rotation) { - auto tabIndex = FindTabWithScenery(scenery); - if (!tabIndex.has_value()) + auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); + if (w != nullptr) { - return; - } - - _activeTabIndex = tabIndex.value(); - SetSelectedScenery(tabIndex.value(), scenery); - if (primary.has_value()) - { - gWindowSceneryPrimaryColour = primary.value(); - } - if (secondary.has_value()) - { - gWindowScenerySecondaryColour = secondary.value(); - } - if (tertiary.has_value()) - { - gWindowSceneryTertiaryColour = tertiary.value(); - } - if (rotation.has_value()) - { - gWindowSceneryRotation = rotation.value(); - } - gWindowSceneryEyedropperEnabled = false; - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, ContextGetWidth() / 2); - _hoverCounter = -16; - gSceneryPlaceCost = kMoney64Undefined; - Invalidate(); - } - - void SetSelectedTab(const ObjectEntryIndex sceneryGroupIndex) - { - const auto* tabInfo = GetSceneryTabInfoForGroup(sceneryGroupIndex); - if (tabInfo == nullptr) - { - tabInfo = &_tabEntries.back(); - } - const auto tabId = std::distance(&*_tabEntries.cbegin(), tabInfo); - - OnMouseDown(WIDX_SCENERY_TAB_1 + tabId); - } - - const ScenerySelection GetTabSelection() - { - return GetSelectedScenery(_activeTabIndex); - } - - void Init() - { - _tabEntries.clear(); - - for (ObjectEntryIndex scenerySetIndex = 0; scenerySetIndex < MaxTabs - ReservedTabCount; scenerySetIndex++) - { - const auto* sceneryGroupEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySetIndex); - if (sceneryGroupEntry != nullptr && SceneryGroupIsInvented(scenerySetIndex)) - { - SceneryTabInfo tabInfo; - tabInfo.SceneryGroupIndex = scenerySetIndex; - for (const auto& sceneryEntry : sceneryGroupEntry->SceneryEntries) - { - if (IsSceneryAvailableToBuild(sceneryEntry)) - { - tabInfo.AddEntryToBack(sceneryEntry); - } - } - if (tabInfo.Entries.size() > 0) - { - _tabEntries.push_back(std::move(tabInfo)); - } - } - } - - // Sort scenery group tabs before adding other tabs - SortTabs(); - - // Add misc and all tab - _tabEntries.emplace_back(SceneryWindow::SceneryTabInfo{ SCENERY_TAB_TYPE_MISC }); - _tabEntries.emplace_back(SceneryWindow::SceneryTabInfo{ SCENERY_TAB_TYPE_ALL }); - - // small scenery - for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_SMALL_SCENERY_OBJECTS; sceneryId++) - { - const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); - if (sceneryEntry != nullptr) - { - InitSceneryEntry({ SCENERY_TYPE_SMALL, sceneryId }, sceneryEntry->scenery_tab_id); - } - } - - // large scenery - for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_LARGE_SCENERY_OBJECTS; sceneryId++) - { - const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); - if (sceneryEntry != nullptr) - { - InitSceneryEntry({ SCENERY_TYPE_LARGE, sceneryId }, sceneryEntry->scenery_tab_id); - } - } - - // walls - for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_WALL_SCENERY_OBJECTS; sceneryId++) - { - const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); - if (sceneryEntry != nullptr) - { - InitSceneryEntry({ SCENERY_TYPE_WALL, sceneryId }, sceneryEntry->scenery_tab_id); - } - } - - // banners - for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_BANNER_OBJECTS; sceneryId++) - { - const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); - if (sceneryEntry != nullptr) - { - InitSceneryEntry({ SCENERY_TYPE_BANNER, sceneryId }, sceneryEntry->scenery_tab_id); - } - } - - for (ObjectEntryIndex sceneryId = 0; sceneryId < MAX_PATH_ADDITION_OBJECTS; sceneryId++) - { - const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryId); - if (sceneryEntry != nullptr) - { - InitSceneryEntry({ SCENERY_TYPE_PATH_ITEM, sceneryId }, sceneryEntry->scenery_tab_id); - } - } - - // Remove empty tabs - _tabEntries.erase( - std::remove_if( - _tabEntries.begin(), _tabEntries.end(), [](const SceneryTabInfo& tabInfo) { return tabInfo.Entries.empty(); }), - _tabEntries.end()); - - // Set required width - _requiredWidth = std::min(static_cast(_tabEntries.size()), MaxTabsPerRow) * TabWidth + 5; - - PrepareWidgets(); - WindowInvalidateByClass(WindowClass::Scenery); - } - - int32_t GetRequiredWidth() const - { - return std::max(_requiredWidth, WINDOW_SCENERY_MIN_WIDTH); - } - -private: - int32_t GetNumColumns() const - { - const auto& listWidget = widgets[WIDX_SCENERY_LIST]; - const auto contentWidth = listWidget.width() - kScrollBarWidth; - return contentWidth / SCENERY_BUTTON_WIDTH; - } - - template T CountRows(T items) const - { - const auto rows = items / GetNumColumns(); - return rows; - } - - size_t CountRows() const - { - const auto tabIndex = _activeTabIndex; - if (tabIndex >= _tabEntries.size()) - { - return 0; - } - - const auto totalItems = _filteredSceneryTab.Entries.size(); - const auto numColumns = GetNumColumns(); - const auto rows = CountRows(totalItems + numColumns - 1); - return rows; - } - - int32_t constexpr ContentRowsHeight(const size_t rows) const - { - return static_cast(rows * SCENERY_BUTTON_HEIGHT); - } - - void ContentUpdateScroll() - { - const auto tabIndex = _activeTabIndex; - if (tabIndex >= _tabEntries.size()) - { - return; - } - - SetFilteredScenery(tabIndex); - - const int32_t listHeight = height - 14 - widgets[WIDX_SCENERY_LIST].top - 1; - - const auto sceneryItem = ContentCountRowsWithSelectedItem(tabIndex); - scrolls[SceneryContentScrollIndex].v_bottom = ContentRowsHeight(sceneryItem.allRows) + 1; - - const int32_t maxTop = std::max(0, scrolls[SceneryContentScrollIndex].v_bottom - listHeight); - auto rowSelected = CountRows(sceneryItem.selected_item); - if (sceneryItem.scenerySelection.IsUndefined()) - { - auto& oldScenery = GetSelectedScenery(tabIndex); - if (!oldScenery.IsUndefined()) - { - // Make sure last selected scenery for tab is always present - _filteredSceneryTab.AddEntryToFront(oldScenery); - } - else - { - // No last selection was made, use blank ScenerySelection - SetSelectedScenery(tabIndex, ScenerySelection()); - rowSelected = 0; - if (!_filteredSceneryTab.Entries.empty()) - { - // Select first item in current filtered tab if available - const auto& scenery = _filteredSceneryTab.Entries.front(); - if (!scenery.IsUndefined()) - { - SetSelectedScenery(tabIndex, scenery); - } - } - } - } - - scrolls[SceneryContentScrollIndex].v_top = ContentRowsHeight(rowSelected); - scrolls[SceneryContentScrollIndex].v_top = std::min(maxTop, scrolls[SceneryContentScrollIndex].v_top); - - WidgetScrollUpdateThumbs(*this, WIDX_SCENERY_LIST); - } - - SceneryItem ContentCountRowsWithSelectedItem(const size_t tabIndex) - { - SceneryItem sceneryItem = { 0, 0, ScenerySelection() }; - const auto scenerySelection = GetSelectedScenery(tabIndex); - for (size_t i = 0; i < _filteredSceneryTab.Entries.size(); i++) - { - const auto& currentEntry = _filteredSceneryTab.Entries[i]; - if (currentEntry == scenerySelection) - { - sceneryItem.selected_item = static_cast(i); - sceneryItem.scenerySelection = scenerySelection; - } - } - sceneryItem.allRows = static_cast(CountRows(_filteredSceneryTab.Entries.size() + 8)); - return sceneryItem; - } - - const ScenerySelection GetSelectedScenery(const size_t tabIndex) - { - if (_tabSelections.size() > tabIndex) - { - return _tabSelections[tabIndex]; - } - return {}; - } - - void SetSelectedScenery(const size_t tabIndex, const ScenerySelection& value) - { - if (_tabSelections.size() <= tabIndex) - { - _tabSelections.resize(tabIndex + 1); - } - _tabSelections[tabIndex] = value; - } - - SceneryTabInfo* GetSceneryTabInfoForMisc() - { - if (_tabEntries.size() >= 2) - { - if (_tabEntries[_tabEntries.size() - 2].IsMisc()) - return &_tabEntries[_tabEntries.size() - 2]; - } - - return nullptr; - } - - SceneryTabInfo* GetSceneryTabInfoForAll() - { - if (!_tabEntries.empty()) - { - if (_tabEntries.back().IsAll()) - return &_tabEntries.back(); - } - - return nullptr; - } - - SceneryTabInfo* GetSceneryTabInfoForGroup(const ObjectEntryIndex sceneryGroupIndex) - { - for (auto& tabEntry : _tabEntries) - { - if (tabEntry.SceneryGroupIndex == sceneryGroupIndex) - return &tabEntry; - } - - return nullptr; - } - - std::optional FindTabWithScenery(const ScenerySelection& scenery) - { - for (size_t i = 0; i < _tabEntries.size(); i++) - { - const auto& tabInfo = _tabEntries[i]; - if (tabInfo.IsAll()) - { - // The scenery will be always added here so exclude this one. - continue; - } - if (tabInfo.Contains(scenery)) - { - return i; - } - } - return std::nullopt; - } - - void InitSceneryEntry(const ScenerySelection& selection, const ObjectEntryIndex sceneryGroupIndex) - { - Guard::ArgumentInRange(selection.EntryIndex, 0, OBJECT_ENTRY_INDEX_NULL); - - if (IsSceneryAvailableToBuild(selection)) - { - // Add scenery to all tab - auto* allTabInfo = GetSceneryTabInfoForAll(); - if (allTabInfo != nullptr) - { - allTabInfo->AddEntryToBack(selection); - } - - // Add scenery to primary group (usually trees or path additions) - if (sceneryGroupIndex != OBJECT_ENTRY_INDEX_NULL) - { - auto* tabInfo = GetSceneryTabInfoForGroup(sceneryGroupIndex); - if (tabInfo != nullptr) - { - tabInfo->AddEntryToBack(selection); - return; - } - } - - // If scenery has no tab, add it to misc - const auto tabIndex = FindTabWithScenery(selection); - if (!tabIndex.has_value()) - { - auto* tabInfo = GetSceneryTabInfoForMisc(); - if (tabInfo != nullptr) - { - tabInfo->AddEntryToBack(selection); - } - } + w->SetSelectedItem(scenery, primary, secondary, tertiary, rotation); } } - void SetFilteredScenery(const size_t tabIndex) + void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex) { - auto currentTab = _tabEntries[tabIndex]; - - _filteredSceneryTab.Entries.clear(); - _filteredSceneryTab.Filter = currentTab.Filter; - - for (auto selection : currentTab.Entries) + // Should this bring to front? + auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); + if (w != nullptr) { - if (MatchFilter(selection)) - _filteredSceneryTab.AddEntryToBack(selection); + return w->SetSelectedTab(sceneryGroupIndex); } } - bool MatchFilter(const ScenerySelection& selection) + // Used after removing objects, in order to avoid crashes. + void WindowSceneryResetSelectedSceneryItems() { - if (_filteredSceneryTab.Filter.empty()) - return true; - - auto& objManager = GetContext()->GetObjectManager(); - auto sceneryObjectType = GetObjectTypeFromSceneryType(selection.SceneryType); - auto sceneryObject = objManager.GetLoadedObject(sceneryObjectType, selection.EntryIndex); - - return IsFilterInName(*sceneryObject) || IsFilterInAuthors(*sceneryObject) || IsFilterInIdentifier(*sceneryObject) - || IsFilterInFilename(*sceneryObject); + _tabSelections.clear(); + _activeTabIndex = 0; } - bool IsFilterInName(const Object& object) + void WindowScenerySetDefaultPlacementConfiguration() { - return String::Contains(object.GetName(), _filteredSceneryTab.Filter, true); + gWindowSceneryRotation = 3; + gWindowSceneryPrimaryColour = COLOUR_BORDEAUX_RED; + gWindowScenerySecondaryColour = COLOUR_YELLOW; + gWindowSceneryTertiaryColour = COLOUR_DARK_BROWN; + + WindowSceneryResetSelectedSceneryItems(); } - bool IsFilterInAuthors(const Object& object) + const ScenerySelection WindowSceneryGetTabSelection() { - for (auto author : object.GetAuthors()) - if (String::Contains(author, _filteredSceneryTab.Filter, true)) - return true; - - return false; - } - - bool IsFilterInIdentifier(const Object& object) - { - return String::Contains(object.GetIdentifier(), _filteredSceneryTab.Filter, true); - } - - bool IsFilterInFilename(const Object& object) - { - auto repoItem = ObjectRepositoryFindObjectByEntry(&(object.GetObjectEntry())); - return String::Contains(repoItem->Path, _filteredSceneryTab.Filter, true); - } - - void SortTabs() - { - std::sort(_tabEntries.begin(), _tabEntries.end(), [](const SceneryTabInfo& a, const SceneryTabInfo& b) { - if (a.SceneryGroupIndex == b.SceneryGroupIndex) - return false; - - if (a.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) - return false; - if (b.SceneryGroupIndex == OBJECT_ENTRY_INDEX_NULL) - return true; - - const auto* entryA = a.GetSceneryGroupEntry(); - const auto* entryB = b.GetSceneryGroupEntry(); - return entryA->priority < entryB->priority; - }); - } - - int32_t GetTabRowCount() - { - return std::max((static_cast(_tabEntries.size()) + MaxTabsPerRow - 1) / MaxTabsPerRow, 0); - } - - int32_t GetMaxTabCountInARow() - { - int32_t tabEntries = static_cast(_tabEntries.size()); - return std::min(tabEntries, MaxTabsPerRow); - } - - void PrepareWidgets() - { - // Add the base widgets - _widgets.clear(); - for (const auto& widget : WindowSceneryBaseWidgets) + auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); + if (w != nullptr) { - _widgets.push_back(widget); - } - - // Remove WWT_LAST - auto lastWidget = _widgets.back(); - _widgets.pop_back(); - - // Add tabs - _actualMinHeight = WINDOW_SCENERY_MIN_HEIGHT; - int32_t xInit = InitTabPosX; - int32_t tabsInThisRow = 0; - - auto hasMisc = GetSceneryTabInfoForMisc() != nullptr; - auto maxTabsInThisRow = MaxTabsPerRow - 1 - (hasMisc ? 1 : 0); - - ScreenCoordsXY pos = { xInit, InitTabPosY }; - for (const auto& tabInfo : _tabEntries) - { - auto widget = MakeTab(pos, STR_STRING_DEFINED_TOOLTIP); - pos.x += TabWidth; - - if (tabInfo.IsMisc()) - { - widget.image = ImageId(SPR_TAB_QUESTION, FilterPaletteID::PaletteNull); - } - else if (tabInfo.IsAll()) - { - widget.image = ImageId(SPR_TAB, FilterPaletteID::PaletteNull); - } - else if (tabInfo.IsSceneryGroup()) - { - // Default tab image - widget.image = ImageId(SPR_TAB_QUESTION, FilterPaletteID::PaletteNull); - - // Scenery Group image - auto scgEntry = tabInfo.GetSceneryGroupEntry(); - if (scgEntry != nullptr) - { - widget.image = ImageId(scgEntry->image, colours[1]); - } - } - - _widgets.push_back(widget); - - tabsInThisRow++; - if (tabsInThisRow >= maxTabsInThisRow) - { - pos.x = xInit; - pos.y += TabHeight; - tabsInThisRow = 0; - _actualMinHeight += TabHeight; - maxTabsInThisRow = MaxTabsPerRow; - } - } - - _widgets.push_back(lastWidget); - - // Shift base widgets based on number of tab rows - int32_t shiftAmount = (GetTabRowCount() - 1) * TabHeight; - if (shiftAmount > 0) - { - _widgets[WIDX_SCENERY_LIST].top += shiftAmount; - _widgets[WIDX_SCENERY_LIST].bottom += shiftAmount; - _widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].bottom += shiftAmount; - _widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_REPAINT_SCENERY_BUTTON].bottom += shiftAmount; - _widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].bottom += shiftAmount; - _widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].bottom += shiftAmount; - _widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].bottom += shiftAmount; - _widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].bottom += shiftAmount; - _widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].top += shiftAmount; - _widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].bottom += shiftAmount; - _widgets[WIDX_FILTER_TEXT_BOX].top += shiftAmount; - _widgets[WIDX_FILTER_TEXT_BOX].bottom += shiftAmount; - _widgets[WIDX_FILTER_CLEAR_BUTTON].top += shiftAmount; - _widgets[WIDX_FILTER_CLEAR_BUTTON].bottom += shiftAmount; - } - - widgets = _widgets.data(); - } - - ScenerySelection GetSceneryIdByCursorPos(const ScreenCoordsXY& screenCoords) const - { - ScenerySelection scenery{}; - - const auto numColumns = GetNumColumns(); - const auto colIndex = screenCoords.x / SCENERY_BUTTON_WIDTH; - const auto rowIndex = screenCoords.y / SCENERY_BUTTON_HEIGHT; - if (colIndex >= 0 && colIndex < numColumns && rowIndex >= 0) - { - const auto tabSceneryIndex = static_cast((rowIndex * numColumns) + colIndex); - if (tabSceneryIndex < _filteredSceneryTab.Entries.size()) - { - return _filteredSceneryTab.Entries[tabSceneryIndex]; - } - } - return scenery; - } - - ScreenSize ContentScrollGetSize() const - { - auto rows = CountRows(); - return { 0, ContentRowsHeight(rows) }; - } - - void ContentScrollMouseDown(const ScreenCoordsXY& screenCoords) - { - const auto scenery = GetSceneryIdByCursorPos(screenCoords); - if (scenery.IsUndefined()) - return; - - auto lastScenery = GetSelectedScenery(_activeTabIndex); - if (lastScenery != scenery && !MatchFilter(lastScenery)) - { - _filteredSceneryTab.Entries.pop_front(); - } - SetSelectedScenery(_activeTabIndex, scenery); - - gWindowSceneryPaintEnabled &= 0xFE; - gWindowSceneryEyedropperEnabled = false; - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, windowPos.x + (width / 2)); - _hoverCounter = -16; - gSceneryPlaceCost = kMoney64Undefined; - Invalidate(); - } - - void ContentScrollMouseOver(const ScreenCoordsXY& screenCoords) - { - ScenerySelection scenery = GetSceneryIdByCursorPos(screenCoords); - if (!scenery.IsUndefined()) - { - _selectedScenery = scenery; - Invalidate(); - } - } - - std::pair GetNameAndPrice(ScenerySelection selectedScenery) - { - StringId name = STR_UNKNOWN_OBJECT_TYPE; - money64 price = kMoney64Undefined; - if (selectedScenery.IsUndefined() && gSceneryPlaceCost != kMoney64Undefined) - { - price = gSceneryPlaceCost; + return w->GetTabSelection(); } else { - switch (selectedScenery.SceneryType) - { - case SCENERY_TYPE_SMALL: - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; - } - case SCENERY_TYPE_PATH_ITEM: - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; - } - case SCENERY_TYPE_WALL: - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; - } - case SCENERY_TYPE_LARGE: - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; - } - case SCENERY_TYPE_BANNER: - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( - selectedScenery.EntryIndex); - if (sceneryEntry != nullptr) - { - price = sceneryEntry->price; - name = sceneryEntry->name; - } - break; - } - } + return {}; } - return { name, price }; } - void DrawTabs(DrawPixelInfo& dpi, const ScreenCoordsXY& offset) + void WindowSceneryInit() { - for (size_t tabIndex = 0; tabIndex < _tabEntries.size(); tabIndex++) + auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); + if (w != nullptr) { - auto widgetIndex = static_cast(WIDX_SCENERY_TAB_1 + tabIndex); - auto widgetCoordsXY = ScreenCoordsXY(widgets[widgetIndex].left, widgets[widgetIndex].top); - - if (_tabEntries[tabIndex].IsAll()) - { - auto imageId = ImageId(SPR_G2_INFINITY, FilterPaletteID::PaletteNull); - GfxDrawSprite(dpi, imageId, offset + widgetCoordsXY + ScreenCoordsXY(2, 6)); - } + w->Init(); } } - - void DrawSceneryItem(DrawPixelInfo& dpi, ScenerySelection scenerySelection) - { - if (scenerySelection.SceneryType == SCENERY_TYPE_BANNER) - { - auto bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); - auto imageId = ImageId(bannerEntry->image + gWindowSceneryRotation * 2, gWindowSceneryPrimaryColour); - GfxDrawSprite(dpi, imageId, { 33, 40 }); - GfxDrawSprite(dpi, imageId.WithIndexOffset(1), { 33, 40 }); - } - else if (scenerySelection.SceneryType == SCENERY_TYPE_LARGE) - { - auto sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); - auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) - imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR) - imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_TERTIARY_COLOUR) - imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour); - GfxDrawSprite(dpi, imageId, { 33, 0 }); - } - else if (scenerySelection.SceneryType == SCENERY_TYPE_WALL) - { - auto wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); - auto imageId = ImageId(wallEntry->image); - auto spriteTop = (wallEntry->height * 2) + 0x32; - if (wallEntry->flags & WALL_SCENERY_HAS_GLASS) - { - imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); - if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) - { - imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); - } - GfxDrawSprite(dpi, imageId, { 47, spriteTop }); - - auto glassImageId = ImageId(wallEntry->image + 6).WithTransparency(gWindowSceneryPrimaryColour); - GfxDrawSprite(dpi, glassImageId, { 47, spriteTop }); - } - else - { - imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); - if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) - { - imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); - if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) - { - imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour); - } - } - GfxDrawSprite(dpi, imageId, { 47, spriteTop }); - - if (wallEntry->flags & WALL_SCENERY_IS_DOOR) - { - GfxDrawSprite(dpi, imageId.WithIndexOffset(1), { 47, spriteTop }); - } - } - } - else if (scenerySelection.SceneryType == SCENERY_TYPE_PATH_ITEM) - { - auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); - auto imageId = ImageId(pathAdditionEntry->image); - GfxDrawSprite(dpi, imageId, { 11, 16 }); - } - else - { - auto sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(scenerySelection.EntryIndex); - auto imageId = ImageId(sceneryEntry->image + gWindowSceneryRotation); - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) - { - imageId = imageId.WithPrimary(gWindowSceneryPrimaryColour); - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_SECONDARY_COLOUR)) - { - imageId = imageId.WithSecondary(gWindowScenerySecondaryColour); - } - } - if (sceneryEntry->flags & SMALL_SCENERY_FLAG_HAS_TERTIARY_COLOUR) - { - imageId = imageId.WithTertiary(gWindowSceneryTertiaryColour); - } - - auto spriteTop = (sceneryEntry->height / 4) + 43; - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) - { - spriteTop -= 12; - } - - GfxDrawSprite(dpi, imageId, { 32, spriteTop }); - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_GLASS)) - { - imageId = ImageId(sceneryEntry->image + 4 + gWindowSceneryRotation) - .WithTransparency(gWindowSceneryPrimaryColour); - GfxDrawSprite(dpi, imageId, { 32, spriteTop }); - } - - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ANIMATED_FG)) - { - imageId = ImageId(sceneryEntry->image + 4 + gWindowSceneryRotation); - GfxDrawSprite(dpi, imageId, { 32, spriteTop }); - } - } - } - - void ContentScrollDraw(DrawPixelInfo& dpi) - { - GfxClear(&dpi, ColourMapA[colours[1]].mid_light); - - auto numColumns = GetNumColumns(); - auto tabIndex = _activeTabIndex; - if (tabIndex >= _tabEntries.size()) - { - return; - } - - ScreenCoordsXY topLeft{ 0, 0 }; - - for (size_t sceneryTabItemIndex = 0; sceneryTabItemIndex < _filteredSceneryTab.Entries.size(); sceneryTabItemIndex++) - { - const auto& currentSceneryGlobal = _filteredSceneryTab.Entries[sceneryTabItemIndex]; - const auto tabSelectedScenery = GetSelectedScenery(tabIndex); - if (gWindowSceneryPaintEnabled == 1 || gWindowSceneryEyedropperEnabled) - { - if (_selectedScenery == currentSceneryGlobal) - { - GfxFillRectInset( - dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, - colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT); - } - } - else - { - if (tabSelectedScenery == currentSceneryGlobal) - { - GfxFillRectInset( - dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, - colours[1], (INSET_RECT_FLAG_BORDER_INSET | INSET_RECT_FLAG_FILL_MID_LIGHT)); - } - else if (_selectedScenery == currentSceneryGlobal) - { - GfxFillRectInset( - dpi, { topLeft, topLeft + ScreenCoordsXY{ SCENERY_BUTTON_WIDTH - 1, SCENERY_BUTTON_HEIGHT - 1 } }, - colours[1], INSET_RECT_FLAG_FILL_MID_LIGHT); - } - } - - DrawPixelInfo clipdpi; - if (ClipDrawPixelInfo( - clipdpi, dpi, topLeft + ScreenCoordsXY{ 1, 1 }, SCENERY_BUTTON_WIDTH - 2, SCENERY_BUTTON_HEIGHT - 2)) - { - DrawSceneryItem(clipdpi, currentSceneryGlobal); - } - - topLeft.x += SCENERY_BUTTON_WIDTH; - if (topLeft.x >= numColumns * SCENERY_BUTTON_WIDTH) - { - topLeft.y += SCENERY_BUTTON_HEIGHT; - topLeft.x = 0; - } - } - } -}; - -WindowBase* WindowSceneryOpen() -{ - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); - if (w == nullptr) - { - w = WindowCreate(WindowClass::Scenery); - } - return w; -} - -void WindowScenerySetSelectedItem( - const ScenerySelection& scenery, const std::optional primary, const std::optional secondary, - const std::optional tertiary, const std::optional rotation) -{ - auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); - if (w != nullptr) - { - w->SetSelectedItem(scenery, primary, secondary, tertiary, rotation); - } -} - -void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex) -{ - // Should this bring to front? - auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); - if (w != nullptr) - { - return w->SetSelectedTab(sceneryGroupIndex); - } -} - -// Used after removing objects, in order to avoid crashes. -void WindowSceneryResetSelectedSceneryItems() -{ - _tabSelections.clear(); - _activeTabIndex = 0; -} - -void WindowScenerySetDefaultPlacementConfiguration() -{ - gWindowSceneryRotation = 3; - gWindowSceneryPrimaryColour = COLOUR_BORDEAUX_RED; - gWindowScenerySecondaryColour = COLOUR_YELLOW; - gWindowSceneryTertiaryColour = COLOUR_DARK_BROWN; - - WindowSceneryResetSelectedSceneryItems(); -} - -const ScenerySelection WindowSceneryGetTabSelection() -{ - auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); - if (w != nullptr) - { - return w->GetTabSelection(); - } - else - { - return {}; - } -} - -void WindowSceneryInit() -{ - auto* w = static_cast(WindowFindByClass(WindowClass::Scenery)); - if (w != nullptr) - { - w->Init(); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index d067c39b3e..cf1014d16b 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -15,26 +15,27 @@ #include #include #include - -enum WindowSceneryScatterWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PREVIEW, - WIDX_DECREMENT, - WIDX_INCREMENT, - WIDX_DENSITY, - WIDX_DENSITY_LOW, - WIDX_DENSITY_MEDIUM, - WIDX_DENSITY_HIGH -}; + enum WindowSceneryScatterWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PREVIEW, + WIDX_DECREMENT, + WIDX_INCREMENT, + WIDX_DENSITY, + WIDX_DENSITY_LOW, + WIDX_DENSITY_MEDIUM, + WIDX_DENSITY_HIGH + }; -bool gWindowSceneryScatterEnabled = false; -uint16_t gWindowSceneryScatterSize; -ScatterToolDensity gWindowSceneryScatterDensity; + bool gWindowSceneryScatterEnabled = false; + uint16_t gWindowSceneryScatterSize; + ScatterToolDensity gWindowSceneryScatterDensity; -// clang-format off + // clang-format off static Widget _sceneryScatterWidgets[] = { MakeWidget ({ 0, 0}, {86, 100}, WindowWidgetType::Frame, WindowColour::Secondary ), // panel / background MakeWidget ({ 1, 1}, {84, 14}, WindowWidgetType::Caption, WindowColour::Primary , STR_SCENERY_SCATTER, STR_WINDOW_TITLE_TIP ), // title bar @@ -50,161 +51,165 @@ static Widget _sceneryScatterWidgets[] = { MakeRemapWidget({55, 68}, {24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, SPR_G2_SCENERY_SCATTER_HIGH, STR_SCATTER_TOOL_DENSITY_HIGH ), // high amount kWidgetsEnd, }; -// clang-format on + // clang-format on -class SceneryScatterWindow final : public WindowBase -{ -public: - void OnOpen() override + class SceneryScatterWindow final : public WindowBase { - widgets = _sceneryScatterWidgets; - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); - WindowInitScrollWidgets(*this); - WindowPushOthersBelow(*this); - - gWindowSceneryScatterEnabled = true; - gWindowSceneryScatterSize = 16; - gWindowSceneryScatterDensity = ScatterToolDensity::MediumDensity; - } - - void OnClose() override - { - gWindowSceneryScatterEnabled = false; - } - - void InputSize(const WidgetIndex widgetIndex) - { - uint8_t maxLength = 0; - Formatter ft; - - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_PREVIEW: - ft.Add(kLandToolMinimumSize); - ft.Add(kLandToolMaximumSize); - maxLength = 3; - break; + widgets = _sceneryScatterWidgets; + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + WindowInitScrollWidgets(*this); + WindowPushOthersBelow(*this); + + gWindowSceneryScatterEnabled = true; + gWindowSceneryScatterSize = 16; + gWindowSceneryScatterDensity = ScatterToolDensity::MediumDensity; } - WindowTextInputOpen(this, widgetIndex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, maxLength); - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnClose() override { - case WIDX_CLOSE: - WindowClose(*this); - break; - - case WIDX_PREVIEW: - InputSize(widgetIndex); - break; - - case WIDX_DENSITY_LOW: - gWindowSceneryScatterDensity = ScatterToolDensity::LowDensity; - break; - - case WIDX_DENSITY_MEDIUM: - gWindowSceneryScatterDensity = ScatterToolDensity::MediumDensity; - break; - - case WIDX_DENSITY_HIGH: - gWindowSceneryScatterDensity = ScatterToolDensity::HighDensity; - break; + gWindowSceneryScatterEnabled = false; } - } - void OnMouseDown(const WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void InputSize(const WidgetIndex widgetIndex) { - case WIDX_DECREMENT: - // Decrement land tool size, if it stays within the limit - gWindowSceneryScatterSize = std::max(kLandToolMinimumSize, gWindowSceneryScatterSize - 1); - Invalidate(); - break; + uint8_t maxLength = 0; + Formatter ft; - case WIDX_INCREMENT: - // Increment land tool size, if it stays within the limit - gWindowSceneryScatterSize = std::min(kLandToolMaximumSize, gWindowSceneryScatterSize + 1); - Invalidate(); - break; - } - } - - void OnTextInput(const WidgetIndex widgetIndex, const std::string_view text) override - { - if (widgetIndex != WIDX_PREVIEW || text.empty()) - return; - - const auto res = String::Parse(text); - - if (res.has_value()) - { switch (widgetIndex) { case WIDX_PREVIEW: - gWindowSceneryScatterSize = std::clamp(res.value(), kLandToolMinimumSize, kLandToolMaximumSize); + ft.Add(kLandToolMinimumSize); + ft.Add(kLandToolMaximumSize); + maxLength = 3; break; } - Invalidate(); + WindowTextInputOpen( + this, widgetIndex, STR_SELECTION_SIZE, STR_ENTER_SELECTION_SIZE, ft, STR_NONE, STR_NONE, maxLength); } - } - void OnPrepareDraw() override - { - // Set the preview image button to be pressed down - pressed_widgets = (1uLL << WIDX_PREVIEW); - - // Set density buttons' pressed state. - switch (gWindowSceneryScatterDensity) + void OnMouseUp(WidgetIndex widgetIndex) override { - case ScatterToolDensity::LowDensity: - pressed_widgets |= (1uLL << WIDX_DENSITY_LOW); - break; + switch (widgetIndex) + { + case WIDX_CLOSE: + WindowClose(*this); + break; - case ScatterToolDensity::MediumDensity: - pressed_widgets |= (1uLL << WIDX_DENSITY_MEDIUM); - break; + case WIDX_PREVIEW: + InputSize(widgetIndex); + break; - case ScatterToolDensity::HighDensity: - pressed_widgets |= (1uLL << WIDX_DENSITY_HIGH); - break; + case WIDX_DENSITY_LOW: + gWindowSceneryScatterDensity = ScatterToolDensity::LowDensity; + break; + + case WIDX_DENSITY_MEDIUM: + gWindowSceneryScatterDensity = ScatterToolDensity::MediumDensity; + break; + + case WIDX_DENSITY_HIGH: + gWindowSceneryScatterDensity = ScatterToolDensity::HighDensity; + break; + } } - // Update the preview image (for tool sizes up to 7) - widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gWindowSceneryScatterSize)); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - WindowDrawWidgets(*this, dpi); - - // Draw area as a number for tool sizes bigger than 7 - if (gWindowSceneryScatterSize > kLandToolMaximumSizeWithSprite) + void OnMouseDown(const WidgetIndex widgetIndex) override { - const auto& preview = widgets[WIDX_PREVIEW]; - const auto screenCoords = ScreenCoordsXY{ windowPos.x + preview.midX(), windowPos.y + preview.midY() }; - auto ft = Formatter(); - ft.Add(gWindowSceneryScatterSize); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + switch (widgetIndex) + { + case WIDX_DECREMENT: + // Decrement land tool size, if it stays within the limit + gWindowSceneryScatterSize = std::max(kLandToolMinimumSize, gWindowSceneryScatterSize - 1); + Invalidate(); + break; + + case WIDX_INCREMENT: + // Increment land tool size, if it stays within the limit + gWindowSceneryScatterSize = std::min(kLandToolMaximumSize, gWindowSceneryScatterSize + 1); + Invalidate(); + break; + } } - } - void OnResize() override + void OnTextInput(const WidgetIndex widgetIndex, const std::string_view text) override + { + if (widgetIndex != WIDX_PREVIEW || text.empty()) + return; + + const auto res = String::Parse(text); + + if (res.has_value()) + { + switch (widgetIndex) + { + case WIDX_PREVIEW: + gWindowSceneryScatterSize = std::clamp( + res.value(), kLandToolMinimumSize, kLandToolMaximumSize); + break; + } + Invalidate(); + } + } + + void OnPrepareDraw() override + { + // Set the preview image button to be pressed down + pressed_widgets = (1uLL << WIDX_PREVIEW); + + // Set density buttons' pressed state. + switch (gWindowSceneryScatterDensity) + { + case ScatterToolDensity::LowDensity: + pressed_widgets |= (1uLL << WIDX_DENSITY_LOW); + break; + + case ScatterToolDensity::MediumDensity: + pressed_widgets |= (1uLL << WIDX_DENSITY_MEDIUM); + break; + + case ScatterToolDensity::HighDensity: + pressed_widgets |= (1uLL << WIDX_DENSITY_HIGH); + break; + } + + // Update the preview image (for tool sizes up to 7) + widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gWindowSceneryScatterSize)); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + WindowDrawWidgets(*this, dpi); + + // Draw area as a number for tool sizes bigger than 7 + if (gWindowSceneryScatterSize > kLandToolMaximumSizeWithSprite) + { + const auto& preview = widgets[WIDX_PREVIEW]; + const auto screenCoords = ScreenCoordsXY{ windowPos.x + preview.midX(), windowPos.y + preview.midY() }; + auto ft = Formatter(); + ft.Add(gWindowSceneryScatterSize); + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowSceneryScatterOpen() { - ResizeFrame(); - } -}; + // Check if window is already open + auto* window = WindowFindByClass(WindowClass::SceneryScatter); + if (window == nullptr) + { + window = WindowCreate(WindowClass::SceneryScatter, 86, 100, 0); + } -WindowBase* WindowSceneryScatterOpen() -{ - // Check if window is already open - auto* window = WindowFindByClass(WindowClass::SceneryScatter); - if (window == nullptr) - { - window = WindowCreate(WindowClass::SceneryScatter, 86, 100, 0); + return window; } - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index be342dcb81..3f520921e9 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -27,39 +27,41 @@ # include # include +namespace OpenRCT2::Ui::Windows +{ # define WWIDTH_MIN 500 # define WHEIGHT_MIN 300 # define WWIDTH_MAX 1200 # define WHEIGHT_MAX 800 # define ITEM_HEIGHT (3 + 9 + 3) -constexpr size_t MaxPlayerNameLength = 32; + constexpr size_t MaxPlayerNameLength = 32; -enum -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_PLAYER_NAME_INPUT, - WIDX_LIST, - WIDX_FETCH_SERVERS, - WIDX_ADD_SERVER, - WIDX_START_SERVER -}; + enum + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_PLAYER_NAME_INPUT, + WIDX_LIST, + WIDX_FETCH_SERVERS, + WIDX_ADD_SERVER, + WIDX_START_SERVER + }; -enum -{ - WIDX_LIST_REMOVE, - WIDX_LIST_SPECTATE -}; + enum + { + WIDX_LIST_REMOVE, + WIDX_LIST_SPECTATE + }; -enum -{ - DDIDX_JOIN, - DDIDX_FAVOURITE -}; + enum + { + DDIDX_JOIN, + DDIDX_FAVOURITE + }; -// clang-format off + // clang-format off static Widget _serverListWidgets[] = { MakeWidget({ 0, 0}, {341, 91}, WindowWidgetType::Frame, WindowColour::Primary ), // panel / background MakeWidget({ 1, 1}, {338, 14}, WindowWidgetType::Caption, WindowColour::Primary, STR_SERVER_LIST, STR_WINDOW_TITLE_TIP), // title bar @@ -71,513 +73,516 @@ static Widget _serverListWidgets[] = { MakeWidget({218, 53}, {101, 14}, WindowWidgetType::Button, WindowColour::Secondary, STR_START_SERVER ), // start server button kWidgetsEnd, }; -// clang-format on + // clang-format on -void JoinServer(std::string address); + void JoinServer(std::string address); -class ServerListWindow final : public Window -{ -private: - u8string _playerName; - ServerList _serverList; - std::future, StringId>> _fetchFuture; - uint32_t _numPlayersOnline = 0; - StringId _statusText = STR_SERVER_LIST_CONNECTING; + class ServerListWindow final : public Window + { + private: + u8string _playerName; + ServerList _serverList; + std::future, StringId>> _fetchFuture; + uint32_t _numPlayersOnline = 0; + StringId _statusText = STR_SERVER_LIST_CONNECTING; - bool _showNetworkVersionTooltip = false; - std::string _version; + bool _showNetworkVersionTooltip = false; + std::string _version; -public: + public: # pragma region Window Override Events - void OnOpen() override - { - _playerName = gConfigNetwork.PlayerName; - widgets = _serverListWidgets; - _serverListWidgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); - InitScrollWidgets(); - no_list_items = 0; - selected_list_item = -1; - frame_no = 0; - min_width = 320; - min_height = 90; - max_width = min_width; - max_height = min_height; - - page = 0; - list_information_type = 0; - - WindowSetResize(*this, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); - - no_list_items = static_cast(_serverList.GetCount()); - - ServerListFetchServersBegin(); - } - - void OnClose() override - { - _serverList = {}; - _fetchFuture = {}; - ConfigSaveDefault(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_PLAYER_NAME_INPUT: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _playerName.c_str(), MaxPlayerNameLength); - break; - case WIDX_LIST: + _playerName = gConfigNetwork.PlayerName; + widgets = _serverListWidgets; + _serverListWidgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); + InitScrollWidgets(); + no_list_items = 0; + selected_list_item = -1; + frame_no = 0; + min_width = 320; + min_height = 90; + max_width = min_width; + max_height = min_height; + + page = 0; + list_information_type = 0; + + WindowSetResize(*this, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); + + no_list_items = static_cast(_serverList.GetCount()); + + ServerListFetchServersBegin(); + } + + void OnClose() override + { + _serverList = {}; + _fetchFuture = {}; + ConfigSaveDefault(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) { - int32_t serverIndex = selected_list_item; - if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) + case WIDX_CLOSE: + Close(); + break; + case WIDX_PLAYER_NAME_INPUT: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _playerName.c_str(), MaxPlayerNameLength); + break; + case WIDX_LIST: { - const auto& server = _serverList.GetServer(serverIndex); - if (server.IsVersionValid()) + int32_t serverIndex = selected_list_item; + if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) { - JoinServer(server.Address); - } - else - { - Formatter ft; - ft.Add(server.Version.c_str()); - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); - } - } - break; - } - case WIDX_FETCH_SERVERS: - ServerListFetchServersBegin(); - break; - case WIDX_ADD_SERVER: - TextInputOpen(widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, STR_NONE, 0, 128); - break; - case WIDX_START_SERVER: - ContextOpenWindow(WindowClass::ServerStart); - break; - } - } - - void OnResize() override - { - WindowSetResize(*this, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (selectedIndex == -1) - { - return; - } - auto serverIndex = selected_list_item; - if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) - { - auto& server = _serverList.GetServer(serverIndex); - switch (selectedIndex) - { - case DDIDX_JOIN: - if (server.IsVersionValid()) - { - JoinServer(server.Address); - } - else - { - Formatter ft; - ft.Add(server.Version.c_str()); - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); + const auto& server = _serverList.GetServer(serverIndex); + if (server.IsVersionValid()) + { + JoinServer(server.Address); + } + else + { + Formatter ft; + ft.Add(server.Version.c_str()); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); + } } break; - case DDIDX_FAVOURITE: - { - server.Favourite = !server.Favourite; - _serverList.WriteFavourites(); } - break; + case WIDX_FETCH_SERVERS: + ServerListFetchServersBegin(); + break; + case WIDX_ADD_SERVER: + TextInputOpen(widgetIndex, STR_ADD_SERVER, STR_ENTER_HOSTNAME_OR_IP_ADDRESS, {}, STR_NONE, 0, 128); + break; + case WIDX_START_SERVER: + ContextOpenWindow(WindowClass::ServerStart); + break; } } - } - void OnUpdate() override - { - if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + void OnResize() override { - WindowUpdateTextboxCaret(); - InvalidateWidget(WIDX_PLAYER_NAME_INPUT); + WindowSetResize(*this, WWIDTH_MIN, WHEIGHT_MIN, WWIDTH_MAX, WHEIGHT_MAX); } - ServerListFetchServersCheck(); - } - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - return { 0, no_list_items * ITEM_HEIGHT }; - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t serverIndex = selected_list_item; - if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override { - const auto& server = _serverList.GetServer(serverIndex); - - const auto& listWidget = widgets[WIDX_LIST]; - - gDropdownItems[0].Format = STR_JOIN_GAME; - if (server.Favourite) + if (selectedIndex == -1) { - gDropdownItems[1].Format = STR_REMOVE_FROM_FAVOURITES; + return; } - else + auto serverIndex = selected_list_item; + if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) { - gDropdownItems[1].Format = STR_ADD_TO_FAVOURITES; + auto& server = _serverList.GetServer(serverIndex); + switch (selectedIndex) + { + case DDIDX_JOIN: + if (server.IsVersionValid()) + { + JoinServer(server.Address); + } + else + { + Formatter ft; + ft.Add(server.Version.c_str()); + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_MULTIPLAYER_INCORRECT_SOFTWARE_VERSION, ft); + } + break; + case DDIDX_FAVOURITE: + { + server.Favourite = !server.Favourite; + _serverList.WriteFavourites(); + } + break; + } } - auto dropdownPos = ScreenCoordsXY{ windowPos.x + listWidget.left + screenCoords.x + 2 - scrolls[0].h_left, - windowPos.y + listWidget.top + screenCoords.y + 2 - scrolls[0].v_top }; - WindowDropdownShowText(dropdownPos, 0, COLOUR_GREY, 0, 2); - } - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto& listWidget = widgets[WIDX_LIST]; - - int32_t itemIndex = screenCoords.y / ITEM_HEIGHT; - bool showNetworkVersionTooltip = false; - if (itemIndex < 0 || itemIndex >= no_list_items) - { - itemIndex = -1; - } - else - { - const int32_t iconX = listWidget.width() - kScrollBarWidth - 7 - 10; - showNetworkVersionTooltip = screenCoords.x > iconX; } - if (selected_list_item != itemIndex || _showNetworkVersionTooltip != showNetworkVersionTooltip) + void OnUpdate() override { - selected_list_item = itemIndex; - _showNetworkVersionTooltip = showNetworkVersionTooltip; - - listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; - WindowTooltipClose(); - - Invalidate(); - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - auto temp = u8string{ text }; - - switch (widgetIndex) - { - case WIDX_PLAYER_NAME_INPUT: - if (_playerName == text) - return; - - _playerName = temp; - gConfigNetwork.PlayerName = _playerName; - widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); - + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + { + WindowUpdateTextboxCaret(); InvalidateWidget(WIDX_PLAYER_NAME_INPUT); - break; + } + ServerListFetchServersCheck(); + } - case WIDX_ADD_SERVER: + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + return { 0, no_list_items * ITEM_HEIGHT }; + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t serverIndex = selected_list_item; + if (serverIndex >= 0 && serverIndex < static_cast(_serverList.GetCount())) { - ServerListEntry entry; - entry.Address = text; - entry.Name = text; - entry.Favourite = true; - _serverList.Add(entry); - _serverList.WriteFavourites(); - Invalidate(); - break; + const auto& server = _serverList.GetServer(serverIndex); + + const auto& listWidget = widgets[WIDX_LIST]; + + gDropdownItems[0].Format = STR_JOIN_GAME; + if (server.Favourite) + { + gDropdownItems[1].Format = STR_REMOVE_FROM_FAVOURITES; + } + else + { + gDropdownItems[1].Format = STR_ADD_TO_FAVOURITES; + } + auto dropdownPos = ScreenCoordsXY{ windowPos.x + listWidget.left + screenCoords.x + 2 - scrolls[0].h_left, + windowPos.y + listWidget.top + screenCoords.y + 2 - scrolls[0].v_top }; + WindowDropdownShowText(dropdownPos, 0, COLOUR_GREY, 0, 2); } } - } - OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override - { - auto ft = Formatter(); - ft.Add(_version.c_str()); - return { fallback, ft }; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, { COLOUR_WHITE }); - - // Draw version number - std::string version = NetworkGetVersion(); - auto ft = Formatter(); - ft.Add(version.c_str()); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 324, widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft, - { COLOUR_WHITE }); - - ft = Formatter(); - ft.Add(_numPlayersOnline); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, height - 15 }, _statusText, ft, { COLOUR_WHITE }); - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); - - auto& listWidget = widgets[WIDX_LIST]; - int32_t listWidgetWidth = listWidget.width(); - - ScreenCoordsXY screenCoords; - screenCoords.y = 0; - for (int32_t i = 0; i < no_list_items; i++) + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override { - if (screenCoords.y >= dpi.y + dpi.height) - continue; + auto& listWidget = widgets[WIDX_LIST]; - const auto& serverDetails = _serverList.GetServer(i); - bool highlighted = i == selected_list_item; - - // Draw hover highlight - if (highlighted) + int32_t itemIndex = screenCoords.y / ITEM_HEIGHT; + bool showNetworkVersionTooltip = false; + if (itemIndex < 0 || itemIndex >= no_list_items) { - GfxFilterRect( - dpi, { 0, screenCoords.y, listWidgetWidth, screenCoords.y + ITEM_HEIGHT }, FilterPaletteID::PaletteDarken1); - _version = serverDetails.Version; - } - - colour_t colour = colours[1]; - if (serverDetails.Favourite) - { - colour = COLOUR_YELLOW; - } - else if (serverDetails.Local) - { - colour = COLOUR_MOSS_GREEN; - } - - screenCoords.x = 3; - - // Before we draw the server info, we need to know how much room we'll need for player info. - char players[32] = { 0 }; - if (serverDetails.MaxPlayers > 0) - { - snprintf(players, sizeof(players), "%d/%d", serverDetails.Players, serverDetails.MaxPlayers); - } - const int16_t numPlayersStringWidth = GfxGetStringWidth(players, FontStyle::Medium); - - // How much space we have for the server info depends on the size of everything rendered after. - const int16_t spaceAvailableForInfo = listWidgetWidth - numPlayersStringWidth - kScrollBarWidth - 35; - - // Are we showing the server's name or description? - const char* serverInfoToShow = serverDetails.Name.c_str(); - if (highlighted && !serverDetails.Description.empty()) - { - serverInfoToShow = serverDetails.Description.c_str(); - } - - // Finally, draw the server information. - auto ft = Formatter(); - ft.Add(serverInfoToShow); - DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour }); - - int32_t right = listWidgetWidth - 7 - kScrollBarWidth; - - // Draw compatibility icon - right -= 10; - int32_t compatibilitySpriteId; - if (serverDetails.Version.empty()) - { - // Server not online... - compatibilitySpriteId = SPR_G2_RCT1_CLOSE_BUTTON_0; + itemIndex = -1; } else { - // Server online... check version - bool correctVersion = serverDetails.Version == NetworkGetVersion(); - compatibilitySpriteId = correctVersion ? SPR_G2_RCT1_OPEN_BUTTON_2 : SPR_G2_RCT1_CLOSE_BUTTON_2; + const int32_t iconX = listWidget.width() - kScrollBarWidth - 7 - 10; + showNetworkVersionTooltip = screenCoords.x > iconX; } - GfxDrawSprite(dpi, ImageId(compatibilitySpriteId), { right, screenCoords.y + 1 }); - right -= 4; - // Draw lock icon - right -= 8; - if (serverDetails.RequiresPassword) + if (selected_list_item != itemIndex || _showNetworkVersionTooltip != showNetworkVersionTooltip) { - GfxDrawSprite(dpi, ImageId(SPR_G2_LOCKED), { right, screenCoords.y + 4 }); + selected_list_item = itemIndex; + _showNetworkVersionTooltip = showNetworkVersionTooltip; + + listWidget.tooltip = showNetworkVersionTooltip ? static_cast(STR_NETWORK_VERSION_TIP) : STR_NONE; + WindowTooltipClose(); + + Invalidate(); + } + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (text.empty()) + return; + + auto temp = u8string{ text }; + + switch (widgetIndex) + { + case WIDX_PLAYER_NAME_INPUT: + if (_playerName == text) + return; + + _playerName = temp; + gConfigNetwork.PlayerName = _playerName; + widgets[WIDX_PLAYER_NAME_INPUT].string = const_cast(_playerName.c_str()); + + InvalidateWidget(WIDX_PLAYER_NAME_INPUT); + break; + + case WIDX_ADD_SERVER: + { + ServerListEntry entry; + entry.Address = text; + entry.Name = text; + entry.Favourite = true; + _serverList.Add(entry); + _serverList.WriteFavourites(); + Invalidate(); + break; + } + } + } + + OpenRCT2String OnTooltip(WidgetIndex widgetIndex, StringId fallback) override + { + auto ft = Formatter(); + ft.Add(_version.c_str()); + return { fallback, ft }; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PLAYER_NAME_INPUT].top }, STR_PLAYER_NAME, {}, + { COLOUR_WHITE }); + + // Draw version number + std::string version = NetworkGetVersion(); + auto ft = Formatter(); + ft.Add(version.c_str()); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 324, widgets[WIDX_START_SERVER].top + 1 }, STR_NETWORK_VERSION, ft, + { COLOUR_WHITE }); + + ft = Formatter(); + ft.Add(_numPlayersOnline); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 8, height - 15 }, _statusText, ft, { COLOUR_WHITE }); + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; + GfxClear(&dpi, paletteIndex); + + auto& listWidget = widgets[WIDX_LIST]; + int32_t listWidgetWidth = listWidget.width(); + + ScreenCoordsXY screenCoords; + screenCoords.y = 0; + for (int32_t i = 0; i < no_list_items; i++) + { + if (screenCoords.y >= dpi.y + dpi.height) + continue; + + const auto& serverDetails = _serverList.GetServer(i); + bool highlighted = i == selected_list_item; + + // Draw hover highlight + if (highlighted) + { + GfxFilterRect( + dpi, { 0, screenCoords.y, listWidgetWidth, screenCoords.y + ITEM_HEIGHT }, + FilterPaletteID::PaletteDarken1); + _version = serverDetails.Version; + } + + colour_t colour = colours[1]; + if (serverDetails.Favourite) + { + colour = COLOUR_YELLOW; + } + else if (serverDetails.Local) + { + colour = COLOUR_MOSS_GREEN; + } + + screenCoords.x = 3; + + // Before we draw the server info, we need to know how much room we'll need for player info. + char players[32] = { 0 }; + if (serverDetails.MaxPlayers > 0) + { + snprintf(players, sizeof(players), "%d/%d", serverDetails.Players, serverDetails.MaxPlayers); + } + const int16_t numPlayersStringWidth = GfxGetStringWidth(players, FontStyle::Medium); + + // How much space we have for the server info depends on the size of everything rendered after. + const int16_t spaceAvailableForInfo = listWidgetWidth - numPlayersStringWidth - kScrollBarWidth - 35; + + // Are we showing the server's name or description? + const char* serverInfoToShow = serverDetails.Name.c_str(); + if (highlighted && !serverDetails.Description.empty()) + { + serverInfoToShow = serverDetails.Description.c_str(); + } + + // Finally, draw the server information. + auto ft = Formatter(); + ft.Add(serverInfoToShow); + DrawTextEllipsised( + dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, spaceAvailableForInfo, STR_STRING, ft, { colour }); + + int32_t right = listWidgetWidth - 7 - kScrollBarWidth; + + // Draw compatibility icon + right -= 10; + int32_t compatibilitySpriteId; + if (serverDetails.Version.empty()) + { + // Server not online... + compatibilitySpriteId = SPR_G2_RCT1_CLOSE_BUTTON_0; + } + else + { + // Server online... check version + bool correctVersion = serverDetails.Version == NetworkGetVersion(); + compatibilitySpriteId = correctVersion ? SPR_G2_RCT1_OPEN_BUTTON_2 : SPR_G2_RCT1_CLOSE_BUTTON_2; + } + GfxDrawSprite(dpi, ImageId(compatibilitySpriteId), { right, screenCoords.y + 1 }); + right -= 4; + + // Draw lock icon + right -= 8; + if (serverDetails.RequiresPassword) + { + GfxDrawSprite(dpi, ImageId(SPR_G2_LOCKED), { right, screenCoords.y + 4 }); + } + right -= 6; + + // Draw number of players + screenCoords.x = right - numPlayersStringWidth; + GfxDrawString(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { colours[1] }); + + screenCoords.y += ITEM_HEIGHT; } - right -= 6; - - // Draw number of players - screenCoords.x = right - numPlayersStringWidth; - GfxDrawString(dpi, screenCoords + ScreenCoordsXY{ 0, 3 }, players, { colours[1] }); - - screenCoords.y += ITEM_HEIGHT; } - } # pragma endregion -private: - void ServerListFetchServersBegin() - { - if (_fetchFuture.valid()) + private: + void ServerListFetchServersBegin() { - // A fetch is already in progress - return; - } - - _serverList.Clear(); - _serverList.ReadAndAddFavourites(); - _statusText = STR_SERVER_LIST_CONNECTING; - - _fetchFuture = std::async(std::launch::async, [this] { - // Spin off background fetches - auto lanF = _serverList.FetchLocalServerListAsync(); - auto wanF = _serverList.FetchOnlineServerListAsync(); - - // Merge or deal with errors - std::vector allEntries; - try - { - auto entries = lanF.get(); - allEntries.reserve(entries.size()); - allEntries.insert(allEntries.end(), entries.begin(), entries.end()); - } - // TODO: Stop catching all exceptions - catch (...) + if (_fetchFuture.valid()) { + // A fetch is already in progress + return; } - auto status = STR_NONE; - try - { - auto entries = wanF.get(); - allEntries.reserve(allEntries.capacity() + entries.size()); - allEntries.insert(allEntries.end(), entries.begin(), entries.end()); - } - catch (const MasterServerException& e) - { - status = e.StatusText; - } - // TODO: Stop catching all exceptions - catch (...) - { - status = STR_SERVER_LIST_NO_CONNECTION; - } - return std::make_tuple(allEntries, status); - }); - } + _serverList.Clear(); + _serverList.ReadAndAddFavourites(); + _statusText = STR_SERVER_LIST_CONNECTING; - void ServerListFetchServersCheck() - { - if (_fetchFuture.valid()) - { - auto status = _fetchFuture.wait_for(std::chrono::seconds::zero()); - if (status == std::future_status::ready) - { + _fetchFuture = std::async(std::launch::async, [this] { + // Spin off background fetches + auto lanF = _serverList.FetchLocalServerListAsync(); + auto wanF = _serverList.FetchOnlineServerListAsync(); + + // Merge or deal with errors + std::vector allEntries; try { - auto [entries, statusText] = _fetchFuture.get(); - _serverList.AddOrUpdateRange(entries); - _serverList.WriteFavourites(); // Update favourites in case favourited server info changes - _numPlayersOnline = _serverList.GetTotalPlayerCount(); - _statusText = STR_X_PLAYERS_ONLINE; - if (statusText != STR_NONE) - { - _statusText = statusText; - } + auto entries = lanF.get(); + allEntries.reserve(entries.size()); + allEntries.insert(allEntries.end(), entries.begin(), entries.end()); + } + // TODO: Stop catching all exceptions + catch (...) + { + } + + auto status = STR_NONE; + try + { + auto entries = wanF.get(); + allEntries.reserve(allEntries.capacity() + entries.size()); + allEntries.insert(allEntries.end(), entries.begin(), entries.end()); } catch (const MasterServerException& e) { - _statusText = e.StatusText; + status = e.StatusText; } - catch (const std::exception& e) + // TODO: Stop catching all exceptions + catch (...) { - _statusText = STR_SERVER_LIST_NO_CONNECTION; - LOG_WARNING("Unable to connect to master server: %s", e.what()); + status = STR_SERVER_LIST_NO_CONNECTION; } - _fetchFuture = {}; - Invalidate(); - } + return std::make_tuple(allEntries, status); + }); } - } - void OnPrepareDraw() override - { - ResizeFrame(); - - int32_t margin = 6; - int32_t buttonHeight = 13; - int32_t buttonTop = height - margin - buttonHeight - 13; - int32_t buttonBottom = buttonTop + buttonHeight; - int32_t listBottom = buttonTop - margin; - - widgets[WIDX_PLAYER_NAME_INPUT].right = width - 6; - widgets[WIDX_LIST].left = 6; - widgets[WIDX_LIST].right = width - 6; - widgets[WIDX_LIST].bottom = listBottom; - widgets[WIDX_FETCH_SERVERS].top = buttonTop; - widgets[WIDX_FETCH_SERVERS].bottom = buttonBottom; - widgets[WIDX_ADD_SERVER].top = buttonTop; - widgets[WIDX_ADD_SERVER].bottom = buttonBottom; - widgets[WIDX_START_SERVER].top = buttonTop; - widgets[WIDX_START_SERVER].bottom = buttonBottom; - - no_list_items = static_cast(_serverList.GetCount()); - } -}; - -WindowBase* WindowServerListOpen() -{ - // Check if window is already open - auto* window = WindowBringToFrontByClass(WindowClass::ServerList); - if (window != nullptr) - return window; - - window = WindowCreate( - WindowClass::ServerList, WWIDTH_MIN, WHEIGHT_MIN, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); - - return window; -} - -void JoinServer(std::string address) -{ - int32_t port = NETWORK_DEFAULT_PORT; - auto endBracketIndex = address.find(']'); - auto colonIndex = address.find_last_of(':'); - if (colonIndex != std::string::npos) - { - if (auto dotIndex = address.find('.'); endBracketIndex != std::string::npos || dotIndex != std::string::npos) + void ServerListFetchServersCheck() { - auto ret = std::sscanf(&address[colonIndex + 1], "%d", &port); - assert(ret); - if (ret > 0) + if (_fetchFuture.valid()) { - address = address.substr(0, colonIndex); + auto status = _fetchFuture.wait_for(std::chrono::seconds::zero()); + if (status == std::future_status::ready) + { + try + { + auto [entries, statusText] = _fetchFuture.get(); + _serverList.AddOrUpdateRange(entries); + _serverList.WriteFavourites(); // Update favourites in case favourited server info changes + _numPlayersOnline = _serverList.GetTotalPlayerCount(); + _statusText = STR_X_PLAYERS_ONLINE; + if (statusText != STR_NONE) + { + _statusText = statusText; + } + } + catch (const MasterServerException& e) + { + _statusText = e.StatusText; + } + catch (const std::exception& e) + { + _statusText = STR_SERVER_LIST_NO_CONNECTION; + LOG_WARNING("Unable to connect to master server: %s", e.what()); + } + _fetchFuture = {}; + Invalidate(); + } } } - } - if (auto beginBracketIndex = address.find('['); - beginBracketIndex != std::string::npos && endBracketIndex != std::string::npos) + void OnPrepareDraw() override + { + ResizeFrame(); + + int32_t margin = 6; + int32_t buttonHeight = 13; + int32_t buttonTop = height - margin - buttonHeight - 13; + int32_t buttonBottom = buttonTop + buttonHeight; + int32_t listBottom = buttonTop - margin; + + widgets[WIDX_PLAYER_NAME_INPUT].right = width - 6; + widgets[WIDX_LIST].left = 6; + widgets[WIDX_LIST].right = width - 6; + widgets[WIDX_LIST].bottom = listBottom; + widgets[WIDX_FETCH_SERVERS].top = buttonTop; + widgets[WIDX_FETCH_SERVERS].bottom = buttonBottom; + widgets[WIDX_ADD_SERVER].top = buttonTop; + widgets[WIDX_ADD_SERVER].bottom = buttonBottom; + widgets[WIDX_START_SERVER].top = buttonTop; + widgets[WIDX_START_SERVER].bottom = buttonBottom; + + no_list_items = static_cast(_serverList.GetCount()); + } + }; + + WindowBase* WindowServerListOpen() { - address = address.substr(beginBracketIndex + 1, endBracketIndex - beginBracketIndex - 1); + // Check if window is already open + auto* window = WindowBringToFrontByClass(WindowClass::ServerList); + if (window != nullptr) + return window; + + window = WindowCreate( + WindowClass::ServerList, WWIDTH_MIN, WHEIGHT_MIN, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); + + return window; } - if (!NetworkBeginClient(address, port)) + void JoinServer(std::string address) { - ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); - } -} + int32_t port = NETWORK_DEFAULT_PORT; + auto endBracketIndex = address.find(']'); + auto colonIndex = address.find_last_of(':'); + if (colonIndex != std::string::npos) + { + if (auto dotIndex = address.find('.'); endBracketIndex != std::string::npos || dotIndex != std::string::npos) + { + auto ret = std::sscanf(&address[colonIndex + 1], "%d", &port); + assert(ret); + if (ret > 0) + { + address = address.substr(0, colonIndex); + } + } + } + if (auto beginBracketIndex = address.find('['); + beginBracketIndex != std::string::npos && endBracketIndex != std::string::npos) + { + address = address.substr(beginBracketIndex + 1, endBracketIndex - beginBracketIndex - 1); + } + + if (!NetworkBeginClient(address, port)) + { + ContextShowError(STR_UNABLE_TO_CONNECT_TO_SERVER, STR_NONE, {}); + } + } +} // namespace OpenRCT2::Ui::Windows #endif diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index c8bddae320..619bff5db9 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -22,9 +22,9 @@ # include # include -using namespace OpenRCT2; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -60,226 +60,231 @@ static Widget _windowServerStartWidgets[] = { MakeWidget({ 112, WH - 6 - 13 }, { 101, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_LOAD_GAME), // None kWidgetsEnd, }; -// clang-format on -class ServerStartWindow final : public Window -{ -public: - void OnOpen() override + // clang-format on + class ServerStartWindow final : public Window { - widgets = _windowServerStartWidgets; - widgets[WIDX_PORT_INPUT].string = _port; - widgets[WIDX_NAME_INPUT].string = _name; - widgets[WIDX_DESCRIPTION_INPUT].string = _description; - widgets[WIDX_GREETING_INPUT].string = _greeting; - widgets[WIDX_PASSWORD_INPUT].string = _password; - InitScrollWidgets(); - frame_no = 0; - min_width = width; - min_height = height; - max_width = min_width; - max_height = min_height; - - page = 0; - list_information_type = 0; - - snprintf(_port, 7, "%u", gConfigNetwork.DefaultPort); - SafeStrCpy(_name, gConfigNetwork.ServerName.c_str(), sizeof(_name)); - SafeStrCpy(_description, gConfigNetwork.ServerDescription.c_str(), sizeof(_description)); - SafeStrCpy(_greeting, gConfigNetwork.ServerGreeting.c_str(), sizeof(_greeting)); - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_PORT_INPUT: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _port, 6); - break; - case WIDX_NAME_INPUT: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _name, 64); - break; - case WIDX_DESCRIPTION_INPUT: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _description, MAX_SERVER_DESCRIPTION_LENGTH); - break; - case WIDX_GREETING_INPUT: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _greeting, CHAT_INPUT_SIZE); - break; - case WIDX_PASSWORD_INPUT: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _password, 32); - break; - case WIDX_MAXPLAYERS_INCREASE: - if (gConfigNetwork.Maxplayers < 255) - { - gConfigNetwork.Maxplayers++; - } - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_MAXPLAYERS_DECREASE: - if (gConfigNetwork.Maxplayers > 1) - { - gConfigNetwork.Maxplayers--; - } - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_ADVERTISE_CHECKBOX: - gConfigNetwork.Advertise = !gConfigNetwork.Advertise; - ConfigSaveDefault(); - Invalidate(); - break; - case WIDX_START_SERVER: - NetworkSetPassword(_password); - WindowScenarioselectOpen(ScenarioSelectCallback); - break; - case WIDX_LOAD_SERVER: - NetworkSetPassword(_password); - auto intent = Intent(WindowClass::Loadsave); - intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); - intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(LoadSaveCallback)); - ContextOpenIntent(&intent); - break; + widgets = _windowServerStartWidgets; + widgets[WIDX_PORT_INPUT].string = _port; + widgets[WIDX_NAME_INPUT].string = _name; + widgets[WIDX_DESCRIPTION_INPUT].string = _description; + widgets[WIDX_GREETING_INPUT].string = _greeting; + widgets[WIDX_PASSWORD_INPUT].string = _password; + InitScrollWidgets(); + frame_no = 0; + min_width = width; + min_height = height; + max_width = min_width; + max_height = min_height; + + page = 0; + list_information_type = 0; + + snprintf(_port, 7, "%u", gConfigNetwork.DefaultPort); + SafeStrCpy(_name, gConfigNetwork.ServerName.c_str(), sizeof(_name)); + SafeStrCpy(_description, gConfigNetwork.ServerDescription.c_str(), sizeof(_description)); + SafeStrCpy(_greeting, gConfigNetwork.ServerGreeting.c_str(), sizeof(_greeting)); } - } - void OnPrepareDraw() override - { - ColourSchemeUpdateByClass(this, WindowClass::ServerList); - - WidgetSetCheckboxValue(*this, WIDX_ADVERTISE_CHECKBOX, gConfigNetwork.Advertise); - auto ft = Formatter::Common(); - ft.Increment(18); - ft.Add(gConfigNetwork.Maxplayers); - } - void OnUpdate() override - { - if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + void OnMouseUp(WidgetIndex widgetIndex) override { - WindowUpdateTextboxCaret(); - WidgetInvalidate(*this, WIDX_NAME_INPUT); - WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT); - WidgetInvalidate(*this, WIDX_GREETING_INPUT); - WidgetInvalidate(*this, WIDX_PASSWORD_INPUT); + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_PORT_INPUT: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _port, 6); + break; + case WIDX_NAME_INPUT: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _name, 64); + break; + case WIDX_DESCRIPTION_INPUT: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _description, MAX_SERVER_DESCRIPTION_LENGTH); + break; + case WIDX_GREETING_INPUT: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _greeting, CHAT_INPUT_SIZE); + break; + case WIDX_PASSWORD_INPUT: + WindowStartTextbox(*this, widgetIndex, STR_STRING, _password, 32); + break; + case WIDX_MAXPLAYERS_INCREASE: + if (gConfigNetwork.Maxplayers < 255) + { + gConfigNetwork.Maxplayers++; + } + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_MAXPLAYERS_DECREASE: + if (gConfigNetwork.Maxplayers > 1) + { + gConfigNetwork.Maxplayers--; + } + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_ADVERTISE_CHECKBOX: + gConfigNetwork.Advertise = !gConfigNetwork.Advertise; + ConfigSaveDefault(); + Invalidate(); + break; + case WIDX_START_SERVER: + NetworkSetPassword(_password); + WindowScenarioselectOpen(ScenarioSelectCallback); + break; + case WIDX_LOAD_SERVER: + NetworkSetPassword(_password); + auto intent = Intent(WindowClass::Loadsave); + intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_LOAD | LOADSAVETYPE_GAME); + intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(LoadSaveCallback)); + ContextOpenIntent(&intent); + break; + } } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - std::string temp = static_cast(text); - int tempPort = 0; - - switch (widgetIndex) + void OnPrepareDraw() override { - case WIDX_PORT_INPUT: - if (strcmp(_port, temp.c_str()) == 0) - return; - - SafeStrCpy(_port, temp.c_str(), sizeof(_port)); - - // Don't allow negative/zero for port number - tempPort = atoi(_port); - if (tempPort > 0) - { - gConfigNetwork.DefaultPort = tempPort; - ConfigSaveDefault(); - } - - WidgetInvalidate(*this, WIDX_PORT_INPUT); - break; - case WIDX_NAME_INPUT: - if (strcmp(_name, temp.c_str()) == 0) - return; - - SafeStrCpy(_name, temp.c_str(), sizeof(_name)); - - // Don't allow empty server names - if (_name[0] != '\0') - { - gConfigNetwork.ServerName = _name; - ConfigSaveDefault(); - } + ColourSchemeUpdateByClass(this, WindowClass::ServerList); + WidgetSetCheckboxValue(*this, WIDX_ADVERTISE_CHECKBOX, gConfigNetwork.Advertise); + auto ft = Formatter::Common(); + ft.Increment(18); + ft.Add(gConfigNetwork.Maxplayers); + } + void OnUpdate() override + { + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + { + WindowUpdateTextboxCaret(); WidgetInvalidate(*this, WIDX_NAME_INPUT); - break; - case WIDX_DESCRIPTION_INPUT: - if (strcmp(_description, temp.c_str()) == 0) - return; - - SafeStrCpy(_description, temp.c_str(), sizeof(_description)); - gConfigNetwork.ServerDescription = _description; - ConfigSaveDefault(); - WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT); - break; - case WIDX_GREETING_INPUT: - if (strcmp(_greeting, temp.c_str()) == 0) - return; - - SafeStrCpy(_greeting, temp.c_str(), sizeof(_greeting)); - gConfigNetwork.ServerGreeting = _greeting; - ConfigSaveDefault(); - WidgetInvalidate(*this, WIDX_GREETING_INPUT); - break; - case WIDX_PASSWORD_INPUT: - if (strcmp(_password, temp.c_str()) == 0) - return; - - SafeStrCpy(_password, temp.c_str(), sizeof(_password)); - WidgetInvalidate(*this, WIDX_PASSWORD_INPUT); - break; + } } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PORT_INPUT].top }, STR_PORT, {}, { colours[1] }); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_NAME_INPUT].top }, STR_SERVER_NAME, {}, { colours[1] }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_DESCRIPTION_INPUT].top }, STR_SERVER_DESCRIPTION, {}, - { colours[1] }); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_GREETING_INPUT].top }, STR_SERVER_GREETING, {}, { colours[1] }); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PASSWORD_INPUT].top }, STR_PASSWORD, {}, { colours[1] }); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_MAXPLAYERS].top }, STR_MAX_PLAYERS, {}, { colours[1] }); - } - - void OnResize() override - { - ResizeFrame(); - } - -private: - char _port[7]; - char _name[65]; - char _description[MAX_SERVER_DESCRIPTION_LENGTH]; - char _greeting[CHAT_INPUT_SIZE]; - char _password[33]; - static void ScenarioSelectCallback(const utf8* path) - { - GameNotifyMapChange(); - if (GetContext()->LoadParkFromFile(path, false, true)) + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - NetworkBeginServer(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress); - } - } + std::string temp = static_cast(text); + int tempPort = 0; - static void LoadSaveCallback(int32_t result, const utf8* path) - { - if (result == MODAL_RESULT_OK) + switch (widgetIndex) + { + case WIDX_PORT_INPUT: + if (strcmp(_port, temp.c_str()) == 0) + return; + + SafeStrCpy(_port, temp.c_str(), sizeof(_port)); + + // Don't allow negative/zero for port number + tempPort = atoi(_port); + if (tempPort > 0) + { + gConfigNetwork.DefaultPort = tempPort; + ConfigSaveDefault(); + } + + WidgetInvalidate(*this, WIDX_PORT_INPUT); + break; + case WIDX_NAME_INPUT: + if (strcmp(_name, temp.c_str()) == 0) + return; + + SafeStrCpy(_name, temp.c_str(), sizeof(_name)); + + // Don't allow empty server names + if (_name[0] != '\0') + { + gConfigNetwork.ServerName = _name; + ConfigSaveDefault(); + } + + WidgetInvalidate(*this, WIDX_NAME_INPUT); + break; + case WIDX_DESCRIPTION_INPUT: + if (strcmp(_description, temp.c_str()) == 0) + return; + + SafeStrCpy(_description, temp.c_str(), sizeof(_description)); + gConfigNetwork.ServerDescription = _description; + ConfigSaveDefault(); + + WidgetInvalidate(*this, WIDX_DESCRIPTION_INPUT); + break; + case WIDX_GREETING_INPUT: + if (strcmp(_greeting, temp.c_str()) == 0) + return; + + SafeStrCpy(_greeting, temp.c_str(), sizeof(_greeting)); + gConfigNetwork.ServerGreeting = _greeting; + ConfigSaveDefault(); + + WidgetInvalidate(*this, WIDX_GREETING_INPUT); + break; + case WIDX_PASSWORD_INPUT: + if (strcmp(_password, temp.c_str()) == 0) + return; + + SafeStrCpy(_password, temp.c_str(), sizeof(_password)); + + WidgetInvalidate(*this, WIDX_PASSWORD_INPUT); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PORT_INPUT].top }, STR_PORT, {}, { colours[1] }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_NAME_INPUT].top }, STR_SERVER_NAME, {}, { colours[1] }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_DESCRIPTION_INPUT].top }, STR_SERVER_DESCRIPTION, {}, + { colours[1] }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_GREETING_INPUT].top }, STR_SERVER_GREETING, {}, + { colours[1] }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_PASSWORD_INPUT].top }, STR_PASSWORD, {}, { colours[1] }); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_MAXPLAYERS].top }, STR_MAX_PLAYERS, {}, { colours[1] }); + } + + void OnResize() override + { + ResizeFrame(); + } + + private: + char _port[7]; + char _name[65]; + char _description[MAX_SERVER_DESCRIPTION_LENGTH]; + char _greeting[CHAT_INPUT_SIZE]; + char _password[33]; + static void ScenarioSelectCallback(const utf8* path) { GameNotifyMapChange(); - GetContext()->LoadParkFromFile(path); - NetworkBeginServer(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress); + if (GetContext()->LoadParkFromFile(path, false, true)) + { + NetworkBeginServer(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress); + } } - } -}; -WindowBase* WindowServerStartOpen() -{ - return WindowFocusOrCreate(WindowClass::ServerStart, WW, WH, WF_CENTRE_SCREEN); -} + static void LoadSaveCallback(int32_t result, const utf8* path) + { + if (result == MODAL_RESULT_OK) + { + GameNotifyMapChange(); + GetContext()->LoadParkFromFile(path); + NetworkBeginServer(gConfigNetwork.DefaultPort, gConfigNetwork.ListenAddress); + } + } + }; + + WindowBase* WindowServerStartOpen() + { + return WindowFocusOrCreate(WindowClass::ServerStart, WW, WH, WF_CENTRE_SCREEN); + } +} // namespace OpenRCT2::Ui::Windows #endif diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 9d9360c094..99a3a8b781 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -16,30 +16,29 @@ #include #include -using namespace OpenRCT2; -using namespace OpenRCT2::Ui; - -WindowBase* ResetShortcutKeysPromptOpen(); - -static constexpr StringId WINDOW_TITLE = STR_SHORTCUTS_TITLE; -static constexpr int32_t WW = 420; -static constexpr int32_t WH = 280; - -static constexpr int32_t WW_SC_MAX = 1200; -static constexpr int32_t WH_SC_MAX = 800; - -enum WindowShortcutWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_TAB_CONTENT_PANEL, - WIDX_SCROLL, - WIDX_RESET, - WIDX_TAB_0, -}; + WindowBase* ResetShortcutKeysPromptOpen(); -// clang-format off + static constexpr StringId WINDOW_TITLE = STR_SHORTCUTS_TITLE; + static constexpr int32_t WW = 420; + static constexpr int32_t WH = 280; + + static constexpr int32_t WW_SC_MAX = 1200; + static constexpr int32_t WH_SC_MAX = 800; + + enum WindowShortcutWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_TAB_CONTENT_PANEL, + WIDX_SCROLL, + WIDX_RESET, + WIDX_TAB_0, + }; + + // clang-format off static Widget _shortcutWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({0, 43}, {350, 287}, WindowWidgetType::Resize, WindowColour::Secondary), @@ -47,578 +46,581 @@ static Widget _shortcutWidgets[] = { MakeWidget({4, WH-15}, {150, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_SHORTCUT_ACTION_RESET, STR_SHORTCUT_ACTION_RESET_TIP), kWidgetsEnd, }; -// clang-format on + // clang-format on -static constexpr StringId CHANGE_WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE; -static constexpr int32_t CHANGE_WW = 250; -static constexpr int32_t CHANGE_WH = 80; + static constexpr StringId CHANGE_WINDOW_TITLE = STR_SHORTCUT_CHANGE_TITLE; + static constexpr int32_t CHANGE_WW = 250; + static constexpr int32_t CHANGE_WH = 80; -enum -{ - WIDX_REMOVE = 3 -}; + enum + { + WIDX_REMOVE = 3 + }; -// clang-format off + // clang-format off static Widget window_shortcut_change_widgets[] = { WINDOW_SHIM(CHANGE_WINDOW_TITLE, CHANGE_WW, CHANGE_WH), MakeWidget({ 75, 56 }, { 100, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_SHORTCUT_REMOVE, STR_SHORTCUT_REMOVE_TIP), kWidgetsEnd, }; -// clang-format on + // clang-format on -class ChangeShortcutWindow final : public Window -{ -private: - std::string _shortcutId; - StringId _shortcutLocalisedName{}; - std::string _shortcutCustomName; - -public: - static ChangeShortcutWindow* Open(std::string_view shortcutId) + class ChangeShortcutWindow final : public Window { - auto& shortcutManager = GetShortcutManager(); - auto registeredShortcut = shortcutManager.GetShortcut(shortcutId); - if (registeredShortcut != nullptr) + private: + std::string _shortcutId; + StringId _shortcutLocalisedName{}; + std::string _shortcutCustomName; + + public: + static ChangeShortcutWindow* Open(std::string_view shortcutId) { - WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); - auto w = WindowCreate( - WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN); - if (w != nullptr) + auto& shortcutManager = GetShortcutManager(); + auto registeredShortcut = shortcutManager.GetShortcut(shortcutId); + if (registeredShortcut != nullptr) { - w->_shortcutId = shortcutId; - w->_shortcutLocalisedName = registeredShortcut->LocalisedName; - w->_shortcutCustomName = registeredShortcut->CustomName; - shortcutManager.SetPendingShortcutChange(registeredShortcut->Id); - return w; - } - } - return nullptr; - } - - void OnOpen() override - { - widgets = window_shortcut_change_widgets; - WindowInitScrollWidgets(*this); - } - - void OnClose() override - { - auto& shortcutManager = GetShortcutManager(); - shortcutManager.SetPendingShortcutChange({}); - NotifyShortcutKeysWindow(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_REMOVE: - Remove(); - break; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - ScreenCoordsXY stringCoords(windowPos.x + 125, windowPos.y + 30); - - auto ft = Formatter(); - if (_shortcutCustomName.empty()) - { - ft.Add(_shortcutLocalisedName); - } - else - { - ft.Add(STR_STRING); - ft.Add(_shortcutCustomName.c_str()); - } - DrawTextWrapped(dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE }); - } - -private: - void NotifyShortcutKeysWindow(); - - void Remove() - { - auto& shortcutManager = GetShortcutManager(); - auto* shortcut = shortcutManager.GetShortcut(_shortcutId); - if (shortcut != nullptr) - { - shortcut->Current.clear(); - shortcutManager.SaveUserBindings(); - } - Close(); - } -}; - -class ShortcutKeysWindow final : public Window -{ -private: - struct ShortcutStringPair - { - std::string ShortcutId; - ::StringId StringId = STR_NONE; - std::string CustomString; - std::string Binding; - }; - - struct ShortcutTabDesc - { - std::string_view IdGroup; - uint32_t ImageId; - uint32_t ImageDivisor; - uint32_t ImageNumFrames; - }; - - std::vector _tabs; - std::vector _widgets; - std::vector _list; - int_fast16_t _highlightedItem; - size_t _currentTabIndex{}; - uint32_t _tabAnimationIndex{}; - -public: - void OnOpen() override - { - InitialiseTabs(); - InitialiseWidgets(); - InitialiseList(); - - min_width = WW; - min_height = WH; - max_width = WW_SC_MAX; - max_height = WH_SC_MAX; - } - - void OnClose() override - { - WindowCloseByClass(WindowClass::ResetShortcutKeysPrompt); - } - - void OnResize() override - { - WindowSetResize(*this, min_width, min_height, max_width, max_height); - } - - void OnUpdate() override - { - // Remove highlight when the mouse is not hovering over the list - if (_highlightedItem != -1 && !WidgetIsHighlighted(*this, WIDX_SCROLL)) - { - _highlightedItem = -1; - InvalidateWidget(WIDX_SCROLL); - } - - _tabAnimationIndex++; - InvalidateWidget(static_cast(WIDX_TAB_0 + _currentTabIndex)); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_RESET: - ResetShortcutKeysPromptOpen(); - break; - default: - { - auto tabIndex = static_cast(widgetIndex - WIDX_TAB_0); - if (tabIndex < _tabs.size()) + WindowCloseByClass(WindowClass::ChangeKeyboardShortcut); + auto w = WindowCreate( + WindowClass::ChangeKeyboardShortcut, CHANGE_WW, CHANGE_WH, WF_CENTRE_SCREEN); + if (w != nullptr) { - SetTab(tabIndex); + w->_shortcutId = shortcutId; + w->_shortcutLocalisedName = registeredShortcut->LocalisedName; + w->_shortcutCustomName = registeredShortcut->CustomName; + shortcutManager.SetPendingShortcutChange(registeredShortcut->Id); + return w; } } + return nullptr; } - } - void OnPrepareDraw() override - { - ResizeFrameWithPage(); - widgets[WIDX_SCROLL].right = width - 5; - widgets[WIDX_SCROLL].bottom = height - 19; - widgets[WIDX_RESET].top = height - 16; - widgets[WIDX_RESET].bottom = height - 5; - WindowAlignTabs(this, WIDX_TAB_0, static_cast(WIDX_TAB_0 + _tabs.size())); - - // Set selected tab - for (size_t i = 0; i < _tabs.size(); i++) + void OnOpen() override { - SetWidgetPressed(static_cast(WIDX_TAB_0 + i), false); + widgets = window_shortcut_change_widgets; + WindowInitScrollWidgets(*this); } - SetWidgetPressed(static_cast(WIDX_TAB_0 + _currentTabIndex), true); - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - auto h = static_cast(_list.size() * SCROLLABLE_ROW_HEIGHT); - auto bottom = std::max(0, h - widgets[WIDX_SCROLL].bottom + widgets[WIDX_SCROLL].top + 21); - if (bottom < scrolls[0].v_top) + void OnClose() override { - scrolls[0].v_top = bottom; - Invalidate(); + auto& shortcutManager = GetShortcutManager(); + shortcutManager.SetPendingShortcutChange({}); + NotifyShortcutKeysWindow(); } - return { 0, h }; - } - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto index = static_cast((screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT); - if (static_cast(index) < _list.size()) + void OnMouseUp(WidgetIndex widgetIndex) override { - _highlightedItem = index; - Invalidate(); - } - else - { - _highlightedItem = -1; - } - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto selectedItem = static_cast((screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT); - if (selectedItem < _list.size()) - { - // Is this a separator? - if (!_list[selectedItem].ShortcutId.empty()) + switch (widgetIndex) { - auto& shortcut = _list[selectedItem]; - ChangeShortcutWindow::Open(shortcut.ShortcutId); + case WIDX_CLOSE: + Close(); + break; + case WIDX_REMOVE: + Remove(); + break; } } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; - GfxFillRect( - dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - - // TODO: the line below is a workaround for what is presumably a bug with dpi->width - // see https://github.com/OpenRCT2/OpenRCT2/issues/11238 for details - const auto scrollWidth = width - kScrollBarWidth - 10; - - for (size_t i = 0; i < _list.size(); ++i) + void OnDraw(DrawPixelInfo& dpi) override { - auto y = static_cast(1 + i * SCROLLABLE_ROW_HEIGHT); - if (y > dpi.y + dpi.height) - { - break; - } + DrawWidgets(dpi); - if (y + SCROLLABLE_ROW_HEIGHT < dpi.y) - { - continue; - } + ScreenCoordsXY stringCoords(windowPos.x + 125, windowPos.y + 30); - // Is this a separator? - if (_list[i].ShortcutId.empty()) + auto ft = Formatter(); + if (_shortcutCustomName.empty()) { - DrawSeparator(dpi, y, scrollWidth); + ft.Add(_shortcutLocalisedName); } else { - auto isHighlighted = _highlightedItem == static_cast(i); - DrawItem(dpi, y, scrollWidth, _list[i], isHighlighted); + ft.Add(STR_STRING); + ft.Add(_shortcutCustomName.c_str()); } + DrawTextWrapped(dpi, stringCoords, 242, STR_SHORTCUT_CHANGE_PROMPT, ft, { TextAlignment::CENTRE }); } - } - void RefreshBindings() - { - InitialiseList(); - } + private: + void NotifyShortcutKeysWindow(); - void ResetAllOnActiveTab() - { - auto& shortcutManager = GetShortcutManager(); - for (const auto& item : _list) + void Remove() { - auto shortcut = shortcutManager.GetShortcut(item.ShortcutId); + auto& shortcutManager = GetShortcutManager(); + auto* shortcut = shortcutManager.GetShortcut(_shortcutId); if (shortcut != nullptr) { - shortcut->Current = shortcut->Default; + shortcut->Current.clear(); + shortcutManager.SaveUserBindings(); } + Close(); } - shortcutManager.SaveUserBindings(); - RefreshBindings(); - } + }; -private: - bool IsInCurrentTab(const RegisteredShortcut& shortcut) + class ShortcutKeysWindow final : public Window { - auto groupFilter = _tabs[_currentTabIndex].IdGroup; - auto group = shortcut.GetTopLevelGroup(); - if (groupFilter.empty()) + private: + struct ShortcutStringPair { - // Check it doesn't belong in any other tab - for (const auto& tab : _tabs) + std::string ShortcutId; + ::StringId StringId = STR_NONE; + std::string CustomString; + std::string Binding; + }; + + struct ShortcutTabDesc + { + std::string_view IdGroup; + uint32_t ImageId; + uint32_t ImageDivisor; + uint32_t ImageNumFrames; + }; + + std::vector _tabs; + std::vector _widgets; + std::vector _list; + int_fast16_t _highlightedItem; + size_t _currentTabIndex{}; + uint32_t _tabAnimationIndex{}; + + public: + void OnOpen() override + { + InitialiseTabs(); + InitialiseWidgets(); + InitialiseList(); + + min_width = WW; + min_height = WH; + max_width = WW_SC_MAX; + max_height = WH_SC_MAX; + } + + void OnClose() override + { + WindowCloseByClass(WindowClass::ResetShortcutKeysPrompt); + } + + void OnResize() override + { + WindowSetResize(*this, min_width, min_height, max_width, max_height); + } + + void OnUpdate() override + { + // Remove highlight when the mouse is not hovering over the list + if (_highlightedItem != -1 && !WidgetIsHighlighted(*this, WIDX_SCROLL)) { - if (!tab.IdGroup.empty()) + _highlightedItem = -1; + InvalidateWidget(WIDX_SCROLL); + } + + _tabAnimationIndex++; + InvalidateWidget(static_cast(WIDX_TAB_0 + _currentTabIndex)); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_RESET: + ResetShortcutKeysPromptOpen(); + break; + default: { - if (tab.IdGroup == group) + auto tabIndex = static_cast(widgetIndex - WIDX_TAB_0); + if (tabIndex < _tabs.size()) { - return false; + SetTab(tabIndex); } } } - return true; } - return group == groupFilter; - } - - void InitialiseList() - { - // Get shortcuts and sort by group - auto shortcuts = GetShortcutsForCurrentTab(); - std::stable_sort(shortcuts.begin(), shortcuts.end(), [](const RegisteredShortcut* a, const RegisteredShortcut* b) { - return a->OrderIndex < b->OrderIndex; - }); - - // Create list items with a separator between each group - _list.clear(); - std::string group; - for (const auto* shortcut : shortcuts) + void OnPrepareDraw() override { - if (group.empty()) + ResizeFrameWithPage(); + widgets[WIDX_SCROLL].right = width - 5; + widgets[WIDX_SCROLL].bottom = height - 19; + widgets[WIDX_RESET].top = height - 16; + widgets[WIDX_RESET].bottom = height - 5; + WindowAlignTabs(this, WIDX_TAB_0, static_cast(WIDX_TAB_0 + _tabs.size())); + + // Set selected tab + for (size_t i = 0; i < _tabs.size(); i++) { - group = shortcut->GetGroup(); + SetWidgetPressed(static_cast(WIDX_TAB_0 + i), false); + } + SetWidgetPressed(static_cast(WIDX_TAB_0 + _currentTabIndex), true); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + auto h = static_cast(_list.size() * SCROLLABLE_ROW_HEIGHT); + auto bottom = std::max(0, h - widgets[WIDX_SCROLL].bottom + widgets[WIDX_SCROLL].top + 21); + if (bottom < scrolls[0].v_top) + { + scrolls[0].v_top = bottom; + Invalidate(); + } + return { 0, h }; + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + auto index = static_cast((screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT); + if (static_cast(index) < _list.size()) + { + _highlightedItem = index; + Invalidate(); } else { - auto groupName = shortcut->GetGroup(); - if (group != groupName) + _highlightedItem = -1; + } + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + auto selectedItem = static_cast((screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT); + if (selectedItem < _list.size()) + { + // Is this a separator? + if (!_list[selectedItem].ShortcutId.empty()) { - // Add separator - group = groupName; - _list.emplace_back(); + auto& shortcut = _list[selectedItem]; + ChangeShortcutWindow::Open(shortcut.ShortcutId); } } - - ShortcutStringPair ssp; - ssp.ShortcutId = shortcut->Id; - ssp.StringId = shortcut->LocalisedName; - ssp.CustomString = shortcut->CustomName; - ssp.Binding = shortcut->GetDisplayString(); - _list.push_back(std::move(ssp)); } - Invalidate(); - } - - std::vector GetShortcutsForCurrentTab() - { - std::vector result; - auto& shortcutManager = GetShortcutManager(); - for (const auto& shortcut : shortcutManager.Shortcuts) + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - if (IsInCurrentTab(shortcut.second)) + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + GfxFillRect( + dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, + ColourMapA[colours[1]].mid_light); + + // TODO: the line below is a workaround for what is presumably a bug with dpi->width + // see https://github.com/OpenRCT2/OpenRCT2/issues/11238 for details + const auto scrollWidth = width - kScrollBarWidth - 10; + + for (size_t i = 0; i < _list.size(); ++i) { - result.push_back(&shortcut.second); + auto y = static_cast(1 + i * SCROLLABLE_ROW_HEIGHT); + if (y > dpi.y + dpi.height) + { + break; + } + + if (y + SCROLLABLE_ROW_HEIGHT < dpi.y) + { + continue; + } + + // Is this a separator? + if (_list[i].ShortcutId.empty()) + { + DrawSeparator(dpi, y, scrollWidth); + } + else + { + auto isHighlighted = _highlightedItem == static_cast(i); + DrawItem(dpi, y, scrollWidth, _list[i], isHighlighted); + } } } - return result; - } - void InitialiseTabs() - { - _tabs.clear(); - _tabs.push_back({ "interface", SPR_TAB_GEARS_0, 2, 4 }); - _tabs.push_back({ "view", SPR_G2_VIEW, 0, 0 }); - _tabs.push_back({ "window", SPR_TAB_PARK_ENTRANCE, 0, 0 }); - _tabs.push_back({ {}, SPR_TAB_WRENCH_0, 2, 16 }); - } - - void InitialiseWidgets() - { - _widgets.clear(); - _widgets.insert(_widgets.begin(), std::begin(_shortcutWidgets), std::end(_shortcutWidgets) - 1); - - int32_t x = 3; - for (size_t i = 0; i < _tabs.size(); i++) + void RefreshBindings() { - auto tab = MakeTab({ x, 17 }, STR_NONE); - _widgets.push_back(tab); - x += 31; - } - - _widgets.push_back(kWidgetsEnd); - widgets = _widgets.data(); - - WindowInitScrollWidgets(*this); - } - - void SetTab(size_t index) - { - if (_currentTabIndex != index) - { - _currentTabIndex = index; - _tabAnimationIndex = 0; InitialiseList(); } - } - void DrawTabImages(DrawPixelInfo& dpi) const - { - for (size_t i = 0; i < _tabs.size(); i++) + void ResetAllOnActiveTab() { - DrawTabImage(dpi, i); - } - } - - void DrawTabImage(DrawPixelInfo& dpi, size_t tabIndex) const - { - const auto& tabDesc = _tabs[tabIndex]; - auto widgetIndex = static_cast(WIDX_TAB_0 + tabIndex); - if (!IsWidgetDisabled(widgetIndex)) - { - auto imageId = tabDesc.ImageId; - if (imageId != 0) + auto& shortcutManager = GetShortcutManager(); + for (const auto& item : _list) { - if (tabIndex == _currentTabIndex && tabDesc.ImageDivisor != 0 && tabDesc.ImageNumFrames != 0) + auto shortcut = shortcutManager.GetShortcut(item.ShortcutId); + if (shortcut != nullptr) { - auto frame = _tabAnimationIndex / tabDesc.ImageDivisor; - imageId += frame % tabDesc.ImageNumFrames; + shortcut->Current = shortcut->Default; + } + } + shortcutManager.SaveUserBindings(); + RefreshBindings(); + } + + private: + bool IsInCurrentTab(const RegisteredShortcut& shortcut) + { + auto groupFilter = _tabs[_currentTabIndex].IdGroup; + auto group = shortcut.GetTopLevelGroup(); + if (groupFilter.empty()) + { + // Check it doesn't belong in any other tab + for (const auto& tab : _tabs) + { + if (!tab.IdGroup.empty()) + { + if (tab.IdGroup == group) + { + return false; + } + } + } + return true; + } + + return group == groupFilter; + } + + void InitialiseList() + { + // Get shortcuts and sort by group + auto shortcuts = GetShortcutsForCurrentTab(); + std::stable_sort(shortcuts.begin(), shortcuts.end(), [](const RegisteredShortcut* a, const RegisteredShortcut* b) { + return a->OrderIndex < b->OrderIndex; + }); + + // Create list items with a separator between each group + _list.clear(); + std::string group; + for (const auto* shortcut : shortcuts) + { + if (group.empty()) + { + group = shortcut->GetGroup(); + } + else + { + auto groupName = shortcut->GetGroup(); + if (group != groupName) + { + // Add separator + group = groupName; + _list.emplace_back(); + } } - const auto& widget = widgets[widgetIndex]; - GfxDrawSprite(dpi, ImageId(imageId), windowPos + ScreenCoordsXY{ widget.left, widget.top }); + ShortcutStringPair ssp; + ssp.ShortcutId = shortcut->Id; + ssp.StringId = shortcut->LocalisedName; + ssp.CustomString = shortcut->CustomName; + ssp.Binding = shortcut->GetDisplayString(); + _list.push_back(std::move(ssp)); + } + + Invalidate(); + } + + std::vector GetShortcutsForCurrentTab() + { + std::vector result; + auto& shortcutManager = GetShortcutManager(); + for (const auto& shortcut : shortcutManager.Shortcuts) + { + if (IsInCurrentTab(shortcut.second)) + { + result.push_back(&shortcut.second); + } + } + return result; + } + + void InitialiseTabs() + { + _tabs.clear(); + _tabs.push_back({ "interface", SPR_TAB_GEARS_0, 2, 4 }); + _tabs.push_back({ "view", SPR_G2_VIEW, 0, 0 }); + _tabs.push_back({ "window", SPR_TAB_PARK_ENTRANCE, 0, 0 }); + _tabs.push_back({ {}, SPR_TAB_WRENCH_0, 2, 16 }); + } + + void InitialiseWidgets() + { + _widgets.clear(); + _widgets.insert(_widgets.begin(), std::begin(_shortcutWidgets), std::end(_shortcutWidgets) - 1); + + int32_t x = 3; + for (size_t i = 0; i < _tabs.size(); i++) + { + auto tab = MakeTab({ x, 17 }, STR_NONE); + _widgets.push_back(tab); + x += 31; + } + + _widgets.push_back(kWidgetsEnd); + widgets = _widgets.data(); + + WindowInitScrollWidgets(*this); + } + + void SetTab(size_t index) + { + if (_currentTabIndex != index) + { + _currentTabIndex = index; + _tabAnimationIndex = 0; + InitialiseList(); } } - } - void DrawSeparator(DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth) - { - const int32_t top = y + (SCROLLABLE_ROW_HEIGHT / 2) - 1; - GfxFillRect(dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark); - GfxFillRect(dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest); - } - - void DrawItem(DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth, const ShortcutStringPair& shortcut, bool isHighlighted) - { - auto format = STR_BLACK_STRING; - if (isHighlighted) + void DrawTabImages(DrawPixelInfo& dpi) const { - format = STR_WINDOW_COLOUR_2_STRINGID; - GfxFilterRect(dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1); + for (size_t i = 0; i < _tabs.size(); i++) + { + DrawTabImage(dpi, i); + } } - auto bindingOffset = (scrollWidth * 2) / 3; - auto ft = Formatter(); - ft.Add(STR_SHORTCUT_ENTRY_FORMAT); - if (shortcut.CustomString.empty()) + void DrawTabImage(DrawPixelInfo& dpi, size_t tabIndex) const { - ft.Add(shortcut.StringId); - } - else - { - ft.Add(STR_STRING); - ft.Add(shortcut.CustomString.c_str()); - } - DrawTextEllipsised(dpi, { 0, y - 1 }, bindingOffset, format, ft); + const auto& tabDesc = _tabs[tabIndex]; + auto widgetIndex = static_cast(WIDX_TAB_0 + tabIndex); + if (!IsWidgetDisabled(widgetIndex)) + { + auto imageId = tabDesc.ImageId; + if (imageId != 0) + { + if (tabIndex == _currentTabIndex && tabDesc.ImageDivisor != 0 && tabDesc.ImageNumFrames != 0) + { + auto frame = _tabAnimationIndex / tabDesc.ImageDivisor; + imageId += frame % tabDesc.ImageNumFrames; + } - if (!shortcut.Binding.empty()) - { - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(shortcut.Binding.c_str()); - DrawTextEllipsised(dpi, { bindingOffset, y - 1 }, 150, format, ft); + const auto& widget = widgets[widgetIndex]; + GfxDrawSprite(dpi, ImageId(imageId), windowPos + ScreenCoordsXY{ widget.left, widget.top }); + } + } } - } -}; -void ChangeShortcutWindow::NotifyShortcutKeysWindow() -{ - auto w = WindowFindByClass(WindowClass::KeyboardShortcutList); - if (w != nullptr) + void DrawSeparator(DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth) + { + const int32_t top = y + (SCROLLABLE_ROW_HEIGHT / 2) - 1; + GfxFillRect(dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark); + GfxFillRect(dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest); + } + + void DrawItem( + DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth, const ShortcutStringPair& shortcut, bool isHighlighted) + { + auto format = STR_BLACK_STRING; + if (isHighlighted) + { + format = STR_WINDOW_COLOUR_2_STRINGID; + GfxFilterRect(dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1); + } + + auto bindingOffset = (scrollWidth * 2) / 3; + auto ft = Formatter(); + ft.Add(STR_SHORTCUT_ENTRY_FORMAT); + if (shortcut.CustomString.empty()) + { + ft.Add(shortcut.StringId); + } + else + { + ft.Add(STR_STRING); + ft.Add(shortcut.CustomString.c_str()); + } + DrawTextEllipsised(dpi, { 0, y - 1 }, bindingOffset, format, ft); + + if (!shortcut.Binding.empty()) + { + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(shortcut.Binding.c_str()); + DrawTextEllipsised(dpi, { bindingOffset, y - 1 }, 150, format, ft); + } + } + }; + + void ChangeShortcutWindow::NotifyShortcutKeysWindow() { - static_cast(w)->RefreshBindings(); + auto w = WindowFindByClass(WindowClass::KeyboardShortcutList); + if (w != nullptr) + { + static_cast(w)->RefreshBindings(); + } } -} -WindowBase* WindowShortcutKeysOpen() -{ - auto w = WindowBringToFrontByClass(WindowClass::KeyboardShortcutList); - if (w == nullptr) + WindowBase* WindowShortcutKeysOpen() { - w = WindowCreate(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE); + auto w = WindowBringToFrontByClass(WindowClass::KeyboardShortcutList); + if (w == nullptr) + { + w = WindowCreate(WindowClass::KeyboardShortcutList, WW, WH, WF_RESIZABLE); + } + return w; } - return w; -} #pragma region Reset prompt -static constexpr int32_t RESET_PROMPT_WW = 200; -static constexpr int32_t RESET_PROMPT_WH = 80; + static constexpr int32_t RESET_PROMPT_WW = 200; + static constexpr int32_t RESET_PROMPT_WH = 80; -enum -{ - WIDX_RESET_PROMPT_BACKGROUND, - WIDX_RESET_PROMPT_TITLE, - WIDX_RESET_PROMPT_CLOSE, - WIDX_RESET_PROMPT_LABEL, - WIDX_RESET_PROMPT_RESET, - WIDX_RESET_PROMPT_CANCEL -}; - -static Widget WindowResetShortcutKeysPromptWidgets[] = { - WINDOW_SHIM_WHITE(STR_SHORTCUT_ACTION_RESET, RESET_PROMPT_WW, RESET_PROMPT_WH), - MakeWidget( - { 2, 30 }, { RESET_PROMPT_WW - 4, 12 }, WindowWidgetType::LabelCentred, WindowColour::Primary, - STR_RESET_SHORTCUT_KEYS_PROMPT), - MakeWidget({ 8, RESET_PROMPT_WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_RESET), - MakeWidget( - { RESET_PROMPT_WW - 95, RESET_PROMPT_WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, - STR_SAVE_PROMPT_CANCEL), - kWidgetsEnd, -}; - -class ResetShortcutKeysPrompt final : public Window -{ - void OnOpen() override + enum { - widgets = WindowResetShortcutKeysPromptWidgets; - } + WIDX_RESET_PROMPT_BACKGROUND, + WIDX_RESET_PROMPT_TITLE, + WIDX_RESET_PROMPT_CLOSE, + WIDX_RESET_PROMPT_LABEL, + WIDX_RESET_PROMPT_RESET, + WIDX_RESET_PROMPT_CANCEL + }; - void OnMouseUp(WidgetIndex widgetIndex) override + static Widget WindowResetShortcutKeysPromptWidgets[] = { + WINDOW_SHIM_WHITE(STR_SHORTCUT_ACTION_RESET, RESET_PROMPT_WW, RESET_PROMPT_WH), + MakeWidget( + { 2, 30 }, { RESET_PROMPT_WW - 4, 12 }, WindowWidgetType::LabelCentred, WindowColour::Primary, + STR_RESET_SHORTCUT_KEYS_PROMPT), + MakeWidget({ 8, RESET_PROMPT_WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, STR_RESET), + MakeWidget( + { RESET_PROMPT_WW - 95, RESET_PROMPT_WH - 22 }, { 85, 14 }, WindowWidgetType::Button, WindowColour::Primary, + STR_SAVE_PROMPT_CANCEL), + kWidgetsEnd, + }; + + class ResetShortcutKeysPrompt final : public Window { - switch (widgetIndex) + void OnOpen() override { - case WIDX_RESET_PROMPT_RESET: - { - auto w = WindowFindByClass(WindowClass::KeyboardShortcutList); - if (w != nullptr) - { - static_cast(w)->ResetAllOnActiveTab(); - } - Close(); - break; - } - case WIDX_RESET_PROMPT_CANCEL: - case WIDX_RESET_PROMPT_CLOSE: - Close(); - break; + widgets = WindowResetShortcutKeysPromptWidgets; } - } -}; -WindowBase* ResetShortcutKeysPromptOpen() -{ - return WindowFocusOrCreate( - WindowClass::ResetShortcutKeysPrompt, RESET_PROMPT_WW, RESET_PROMPT_WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); -} + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_RESET_PROMPT_RESET: + { + auto w = WindowFindByClass(WindowClass::KeyboardShortcutList); + if (w != nullptr) + { + static_cast(w)->ResetAllOnActiveTab(); + } + Close(); + break; + } + case WIDX_RESET_PROMPT_CANCEL: + case WIDX_RESET_PROMPT_CLOSE: + Close(); + break; + } + } + }; + + WindowBase* ResetShortcutKeysPromptOpen() + { + return WindowFocusOrCreate( + WindowClass::ResetShortcutKeysPrompt, RESET_PROMPT_WW, RESET_PROMPT_WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + } #pragma endregion +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 107205ce71..0584cea2e2 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -26,12 +26,13 @@ #include #include #include +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_SIGN; + static constexpr int32_t WW = 113; + static constexpr int32_t WH = 96; -static constexpr StringId WINDOW_TITLE = STR_SIGN; -static constexpr int32_t WW = 113; -static constexpr int32_t WH = 96; - -// clang-format off + // clang-format off enum WindowSignWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -54,319 +55,321 @@ static Widget _signWidgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class SignWindow final : public Window -{ -private: - bool _isSmall = false; - ObjectEntryIndex _sceneryEntry = OBJECT_ENTRY_INDEX_NULL; - colour_t _mainColour = {}; - colour_t _textColour = {}; - - BannerIndex GetBannerIndex() const + class SignWindow final : public Window { - return BannerIndex::FromUnderlying(number); - } + private: + bool _isSmall = false; + ObjectEntryIndex _sceneryEntry = OBJECT_ENTRY_INDEX_NULL; + colour_t _mainColour = {}; + colour_t _textColour = {}; - void ShowTextInput() - { - auto* banner = GetBanner(GetBannerIndex()); - if (banner != nullptr) + BannerIndex GetBannerIndex() const { - auto bannerText = banner->GetText(); - WindowTextInputRawOpen(this, WIDX_SIGN_TEXT, STR_SIGN_TEXT_TITLE, STR_SIGN_TEXT_PROMPT, {}, bannerText.c_str(), 32); - } - } - -public: - void OnOpen() override - { - widgets = _signWidgets; - WindowInitScrollWidgets(*this); - } - - /* - * Initializes the window and sets it's number and if it's small - * @return true if successfull - */ - bool Initialize(rct_windownumber windowNumber, const bool isSmall) - { - number = windowNumber; - _isSmall = isSmall; - auto* banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) - { - return false; + return BannerIndex::FromUnderlying(number); } - auto signViewPosition = banner->position.ToCoordsXY().ToTileCentre(); - auto* tileElement = BannerGetTileElement(GetBannerIndex()); - if (tileElement == nullptr) - return false; - - int32_t viewZ = tileElement->GetBaseZ(); - frame_no = viewZ; - - if (_isSmall) + void ShowTextInput() { - auto* wallElement = tileElement->AsWall(); - if (wallElement == nullptr) + auto* banner = GetBanner(GetBannerIndex()); + if (banner != nullptr) + { + auto bannerText = banner->GetText(); + WindowTextInputRawOpen( + this, WIDX_SIGN_TEXT, STR_SIGN_TEXT_TITLE, STR_SIGN_TEXT_PROMPT, {}, bannerText.c_str(), 32); + } + } + + public: + void OnOpen() override + { + widgets = _signWidgets; + WindowInitScrollWidgets(*this); + } + + /* + * Initializes the window and sets it's number and if it's small + * @return true if successfull + */ + bool Initialize(rct_windownumber windowNumber, const bool isSmall) + { + number = windowNumber; + _isSmall = isSmall; + auto* banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) { return false; } - _mainColour = wallElement->GetPrimaryColour(); - _textColour = wallElement->GetSecondaryColour(); - _sceneryEntry = wallElement->GetEntryIndex(); - } - else - { - auto* sceneryElement = tileElement->AsLargeScenery(); - if (sceneryElement == nullptr) - { + + auto signViewPosition = banner->position.ToCoordsXY().ToTileCentre(); + auto* tileElement = BannerGetTileElement(GetBannerIndex()); + if (tileElement == nullptr) return false; - } - _mainColour = sceneryElement->GetPrimaryColour(); - _textColour = sceneryElement->GetSecondaryColour(); - _sceneryEntry = sceneryElement->GetEntryIndex(); - } - // Create viewport - Widget& viewportWidget = widgets[WIDX_VIEWPORT]; - ViewportCreate( - this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, - viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ })); + int32_t viewZ = tileElement->GetBaseZ(); + frame_no = viewZ; - viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; - Invalidate(); - - return true; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - auto* banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) - { - Close(); - return; - } - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_SIGN_DEMOLISH: + if (_isSmall) { - auto* tileElement = BannerGetTileElement(GetBannerIndex()); - if (tileElement == nullptr) + auto* wallElement = tileElement->AsWall(); + if (wallElement == nullptr) { - Close(); - return; + return false; } - auto bannerCoords = banner->position.ToCoordsXY(); - - if (_isSmall) + _mainColour = wallElement->GetPrimaryColour(); + _textColour = wallElement->GetSecondaryColour(); + _sceneryEntry = wallElement->GetEntryIndex(); + } + else + { + auto* sceneryElement = tileElement->AsLargeScenery(); + if (sceneryElement == nullptr) { - CoordsXYZD wallLocation = { bannerCoords, tileElement->GetBaseZ(), tileElement->GetDirection() }; - auto wallRemoveAction = WallRemoveAction(wallLocation); - GameActions::Execute(&wallRemoveAction); + return false; } - else - { - auto sceneryRemoveAction = LargeSceneryRemoveAction( - { bannerCoords, tileElement->GetBaseZ(), tileElement->GetDirection() }, - tileElement->AsLargeScenery()->GetSequenceIndex()); - GameActions::Execute(&sceneryRemoveAction); - } - break; + _mainColour = sceneryElement->GetPrimaryColour(); + _textColour = sceneryElement->GetSecondaryColour(); + _sceneryEntry = sceneryElement->GetEntryIndex(); } - case WIDX_SIGN_TEXT: - ShowTextInput(); - break; - } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - Widget* widget = &widgets[widgetIndex]; - switch (widgetIndex) - { - case WIDX_MAIN_COLOUR: - WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), static_cast(_mainColour)); - break; - case WIDX_TEXT_COLOUR: - WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), static_cast(_textColour)); - break; - } - } + // Create viewport + Widget& viewportWidget = widgets[WIDX_VIEWPORT]; + ViewportCreate( + this, windowPos + ScreenCoordsXY{ viewportWidget.left + 1, viewportWidget.top + 1 }, viewportWidget.width() - 1, + viewportWidget.height() - 1, Focus(CoordsXYZ{ signViewPosition, viewZ })); - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - switch (widgetIndex) - { - case WIDX_MAIN_COLOUR: - { - if (dropdownIndex == -1) - return; - _mainColour = ColourDropDownIndexToColour(dropdownIndex); - auto signSetStyleAction = SignSetStyleAction(GetBannerIndex(), _mainColour, _textColour, !_isSmall); - GameActions::Execute(&signSetStyleAction); - break; - } - case WIDX_TEXT_COLOUR: - { - if (dropdownIndex == -1) - return; - _textColour = ColourDropDownIndexToColour(dropdownIndex); - auto signSetStyleAction = SignSetStyleAction(GetBannerIndex(), _mainColour, _textColour, !_isSmall); - GameActions::Execute(&signSetStyleAction); - break; - } - default: - return; - } - - Invalidate(); - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex == WIDX_SIGN_TEXT && !text.empty()) - { - auto signSetNameAction = SignSetNameAction(GetBannerIndex(), std::string(text)); - GameActions::Execute(&signSetNameAction); - } - } - - void OnPrepareDraw() override - { - Widget* main_colour_btn = &widgets[WIDX_MAIN_COLOUR]; - Widget* text_colour_btn = &widgets[WIDX_TEXT_COLOUR]; - - if (_isSmall) - { - auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryEntry); - - main_colour_btn->type = WindowWidgetType::Empty; - text_colour_btn->type = WindowWidgetType::Empty; - if (wallEntry == nullptr) - { - return; - } - if (wallEntry->flags & WALL_SCENERY_HAS_PRIMARY_COLOUR) - { - main_colour_btn->type = WindowWidgetType::ColourBtn; - } - if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) - { - text_colour_btn->type = WindowWidgetType::ColourBtn; - } - } - else - { - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryEntry); - - main_colour_btn->type = WindowWidgetType::Empty; - text_colour_btn->type = WindowWidgetType::Empty; - if (sceneryEntry == nullptr) - { - return; - } - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) - { - main_colour_btn->type = WindowWidgetType::ColourBtn; - } - if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR) - { - text_colour_btn->type = WindowWidgetType::ColourBtn; - } - } - - main_colour_btn->image = GetColourButtonImage(_mainColour); - text_colour_btn->image = GetColourButtonImage(_textColour); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - if (viewport != nullptr) - { - WindowDrawViewport(dpi, *this); - } - } - - void OnViewportRotate() override - { - RemoveViewport(); - - auto banner = GetBanner(GetBannerIndex()); - if (banner == nullptr) - { - return; - } - - auto signViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), frame_no }; - - // Create viewport - Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; - ViewportCreate( - this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, viewportWidget->width() - 1, - viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos })); - if (viewport != nullptr) viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; - Invalidate(); - } + Invalidate(); - void OnResize() override + return true; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + auto* banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) + { + Close(); + return; + } + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_SIGN_DEMOLISH: + { + auto* tileElement = BannerGetTileElement(GetBannerIndex()); + if (tileElement == nullptr) + { + Close(); + return; + } + auto bannerCoords = banner->position.ToCoordsXY(); + + if (_isSmall) + { + CoordsXYZD wallLocation = { bannerCoords, tileElement->GetBaseZ(), tileElement->GetDirection() }; + auto wallRemoveAction = WallRemoveAction(wallLocation); + GameActions::Execute(&wallRemoveAction); + } + else + { + auto sceneryRemoveAction = LargeSceneryRemoveAction( + { bannerCoords, tileElement->GetBaseZ(), tileElement->GetDirection() }, + tileElement->AsLargeScenery()->GetSequenceIndex()); + GameActions::Execute(&sceneryRemoveAction); + } + break; + } + case WIDX_SIGN_TEXT: + ShowTextInput(); + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + Widget* widget = &widgets[widgetIndex]; + switch (widgetIndex) + { + case WIDX_MAIN_COLOUR: + WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), static_cast(_mainColour)); + break; + case WIDX_TEXT_COLOUR: + WindowDropdownShowColour(this, widget, TRANSLUCENT(colours[1]), static_cast(_textColour)); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + switch (widgetIndex) + { + case WIDX_MAIN_COLOUR: + { + if (dropdownIndex == -1) + return; + _mainColour = ColourDropDownIndexToColour(dropdownIndex); + auto signSetStyleAction = SignSetStyleAction(GetBannerIndex(), _mainColour, _textColour, !_isSmall); + GameActions::Execute(&signSetStyleAction); + break; + } + case WIDX_TEXT_COLOUR: + { + if (dropdownIndex == -1) + return; + _textColour = ColourDropDownIndexToColour(dropdownIndex); + auto signSetStyleAction = SignSetStyleAction(GetBannerIndex(), _mainColour, _textColour, !_isSmall); + GameActions::Execute(&signSetStyleAction); + break; + } + default: + return; + } + + Invalidate(); + } + + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex == WIDX_SIGN_TEXT && !text.empty()) + { + auto signSetNameAction = SignSetNameAction(GetBannerIndex(), std::string(text)); + GameActions::Execute(&signSetNameAction); + } + } + + void OnPrepareDraw() override + { + Widget* main_colour_btn = &widgets[WIDX_MAIN_COLOUR]; + Widget* text_colour_btn = &widgets[WIDX_TEXT_COLOUR]; + + if (_isSmall) + { + auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryEntry); + + main_colour_btn->type = WindowWidgetType::Empty; + text_colour_btn->type = WindowWidgetType::Empty; + if (wallEntry == nullptr) + { + return; + } + if (wallEntry->flags & WALL_SCENERY_HAS_PRIMARY_COLOUR) + { + main_colour_btn->type = WindowWidgetType::ColourBtn; + } + if (wallEntry->flags & WALL_SCENERY_HAS_SECONDARY_COLOUR) + { + text_colour_btn->type = WindowWidgetType::ColourBtn; + } + } + else + { + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryEntry); + + main_colour_btn->type = WindowWidgetType::Empty; + text_colour_btn->type = WindowWidgetType::Empty; + if (sceneryEntry == nullptr) + { + return; + } + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR) + { + main_colour_btn->type = WindowWidgetType::ColourBtn; + } + if (sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_SECONDARY_COLOUR) + { + text_colour_btn->type = WindowWidgetType::ColourBtn; + } + } + + main_colour_btn->image = GetColourButtonImage(_mainColour); + text_colour_btn->image = GetColourButtonImage(_textColour); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + if (viewport != nullptr) + { + WindowDrawViewport(dpi, *this); + } + } + + void OnViewportRotate() override + { + RemoveViewport(); + + auto banner = GetBanner(GetBannerIndex()); + if (banner == nullptr) + { + return; + } + + auto signViewPos = CoordsXYZ{ banner->position.ToCoordsXY().ToTileCentre(), frame_no }; + + // Create viewport + Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; + ViewportCreate( + this, windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }, + viewportWidget->width() - 1, viewportWidget->height() - 1, Focus(CoordsXYZ{ signViewPos })); + if (viewport != nullptr) + viewport->flags = gConfigGeneral.AlwaysShowGridlines ? VIEWPORT_FLAG_GRIDLINES : VIEWPORT_FLAG_NONE; + Invalidate(); + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + /** + * + * rct2: 0x006BA305 + */ + WindowBase* WindowSignOpen(rct_windownumber number) { - ResizeFrame(); + auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + + if (w != nullptr) + return w; + + w = WindowCreate(WindowClass::Banner, WW, WH, 0); + + if (w == nullptr) + return nullptr; + + bool result = w->Initialize(number, false); + if (result != true) + return nullptr; + + return w; } -}; -/** - * - * rct2: 0x006BA305 - */ -WindowBase* WindowSignOpen(rct_windownumber number) -{ - auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + /** + * + * rct2: 0x6E5F52 + */ + WindowBase* WindowSignSmallOpen(rct_windownumber number) + { + auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); + + if (w != nullptr) + return w; + + w = WindowCreate(WindowClass::Banner, WW, WH, 0); + + if (w == nullptr) + return nullptr; + + bool result = w->Initialize(number, true); + if (result != true) + return nullptr; - if (w != nullptr) return w; - - w = WindowCreate(WindowClass::Banner, WW, WH, 0); - - if (w == nullptr) - return nullptr; - - bool result = w->Initialize(number, false); - if (result != true) - return nullptr; - - return w; -} - -/** - * - * rct2: 0x6E5F52 - */ -WindowBase* WindowSignSmallOpen(rct_windownumber number) -{ - auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); - - if (w != nullptr) - return w; - - w = WindowCreate(WindowClass::Banner, WW, WH, 0); - - if (w == nullptr) - return nullptr; - - bool result = w->Initialize(number, true); - if (result != true) - return nullptr; - - return w; -} + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index ba50504a93..e98a3d52b0 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -35,51 +35,51 @@ #include #include -using namespace OpenRCT2; - -static constexpr StringId WINDOW_TITLE = STR_STRINGID; - -static constexpr int32_t WW = 190; -static constexpr int32_t WH = 180; - -enum WindowStaffPage +namespace OpenRCT2::Ui::Windows { - WINDOW_STAFF_OVERVIEW, - WINDOW_STAFF_OPTIONS, - WINDOW_STAFF_STATISTICS, - WINDOW_STAFF_PAGE_COUNT, -}; + static constexpr StringId WINDOW_TITLE = STR_STRINGID; -enum WindowStaffWidgetIdx -{ - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_RESIZE, - WIDX_TAB_1, - WIDX_TAB_2, - WIDX_TAB_3, + static constexpr int32_t WW = 190; + static constexpr int32_t WH = 180; - WIDX_VIEWPORT = 7, - WIDX_BTM_LABEL, - WIDX_PICKUP, - WIDX_PATROL, - WIDX_RENAME, - WIDX_LOCATE, - WIDX_FIRE, + enum WindowStaffPage + { + WINDOW_STAFF_OVERVIEW, + WINDOW_STAFF_OPTIONS, + WINDOW_STAFF_STATISTICS, + WINDOW_STAFF_PAGE_COUNT, + }; - WIDX_CHECKBOX_1 = 7, - WIDX_CHECKBOX_2, - WIDX_CHECKBOX_3, - WIDX_CHECKBOX_4, - WIDX_COSTUME_BOX, - WIDX_COSTUME_BTN, -}; + enum WindowStaffWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_RESIZE, + WIDX_TAB_1, + WIDX_TAB_2, + WIDX_TAB_3, -validate_global_widx(WC_PEEP, WIDX_PATROL); -validate_global_widx(WC_STAFF, WIDX_PICKUP); + WIDX_VIEWPORT = 7, + WIDX_BTM_LABEL, + WIDX_PICKUP, + WIDX_PATROL, + WIDX_RENAME, + WIDX_LOCATE, + WIDX_FIRE, -// clang-format off + WIDX_CHECKBOX_1 = 7, + WIDX_CHECKBOX_2, + WIDX_CHECKBOX_3, + WIDX_CHECKBOX_4, + WIDX_COSTUME_BOX, + WIDX_COSTUME_BTN, + }; + + validate_global_widx(WC_PEEP, WIDX_PATROL); + validate_global_widx(WC_STAFF, WIDX_PICKUP); + + // clang-format off #define MAIN_STAFF_WIDGETS \ WINDOW_SHIM(WINDOW_TITLE, WW, WH), \ MakeWidget({ 0, 43}, {190, 137}, WindowWidgetType::Resize, WindowColour::Secondary), /* Resize */ \ @@ -110,1150 +110,1152 @@ static Widget _staffOptionsWidgets[] = { MakeWidget ({WW - 17, 51}, { 11, 10}, WindowWidgetType::Button, WindowColour::Secondary, STR_DROPDOWN_GLYPH, STR_SELECT_COSTUME_TIP), // Costume Dropdown Button kWidgetsEnd, }; -// clang-format on + // clang-format on -// 0x9AF9F4 -static Widget _staffStatsWidgets[] = { - MAIN_STAFF_WIDGETS, - kWidgetsEnd, -}; + // 0x9AF9F4 + static Widget _staffStatsWidgets[] = { + MAIN_STAFF_WIDGETS, + kWidgetsEnd, + }; -static Widget* window_staff_page_widgets[] = { - _staffOverviewWidgets, - _staffOptionsWidgets, - _staffStatsWidgets, -}; + static Widget* window_staff_page_widgets[] = { + _staffOverviewWidgets, + _staffOptionsWidgets, + _staffStatsWidgets, + }; -class StaffWindow final : public Window -{ -private: - EntertainerCostume _availableCostumes[EnumValue(EntertainerCostume::Count)]{}; - uint16_t _tabAnimationOffset = 0; - int32_t _pickedPeepOldX = LOCATION_NULL; - -public: - void Initialise(EntityId entityId) + class StaffWindow final : public Window { - number = entityId.ToUnderlying(); - } + private: + EntertainerCostume _availableCostumes[EnumValue(EntertainerCostume::Count)]{}; + uint16_t _tabAnimationOffset = 0; + int32_t _pickedPeepOldX = LOCATION_NULL; - void OnOpen() override - { - SetPage(WINDOW_STAFF_OVERVIEW); - } + public: + void Initialise(EntityId entityId) + { + number = entityId.ToUnderlying(); + } - void OnClose() override - { - CancelTools(); - } + void OnOpen() override + { + SetPage(WINDOW_STAFF_OVERVIEW); + } - void OnMouseUp(WidgetIndex widgetIndex) override - { - if (widgetIndex <= WIDX_TAB_3) - CommonMouseUp(widgetIndex); - else + void OnClose() override + { + CancelTools(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + if (widgetIndex <= WIDX_TAB_3) + CommonMouseUp(widgetIndex); + else + { + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewMouseUp(widgetIndex); + break; + case WINDOW_STAFF_OPTIONS: + OptionsMouseUp(widgetIndex); + } + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override { switch (page) { case WINDOW_STAFF_OVERVIEW: - OverviewMouseUp(widgetIndex); + OverviewOnMouseDown(widgetIndex); break; case WINDOW_STAFF_OPTIONS: - OptionsMouseUp(widgetIndex); + OptionsOnMouseDown(widgetIndex); + break; } } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (page) + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override { - case WINDOW_STAFF_OVERVIEW: - OverviewOnMouseDown(widgetIndex); - break; - case WINDOW_STAFF_OPTIONS: - OptionsOnMouseDown(widgetIndex); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - switch (page) - { - case WINDOW_STAFF_OVERVIEW: - OverviewOnDropdown(widgetIndex, dropdownIndex); - break; - case WINDOW_STAFF_OPTIONS: - OptionsOnDropdown(widgetIndex, dropdownIndex); - break; - } - } - - void OnPrepareDraw() override - { - CommonPrepareDrawBefore(); - - switch (page) - { - case WINDOW_STAFF_OVERVIEW: - OverviewPrepareDraw(); - break; - case WINDOW_STAFF_OPTIONS: - OptionsPrepareDraw(); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewOnDropdown(widgetIndex, dropdownIndex); + break; + case WINDOW_STAFF_OPTIONS: + OptionsOnDropdown(widgetIndex, dropdownIndex); + break; + } } - CommonPrepareDrawAfter(); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - switch (page) + void OnPrepareDraw() override { - case WINDOW_STAFF_OVERVIEW: - OverviewDraw(dpi); - break; - case WINDOW_STAFF_STATISTICS: - StatsDraw(dpi); - break; - } - } + CommonPrepareDrawBefore(); - void OnResize() override - { - switch (page) + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewPrepareDraw(); + break; + case WINDOW_STAFF_OPTIONS: + OptionsPrepareDraw(); + break; + } + + CommonPrepareDrawAfter(); + } + + void OnDraw(DrawPixelInfo& dpi) override { - case WINDOW_STAFF_OVERVIEW: - OverviewResize(); - break; - case WINDOW_STAFF_OPTIONS: - OptionsResize(); - break; - case WINDOW_STAFF_STATISTICS: - StatsResize(); - break; - } - } + DrawWidgets(dpi); + DrawTabImages(dpi); - void OnUpdate() override - { - switch (page) + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewDraw(dpi); + break; + case WINDOW_STAFF_STATISTICS: + StatsDraw(dpi); + break; + } + } + + void OnResize() override { - case WINDOW_STAFF_OVERVIEW: - OverviewUpdate(); - break; - case WINDOW_STAFF_OPTIONS: - OptionsUpdate(); - break; - case WINDOW_STAFF_STATISTICS: - StatsUpdate(); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewResize(); + break; + case WINDOW_STAFF_OPTIONS: + OptionsResize(); + break; + case WINDOW_STAFF_STATISTICS: + StatsResize(); + break; + } } - } - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (page) + void OnUpdate() override { - case WINDOW_STAFF_OVERVIEW: - OverviewToolUpdate(widgetIndex, screenCoords); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewUpdate(); + break; + case WINDOW_STAFF_OPTIONS: + OptionsUpdate(); + break; + case WINDOW_STAFF_STATISTICS: + StatsUpdate(); + break; + } } - } - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (page) + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - case WINDOW_STAFF_OVERVIEW: - OverviewToolDown(widgetIndex, screenCoords); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewToolUpdate(widgetIndex, screenCoords); + break; + } } - } - void OnToolAbort(WidgetIndex widgetIndex) override - { - switch (page) + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - case WINDOW_STAFF_OVERVIEW: - OverviewToolAbort(widgetIndex); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewToolDown(widgetIndex, screenCoords); + break; + } } - } - void OnViewportRotate() override - { - switch (page) + void OnToolAbort(WidgetIndex widgetIndex) override { - case WINDOW_STAFF_OVERVIEW: - OverviewViewportRotate(); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewToolAbort(widgetIndex); + break; + } } - } - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - switch (page) + void OnViewportRotate() override { - case WINDOW_STAFF_OVERVIEW: - OverviewTextInput(widgetIndex, text); - break; + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewViewportRotate(); + break; + } } - } -private: + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + switch (page) + { + case WINDOW_STAFF_OVERVIEW: + OverviewTextInput(widgetIndex, text); + break; + } + } + + private: #pragma region Common events - void CommonMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void CommonMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - Close(); - break; - case WIDX_TAB_1: - case WIDX_TAB_2: - case WIDX_TAB_3: - SetPage(widgetIndex - WIDX_TAB_1); - break; - } - } - - void CommonPrepareDrawBefore() - { - ColourSchemeUpdateByClass(this, static_cast(WindowClass::Staff)); - - if (window_staff_page_widgets[page] != widgets) - { - widgets = window_staff_page_widgets[page]; - InitScrollWidgets(); - } - SetPressedTab(); - DisableWidgets(); - - auto staff = GetStaff(); - if (staff == nullptr) - { - return; + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_TAB_1: + case WIDX_TAB_2: + case WIDX_TAB_3: + SetPage(widgetIndex - WIDX_TAB_1); + break; + } } - auto ft = Formatter::Common(); - staff->FormatNameTo(ft); + void CommonPrepareDrawBefore() + { + ColourSchemeUpdateByClass(this, static_cast(WindowClass::Staff)); - ResizeFrameWithPage(); - } + if (window_staff_page_widgets[page] != widgets) + { + widgets = window_staff_page_widgets[page]; + InitScrollWidgets(); + } + SetPressedTab(); + DisableWidgets(); - void CommonPrepareDrawAfter() - { - WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_3); - } + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + auto ft = Formatter::Common(); + staff->FormatNameTo(ft); + + ResizeFrameWithPage(); + } + + void CommonPrepareDrawAfter() + { + WindowAlignTabs(this, WIDX_TAB_1, WIDX_TAB_3); + } #pragma endregion #pragma region Overview tab events - void OverviewMouseUp(WidgetIndex widgetIndex) - { - auto staff = GetStaff(); - if (staff == nullptr) + void OverviewMouseUp(WidgetIndex widgetIndex) { - return; - } - - switch (widgetIndex) - { - case WIDX_PICKUP: + auto staff = GetStaff(); + if (staff == nullptr) { - _pickedPeepOldX = staff->x; - CoordsXYZ nullLoc{}; - nullLoc.SetNull(); - PeepPickupAction pickupAction{ PeepPickupType::Pickup, EntityId::FromUnderlying(number), nullLoc, - NetworkGetCurrentPlayerId() }; - pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - return; - WindowBase* wind = WindowFindByNumber(WindowClass::Peep, peepnum); - if (wind != nullptr) - { - ToolSet(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); - } - }); - GameActions::Execute(&pickupAction); + return; } - break; - case WIDX_FIRE: + + switch (widgetIndex) { - auto intent = Intent(WindowClass::FirePrompt); - intent.PutExtra(INTENT_EXTRA_PEEP, staff); - ContextOpenIntent(&intent); - break; - } - case WIDX_RENAME: - { - auto peepName = staff->GetName(); - WindowTextInputRawOpen( - this, widgetIndex, STR_STAFF_TITLE_STAFF_MEMBER_NAME, STR_STAFF_PROMPT_ENTER_NAME, {}, peepName.c_str(), - 32); - break; - } - } - } - - void OverviewOnMouseDown(WidgetIndex widgetIndex) - { - Widget* widget = &widgets[widgetIndex]; - - switch (widgetIndex) - { - case WIDX_LOCATE: - ShowLocateDropdown(widget); - break; - case WIDX_PATROL: - { - // Dropdown names - gDropdownItems[0].Format = STR_SET_PATROL_AREA; - gDropdownItems[1].Format = STR_CLEAR_PATROL_AREA; - - auto ddPos = ScreenCoordsXY{ widget->left + windowPos.x, widget->top + windowPos.y }; - int32_t extraHeight = widget->height() + 1; - WindowDropdownShowText(ddPos, extraHeight, colours[1], 0, 2); - gDropdownDefaultIndex = 0; - - auto staff = GetStaff(); - if (staff == nullptr) + case WIDX_PICKUP: { - return; + _pickedPeepOldX = staff->x; + CoordsXYZ nullLoc{}; + nullLoc.SetNull(); + PeepPickupAction pickupAction{ PeepPickupType::Pickup, EntityId::FromUnderlying(number), nullLoc, + NetworkGetCurrentPlayerId() }; + pickupAction.SetCallback([peepnum = number](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + WindowBase* wind = WindowFindByNumber(WindowClass::Peep, peepnum); + if (wind != nullptr) + { + ToolSet(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); + } + }); + GameActions::Execute(&pickupAction); } - - // Disable clear patrol area if no area is set. - if (!staff->HasPatrolArea()) + break; + case WIDX_FIRE: { - Dropdown::SetDisabled(1, true); + auto intent = Intent(WindowClass::FirePrompt); + intent.PutExtra(INTENT_EXTRA_PEEP, staff); + ContextOpenIntent(&intent); + break; + } + case WIDX_RENAME: + { + auto peepName = staff->GetName(); + WindowTextInputRawOpen( + this, widgetIndex, STR_STAFF_TITLE_STAFF_MEMBER_NAME, STR_STAFF_PROMPT_ENTER_NAME, {}, peepName.c_str(), + 32); + break; } } } - } - void OverviewOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - switch (widgetIndex) + void OverviewOnMouseDown(WidgetIndex widgetIndex) { - case WIDX_LOCATE: + Widget* widget = &widgets[widgetIndex]; + + switch (widgetIndex) { - if (dropdownIndex == 0) - { - ScrollToViewport(); - } - else if (dropdownIndex == 1) - { - FollowPeep(); - } - break; - } - case WIDX_PATROL: - { - // Clear patrol - if (dropdownIndex == 1) + case WIDX_LOCATE: + ShowLocateDropdown(widget); + break; + case WIDX_PATROL: { + // Dropdown names + gDropdownItems[0].Format = STR_SET_PATROL_AREA; + gDropdownItems[1].Format = STR_CLEAR_PATROL_AREA; + + auto ddPos = ScreenCoordsXY{ widget->left + windowPos.x, widget->top + windowPos.y }; + int32_t extraHeight = widget->height() + 1; + WindowDropdownShowText(ddPos, extraHeight, colours[1], 0, 2); + gDropdownDefaultIndex = 0; + auto staff = GetStaff(); if (staff == nullptr) { return; } - WindowCloseByClass(WindowClass::PatrolArea); - - auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction(staff->Id, {}, StaffSetPatrolAreaMode::ClearAll); - GameActions::Execute(&staffSetPatrolAreaAction); - } - else - { - auto staffId = EntityId::FromUnderlying(number); - if (WindowPatrolAreaGetCurrentStaffId() == staffId) + // Disable clear patrol area if no area is set. + if (!staff->HasPatrolArea()) { + Dropdown::SetDisabled(1, true); + } + } + } + } + + void OverviewOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) + { + switch (widgetIndex) + { + case WIDX_LOCATE: + { + if (dropdownIndex == 0) + { + ScrollToViewport(); + } + else if (dropdownIndex == 1) + { + FollowPeep(); + } + break; + } + case WIDX_PATROL: + { + // Clear patrol + if (dropdownIndex == 1) + { + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + WindowCloseByClass(WindowClass::PatrolArea); + + auto staffSetPatrolAreaAction = StaffSetPatrolAreaAction( + staff->Id, {}, StaffSetPatrolAreaMode::ClearAll); + GameActions::Execute(&staffSetPatrolAreaAction); } else { - WindowPatrolAreaOpen(staffId); + auto staffId = EntityId::FromUnderlying(number); + if (WindowPatrolAreaGetCurrentStaffId() == staffId) + { + WindowCloseByClass(WindowClass::PatrolArea); + } + else + { + WindowPatrolAreaOpen(staffId); + } } + break; } - break; } } - } - void OverviewPrepareDraw() - { - auto staff = GetStaff(); - if (staff == nullptr) + void OverviewPrepareDraw() { - return; - } - - widgets[WIDX_VIEWPORT].right = width - 26; - widgets[WIDX_VIEWPORT].bottom = height - 14; - - widgets[WIDX_BTM_LABEL].right = width - 26; - widgets[WIDX_BTM_LABEL].top = height - 13; - widgets[WIDX_BTM_LABEL].bottom = height - 3; - - widgets[WIDX_PICKUP].left = width - 25; - widgets[WIDX_PICKUP].right = width - 2; - - SetWidgetPressed(WIDX_PATROL, WindowPatrolAreaGetCurrentStaffId() == staff->Id); - - widgets[WIDX_PATROL].left = width - 25; - widgets[WIDX_PATROL].right = width - 2; - - widgets[WIDX_RENAME].left = width - 25; - widgets[WIDX_RENAME].right = width - 2; - - widgets[WIDX_LOCATE].left = width - 25; - widgets[WIDX_LOCATE].right = width - 2; - - widgets[WIDX_FIRE].left = width - 25; - widgets[WIDX_FIRE].right = width - 2; - } - - void OverviewDraw(DrawPixelInfo& dpi) - { - // Draw the viewport no sound sprite - if (viewport != nullptr) - { - WindowDrawViewport(dpi, *this); - - if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + auto staff = GetStaff(); + if (staff == nullptr) { - GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); - } - } - - // Draw the centred label - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - auto ft = Formatter(); - staff->FormatActionTo(ft); - const auto& widget = widgets[WIDX_BTM_LABEL]; - auto screenPos = windowPos + ScreenCoordsXY{ widget.midX(), widget.top }; - int32_t widgetWidth = widget.width(); - DrawTextEllipsised(dpi, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); - } - - void DrawOverviewTabImage(DrawPixelInfo& dpi) - { - if (IsWidgetDisabled(WIDX_TAB_1)) - return; - - const auto& widget = widgets[WIDX_TAB_1]; - int32_t widgetWidth = widget.width() - 1; - int32_t widgetHeight = widget.height() - 1; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; - if (page == WINDOW_STAFF_OVERVIEW) - widgetHeight++; - - DrawPixelInfo clip_dpi; - if (!ClipDrawPixelInfo(clip_dpi, dpi, screenCoords, widgetWidth, widgetHeight)) - { - return; - } - - screenCoords = ScreenCoordsXY{ 14, 20 }; - - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - if (staff->Is() && staff->AssignedStaffType == StaffType::Entertainer) - screenCoords.y++; - - int32_t imageIndex = GetPeepAnimation(staff->SpriteType).base_image + 1; - - int32_t offset = 0; - - if (page == WINDOW_STAFF_OVERVIEW) - { - offset = _tabAnimationOffset; - offset = Floor2(offset, 4); - } - imageIndex += offset; - - GfxDrawSprite(clip_dpi, ImageId(imageIndex, staff->TshirtColour, staff->TrousersColour), screenCoords); - } - - void OverviewResize() - { - min_width = WW; - max_width = 500; - min_height = WH; - max_height = 450; - - if (width < min_width) - { - width = min_width; - Invalidate(); - } - if (width > max_width) - { - Invalidate(); - width = max_width; - } - if (height < min_height) - { - height = min_height; - Invalidate(); - } - if (height > max_height) - { - Invalidate(); - height = max_height; - } - - if (viewport != nullptr) - { - int32_t newWidth = width - 30; - int32_t newHeight = height - 62; - - // Update the viewport size - if (viewport->width != newWidth || viewport->height != newHeight) - { - viewport->width = newWidth; - viewport->height = newHeight; - viewport->view_width = viewport->zoom.ApplyTo(newWidth); - viewport->view_height = viewport->zoom.ApplyTo(newHeight); - } - } - - ViewportInit(); - } - - void OverviewUpdate() - { - _tabAnimationOffset++; - _tabAnimationOffset %= 24; - - // Update pickup animation, can only happen in this tab. - picked_peep_frame++; - picked_peep_frame %= 48; - - InvalidateWidget(WIDX_TAB_1); - } - - void OverviewToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (widgetIndex != WIDX_PICKUP) - return; - - MapInvalidateSelectionRect(); - - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); - if (!mapCoords.IsNull()) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectType = MAP_SELECT_TYPE_FULL; - gMapSelectPositionA = mapCoords; - gMapSelectPositionB = mapCoords; - MapInvalidateSelectionRect(); - } - - gPickupPeepImage = ImageId(); - - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); - if (info.SpriteType == ViewportInteractionItem::None) - return; - - gPickupPeepX = screenCoords.x - 1; - gPickupPeepY = screenCoords.y + 16; - - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - auto baseImageId = GetPeepAnimation(staff->SpriteType, PeepActionSpriteType::Ui).base_image; - baseImageId += picked_peep_frame >> 2; - gPickupPeepImage = ImageId(baseImageId, staff->TshirtColour, staff->TrousersColour); - } - - void OverviewToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) - { - if (widgetIndex != WIDX_PICKUP) - return; - - const auto staffEntityId = EntityId::FromUnderlying(number); - TileElement* tileElement; - auto destCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); - - if (destCoords.IsNull()) - return; - - PeepPickupAction pickupAction{ - PeepPickupType::Place, staffEntityId, { destCoords, tileElement->GetBaseZ() }, NetworkGetCurrentPlayerId() - }; - pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) return; - ToolCancel(); + } + + widgets[WIDX_VIEWPORT].right = width - 26; + widgets[WIDX_VIEWPORT].bottom = height - 14; + + widgets[WIDX_BTM_LABEL].right = width - 26; + widgets[WIDX_BTM_LABEL].top = height - 13; + widgets[WIDX_BTM_LABEL].bottom = height - 3; + + widgets[WIDX_PICKUP].left = width - 25; + widgets[WIDX_PICKUP].right = width - 2; + + SetWidgetPressed(WIDX_PATROL, WindowPatrolAreaGetCurrentStaffId() == staff->Id); + + widgets[WIDX_PATROL].left = width - 25; + widgets[WIDX_PATROL].right = width - 2; + + widgets[WIDX_RENAME].left = width - 25; + widgets[WIDX_RENAME].right = width - 2; + + widgets[WIDX_LOCATE].left = width - 25; + widgets[WIDX_LOCATE].right = width - 2; + + widgets[WIDX_FIRE].left = width - 25; + widgets[WIDX_FIRE].right = width - 2; + } + + void OverviewDraw(DrawPixelInfo& dpi) + { + // Draw the viewport no sound sprite + if (viewport != nullptr) + { + WindowDrawViewport(dpi, *this); + + if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + { + GfxDrawSprite(dpi, ImageId(SPR_HEARING_VIEWPORT), WindowGetViewportSoundIconPos(*this)); + } + } + + // Draw the centred label + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + auto ft = Formatter(); + staff->FormatActionTo(ft); + const auto& widget = widgets[WIDX_BTM_LABEL]; + auto screenPos = windowPos + ScreenCoordsXY{ widget.midX(), widget.top }; + int32_t widgetWidth = widget.width(); + DrawTextEllipsised(dpi, screenPos, widgetWidth, STR_BLACK_STRING, ft, { TextAlignment::CENTRE }); + } + + void DrawOverviewTabImage(DrawPixelInfo& dpi) + { + if (IsWidgetDisabled(WIDX_TAB_1)) + return; + + const auto& widget = widgets[WIDX_TAB_1]; + int32_t widgetWidth = widget.width() - 1; + int32_t widgetHeight = widget.height() - 1; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }; + if (page == WINDOW_STAFF_OVERVIEW) + widgetHeight++; + + DrawPixelInfo clip_dpi; + if (!ClipDrawPixelInfo(clip_dpi, dpi, screenCoords, widgetWidth, widgetHeight)) + { + return; + } + + screenCoords = ScreenCoordsXY{ 14, 20 }; + + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + if (staff->Is() && staff->AssignedStaffType == StaffType::Entertainer) + screenCoords.y++; + + int32_t imageIndex = GetPeepAnimation(staff->SpriteType).base_image + 1; + + int32_t offset = 0; + + if (page == WINDOW_STAFF_OVERVIEW) + { + offset = _tabAnimationOffset; + offset = Floor2(offset, 4); + } + imageIndex += offset; + + GfxDrawSprite(clip_dpi, ImageId(imageIndex, staff->TshirtColour, staff->TrousersColour), screenCoords); + } + + void OverviewResize() + { + min_width = WW; + max_width = 500; + min_height = WH; + max_height = 450; + + if (width < min_width) + { + width = min_width; + Invalidate(); + } + if (width > max_width) + { + Invalidate(); + width = max_width; + } + if (height < min_height) + { + height = min_height; + Invalidate(); + } + if (height > max_height) + { + Invalidate(); + height = max_height; + } + + if (viewport != nullptr) + { + int32_t newWidth = width - 30; + int32_t newHeight = height - 62; + + // Update the viewport size + if (viewport->width != newWidth || viewport->height != newHeight) + { + viewport->width = newWidth; + viewport->height = newHeight; + viewport->view_width = viewport->zoom.ApplyTo(newWidth); + viewport->view_height = viewport->zoom.ApplyTo(newHeight); + } + } + + ViewportInit(); + } + + void OverviewUpdate() + { + _tabAnimationOffset++; + _tabAnimationOffset %= 24; + + // Update pickup animation, can only happen in this tab. + picked_peep_frame++; + picked_peep_frame %= 48; + + InvalidateWidget(WIDX_TAB_1); + } + + void OverviewToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetIndex != WIDX_PICKUP) + return; + + MapInvalidateSelectionRect(); + + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + + auto mapCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, nullptr); + if (!mapCoords.IsNull()) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectType = MAP_SELECT_TYPE_FULL; + gMapSelectPositionA = mapCoords; + gMapSelectPositionB = mapCoords; + MapInvalidateSelectionRect(); + } + gPickupPeepImage = ImageId(); - }); - GameActions::Execute(&pickupAction); - } - void OverviewToolAbort(WidgetIndex widgetIndex) - { - if (widgetIndex != WIDX_PICKUP) - return; + auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionItemAll); + if (info.SpriteType == ViewportInteractionItem::None) + return; - PeepPickupAction pickupAction{ - PeepPickupType::Cancel, EntityId::FromUnderlying(number), { _pickedPeepOldX, 0, 0 }, NetworkGetCurrentPlayerId() - }; - GameActions::Execute(&pickupAction); - } + gPickupPeepX = screenCoords.x - 1; + gPickupPeepY = screenCoords.y + 16; - void OverviewViewportRotate() - { - ViewportInit(); - } + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } - void OverviewTextInput(WidgetIndex widgetIndex, std::string_view text) - { - if (widgetIndex != WIDX_RENAME) - return; + auto baseImageId = GetPeepAnimation(staff->SpriteType, PeepActionSpriteType::Ui).base_image; + baseImageId += picked_peep_frame >> 2; + gPickupPeepImage = ImageId(baseImageId, staff->TshirtColour, staff->TrousersColour); + } - if (text.empty()) - return; + void OverviewToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetIndex != WIDX_PICKUP) + return; - auto gameAction = StaffSetNameAction(EntityId::FromUnderlying(number), std::string{ text }); - GameActions::Execute(&gameAction); - } + const auto staffEntityId = EntityId::FromUnderlying(number); + TileElement* tileElement; + auto destCoords = FootpathGetCoordinatesFromPos({ screenCoords.x, screenCoords.y + 16 }, nullptr, &tileElement); + + if (destCoords.IsNull()) + return; + + PeepPickupAction pickupAction{ + PeepPickupType::Place, staffEntityId, { destCoords, tileElement->GetBaseZ() }, NetworkGetCurrentPlayerId() + }; + pickupAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + ToolCancel(); + gPickupPeepImage = ImageId(); + }); + GameActions::Execute(&pickupAction); + } + + void OverviewToolAbort(WidgetIndex widgetIndex) + { + if (widgetIndex != WIDX_PICKUP) + return; + + PeepPickupAction pickupAction{ + PeepPickupType::Cancel, EntityId::FromUnderlying(number), { _pickedPeepOldX, 0, 0 }, NetworkGetCurrentPlayerId() + }; + GameActions::Execute(&pickupAction); + } + + void OverviewViewportRotate() + { + ViewportInit(); + } + + void OverviewTextInput(WidgetIndex widgetIndex, std::string_view text) + { + if (widgetIndex != WIDX_RENAME) + return; + + if (text.empty()) + return; + + auto gameAction = StaffSetNameAction(EntityId::FromUnderlying(number), std::string{ text }); + GameActions::Execute(&gameAction); + } #pragma endregion #pragma region Options tab events - void OptionsMouseUp(WidgetIndex widgetIndex) - { - switch (widgetIndex) + void OptionsMouseUp(WidgetIndex widgetIndex) { - case WIDX_CHECKBOX_1: - case WIDX_CHECKBOX_2: - case WIDX_CHECKBOX_3: - case WIDX_CHECKBOX_4: - SetOrder(widgetIndex - WIDX_CHECKBOX_1); - break; - } - } - - void OptionsOnMouseDown(WidgetIndex widgetIndex) - { - if (widgetIndex != WIDX_COSTUME_BTN) - { - return; - } - - auto* ddWidget = &widgets[WIDX_COSTUME_BOX]; - - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - int32_t checkedIndex = -1; - // This will be moved below where Items Checked is when all - // of dropdown related functions are finished. This prevents - // the dropdown from not working on first click. - int32_t numCostumes = StaffGetAvailableEntertainerCostumeList(_availableCostumes); - for (int32_t i = 0; i < numCostumes; i++) - { - EntertainerCostume costume = _availableCostumes[i]; - if (staff->SpriteType == EntertainerCostumeToSprite(costume)) + switch (widgetIndex) { - checkedIndex = i; + case WIDX_CHECKBOX_1: + case WIDX_CHECKBOX_2: + case WIDX_CHECKBOX_3: + case WIDX_CHECKBOX_4: + SetOrder(widgetIndex - WIDX_CHECKBOX_1); + break; } - gDropdownItems[i].Args = StaffCostumeNames[EnumValue(costume)]; - gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; } - auto ddPos = ScreenCoordsXY{ ddWidget->left + windowPos.x, ddWidget->top + windowPos.y }; - int32_t ddHeight = ddWidget->height() + 1; - int32_t ddWidth = ddWidget->width() - 3; - WindowDropdownShowTextCustomWidth(ddPos, ddHeight, colours[1], 0, Dropdown::Flag::StayOpen, numCostumes, ddWidth); - - // See above note. - if (checkedIndex != -1) + void OptionsOnMouseDown(WidgetIndex widgetIndex) { - Dropdown::SetChecked(checkedIndex, true); - } - } + if (widgetIndex != WIDX_COSTUME_BTN) + { + return; + } - void OptionsOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) - { - if (widgetIndex != WIDX_COSTUME_BTN) + auto* ddWidget = &widgets[WIDX_COSTUME_BOX]; + + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + int32_t checkedIndex = -1; + // This will be moved below where Items Checked is when all + // of dropdown related functions are finished. This prevents + // the dropdown from not working on first click. + int32_t numCostumes = StaffGetAvailableEntertainerCostumeList(_availableCostumes); + for (int32_t i = 0; i < numCostumes; i++) + { + EntertainerCostume costume = _availableCostumes[i]; + if (staff->SpriteType == EntertainerCostumeToSprite(costume)) + { + checkedIndex = i; + } + gDropdownItems[i].Args = StaffCostumeNames[EnumValue(costume)]; + gDropdownItems[i].Format = STR_DROPDOWN_MENU_LABEL; + } + + auto ddPos = ScreenCoordsXY{ ddWidget->left + windowPos.x, ddWidget->top + windowPos.y }; + int32_t ddHeight = ddWidget->height() + 1; + int32_t ddWidth = ddWidget->width() - 3; + WindowDropdownShowTextCustomWidth(ddPos, ddHeight, colours[1], 0, Dropdown::Flag::StayOpen, numCostumes, ddWidth); + + // See above note. + if (checkedIndex != -1) + { + Dropdown::SetChecked(checkedIndex, true); + } + } + + void OptionsOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) { - return; + if (widgetIndex != WIDX_COSTUME_BTN) + { + return; + } + + if (dropdownIndex == -1) + return; + + EntertainerCostume costume = _availableCostumes[dropdownIndex]; + auto staffSetCostumeAction = StaffSetCostumeAction(EntityId::FromUnderlying(number), costume); + GameActions::Execute(&staffSetCostumeAction); } - if (dropdownIndex == -1) - return; - - EntertainerCostume costume = _availableCostumes[dropdownIndex]; - auto staffSetCostumeAction = StaffSetCostumeAction(EntityId::FromUnderlying(number), costume); - GameActions::Execute(&staffSetCostumeAction); - } - - void OptionsPrepareDraw() - { - auto staff = GetStaff(); - if (staff == nullptr) + void OptionsPrepareDraw() { - return; + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + switch (staff->AssignedStaffType) + { + case StaffType::Entertainer: + widgets[WIDX_CHECKBOX_1].type = WindowWidgetType::Empty; + widgets[WIDX_CHECKBOX_2].type = WindowWidgetType::Empty; + widgets[WIDX_CHECKBOX_3].type = WindowWidgetType::Empty; + widgets[WIDX_CHECKBOX_4].type = WindowWidgetType::Empty; + widgets[WIDX_COSTUME_BOX].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Button; + widgets[WIDX_COSTUME_BOX].text = StaffCostumeNames[EnumValue(staff->SpriteType) - 4]; + break; + case StaffType::Handyman: + widgets[WIDX_CHECKBOX_1].type = WindowWidgetType::Checkbox; + widgets[WIDX_CHECKBOX_1].text = STR_STAFF_OPTION_SWEEP_FOOTPATHS; + widgets[WIDX_CHECKBOX_2].type = WindowWidgetType::Checkbox; + widgets[WIDX_CHECKBOX_2].text = STR_STAFF_OPTION_WATER_GARDENS; + widgets[WIDX_CHECKBOX_3].type = WindowWidgetType::Checkbox; + widgets[WIDX_CHECKBOX_3].text = STR_STAFF_OPTION_EMPTY_LITTER; + widgets[WIDX_CHECKBOX_4].type = WindowWidgetType::Checkbox; + widgets[WIDX_CHECKBOX_4].text = STR_STAFF_OPTION_MOW_GRASS; + widgets[WIDX_COSTUME_BOX].type = WindowWidgetType::Empty; + widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Empty; + OptionsSetCheckboxValues(); + break; + case StaffType::Mechanic: + widgets[WIDX_CHECKBOX_1].type = WindowWidgetType::Checkbox; + widgets[WIDX_CHECKBOX_1].text = STR_INSPECT_RIDES; + widgets[WIDX_CHECKBOX_2].type = WindowWidgetType::Checkbox; + widgets[WIDX_CHECKBOX_2].text = STR_FIX_RIDES; + widgets[WIDX_CHECKBOX_3].type = WindowWidgetType::Empty; + widgets[WIDX_CHECKBOX_4].type = WindowWidgetType::Empty; + widgets[WIDX_COSTUME_BOX].type = WindowWidgetType::Empty; + widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Empty; + widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Empty; + OptionsSetCheckboxValues(); + break; + case StaffType::Security: + // Security guards don't have an options screen. + break; + case StaffType::Count: + break; + } } - switch (staff->AssignedStaffType) + void OptionsSetCheckboxValues() { - case StaffType::Entertainer: - widgets[WIDX_CHECKBOX_1].type = WindowWidgetType::Empty; - widgets[WIDX_CHECKBOX_2].type = WindowWidgetType::Empty; - widgets[WIDX_CHECKBOX_3].type = WindowWidgetType::Empty; - widgets[WIDX_CHECKBOX_4].type = WindowWidgetType::Empty; - widgets[WIDX_COSTUME_BOX].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Button; - widgets[WIDX_COSTUME_BOX].text = StaffCostumeNames[EnumValue(staff->SpriteType) - 4]; - break; - case StaffType::Handyman: - widgets[WIDX_CHECKBOX_1].type = WindowWidgetType::Checkbox; - widgets[WIDX_CHECKBOX_1].text = STR_STAFF_OPTION_SWEEP_FOOTPATHS; - widgets[WIDX_CHECKBOX_2].type = WindowWidgetType::Checkbox; - widgets[WIDX_CHECKBOX_2].text = STR_STAFF_OPTION_WATER_GARDENS; - widgets[WIDX_CHECKBOX_3].type = WindowWidgetType::Checkbox; - widgets[WIDX_CHECKBOX_3].text = STR_STAFF_OPTION_EMPTY_LITTER; - widgets[WIDX_CHECKBOX_4].type = WindowWidgetType::Checkbox; - widgets[WIDX_CHECKBOX_4].text = STR_STAFF_OPTION_MOW_GRASS; - widgets[WIDX_COSTUME_BOX].type = WindowWidgetType::Empty; - widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Empty; - OptionsSetCheckboxValues(); - break; - case StaffType::Mechanic: - widgets[WIDX_CHECKBOX_1].type = WindowWidgetType::Checkbox; - widgets[WIDX_CHECKBOX_1].text = STR_INSPECT_RIDES; - widgets[WIDX_CHECKBOX_2].type = WindowWidgetType::Checkbox; - widgets[WIDX_CHECKBOX_2].text = STR_FIX_RIDES; - widgets[WIDX_CHECKBOX_3].type = WindowWidgetType::Empty; - widgets[WIDX_CHECKBOX_4].type = WindowWidgetType::Empty; - widgets[WIDX_COSTUME_BOX].type = WindowWidgetType::Empty; - widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Empty; - widgets[WIDX_COSTUME_BTN].type = WindowWidgetType::Empty; - OptionsSetCheckboxValues(); - break; - case StaffType::Security: - // Security guards don't have an options screen. - break; - case StaffType::Count: - break; + SetCheckboxValue(WIDX_CHECKBOX_1, false); + SetCheckboxValue(WIDX_CHECKBOX_2, false); + SetCheckboxValue(WIDX_CHECKBOX_3, false); + SetCheckboxValue(WIDX_CHECKBOX_4, false); + + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + auto staffOrders = staff->StaffOrders; + + for (auto index = UtilBitScanForward(staffOrders); index != -1; index = UtilBitScanForward(staffOrders)) + { + staffOrders &= ~(1 << index); + SetCheckboxValue(WIDX_CHECKBOX_1 + index, true); + } } - } - void OptionsSetCheckboxValues() - { - SetCheckboxValue(WIDX_CHECKBOX_1, false); - SetCheckboxValue(WIDX_CHECKBOX_2, false); - SetCheckboxValue(WIDX_CHECKBOX_3, false); - SetCheckboxValue(WIDX_CHECKBOX_4, false); - - auto staff = GetStaff(); - if (staff == nullptr) + void OptionsResize() { - return; + min_width = 190; + max_width = 190; + min_height = 126; + max_height = 126; + + if (width < min_width) + { + width = min_width; + Invalidate(); + } + if (width > max_width) + { + Invalidate(); + width = max_width; + } + if (height < min_height) + { + height = min_height; + Invalidate(); + } + if (height > max_height) + { + Invalidate(); + height = max_height; + } } - auto staffOrders = staff->StaffOrders; - - for (auto index = UtilBitScanForward(staffOrders); index != -1; index = UtilBitScanForward(staffOrders)) + void OptionsUpdate() { - staffOrders &= ~(1 << index); - SetCheckboxValue(WIDX_CHECKBOX_1 + index, true); + frame_no++; + InvalidateWidget(WIDX_TAB_2); } - } - - void OptionsResize() - { - min_width = 190; - max_width = 190; - min_height = 126; - max_height = 126; - - if (width < min_width) - { - width = min_width; - Invalidate(); - } - if (width > max_width) - { - Invalidate(); - width = max_width; - } - if (height < min_height) - { - height = min_height; - Invalidate(); - } - if (height > max_height) - { - Invalidate(); - height = max_height; - } - } - - void OptionsUpdate() - { - frame_no++; - InvalidateWidget(WIDX_TAB_2); - } #pragma endregion #pragma region Statistics tab events - void StatsDraw(DrawPixelInfo& dpi) - { - auto staff = GetStaff(); - if (staff == nullptr) + void StatsDraw(DrawPixelInfo& dpi) { - return; - } - - auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_RESIZE].left + 4, widgets[WIDX_RESIZE].top + 4 }; - - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(GetStaffWage(staff->AssignedStaffType)); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft); - screenCoords.y += LIST_ROW_HEIGHT; - } - - auto ft = Formatter(); - ft.Add(staff->GetHireDate()); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - switch (staff->AssignedStaffType) - { - case StaffType::Handyman: - ft = Formatter(); - ft.Add(staff->StaffLawnsMown); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(staff->StaffGardensWatered); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(staff->StaffLitterSwept); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(staff->StaffBinsEmptied); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft); - break; - case StaffType::Mechanic: - ft = Formatter(); - ft.Add(staff->StaffRidesInspected); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); - screenCoords.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(staff->StaffRidesFixed); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft); - break; - case StaffType::Security: - ft = Formatter(); - ft.Add(staff->StaffVandalsStopped); - DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft); - break; - case StaffType::Entertainer: - case StaffType::Count: - break; - } - } - - void StatsResize() - { - min_width = 190; - max_width = 190; - min_height = 126; - max_height = 126; - - if (width < min_width) - { - width = min_width; - Invalidate(); - } - if (width > max_width) - { - Invalidate(); - width = max_width; - } - if (height < min_height) - { - height = min_height; - Invalidate(); - } - if (height > max_height) - { - Invalidate(); - height = max_height; - } - } - - void StatsUpdate() - { - frame_no++; - InvalidateWidget(WIDX_TAB_3); - - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - if (staff->WindowInvalidateFlags & PEEP_INVALIDATE_STAFF_STATS) - { - staff->WindowInvalidateFlags &= ~PEEP_INVALIDATE_STAFF_STATS; - Invalidate(); - } - } -#pragma endregion - void DisableWidgets() - { - const auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - for (WidgetIndex widgetIndex = WIDX_TAB_1; widgets[widgetIndex].type != kWidgetsEnd.type; widgetIndex++) - { - SetWidgetDisabled(widgetIndex, false); - } - - if (staff->AssignedStaffType == StaffType::Security) - { - SetWidgetDisabled(WIDX_TAB_2, true); - } - - if (page == WINDOW_STAFF_OVERVIEW) - { - if (staff->CanBePickedUp()) + auto staff = GetStaff(); + if (staff == nullptr) { - SetWidgetDisabled(WIDX_PICKUP, false); - } - else - { - SetWidgetDisabled(WIDX_PICKUP, true); - } - - SetWidgetDisabled(WIDX_FIRE, staff->State == PeepState::Fixing || staff->State == PeepState::Inspecting); - } - } - - void CancelTools() - { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) - { - if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification) - ToolCancel(); - } - } - - void SetPage(int32_t pageNum) - { - CancelTools(); - - int32_t listen = 0; - if (page == WINDOW_STAFF_OVERVIEW && viewport != nullptr) - { - if (!(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) - listen = 1; - } - - page = pageNum; - frame_no = 0; - pressed_widgets = 0; - hold_down_widgets = 0; - widgets = window_staff_page_widgets[page]; - - RemoveViewport(); - - Invalidate(); - OnResize(); - OnPrepareDraw(); - InitScrollWidgets(); - ViewportInit(); - Invalidate(); - - if (listen && viewport != nullptr) - viewport->flags |= VIEWPORT_FLAG_SOUND_ON; - } - - void SetPressedTab() - { - for (int32_t i = 0; i < WINDOW_STAFF_PAGE_COUNT; i++) - SetWidgetPressed((WIDX_TAB_1 + i), false); - SetWidgetPressed(WIDX_TAB_1 + page, true); - } - - void SetOrder(int32_t orderId) - { - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - uint8_t newOrders = staff->StaffOrders ^ (1 << orderId); - auto staffSetOrdersAction = StaffSetOrdersAction(EntityId::FromUnderlying(number), newOrders); - GameActions::Execute(&staffSetOrdersAction); - } - - void ViewportInit() - { - if (page != WINDOW_STAFF_OVERVIEW) - return; - - auto staff = GetStaff(); - if (staff == nullptr) - { - return; - } - - std::optional tempFocus; - if (staff->State != PeepState::Picked) - { - tempFocus = Focus(staff->Id); - } - - uint16_t viewport_flags; - - if (viewport != nullptr) - { - if (tempFocus == focus) return; + } - viewport_flags = viewport->flags; - RemoveViewport(); - } - else - { - viewport_flags = 0; - if (gConfigGeneral.AlwaysShowGridlines) - viewport_flags |= VIEWPORT_FLAG_GRIDLINES; - } + auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_RESIZE].left + 4, widgets[WIDX_RESIZE].top + 4 }; - OnPrepareDraw(); - - focus = tempFocus; - - if (staff->State != PeepState::Picked) - { - if (viewport == nullptr) + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) { - const auto& viewWidget = widgets[WIDX_VIEWPORT]; + auto ft = Formatter(); + ft.Add(GetStaffWage(staff->AssignedStaffType)); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft); + screenCoords.y += LIST_ROW_HEIGHT; + } - auto screenPos = ScreenCoordsXY{ viewWidget.left + 1 + windowPos.x, viewWidget.top + 1 + windowPos.y }; - int32_t viewportWidth = viewWidget.width() - 1; - int32_t viewportHeight = viewWidget.height() - 1; + auto ft = Formatter(); + ft.Add(staff->GetHireDate()); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_EMPLOYED_FOR, ft); + screenCoords.y += LIST_ROW_HEIGHT; - ViewportCreate(this, screenPos, viewportWidth, viewportHeight, focus.value()); - flags |= WF_NO_SCROLLING; + switch (staff->AssignedStaffType) + { + case StaffType::Handyman: + ft = Formatter(); + ft.Add(staff->StaffLawnsMown); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LAWNS_MOWN, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(staff->StaffGardensWatered); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_GARDENS_WATERED, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(staff->StaffLitterSwept); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_LITTER_SWEPT, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(staff->StaffBinsEmptied); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_BINS_EMPTIED, ft); + break; + case StaffType::Mechanic: + ft = Formatter(); + ft.Add(staff->StaffRidesInspected); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_INSPECTED, ft); + screenCoords.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(staff->StaffRidesFixed); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_RIDES_FIXED, ft); + break; + case StaffType::Security: + ft = Formatter(); + ft.Add(staff->StaffVandalsStopped); + DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_VANDALS_STOPPED, ft); + break; + case StaffType::Entertainer: + case StaffType::Count: + break; + } + } + + void StatsResize() + { + min_width = 190; + max_width = 190; + min_height = 126; + max_height = 126; + + if (width < min_width) + { + width = min_width; + Invalidate(); + } + if (width > max_width) + { + Invalidate(); + width = max_width; + } + if (height < min_height) + { + height = min_height; + Invalidate(); + } + if (height > max_height) + { + Invalidate(); + height = max_height; + } + } + + void StatsUpdate() + { + frame_no++; + InvalidateWidget(WIDX_TAB_3); + + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + if (staff->WindowInvalidateFlags & PEEP_INVALIDATE_STAFF_STATS) + { + staff->WindowInvalidateFlags &= ~PEEP_INVALIDATE_STAFF_STATS; Invalidate(); } } - - if (viewport != nullptr) - viewport->flags = viewport_flags; - Invalidate(); - } - - void ShowLocateDropdown(Widget* widget) - { - gDropdownItems[0].Format = STR_LOCATE_SUBJECT_TIP; - gDropdownItems[1].Format = STR_FOLLOW_SUBJECT_TIP; - - WindowDropdownShowText( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 2); - gDropdownDefaultIndex = 0; - } - - void FollowPeep() - { - WindowBase* main = WindowGetMain(); - WindowFollowSprite(*main, EntityId::FromUnderlying(number)); - } - - void DrawTabImages(DrawPixelInfo& dpi) - { - DrawOverviewTabImage(dpi); - DrawTabImage(dpi, WINDOW_STAFF_OPTIONS, SPR_TAB_STAFF_OPTIONS_0); - DrawTabImage(dpi, WINDOW_STAFF_STATISTICS, SPR_TAB_STATS_0); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t baseImageId) - { - WidgetIndex widgetIndex = WIDX_TAB_1 + p; - Widget* widget = &widgets[widgetIndex]; - - auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; - - if (!IsWidgetDisabled(widgetIndex)) +#pragma endregion + void DisableWidgets() { - if (page == p) + const auto staff = GetStaff(); + if (staff == nullptr) { - int32_t frame = frame_no / TabAnimationDivisor[page - 1]; - baseImageId += (frame % TabAnimationFrames); + return; } - // Draw normal, enabled sprite. - GfxDrawSprite(dpi, ImageId(baseImageId), screenCoords); + for (WidgetIndex widgetIndex = WIDX_TAB_1; widgets[widgetIndex].type != kWidgetsEnd.type; widgetIndex++) + { + SetWidgetDisabled(widgetIndex, false); + } + + if (staff->AssignedStaffType == StaffType::Security) + { + SetWidgetDisabled(WIDX_TAB_2, true); + } + + if (page == WINDOW_STAFF_OVERVIEW) + { + if (staff->CanBePickedUp()) + { + SetWidgetDisabled(WIDX_PICKUP, false); + } + else + { + SetWidgetDisabled(WIDX_PICKUP, true); + } + + SetWidgetDisabled(WIDX_FIRE, staff->State == PeepState::Fixing || staff->State == PeepState::Inspecting); + } } - } - Staff* GetStaff() - { - return GetEntity(EntityId::FromUnderlying(number)); - } + void CancelTools() + { + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + { + if (number == gCurrentToolWidget.window_number && classification == gCurrentToolWidget.window_classification) + ToolCancel(); + } + } - static constexpr int32_t TabAnimationDivisor[] = { - 2, // WINDOW_STAFF_OPTIONS, - 4, // WINDOW_STAFF_STATISTICS, + void SetPage(int32_t pageNum) + { + CancelTools(); + + int32_t listen = 0; + if (page == WINDOW_STAFF_OVERVIEW && viewport != nullptr) + { + if (!(viewport->flags & VIEWPORT_FLAG_SOUND_ON)) + listen = 1; + } + + page = pageNum; + frame_no = 0; + pressed_widgets = 0; + hold_down_widgets = 0; + widgets = window_staff_page_widgets[page]; + + RemoveViewport(); + + Invalidate(); + OnResize(); + OnPrepareDraw(); + InitScrollWidgets(); + ViewportInit(); + Invalidate(); + + if (listen && viewport != nullptr) + viewport->flags |= VIEWPORT_FLAG_SOUND_ON; + } + + void SetPressedTab() + { + for (int32_t i = 0; i < WINDOW_STAFF_PAGE_COUNT; i++) + SetWidgetPressed((WIDX_TAB_1 + i), false); + SetWidgetPressed(WIDX_TAB_1 + page, true); + } + + void SetOrder(int32_t orderId) + { + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + uint8_t newOrders = staff->StaffOrders ^ (1 << orderId); + auto staffSetOrdersAction = StaffSetOrdersAction(EntityId::FromUnderlying(number), newOrders); + GameActions::Execute(&staffSetOrdersAction); + } + + void ViewportInit() + { + if (page != WINDOW_STAFF_OVERVIEW) + return; + + auto staff = GetStaff(); + if (staff == nullptr) + { + return; + } + + std::optional tempFocus; + if (staff->State != PeepState::Picked) + { + tempFocus = Focus(staff->Id); + } + + uint16_t viewport_flags; + + if (viewport != nullptr) + { + if (tempFocus == focus) + return; + + viewport_flags = viewport->flags; + RemoveViewport(); + } + else + { + viewport_flags = 0; + if (gConfigGeneral.AlwaysShowGridlines) + viewport_flags |= VIEWPORT_FLAG_GRIDLINES; + } + + OnPrepareDraw(); + + focus = tempFocus; + + if (staff->State != PeepState::Picked) + { + if (viewport == nullptr) + { + const auto& viewWidget = widgets[WIDX_VIEWPORT]; + + auto screenPos = ScreenCoordsXY{ viewWidget.left + 1 + windowPos.x, viewWidget.top + 1 + windowPos.y }; + int32_t viewportWidth = viewWidget.width() - 1; + int32_t viewportHeight = viewWidget.height() - 1; + + ViewportCreate(this, screenPos, viewportWidth, viewportHeight, focus.value()); + flags |= WF_NO_SCROLLING; + Invalidate(); + } + } + + if (viewport != nullptr) + viewport->flags = viewport_flags; + Invalidate(); + } + + void ShowLocateDropdown(Widget* widget) + { + gDropdownItems[0].Format = STR_LOCATE_SUBJECT_TIP; + gDropdownItems[1].Format = STR_FOLLOW_SUBJECT_TIP; + + WindowDropdownShowText( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, 2); + gDropdownDefaultIndex = 0; + } + + void FollowPeep() + { + WindowBase* main = WindowGetMain(); + WindowFollowSprite(*main, EntityId::FromUnderlying(number)); + } + + void DrawTabImages(DrawPixelInfo& dpi) + { + DrawOverviewTabImage(dpi); + DrawTabImage(dpi, WINDOW_STAFF_OPTIONS, SPR_TAB_STAFF_OPTIONS_0); + DrawTabImage(dpi, WINDOW_STAFF_STATISTICS, SPR_TAB_STATS_0); + } + + void DrawTabImage(DrawPixelInfo& dpi, int32_t p, int32_t baseImageId) + { + WidgetIndex widgetIndex = WIDX_TAB_1 + p; + Widget* widget = &widgets[widgetIndex]; + + auto screenCoords = windowPos + ScreenCoordsXY{ widget->left, widget->top }; + + if (!IsWidgetDisabled(widgetIndex)) + { + if (page == p) + { + int32_t frame = frame_no / TabAnimationDivisor[page - 1]; + baseImageId += (frame % TabAnimationFrames); + } + + // Draw normal, enabled sprite. + GfxDrawSprite(dpi, ImageId(baseImageId), screenCoords); + } + } + + Staff* GetStaff() + { + return GetEntity(EntityId::FromUnderlying(number)); + } + + static constexpr int32_t TabAnimationDivisor[] = { + 2, // WINDOW_STAFF_OPTIONS, + 4, // WINDOW_STAFF_STATISTICS, + }; + + static constexpr int32_t TabAnimationFrames = 7; }; - static constexpr int32_t TabAnimationFrames = 7; -}; + WindowBase* WindowStaffOpen(Peep* peep) + { + auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); -WindowBase* WindowStaffOpen(Peep* peep) -{ - auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); + if (w != nullptr) + return w; + + w = WindowCreate(WindowClass::Peep, WW, WH, WF_10 | WF_RESIZABLE); + + if (w == nullptr) + return nullptr; + + if (w != nullptr) + w->Initialise(peep->Id); - if (w != nullptr) return w; - - w = WindowCreate(WindowClass::Peep, WW, WH, WF_10 | WF_RESIZABLE); - - if (w == nullptr) - return nullptr; - - if (w != nullptr) - w->Initialise(peep->Id); - - return w; -} + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 7a5529026d..637c9f7b71 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -18,11 +18,13 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_SACK_STAFF; -static constexpr int32_t WW = 200; -static constexpr int32_t WH = 100; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_SACK_STAFF; + static constexpr int32_t WW = 200; + static constexpr int32_t WH = 100; -// clang-format off + // clang-format off enum WindowStaffFireWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -39,62 +41,63 @@ static Widget _staffFireWidgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class StaffFirePromptWindow final : public Window -{ -public: - void SetWindowNumber(rct_windownumber windownumber) + class StaffFirePromptWindow final : public Window { - number = windownumber; - } - - void OnOpen() override - { - widgets = _staffFireWidgets; - WindowInitScrollWidgets(*this); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void SetWindowNumber(rct_windownumber windownumber) { - case WIDX_YES: - { - auto staffFireAction = StaffFireAction(EntityId::FromUnderlying(number)); - GameActions::Execute(&staffFireAction); - break; - } - case WIDX_CLOSE: - case WIDX_CANCEL: - Close(); - break; + number = windownumber; } - } - void OnDraw(DrawPixelInfo& dpi) override + void OnOpen() override + { + widgets = _staffFireWidgets; + WindowInitScrollWidgets(*this); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_YES: + { + auto staffFireAction = StaffFireAction(EntityId::FromUnderlying(number)); + GameActions::Execute(&staffFireAction); + break; + } + case WIDX_CLOSE: + case WIDX_CANCEL: + Close(); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + Peep* peep = GetEntity(EntityId::FromUnderlying(number)); + auto ft = Formatter(); + peep->FormatNameTo(ft); + + ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ WW / 2, (WH / 2) - 3 }); + DrawTextWrapped(dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE }); + } + + void OnResize() override + { + ResizeFrame(); + } + }; + + WindowBase* WindowStaffFirePromptOpen(Peep* peep) { - DrawWidgets(dpi); - - Peep* peep = GetEntity(EntityId::FromUnderlying(number)); - auto ft = Formatter(); - peep->FormatNameTo(ft); - - ScreenCoordsXY textCoords(windowPos + ScreenCoordsXY{ WW / 2, (WH / 2) - 3 }); - DrawTextWrapped(dpi, textCoords, WW - 4, STR_FIRE_STAFF_ID, ft, { TextAlignment::CENTRE }); + // Check if the confirm window already exists + auto* window = WindowFocusOrCreate( + WindowClass::FirePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); + window->SetWindowNumber(peep->Id.ToUnderlying()); + return window; } - - void OnResize() override - { - ResizeFrame(); - } -}; - -WindowBase* WindowStaffFirePromptOpen(Peep* peep) -{ - // Check if the confirm window already exists - auto* window = WindowFocusOrCreate( - WindowClass::FirePrompt, WW, WH, WF_CENTRE_SCREEN | WF_TRANSPARENT); - window->SetWindowNumber(peep->Id.ToUnderlying()); - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 7003384afc..0ddf7019c4 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -36,41 +36,41 @@ #include #include -using namespace OpenRCT2; - -enum +namespace OpenRCT2::Ui::Windows { - WINDOW_STAFF_LIST_TAB_HANDYMEN, - WINDOW_STAFF_LIST_TAB_MECHANICS, - WINDOW_STAFF_LIST_TAB_SECURITY, - WINDOW_STAFF_LIST_TAB_ENTERTAINERS -}; + enum + { + WINDOW_STAFF_LIST_TAB_HANDYMEN, + WINDOW_STAFF_LIST_TAB_MECHANICS, + WINDOW_STAFF_LIST_TAB_SECURITY, + WINDOW_STAFF_LIST_TAB_ENTERTAINERS + }; -enum WindowStaffListWidgetIdx -{ - WIDX_STAFF_LIST_BACKGROUND, - WIDX_STAFF_LIST_TITLE, - WIDX_STAFF_LIST_CLOSE, - WIDX_STAFF_LIST_TAB_CONTENT_PANEL, - WIDX_STAFF_LIST_HANDYMEN_TAB, - WIDX_STAFF_LIST_MECHANICS_TAB, - WIDX_STAFF_LIST_SECURITY_TAB, - WIDX_STAFF_LIST_ENTERTAINERS_TAB, - WIDX_STAFF_LIST_LIST, - WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER, - WIDX_STAFF_LIST_HIRE_BUTTON, - WIDX_STAFF_LIST_QUICK_FIRE, - WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, - WIDX_STAFF_LIST_MAP, -}; + enum WindowStaffListWidgetIdx + { + WIDX_STAFF_LIST_BACKGROUND, + WIDX_STAFF_LIST_TITLE, + WIDX_STAFF_LIST_CLOSE, + WIDX_STAFF_LIST_TAB_CONTENT_PANEL, + WIDX_STAFF_LIST_HANDYMEN_TAB, + WIDX_STAFF_LIST_MECHANICS_TAB, + WIDX_STAFF_LIST_SECURITY_TAB, + WIDX_STAFF_LIST_ENTERTAINERS_TAB, + WIDX_STAFF_LIST_LIST, + WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER, + WIDX_STAFF_LIST_HIRE_BUTTON, + WIDX_STAFF_LIST_QUICK_FIRE, + WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, + WIDX_STAFF_LIST_MAP, + }; -static constexpr StringId WINDOW_TITLE = STR_STAFF; -static constexpr int32_t WW = 320; -static constexpr int32_t WH = 270; -constexpr int32_t MAX_WW = 500; -constexpr int32_t MAX_WH = 450; + static constexpr StringId WINDOW_TITLE = STR_STAFF; + static constexpr int32_t WW = 320; + static constexpr int32_t WH = 270; + constexpr int32_t MAX_WW = 500; + constexpr int32_t MAX_WH = 450; -// clang-format off + // clang-format off static Widget _staffListWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, { WW, WH - 43}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab content panel @@ -86,677 +86,681 @@ static Widget _staffListWidgets[] = { MakeWidget({291, 46}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_MAP), STR_SHOW_STAFF_ON_MAP_TIP ), // show staff on map button kWidgetsEnd, }; -// clang-format on + // clang-format on -class StaffListWindow final : public Window -{ -private: - struct StaffNamingConvention + class StaffListWindow final : public Window { - StringId Plural; - StringId Singular; - StringId ActionHire; - }; - - struct StaffEntry - { - EntityId Id; - u8string Name; - }; - - std::vector _staffList; - bool _quickFireMode{}; - std::optional _highlightedIndex{}; - int32_t _selectedTab{}; - uint32_t _tabAnimationIndex{}; - -public: - void OnOpen() override - { - widgets = _staffListWidgets; - WindowInitScrollWidgets(*this); - - widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::Empty; - min_width = WW; - min_height = WH; - max_width = MAX_WW; - max_height = MAX_WH; - - RefreshList(); - } - - void OnClose() override - { - CancelTools(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + private: + struct StaffNamingConvention { - case WIDX_STAFF_LIST_CLOSE: - Close(); - break; - case WIDX_STAFF_LIST_HIRE_BUTTON: + StringId Plural; + StringId Singular; + StringId ActionHire; + }; + + struct StaffEntry + { + EntityId Id; + u8string Name; + }; + + std::vector _staffList; + bool _quickFireMode{}; + std::optional _highlightedIndex{}; + int32_t _selectedTab{}; + uint32_t _tabAnimationIndex{}; + + public: + void OnOpen() override + { + widgets = _staffListWidgets; + WindowInitScrollWidgets(*this); + + widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::Empty; + min_width = WW; + min_height = WH; + max_width = MAX_WW; + max_height = MAX_WH; + + RefreshList(); + } + + void OnClose() override + { + CancelTools(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) { - auto staffType = GetSelectedStaffType(); - auto costume = EntertainerCostume::Count; - if (staffType == StaffType::Entertainer) + case WIDX_STAFF_LIST_CLOSE: + Close(); + break; + case WIDX_STAFF_LIST_HIRE_BUTTON: { - costume = GetRandomEntertainerCostume(); - } - HireNewMember(staffType, costume); - break; - } - case WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON: - if (!ToolSet(*this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair)) - { - ShowGridlines(); - SetPatrolAreaToRender(GetSelectedStaffType()); - GfxInvalidateScreen(); - } - break; - case WIDX_STAFF_LIST_MAP: - ContextOpenWindow(WindowClass::Map); - break; - case WIDX_STAFF_LIST_QUICK_FIRE: - _quickFireMode = !_quickFireMode; - Invalidate(); - break; - } - } - - void OnResize() override - { - min_width = WW; - min_height = WH; - if (width < min_width) - { - width = min_width; - Invalidate(); - } - if (height < min_height) - { - height = min_height; - Invalidate(); - } - ResizeFrameWithPage(); - } - - void OnUpdate() override - { - _tabAnimationIndex++; - if (_tabAnimationIndex >= 24) - { - _tabAnimationIndex = 0; - } - else - { - InvalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab); - - // Enable highlighting of these staff members in map window - if (WindowFindByClass(WindowClass::Map) != nullptr) - { - gWindowMapFlashingFlags |= MapFlashingFlags::StaffListOpen; - for (auto peep : EntityList()) - { - EntitySetFlashing(peep, false); - if (peep->AssignedStaffType == GetSelectedStaffType()) + auto staffType = GetSelectedStaffType(); + auto costume = EntertainerCostume::Count; + if (staffType == StaffType::Entertainer) { - EntitySetFlashing(peep, true); + costume = GetRandomEntertainerCostume(); } + HireNewMember(staffType, costume); + break; } - } - } - - // Note this may be slow if number of staff increases a large amount. - // See GuestList for fix (more intents) if required. - RefreshList(); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_STAFF_LIST_HANDYMEN_TAB: - case WIDX_STAFF_LIST_MECHANICS_TAB: - case WIDX_STAFF_LIST_SECURITY_TAB: - case WIDX_STAFF_LIST_ENTERTAINERS_TAB: - { - auto newSelectedTab = widgetIndex - WIDX_STAFF_LIST_HANDYMEN_TAB; - if (_selectedTab != newSelectedTab) - { - _selectedTab = static_cast(newSelectedTab); + case WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON: + if (!ToolSet(*this, WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON, Tool::Crosshair)) + { + ShowGridlines(); + SetPatrolAreaToRender(GetSelectedStaffType()); + GfxInvalidateScreen(); + } + break; + case WIDX_STAFF_LIST_MAP: + ContextOpenWindow(WindowClass::Map); + break; + case WIDX_STAFF_LIST_QUICK_FIRE: + _quickFireMode = !_quickFireMode; Invalidate(); - scrolls[0].v_top = 0; - CancelTools(); - } - break; + break; } - case WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER: - WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], StaffGetColour(GetSelectedStaffType())); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - { - return; - } - if (widgetIndex == WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER) - { - auto action = StaffSetColourAction(GetSelectedStaffType(), ColourDropDownIndexToColour(dropdownIndex)); - GameActions::Execute(&action); - } - } - - void OnPrepareDraw() override - { - // Set selected tab - SetWidgetPressed(WIDX_STAFF_LIST_HANDYMEN_TAB, false); - SetWidgetPressed(WIDX_STAFF_LIST_MECHANICS_TAB, false); - SetWidgetPressed(WIDX_STAFF_LIST_SECURITY_TAB, false); - SetWidgetPressed(WIDX_STAFF_LIST_ENTERTAINERS_TAB, false); - SetWidgetPressed(_selectedTab + WIDX_STAFF_LIST_HANDYMEN_TAB, true); - - widgets[WIDX_STAFF_LIST_HIRE_BUTTON].text = GetStaffNamingConvention(GetSelectedStaffType()).ActionHire; - widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::Empty; - - if (GetSelectedStaffType() != StaffType::Entertainer) - { - widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::ColourBtn; - widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = GetColourButtonImage(StaffGetColour(GetSelectedStaffType())); - } - SetWidgetPressed(WIDX_STAFF_LIST_QUICK_FIRE, _quickFireMode); - - ResizeFrameWithPage(); - widgets[WIDX_STAFF_LIST_LIST].right = width - 4; - widgets[WIDX_STAFF_LIST_LIST].bottom = height - 15; - widgets[WIDX_STAFF_LIST_QUICK_FIRE].left = width - 77; - widgets[WIDX_STAFF_LIST_QUICK_FIRE].right = width - 54; - widgets[WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON].left = width - 53; - widgets[WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON].right = width - 30; - widgets[WIDX_STAFF_LIST_MAP].left = width - 29; - widgets[WIDX_STAFF_LIST_MAP].right = width - 6; - widgets[WIDX_STAFF_LIST_HIRE_BUTTON].left = width - 155; - widgets[WIDX_STAFF_LIST_HIRE_BUTTON].right = width - 11; - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - DrawTabImages(dpi); - - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - auto ft = Formatter(); - ft.Add(GetStaffWage(GetSelectedStaffType())); - DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft); } - if (GetSelectedStaffType() != StaffType::Entertainer) + void OnResize() override { - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 }, - STR_UNIFORM_COLOUR); - } - - auto namingConvention = GetStaffNamingConvention(GetSelectedStaffType()); - auto staffTypeStringId = _staffList.size() == 1 ? namingConvention.Singular : namingConvention.Plural; - - auto ft = Formatter(); - ft.Add(_staffList.size()); - ft.Add(staffTypeStringId); - - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft); - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - if (_highlightedIndex) - { - _highlightedIndex = {}; - Invalidate(); - } - - auto scrollHeight = static_cast(_staffList.size()) * SCROLLABLE_ROW_HEIGHT; - auto i = scrollHeight - widgets[WIDX_STAFF_LIST_LIST].bottom + widgets[WIDX_STAFF_LIST_LIST].top + 21; - if (i < 0) - i = 0; - if (i < scrolls[0].v_top) - { - scrolls[0].v_top = i; - Invalidate(); - } - - auto scrollWidth = widgets[WIDX_STAFF_LIST_LIST].width() - 15; - return { scrollWidth, scrollHeight }; - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - auto i = static_cast(screenCoords.y / SCROLLABLE_ROW_HEIGHT); - if (i != _highlightedIndex) - { - _highlightedIndex = static_cast(i); - Invalidate(); - } - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t i = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - for (const auto& entry : _staffList) - { - if (i == 0) + min_width = WW; + min_height = WH; + if (width < min_width) { - if (_quickFireMode) + width = min_width; + Invalidate(); + } + if (height < min_height) + { + height = min_height; + Invalidate(); + } + ResizeFrameWithPage(); + } + + void OnUpdate() override + { + _tabAnimationIndex++; + if (_tabAnimationIndex >= 24) + { + _tabAnimationIndex = 0; + } + else + { + InvalidateWidget(WIDX_STAFF_LIST_HANDYMEN_TAB + _selectedTab); + + // Enable highlighting of these staff members in map window + if (WindowFindByClass(WindowClass::Map) != nullptr) { - auto staffFireAction = StaffFireAction(entry.Id); - GameActions::Execute(&staffFireAction); - } - else - { - auto peep = GetEntity(entry.Id); - if (peep != nullptr) + gWindowMapFlashingFlags |= MapFlashingFlags::StaffListOpen; + for (auto peep : EntityList()) { - auto intent = Intent(WindowClass::Peep); - intent.PutExtra(INTENT_EXTRA_PEEP, peep); - ContextOpenIntent(&intent); - } - } - break; - } - - i--; - } - } - - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; - GfxFillRect( - dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - - // How much space do we have for the name and action columns? (Discount scroll area and icons.) - const int32_t nonIconSpace = widgets[WIDX_STAFF_LIST_LIST].width() - 15 - 68; - const int32_t nameColumnSize = nonIconSpace * 0.42; - const int32_t actionColumnSize = nonIconSpace * 0.58; - const int32_t actionOffset = widgets[WIDX_STAFF_LIST_LIST].right - actionColumnSize - 15; - - auto y = 0; - size_t i = 0; - for (const auto& entry : _staffList) - { - if (y > dpi.y + dpi.height) - { - break; - } - - if (y + 11 >= dpi.y) - { - const auto* peep = GetEntity(entry.Id); - if (peep == nullptr) - { - continue; - } - int32_t format = (_quickFireMode ? STR_RED_STRINGID : STR_BLACK_STRING); - - if (i == _highlightedIndex) - { - GfxFilterRect(dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1); - format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); - } - - auto ft = Formatter(); - peep->FormatNameTo(ft); - DrawTextEllipsised(dpi, { 0, y }, nameColumnSize, format, ft); - - ft = Formatter(); - peep->FormatActionTo(ft); - DrawTextEllipsised(dpi, { actionOffset, y }, actionColumnSize, format, ft); - - // True if a patrol path is set for the worker - if (peep->HasPatrolArea()) - { - GfxDrawSprite(dpi, ImageId(SPR_STAFF_PATROL_PATH), { nameColumnSize + 5, y }); - } - - auto staffOrderIcon_x = nameColumnSize + 20; - if (peep->AssignedStaffType != StaffType::Entertainer) - { - auto staffOrders = peep->StaffOrders; - auto staffOrderSprite = GetStaffOrderBaseSprite(GetSelectedStaffType()); - - while (staffOrders != 0) - { - if (staffOrders & 1) + EntitySetFlashing(peep, false); + if (peep->AssignedStaffType == GetSelectedStaffType()) { - GfxDrawSprite(dpi, ImageId(staffOrderSprite), { staffOrderIcon_x, y }); + EntitySetFlashing(peep, true); } - staffOrders = staffOrders >> 1; - staffOrderIcon_x += 9; - // TODO: Remove sprite ID addition - staffOrderSprite++; } } + } + + // Note this may be slow if number of staff increases a large amount. + // See GuestList for fix (more intents) if required. + RefreshList(); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_STAFF_LIST_HANDYMEN_TAB: + case WIDX_STAFF_LIST_MECHANICS_TAB: + case WIDX_STAFF_LIST_SECURITY_TAB: + case WIDX_STAFF_LIST_ENTERTAINERS_TAB: + { + auto newSelectedTab = widgetIndex - WIDX_STAFF_LIST_HANDYMEN_TAB; + if (_selectedTab != newSelectedTab) + { + _selectedTab = static_cast(newSelectedTab); + Invalidate(); + scrolls[0].v_top = 0; + CancelTools(); + } + break; + } + case WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER: + WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], StaffGetColour(GetSelectedStaffType())); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (dropdownIndex == -1) + { + return; + } + if (widgetIndex == WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER) + { + auto action = StaffSetColourAction(GetSelectedStaffType(), ColourDropDownIndexToColour(dropdownIndex)); + GameActions::Execute(&action); + } + } + + void OnPrepareDraw() override + { + // Set selected tab + SetWidgetPressed(WIDX_STAFF_LIST_HANDYMEN_TAB, false); + SetWidgetPressed(WIDX_STAFF_LIST_MECHANICS_TAB, false); + SetWidgetPressed(WIDX_STAFF_LIST_SECURITY_TAB, false); + SetWidgetPressed(WIDX_STAFF_LIST_ENTERTAINERS_TAB, false); + SetWidgetPressed(_selectedTab + WIDX_STAFF_LIST_HANDYMEN_TAB, true); + + widgets[WIDX_STAFF_LIST_HIRE_BUTTON].text = GetStaffNamingConvention(GetSelectedStaffType()).ActionHire; + widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::Empty; + + if (GetSelectedStaffType() != StaffType::Entertainer) + { + widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].type = WindowWidgetType::ColourBtn; + widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].image = GetColourButtonImage( + StaffGetColour(GetSelectedStaffType())); + } + SetWidgetPressed(WIDX_STAFF_LIST_QUICK_FIRE, _quickFireMode); + + ResizeFrameWithPage(); + widgets[WIDX_STAFF_LIST_LIST].right = width - 4; + widgets[WIDX_STAFF_LIST_LIST].bottom = height - 15; + widgets[WIDX_STAFF_LIST_QUICK_FIRE].left = width - 77; + widgets[WIDX_STAFF_LIST_QUICK_FIRE].right = width - 54; + widgets[WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON].left = width - 53; + widgets[WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON].right = width - 30; + widgets[WIDX_STAFF_LIST_MAP].left = width - 29; + widgets[WIDX_STAFF_LIST_MAP].right = width - 6; + widgets[WIDX_STAFF_LIST_HIRE_BUTTON].left = width - 155; + widgets[WIDX_STAFF_LIST_HIRE_BUTTON].right = width - 11; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + DrawTabImages(dpi); + + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + auto ft = Formatter(); + ft.Add(GetStaffWage(GetSelectedStaffType())); + DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft); + } + + if (GetSelectedStaffType() != StaffType::Entertainer) + { + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 6, widgets[WIDX_STAFF_LIST_UNIFORM_COLOUR_PICKER].top + 1 }, + STR_UNIFORM_COLOUR); + } + + auto namingConvention = GetStaffNamingConvention(GetSelectedStaffType()); + auto staffTypeStringId = _staffList.size() == 1 ? namingConvention.Singular : namingConvention.Plural; + + auto ft = Formatter(); + ft.Add(_staffList.size()); + ft.Add(staffTypeStringId); + + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 4, widgets[WIDX_STAFF_LIST_LIST].bottom + 2 }, STR_STAFF_LIST_COUNTER, ft); + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + if (_highlightedIndex) + { + _highlightedIndex = {}; + Invalidate(); + } + + auto scrollHeight = static_cast(_staffList.size()) * SCROLLABLE_ROW_HEIGHT; + auto i = scrollHeight - widgets[WIDX_STAFF_LIST_LIST].bottom + widgets[WIDX_STAFF_LIST_LIST].top + 21; + if (i < 0) + i = 0; + if (i < scrolls[0].v_top) + { + scrolls[0].v_top = i; + Invalidate(); + } + + auto scrollWidth = widgets[WIDX_STAFF_LIST_LIST].width() - 15; + return { scrollWidth, scrollHeight }; + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + auto i = static_cast(screenCoords.y / SCROLLABLE_ROW_HEIGHT); + if (i != _highlightedIndex) + { + _highlightedIndex = static_cast(i); + Invalidate(); + } + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int32_t i = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + for (const auto& entry : _staffList) + { + if (i == 0) + { + if (_quickFireMode) + { + auto staffFireAction = StaffFireAction(entry.Id); + GameActions::Execute(&staffFireAction); + } + else + { + auto peep = GetEntity(entry.Id); + if (peep != nullptr) + { + auto intent = Intent(WindowClass::Peep); + intent.PutExtra(INTENT_EXTRA_PEEP, peep); + ContextOpenIntent(&intent); + } + } + break; + } + + i--; + } + } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + auto dpiCoords = ScreenCoordsXY{ dpi.x, dpi.y }; + GfxFillRect( + dpi, { dpiCoords, dpiCoords + ScreenCoordsXY{ dpi.width - 1, dpi.height - 1 } }, + ColourMapA[colours[1]].mid_light); + + // How much space do we have for the name and action columns? (Discount scroll area and icons.) + const int32_t nonIconSpace = widgets[WIDX_STAFF_LIST_LIST].width() - 15 - 68; + const int32_t nameColumnSize = nonIconSpace * 0.42; + const int32_t actionColumnSize = nonIconSpace * 0.58; + const int32_t actionOffset = widgets[WIDX_STAFF_LIST_LIST].right - actionColumnSize - 15; + + auto y = 0; + size_t i = 0; + for (const auto& entry : _staffList) + { + if (y > dpi.y + dpi.height) + { + break; + } + + if (y + 11 >= dpi.y) + { + const auto* peep = GetEntity(entry.Id); + if (peep == nullptr) + { + continue; + } + int32_t format = (_quickFireMode ? STR_RED_STRINGID : STR_BLACK_STRING); + + if (i == _highlightedIndex) + { + GfxFilterRect(dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1); + format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID); + } + + auto ft = Formatter(); + peep->FormatNameTo(ft); + DrawTextEllipsised(dpi, { 0, y }, nameColumnSize, format, ft); + + ft = Formatter(); + peep->FormatActionTo(ft); + DrawTextEllipsised(dpi, { actionOffset, y }, actionColumnSize, format, ft); + + // True if a patrol path is set for the worker + if (peep->HasPatrolArea()) + { + GfxDrawSprite(dpi, ImageId(SPR_STAFF_PATROL_PATH), { nameColumnSize + 5, y }); + } + + auto staffOrderIcon_x = nameColumnSize + 20; + if (peep->AssignedStaffType != StaffType::Entertainer) + { + auto staffOrders = peep->StaffOrders; + auto staffOrderSprite = GetStaffOrderBaseSprite(GetSelectedStaffType()); + + while (staffOrders != 0) + { + if (staffOrders & 1) + { + GfxDrawSprite(dpi, ImageId(staffOrderSprite), { staffOrderIcon_x, y }); + } + staffOrders = staffOrders >> 1; + staffOrderIcon_x += 9; + // TODO: Remove sprite ID addition + staffOrderSprite++; + } + } + else + { + GfxDrawSprite(dpi, ImageId(GetEntertainerCostumeSprite(peep->SpriteType)), { staffOrderIcon_x, y }); + } + } + + y += SCROLLABLE_ROW_HEIGHT; + i++; + } + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON) + { + auto closestStaffMember = GetClosestStaffMemberTo(screenCoords); + if (closestStaffMember != nullptr) + { + ToolCancel(); + auto* staffWindow = WindowStaffOpen(closestStaffMember); + staffWindow->OnDropdown(WC_PEEP__WIDX_PATROL, 0); + } else { - GfxDrawSprite(dpi, ImageId(GetEntertainerCostumeSprite(peep->SpriteType)), { staffOrderIcon_x, y }); + auto ft = Formatter(); + ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); + ContextShowError(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); + } + } + } + + void OnToolAbort(WidgetIndex widgetIndex) override + { + if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON) + { + HideGridlines(); + ToolCancel(); + ClearPatrolAreaToRender(); + GfxInvalidateScreen(); + } + } + + void RefreshList() + { + _staffList.clear(); + + for (auto* peep : EntityList()) + { + EntitySetFlashing(peep, false); + if (peep->AssignedStaffType == GetSelectedStaffType()) + { + EntitySetFlashing(peep, true); + + StaffEntry entry; + entry.Id = peep->Id; + entry.Name = peep->GetName(); + + _staffList.push_back(std::move(entry)); } } - y += SCROLLABLE_ROW_HEIGHT; - i++; + std::sort(_staffList.begin(), _staffList.end(), [](const auto& a, const auto& b) { + return StrLogicalCmp(a.Name.c_str(), b.Name.c_str()) < 0; + }); } - } - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON) + private: + /** + * Hires a new staff member of the given type. + */ + void HireNewMember(StaffType staffType, EntertainerCostume entertainerType) { - auto closestStaffMember = GetClosestStaffMemberTo(screenCoords); - if (closestStaffMember != nullptr) + bool autoPosition = gConfigGeneral.AutoStaffPlacement; + if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) { - ToolCancel(); - auto* staffWindow = WindowStaffOpen(closestStaffMember); - staffWindow->OnDropdown(WC_PEEP__WIDX_PATROL, 0); + autoPosition = autoPosition ^ 1; } - else + + uint32_t staffOrders = 0; + + if (staffType == StaffType::Handyman) { - auto ft = Formatter(); - ft.Add(GetStaffNamingConvention(GetSelectedStaffType()).Plural); - ContextShowError(STR_NO_THING_IN_PARK_YET, STR_NONE, ft); + staffOrders = STAFF_ORDERS_SWEEPING | STAFF_ORDERS_WATER_FLOWERS | STAFF_ORDERS_EMPTY_BINS; + if (gConfigGeneral.HandymenMowByDefault) + { + staffOrders |= STAFF_ORDERS_MOWING; + } } - } - } - - void OnToolAbort(WidgetIndex widgetIndex) override - { - if (widgetIndex == WIDX_STAFF_LIST_SHOW_PATROL_AREA_BUTTON) - { - HideGridlines(); - ToolCancel(); - ClearPatrolAreaToRender(); - GfxInvalidateScreen(); - } - } - - void RefreshList() - { - _staffList.clear(); - - for (auto* peep : EntityList()) - { - EntitySetFlashing(peep, false); - if (peep->AssignedStaffType == GetSelectedStaffType()) + else if (staffType == StaffType::Mechanic) { - EntitySetFlashing(peep, true); - - StaffEntry entry; - entry.Id = peep->Id; - entry.Name = peep->GetName(); - - _staffList.push_back(std::move(entry)); + staffOrders = STAFF_ORDERS_INSPECT_RIDES | STAFF_ORDERS_FIX_RIDES; } - } - std::sort(_staffList.begin(), _staffList.end(), [](const auto& a, const auto& b) { - return StrLogicalCmp(a.Name.c_str(), b.Name.c_str()) < 0; - }); - } + auto hireStaffAction = StaffHireNewAction(autoPosition, staffType, entertainerType, staffOrders); + hireStaffAction.SetCallback([=](const GameAction*, const GameActions::Result* res) -> void { + if (res->Error != GameActions::Status::Ok) + return; -private: - /** - * Hires a new staff member of the given type. - */ - void HireNewMember(StaffType staffType, EntertainerCostume entertainerType) - { - bool autoPosition = gConfigGeneral.AutoStaffPlacement; - if (gInputPlaceObjectModifier & PLACE_OBJECT_MODIFIER_SHIFT_Z) - { - autoPosition = autoPosition ^ 1; - } + auto actionResult = res->GetData(); + auto* staff = GetEntity(actionResult.StaffEntityId); + if (staff == nullptr) + return; - uint32_t staffOrders = 0; + // If autoposition of staff is disabled, pickup peep and then open the staff window + if (staff->State == PeepState::Picked) + { + CoordsXYZ nullLoc{}; + nullLoc.SetNull(); - if (staffType == StaffType::Handyman) - { - staffOrders = STAFF_ORDERS_SWEEPING | STAFF_ORDERS_WATER_FLOWERS | STAFF_ORDERS_EMPTY_BINS; - if (gConfigGeneral.HandymenMowByDefault) - { - staffOrders |= STAFF_ORDERS_MOWING; - } - } - else if (staffType == StaffType::Mechanic) - { - staffOrders = STAFF_ORDERS_INSPECT_RIDES | STAFF_ORDERS_FIX_RIDES; - } + PeepPickupAction pickupAction{ PeepPickupType::Pickup, staff->Id, nullLoc, NetworkGetCurrentPlayerId() }; + pickupAction.SetCallback([staffId = staff->Id](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; - auto hireStaffAction = StaffHireNewAction(autoPosition, staffType, entertainerType, staffOrders); - hireStaffAction.SetCallback([=](const GameAction*, const GameActions::Result* res) -> void { - if (res->Error != GameActions::Status::Ok) - return; - - auto actionResult = res->GetData(); - auto* staff = GetEntity(actionResult.StaffEntityId); - if (staff == nullptr) - return; - - // If autoposition of staff is disabled, pickup peep and then open the staff window - if (staff->State == PeepState::Picked) - { - CoordsXYZ nullLoc{}; - nullLoc.SetNull(); - - PeepPickupAction pickupAction{ PeepPickupType::Pickup, staff->Id, nullLoc, NetworkGetCurrentPlayerId() }; - pickupAction.SetCallback([staffId = staff->Id](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - return; - - auto* staff2 = GetEntity(staffId); + auto* staff2 = GetEntity(staffId); + auto intent = Intent(WindowClass::Peep); + intent.PutExtra(INTENT_EXTRA_PEEP, staff2); + auto* wind = ContextOpenIntent(&intent); + if (wind != nullptr) + { + ToolSet(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); + } + }); + GameActions::Execute(&pickupAction); + } + else + { + // Open window for new staff. auto intent = Intent(WindowClass::Peep); - intent.PutExtra(INTENT_EXTRA_PEEP, staff2); - auto* wind = ContextOpenIntent(&intent); - if (wind != nullptr) - { - ToolSet(*wind, WC_STAFF__WIDX_PICKUP, Tool::Picker); - } - }); - GameActions::Execute(&pickupAction); - } - else - { - // Open window for new staff. - auto intent = Intent(WindowClass::Peep); - intent.PutExtra(INTENT_EXTRA_PEEP, staff); - ContextOpenIntent(&intent); - } - }); + intent.PutExtra(INTENT_EXTRA_PEEP, staff); + ContextOpenIntent(&intent); + } + }); - GameActions::Execute(&hireStaffAction); - } + GameActions::Execute(&hireStaffAction); + } - StaffType GetSelectedStaffType() const - { - return static_cast(_selectedTab); - } - - void DrawTabImages(DrawPixelInfo& dpi) const - { - const auto& gameState = GetGameState(); - DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_HANDYMEN, PeepSpriteType::Handyman, gameState.StaffHandymanColour); - DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_MECHANICS, PeepSpriteType::Mechanic, gameState.StaffMechanicColour); - DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_SECURITY, PeepSpriteType::Security, gameState.StaffSecurityColour); - DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, PeepSpriteType::EntertainerElephant); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t tabIndex, PeepSpriteType type, colour_t colour) const - { - auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex; - const auto& widget = widgets[widgetIndex]; - auto imageId = (_selectedTab == tabIndex ? (_tabAnimationIndex & ~3) : 0); - imageId += GetPeepAnimation(type).base_image + 1; - GfxDrawSprite( - dpi, ImageId(imageId, colour), windowPos + ScreenCoordsXY{ (widget.left + widget.right) / 2, widget.bottom - 6 }); - } - - void DrawTabImage(DrawPixelInfo& dpi, int32_t tabIndex, PeepSpriteType type) const - { - auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex; - const auto& widget = widgets[widgetIndex]; - DrawPixelInfo clippedDpi; - if (ClipDrawPixelInfo( - clippedDpi, dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }, widget.right - widget.left - 1, - widget.bottom - widget.top - 1)) + StaffType GetSelectedStaffType() const { - auto imageId = (_selectedTab == 3 ? (_tabAnimationIndex & ~3) : 0); + return static_cast(_selectedTab); + } + + void DrawTabImages(DrawPixelInfo& dpi) const + { + const auto& gameState = GetGameState(); + DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_HANDYMEN, PeepSpriteType::Handyman, gameState.StaffHandymanColour); + DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_MECHANICS, PeepSpriteType::Mechanic, gameState.StaffMechanicColour); + DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_SECURITY, PeepSpriteType::Security, gameState.StaffSecurityColour); + DrawTabImage(dpi, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, PeepSpriteType::EntertainerElephant); + } + + void DrawTabImage(DrawPixelInfo& dpi, int32_t tabIndex, PeepSpriteType type, colour_t colour) const + { + auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex; + const auto& widget = widgets[widgetIndex]; + auto imageId = (_selectedTab == tabIndex ? (_tabAnimationIndex & ~3) : 0); imageId += GetPeepAnimation(type).base_image + 1; - GfxDrawSprite(clippedDpi, ImageId(imageId), { 15, 23 }); + GfxDrawSprite( + dpi, ImageId(imageId, colour), + windowPos + ScreenCoordsXY{ (widget.left + widget.right) / 2, widget.bottom - 6 }); } - } - void CancelTools() - { - if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) + void DrawTabImage(DrawPixelInfo& dpi, int32_t tabIndex, PeepSpriteType type) const { - if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) + auto widgetIndex = WIDX_STAFF_LIST_HANDYMEN_TAB + tabIndex; + const auto& widget = widgets[widgetIndex]; + DrawPixelInfo clippedDpi; + if (ClipDrawPixelInfo( + clippedDpi, dpi, windowPos + ScreenCoordsXY{ widget.left + 1, widget.top + 1 }, + widget.right - widget.left - 1, widget.bottom - widget.top - 1)) { - ToolCancel(); + auto imageId = (_selectedTab == 3 ? (_tabAnimationIndex & ~3) : 0); + imageId += GetPeepAnimation(type).base_image + 1; + GfxDrawSprite(clippedDpi, ImageId(imageId), { 15, 23 }); } } - } - Peep* GetClosestStaffMemberTo(const ScreenCoordsXY& screenCoords) - { - int32_t direction{}; - TileElement* tileElement{}; - auto footpathCoords = FootpathGetCoordinatesFromPos(screenCoords, &direction, &tileElement); - if (footpathCoords.IsNull()) - return nullptr; - - auto isPatrolAreaSet = IsPatrolAreaSetForStaffType(GetSelectedStaffType(), footpathCoords); - - Peep* closestPeep = nullptr; - auto closestPeepDistance = std::numeric_limits::max(); - for (auto peep : EntityList()) + void CancelTools() { - if (peep->AssignedStaffType != GetSelectedStaffType()) - continue; - - if (isPatrolAreaSet) + if (InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) { - if (!peep->HasPatrolArea()) + if (classification == gCurrentToolWidget.window_classification && number == gCurrentToolWidget.window_number) + { + ToolCancel(); + } + } + } + + Peep* GetClosestStaffMemberTo(const ScreenCoordsXY& screenCoords) + { + int32_t direction{}; + TileElement* tileElement{}; + auto footpathCoords = FootpathGetCoordinatesFromPos(screenCoords, &direction, &tileElement); + if (footpathCoords.IsNull()) + return nullptr; + + auto isPatrolAreaSet = IsPatrolAreaSetForStaffType(GetSelectedStaffType(), footpathCoords); + + Peep* closestPeep = nullptr; + auto closestPeepDistance = std::numeric_limits::max(); + for (auto peep : EntityList()) + { + if (peep->AssignedStaffType != GetSelectedStaffType()) + continue; + + if (isPatrolAreaSet) + { + if (!peep->HasPatrolArea()) + { + continue; + } + if (!peep->IsLocationInPatrol(footpathCoords)) + { + continue; + } + } + + if (peep->x == LOCATION_NULL) { continue; } - if (!peep->IsLocationInPatrol(footpathCoords)) + + auto distance = std::abs(footpathCoords.x - peep->x) + std::abs(footpathCoords.y - peep->y); + if (distance < closestPeepDistance) { - continue; + closestPeepDistance = distance; + closestPeep = peep; } } + return closestPeep; + } - if (peep->x == LOCATION_NULL) + static EntertainerCostume GetRandomEntertainerCostume() + { + auto result = EntertainerCostume::Panda; + EntertainerCostume costumeList[EnumValue(EntertainerCostume::Count)]; + int32_t numCostumes = StaffGetAvailableEntertainerCostumeList(costumeList); + if (numCostumes > 0) { - continue; + int32_t index = UtilRand() % numCostumes; + result = costumeList[index]; } + return result; + } - auto distance = std::abs(footpathCoords.x - peep->x) + std::abs(footpathCoords.y - peep->y); - if (distance < closestPeepDistance) + static constexpr StaffNamingConvention GetStaffNamingConvention(StaffType type) + { + switch (type) { - closestPeepDistance = distance; - closestPeep = peep; + default: + case StaffType::Handyman: + return { STR_HANDYMAN_PLURAL, STR_HANDYMAN_SINGULAR, STR_HIRE_HANDYMAN }; + case StaffType::Mechanic: + return { STR_MECHANIC_PLURAL, STR_MECHANIC_SINGULAR, STR_HIRE_MECHANIC }; + case StaffType::Security: + return { STR_SECURITY_GUARD_PLURAL, STR_SECURITY_GUARD_SINGULAR, STR_HIRE_SECURITY_GUARD }; + case StaffType::Entertainer: + return { STR_ENTERTAINER_PLURAL, STR_ENTERTAINER_SINGULAR, STR_HIRE_ENTERTAINER }; } } - return closestPeep; - } - static EntertainerCostume GetRandomEntertainerCostume() - { - auto result = EntertainerCostume::Panda; - EntertainerCostume costumeList[EnumValue(EntertainerCostume::Count)]; - int32_t numCostumes = StaffGetAvailableEntertainerCostumeList(costumeList); - if (numCostumes > 0) + static uint32_t GetStaffOrderBaseSprite(StaffType type) { - int32_t index = UtilRand() % numCostumes; - result = costumeList[index]; + switch (type) + { + case StaffType::Handyman: + return SPR_STAFF_ORDERS_SWEEPING; + case StaffType::Mechanic: + return SPR_STAFF_ORDERS_INSPECT_RIDES; + default: + return 0; + } } - return result; + + static uint32_t GetEntertainerCostumeSprite(PeepSpriteType type) + { + switch (type) + { + default: + case PeepSpriteType::EntertainerPanda: + return SPR_STAFF_COSTUME_PANDA; + case PeepSpriteType::EntertainerTiger: + return SPR_STAFF_COSTUME_TIGER; + case PeepSpriteType::EntertainerElephant: + return SPR_STAFF_COSTUME_ELEPHANT; + case PeepSpriteType::EntertainerRoman: + return SPR_STAFF_COSTUME_ROMAN; + case PeepSpriteType::EntertainerGorilla: + return SPR_STAFF_COSTUME_GORILLA; + case PeepSpriteType::EntertainerSnowman: + return SPR_STAFF_COSTUME_SNOWMAN; + case PeepSpriteType::EntertainerKnight: + return SPR_STAFF_COSTUME_KNIGHT; + case PeepSpriteType::EntertainerAstronaut: + return SPR_STAFF_COSTUME_ASTRONAUT; + case PeepSpriteType::EntertainerBandit: + return SPR_STAFF_COSTUME_BANDIT; + case PeepSpriteType::EntertainerSheriff: + return SPR_STAFF_COSTUME_SHERIFF; + case PeepSpriteType::EntertainerPirate: + return SPR_STAFF_COSTUME_PIRATE; + } + } + }; + + WindowBase* WindowStaffListOpen() + { + return WindowFocusOrCreate(WindowClass::StaffList, WW, WH, WF_10 | WF_RESIZABLE); } - static constexpr StaffNamingConvention GetStaffNamingConvention(StaffType type) + void WindowStaffListRefresh() { - switch (type) + auto* window = WindowFindByClass(WindowClass::StaffList); + if (window != nullptr) { - default: - case StaffType::Handyman: - return { STR_HANDYMAN_PLURAL, STR_HANDYMAN_SINGULAR, STR_HIRE_HANDYMAN }; - case StaffType::Mechanic: - return { STR_MECHANIC_PLURAL, STR_MECHANIC_SINGULAR, STR_HIRE_MECHANIC }; - case StaffType::Security: - return { STR_SECURITY_GUARD_PLURAL, STR_SECURITY_GUARD_SINGULAR, STR_HIRE_SECURITY_GUARD }; - case StaffType::Entertainer: - return { STR_ENTERTAINER_PLURAL, STR_ENTERTAINER_SINGULAR, STR_HIRE_ENTERTAINER }; + static_cast(window)->RefreshList(); } } - - static uint32_t GetStaffOrderBaseSprite(StaffType type) - { - switch (type) - { - case StaffType::Handyman: - return SPR_STAFF_ORDERS_SWEEPING; - case StaffType::Mechanic: - return SPR_STAFF_ORDERS_INSPECT_RIDES; - default: - return 0; - } - } - - static uint32_t GetEntertainerCostumeSprite(PeepSpriteType type) - { - switch (type) - { - default: - case PeepSpriteType::EntertainerPanda: - return SPR_STAFF_COSTUME_PANDA; - case PeepSpriteType::EntertainerTiger: - return SPR_STAFF_COSTUME_TIGER; - case PeepSpriteType::EntertainerElephant: - return SPR_STAFF_COSTUME_ELEPHANT; - case PeepSpriteType::EntertainerRoman: - return SPR_STAFF_COSTUME_ROMAN; - case PeepSpriteType::EntertainerGorilla: - return SPR_STAFF_COSTUME_GORILLA; - case PeepSpriteType::EntertainerSnowman: - return SPR_STAFF_COSTUME_SNOWMAN; - case PeepSpriteType::EntertainerKnight: - return SPR_STAFF_COSTUME_KNIGHT; - case PeepSpriteType::EntertainerAstronaut: - return SPR_STAFF_COSTUME_ASTRONAUT; - case PeepSpriteType::EntertainerBandit: - return SPR_STAFF_COSTUME_BANDIT; - case PeepSpriteType::EntertainerSheriff: - return SPR_STAFF_COSTUME_SHERIFF; - case PeepSpriteType::EntertainerPirate: - return SPR_STAFF_COSTUME_PIRATE; - } - } -}; - -WindowBase* WindowStaffListOpen() -{ - return WindowFocusOrCreate(WindowClass::StaffList, WW, WH, WF_10 | WF_RESIZABLE); -} - -void WindowStaffListRefresh() -{ - auto* window = WindowFindByClass(WindowClass::StaffList); - if (window != nullptr) - { - static_cast(window)->RefreshList(); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index dda0e23ce7..0b1fb7a13b 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -21,407 +21,411 @@ #include #include -static constexpr int32_t WW = 250; -static constexpr int32_t WH = 90; - -enum WindowTextInputWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_CANCEL, - WIDX_OKAY -}; + static constexpr int32_t WW = 250; + static constexpr int32_t WH = 90; -static Widget _textInputWidgets[] = { - WINDOW_SHIM(STR_NONE, WW, WH), - MakeWidget({ 170, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_CANCEL), - MakeWidget({ 10, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_OK), - kWidgetsEnd, -}; - -class TextInputWindow final : public Window -{ -private: - WidgetIdentifier _parentWidget{}; - - std::string _title; - StringId _titleStringId = STR_NONE; - - std::string _description; - StringId _descriptionStringId = STR_NONE; - Formatter _descriptionArgs; - - std::function _callback; - std::function _cancelCallback; - - int32_t _cursorBlink{}; - size_t _maxInputLength{}; - u8string _buffer; - -public: - void OnOpen() override + enum WindowTextInputWidgetIdx { - widgets = _textInputWidgets; - WindowInitScrollWidgets(*this); - SetParentWindow(nullptr, 0); - } + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_CANCEL, + WIDX_OKAY + }; - void SetParentWindow(WindowBase* parentWindow, WidgetIndex widgetIndex) + static Widget _textInputWidgets[] = { + WINDOW_SHIM(STR_NONE, WW, WH), + MakeWidget({ 170, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_CANCEL), + MakeWidget({ 10, 68 }, { 71, 14 }, WindowWidgetType::Button, WindowColour::Secondary, STR_OK), + kWidgetsEnd, + }; + + class TextInputWindow final : public Window { - // Save calling window details so that the information can be passed back to the correct window & widget - if (parentWindow == nullptr) + private: + WidgetIdentifier _parentWidget{}; + + std::string _title; + StringId _titleStringId = STR_NONE; + + std::string _description; + StringId _descriptionStringId = STR_NONE; + Formatter _descriptionArgs; + + std::function _callback; + std::function _cancelCallback; + + int32_t _cursorBlink{}; + size_t _maxInputLength{}; + u8string _buffer; + + public: + void OnOpen() override { - _parentWidget.window.classification = WindowClass::Null; - _parentWidget.window.number = 0; - _parentWidget.widget_index = 0; - - colours[0] = COLOUR_GREY; - colours[1] = COLOUR_GREY; - colours[2] = COLOUR_GREY; + widgets = _textInputWidgets; + WindowInitScrollWidgets(*this); + SetParentWindow(nullptr, 0); } - else + + void SetParentWindow(WindowBase* parentWindow, WidgetIndex widgetIndex) { - _parentWidget.window.classification = parentWindow->classification; - _parentWidget.window.number = parentWindow->number; - _parentWidget.widget_index = widgetIndex; - - colours[0] = parentWindow->colours[1]; - colours[1] = parentWindow->colours[1]; - colours[2] = parentWindow->colours[1]; - } - } - - void SetTitle(StringId title, StringId description, const Formatter& decriptionArgs) - { - _titleStringId = title; - _descriptionStringId = description; - _descriptionArgs = decriptionArgs; - } - - void SetTitle(std::string_view title, std::string_view description) - { - _titleStringId = STR_NONE; - _title = title; - _descriptionStringId = STR_NONE; - _description = description; - } - - void SetText(std::string_view text, size_t maxLength) - { - text = String::UTF8TruncateCodePoints(text, maxLength); - _buffer = u8string{ text }; - _maxInputLength = maxLength; - gTextInput = ContextStartTextInput(_buffer, maxLength); - } - - void SetCallback(std::function callback, std::function cancelCallback) - { - _callback = callback; - _cancelCallback = cancelCallback; - } - - void OnClose() override - { - // Make sure that we take it out of the text input - // mode otherwise problems may occur. - ContextStopTextInput(); - } - - void OnUpdate() override - { - if (HasParentWindow()) - { - // If the calling window is closed then close the text input window - auto parentWindow = GetParentWindow(); + // Save calling window details so that the information can be passed back to the correct window & widget if (parentWindow == nullptr) { - WindowClose(*this); - return; + _parentWidget.window.classification = WindowClass::Null; + _parentWidget.window.number = 0; + _parentWidget.widget_index = 0; + + colours[0] = COLOUR_GREY; + colours[1] = COLOUR_GREY; + colours[2] = COLOUR_GREY; + } + else + { + _parentWidget.window.classification = parentWindow->classification; + _parentWidget.window.number = parentWindow->number; + _parentWidget.widget_index = widgetIndex; + + colours[0] = parentWindow->colours[1]; + colours[1] = parentWindow->colours[1]; + colours[2] = parentWindow->colours[1]; } } - // Used to blink the cursor. - _cursorBlink++; - if (_cursorBlink > 30) - _cursorBlink = 0; - - Invalidate(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void SetTitle(StringId title, StringId description, const Formatter& decriptionArgs) { - case WIDX_CANCEL: - case WIDX_CLOSE: - ContextStopTextInput(); - ExecuteCallback(false); - WindowClose(*this); - break; - case WIDX_OKAY: - ContextStopTextInput(); - ExecuteCallback(true); - WindowClose(*this); - } - } - - void OnPrepareDraw() override - { - // Change window size if required. - int32_t newHeight = CalculateWindowHeight(_buffer.data()); - if (newHeight != height) - { - WindowSetResize(*this, WW, newHeight, WW, newHeight); + _titleStringId = title; + _descriptionStringId = description; + _descriptionArgs = decriptionArgs; } - widgets[WIDX_OKAY].top = newHeight - 22; - widgets[WIDX_OKAY].bottom = newHeight - 9; - widgets[WIDX_CANCEL].top = newHeight - 22; - widgets[WIDX_CANCEL].bottom = newHeight - 9; - widgets[WIDX_BACKGROUND].bottom = newHeight - 1; - - // Set window title argument - if (_titleStringId == STR_NONE) + void SetTitle(std::string_view title, std::string_view description) { - auto ft = Formatter::Common(); - ft.Add(_title.c_str()); - widgets[WIDX_TITLE].text = STR_STRING; - } - else - { - widgets[WIDX_TITLE].text = _titleStringId; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - - ScreenCoordsXY screenCoords; - screenCoords.y = windowPos.y + 25; - - int32_t no_lines = 0; - - if (_descriptionStringId == STR_NONE) - { - auto ft = Formatter(); - ft.Add(_description.c_str()); - DrawTextWrapped( - dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); - } - else - { - DrawTextWrapped( - dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs, - { colours[1], TextAlignment::CENTRE }); + _titleStringId = STR_NONE; + _title = title; + _descriptionStringId = STR_NONE; + _description = description; } - screenCoords.y += 25; - - // String length needs to add 12 either side of box - // +13 for cursor when max length. - u8string wrappedString; - GfxWrapString( - u8string_view{ _buffer.data(), _buffer.size() }, WW - (24 + 13), FontStyle::Medium, &wrappedString, &no_lines); - - GfxFillRectInset( - dpi, { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } }, - colours[1], INSET_RECT_F_60); - - screenCoords.y += 1; - - const utf8* wrapPointer = wrappedString.data(); - size_t char_count = 0; - uint8_t cur_drawn = 0; - - int32_t cursorX = 0; - int32_t cursorY = 0; - for (int32_t line = 0; line <= no_lines; line++) + void SetText(std::string_view text, size_t maxLength) { - screenCoords.x = windowPos.x + 12; - DrawText(dpi, screenCoords, { colours[1], FontStyle::Medium, TextAlignment::LEFT }, wrapPointer, true); + text = String::UTF8TruncateCodePoints(text, maxLength); + _buffer = u8string{ text }; + _maxInputLength = maxLength; + gTextInput = ContextStartTextInput(_buffer, maxLength); + } - size_t string_length = GetStringSize(wrapPointer) - 1; + void SetCallback(std::function callback, std::function cancelCallback) + { + _callback = callback; + _cancelCallback = cancelCallback; + } - if (!cur_drawn && (gTextInput->SelectionStart <= char_count + string_length)) + void OnClose() override + { + // Make sure that we take it out of the text input + // mode otherwise problems may occur. + ContextStopTextInput(); + } + + void OnUpdate() override + { + if (HasParentWindow()) { - // Make a view of the string for measuring the width. - cursorX = windowPos.x + 13 - + GfxGetStringWidthNoFormatting( - u8string_view{ wrapPointer, gTextInput->SelectionStart - char_count }, FontStyle::Medium); - cursorY = screenCoords.y; - - int32_t textWidth = 6; - if (gTextInput->SelectionStart < strlen(_buffer.data())) + // If the calling window is closed then close the text input window + auto parentWindow = GetParentWindow(); + if (parentWindow == nullptr) { - // Make a 1 utf8-character wide string for measuring the width - // of the currently selected character. - utf8 tmp[5] = {}; // This is easier than setting temp_string[0..5] - uint32_t codepoint = UTF8GetNext(_buffer.data() + gTextInput->SelectionStart, nullptr); - UTF8WriteCodepoint(tmp, codepoint); - textWidth = std::max(GfxGetStringWidthNoFormatting(tmp, FontStyle::Medium) - 2, 4); - } - - if (_cursorBlink > 15) - { - uint8_t colour = ColourMapA[colours[1]].mid_light; - // TODO: palette index addition - GfxFillRect( - dpi, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5); - } - - cur_drawn++; - } - - wrapPointer += string_length + 1; - - if (_buffer[char_count + string_length] == ' ') - char_count++; - char_count += string_length; - - screenCoords.y += 10; - } - - if (!cur_drawn) - { - cursorX = dpi.lastStringPos.x; - cursorY = screenCoords.y - 10; - } - - // IME composition - if (!String::IsNullOrEmpty(gTextInput->ImeBuffer)) - { - IMEComposition(cursorX, cursorY); - } - } - - void OnReturnPressed() - { - ContextStopTextInput(); - ExecuteCallback(true); - WindowClose(*this); - } - - static int32_t CalculateWindowHeight(std::string_view text) - { - // String length needs to add 12 either side of box +13 for cursor when max length. - int32_t numLines{}; - GfxWrapString(text, WW - (24 + 13), FontStyle::Medium, nullptr, &numLines); - return numLines * 10 + WH; - } - - void OnResize() override - { - ResizeFrame(); - } - -private: - static void IMEComposition(int32_t cursorX, int32_t cursorY) - { - SDL_Rect rect = { cursorX, cursorY, 100, 100 }; - SDL_SetTextInputRect(&rect); - } - - void ExecuteCallback(bool hasValue) - { - if (HasParentWindow()) - { - if (hasValue) - { - auto w = GetParentWindow(); - if (w != nullptr) - { - w->OnTextInput(_parentWidget.widget_index, _buffer); + WindowClose(*this); + return; } } + + // Used to blink the cursor. + _cursorBlink++; + if (_cursorBlink > 30) + _cursorBlink = 0; + + Invalidate(); } - else + + void OnMouseUp(WidgetIndex widgetIndex) override { - if (hasValue) + switch (widgetIndex) { - if (_callback) + case WIDX_CANCEL: + case WIDX_CLOSE: + ContextStopTextInput(); + ExecuteCallback(false); + WindowClose(*this); + break; + case WIDX_OKAY: + ContextStopTextInput(); + ExecuteCallback(true); + WindowClose(*this); + } + } + + void OnPrepareDraw() override + { + // Change window size if required. + int32_t newHeight = CalculateWindowHeight(_buffer.data()); + if (newHeight != height) + { + WindowSetResize(*this, WW, newHeight, WW, newHeight); + } + + widgets[WIDX_OKAY].top = newHeight - 22; + widgets[WIDX_OKAY].bottom = newHeight - 9; + widgets[WIDX_CANCEL].top = newHeight - 22; + widgets[WIDX_CANCEL].bottom = newHeight - 9; + widgets[WIDX_BACKGROUND].bottom = newHeight - 1; + + // Set window title argument + if (_titleStringId == STR_NONE) + { + auto ft = Formatter::Common(); + ft.Add(_title.c_str()); + widgets[WIDX_TITLE].text = STR_STRING; + } + else + { + widgets[WIDX_TITLE].text = _titleStringId; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + ScreenCoordsXY screenCoords; + screenCoords.y = windowPos.y + 25; + + int32_t no_lines = 0; + + if (_descriptionStringId == STR_NONE) + { + auto ft = Formatter(); + ft.Add(_description.c_str()); + DrawTextWrapped( + dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, STR_STRING, ft, { colours[1], TextAlignment::CENTRE }); + } + else + { + DrawTextWrapped( + dpi, { windowPos.x + WW / 2, screenCoords.y }, WW, _descriptionStringId, _descriptionArgs, + { colours[1], TextAlignment::CENTRE }); + } + + screenCoords.y += 25; + + // String length needs to add 12 either side of box + // +13 for cursor when max length. + u8string wrappedString; + GfxWrapString( + u8string_view{ _buffer.data(), _buffer.size() }, WW - (24 + 13), FontStyle::Medium, &wrappedString, &no_lines); + + GfxFillRectInset( + dpi, + { { windowPos.x + 10, screenCoords.y }, { windowPos.x + WW - 10, screenCoords.y + 10 * (no_lines + 1) + 3 } }, + colours[1], INSET_RECT_F_60); + + screenCoords.y += 1; + + const utf8* wrapPointer = wrappedString.data(); + size_t char_count = 0; + uint8_t cur_drawn = 0; + + int32_t cursorX = 0; + int32_t cursorY = 0; + for (int32_t line = 0; line <= no_lines; line++) + { + screenCoords.x = windowPos.x + 12; + DrawText(dpi, screenCoords, { colours[1], FontStyle::Medium, TextAlignment::LEFT }, wrapPointer, true); + + size_t string_length = GetStringSize(wrapPointer) - 1; + + if (!cur_drawn && (gTextInput->SelectionStart <= char_count + string_length)) { - _callback(_buffer.data()); + // Make a view of the string for measuring the width. + cursorX = windowPos.x + 13 + + GfxGetStringWidthNoFormatting( + u8string_view{ wrapPointer, gTextInput->SelectionStart - char_count }, FontStyle::Medium); + cursorY = screenCoords.y; + + int32_t textWidth = 6; + if (gTextInput->SelectionStart < strlen(_buffer.data())) + { + // Make a 1 utf8-character wide string for measuring the width + // of the currently selected character. + utf8 tmp[5] = {}; // This is easier than setting temp_string[0..5] + uint32_t codepoint = UTF8GetNext(_buffer.data() + gTextInput->SelectionStart, nullptr); + UTF8WriteCodepoint(tmp, codepoint); + textWidth = std::max(GfxGetStringWidthNoFormatting(tmp, FontStyle::Medium) - 2, 4); + } + + if (_cursorBlink > 15) + { + uint8_t colour = ColourMapA[colours[1]].mid_light; + // TODO: palette index addition + GfxFillRect( + dpi, { { cursorX, screenCoords.y + 9 }, { cursorX + textWidth, screenCoords.y + 9 } }, colour + 5); + } + + cur_drawn++; + } + + wrapPointer += string_length + 1; + + if (_buffer[char_count + string_length] == ' ') + char_count++; + char_count += string_length; + + screenCoords.y += 10; + } + + if (!cur_drawn) + { + cursorX = dpi.lastStringPos.x; + cursorY = screenCoords.y - 10; + } + + // IME composition + if (!String::IsNullOrEmpty(gTextInput->ImeBuffer)) + { + IMEComposition(cursorX, cursorY); + } + } + + void OnReturnPressed() + { + ContextStopTextInput(); + ExecuteCallback(true); + WindowClose(*this); + } + + static int32_t CalculateWindowHeight(std::string_view text) + { + // String length needs to add 12 either side of box +13 for cursor when max length. + int32_t numLines{}; + GfxWrapString(text, WW - (24 + 13), FontStyle::Medium, nullptr, &numLines); + return numLines * 10 + WH; + } + + void OnResize() override + { + ResizeFrame(); + } + + private: + static void IMEComposition(int32_t cursorX, int32_t cursorY) + { + SDL_Rect rect = { cursorX, cursorY, 100, 100 }; + SDL_SetTextInputRect(&rect); + } + + void ExecuteCallback(bool hasValue) + { + if (HasParentWindow()) + { + if (hasValue) + { + auto w = GetParentWindow(); + if (w != nullptr) + { + w->OnTextInput(_parentWidget.widget_index, _buffer); + } } } else { - if (_cancelCallback) + if (hasValue) { - _cancelCallback(); + if (_callback) + { + _callback(_buffer.data()); + } + } + else + { + if (_cancelCallback) + { + _cancelCallback(); + } } } } - } - bool HasParentWindow() const - { - return _parentWidget.window.classification != WindowClass::Null; - } - - WindowBase* GetParentWindow() const - { - return HasParentWindow() ? WindowFindByNumber(_parentWidget.window.classification, _parentWidget.window.number) - : nullptr; - } -}; - -void WindowTextInputRawOpen( - WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, - const_utf8string existing_text, int32_t maxLength) -{ - WindowCloseByClass(WindowClass::Textinput); - - auto height = TextInputWindow::CalculateWindowHeight(existing_text); - auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); - if (w != nullptr) - { - w->SetParentWindow(call_w, call_widget); - w->SetTitle(title, description, descriptionArgs); - w->SetText(existing_text, maxLength); - } -} - -void WindowTextInputOpen( - std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, - std::function callback, std::function cancelCallback) -{ - auto height = TextInputWindow::CalculateWindowHeight(initialValue); - auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); - if (w != nullptr) - { - w->SetTitle(title, description); - w->SetText(initialValue, maxLength); - w->SetCallback(callback, cancelCallback); - } -} - -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) -{ - auto existingText = FormatStringID(existing_text, &existing_args); - WindowTextInputRawOpen(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength); -} - -void WindowTextInputKey(WindowBase* w, uint32_t keycode) -{ - const auto wndNumber = w->number; - const auto wndClass = w->classification; - - // If the return button is pressed stop text input - if (keycode == SDLK_RETURN || keycode == SDLK_KP_ENTER) - { - if (w->classification == WindowClass::Textinput) + bool HasParentWindow() const { - auto textInputWindow = static_cast(w); - textInputWindow->OnReturnPressed(); + return _parentWidget.window.classification != WindowClass::Null; + } + + WindowBase* GetParentWindow() const + { + return HasParentWindow() ? WindowFindByNumber(_parentWidget.window.classification, _parentWidget.window.number) + : nullptr; + } + }; + + void WindowTextInputRawOpen( + WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, + const_utf8string existing_text, int32_t maxLength) + { + WindowCloseByClass(WindowClass::Textinput); + + auto height = TextInputWindow::CalculateWindowHeight(existing_text); + auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + if (w != nullptr) + { + w->SetParentWindow(call_w, call_widget); + w->SetTitle(title, description, descriptionArgs); + w->SetText(existing_text, maxLength); } } - // The window can be potentially closed within a callback, we need to check if its still alive. - w = WindowFindByNumber(wndClass, wndNumber); - if (w != nullptr) - w->Invalidate(); -} + void WindowTextInputOpen( + std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, + std::function callback, std::function cancelCallback) + { + auto height = TextInputWindow::CalculateWindowHeight(initialValue); + auto w = WindowCreate(WindowClass::Textinput, WW, height, WF_CENTRE_SCREEN | WF_STICK_TO_FRONT); + if (w != nullptr) + { + w->SetTitle(title, description); + w->SetText(initialValue, maxLength); + w->SetCallback(callback, cancelCallback); + } + } + + 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) + { + auto existingText = FormatStringID(existing_text, &existing_args); + WindowTextInputRawOpen(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength); + } + + void WindowTextInputKey(WindowBase* w, uint32_t keycode) + { + const auto wndNumber = w->number; + const auto wndClass = w->classification; + + // If the return button is pressed stop text input + if (keycode == SDLK_RETURN || keycode == SDLK_KP_ENTER) + { + if (w->classification == WindowClass::Textinput) + { + auto textInputWindow = static_cast(w); + textInputWindow->OnReturnPressed(); + } + } + + // The window can be potentially closed within a callback, we need to check if its still alive. + w = WindowFindByNumber(wndClass, wndNumber); + if (w != nullptr) + w->Invalidate(); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 32d727632d..9356636964 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -22,55 +22,57 @@ #include #include -enum +namespace OpenRCT2::Ui::Windows { - WINDOW_THEMES_TAB_SETTINGS, - WINDOW_THEMES_TAB_MAIN_UI, - WINDOW_THEMES_TAB_PARK, - WINDOW_THEMES_TAB_TOOLS, - WINDOW_THEMES_TAB_RIDES_PEEPS, - WINDOW_THEMES_TAB_EDITORS, - WINDOW_THEMES_TAB_MISC, - WINDOW_THEMES_TAB_PROMPTS, - WINDOW_THEMES_TAB_FEATURES, - WINDOW_THEMES_TAB_COUNT -}; + enum + { + WINDOW_THEMES_TAB_SETTINGS, + WINDOW_THEMES_TAB_MAIN_UI, + WINDOW_THEMES_TAB_PARK, + WINDOW_THEMES_TAB_TOOLS, + WINDOW_THEMES_TAB_RIDES_PEEPS, + WINDOW_THEMES_TAB_EDITORS, + WINDOW_THEMES_TAB_MISC, + WINDOW_THEMES_TAB_PROMPTS, + WINDOW_THEMES_TAB_FEATURES, + WINDOW_THEMES_TAB_COUNT + }; -enum WindowThemesWidgetIdx -{ - WIDX_THEMES_BACKGROUND, - WIDX_THEMES_TITLE, - WIDX_THEMES_CLOSE, - WIDX_THEMES_TAB_CONTENT_PANEL, - WIDX_THEMES_SETTINGS_TAB, - WIDX_THEMES_MAIN_UI_TAB, - WIDX_THEMES_PARK_TAB, - WIDX_THEMES_TOOLS_TAB, - WIDX_THEMES_RIDE_PEEPS_TAB, - WIDX_THEMES_EDITORS_TAB, - WIDX_THEMES_MISC_TAB, - WIDX_THEMES_PROMPTS_TAB, - WIDX_THEMES_FEATURES_TAB, - WIDX_THEMES_HEADER_WINDOW, - WIDX_THEMES_HEADER_PALETTE, - WIDX_THEMES_PRESETS, - WIDX_THEMES_PRESETS_DROPDOWN, - WIDX_THEMES_DUPLICATE_BUTTON, - WIDX_THEMES_DELETE_BUTTON, - WIDX_THEMES_RENAME_BUTTON, - WIDX_THEMES_COLOURBTN_MASK, - WIDX_THEMES_LIST, - WIDX_THEMES_RCT1_RIDE_LIGHTS, - WIDX_THEMES_RCT1_PARK_LIGHTS, - WIDX_THEMES_RCT1_SCENARIO_FONT, - WIDX_THEMES_RCT1_BOTTOM_TOOLBAR -}; + enum WindowThemesWidgetIdx + { + WIDX_THEMES_BACKGROUND, + WIDX_THEMES_TITLE, + WIDX_THEMES_CLOSE, + WIDX_THEMES_TAB_CONTENT_PANEL, + WIDX_THEMES_SETTINGS_TAB, + WIDX_THEMES_MAIN_UI_TAB, + WIDX_THEMES_PARK_TAB, + WIDX_THEMES_TOOLS_TAB, + WIDX_THEMES_RIDE_PEEPS_TAB, + WIDX_THEMES_EDITORS_TAB, + WIDX_THEMES_MISC_TAB, + WIDX_THEMES_PROMPTS_TAB, + WIDX_THEMES_FEATURES_TAB, + WIDX_THEMES_HEADER_WINDOW, + WIDX_THEMES_HEADER_PALETTE, + WIDX_THEMES_PRESETS, + WIDX_THEMES_PRESETS_DROPDOWN, + WIDX_THEMES_DUPLICATE_BUTTON, + WIDX_THEMES_DELETE_BUTTON, + WIDX_THEMES_RENAME_BUTTON, + WIDX_THEMES_COLOURBTN_MASK, + WIDX_THEMES_LIST, + WIDX_THEMES_RCT1_RIDE_LIGHTS, + WIDX_THEMES_RCT1_PARK_LIGHTS, + WIDX_THEMES_RCT1_SCENARIO_FONT, + WIDX_THEMES_RCT1_BOTTOM_TOOLBAR + }; -static constexpr StringId WINDOW_TITLE = STR_THEMES_TITLE; -static constexpr int32_t WW = 320; -static constexpr int32_t WH = 107; + static constexpr StringId WINDOW_TITLE = STR_THEMES_TITLE; + static constexpr int32_t WW = 320; + static constexpr int32_t WH = 107; -// clang-format off + // clang-format off static Widget _themesWidgets[] = { WINDOW_SHIM(WINDOW_TITLE, WW, WH), MakeWidget({ 0, 43}, {320, 64}, WindowWidgetType::Resize, WindowColour::Secondary ), // tab content panel @@ -219,665 +221,669 @@ static WindowClass window_themes_tab_7_classes[] = { WindowClass::LoadsaveOverwritePrompt, WindowClass::NetworkStatus, }; -// clang-format on + // clang-format on -static WindowClass* window_themes_tab_classes[] = { - nullptr, - window_themes_tab_1_classes, - window_themes_tab_2_classes, - window_themes_tab_3_classes, - window_themes_tab_4_classes, - window_themes_tab_5_classes, - window_themes_tab_6_classes, - window_themes_tab_7_classes, -}; + static WindowClass* window_themes_tab_classes[] = { + nullptr, + window_themes_tab_1_classes, + window_themes_tab_2_classes, + window_themes_tab_3_classes, + window_themes_tab_4_classes, + window_themes_tab_5_classes, + window_themes_tab_6_classes, + window_themes_tab_7_classes, + }; #pragma endregion -class ThemesWindow final : public Window -{ -private: - uint8_t _selected_tab = 0; - int16_t _colour_index_1 = -1; - int8_t _colour_index_2 = -1; - const uint8_t _row_height = 32; - const uint8_t _button_offset_x = 220; - const uint8_t _button_offset_y = 3; - const uint8_t _check_offset_y = 3 + 12 + 2; + class ThemesWindow final : public Window + { + private: + uint8_t _selected_tab = 0; + int16_t _colour_index_1 = -1; + int8_t _colour_index_2 = -1; + const uint8_t _row_height = 32; + const uint8_t _button_offset_x = 220; + const uint8_t _button_offset_y = 3; + const uint8_t _check_offset_y = 3 + 12 + 2; -public: + public: #pragma region Window Override Events - void OnOpen() override - { - widgets = _themesWidgets; - - WindowThemesInitVars(); - - WindowInitScrollWidgets(*this); - list_information_type = 0; - _colour_index_1 = -1; - _colour_index_2 = -1; - min_width = 320; - min_height = 107; - max_width = 320; - max_height = 107; - } - - void OnResize() override - { - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + void OnOpen() override { + widgets = _themesWidgets; + + WindowThemesInitVars(); + + WindowInitScrollWidgets(*this); + list_information_type = 0; + _colour_index_1 = -1; + _colour_index_2 = -1; min_width = 320; min_height = 107; max_width = 320; max_height = 107; - - if (width < min_width) - { - width = min_width; - GfxInvalidateScreen(); - } - if (height < min_height) - { - height = min_height; - GfxInvalidateScreen(); - } - if (width > max_width) - { - width = max_width; - GfxInvalidateScreen(); - } - if (height > max_height) - { - height = max_height; - GfxInvalidateScreen(); - } - } - else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) - { - min_width = 320; - min_height = 122; - max_width = 320; - max_height = 122; - - if (width < min_width) - { - width = min_width; - GfxInvalidateScreen(); - } - if (height < min_height) - { - height = min_height; - GfxInvalidateScreen(); - } - if (width > max_width) - { - width = max_width; - GfxInvalidateScreen(); - } - if (height > max_height) - { - height = max_height; - GfxInvalidateScreen(); - } - } - else - { - min_width = 320; - min_height = 270; - max_width = 320; - max_height = 450; - - if (width < min_width) - { - width = min_width; - Invalidate(); - } - if (height < min_height) - { - height = min_height; - Invalidate(); - } - if (width > max_width) - { - width = max_width; - Invalidate(); - } - if (height > max_height) - { - height = max_height; - Invalidate(); - } } - ResizeFrameWithPage(); - } - - void OnUpdate() override - { - frame_no++; - if (frame_no >= window_themes_tab_animation_loops[_selected_tab]) - frame_no = 0; - - WidgetInvalidate(*this, WIDX_THEMES_SETTINGS_TAB + _selected_tab); - } - - void OnPrepareDraw() override - { - int32_t pressedWidgets = pressed_widgets - & ~((1LL << WIDX_THEMES_SETTINGS_TAB) | (1LL << WIDX_THEMES_MAIN_UI_TAB) | (1LL << WIDX_THEMES_PARK_TAB) - | (1LL << WIDX_THEMES_TOOLS_TAB) | (1LL << WIDX_THEMES_RIDE_PEEPS_TAB) | (1LL << WIDX_THEMES_EDITORS_TAB) - | (1LL << WIDX_THEMES_MISC_TAB) | (1LL << WIDX_THEMES_PROMPTS_TAB) | (1LL << WIDX_THEMES_FEATURES_TAB)); - WidgetIndex widgetIndex = _selected_tab + WIDX_THEMES_SETTINGS_TAB; - - pressed_widgets = pressedWidgets | (1 << widgetIndex); - - if (WindowFindByClass(WindowClass::Dropdown) == nullptr) + void OnResize() override { - _colour_index_1 = -1; - _colour_index_2 = -1; + if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + { + min_width = 320; + min_height = 107; + max_width = 320; + max_height = 107; + + if (width < min_width) + { + width = min_width; + GfxInvalidateScreen(); + } + if (height < min_height) + { + height = min_height; + GfxInvalidateScreen(); + } + if (width > max_width) + { + width = max_width; + GfxInvalidateScreen(); + } + if (height > max_height) + { + height = max_height; + GfxInvalidateScreen(); + } + } + else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) + { + min_width = 320; + min_height = 122; + max_width = 320; + max_height = 122; + + if (width < min_width) + { + width = min_width; + GfxInvalidateScreen(); + } + if (height < min_height) + { + height = min_height; + GfxInvalidateScreen(); + } + if (width > max_width) + { + width = max_width; + GfxInvalidateScreen(); + } + if (height > max_height) + { + height = max_height; + GfxInvalidateScreen(); + } + } + else + { + min_width = 320; + min_height = 270; + max_width = 320; + max_height = 450; + + if (width < min_width) + { + width = min_width; + Invalidate(); + } + if (height < min_height) + { + height = min_height; + Invalidate(); + } + if (width > max_width) + { + width = max_width; + Invalidate(); + } + if (height > max_height) + { + height = max_height; + Invalidate(); + } + } + + ResizeFrameWithPage(); } - ResizeFrameWithPage(); - widgets[WIDX_THEMES_LIST].right = width - 4; - widgets[WIDX_THEMES_LIST].bottom = height - 0x0F; - - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + void OnUpdate() override { - widgets[WIDX_THEMES_HEADER_WINDOW].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_HEADER_PALETTE].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_LIST].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_RIDE_LIGHTS].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WindowWidgetType::Button; - widgets[WIDX_THEMES_DELETE_BUTTON].type = WindowWidgetType::Button; - widgets[WIDX_THEMES_RENAME_BUTTON].type = WindowWidgetType::Button; - widgets[WIDX_THEMES_PRESETS].type = WindowWidgetType::DropdownMenu; - widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WindowWidgetType::Button; - widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::Empty; - } - else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) - { - widgets[WIDX_THEMES_HEADER_WINDOW].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_HEADER_PALETTE].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_LIST].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_RIDE_LIGHTS].type = WindowWidgetType::Checkbox; - widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WindowWidgetType::Checkbox; - widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WindowWidgetType::Checkbox; - widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WindowWidgetType::Checkbox; - widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_DELETE_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RENAME_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_PRESETS].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::Empty; - - WidgetSetCheckboxValue(*this, WIDX_THEMES_RCT1_RIDE_LIGHTS, ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE); - WidgetSetCheckboxValue(*this, WIDX_THEMES_RCT1_PARK_LIGHTS, ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK); - WidgetSetCheckboxValue( - *this, WIDX_THEMES_RCT1_SCENARIO_FONT, ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT); - WidgetSetCheckboxValue( - *this, WIDX_THEMES_RCT1_BOTTOM_TOOLBAR, ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR); - } - else - { - widgets[WIDX_THEMES_HEADER_WINDOW].type = WindowWidgetType::TableHeader; - widgets[WIDX_THEMES_HEADER_PALETTE].type = WindowWidgetType::TableHeader; - widgets[WIDX_THEMES_LIST].type = WindowWidgetType::Scroll; - widgets[WIDX_THEMES_RCT1_RIDE_LIGHTS].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_DELETE_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_RENAME_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_PRESETS].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WindowWidgetType::Empty; - widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::Empty; - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - // Widgets - WindowDrawWidgets(*this, dpi); - WindowThemesDrawTabImages(dpi); - - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) - { - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 10, widgets[WIDX_THEMES_PRESETS].top + 1 }, STR_THEMES_LABEL_CURRENT_THEME, {}, - { colours[1] }); - - size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); - const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); - auto ft = Formatter(); - ft.Add(activeThemeName); - - auto screenPos = windowPos - + ScreenCoordsXY{ widgets[WIDX_THEMES_PRESETS].left + 1, widgets[WIDX_THEMES_PRESETS].top }; - auto newWidth = windowPos.x + widgets[WIDX_THEMES_PRESETS_DROPDOWN].left - widgets[WIDX_THEMES_PRESETS].left - 4; - - DrawTextEllipsised(dpi, screenPos, newWidth, STR_STRING, ft, { colours[1] }); - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - int16_t newSelectedTab; - int32_t num_items; - auto widget = &widgets[widgetIndex]; - - switch (widgetIndex) - { - case WIDX_THEMES_SETTINGS_TAB: - case WIDX_THEMES_MAIN_UI_TAB: - case WIDX_THEMES_PARK_TAB: - case WIDX_THEMES_TOOLS_TAB: - case WIDX_THEMES_RIDE_PEEPS_TAB: - case WIDX_THEMES_EDITORS_TAB: - case WIDX_THEMES_MISC_TAB: - case WIDX_THEMES_PROMPTS_TAB: - case WIDX_THEMES_FEATURES_TAB: - newSelectedTab = widgetIndex - WIDX_THEMES_SETTINGS_TAB; - if (_selected_tab == newSelectedTab) - break; - _selected_tab = static_cast(newSelectedTab); - scrolls[0].v_top = 0; + frame_no++; + if (frame_no >= window_themes_tab_animation_loops[_selected_tab]) frame_no = 0; - OnResize(); - Invalidate(); - break; - case WIDX_THEMES_PRESETS_DROPDOWN: - ThemeManagerLoadAvailableThemes(); - num_items = static_cast(ThemeManagerGetNumAvailableThemes()); - widget--; - for (int32_t i = 0; i < num_items; i++) - { - gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; - gDropdownItems[i].Args = reinterpret_cast(ThemeManagerGetAvailableThemeName(i)); - } - - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, num_items, widget->width() - 3); - - Dropdown::SetChecked(static_cast(ThemeManagerGetAvailableThemeIndex()), true); - break; - case WIDX_THEMES_RCT1_RIDE_LIGHTS: - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); - } - else - { - ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_LIGHTS_RIDE); - ThemeSave(); - WindowInvalidateAll(); - } - break; - case WIDX_THEMES_RCT1_PARK_LIGHTS: - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); - } - else - { - ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_LIGHTS_PARK)); - ThemeSave(); - WindowInvalidateAll(); - } - break; - case WIDX_THEMES_RCT1_SCENARIO_FONT: - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); - } - else - { - ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)); - ThemeSave(); - WindowInvalidateAll(); - } - break; - case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR: - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); - } - else - { - ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)); - ThemeSave(); - WindowInvalidateAll(); - } + WidgetInvalidate(*this, WIDX_THEMES_SETTINGS_TAB + _selected_tab); } - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - size_t activeAvailableThemeIndex; - const utf8* activeThemeName; - - switch (widgetIndex) + void OnPrepareDraw() override { - case WIDX_THEMES_CLOSE: - Close(); - break; - case WIDX_THEMES_DUPLICATE_BUTTON:; - activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); - activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); - WindowTextInputOpen( - this, widgetIndex, STR_THEMES_ACTION_DUPLICATE, STR_THEMES_PROMPT_ENTER_THEME_NAME, {}, STR_STRING, - reinterpret_cast(activeThemeName), 64); - break; - case WIDX_THEMES_DELETE_BUTTON: - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); - } - else - { - ThemeDelete(); - } - break; - case WIDX_THEMES_RENAME_BUTTON: - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); - } - else - { + int32_t pressedWidgets = pressed_widgets + & ~((1LL << WIDX_THEMES_SETTINGS_TAB) | (1LL << WIDX_THEMES_MAIN_UI_TAB) | (1LL << WIDX_THEMES_PARK_TAB) + | (1LL << WIDX_THEMES_TOOLS_TAB) | (1LL << WIDX_THEMES_RIDE_PEEPS_TAB) | (1LL << WIDX_THEMES_EDITORS_TAB) + | (1LL << WIDX_THEMES_MISC_TAB) | (1LL << WIDX_THEMES_PROMPTS_TAB) | (1LL << WIDX_THEMES_FEATURES_TAB)); + WidgetIndex widgetIndex = _selected_tab + WIDX_THEMES_SETTINGS_TAB; + + pressed_widgets = pressedWidgets | (1 << widgetIndex); + + if (WindowFindByClass(WindowClass::Dropdown) == nullptr) + { + _colour_index_1 = -1; + _colour_index_2 = -1; + } + + ResizeFrameWithPage(); + widgets[WIDX_THEMES_LIST].right = width - 4; + widgets[WIDX_THEMES_LIST].bottom = height - 0x0F; + + if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + { + widgets[WIDX_THEMES_HEADER_WINDOW].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_HEADER_PALETTE].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_LIST].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_RIDE_LIGHTS].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WindowWidgetType::Button; + widgets[WIDX_THEMES_DELETE_BUTTON].type = WindowWidgetType::Button; + widgets[WIDX_THEMES_RENAME_BUTTON].type = WindowWidgetType::Button; + widgets[WIDX_THEMES_PRESETS].type = WindowWidgetType::DropdownMenu; + widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WindowWidgetType::Button; + widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::Empty; + } + else if (_selected_tab == WINDOW_THEMES_TAB_FEATURES) + { + widgets[WIDX_THEMES_HEADER_WINDOW].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_HEADER_PALETTE].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_LIST].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_RIDE_LIGHTS].type = WindowWidgetType::Checkbox; + widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WindowWidgetType::Checkbox; + widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WindowWidgetType::Checkbox; + widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WindowWidgetType::Checkbox; + widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_DELETE_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RENAME_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_PRESETS].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::Empty; + + WidgetSetCheckboxValue(*this, WIDX_THEMES_RCT1_RIDE_LIGHTS, ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE); + WidgetSetCheckboxValue(*this, WIDX_THEMES_RCT1_PARK_LIGHTS, ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK); + WidgetSetCheckboxValue( + *this, WIDX_THEMES_RCT1_SCENARIO_FONT, ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT); + WidgetSetCheckboxValue( + *this, WIDX_THEMES_RCT1_BOTTOM_TOOLBAR, ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR); + } + else + { + widgets[WIDX_THEMES_HEADER_WINDOW].type = WindowWidgetType::TableHeader; + widgets[WIDX_THEMES_HEADER_PALETTE].type = WindowWidgetType::TableHeader; + widgets[WIDX_THEMES_LIST].type = WindowWidgetType::Scroll; + widgets[WIDX_THEMES_RCT1_RIDE_LIGHTS].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_PARK_LIGHTS].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_SCENARIO_FONT].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RCT1_BOTTOM_TOOLBAR].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_DUPLICATE_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_DELETE_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_RENAME_BUTTON].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_PRESETS].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WindowWidgetType::Empty; + widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::Empty; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + // Widgets + WindowDrawWidgets(*this, dpi); + WindowThemesDrawTabImages(dpi); + + if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS) + { + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 10, widgets[WIDX_THEMES_PRESETS].top + 1 }, STR_THEMES_LABEL_CURRENT_THEME, + {}, { colours[1] }); + + size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); + const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); + auto ft = Formatter(); + ft.Add(activeThemeName); + + auto screenPos = windowPos + + ScreenCoordsXY{ widgets[WIDX_THEMES_PRESETS].left + 1, widgets[WIDX_THEMES_PRESETS].top }; + auto newWidth = windowPos.x + widgets[WIDX_THEMES_PRESETS_DROPDOWN].left - widgets[WIDX_THEMES_PRESETS].left + - 4; + + DrawTextEllipsised(dpi, screenPos, newWidth, STR_STRING, ft, { colours[1] }); + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + int16_t newSelectedTab; + int32_t num_items; + auto widget = &widgets[widgetIndex]; + + switch (widgetIndex) + { + case WIDX_THEMES_SETTINGS_TAB: + case WIDX_THEMES_MAIN_UI_TAB: + case WIDX_THEMES_PARK_TAB: + case WIDX_THEMES_TOOLS_TAB: + case WIDX_THEMES_RIDE_PEEPS_TAB: + case WIDX_THEMES_EDITORS_TAB: + case WIDX_THEMES_MISC_TAB: + case WIDX_THEMES_PROMPTS_TAB: + case WIDX_THEMES_FEATURES_TAB: + newSelectedTab = widgetIndex - WIDX_THEMES_SETTINGS_TAB; + if (_selected_tab == newSelectedTab) + break; + _selected_tab = static_cast(newSelectedTab); + scrolls[0].v_top = 0; + frame_no = 0; + OnResize(); + Invalidate(); + break; + case WIDX_THEMES_PRESETS_DROPDOWN: + ThemeManagerLoadAvailableThemes(); + num_items = static_cast(ThemeManagerGetNumAvailableThemes()); + + widget--; + for (int32_t i = 0; i < num_items; i++) + { + gDropdownItems[i].Format = STR_OPTIONS_DROPDOWN_ITEM; + gDropdownItems[i].Args = reinterpret_cast(ThemeManagerGetAvailableThemeName(i)); + } + + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, num_items, widget->width() - 3); + + Dropdown::SetChecked(static_cast(ThemeManagerGetAvailableThemeIndex()), true); + break; + case WIDX_THEMES_RCT1_RIDE_LIGHTS: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + } + else + { + ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_LIGHTS_RIDE); + ThemeSave(); + WindowInvalidateAll(); + } + break; + case WIDX_THEMES_RCT1_PARK_LIGHTS: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + } + else + { + ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_LIGHTS_PARK)); + ThemeSave(); + WindowInvalidateAll(); + } + break; + case WIDX_THEMES_RCT1_SCENARIO_FONT: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + } + else + { + ThemeSetFlags( + ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)); + ThemeSave(); + WindowInvalidateAll(); + } + break; + case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + } + else + { + ThemeSetFlags(ThemeGetFlags() ^ static_cast(UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)); + ThemeSave(); + WindowInvalidateAll(); + } + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + size_t activeAvailableThemeIndex; + const utf8* activeThemeName; + + switch (widgetIndex) + { + case WIDX_THEMES_CLOSE: + Close(); + break; + case WIDX_THEMES_DUPLICATE_BUTTON:; activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); WindowTextInputOpen( - this, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_THEMES_PROMPT_ENTER_THEME_NAME, {}, STR_STRING, + this, widgetIndex, STR_THEMES_ACTION_DUPLICATE, STR_THEMES_PROMPT_ENTER_THEME_NAME, {}, STR_STRING, reinterpret_cast(activeThemeName), 64); - } - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - switch (widgetIndex) - { - case WIDX_THEMES_LIST: - if (selectedIndex != -1) - { - const auto newColour = ThemeOverrideExtendedColour(ColourDropDownIndexToColour(selectedIndex)); - WindowClass wc = GetWindowClassTabIndex(_colour_index_1); - uint8_t colour = ThemeGetColour(wc, _colour_index_2); - colour = (colour & COLOUR_FLAG_TRANSLUCENT) | newColour; - ThemeSetColour(wc, _colour_index_2, colour); - ColourSchemeUpdateAll(); - WindowInvalidateAll(); - _colour_index_1 = -1; - _colour_index_2 = -1; - } - break; - case WIDX_THEMES_PRESETS_DROPDOWN: - if (selectedIndex != -1) - { - ThemeManagerSetActiveAvailableTheme(selectedIndex); - } - break; - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - if (text.empty()) - return; - - switch (widgetIndex) - { - case WIDX_THEMES_DUPLICATE_BUTTON: - case WIDX_THEMES_RENAME_BUTTON: - if (Platform::IsFilenameValid(text)) - { - if (ThemeGetIndexForName(std::string(text).c_str()) == SIZE_MAX) + break; + case WIDX_THEMES_DELETE_BUTTON: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) { - if (widgetIndex == WIDX_THEMES_DUPLICATE_BUTTON) - { - ThemeDuplicate(std::string(text).c_str()); - } - else - { - ThemeRename(std::string(text).c_str()); - } - Invalidate(); + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); } else { - ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, STR_NONE, {}); + ThemeDelete(); } - } - else - { - ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); - } - break; - } - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) - return {}; - - int32_t scrollHeight = GetColourSchemeTabCount() * _row_height; - int32_t i = scrollHeight - widgets[WIDX_THEMES_LIST].bottom + widgets[WIDX_THEMES_LIST].top + 21; - if (i < 0) - i = 0; - if (i < scrolls[0].v_top) - { - scrolls[0].v_top = i; - Invalidate(); + break; + case WIDX_THEMES_RENAME_BUTTON: + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {}); + } + else + { + activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex(); + activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex); + WindowTextInputOpen( + this, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_THEMES_PROMPT_ENTER_THEME_NAME, {}, STR_STRING, + reinterpret_cast(activeThemeName), 64); + } + break; + } } - return { 420, scrollHeight }; - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (screenCoords.y / _row_height < GetColourSchemeTabCount()) + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override { - int32_t y2 = screenCoords.y % _row_height; - _colour_index_1 = screenCoords.y / _row_height; - _colour_index_2 = ((screenCoords.x - _button_offset_x) / 12); - - WindowClass wc = GetWindowClassTabIndex(_colour_index_1); - int32_t numColours = ThemeDescGetNumColours(wc); - if (_colour_index_2 < numColours) + switch (widgetIndex) { - if (screenCoords.x >= _button_offset_x && screenCoords.x < _button_offset_x + 12 * 6 && y2 >= _button_offset_y - && y2 < _button_offset_y + 11) - { - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + case WIDX_THEMES_LIST: + if (selectedIndex != -1) { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); - } - else - { - widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::ColourBtn; - widgets[WIDX_THEMES_COLOURBTN_MASK].left = _button_offset_x + _colour_index_2 * 12 - + widgets[WIDX_THEMES_LIST].left; - widgets[WIDX_THEMES_COLOURBTN_MASK].top = _colour_index_1 * _row_height + _button_offset_y - - scrolls[0].v_top + widgets[WIDX_THEMES_LIST].top; - widgets[WIDX_THEMES_COLOURBTN_MASK].right = widgets[WIDX_THEMES_COLOURBTN_MASK].left + 12; - widgets[WIDX_THEMES_COLOURBTN_MASK].bottom = widgets[WIDX_THEMES_COLOURBTN_MASK].top + 12; - + const auto newColour = ThemeOverrideExtendedColour(ColourDropDownIndexToColour(selectedIndex)); + WindowClass wc = GetWindowClassTabIndex(_colour_index_1); uint8_t colour = ThemeGetColour(wc, _colour_index_2); - WindowDropdownShowColour(this, &(widgets[WIDX_THEMES_COLOURBTN_MASK]), colours[1], colour); - WidgetInvalidate(*this, WIDX_THEMES_LIST); - } - } - else if ( - screenCoords.x >= _button_offset_x && screenCoords.x < _button_offset_x + 12 * 6 - 1 - && y2 >= _check_offset_y && y2 < _check_offset_y + 11) - { - if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) - { - ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); - } - else - { - uint8_t colour = ThemeGetColour(wc, _colour_index_2); - if (colour & COLOUR_FLAG_TRANSLUCENT) - { - colour &= ~COLOUR_FLAG_TRANSLUCENT; - } - else - { - colour |= COLOUR_FLAG_TRANSLUCENT; - } + colour = (colour & COLOUR_FLAG_TRANSLUCENT) | newColour; ThemeSetColour(wc, _colour_index_2, colour); ColourSchemeUpdateAll(); WindowInvalidateAll(); + _colour_index_1 = -1; + _colour_index_2 = -1; } - } + break; + case WIDX_THEMES_PRESETS_DROPDOWN: + if (selectedIndex != -1) + { + ThemeManagerSetActiveAvailableTheme(selectedIndex); + } + break; } } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - ScreenCoordsXY screenCoords; - - if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) - return; - - if ((colours[1] & 0x80) == 0) - // GfxFillRect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, - // ColourMapA[colours[1]].mid_light); - GfxClear(&dpi, ColourMapA[colours[1]].mid_light); - screenCoords.y = 0; - for (int32_t i = 0; i < GetColourSchemeTabCount(); i++) + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override { - if (screenCoords.y > dpi.y + dpi.height) - { - break; - } - if (screenCoords.y + _row_height >= dpi.y) - { - if (i + 1 < GetColourSchemeTabCount()) - { - int32_t colour = colours[1]; + if (text.empty()) + return; - auto leftTop = ScreenCoordsXY{ 0, screenCoords.y + _row_height - 2 }; - auto rightBottom = ScreenCoordsXY{ widgets[WIDX_THEMES_LIST].right, screenCoords.y + _row_height - 2 }; - auto yPixelOffset = ScreenCoordsXY{ 0, 1 }; - - if (colour & COLOUR_FLAG_TRANSLUCENT) + switch (widgetIndex) + { + case WIDX_THEMES_DUPLICATE_BUTTON: + case WIDX_THEMES_RENAME_BUTTON: + if (Platform::IsFilenameValid(text)) { - TranslucentWindowPalette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)]; - - GfxFilterRect(dpi, { leftTop, rightBottom }, windowPalette.highlight); - GfxFilterRect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow); + if (ThemeGetIndexForName(std::string(text).c_str()) == SIZE_MAX) + { + if (widgetIndex == WIDX_THEMES_DUPLICATE_BUTTON) + { + ThemeDuplicate(std::string(text).c_str()); + } + else + { + ThemeRename(std::string(text).c_str()); + } + Invalidate(); + } + else + { + ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, STR_NONE, {}); + } } else { - colour = ColourMapA[colours[1]].mid_dark; - GfxFillRect(dpi, { leftTop, rightBottom }, colour); - - colour = ColourMapA[colours[1]].lightest; - GfxFillRect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour); + ContextShowError(STR_ERROR_INVALID_CHARACTERS, STR_NONE, {}); } - } + break; + } + } - WindowClass wc = GetWindowClassTabIndex(i); + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) + return {}; + + int32_t scrollHeight = GetColourSchemeTabCount() * _row_height; + int32_t i = scrollHeight - widgets[WIDX_THEMES_LIST].bottom + widgets[WIDX_THEMES_LIST].top + 21; + if (i < 0) + i = 0; + if (i < scrolls[0].v_top) + { + scrolls[0].v_top = i; + Invalidate(); + } + + return { 420, scrollHeight }; + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (screenCoords.y / _row_height < GetColourSchemeTabCount()) + { + int32_t y2 = screenCoords.y % _row_height; + _colour_index_1 = screenCoords.y / _row_height; + _colour_index_2 = ((screenCoords.x - _button_offset_x) / 12); + + WindowClass wc = GetWindowClassTabIndex(_colour_index_1); int32_t numColours = ThemeDescGetNumColours(wc); - for (uint8_t j = 0; j < numColours; j++) + if (_colour_index_2 < numColours) { - DrawTextBasic(dpi, { 2, screenCoords.y + 4 }, ThemeDescGetName(wc), {}, { colours[1] }); - - uint8_t colour = ThemeGetColour(wc, j); - const bool isPressed = (i == _colour_index_1 && j == _colour_index_2); - auto image = ImageId( - isPressed ? SPR_PALETTE_BTN_PRESSED : SPR_PALETTE_BTN, colour & ~COLOUR_FLAG_TRANSLUCENT); - GfxDrawSprite(dpi, image, { _button_offset_x + 12 * j, screenCoords.y + _button_offset_y }); - - ScreenCoordsXY topLeft{ _button_offset_x + 12 * j, screenCoords.y + _check_offset_y }; - ScreenCoordsXY bottomRight{ _button_offset_x + 12 * j + 9, screenCoords.y + _check_offset_y + 10 }; - GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0); - if (colour & COLOUR_FLAG_TRANSLUCENT) + if (screenCoords.x >= _button_offset_x && screenCoords.x < _button_offset_x + 12 * 6 + && y2 >= _button_offset_y && y2 < _button_offset_y + 11) { - GfxDrawString( - dpi, topLeft, static_cast(CheckBoxMarkString), - { static_cast(colours[1] & 0x7F), FontStyle::Medium, TextDarkness::Dark }); + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); + } + else + { + widgets[WIDX_THEMES_COLOURBTN_MASK].type = WindowWidgetType::ColourBtn; + widgets[WIDX_THEMES_COLOURBTN_MASK].left = _button_offset_x + _colour_index_2 * 12 + + widgets[WIDX_THEMES_LIST].left; + widgets[WIDX_THEMES_COLOURBTN_MASK].top = _colour_index_1 * _row_height + _button_offset_y + - scrolls[0].v_top + widgets[WIDX_THEMES_LIST].top; + widgets[WIDX_THEMES_COLOURBTN_MASK].right = widgets[WIDX_THEMES_COLOURBTN_MASK].left + 12; + widgets[WIDX_THEMES_COLOURBTN_MASK].bottom = widgets[WIDX_THEMES_COLOURBTN_MASK].top + 12; + + uint8_t colour = ThemeGetColour(wc, _colour_index_2); + WindowDropdownShowColour(this, &(widgets[WIDX_THEMES_COLOURBTN_MASK]), colours[1], colour); + WidgetInvalidate(*this, WIDX_THEMES_LIST); + } + } + else if ( + screenCoords.x >= _button_offset_x && screenCoords.x < _button_offset_x + 12 * 6 - 1 + && y2 >= _check_offset_y && y2 < _check_offset_y + 11) + { + if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED) + { + ContextShowError(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {}); + } + else + { + uint8_t colour = ThemeGetColour(wc, _colour_index_2); + if (colour & COLOUR_FLAG_TRANSLUCENT) + { + colour &= ~COLOUR_FLAG_TRANSLUCENT; + } + else + { + colour |= COLOUR_FLAG_TRANSLUCENT; + } + ThemeSetColour(wc, _colour_index_2, colour); + ColourSchemeUpdateAll(); + WindowInvalidateAll(); + } } } } - - screenCoords.y += _row_height; } - } + + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override + { + ScreenCoordsXY screenCoords; + + if (_selected_tab == WINDOW_THEMES_TAB_SETTINGS || _selected_tab == WINDOW_THEMES_TAB_FEATURES) + return; + + if ((colours[1] & 0x80) == 0) + // GfxFillRect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, + // ColourMapA[colours[1]].mid_light); + GfxClear(&dpi, ColourMapA[colours[1]].mid_light); + screenCoords.y = 0; + for (int32_t i = 0; i < GetColourSchemeTabCount(); i++) + { + if (screenCoords.y > dpi.y + dpi.height) + { + break; + } + if (screenCoords.y + _row_height >= dpi.y) + { + if (i + 1 < GetColourSchemeTabCount()) + { + int32_t colour = colours[1]; + + auto leftTop = ScreenCoordsXY{ 0, screenCoords.y + _row_height - 2 }; + auto rightBottom = ScreenCoordsXY{ widgets[WIDX_THEMES_LIST].right, screenCoords.y + _row_height - 2 }; + auto yPixelOffset = ScreenCoordsXY{ 0, 1 }; + + if (colour & COLOUR_FLAG_TRANSLUCENT) + { + TranslucentWindowPalette windowPalette = TranslucentWindowPalettes[BASE_COLOUR(colour)]; + + GfxFilterRect(dpi, { leftTop, rightBottom }, windowPalette.highlight); + GfxFilterRect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, windowPalette.shadow); + } + else + { + colour = ColourMapA[colours[1]].mid_dark; + GfxFillRect(dpi, { leftTop, rightBottom }, colour); + + colour = ColourMapA[colours[1]].lightest; + GfxFillRect(dpi, { leftTop + yPixelOffset, rightBottom + yPixelOffset }, colour); + } + } + + WindowClass wc = GetWindowClassTabIndex(i); + int32_t numColours = ThemeDescGetNumColours(wc); + for (uint8_t j = 0; j < numColours; j++) + { + DrawTextBasic(dpi, { 2, screenCoords.y + 4 }, ThemeDescGetName(wc), {}, { colours[1] }); + + uint8_t colour = ThemeGetColour(wc, j); + const bool isPressed = (i == _colour_index_1 && j == _colour_index_2); + auto image = ImageId( + isPressed ? SPR_PALETTE_BTN_PRESSED : SPR_PALETTE_BTN, colour & ~COLOUR_FLAG_TRANSLUCENT); + GfxDrawSprite(dpi, image, { _button_offset_x + 12 * j, screenCoords.y + _button_offset_y }); + + ScreenCoordsXY topLeft{ _button_offset_x + 12 * j, screenCoords.y + _check_offset_y }; + ScreenCoordsXY bottomRight{ _button_offset_x + 12 * j + 9, screenCoords.y + _check_offset_y + 10 }; + GfxFillRectInset(dpi, { topLeft, bottomRight }, colours[1], INSET_RECT_F_E0); + if (colour & COLOUR_FLAG_TRANSLUCENT) + { + GfxDrawString( + dpi, topLeft, static_cast(CheckBoxMarkString), + { static_cast(colours[1] & 0x7F), FontStyle::Medium, TextDarkness::Dark }); + } + } + } + + screenCoords.y += _row_height; + } + } #pragma endregion - void WindowThemesInitVars() - { - _selected_tab = WINDOW_THEMES_TAB_SETTINGS; - } - - WindowClass GetWindowClassTabIndex(int32_t index) - { - WindowClass* classes = window_themes_tab_classes[_selected_tab]; - return classes[index]; - } - - int32_t GetColourSchemeTabCount() - { - switch (_selected_tab) + void WindowThemesInitVars() { - case 1: - return sizeof(window_themes_tab_1_classes); - case 2: - return sizeof(window_themes_tab_2_classes); - case 3: - return sizeof(window_themes_tab_3_classes); - case 4: - return sizeof(window_themes_tab_4_classes); - case 5: - return sizeof(window_themes_tab_5_classes); - case 6: - return sizeof(window_themes_tab_6_classes); - case 7: - return sizeof(window_themes_tab_7_classes); + _selected_tab = WINDOW_THEMES_TAB_SETTINGS; } - return 0; - } - void WindowThemesDrawTabImages(DrawPixelInfo& dpi) - { - for (int32_t i = 0; i < WINDOW_THEMES_TAB_COUNT; i++) + WindowClass GetWindowClassTabIndex(int32_t index) { - int32_t sprite_idx = window_themes_tab_sprites[i]; - if (_selected_tab == i) - sprite_idx += frame_no / window_themes_tab_animation_divisor[_selected_tab]; - GfxDrawSprite( - dpi, ImageId(sprite_idx), - windowPos - + ScreenCoordsXY{ widgets[WIDX_THEMES_SETTINGS_TAB + i].left, widgets[WIDX_THEMES_SETTINGS_TAB + i].top }); + WindowClass* classes = window_themes_tab_classes[_selected_tab]; + return classes[index]; } - } -}; -WindowBase* WindowThemesOpen() -{ - WindowBase* window; + int32_t GetColourSchemeTabCount() + { + switch (_selected_tab) + { + case 1: + return sizeof(window_themes_tab_1_classes); + case 2: + return sizeof(window_themes_tab_2_classes); + case 3: + return sizeof(window_themes_tab_3_classes); + case 4: + return sizeof(window_themes_tab_4_classes); + case 5: + return sizeof(window_themes_tab_5_classes); + case 6: + return sizeof(window_themes_tab_6_classes); + case 7: + return sizeof(window_themes_tab_7_classes); + } + return 0; + } + + void WindowThemesDrawTabImages(DrawPixelInfo& dpi) + { + for (int32_t i = 0; i < WINDOW_THEMES_TAB_COUNT; i++) + { + int32_t sprite_idx = window_themes_tab_sprites[i]; + if (_selected_tab == i) + sprite_idx += frame_no / window_themes_tab_animation_divisor[_selected_tab]; + GfxDrawSprite( + dpi, ImageId(sprite_idx), + windowPos + + ScreenCoordsXY{ widgets[WIDX_THEMES_SETTINGS_TAB + i].left, + widgets[WIDX_THEMES_SETTINGS_TAB + i].top }); + } + } + }; + + WindowBase* WindowThemesOpen() + { + WindowBase* window; + + // Check if window is already open + window = WindowBringToFrontByClass(WindowClass::Themes); + if (window != nullptr) + return window; + + window = WindowCreate(WindowClass::Themes, 320, 107, WF_10 | WF_RESIZABLE); - // Check if window is already open - window = WindowBringToFrontByClass(WindowClass::Themes); - if (window != nullptr) return window; - - window = WindowCreate(WindowClass::Themes, 320, 107, WF_10 | WF_RESIZABLE); - - return window; -} + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 25192c5958..56831298ba 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -41,204 +41,206 @@ #include #include -static constexpr StringId EntranceTypeStringIds[] = { - STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_ENTRANCE, - STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_EXIT, - STR_TILE_INSPECTOR_ENTRANCE_TYPE_PARK_ENTRANC, -}; - -static constexpr StringId ParkEntrancePartStringIds[] = { - STR_TILE_INSPECTOR_ENTRANCE_MIDDLE, - STR_TILE_INSPECTOR_ENTRANCE_LEFT, - STR_TILE_INSPECTOR_ENTRANCE_RIGHT, -}; - -static constexpr StringId WallSlopeStringIds[] = { - STR_TILE_INSPECTOR_WALL_FLAT, - STR_TILE_INSPECTOR_WALL_SLOPED_LEFT, - STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT, - STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, -}; - -enum WindowTileInspectorWidgetIdx +namespace OpenRCT2::Ui::Windows { - WIDX_BACKGROUND, - WIDX_TITLE, - WIDX_CLOSE, - WIDX_LIST, - WIDX_SPINNER_X, - WIDX_SPINNER_X_INCREASE, - WIDX_SPINNER_X_DECREASE, - WIDX_SPINNER_Y, - WIDX_SPINNER_Y_INCREASE, - WIDX_SPINNER_Y_DECREASE, - WIDX_BUTTON_REMOVE, - WIDX_BUTTON_MOVE_UP, - WIDX_BUTTON_MOVE_DOWN, - WIDX_BUTTON_ROTATE, - WIDX_BUTTON_SORT, - WIDX_BUTTON_PASTE, - WIDX_BUTTON_COPY, - WIDX_COLUMN_INVISIBLE, - WIDX_COLUMN_TYPE, - WIDX_COLUMN_BASEHEIGHT, - WIDX_COLUMN_CLEARANCEHEIGHT, - WIDX_COLUMN_DIRECTION, - WIDX_COLUMN_GHOSTFLAG, - WIDX_COLUMN_LASTFLAG, - WIDX_GROUPBOX_DETAILS, - WIDX_GROUPBOX_PROPERTIES, + static constexpr StringId EntranceTypeStringIds[] = { + STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_ENTRANCE, + STR_TILE_INSPECTOR_ENTRANCE_TYPE_RIDE_EXIT, + STR_TILE_INSPECTOR_ENTRANCE_TYPE_PARK_ENTRANC, + }; - PAGE_WIDGETS, + static constexpr StringId ParkEntrancePartStringIds[] = { + STR_TILE_INSPECTOR_ENTRANCE_MIDDLE, + STR_TILE_INSPECTOR_ENTRANCE_LEFT, + STR_TILE_INSPECTOR_ENTRANCE_RIGHT, + }; - // Surface - WIDX_SURFACE_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_SURFACE_SPINNER_HEIGHT_INCREASE, - WIDX_SURFACE_SPINNER_HEIGHT_DECREASE, - WIDX_SURFACE_BUTTON_REMOVE_FENCES, - WIDX_SURFACE_BUTTON_RESTORE_FENCES, - WIDX_SURFACE_CHECK_CORNER_N, - WIDX_SURFACE_CHECK_CORNER_E, - WIDX_SURFACE_CHECK_CORNER_S, - WIDX_SURFACE_CHECK_CORNER_W, - WIDX_SURFACE_CHECK_DIAGONAL, + static constexpr StringId WallSlopeStringIds[] = { + STR_TILE_INSPECTOR_WALL_FLAT, + STR_TILE_INSPECTOR_WALL_SLOPED_LEFT, + STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT, + STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, + }; - // Path - WIDX_PATH_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_PATH_SPINNER_HEIGHT_INCREASE, - WIDX_PATH_SPINNER_HEIGHT_DECREASE, - WIDX_PATH_CHECK_BROKEN, - WIDX_PATH_CHECK_SLOPED, - WIDX_PATH_CHECK_JUNCTION_RAILINGS, - WIDX_PATH_CHECK_EDGE_NE, // Note: This is NOT named after the world orientation, but after the way - WIDX_PATH_CHECK_EDGE_E, // it looks in the window (top corner is north). Their order is important, - WIDX_PATH_CHECK_EDGE_SE, // as this is the same order paths use for their corners / edges. - WIDX_PATH_CHECK_EDGE_S, // N - WIDX_PATH_CHECK_EDGE_SW, // NW-------NE - WIDX_PATH_CHECK_EDGE_W, // W ------------- E - WIDX_PATH_CHECK_EDGE_NW, // SW-------SE - WIDX_PATH_CHECK_EDGE_N, // S + enum WindowTileInspectorWidgetIdx + { + WIDX_BACKGROUND, + WIDX_TITLE, + WIDX_CLOSE, + WIDX_LIST, + WIDX_SPINNER_X, + WIDX_SPINNER_X_INCREASE, + WIDX_SPINNER_X_DECREASE, + WIDX_SPINNER_Y, + WIDX_SPINNER_Y_INCREASE, + WIDX_SPINNER_Y_DECREASE, + WIDX_BUTTON_REMOVE, + WIDX_BUTTON_MOVE_UP, + WIDX_BUTTON_MOVE_DOWN, + WIDX_BUTTON_ROTATE, + WIDX_BUTTON_SORT, + WIDX_BUTTON_PASTE, + WIDX_BUTTON_COPY, + WIDX_COLUMN_INVISIBLE, + WIDX_COLUMN_TYPE, + WIDX_COLUMN_BASEHEIGHT, + WIDX_COLUMN_CLEARANCEHEIGHT, + WIDX_COLUMN_DIRECTION, + WIDX_COLUMN_GHOSTFLAG, + WIDX_COLUMN_LASTFLAG, + WIDX_GROUPBOX_DETAILS, + WIDX_GROUPBOX_PROPERTIES, - // Track - WIDX_TRACK_CHECK_APPLY_TO_ALL = PAGE_WIDGETS, - WIDX_TRACK_SPINNER_HEIGHT, - WIDX_TRACK_SPINNER_HEIGHT_INCREASE, - WIDX_TRACK_SPINNER_HEIGHT_DECREASE, - WIDX_TRACK_CHECK_CHAIN_LIFT, - WIDX_TRACK_CHECK_BRAKE_CLOSED, - WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE, + PAGE_WIDGETS, - // Scenery - WIDX_SCENERY_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_SCENERY_SPINNER_HEIGHT_INCREASE, - WIDX_SCENERY_SPINNER_HEIGHT_DECREASE, - WIDX_SCENERY_CHECK_QUARTER_N, - WIDX_SCENERY_CHECK_QUARTER_E, - WIDX_SCENERY_CHECK_QUARTER_S, - WIDX_SCENERY_CHECK_QUARTER_W, - WIDX_SCENERY_CHECK_COLLISION_N, - WIDX_SCENERY_CHECK_COLLISION_E, - WIDX_SCENERY_CHECK_COLLISION_S, - WIDX_SCENERY_CHECK_COLLISION_W, + // Surface + WIDX_SURFACE_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_SURFACE_SPINNER_HEIGHT_INCREASE, + WIDX_SURFACE_SPINNER_HEIGHT_DECREASE, + WIDX_SURFACE_BUTTON_REMOVE_FENCES, + WIDX_SURFACE_BUTTON_RESTORE_FENCES, + WIDX_SURFACE_CHECK_CORNER_N, + WIDX_SURFACE_CHECK_CORNER_E, + WIDX_SURFACE_CHECK_CORNER_S, + WIDX_SURFACE_CHECK_CORNER_W, + WIDX_SURFACE_CHECK_DIAGONAL, - // Entrance - WIDX_ENTRANCE_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE, - WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE, - WIDX_ENTRANCE_BUTTON_MAKE_USABLE, + // Path + WIDX_PATH_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_PATH_SPINNER_HEIGHT_INCREASE, + WIDX_PATH_SPINNER_HEIGHT_DECREASE, + WIDX_PATH_CHECK_BROKEN, + WIDX_PATH_CHECK_SLOPED, + WIDX_PATH_CHECK_JUNCTION_RAILINGS, + WIDX_PATH_CHECK_EDGE_NE, // Note: This is NOT named after the world orientation, but after the way + WIDX_PATH_CHECK_EDGE_E, // it looks in the window (top corner is north). Their order is important, + WIDX_PATH_CHECK_EDGE_SE, // as this is the same order paths use for their corners / edges. + WIDX_PATH_CHECK_EDGE_S, // N + WIDX_PATH_CHECK_EDGE_SW, // NW-------NE + WIDX_PATH_CHECK_EDGE_W, // W ------------- E + WIDX_PATH_CHECK_EDGE_NW, // SW-------SE + WIDX_PATH_CHECK_EDGE_N, // S - // Wall - WIDX_WALL_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_WALL_SPINNER_HEIGHT_INCREASE, - WIDX_WALL_SPINNER_HEIGHT_DECREASE, - WIDX_WALL_DROPDOWN_SLOPE, - WIDX_WALL_DROPDOWN_SLOPE_BUTTON, - WIDX_WALL_SPINNER_ANIMATION_FRAME, - WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE, - WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE, + // Track + WIDX_TRACK_CHECK_APPLY_TO_ALL = PAGE_WIDGETS, + WIDX_TRACK_SPINNER_HEIGHT, + WIDX_TRACK_SPINNER_HEIGHT_INCREASE, + WIDX_TRACK_SPINNER_HEIGHT_DECREASE, + WIDX_TRACK_CHECK_CHAIN_LIFT, + WIDX_TRACK_CHECK_BRAKE_CLOSED, + WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE, - // Large - WIDX_LARGE_SCENERY_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE, - WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE, + // Scenery + WIDX_SCENERY_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_SCENERY_SPINNER_HEIGHT_INCREASE, + WIDX_SCENERY_SPINNER_HEIGHT_DECREASE, + WIDX_SCENERY_CHECK_QUARTER_N, + WIDX_SCENERY_CHECK_QUARTER_E, + WIDX_SCENERY_CHECK_QUARTER_S, + WIDX_SCENERY_CHECK_QUARTER_W, + WIDX_SCENERY_CHECK_COLLISION_N, + WIDX_SCENERY_CHECK_COLLISION_E, + WIDX_SCENERY_CHECK_COLLISION_S, + WIDX_SCENERY_CHECK_COLLISION_W, - // Banner - WIDX_BANNER_SPINNER_HEIGHT = PAGE_WIDGETS, - WIDX_BANNER_SPINNER_HEIGHT_INCREASE, - WIDX_BANNER_SPINNER_HEIGHT_DECREASE, - WIDX_BANNER_CHECK_BLOCK_NE, - WIDX_BANNER_CHECK_BLOCK_SE, - WIDX_BANNER_CHECK_BLOCK_SW, - WIDX_BANNER_CHECK_BLOCK_NW, -}; + // Entrance + WIDX_ENTRANCE_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE, + WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE, + WIDX_ENTRANCE_BUTTON_MAKE_USABLE, -static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE == WIDX_BUTTON_ROTATE); -static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_COPY == WIDX_BUTTON_COPY); -static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE == WIDX_BUTTON_PASTE); -static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE == WIDX_BUTTON_REMOVE); -static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP == WIDX_BUTTON_MOVE_UP); -static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN == WIDX_BUTTON_MOVE_DOWN); -static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE == WIDX_SPINNER_X_INCREASE); -static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE == WIDX_SPINNER_X_DECREASE); -static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE == WIDX_SPINNER_Y_INCREASE); -static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE == WIDX_SPINNER_Y_DECREASE); + // Wall + WIDX_WALL_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_WALL_SPINNER_HEIGHT_INCREASE, + WIDX_WALL_SPINNER_HEIGHT_DECREASE, + WIDX_WALL_DROPDOWN_SLOPE, + WIDX_WALL_DROPDOWN_SLOPE_BUTTON, + WIDX_WALL_SPINNER_ANIMATION_FRAME, + WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE, + WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE, + + // Large + WIDX_LARGE_SCENERY_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE, + WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE, + + // Banner + WIDX_BANNER_SPINNER_HEIGHT = PAGE_WIDGETS, + WIDX_BANNER_SPINNER_HEIGHT_INCREASE, + WIDX_BANNER_SPINNER_HEIGHT_DECREASE, + WIDX_BANNER_CHECK_BLOCK_NE, + WIDX_BANNER_CHECK_BLOCK_SE, + WIDX_BANNER_CHECK_BLOCK_SW, + WIDX_BANNER_CHECK_BLOCK_NW, + }; + + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE == WIDX_BUTTON_ROTATE); + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_COPY == WIDX_BUTTON_COPY); + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE == WIDX_BUTTON_PASTE); + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE == WIDX_BUTTON_REMOVE); + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP == WIDX_BUTTON_MOVE_UP); + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN == WIDX_BUTTON_MOVE_DOWN); + static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_X_INCREASE == WIDX_SPINNER_X_INCREASE); + static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_X_DECREASE == WIDX_SPINNER_X_DECREASE); + static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_Y_INCREASE == WIDX_SPINNER_Y_INCREASE); + static_assert(WC_TILE_INSPECTOR__WIDX_SPINNER_Y_DECREASE == WIDX_SPINNER_Y_DECREASE); #pragma region MEASUREMENTS -static constexpr StringId WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE; -// Window sizes -static constexpr int32_t WW = 400; -static constexpr int32_t WH = 170; + static constexpr StringId WINDOW_TITLE = STR_TILE_INSPECTOR_TITLE; + // Window sizes + static constexpr int32_t WW = 400; + static constexpr int32_t WH = 170; -constexpr int32_t MIN_WW = WW; -constexpr int32_t MAX_WW = WW; -constexpr int32_t MIN_WH = 130; -constexpr int32_t MAX_WH = 800; + constexpr int32_t MIN_WW = WW; + constexpr int32_t MAX_WW = WW; + constexpr int32_t MIN_WH = 130; + constexpr int32_t MAX_WH = 800; -// Button space for top buttons -constexpr auto ToolbarButtonAnchor = ScreenCoordsXY{ WW - 27, 17 }; -constexpr auto ToolbarButtonSize = ScreenSize{ 24, 24 }; -constexpr auto ToolbarButtonHalfSize = ScreenSize{ 24, 12 }; -constexpr auto ToolbarButtonOffsetX = ScreenSize{ -24, 0 }; + // Button space for top buttons + constexpr auto ToolbarButtonAnchor = ScreenCoordsXY{ WW - 27, 17 }; + constexpr auto ToolbarButtonSize = ScreenSize{ 24, 24 }; + constexpr auto ToolbarButtonHalfSize = ScreenSize{ 24, 12 }; + constexpr auto ToolbarButtonOffsetX = ScreenSize{ -24, 0 }; -// List's column offsets -constexpr auto InvisibleFlagColumnXY = ScreenCoordsXY{ 3, 42 }; -constexpr auto InvisibleFlagColumnSize = ScreenSize{ 20, 14 }; -constexpr auto TypeColumnXY = InvisibleFlagColumnXY + ScreenSize{ InvisibleFlagColumnSize.width, 0 }; -constexpr auto TypeColumnSize = ScreenSize{ 252, 14 }; -constexpr auto BaseHeightColumnXY = TypeColumnXY + ScreenSize{ TypeColumnSize.width, 0 }; -constexpr auto BaseHeightColumnSize = ScreenSize{ 30, 14 }; -constexpr auto ClearanceHeightColumnXY = BaseHeightColumnXY + ScreenCoordsXY{ BaseHeightColumnSize.width, 0 }; -constexpr auto ClearanceHeightColumnSize = ScreenSize{ 30, 14 }; -constexpr auto DirectionColumnXY = ClearanceHeightColumnXY + ScreenCoordsXY{ ClearanceHeightColumnSize.width, 0 }; -constexpr auto DirectionColumnSize = ScreenSize{ 15, 14 }; -constexpr auto GhostFlagColumnXY = DirectionColumnXY + ScreenCoordsXY{ DirectionColumnSize.width, 0 }; -constexpr auto GhostFlagColumnSize = ScreenSize{ 15, 14 }; -constexpr auto LastFlagColumnXY = GhostFlagColumnXY + ScreenCoordsXY{ GhostFlagColumnSize.width, 0 }; -constexpr auto LastFlagColumnSize = ScreenSize{ 32, 14 }; + // List's column offsets + constexpr auto InvisibleFlagColumnXY = ScreenCoordsXY{ 3, 42 }; + constexpr auto InvisibleFlagColumnSize = ScreenSize{ 20, 14 }; + constexpr auto TypeColumnXY = InvisibleFlagColumnXY + ScreenSize{ InvisibleFlagColumnSize.width, 0 }; + constexpr auto TypeColumnSize = ScreenSize{ 252, 14 }; + constexpr auto BaseHeightColumnXY = TypeColumnXY + ScreenSize{ TypeColumnSize.width, 0 }; + constexpr auto BaseHeightColumnSize = ScreenSize{ 30, 14 }; + constexpr auto ClearanceHeightColumnXY = BaseHeightColumnXY + ScreenCoordsXY{ BaseHeightColumnSize.width, 0 }; + constexpr auto ClearanceHeightColumnSize = ScreenSize{ 30, 14 }; + constexpr auto DirectionColumnXY = ClearanceHeightColumnXY + ScreenCoordsXY{ ClearanceHeightColumnSize.width, 0 }; + constexpr auto DirectionColumnSize = ScreenSize{ 15, 14 }; + constexpr auto GhostFlagColumnXY = DirectionColumnXY + ScreenCoordsXY{ DirectionColumnSize.width, 0 }; + constexpr auto GhostFlagColumnSize = ScreenSize{ 15, 14 }; + constexpr auto LastFlagColumnXY = GhostFlagColumnXY + ScreenCoordsXY{ GhostFlagColumnSize.width, 0 }; + constexpr auto LastFlagColumnSize = ScreenSize{ 32, 14 }; -constexpr int32_t PADDING_BOTTOM = 15; -constexpr int32_t GROUPBOX_PADDING = 6; -constexpr int32_t HORIZONTAL_GROUPBOX_PADDING = 5; -constexpr int32_t VERTICAL_GROUPBOX_PADDING = 4; -constexpr auto PropertyButtonSize = ScreenSize{ 130, 18 }; -constexpr auto PropertyFullWidth = ScreenSize{ 370, 18 }; + constexpr int32_t PADDING_BOTTOM = 15; + constexpr int32_t GROUPBOX_PADDING = 6; + constexpr int32_t HORIZONTAL_GROUPBOX_PADDING = 5; + constexpr int32_t VERTICAL_GROUPBOX_PADDING = 4; + constexpr auto PropertyButtonSize = ScreenSize{ 130, 18 }; + constexpr auto PropertyFullWidth = ScreenSize{ 370, 18 }; #pragma endregion -constexpr ScreenCoordsXY PropertyRowCol(ScreenCoordsXY anchor, int32_t row, int32_t column) -{ - return anchor - + ScreenCoordsXY{ column * (PropertyButtonSize.width + HORIZONTAL_GROUPBOX_PADDING), - row * (PropertyButtonSize.height + VERTICAL_GROUPBOX_PADDING) }; -} + constexpr ScreenCoordsXY PropertyRowCol(ScreenCoordsXY anchor, int32_t row, int32_t column) + { + return anchor + + ScreenCoordsXY{ column * (PropertyButtonSize.width + HORIZONTAL_GROUPBOX_PADDING), + row * (PropertyButtonSize.height + VERTICAL_GROUPBOX_PADDING) }; + } -constexpr ScreenCoordsXY CheckboxGroupOffset( - ScreenCoordsXY anchorPoint, int16_t horizontalMultiplier, int16_t verticalMultiplier) -{ - return anchorPoint + ScreenCoordsXY{ 14 * horizontalMultiplier, 7 * verticalMultiplier }; -} + constexpr ScreenCoordsXY CheckboxGroupOffset( + ScreenCoordsXY anchorPoint, int16_t horizontalMultiplier, int16_t verticalMultiplier) + { + return anchorPoint + ScreenCoordsXY{ 14 * horizontalMultiplier, 7 * verticalMultiplier }; + } -// clang-format off + // clang-format off // Macros for easily obtaining the top and bottom of a widget inside a properties group box #define GBBT(GROUPTOP, row) ((GROUPTOP) + 14 + row * (PropertyButtonSize.height + VERTICAL_GROUPBOX_PADDING)) #define GBBB(GROUPTOP, row) (GBBT((GROUPTOP), row) + PropertyButtonSize.height) @@ -404,46 +406,46 @@ static Widget *PageWidgets[] = { LargeSceneryWidgets, BannerWidgets, }; -// clang-format on + // clang-format on -struct TileInspectorGroupboxSettings -{ - // Offsets from the bottom of the window - int16_t details_top_offset, details_bottom_offset; - int16_t properties_top_offset, properties_bottom_offset; - // String to be displayed in the details groupbox - StringId string_id; -}; + struct TileInspectorGroupboxSettings + { + // Offsets from the bottom of the window + int16_t details_top_offset, details_bottom_offset; + int16_t properties_top_offset, properties_bottom_offset; + // String to be displayed in the details groupbox + StringId string_id; + }; -static constexpr TileInspectorGroupboxSettings MakeGroupboxSettings( - int16_t detailsHeight, int16_t propertiesHeight, StringId stringId) -{ - TileInspectorGroupboxSettings settings{}; - decltype(settings.properties_bottom_offset) offsetSum = 0; - settings.properties_bottom_offset = (offsetSum += PADDING_BOTTOM); - settings.properties_top_offset = (offsetSum += propertiesHeight); - settings.details_bottom_offset = (offsetSum += GROUPBOX_PADDING); - settings.details_top_offset = (offsetSum += detailsHeight); - settings.string_id = stringId; - return settings; -} + static constexpr TileInspectorGroupboxSettings MakeGroupboxSettings( + int16_t detailsHeight, int16_t propertiesHeight, StringId stringId) + { + TileInspectorGroupboxSettings settings{}; + decltype(settings.properties_bottom_offset) offsetSum = 0; + settings.properties_bottom_offset = (offsetSum += PADDING_BOTTOM); + settings.properties_top_offset = (offsetSum += propertiesHeight); + settings.details_bottom_offset = (offsetSum += GROUPBOX_PADDING); + settings.details_top_offset = (offsetSum += detailsHeight); + settings.string_id = stringId; + return settings; + } -static constexpr TileInspectorGroupboxSettings PageGroupBoxSettings[] = { - MakeGroupboxSettings(SurfaceDetailsHeight, SurfacePropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_SURFACE_INFO), - MakeGroupboxSettings(PathDetailsHeight, PathPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_PATH_INFO), - MakeGroupboxSettings(TrackDetailsHeight, TrackPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_TRACK_INFO), - MakeGroupboxSettings(SceneryDetailsHeight, SceneryPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_SCENERY_INFO), - MakeGroupboxSettings(EntranceDetailsHeight, EntrancePropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_ENTRANCE_INFO), - MakeGroupboxSettings(WallDetailsHeight, WallPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_WALL_INFO), - MakeGroupboxSettings(LargeSceneryDetailsHeight, LargeSceneryPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_BANNER_INFO), - MakeGroupboxSettings(BannerDetailsHeight, BannerPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_BANNER_INFO), -}; + static constexpr TileInspectorGroupboxSettings PageGroupBoxSettings[] = { + MakeGroupboxSettings(SurfaceDetailsHeight, SurfacePropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_SURFACE_INFO), + MakeGroupboxSettings(PathDetailsHeight, PathPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_PATH_INFO), + MakeGroupboxSettings(TrackDetailsHeight, TrackPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_TRACK_INFO), + MakeGroupboxSettings(SceneryDetailsHeight, SceneryPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_SCENERY_INFO), + MakeGroupboxSettings(EntranceDetailsHeight, EntrancePropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_ENTRANCE_INFO), + MakeGroupboxSettings(WallDetailsHeight, WallPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_WALL_INFO), + MakeGroupboxSettings(LargeSceneryDetailsHeight, LargeSceneryPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_BANNER_INFO), + MakeGroupboxSettings(BannerDetailsHeight, BannerPropertiesHeight, STR_TILE_INSPECTOR_GROUPBOX_BANNER_INFO), + }; -static constexpr int32_t ViewportInteractionFlags = EnumsToFlags( - ViewportInteractionItem::Terrain, ViewportInteractionItem::Ride, ViewportInteractionItem::Scenery, - ViewportInteractionItem::Footpath, ViewportInteractionItem::PathAddition, ViewportInteractionItem::ParkEntrance, - ViewportInteractionItem::Wall, ViewportInteractionItem::LargeScenery, ViewportInteractionItem::Banner); -// clang-format off + static constexpr int32_t ViewportInteractionFlags = EnumsToFlags( + ViewportInteractionItem::Terrain, ViewportInteractionItem::Ride, ViewportInteractionItem::Scenery, + ViewportInteractionItem::Footpath, ViewportInteractionItem::PathAddition, ViewportInteractionItem::ParkEntrance, + ViewportInteractionItem::Wall, ViewportInteractionItem::LargeScenery, ViewportInteractionItem::Banner); + // clang-format off static uint64_t PageHoldDownWidgets[] = { (1uLL << WIDX_SPINNER_X_INCREASE) | (1uLL << WIDX_SPINNER_X_DECREASE) | (1uLL << WIDX_SPINNER_Y_INCREASE) | (1uLL << WIDX_SPINNER_Y_DECREASE), @@ -468,1919 +470,1945 @@ static uint64_t PageDisabledWidgets[] = { (1uLL << WIDX_BUTTON_ROTATE), 0, }; -// clang-format on + // clang-format on -class TileInspector final : public Window -{ -private: - int16_t _highlightedIndex = -1; - bool _tileSelected = false; - int32_t _toolMouseX = 0; - int32_t _toolMouseY = 0; - bool _toolCtrlDown = false; - CoordsXY _toolMap = {}; - bool _applyToAll = false; - bool _elementCopied = false; - TileElement _copiedElement; - Banner _copiedBanner; - -public: - void OnOpen() override + class TileInspector final : public Window { - min_width = MIN_WW; - min_height = MIN_WH; - max_width = MAX_WW; - max_height = MAX_WH; + private: + int16_t _highlightedIndex = -1; + bool _tileSelected = false; + int32_t _toolMouseX = 0; + int32_t _toolMouseY = 0; + bool _toolCtrlDown = false; + CoordsXY _toolMap = {}; + bool _applyToAll = false; + bool _elementCopied = false; + TileElement _copiedElement; + Banner _copiedBanner; - windowTileInspectorSelectedIndex = -1; - SetPage(TileInspectorPage::Default); - WindowInitScrollWidgets(*this); - _tileSelected = false; - - ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair); - } - - void OnUpdate() override - { - // Check if the mouse is hovering over the list - if (!WidgetIsHighlighted(*this, WIDX_LIST)) + public: + void OnOpen() override { - if (_highlightedIndex != -1) - InvalidateWidget(WIDX_LIST); - _highlightedIndex = -1; + min_width = MIN_WW; + min_height = MIN_WH; + max_width = MAX_WW; + max_height = MAX_WH; + + windowTileInspectorSelectedIndex = -1; + SetPage(TileInspectorPage::Default); + WindowInitScrollWidgets(*this); + _tileSelected = false; + + ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair); } - if (gCurrentToolWidget.window_classification != WindowClass::TileInspector) - Close(); - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnUpdate() override { - case WIDX_CLOSE: + // Check if the mouse is hovering over the list + if (!WidgetIsHighlighted(*this, WIDX_LIST)) + { + if (_highlightedIndex != -1) + InvalidateWidget(WIDX_LIST); + _highlightedIndex = -1; + } + if (gCurrentToolWidget.window_classification != WindowClass::TileInspector) Close(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + return; + + case WIDX_BUTTON_REMOVE: + { + RemoveElement(windowTileInspectorSelectedIndex); + break; + } + + case WIDX_BUTTON_ROTATE: + RotateElement(windowTileInspectorSelectedIndex); + break; + + case WIDX_BUTTON_SORT: + SortElements(); + break; + + case WIDX_BUTTON_COPY: + CopyElement(); + break; + + case WIDX_BUTTON_PASTE: + PasteElement(); + break; + + case WIDX_BUTTON_MOVE_UP: + SwapElements(windowTileInspectorSelectedIndex, windowTileInspectorSelectedIndex + 1); + break; + + case WIDX_BUTTON_MOVE_DOWN: + SwapElements(windowTileInspectorSelectedIndex - 1, windowTileInspectorSelectedIndex); + break; + } + + // Only element-specific widgets from now on + if (tileInspectorPage == TileInspectorPage::Default || windowTileInspectorSelectedIndex == -1) return; - case WIDX_BUTTON_REMOVE: - { - RemoveElement(windowTileInspectorSelectedIndex); - break; - } - - case WIDX_BUTTON_ROTATE: - RotateElement(windowTileInspectorSelectedIndex); - break; - - case WIDX_BUTTON_SORT: - SortElements(); - break; - - case WIDX_BUTTON_COPY: - CopyElement(); - break; - - case WIDX_BUTTON_PASTE: - PasteElement(); - break; - - case WIDX_BUTTON_MOVE_UP: - SwapElements(windowTileInspectorSelectedIndex, windowTileInspectorSelectedIndex + 1); - break; - - case WIDX_BUTTON_MOVE_DOWN: - SwapElements(windowTileInspectorSelectedIndex - 1, windowTileInspectorSelectedIndex); - break; - } - - // Only element-specific widgets from now on - if (tileInspectorPage == TileInspectorPage::Default || windowTileInspectorSelectedIndex == -1) - return; - - const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); - - if (tileElement == nullptr) - return; - - // Page widgets - switch (tileElement->GetType()) - { - case TileElementType::Surface: - switch (widgetIndex) - { - case WIDX_SURFACE_BUTTON_REMOVE_FENCES: - SurfaceShowParkFences(false); - break; - - case WIDX_SURFACE_BUTTON_RESTORE_FENCES: - SurfaceShowParkFences(true); - break; - - case WIDX_SURFACE_CHECK_CORNER_N: - case WIDX_SURFACE_CHECK_CORNER_E: - case WIDX_SURFACE_CHECK_CORNER_S: - case WIDX_SURFACE_CHECK_CORNER_W: - SurfaceToggleCorner(((widgetIndex - WIDX_SURFACE_CHECK_CORNER_N) + 2 - GetCurrentRotation()) & 3); - break; - - case WIDX_SURFACE_CHECK_DIAGONAL: - SurfaceToggleDiagonal(); - break; - } // switch widgetindex - break; - case TileElementType::Path: - switch (widgetIndex) - { - case WIDX_PATH_CHECK_SLOPED: - PathSetSloped(windowTileInspectorSelectedIndex, !tileElement->AsPath()->IsSloped()); - break; - case WIDX_PATH_CHECK_JUNCTION_RAILINGS: - PathSetJunctionRailings( - windowTileInspectorSelectedIndex, !tileElement->AsPath()->HasJunctionRailings()); - break; - - case WIDX_PATH_CHECK_BROKEN: - PathSetBroken(windowTileInspectorSelectedIndex, !tileElement->AsPath()->IsBroken()); - break; - - case WIDX_PATH_CHECK_EDGE_E: - case WIDX_PATH_CHECK_EDGE_S: - case WIDX_PATH_CHECK_EDGE_W: - case WIDX_PATH_CHECK_EDGE_N: - { - // 0 = east/right, 1 = south/bottom, 2 = west/left, 3 = north/top - const int32_t eswn = (widgetIndex - WIDX_PATH_CHECK_EDGE_E) / 2; - // Transform to world orientation - const int32_t index = (eswn - GetCurrentRotation()) & 3; - PathToggleEdge( - windowTileInspectorSelectedIndex, - index + 4); // The corners are stored in the 4 most significant bits, hence the + 4 - break; - } - - case WIDX_PATH_CHECK_EDGE_NE: - case WIDX_PATH_CHECK_EDGE_SE: - case WIDX_PATH_CHECK_EDGE_SW: - case WIDX_PATH_CHECK_EDGE_NW: - { - // 0 = NE, 1 = SE, 2 = SW, 3 = NW - const int32_t neseswnw = (widgetIndex - WIDX_PATH_CHECK_EDGE_NE) / 2; - // Transform to world orientation - const int32_t index = (neseswnw - GetCurrentRotation()) & 3; - PathToggleEdge(windowTileInspectorSelectedIndex, index); - break; - } - } // switch widget index - break; - - case TileElementType::Track: - switch (widgetIndex) - { - case WIDX_TRACK_CHECK_APPLY_TO_ALL: - _applyToAll ^= 1; - InvalidateWidget(widgetIndex); - break; - - case WIDX_TRACK_CHECK_CHAIN_LIFT: - { - bool entireTrackBlock = IsWidgetPressed(WIDX_TRACK_CHECK_APPLY_TO_ALL); - bool newLift = !tileElement->AsTrack()->HasChain(); - TrackBlockSetLift(windowTileInspectorSelectedIndex, entireTrackBlock, newLift); - break; - } - - case WIDX_TRACK_CHECK_BRAKE_CLOSED: - TrackSetBrakeClosed(windowTileInspectorSelectedIndex, !tileElement->AsTrack()->IsBrakeClosed()); - break; - - case WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE: - TrackSetIndestructible(windowTileInspectorSelectedIndex, !tileElement->AsTrack()->IsIndestructible()); - break; - } // switch widget index - break; - - case TileElementType::SmallScenery: - switch (widgetIndex) - { - case WIDX_SCENERY_CHECK_QUARTER_N: - case WIDX_SCENERY_CHECK_QUARTER_E: - case WIDX_SCENERY_CHECK_QUARTER_S: - case WIDX_SCENERY_CHECK_QUARTER_W: - QuarterTileSet(windowTileInspectorSelectedIndex, widgetIndex - WIDX_SCENERY_CHECK_QUARTER_N); - break; - - case WIDX_SCENERY_CHECK_COLLISION_N: - case WIDX_SCENERY_CHECK_COLLISION_E: - case WIDX_SCENERY_CHECK_COLLISION_S: - case WIDX_SCENERY_CHECK_COLLISION_W: - ToggleQuadrantCollosion(windowTileInspectorSelectedIndex, widgetIndex - WIDX_SCENERY_CHECK_COLLISION_N); - break; - } // switch widget index - break; - - case TileElementType::Entrance: - switch (widgetIndex) - { - case WIDX_ENTRANCE_BUTTON_MAKE_USABLE: - EntranceMakeUsable(windowTileInspectorSelectedIndex); - break; - } // switch widget index - break; - - case TileElementType::Banner: - switch (widgetIndex) - { - case WIDX_BANNER_CHECK_BLOCK_NE: - case WIDX_BANNER_CHECK_BLOCK_SE: - case WIDX_BANNER_CHECK_BLOCK_SW: - case WIDX_BANNER_CHECK_BLOCK_NW: - BannerToggleBlock(windowTileInspectorSelectedIndex, widgetIndex - WIDX_BANNER_CHECK_BLOCK_NE); - break; - } // switch widget index - break; - - case TileElementType::LargeScenery: - case TileElementType::Wall: - default: - break; - } - } - - void OnClose() override - { - ToolCancel(); - TileElement* const elem = OpenRCT2::TileInspector::GetSelectedElement(); - if (elem != nullptr) - { - MapInvalidateElement(_toolMap, elem); - } - windowTileInspectorSelectedIndex = -1; - } - - void OnResize() override - { - if (width < min_width) - { - Invalidate(); - width = min_width; - } - if (height < min_height) - { - Invalidate(); - height = min_height; - } - ResizeFrame(); - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_SPINNER_X_INCREASE: - windowTileInspectorTile.x = std::min(windowTileInspectorTile.x + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); - _toolMap.x = std::min(_toolMap.x + 32, MAXIMUM_TILE_START_XY); - LoadTile(nullptr); - break; - - case WIDX_SPINNER_X_DECREASE: - windowTileInspectorTile.x = std::max(windowTileInspectorTile.x - 1, 0); - _toolMap.x = std::max(_toolMap.x - 32, 0); - LoadTile(nullptr); - break; - - case WIDX_SPINNER_Y_INCREASE: - windowTileInspectorTile.y = std::min(windowTileInspectorTile.y + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); - _toolMap.y = std::min(_toolMap.y + 32, MAXIMUM_TILE_START_XY); - LoadTile(nullptr); - break; - - case WIDX_SPINNER_Y_DECREASE: - windowTileInspectorTile.y = std::max(windowTileInspectorTile.y - 1, 0); - _toolMap.y = std::max(_toolMap.y - 32, 0); - LoadTile(nullptr); - break; - } // switch widget index - - // Only element-specific widgets from now on - if (tileInspectorPage == TileInspectorPage::Default || windowTileInspectorSelectedIndex == -1) - return; - - const TileElement* tileElement = OpenRCT2::TileInspector::GetSelectedElement(); - if (tileElement == nullptr) - return; - - switch (tileElement->GetType()) - { - case TileElementType::Surface: - switch (widgetIndex) - { - case WIDX_SURFACE_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_SURFACE_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - case TileElementType::Path: - switch (widgetIndex) - { - case WIDX_PATH_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_PATH_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - case TileElementType::Track: - switch (widgetIndex) - { - case WIDX_TRACK_SPINNER_HEIGHT_INCREASE: - if (IsWidgetPressed(WIDX_TRACK_CHECK_APPLY_TO_ALL)) - TrackBlockHeightOffset(windowTileInspectorSelectedIndex, 1); - else - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_TRACK_SPINNER_HEIGHT_DECREASE: - if (IsWidgetPressed(WIDX_TRACK_CHECK_APPLY_TO_ALL)) - TrackBlockHeightOffset(windowTileInspectorSelectedIndex, -1); - else - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - case TileElementType::SmallScenery: - switch (widgetIndex) - { - case WIDX_SCENERY_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_SCENERY_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - case TileElementType::Entrance: - switch (widgetIndex) - { - case WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - - case WIDX_ENTRANCE_BUTTON_MAKE_USABLE: - EntranceMakeUsable(windowTileInspectorSelectedIndex); - break; - } // switch widget index - break; - - case TileElementType::Wall: - switch (widgetIndex) - { - case WIDX_WALL_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_WALL_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - - case WIDX_WALL_DROPDOWN_SLOPE_BUTTON: - { - Widget* widget = &widgets[widgetIndex]; - // Use dropdown instead of dropdown button - widget--; - // Fill dropdown list - gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; - gDropdownItems[0].Args = STR_TILE_INSPECTOR_WALL_FLAT; - gDropdownItems[1].Args = STR_TILE_INSPECTOR_WALL_SLOPED_LEFT; - gDropdownItems[2].Args = STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT; - WindowDropdownShowTextCustomWidth( - { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, - Dropdown::Flag::StayOpen, 3, widget->width() - 3); - - // Set current value as checked - Dropdown::SetChecked(tileElement->AsWall()->GetSlope(), true); - break; - } - - case WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE: - WallAnimationFrameOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE: - WallAnimationFrameOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - case TileElementType::LargeScenery: - switch (widgetIndex) - { - case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - case TileElementType::Banner: - switch (widgetIndex) - { - case WIDX_BANNER_SPINNER_HEIGHT_INCREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, 1); - break; - - case WIDX_BANNER_SPINNER_HEIGHT_DECREASE: - BaseHeightOffset(windowTileInspectorSelectedIndex, -1); - break; - } // switch widget index - break; - - default: - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override - { - if (dropdownIndex == -1) - return; - // Get selected element - const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); - if (tileInspectorPage == TileInspectorPage::Wall) - { - Guard::Assert(tileElement->GetType() == TileElementType::Wall, "Element is not a wall"); - if (widgetIndex == WIDX_WALL_DROPDOWN_SLOPE_BUTTON) - WallSetSlope(windowTileInspectorSelectedIndex, dropdownIndex); - } - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - MapInvalidateSelectionRect(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - - CoordsXY mapCoords; - TileElement* clickedElement = nullptr; - bool mouseOnViewport = false; - if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z)) - { - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionFlags); - clickedElement = info.Element; - mapCoords = info.Loc; - } - // Even if Ctrl was pressed, fall back to normal selection when there was nothing under the cursor - if (clickedElement == nullptr) - { - auto mouseCoords = ScreenPosToMapPos(screenCoords, nullptr); - if (mouseCoords.has_value()) - { - mouseOnViewport = true; - mapCoords = mouseCoords.value(); - } - } - if (mouseOnViewport) - gMapSelectPositionA = gMapSelectPositionB = mapCoords; - else if (_tileSelected) - gMapSelectPositionA = gMapSelectPositionB = _toolMap; - else - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - gMapSelectType = MAP_SELECT_TYPE_FULL; - MapInvalidateSelectionRect(); - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - UpdateSelectedTile(screenCoords); - } - - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - UpdateSelectedTile(screenCoords); - } - - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - return ScreenSize(WW - 30, windowTileInspectorElementCount * SCROLLABLE_ROW_HEIGHT); - } - - void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - // There is nothing to interact with when no tile is selected - if (!_tileSelected) - return; - - // Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements - const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1; - const ScreenRect checkboxColumnRect{ { 2, 0 }, { 15, screenCoords.y } }; - if (index >= 0 && checkboxColumnRect.Contains(screenCoords)) - { // Checkbox was clicked - ToggleInvisibility(index); - } - else - { - SelectElementFromList(index); - } - } - - void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1; - if (index < 0 || index >= windowTileInspectorElementCount) - _highlightedIndex = -1; - else - _highlightedIndex = index; - InvalidateWidget(WIDX_LIST); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - ScreenCoordsXY screenCoords(windowPos.x, windowPos.y); - - // Draw coordinates - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] }); - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] }); - if (_tileSelected) - { - auto tileCoords = TileCoordsXY{ _toolMap }; - auto ft = Formatter(); - ft.Add(tileCoords.x); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); - ft = Formatter(); - ft.Add(tileCoords.y); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); - } - else - { - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] }); - GfxDrawString(dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] }); - } - - if (windowTileInspectorSelectedIndex != -1) - { - // X and Y of first element in detail box - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_GROUPBOX_DETAILS].top + 14 }; - - // Get map element const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); + + if (tileElement == nullptr) + return; + + // Page widgets + switch (tileElement->GetType()) + { + case TileElementType::Surface: + switch (widgetIndex) + { + case WIDX_SURFACE_BUTTON_REMOVE_FENCES: + SurfaceShowParkFences(false); + break; + + case WIDX_SURFACE_BUTTON_RESTORE_FENCES: + SurfaceShowParkFences(true); + break; + + case WIDX_SURFACE_CHECK_CORNER_N: + case WIDX_SURFACE_CHECK_CORNER_E: + case WIDX_SURFACE_CHECK_CORNER_S: + case WIDX_SURFACE_CHECK_CORNER_W: + SurfaceToggleCorner(((widgetIndex - WIDX_SURFACE_CHECK_CORNER_N) + 2 - GetCurrentRotation()) & 3); + break; + + case WIDX_SURFACE_CHECK_DIAGONAL: + SurfaceToggleDiagonal(); + break; + } // switch widgetindex + break; + case TileElementType::Path: + switch (widgetIndex) + { + case WIDX_PATH_CHECK_SLOPED: + PathSetSloped(windowTileInspectorSelectedIndex, !tileElement->AsPath()->IsSloped()); + break; + case WIDX_PATH_CHECK_JUNCTION_RAILINGS: + PathSetJunctionRailings( + windowTileInspectorSelectedIndex, !tileElement->AsPath()->HasJunctionRailings()); + break; + + case WIDX_PATH_CHECK_BROKEN: + PathSetBroken(windowTileInspectorSelectedIndex, !tileElement->AsPath()->IsBroken()); + break; + + case WIDX_PATH_CHECK_EDGE_E: + case WIDX_PATH_CHECK_EDGE_S: + case WIDX_PATH_CHECK_EDGE_W: + case WIDX_PATH_CHECK_EDGE_N: + { + // 0 = east/right, 1 = south/bottom, 2 = west/left, 3 = north/top + const int32_t eswn = (widgetIndex - WIDX_PATH_CHECK_EDGE_E) / 2; + // Transform to world orientation + const int32_t index = (eswn - GetCurrentRotation()) & 3; + PathToggleEdge( + windowTileInspectorSelectedIndex, + index + 4); // The corners are stored in the 4 most significant bits, hence the + 4 + break; + } + + case WIDX_PATH_CHECK_EDGE_NE: + case WIDX_PATH_CHECK_EDGE_SE: + case WIDX_PATH_CHECK_EDGE_SW: + case WIDX_PATH_CHECK_EDGE_NW: + { + // 0 = NE, 1 = SE, 2 = SW, 3 = NW + const int32_t neseswnw = (widgetIndex - WIDX_PATH_CHECK_EDGE_NE) / 2; + // Transform to world orientation + const int32_t index = (neseswnw - GetCurrentRotation()) & 3; + PathToggleEdge(windowTileInspectorSelectedIndex, index); + break; + } + } // switch widget index + break; + + case TileElementType::Track: + switch (widgetIndex) + { + case WIDX_TRACK_CHECK_APPLY_TO_ALL: + _applyToAll ^= 1; + InvalidateWidget(widgetIndex); + break; + + case WIDX_TRACK_CHECK_CHAIN_LIFT: + { + bool entireTrackBlock = IsWidgetPressed(WIDX_TRACK_CHECK_APPLY_TO_ALL); + bool newLift = !tileElement->AsTrack()->HasChain(); + TrackBlockSetLift(windowTileInspectorSelectedIndex, entireTrackBlock, newLift); + break; + } + + case WIDX_TRACK_CHECK_BRAKE_CLOSED: + TrackSetBrakeClosed(windowTileInspectorSelectedIndex, !tileElement->AsTrack()->IsBrakeClosed()); + break; + + case WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE: + TrackSetIndestructible( + windowTileInspectorSelectedIndex, !tileElement->AsTrack()->IsIndestructible()); + break; + } // switch widget index + break; + + case TileElementType::SmallScenery: + switch (widgetIndex) + { + case WIDX_SCENERY_CHECK_QUARTER_N: + case WIDX_SCENERY_CHECK_QUARTER_E: + case WIDX_SCENERY_CHECK_QUARTER_S: + case WIDX_SCENERY_CHECK_QUARTER_W: + QuarterTileSet(windowTileInspectorSelectedIndex, widgetIndex - WIDX_SCENERY_CHECK_QUARTER_N); + break; + + case WIDX_SCENERY_CHECK_COLLISION_N: + case WIDX_SCENERY_CHECK_COLLISION_E: + case WIDX_SCENERY_CHECK_COLLISION_S: + case WIDX_SCENERY_CHECK_COLLISION_W: + ToggleQuadrantCollosion( + windowTileInspectorSelectedIndex, widgetIndex - WIDX_SCENERY_CHECK_COLLISION_N); + break; + } // switch widget index + break; + + case TileElementType::Entrance: + switch (widgetIndex) + { + case WIDX_ENTRANCE_BUTTON_MAKE_USABLE: + EntranceMakeUsable(windowTileInspectorSelectedIndex); + break; + } // switch widget index + break; + + case TileElementType::Banner: + switch (widgetIndex) + { + case WIDX_BANNER_CHECK_BLOCK_NE: + case WIDX_BANNER_CHECK_BLOCK_SE: + case WIDX_BANNER_CHECK_BLOCK_SW: + case WIDX_BANNER_CHECK_BLOCK_NW: + BannerToggleBlock(windowTileInspectorSelectedIndex, widgetIndex - WIDX_BANNER_CHECK_BLOCK_NE); + break; + } // switch widget index + break; + + case TileElementType::LargeScenery: + case TileElementType::Wall: + default: + break; + } + } + + void OnClose() override + { + ToolCancel(); + TileElement* const elem = OpenRCT2::TileInspector::GetSelectedElement(); + if (elem != nullptr) + { + MapInvalidateElement(_toolMap, elem); + } + windowTileInspectorSelectedIndex = -1; + } + + void OnResize() override + { + if (width < min_width) + { + Invalidate(); + width = min_width; + } + if (height < min_height) + { + Invalidate(); + height = min_height; + } + ResizeFrame(); + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_SPINNER_X_INCREASE: + windowTileInspectorTile.x = std::min( + windowTileInspectorTile.x + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); + _toolMap.x = std::min(_toolMap.x + 32, MAXIMUM_TILE_START_XY); + LoadTile(nullptr); + break; + + case WIDX_SPINNER_X_DECREASE: + windowTileInspectorTile.x = std::max(windowTileInspectorTile.x - 1, 0); + _toolMap.x = std::max(_toolMap.x - 32, 0); + LoadTile(nullptr); + break; + + case WIDX_SPINNER_Y_INCREASE: + windowTileInspectorTile.y = std::min( + windowTileInspectorTile.y + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); + _toolMap.y = std::min(_toolMap.y + 32, MAXIMUM_TILE_START_XY); + LoadTile(nullptr); + break; + + case WIDX_SPINNER_Y_DECREASE: + windowTileInspectorTile.y = std::max(windowTileInspectorTile.y - 1, 0); + _toolMap.y = std::max(_toolMap.y - 32, 0); + LoadTile(nullptr); + break; + } // switch widget index + + // Only element-specific widgets from now on + if (tileInspectorPage == TileInspectorPage::Default || windowTileInspectorSelectedIndex == -1) + return; + + const TileElement* tileElement = OpenRCT2::TileInspector::GetSelectedElement(); if (tileElement == nullptr) return; switch (tileElement->GetType()) { case TileElementType::Surface: - { - // Details - // Terrain texture name - StringId terrainNameId = STR_EMPTY; - auto surfaceStyle = tileElement->AsSurface()->GetSurfaceObject(); - if (surfaceStyle != nullptr) - terrainNameId = surfaceStyle->NameStringId; - auto ft = Formatter(); - ft.Add(terrainNameId); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] }); + switch (widgetIndex) + { + case WIDX_SURFACE_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; - // Edge texture name - StringId terrainEdgeNameId = STR_EMPTY; - auto edgeStyle = tileElement->AsSurface()->GetEdgeObject(); - if (edgeStyle != nullptr) - terrainEdgeNameId = edgeStyle->NameStringId; - ft = Formatter(); - ft.Add(terrainEdgeNameId); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { colours[1] }); - - // Land ownership - StringId landOwnership; - if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED) - landOwnership = STR_LAND_OWNED; - else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_AVAILABLE) - landOwnership = STR_LAND_SALE; - else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) - landOwnership = STR_CONSTRUCTION_RIGHTS_OWNED; - else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) - landOwnership = STR_CONSTRUCTION_RIGHTS_SALE; - else - landOwnership = STR_TILE_INSPECTOR_LAND_NOT_OWNED_AND_NOT_AVAILABLE; - - ft = Formatter(); - ft.Add(landOwnership); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, { colours[1] }); - - // Water level - ft = Formatter(); - ft.Add(tileElement->AsSurface()->GetWaterHeight()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft, - { colours[1] }); - - // Properties - // Raise / lower label - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SURFACE_SPINNER_HEIGHT].top }; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3; - ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - - // Raised corners - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SURFACE_CHECK_CORNER_E].top }; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_CORNERS, {}, { colours[1] }); + case WIDX_SURFACE_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index break; - } + case TileElementType::Path: - { - // Details - auto pathEl = tileElement->AsPath(); - auto footpathObj = pathEl->GetLegacyPathEntry(); - if (footpathObj == nullptr) + switch (widgetIndex) { - // Surface name - auto surfaceObj = pathEl->GetSurfaceEntry(); - if (surfaceObj != nullptr) - { - auto ft = Formatter(); - ft.Add(surfaceObj->NameStringId); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE }); - } + case WIDX_PATH_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; - // Railings name - auto railingsObj = pathEl->GetRailingsEntry(); - if (railingsObj != nullptr) - { - auto ft = Formatter(); - ft.Add(railingsObj->NameStringId); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft, - { COLOUR_WHITE }); - } - } - else - { - // Legacy path name - auto footpathEntry = reinterpret_cast(footpathObj->GetLegacyData()); - auto ft = Formatter(); - ft.Add(footpathEntry->string_idx); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); - } - - // Path addition - if (tileElement->AsPath()->HasAddition()) - { - const auto pathAdditionEntry = tileElement->AsPath()->GetAdditionEntry(); - StringId additionNameId = pathAdditionEntry != nullptr ? pathAdditionEntry->name - : static_cast(STR_UNKNOWN_OBJECT_TYPE); - auto ft = Formatter(); - ft.Add(additionNameId); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, - { COLOUR_WHITE }); - } - else - { - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, {}, - { COLOUR_WHITE }); - } - - // Properties - // Raise / lower label - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_SPINNER_HEIGHT].top }; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3; - auto ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - - // Path connections - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_CHECK_EDGE_W].top }; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_CONNECTED_EDGES, {}, { colours[1] }); + case WIDX_PATH_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index break; - } case TileElementType::Track: - { - auto trackElement = tileElement->AsTrack(); - RideId id = trackElement->GetRideIndex(); - auto rideTile = GetRide(id); - - // Ride ID - auto ft = Formatter(); - ft.Add(id); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { colours[1] }); - - // Ride name - if (rideTile != nullptr) + switch (widgetIndex) { - ft = Formatter(); - rideTile->FormatNameTo(ft); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, - { colours[1] }); - } + case WIDX_TRACK_SPINNER_HEIGHT_INCREASE: + if (IsWidgetPressed(WIDX_TRACK_CHECK_APPLY_TO_ALL)) + TrackBlockHeightOffset(windowTileInspectorSelectedIndex, 1); + else + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; - // Ride type. Individual pieces may be of a different ride type from the ride it belongs to. - const auto& rtd = GetRideTypeDescriptor(trackElement->GetRideType()); - ft = Formatter(); - ft.Add(rtd.Naming.Name); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, { colours[1] }); - - // Track - ft = Formatter(); - ft.Add(trackElement->GetTrackType()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { colours[1] }); - - ft = Formatter(); - ft.Add(trackElement->GetSequenceIndex()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { colours[1] }); - if (trackElement->IsStation()) - { - auto stationIndex = trackElement->GetStationIndex(); - ft = Formatter(); - ft.Add(STR_COMMA16); - ft.Add(stationIndex.ToUnderlying()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); - } - else - { - const char* stationNone = "-"; - ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(stationNone); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); - } - - ft = Formatter(); - ft.Add(ColourSchemeNames[trackElement->GetColourScheme()]); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { colours[1] }); - - // Properties - // Raise / lower label - screenCoords.y = windowPos.y + widgets[WIDX_TRACK_SPINNER_HEIGHT].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; - ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + case WIDX_TRACK_SPINNER_HEIGHT_DECREASE: + if (IsWidgetPressed(WIDX_TRACK_CHECK_APPLY_TO_ALL)) + TrackBlockHeightOffset(windowTileInspectorSelectedIndex, -1); + else + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index break; - } case TileElementType::SmallScenery: - { - // Details - // Age - auto ft = Formatter(); - ft.Add(tileElement->AsSmallScenery()->GetAge()); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { colours[1] }); - - // Quadrant value - const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - if (sceneryEntry != nullptr && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) + switch (widgetIndex) { - int16_t quadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant(); - static constexpr StringId _quadrantStringIdx[] = { - STR_TILE_INSPECTOR_SCENERY_QUADRANT_SW, - STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW, - STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE, - STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE, - }; - ft = Formatter(); - ft.Add(_quadrantStringIdx[quadrant]); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, - { colours[1] }); - } + case WIDX_SCENERY_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; - // Scenery ID - ft = Formatter(); - ft.Add(tileElement->AsSmallScenery()->GetEntryIndex()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, { colours[1] }); - - // Properties - // Raise / Lower - screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_SPINNER_HEIGHT].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3; - ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - - // Quarter tile - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_SCENERY_CHECK_QUARTER_E].top }; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, {}, { colours[1] }); - - // Collision - screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_CHECK_COLLISION_E].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_COLLISSION, {}, { colours[1] }); + case WIDX_SCENERY_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index break; - } case TileElementType::Entrance: - { - // Details - // Entrance type - auto ft = Formatter(); - ft.Add(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { colours[1] }); + switch (widgetIndex) + { + case WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) + case WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + + case WIDX_ENTRANCE_BUTTON_MAKE_USABLE: + EntranceMakeUsable(windowTileInspectorSelectedIndex); + break; + } // switch widget index + break; + + case TileElementType::Wall: + switch (widgetIndex) { - // TODO: Make this work with Left/Right park entrance parts - ft = Formatter(); - ft.Add(ParkEntranceGetIndex({ _toolMap, tileElement->GetBaseZ() })); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, - { colours[1] }); - } - else - { - ft = Formatter(); - ft.Add(tileElement->AsEntrance()->GetStationIndex().ToUnderlying()); - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) + case WIDX_WALL_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; + + case WIDX_WALL_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + + case WIDX_WALL_DROPDOWN_SLOPE_BUTTON: { - // Ride entrance ID + Widget* widget = &widgets[widgetIndex]; + // Use dropdown instead of dropdown button + widget--; + // Fill dropdown list + gDropdownItems[0].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[1].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[2].Format = STR_DROPDOWN_MENU_LABEL; + gDropdownItems[0].Args = STR_TILE_INSPECTOR_WALL_FLAT; + gDropdownItems[1].Args = STR_TILE_INSPECTOR_WALL_SLOPED_LEFT; + gDropdownItems[2].Args = STR_TILE_INSPECTOR_WALL_SLOPED_RIGHT; + WindowDropdownShowTextCustomWidth( + { windowPos.x + widget->left, windowPos.y + widget->top }, widget->height() + 1, colours[1], 0, + Dropdown::Flag::StayOpen, 3, widget->width() - 3); + + // Set current value as checked + Dropdown::SetChecked(tileElement->AsWall()->GetSlope(), true); + break; + } + + case WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE: + WallAnimationFrameOffset(windowTileInspectorSelectedIndex, 1); + break; + + case WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE: + WallAnimationFrameOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index + break; + + case TileElementType::LargeScenery: + switch (widgetIndex) + { + case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; + + case WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index + break; + + case TileElementType::Banner: + switch (widgetIndex) + { + case WIDX_BANNER_SPINNER_HEIGHT_INCREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, 1); + break; + + case WIDX_BANNER_SPINNER_HEIGHT_DECREASE: + BaseHeightOffset(windowTileInspectorSelectedIndex, -1); + break; + } // switch widget index + break; + + default: + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex) override + { + if (dropdownIndex == -1) + return; + // Get selected element + const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); + if (tileInspectorPage == TileInspectorPage::Wall) + { + Guard::Assert(tileElement->GetType() == TileElementType::Wall, "Element is not a wall"); + if (widgetIndex == WIDX_WALL_DROPDOWN_SLOPE_BUTTON) + WallSetSlope(windowTileInspectorSelectedIndex, dropdownIndex); + } + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + MapInvalidateSelectionRect(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + + CoordsXY mapCoords; + TileElement* clickedElement = nullptr; + bool mouseOnViewport = false; + if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z)) + { + auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionFlags); + clickedElement = info.Element; + mapCoords = info.Loc; + } + // Even if Ctrl was pressed, fall back to normal selection when there was nothing under the cursor + if (clickedElement == nullptr) + { + auto mouseCoords = ScreenPosToMapPos(screenCoords, nullptr); + if (mouseCoords.has_value()) + { + mouseOnViewport = true; + mapCoords = mouseCoords.value(); + } + } + if (mouseOnViewport) + gMapSelectPositionA = gMapSelectPositionB = mapCoords; + else if (_tileSelected) + gMapSelectPositionA = gMapSelectPositionB = _toolMap; + else + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + + gMapSelectType = MAP_SELECT_TYPE_FULL; + MapInvalidateSelectionRect(); + } + + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + UpdateSelectedTile(screenCoords); + } + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + UpdateSelectedTile(screenCoords); + } + + ScreenSize OnScrollGetSize(int32_t scrollIndex) override + { + return ScreenSize(WW - 30, windowTileInspectorElementCount * SCROLLABLE_ROW_HEIGHT); + } + + void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + // There is nothing to interact with when no tile is selected + if (!_tileSelected) + return; + + // Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements + const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1; + const ScreenRect checkboxColumnRect{ { 2, 0 }, { 15, screenCoords.y } }; + if (index >= 0 && checkboxColumnRect.Contains(screenCoords)) + { // Checkbox was clicked + ToggleInvisibility(index); + } + else + { + SelectElementFromList(index); + } + } + + void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1; + if (index < 0 || index >= windowTileInspectorElementCount) + _highlightedIndex = -1; + else + _highlightedIndex = index; + InvalidateWidget(WIDX_LIST); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + ScreenCoordsXY screenCoords(windowPos.x, windowPos.y); + + // Draw coordinates + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(5, 24), "X:", { colours[1] }); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(74, 24), "Y:", { colours[1] }); + if (_tileSelected) + { + auto tileCoords = TileCoordsXY{ _toolMap }; + auto ft = Formatter(); + ft.Add(tileCoords.x); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 43, 24 }, STR_FORMAT_INTEGER, ft, { colours[1], TextAlignment::RIGHT }); + ft = Formatter(); + ft.Add(tileCoords.y); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 113, 24 }, STR_FORMAT_INTEGER, ft, + { colours[1], TextAlignment::RIGHT }); + } + else + { + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(43 - 7, 24), "-", { colours[1] }); + GfxDrawString(dpi, screenCoords + ScreenCoordsXY(113 - 7, 24), "-", { colours[1] }); + } + + if (windowTileInspectorSelectedIndex != -1) + { + // X and Y of first element in detail box + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_GROUPBOX_DETAILS].top + 14 }; + + // Get map element + const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); + if (tileElement == nullptr) + return; + + switch (tileElement->GetType()) + { + case TileElementType::Surface: + { + // Details + // Terrain texture name + StringId terrainNameId = STR_EMPTY; + auto surfaceStyle = tileElement->AsSurface()->GetSurfaceObject(); + if (surfaceStyle != nullptr) + terrainNameId = surfaceStyle->NameStringId; + auto ft = Formatter(); + ft.Add(terrainNameId); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_TERAIN, ft, { colours[1] }); + + // Edge texture name + StringId terrainEdgeNameId = STR_EMPTY; + auto edgeStyle = tileElement->AsSurface()->GetEdgeObject(); + if (edgeStyle != nullptr) + terrainEdgeNameId = edgeStyle->NameStringId; + ft = Formatter(); + ft.Add(terrainEdgeNameId); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SURFACE_EDGE, ft, { colours[1] }); + + // Land ownership + StringId landOwnership; + if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_OWNED) + landOwnership = STR_LAND_OWNED; + else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_AVAILABLE) + landOwnership = STR_LAND_SALE; + else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_OWNED) + landOwnership = STR_CONSTRUCTION_RIGHTS_OWNED; + else if (tileElement->AsSurface()->GetOwnership() & OWNERSHIP_CONSTRUCTION_RIGHTS_AVAILABLE) + landOwnership = STR_CONSTRUCTION_RIGHTS_SALE; + else + landOwnership = STR_TILE_INSPECTOR_LAND_NOT_OWNED_AND_NOT_AVAILABLE; + + ft = Formatter(); + ft.Add(landOwnership); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SURFACE_OWNERSHIP, ft, + { colours[1] }); + + // Water level + ft = Formatter(); + ft.Add(tileElement->AsSurface()->GetWaterHeight()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_SURFACE_WATER_LEVEL, ft, + { colours[1] }); + + // Properties + // Raise / lower label + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, + widgets[WIDX_SURFACE_SPINNER_HEIGHT].top }; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_SURFACE_SPINNER_HEIGHT].left + 3; + ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + + // Raised corners + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, + widgets[WIDX_SURFACE_CHECK_CORNER_E].top }; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SURFACE_CORNERS, {}, { colours[1] }); + break; + } + case TileElementType::Path: + { + // Details + auto pathEl = tileElement->AsPath(); + auto footpathObj = pathEl->GetLegacyPathEntry(); + if (footpathObj == nullptr) + { + // Surface name + auto surfaceObj = pathEl->GetSurfaceEntry(); + if (surfaceObj != nullptr) + { + auto ft = Formatter(); + ft.Add(surfaceObj->NameStringId); + DrawTextBasic( + dpi, screenCoords, STR_TILE_INSPECTOR_FOOTPATH_SURFACE_NAME, ft, { COLOUR_WHITE }); + } + + // Railings name + auto railingsObj = pathEl->GetRailingsEntry(); + if (railingsObj != nullptr) + { + auto ft = Formatter(); + ft.Add(railingsObj->NameStringId); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_FOOTPATH_RAILINGS_NAME, ft, + { COLOUR_WHITE }); + } + } + else + { + // Legacy path name + auto footpathEntry = reinterpret_cast(footpathObj->GetLegacyData()); + auto ft = Formatter(); + ft.Add(footpathEntry->string_idx); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_NAME, ft, { COLOUR_WHITE }); + } + + // Path addition + if (tileElement->AsPath()->HasAddition()) + { + const auto pathAdditionEntry = tileElement->AsPath()->GetAdditionEntry(); + StringId additionNameId = pathAdditionEntry != nullptr + ? pathAdditionEntry->name + : static_cast(STR_UNKNOWN_OBJECT_TYPE); + auto ft = Formatter(); + ft.Add(additionNameId); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS, ft, + { COLOUR_WHITE }); + } + else + { + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 2 * 11 }, STR_TILE_INSPECTOR_PATH_ADDITIONS_NONE, {}, + { COLOUR_WHITE }); + } + + // Properties + // Raise / lower label + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_SPINNER_HEIGHT].top }; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_PATH_SPINNER_HEIGHT].left + 3; + auto ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + + // Path connections + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_PATH_CHECK_EDGE_W].top }; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_PATH_CONNECTED_EDGES, {}, { colours[1] }); + break; + } + + case TileElementType::Track: + { + auto trackElement = tileElement->AsTrack(); + RideId id = trackElement->GetRideIndex(); + auto rideTile = GetRide(id); + + // Ride ID + auto ft = Formatter(); + ft.Add(id); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_TRACK_RIDE_ID, ft, { colours[1] }); + + // Ride name + if (rideTile != nullptr) + { + ft = Formatter(); + rideTile->FormatNameTo(ft); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_TRACK_RIDE_NAME, ft, + { colours[1] }); + } + + // Ride type. Individual pieces may be of a different ride type from the ride it belongs to. + const auto& rtd = GetRideTypeDescriptor(trackElement->GetRideType()); + ft = Formatter(); + ft.Add(rtd.Naming.Name); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_TRACK_RIDE_TYPE, ft, + { colours[1] }); + + // Track + ft = Formatter(); + ft.Add(trackElement->GetTrackType()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_TRACK_PIECE_ID, ft, { colours[1] }); + + ft = Formatter(); + ft.Add(trackElement->GetSequenceIndex()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 44 }, STR_TILE_INSPECTOR_TRACK_SEQUENCE, ft, { colours[1] }); + if (trackElement->IsStation()) + { + auto stationIndex = trackElement->GetStationIndex(); + ft = Formatter(); + ft.Add(STR_COMMA16); + ft.Add(stationIndex.ToUnderlying()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, + { colours[1] }); + } + else + { + const char* stationNone = "-"; + ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(stationNone); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 55 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, + { colours[1] }); + } + + ft = Formatter(); + ft.Add(ColourSchemeNames[trackElement->GetColourScheme()]); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 66 }, STR_TILE_INSPECTOR_COLOUR_SCHEME, ft, { colours[1] }); + + // Properties + // Raise / lower label + screenCoords.y = windowPos.y + widgets[WIDX_TRACK_SPINNER_HEIGHT].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_TRACK_SPINNER_HEIGHT].left + 3; + ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + break; + } + + case TileElementType::SmallScenery: + { + // Details + // Age + auto ft = Formatter(); + ft.Add(tileElement->AsSmallScenery()->GetAge()); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_AGE, ft, { colours[1] }); + + // Quadrant value + const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); + if (sceneryEntry != nullptr && !(sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE))) + { + int16_t quadrant = tileElement->AsSmallScenery()->GetSceneryQuadrant(); + static constexpr StringId _quadrantStringIdx[] = { + STR_TILE_INSPECTOR_SCENERY_QUADRANT_SW, + STR_TILE_INSPECTOR_SCENERY_QUADRANT_NW, + STR_TILE_INSPECTOR_SCENERY_QUADRANT_NE, + STR_TILE_INSPECTOR_SCENERY_QUADRANT_SE, + }; + ft = Formatter(); + ft.Add(_quadrantStringIdx[quadrant]); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_SCENERY_QUADRANT, ft, + { colours[1] }); + } + + // Scenery ID + ft = Formatter(); + ft.Add(tileElement->AsSmallScenery()->GetEntryIndex()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_SCENERY_ENTRY_IDX, ft, + { colours[1] }); + + // Properties + // Raise / Lower + screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_SPINNER_HEIGHT].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_SCENERY_SPINNER_HEIGHT].left + 3; + ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + + // Quarter tile + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, + widgets[WIDX_SCENERY_CHECK_QUARTER_E].top }; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_SCENERY_QUADRANT_LABEL, {}, { colours[1] }); + + // Collision + screenCoords.y = windowPos.y + widgets[WIDX_SCENERY_CHECK_COLLISION_E].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_COLLISSION, {}, { colours[1] }); + break; + } + + case TileElementType::Entrance: + { + // Details + // Entrance type + auto ft = Formatter(); + ft.Add(EntranceTypeStringIds[tileElement->AsEntrance()->GetEntranceType()]); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRANCE_TYPE, ft, { colours[1] }); + + if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) + { + // TODO: Make this work with Left/Right park entrance parts + ft = Formatter(); + ft.Add(ParkEntranceGetIndex({ _toolMap, tileElement->GetBaseZ() })); DrawTextBasic( dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, { colours[1] }); } else { - // Ride exit ID + ft = Formatter(); + ft.Add(tileElement->AsEntrance()->GetStationIndex().ToUnderlying()); + if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_RIDE_ENTRANCE) + { + // Ride entrance ID + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_ENTRANCE_ID, ft, + { colours[1] }); + } + else + { + // Ride exit ID + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft, + { colours[1] }); + } + } + + if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) + { + // Entrance part + ft = Formatter(); + ft.Add(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRANCE_EXIT_ID, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, + { colours[1] }); + } + else + { + // Ride ID + ft = Formatter(); + ft.Add(tileElement->AsEntrance()->GetRideIndex()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, + { colours[1] }); + // Station index + auto stationIndex = tileElement->AsEntrance()->GetStationIndex(); + ft = Formatter(); + ft.Add(STR_COMMA16); + ft.Add(stationIndex.ToUnderlying()); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); } - } - if (tileElement->AsEntrance()->GetEntranceType() == ENTRANCE_TYPE_PARK_ENTRANCE) - { - // Entrance part + // Properties + // Raise / Lower + screenCoords.y = windowPos.y + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3; ft = Formatter(); - ft.Add(ParkEntrancePartStringIds[tileElement->AsEntrance()->GetSequenceIndex()]); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_PART, ft, { colours[1] }); - } - else - { - // Ride ID - ft = Formatter(); - ft.Add(tileElement->AsEntrance()->GetRideIndex()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRANCE_RIDE_ID, ft, - { colours[1] }); - // Station index - auto stationIndex = tileElement->AsEntrance()->GetStationIndex(); - ft = Formatter(); - ft.Add(STR_COMMA16); - ft.Add(stationIndex.ToUnderlying()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 33 }, STR_TILE_INSPECTOR_STATION_INDEX, ft, { colours[1] }); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + break; } - // Properties - // Raise / Lower - screenCoords.y = windowPos.y + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].left + 3; - ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - break; - } - - case TileElementType::Wall: - { - // Details - // Type - auto ft = Formatter(); - ft.Add(tileElement->AsWall()->GetEntryIndex()); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { colours[1] }); - - // Banner info - auto banner = tileElement->AsWall()->GetBanner(); - if (banner != nullptr) + case TileElementType::Wall: { - ft = Formatter(); - banner->FormatTextTo(ft); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, - { colours[1] }); - } - else - { - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, - { colours[1] }); - } + // Details + // Type + auto ft = Formatter(); + ft.Add(tileElement->AsWall()->GetEntryIndex()); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_TYPE, ft, { colours[1] }); - // Properties - // Raise / lower label - screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_HEIGHT].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3; - ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - - // Slope label - screenCoords = windowPos - + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_WALL_DROPDOWN_SLOPE].top }; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_SLOPE, {}, { colours[1] }); - - // Animation frame label - screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, {}, { colours[1] }); - - // Current animation frame - colour_t colour = colours[1]; - if (IsWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME)) - { - colour = colours[0] | COLOUR_FLAG_INSET; - } - screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3; - ft = Formatter(); - ft.Add(tileElement->AsWall()->GetAnimationFrame()); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour }); - break; - } - - case TileElementType::LargeScenery: - { - // Details - // Type - auto sceneryElement = tileElement->AsLargeScenery(); - ObjectEntryIndex largeSceneryType = sceneryElement->GetEntryIndex(); - auto ft = Formatter(); - ft.Add(largeSceneryType); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { colours[1] }); - - // Part ID - ft = Formatter(); - ft.Add(sceneryElement->GetSequenceIndex()); - DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft, - { colours[1] }); - - // Banner info - auto* largeSceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(largeSceneryType); - if (largeSceneryEntry != nullptr && largeSceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) - { - auto banner = sceneryElement->GetBanner(); + // Banner info + auto banner = tileElement->AsWall()->GetBanner(); if (banner != nullptr) { ft = Formatter(); banner->FormatTextTo(ft); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); } + else + { + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, + { colours[1] }); + } + + // Properties + // Raise / lower label + screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_HEIGHT].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_HEIGHT].left + 3; + ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + + // Slope label + screenCoords = windowPos + + ScreenCoordsXY{ widgets[WIDX_GROUPBOX_DETAILS].left + 7, widgets[WIDX_WALL_DROPDOWN_SLOPE].top }; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_SLOPE, {}, { colours[1] }); + + // Animation frame label + screenCoords.y = windowPos.y + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_WALL_ANIMATION_FRAME, {}, { colours[1] }); + + // Current animation frame + colour_t colour = colours[1]; + if (IsWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME)) + { + colour = colours[0] | COLOUR_FLAG_INSET; + } + screenCoords.x = windowPos.x + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].left + 3; + ft = Formatter(); + ft.Add(tileElement->AsWall()->GetAnimationFrame()); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colour }); + break; } - else + + case TileElementType::LargeScenery: { + // Details + // Type + auto sceneryElement = tileElement->AsLargeScenery(); + ObjectEntryIndex largeSceneryType = sceneryElement->GetEntryIndex(); + auto ft = Formatter(); + ft.Add(largeSceneryType); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_LARGE_SCENERY_TYPE, ft, { colours[1] }); + + // Part ID + ft = Formatter(); + ft.Add(sceneryElement->GetSequenceIndex()); DrawTextBasic( - dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, + dpi, screenCoords + ScreenCoordsXY{ 0, 11 }, STR_TILE_INSPECTOR_LARGE_SCENERY_PIECE_ID, ft, { colours[1] }); + + // Banner info + auto* largeSceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(largeSceneryType); + if (largeSceneryEntry != nullptr && largeSceneryEntry->scrolling_mode != SCROLLING_MODE_NONE) + { + auto banner = sceneryElement->GetBanner(); + if (banner != nullptr) + { + ft = Formatter(); + banner->FormatTextTo(ft); + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, + { colours[1] }); + } + } + else + { + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ 0, 22 }, STR_TILE_INSPECTOR_ENTRY_BANNER_NONE, {}, + { colours[1] }); + } + + // Properties + // Raise / lower label + screenCoords.y = windowPos.y + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3; + ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + break; } - // Properties - // Raise / lower label - screenCoords.y = windowPos.y + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].left + 3; - ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - break; - } - - case TileElementType::Banner: - { - // Details - // Banner info - auto banner = tileElement->AsBanner()->GetBanner(); - if (banner != nullptr) + case TileElementType::Banner: { - Formatter ft; - banner->FormatTextTo(ft); - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); + // Details + // Banner info + auto banner = tileElement->AsBanner()->GetBanner(); + if (banner != nullptr) + { + Formatter ft; + banner->FormatTextTo(ft); + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_ENTRY_BANNER_TEXT, ft, { colours[1] }); + } + + // Properties + // Raise / lower label + screenCoords.y = windowPos.y + widgets[WIDX_BANNER_SPINNER_HEIGHT].top; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); + + // Current base height + screenCoords.x = windowPos.x + widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3; + auto ft = Formatter(); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); + + // Blocked paths + screenCoords.y += 28; + screenCoords.x = windowPos.x + widgets[WIDX_GROUPBOX_DETAILS].left + 7; + DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, {}, { colours[1] }); + break; } - // Properties - // Raise / lower label - screenCoords.y = windowPos.y + widgets[WIDX_BANNER_SPINNER_HEIGHT].top; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BASE_HEIGHT_FULL, {}, { colours[1] }); - - // Current base height - screenCoords.x = windowPos.x + widgets[WIDX_BANNER_SPINNER_HEIGHT].left + 3; - auto ft = Formatter(); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { colours[1] }); - - // Blocked paths - screenCoords.y += 28; - screenCoords.x = windowPos.x + widgets[WIDX_GROUPBOX_DETAILS].left + 7; - DrawTextBasic(dpi, screenCoords, STR_TILE_INSPECTOR_BANNER_BLOCKED_PATHS, {}, { colours[1] }); - break; + default: + break; } - - default: - break; } } - } - void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override - { - const int32_t listWidth = widgets[WIDX_LIST].width(); - GfxFillRect( - dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - - // Show usage hint when nothing is selected - if (!_tileSelected) + void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - auto& listWidget = widgets[WIDX_LIST]; - auto centrePos = ScreenCoordsXY{ listWidget.width() / 2, - (listWidget.height() - FontGetLineHeight(FontStyle::Medium)) / 2 }; - auto ft = Formatter{}; - auto textPaint = TextPaint{ colours[1], TextAlignment::CENTRE }; - DrawTextWrapped(dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint); - return; - } + const int32_t listWidth = widgets[WIDX_LIST].width(); + GfxFillRect( + dpi, { { dpi.x, dpi.y }, { dpi.x + dpi.width - 1, dpi.y + dpi.height - 1 } }, ColourMapA[colours[1]].mid_light); - ScreenCoordsXY screenCoords{}; - screenCoords.y = SCROLLABLE_ROW_HEIGHT * (windowTileInspectorElementCount - 1); - int32_t i = 0; - char buffer[256]; - - const TileElement* tileElement = MapGetFirstElementAt(_toolMap); - - do - { - if (tileElement == nullptr) - break; - - const bool selectedRow = i == windowTileInspectorSelectedIndex; - const bool hoveredRow = i == _highlightedIndex; - const char* typeName = ""; - - // Draw row background colour - auto fillRectangle = ScreenRect{ { 0, screenCoords.y }, { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }; - if (selectedRow) - GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); - else if (hoveredRow) - GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark | 0x1000000); - // Zebra stripes - else if (((windowTileInspectorElementCount - i) & 1) == 0) - GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].light | 0x1000000); - - const StringId stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; - auto checkboxFormatter = Formatter(); - checkboxFormatter.Add(STR_STRING); - checkboxFormatter.Add(CheckBoxMarkString); - - // Draw checkbox and check if visible - GfxFillRectInset(dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0); - if (!tileElement->IsInvisible()) + // Show usage hint when nothing is selected + if (!_tileSelected) { - auto eyeFormatter = Formatter(); - eyeFormatter.Add(STR_STRING); - eyeFormatter.Add(EyeString); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter); + auto& listWidget = widgets[WIDX_LIST]; + auto centrePos = ScreenCoordsXY{ listWidget.width() / 2, + (listWidget.height() - FontGetLineHeight(FontStyle::Medium)) / 2 }; + auto ft = Formatter{}; + auto textPaint = TextPaint{ colours[1], TextAlignment::CENTRE }; + DrawTextWrapped(dpi, centrePos, listWidth, STR_TILE_INSPECTOR_SELECT_TILE_HINT, ft, textPaint); + return; } - const auto type = tileElement->GetType(); - switch (type) + ScreenCoordsXY screenCoords{}; + screenCoords.y = SCROLLABLE_ROW_HEIGHT * (windowTileInspectorElementCount - 1); + int32_t i = 0; + char buffer[256]; + + const TileElement* tileElement = MapGetFirstElementAt(_toolMap); + + do { - case TileElementType::Surface: - typeName = LanguageGetString(STR_TILE_INSPECTOR_SURFACE); + if (tileElement == nullptr) break; - case TileElementType::Path: - typeName = tileElement->AsPath()->IsQueue() ? LanguageGetString(STR_QUEUE_LINE_MAP_TIP) - : LanguageGetString(STR_FOOTPATH_MAP_TIP); - break; + const bool selectedRow = i == windowTileInspectorSelectedIndex; + const bool hoveredRow = i == _highlightedIndex; + const char* typeName = ""; - case TileElementType::Track: - typeName = LanguageGetString(STR_RIDE_COMPONENT_TRACK_CAPITALISED); - break; + // Draw row background colour + auto fillRectangle = ScreenRect{ { 0, screenCoords.y }, + { listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }; + if (selectedRow) + GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark); + else if (hoveredRow) + GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark | 0x1000000); + // Zebra stripes + else if (((windowTileInspectorElementCount - i) & 1) == 0) + GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].light | 0x1000000); - case TileElementType::SmallScenery: + const StringId stringFormat = (selectedRow || hoveredRow) ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; + auto checkboxFormatter = Formatter(); + checkboxFormatter.Add(STR_STRING); + checkboxFormatter.Add(CheckBoxMarkString); + + // Draw checkbox and check if visible + GfxFillRectInset(dpi, { { 2, screenCoords.y }, { 15, screenCoords.y + 11 } }, colours[1], INSET_RECT_F_E0); + if (!tileElement->IsInvisible()) { - const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); - snprintf( - buffer, sizeof(buffer), "%s (%s)", LanguageGetString(STR_OBJECT_SELECTION_SMALL_SCENERY), - sceneryEntry != nullptr ? LanguageGetString(sceneryEntry->name) : ""); - typeName = buffer; - break; + auto eyeFormatter = Formatter(); + eyeFormatter.Add(STR_STRING); + eyeFormatter.Add(EyeString); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 2, 1 }, stringFormat, eyeFormatter); } - case TileElementType::Entrance: - typeName = LanguageGetString(STR_RIDE_CONSTRUCTION_ENTRANCE); - break; - - case TileElementType::Wall: + const auto type = tileElement->GetType(); + switch (type) { - const auto* entry = tileElement->AsWall()->GetEntry(); - snprintf( - buffer, sizeof(buffer), "%s (%s)", LanguageGetString(STR_TILE_INSPECTOR_WALL), - entry != nullptr ? LanguageGetString(entry->name) : ""); - typeName = buffer; - break; + case TileElementType::Surface: + typeName = LanguageGetString(STR_TILE_INSPECTOR_SURFACE); + break; + + case TileElementType::Path: + typeName = tileElement->AsPath()->IsQueue() ? LanguageGetString(STR_QUEUE_LINE_MAP_TIP) + : LanguageGetString(STR_FOOTPATH_MAP_TIP); + break; + + case TileElementType::Track: + typeName = LanguageGetString(STR_RIDE_COMPONENT_TRACK_CAPITALISED); + break; + + case TileElementType::SmallScenery: + { + const auto* sceneryEntry = tileElement->AsSmallScenery()->GetEntry(); + snprintf( + buffer, sizeof(buffer), "%s (%s)", LanguageGetString(STR_OBJECT_SELECTION_SMALL_SCENERY), + sceneryEntry != nullptr ? LanguageGetString(sceneryEntry->name) : ""); + typeName = buffer; + break; + } + + case TileElementType::Entrance: + typeName = LanguageGetString(STR_RIDE_CONSTRUCTION_ENTRANCE); + break; + + case TileElementType::Wall: + { + const auto* entry = tileElement->AsWall()->GetEntry(); + snprintf( + buffer, sizeof(buffer), "%s (%s)", LanguageGetString(STR_TILE_INSPECTOR_WALL), + entry != nullptr ? LanguageGetString(entry->name) : ""); + typeName = buffer; + break; + } + + case TileElementType::LargeScenery: + typeName = LanguageGetString(STR_OBJECT_SELECTION_LARGE_SCENERY); + break; + + case TileElementType::Banner: + snprintf( + buffer, sizeof(buffer), "%s (%u)", LanguageGetString(STR_BANNER_WINDOW_TITLE), + tileElement->AsBanner()->GetIndex().ToUnderlying()); + typeName = buffer; + break; + + default: + snprintf( + buffer, sizeof(buffer), "%s (%d)", LanguageGetString(STR_UNKNOWN_OBJECT_TYPE), EnumValue(type)); + typeName = buffer; } - case TileElementType::LargeScenery: - typeName = LanguageGetString(STR_OBJECT_SELECTION_LARGE_SCENERY); - break; + const int32_t clearanceHeight = tileElement->ClearanceHeight; + const bool ghost = tileElement->IsGhost(); + const bool last = tileElement->IsLastForTile(); - case TileElementType::Banner: - snprintf( - buffer, sizeof(buffer), "%s (%u)", LanguageGetString(STR_BANNER_WINDOW_TITLE), - tileElement->AsBanner()->GetIndex().ToUnderlying()); - typeName = buffer; - break; + // Element name + auto ft = Formatter(); + ft.Add(STR_STRING); + ft.Add(typeName); + DrawTextEllipsised( + dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft); - default: - snprintf(buffer, sizeof(buffer), "%s (%d)", LanguageGetString(STR_UNKNOWN_OBJECT_TYPE), EnumValue(type)); - typeName = buffer; + // Base height + ft = Formatter(); + ft.Add(STR_FORMAT_INTEGER); + ft.Add(tileElement->BaseHeight); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft); + + // Clearance height + ft = Formatter(); + ft.Add(STR_FORMAT_INTEGER); + ft.Add(clearanceHeight); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft); + + // Direction + ft = Formatter(); + ft.Add(STR_FORMAT_INTEGER); + ft.Add(tileElement->GetDirection()); + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft); + + // Checkmarks for ghost and last for tile + if (ghost) + DrawTextBasic( + dpi, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); + if (last) + DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); + + screenCoords.y -= SCROLLABLE_ROW_HEIGHT; + i++; + } while (!(tileElement++)->IsLastForTile()); + } + + void ClearClipboard() + { + _elementCopied = false; + } + + void ToggleInvisibility() + { + if (windowTileInspectorSelectedIndex >= 0 && windowTileInspectorSelectedIndex < windowTileInspectorElementCount) + { + ToggleInvisibility(windowTileInspectorSelectedIndex); } - - const int32_t clearanceHeight = tileElement->ClearanceHeight; - const bool ghost = tileElement->IsGhost(); - const bool last = tileElement->IsLastForTile(); - - // Element name - auto ft = Formatter(); - ft.Add(STR_STRING); - ft.Add(typeName); - DrawTextEllipsised(dpi, screenCoords + ScreenCoordsXY{ TypeColumnXY.x, 0 }, TypeColumnSize.width, stringFormat, ft); - - // Base height - ft = Formatter(); - ft.Add(STR_FORMAT_INTEGER); - ft.Add(tileElement->BaseHeight); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ BaseHeightColumnXY.x, 0 }, stringFormat, ft); - - // Clearance height - ft = Formatter(); - ft.Add(STR_FORMAT_INTEGER); - ft.Add(clearanceHeight); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ ClearanceHeightColumnXY.x, 0 }, stringFormat, ft); - - // Direction - ft = Formatter(); - ft.Add(STR_FORMAT_INTEGER); - ft.Add(tileElement->GetDirection()); - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ DirectionColumnXY.x, 0 }, stringFormat, ft); - - // Checkmarks for ghost and last for tile - if (ghost) - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ GhostFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); - if (last) - DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter); - - screenCoords.y -= SCROLLABLE_ROW_HEIGHT; - i++; - } while (!(tileElement++)->IsLastForTile()); - } - - void ClearClipboard() - { - _elementCopied = false; - } - - void ToggleInvisibility() - { - if (windowTileInspectorSelectedIndex >= 0 && windowTileInspectorSelectedIndex < windowTileInspectorElementCount) - { - ToggleInvisibility(windowTileInspectorSelectedIndex); - } - } - -private: - void SetPage(const TileInspectorPage p) - { - Invalidate(); - // subtract current page height, then add new page height - if (tileInspectorPage != TileInspectorPage::Default) - { - auto index = EnumValue(tileInspectorPage) - 1; - height -= PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; - min_height -= PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; - } - if (p != TileInspectorPage::Default) - { - auto index = EnumValue(p) - 1; - height += PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; - min_height += PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; - } - tileInspectorPage = p; - auto pageIndex = EnumValue(p); - widgets = PageWidgets[pageIndex]; - hold_down_widgets = PageHoldDownWidgets[pageIndex]; - disabled_widgets = PageDisabledWidgets[pageIndex]; - pressed_widgets = 0; - Invalidate(); - } - - void UpdateSelectedTile(const ScreenCoordsXY& screenCoords) - { - const bool ctrlIsHeldDown = InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z); - // Mouse hasn't moved - if (screenCoords.x == _toolMouseX && screenCoords.y == _toolMouseY && _toolCtrlDown == ctrlIsHeldDown) - return; - - _toolMouseX = screenCoords.x; - _toolMouseY = screenCoords.y; - _toolCtrlDown = ctrlIsHeldDown; - - CoordsXY mapCoords{}; - TileElement* clickedElement = nullptr; - if (ctrlIsHeldDown) - { - auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionFlags); - clickedElement = info.Element; - mapCoords = info.Loc; } - // Even if Ctrl was pressed, fall back to normal selection when there was nothing under the cursor - if (clickedElement == nullptr) + private: + void SetPage(const TileInspectorPage p) { - auto mouseCoords = ScreenPosToMapPos(screenCoords, nullptr); - if (!mouseCoords.has_value()) + Invalidate(); + // subtract current page height, then add new page height + if (tileInspectorPage != TileInspectorPage::Default) + { + auto index = EnumValue(tileInspectorPage) - 1; + height -= PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; + min_height -= PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; + } + if (p != TileInspectorPage::Default) + { + auto index = EnumValue(p) - 1; + height += PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; + min_height += PageGroupBoxSettings[index].details_top_offset - GROUPBOX_PADDING - 3; + } + tileInspectorPage = p; + auto pageIndex = EnumValue(p); + widgets = PageWidgets[pageIndex]; + hold_down_widgets = PageHoldDownWidgets[pageIndex]; + disabled_widgets = PageDisabledWidgets[pageIndex]; + pressed_widgets = 0; + Invalidate(); + } + + void UpdateSelectedTile(const ScreenCoordsXY& screenCoords) + { + const bool ctrlIsHeldDown = InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z); + // Mouse hasn't moved + if (screenCoords.x == _toolMouseX && screenCoords.y == _toolMouseY && _toolCtrlDown == ctrlIsHeldDown) return; - mapCoords = mouseCoords.value(); - // Tile is already selected - if (_tileSelected && mapCoords.x == _toolMap.x && mapCoords.y == _toolMap.y) - return; + _toolMouseX = screenCoords.x; + _toolMouseY = screenCoords.y; + _toolCtrlDown = ctrlIsHeldDown; + + CoordsXY mapCoords{}; + TileElement* clickedElement = nullptr; + if (ctrlIsHeldDown) + { + auto info = GetMapCoordinatesFromPos(screenCoords, ViewportInteractionFlags); + clickedElement = info.Element; + mapCoords = info.Loc; + } + + // Even if Ctrl was pressed, fall back to normal selection when there was nothing under the cursor + if (clickedElement == nullptr) + { + auto mouseCoords = ScreenPosToMapPos(screenCoords, nullptr); + if (!mouseCoords.has_value()) + return; + + mapCoords = mouseCoords.value(); + // Tile is already selected + if (_tileSelected && mapCoords.x == _toolMap.x && mapCoords.y == _toolMap.y) + return; + } + + // Invalidate the previous selection + if (auto* elem = OpenRCT2::TileInspector::GetSelectedElement(); elem != nullptr) + { + MapInvalidateElement(windowTileInspectorTile.ToCoordsXY(), elem); + } + + _tileSelected = true; + _toolMap = mapCoords; + windowTileInspectorTile = TileCoordsXY(mapCoords); + LoadTile(clickedElement); } - // Invalidate the previous selection - if (auto* elem = OpenRCT2::TileInspector::GetSelectedElement(); elem != nullptr) + void SelectElementFromList(int32_t index) { - MapInvalidateElement(windowTileInspectorTile.ToCoordsXY(), elem); + if (index < 0 || index >= windowTileInspectorElementCount) + { + windowTileInspectorSelectedIndex = -1; + } + else + { + windowTileInspectorSelectedIndex = index; + } + Invalidate(); } - _tileSelected = true; - _toolMap = mapCoords; - windowTileInspectorTile = TileCoordsXY(mapCoords); - LoadTile(clickedElement); - } - - void SelectElementFromList(int32_t index) - { - if (index < 0 || index >= windowTileInspectorElementCount) + void LoadTile(TileElement* elementToSelect) { windowTileInspectorSelectedIndex = -1; + scrolls[0].v_top = 0; + + TileElement* element = MapGetFirstElementAt(_toolMap); + int16_t numItems = 0; + do + { + if (element == nullptr) + break; + if (element == elementToSelect) + windowTileInspectorSelectedIndex = numItems; + + numItems++; + } while (!(element++)->IsLastForTile()); + windowTileInspectorElementCount = numItems; + Invalidate(); } - else + + void RemoveElement(int32_t elementIndex) { - windowTileInspectorSelectedIndex = index; + Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyRemove, elementIndex); + GameActions::Execute(&modifyTile); } - Invalidate(); - } - void LoadTile(TileElement* elementToSelect) - { - windowTileInspectorSelectedIndex = -1; - scrolls[0].v_top = 0; - - TileElement* element = MapGetFirstElementAt(_toolMap); - int16_t numItems = 0; - do + void RotateElement(int32_t elementIndex) { - if (element == nullptr) - break; - if (element == elementToSelect) - windowTileInspectorSelectedIndex = numItems; - - numItems++; - } while (!(element++)->IsLastForTile()); - windowTileInspectorElementCount = numItems; - Invalidate(); - } - - void RemoveElement(int32_t elementIndex) - { - Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyRemove, elementIndex); - GameActions::Execute(&modifyTile); - } - - void RotateElement(int32_t elementIndex) - { - Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyRotate, elementIndex); - GameActions::Execute(&modifyTile); - } - - // Swap element with its parent - void SwapElements(int16_t first, int16_t second) - { - bool firstInRange = first >= 0 && first < windowTileInspectorElementCount; - bool secondInRange = second >= 0 && second < windowTileInspectorElementCount; - // This might happen if two people are modifying the same tile. - if (!firstInRange || !secondInRange) - return; - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnySwap, first, second); - GameActions::Execute(&modifyTile); - } - - void SortElements() - { - Guard::Assert(_tileSelected, "No tile selected"); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnySort); - GameActions::Execute(&modifyTile); - } - - void CopyElement() - { - const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); - Guard::Assert(tileElement != nullptr, "Invalid tile element"); - // Copy value, in case the element gets moved - _copiedElement = *tileElement; - _copiedBanner = {}; - auto bannerIndex = _copiedElement.GetBannerIndex(); - if (bannerIndex != BannerIndex::GetNull()) - { - auto banner = GetBanner(bannerIndex); - if (banner != nullptr) - _copiedBanner = *banner; + Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyRotate, elementIndex); + GameActions::Execute(&modifyTile); } - _elementCopied = true; - Invalidate(); - } - void PasteElement() - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyPaste, 0, 0, _copiedElement, _copiedBanner); - GameActions::Execute(&modifyTile); - } - - void BaseHeightOffset(int16_t elementIndex, int8_t heightOffset) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyBaseHeightOffset, elementIndex, heightOffset); - GameActions::Execute(&modifyTile); - } - - void SurfaceShowParkFences(bool showFences) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::SurfaceShowParkFences, showFences); - GameActions::Execute(&modifyTile); - } - - void SurfaceToggleCorner(int32_t cornerIndex) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::SurfaceToggleCorner, cornerIndex); - GameActions::Execute(&modifyTile); - } - - void SurfaceToggleDiagonal() - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::SurfaceToggleDiagonal); - GameActions::Execute(&modifyTile); - } - - void PathSetSloped(int32_t elementIndex, bool sloped) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::PathSetSlope, elementIndex, sloped); - GameActions::Execute(&modifyTile); - } - - void PathSetJunctionRailings(int32_t elementIndex, bool hasJunctionRailings) - { - auto modifyTile = TileModifyAction( - _toolMap, TileModifyType::PathSetJunctionRailings, elementIndex, hasJunctionRailings); - GameActions::Execute(&modifyTile); - } - - void PathSetBroken(int32_t elementIndex, bool broken) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::PathSetBroken, elementIndex, broken); - GameActions::Execute(&modifyTile); - } - - void PathToggleEdge(int32_t elementIndex, int32_t cornerIndex) - { - Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); - Guard::Assert(cornerIndex >= 0 && cornerIndex < 8, "cornerIndex out of range"); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::PathToggleEdge, elementIndex, cornerIndex); - GameActions::Execute(&modifyTile); - } - - void EntranceMakeUsable(int32_t elementIndex) - { - Guard::ArgumentInRange(elementIndex, 0, windowTileInspectorElementCount - 1); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::EntranceMakeUsable, elementIndex); - GameActions::Execute(&modifyTile); - } - - void WallSetSlope(int32_t elementIndex, int32_t slopeValue) - { - // Make sure only the correct bits are set - Guard::Assert((slopeValue & 3) == slopeValue, "slopeValue doesn't match its mask"); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::WallSetSlope, elementIndex, slopeValue); - GameActions::Execute(&modifyTile); - } - - void WallAnimationFrameOffset(int16_t elementIndex, int8_t animationFrameOffset) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::WallSetAnimationFrame, elementIndex, animationFrameOffset); - GameActions::Execute(&modifyTile); - } - - void TrackBlockHeightOffset(int32_t elementIndex, int8_t heightOffset) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackBaseHeightOffset, elementIndex, heightOffset); - GameActions::Execute(&modifyTile); - } - - void TrackBlockSetLift(int32_t elementIndex, bool entireTrackBlock, bool chain) - { - auto modifyTile = TileModifyAction( - _toolMap, entireTrackBlock ? TileModifyType::TrackSetChainBlock : TileModifyType::TrackSetChain, elementIndex, - chain); - GameActions::Execute(&modifyTile); - } - - void TrackSetBrakeClosed(int32_t elementIndex, bool isClosed) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackSetBrake, elementIndex, isClosed); - GameActions::Execute(&modifyTile); - } - - void TrackSetIndestructible(int32_t elementIndex, bool isIndestructible) - { - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackSetIndestructible, elementIndex, isIndestructible); - GameActions::Execute(&modifyTile); - } - - void QuarterTileSet(int32_t elementIndex, const int32_t quarterIndex) - { - // quarterIndex is widget index relative to WIDX_SCENERY_CHECK_QUARTER_N, so a value from 0-3 - Guard::Assert(quarterIndex >= 0 && quarterIndex < 4, "quarterIndex out of range"); - auto modifyTile = TileModifyAction( - _toolMap, TileModifyType::ScenerySetQuarterLocation, elementIndex, (quarterIndex - GetCurrentRotation()) & 3); - GameActions::Execute(&modifyTile); - } - - // ToggleQuadrantCollision? - void ToggleQuadrantCollosion(int32_t elementIndex, const int32_t quadrantIndex) - { - auto modifyTile = TileModifyAction( - _toolMap, TileModifyType::ScenerySetQuarterCollision, elementIndex, (quadrantIndex + 2 - GetCurrentRotation()) & 3); - GameActions::Execute(&modifyTile); - } - - void BannerToggleBlock(int32_t elementIndex, int32_t edgeIndex) - { - Guard::Assert(edgeIndex >= 0 && edgeIndex < 4, "edgeIndex out of range"); - // Make edgeIndex abstract - edgeIndex = (edgeIndex - GetCurrentRotation()) & 3; - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::BannerToggleBlockingEdge, elementIndex, edgeIndex); - GameActions::Execute(&modifyTile); - } - - void ToggleInvisibility(int32_t elementIndex) - { - Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); - auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyToggleInvisilibity, elementIndex); - GameActions::Execute(&modifyTile); - } - - void OnPrepareDraw() override - { - const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); - - // Set the correct page automatically - TileInspectorPage p = TileInspectorPage::Default; - if (tileElement != nullptr) + // Swap element with its parent + void SwapElements(int16_t first, int16_t second) { + bool firstInRange = first >= 0 && first < windowTileInspectorElementCount; + bool secondInRange = second >= 0 && second < windowTileInspectorElementCount; + // This might happen if two people are modifying the same tile. + if (!firstInRange || !secondInRange) + return; + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnySwap, first, second); + GameActions::Execute(&modifyTile); + } + + void SortElements() + { + Guard::Assert(_tileSelected, "No tile selected"); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnySort); + GameActions::Execute(&modifyTile); + } + + void CopyElement() + { + const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); + Guard::Assert(tileElement != nullptr, "Invalid tile element"); + // Copy value, in case the element gets moved + _copiedElement = *tileElement; + _copiedBanner = {}; + auto bannerIndex = _copiedElement.GetBannerIndex(); + if (bannerIndex != BannerIndex::GetNull()) + { + auto banner = GetBanner(bannerIndex); + if (banner != nullptr) + _copiedBanner = *banner; + } + _elementCopied = true; + Invalidate(); + } + + void PasteElement() + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyPaste, 0, 0, _copiedElement, _copiedBanner); + GameActions::Execute(&modifyTile); + } + + void BaseHeightOffset(int16_t elementIndex, int8_t heightOffset) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyBaseHeightOffset, elementIndex, heightOffset); + GameActions::Execute(&modifyTile); + } + + void SurfaceShowParkFences(bool showFences) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::SurfaceShowParkFences, showFences); + GameActions::Execute(&modifyTile); + } + + void SurfaceToggleCorner(int32_t cornerIndex) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::SurfaceToggleCorner, cornerIndex); + GameActions::Execute(&modifyTile); + } + + void SurfaceToggleDiagonal() + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::SurfaceToggleDiagonal); + GameActions::Execute(&modifyTile); + } + + void PathSetSloped(int32_t elementIndex, bool sloped) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::PathSetSlope, elementIndex, sloped); + GameActions::Execute(&modifyTile); + } + + void PathSetJunctionRailings(int32_t elementIndex, bool hasJunctionRailings) + { + auto modifyTile = TileModifyAction( + _toolMap, TileModifyType::PathSetJunctionRailings, elementIndex, hasJunctionRailings); + GameActions::Execute(&modifyTile); + } + + void PathSetBroken(int32_t elementIndex, bool broken) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::PathSetBroken, elementIndex, broken); + GameActions::Execute(&modifyTile); + } + + void PathToggleEdge(int32_t elementIndex, int32_t cornerIndex) + { + Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); + Guard::Assert(cornerIndex >= 0 && cornerIndex < 8, "cornerIndex out of range"); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::PathToggleEdge, elementIndex, cornerIndex); + GameActions::Execute(&modifyTile); + } + + void EntranceMakeUsable(int32_t elementIndex) + { + Guard::ArgumentInRange(elementIndex, 0, windowTileInspectorElementCount - 1); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::EntranceMakeUsable, elementIndex); + GameActions::Execute(&modifyTile); + } + + void WallSetSlope(int32_t elementIndex, int32_t slopeValue) + { + // Make sure only the correct bits are set + Guard::Assert((slopeValue & 3) == slopeValue, "slopeValue doesn't match its mask"); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::WallSetSlope, elementIndex, slopeValue); + GameActions::Execute(&modifyTile); + } + + void WallAnimationFrameOffset(int16_t elementIndex, int8_t animationFrameOffset) + { + auto modifyTile = TileModifyAction( + _toolMap, TileModifyType::WallSetAnimationFrame, elementIndex, animationFrameOffset); + GameActions::Execute(&modifyTile); + } + + void TrackBlockHeightOffset(int32_t elementIndex, int8_t heightOffset) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackBaseHeightOffset, elementIndex, heightOffset); + GameActions::Execute(&modifyTile); + } + + void TrackBlockSetLift(int32_t elementIndex, bool entireTrackBlock, bool chain) + { + auto modifyTile = TileModifyAction( + _toolMap, entireTrackBlock ? TileModifyType::TrackSetChainBlock : TileModifyType::TrackSetChain, elementIndex, + chain); + GameActions::Execute(&modifyTile); + } + + void TrackSetBrakeClosed(int32_t elementIndex, bool isClosed) + { + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::TrackSetBrake, elementIndex, isClosed); + GameActions::Execute(&modifyTile); + } + + void TrackSetIndestructible(int32_t elementIndex, bool isIndestructible) + { + auto modifyTile = TileModifyAction( + _toolMap, TileModifyType::TrackSetIndestructible, elementIndex, isIndestructible); + GameActions::Execute(&modifyTile); + } + + void QuarterTileSet(int32_t elementIndex, const int32_t quarterIndex) + { + // quarterIndex is widget index relative to WIDX_SCENERY_CHECK_QUARTER_N, so a value from 0-3 + Guard::Assert(quarterIndex >= 0 && quarterIndex < 4, "quarterIndex out of range"); + auto modifyTile = TileModifyAction( + _toolMap, TileModifyType::ScenerySetQuarterLocation, elementIndex, (quarterIndex - GetCurrentRotation()) & 3); + GameActions::Execute(&modifyTile); + } + + // ToggleQuadrantCollision? + void ToggleQuadrantCollosion(int32_t elementIndex, const int32_t quadrantIndex) + { + auto modifyTile = TileModifyAction( + _toolMap, TileModifyType::ScenerySetQuarterCollision, elementIndex, + (quadrantIndex + 2 - GetCurrentRotation()) & 3); + GameActions::Execute(&modifyTile); + } + + void BannerToggleBlock(int32_t elementIndex, int32_t edgeIndex) + { + Guard::Assert(edgeIndex >= 0 && edgeIndex < 4, "edgeIndex out of range"); + // Make edgeIndex abstract + edgeIndex = (edgeIndex - GetCurrentRotation()) & 3; + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::BannerToggleBlockingEdge, elementIndex, edgeIndex); + GameActions::Execute(&modifyTile); + } + + void ToggleInvisibility(int32_t elementIndex) + { + Guard::Assert(elementIndex >= 0 && elementIndex < windowTileInspectorElementCount, "elementIndex out of range"); + auto modifyTile = TileModifyAction(_toolMap, TileModifyType::AnyToggleInvisilibity, elementIndex); + GameActions::Execute(&modifyTile); + } + + void OnPrepareDraw() override + { + const TileElement* const tileElement = OpenRCT2::TileInspector::GetSelectedElement(); + + // Set the correct page automatically + TileInspectorPage p = TileInspectorPage::Default; + if (tileElement != nullptr) + { + switch (tileElement->GetType()) + { + case TileElementType::Surface: + p = TileInspectorPage::Surface; + break; + + case TileElementType::Path: + p = TileInspectorPage::Path; + break; + + case TileElementType::Track: + p = TileInspectorPage::Track; + break; + + case TileElementType::SmallScenery: + p = TileInspectorPage::Scenery; + break; + + case TileElementType::Entrance: + p = TileInspectorPage::Entrance; + break; + + case TileElementType::Wall: + p = TileInspectorPage::Wall; + break; + + case TileElementType::LargeScenery: + p = TileInspectorPage::LargeScenery; + break; + + case TileElementType::Banner: + p = TileInspectorPage::Banner; + break; + } + } + + if (tileInspectorPage != p) + { + SetPage(p); + Invalidate(); + } + // X and Y spinners + SetWidgetDisabledAndInvalidate( + WIDX_SPINNER_X_INCREASE, !(_tileSelected && ((_toolMap.x / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); + SetWidgetDisabledAndInvalidate(WIDX_SPINNER_X_DECREASE, !(_tileSelected && ((_toolMap.x / 32) > 0))); + SetWidgetDisabledAndInvalidate( + WIDX_SPINNER_Y_INCREASE, !(_tileSelected && ((_toolMap.y / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); + SetWidgetDisabledAndInvalidate(WIDX_SPINNER_Y_DECREASE, !(_tileSelected && ((_toolMap.y / 32) > 0))); + + // Sort buttons + SetWidgetDisabledAndInvalidate(WIDX_BUTTON_SORT, !(_tileSelected && windowTileInspectorElementCount > 1)); + + // Move Up button + SetWidgetDisabledAndInvalidate( + WIDX_BUTTON_MOVE_UP, + !(windowTileInspectorSelectedIndex != -1 + && windowTileInspectorSelectedIndex < windowTileInspectorElementCount - 1)); + + // Move Down button + SetWidgetDisabledAndInvalidate(WIDX_BUTTON_MOVE_DOWN, !(windowTileInspectorSelectedIndex > 0)); + + // Copy button + SetWidgetDisabledAndInvalidate(WIDX_BUTTON_COPY, !(windowTileInspectorSelectedIndex >= 0)); + + // Paste button + SetWidgetDisabledAndInvalidate(WIDX_BUTTON_PASTE, !(_tileSelected && _elementCopied)); + + widgets[WIDX_BACKGROUND].bottom = height - 1; + + if (tileInspectorPage == TileInspectorPage::Default) + { + widgets[WIDX_GROUPBOX_DETAILS].type = WindowWidgetType::Empty; + widgets[WIDX_GROUPBOX_PROPERTIES].type = WindowWidgetType::Empty; + widgets[WIDX_LIST].bottom = height - PADDING_BOTTOM; + } + else + { + widgets[WIDX_GROUPBOX_DETAILS].type = WindowWidgetType::Groupbox; + widgets[WIDX_GROUPBOX_PROPERTIES].type = WindowWidgetType::Groupbox; + auto pageIndex = EnumValue(tileInspectorPage) - 1; + widgets[WIDX_GROUPBOX_DETAILS].text = PageGroupBoxSettings[pageIndex].string_id; + widgets[WIDX_GROUPBOX_DETAILS].top = height - PageGroupBoxSettings[pageIndex].details_top_offset; + widgets[WIDX_GROUPBOX_DETAILS].bottom = height - PageGroupBoxSettings[pageIndex].details_bottom_offset; + widgets[WIDX_GROUPBOX_PROPERTIES].top = height - PageGroupBoxSettings[pageIndex].properties_top_offset; + widgets[WIDX_GROUPBOX_PROPERTIES].bottom = height - PageGroupBoxSettings[pageIndex].properties_bottom_offset; + widgets[WIDX_LIST].bottom = widgets[WIDX_GROUPBOX_DETAILS].top - GROUPBOX_PADDING; + } + + // The default page doesn't need further invalidation + if (tileInspectorPage == TileInspectorPage::Default) + return; + + // Using a switch, because I don't think giving each page their own callbacks is + // needed here, as only the mouseup and invalidate functions are different. + const int32_t propertiesAnchor = widgets[WIDX_GROUPBOX_PROPERTIES].top; + switch (tileElement->GetType()) { case TileElementType::Surface: - p = TileInspectorPage::Surface; + widgets[WIDX_SURFACE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_SURFACE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_SURFACE_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_SURFACE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_SURFACE_BUTTON_REMOVE_FENCES].top = GBBT(propertiesAnchor, 1); + widgets[WIDX_SURFACE_BUTTON_REMOVE_FENCES].bottom = GBBB(propertiesAnchor, 1); + widgets[WIDX_SURFACE_BUTTON_RESTORE_FENCES].top = GBBT(propertiesAnchor, 1); + widgets[WIDX_SURFACE_BUTTON_RESTORE_FENCES].bottom = GBBB(propertiesAnchor, 1); + widgets[WIDX_SURFACE_CHECK_CORNER_N].top = GBBT(propertiesAnchor, 2) + 7 * 0; + widgets[WIDX_SURFACE_CHECK_CORNER_N].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_N].top + 13; + widgets[WIDX_SURFACE_CHECK_CORNER_E].top = GBBT(propertiesAnchor, 2) + 7 * 1; + widgets[WIDX_SURFACE_CHECK_CORNER_E].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_E].top + 13; + widgets[WIDX_SURFACE_CHECK_CORNER_S].top = GBBT(propertiesAnchor, 2) + 7 * 2; + widgets[WIDX_SURFACE_CHECK_CORNER_S].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_S].top + 13; + widgets[WIDX_SURFACE_CHECK_CORNER_W].top = GBBT(propertiesAnchor, 2) + 7 * 1; + widgets[WIDX_SURFACE_CHECK_CORNER_W].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_W].top + 13; + widgets[WIDX_SURFACE_CHECK_DIAGONAL].top = GBBT(propertiesAnchor, 3) + 7 * 1; + widgets[WIDX_SURFACE_CHECK_DIAGONAL].bottom = widgets[WIDX_SURFACE_CHECK_DIAGONAL].top + 13; + SetCheckboxValue( + WIDX_SURFACE_CHECK_CORNER_N, + tileElement->AsSurface()->GetSlope() & (1 << ((2 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_SURFACE_CHECK_CORNER_E, + tileElement->AsSurface()->GetSlope() & (1 << ((3 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_SURFACE_CHECK_CORNER_S, + tileElement->AsSurface()->GetSlope() & (1 << ((0 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_SURFACE_CHECK_CORNER_W, + tileElement->AsSurface()->GetSlope() & (1 << ((1 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_SURFACE_CHECK_DIAGONAL, tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT); break; case TileElementType::Path: - p = TileInspectorPage::Path; + widgets[WIDX_PATH_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_PATH_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_PATH_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_PATH_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_PATH_CHECK_BROKEN].top = GBBT(propertiesAnchor, 1); + widgets[WIDX_PATH_CHECK_BROKEN].bottom = GBBB(propertiesAnchor, 1); + widgets[WIDX_PATH_CHECK_SLOPED].top = GBBT(propertiesAnchor, 2); + widgets[WIDX_PATH_CHECK_SLOPED].bottom = GBBB(propertiesAnchor, 2); + widgets[WIDX_PATH_CHECK_JUNCTION_RAILINGS].top = GBBT(propertiesAnchor, 3); + widgets[WIDX_PATH_CHECK_JUNCTION_RAILINGS].bottom = GBBB(propertiesAnchor, 3); + widgets[WIDX_PATH_CHECK_EDGE_N].top = GBBT(propertiesAnchor, 4) + 7 * 0; + widgets[WIDX_PATH_CHECK_EDGE_N].bottom = widgets[WIDX_PATH_CHECK_EDGE_N].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_NE].top = GBBT(propertiesAnchor, 4) + 7 * 1; + widgets[WIDX_PATH_CHECK_EDGE_NE].bottom = widgets[WIDX_PATH_CHECK_EDGE_NE].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_E].top = GBBT(propertiesAnchor, 4) + 7 * 2; + widgets[WIDX_PATH_CHECK_EDGE_E].bottom = widgets[WIDX_PATH_CHECK_EDGE_E].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_SE].top = GBBT(propertiesAnchor, 4) + 7 * 3; + widgets[WIDX_PATH_CHECK_EDGE_SE].bottom = widgets[WIDX_PATH_CHECK_EDGE_SE].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_S].top = GBBT(propertiesAnchor, 4) + 7 * 4; + widgets[WIDX_PATH_CHECK_EDGE_S].bottom = widgets[WIDX_PATH_CHECK_EDGE_S].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_SW].top = GBBT(propertiesAnchor, 4) + 7 * 3; + widgets[WIDX_PATH_CHECK_EDGE_SW].bottom = widgets[WIDX_PATH_CHECK_EDGE_SW].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_W].top = GBBT(propertiesAnchor, 4) + 7 * 2; + widgets[WIDX_PATH_CHECK_EDGE_W].bottom = widgets[WIDX_PATH_CHECK_EDGE_W].top + 13; + widgets[WIDX_PATH_CHECK_EDGE_NW].top = GBBT(propertiesAnchor, 4) + 7 * 1; + widgets[WIDX_PATH_CHECK_EDGE_NW].bottom = widgets[WIDX_PATH_CHECK_EDGE_NW].top + 13; + SetCheckboxValue(WIDX_PATH_CHECK_SLOPED, tileElement->AsPath()->IsSloped()); + SetCheckboxValue(WIDX_PATH_CHECK_JUNCTION_RAILINGS, tileElement->AsPath()->HasJunctionRailings()); + SetCheckboxValue(WIDX_PATH_CHECK_BROKEN, tileElement->AsPath()->IsBroken()); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_NE, tileElement->AsPath()->GetEdges() & (1 << ((0 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_SE, tileElement->AsPath()->GetEdges() & (1 << ((1 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_SW, tileElement->AsPath()->GetEdges() & (1 << ((2 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_NW, tileElement->AsPath()->GetEdges() & (1 << ((3 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_E, tileElement->AsPath()->GetCorners() & (1 << ((0 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_S, tileElement->AsPath()->GetCorners() & (1 << ((1 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_W, tileElement->AsPath()->GetCorners() & (1 << ((2 - GetCurrentRotation()) & 3))); + SetCheckboxValue( + WIDX_PATH_CHECK_EDGE_N, tileElement->AsPath()->GetCorners() & (1 << ((3 - GetCurrentRotation()) & 3))); break; case TileElementType::Track: - p = TileInspectorPage::Track; + widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].top = GBBT(propertiesAnchor, 0); + widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].bottom = GBBB(propertiesAnchor, 0); + widgets[WIDX_TRACK_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 1) + 3; + widgets[WIDX_TRACK_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 1) - 3; + widgets[WIDX_TRACK_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 1) + 4; + widgets[WIDX_TRACK_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 1) - 4; + widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 1) + 4; + widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 1) - 4; + widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].top = GBBT(propertiesAnchor, 2); + widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].bottom = GBBB(propertiesAnchor, 2); + widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].top = GBBT(propertiesAnchor, 3); + widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].bottom = GBBB(propertiesAnchor, 3); + widgets[WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE].top = GBBT(propertiesAnchor, 4); + widgets[WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE].bottom = GBBB(propertiesAnchor, 4); + SetCheckboxValue(WIDX_TRACK_CHECK_APPLY_TO_ALL, _applyToAll); + SetCheckboxValue(WIDX_TRACK_CHECK_CHAIN_LIFT, tileElement->AsTrack()->HasChain()); + SetCheckboxValue(WIDX_TRACK_CHECK_BRAKE_CLOSED, tileElement->AsTrack()->IsBrakeClosed()); + widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].content = tileElement->AsTrack()->IsBlockStart() + ? STR_TILE_INSPECTOR_TRACK_BLOCK_BRAKE + : STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED; + SetCheckboxValue(WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE, tileElement->AsTrack()->IsIndestructible()); break; case TileElementType::SmallScenery: - p = TileInspectorPage::Scenery; + { + // Raise / Lower + widgets[WIDX_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_SCENERY_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + + // Quadrant checkboxes + widgets[WIDX_SCENERY_CHECK_QUARTER_N].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 0; + widgets[WIDX_SCENERY_CHECK_QUARTER_N].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_N].top + 13; + widgets[WIDX_SCENERY_CHECK_QUARTER_E].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 1; + widgets[WIDX_SCENERY_CHECK_QUARTER_E].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_E].top + 13; + widgets[WIDX_SCENERY_CHECK_QUARTER_S].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 2; + widgets[WIDX_SCENERY_CHECK_QUARTER_S].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_S].top + 13; + widgets[WIDX_SCENERY_CHECK_QUARTER_W].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 1; + widgets[WIDX_SCENERY_CHECK_QUARTER_W].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_W].top + 13; + // This gets the relative rotation, by subtracting the camera's rotation, and wrapping it between 0-3 + // inclusive + bool N = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((0 - GetCurrentRotation()) & 3); + bool E = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((1 - GetCurrentRotation()) & 3); + bool S = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((2 - GetCurrentRotation()) & 3); + bool W = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((3 - GetCurrentRotation()) & 3); + SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_N, N); + SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_E, E); + SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_S, S); + SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_W, W); + + // Collision checkboxes + widgets[WIDX_SCENERY_CHECK_COLLISION_N].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 0; + widgets[WIDX_SCENERY_CHECK_COLLISION_N].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_N].top + 13; + widgets[WIDX_SCENERY_CHECK_COLLISION_E].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 1; + widgets[WIDX_SCENERY_CHECK_COLLISION_E].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_E].top + 13; + widgets[WIDX_SCENERY_CHECK_COLLISION_S].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 2; + widgets[WIDX_SCENERY_CHECK_COLLISION_S].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_S].top + 13; + widgets[WIDX_SCENERY_CHECK_COLLISION_W].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 1; + widgets[WIDX_SCENERY_CHECK_COLLISION_W].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_W].top + 13; + auto occupiedQuadrants = tileElement->GetOccupiedQuadrants(); + N = (occupiedQuadrants & (1 << ((2 - GetCurrentRotation()) & 3))) != 0; + E = (occupiedQuadrants & (1 << ((3 - GetCurrentRotation()) & 3))) != 0; + S = (occupiedQuadrants & (1 << ((0 - GetCurrentRotation()) & 3))) != 0; + W = (occupiedQuadrants & (1 << ((1 - GetCurrentRotation()) & 3))) != 0; + SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_N, N); + SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_E, E); + SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_S, S); + SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_W, W); break; + } case TileElementType::Entrance: - p = TileInspectorPage::Entrance; + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_ENTRANCE_BUTTON_MAKE_USABLE].top = GBBT(propertiesAnchor, 1); + widgets[WIDX_ENTRANCE_BUTTON_MAKE_USABLE].bottom = GBBB(propertiesAnchor, 1); + SetWidgetDisabled( + WIDX_ENTRANCE_BUTTON_MAKE_USABLE, + !(tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE)); break; case TileElementType::Wall: - p = TileInspectorPage::Wall; + { + bool canBeSloped = false; + bool hasAnimation = false; + const auto wallEntry = tileElement->AsWall()->GetEntry(); + if (wallEntry != nullptr) + { + canBeSloped = !(wallEntry->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE); + hasAnimation = wallEntry->flags & WALL_SCENERY_IS_DOOR; + } + + widgets[WIDX_WALL_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_WALL_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_WALL_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_WALL_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_WALL_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_WALL_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_WALL_DROPDOWN_SLOPE].top = GBBT(propertiesAnchor, 1) + 3; + widgets[WIDX_WALL_DROPDOWN_SLOPE].bottom = GBBB(propertiesAnchor, 1) - 3; + widgets[WIDX_WALL_DROPDOWN_SLOPE].text = WallSlopeStringIds[tileElement->AsWall()->GetSlope()]; + widgets[WIDX_WALL_DROPDOWN_SLOPE_BUTTON].top = GBBT(propertiesAnchor, 1) + 4; + widgets[WIDX_WALL_DROPDOWN_SLOPE_BUTTON].bottom = GBBB(propertiesAnchor, 1) - 4; + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].top = GBBT(propertiesAnchor, 2) + 3; + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].bottom = GBBB(propertiesAnchor, 2) - 3; + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE].top = GBBT(propertiesAnchor, 2) + 4; + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE].bottom = GBBB(propertiesAnchor, 2) - 4; + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE].top = GBBT(propertiesAnchor, 2) + 4; + widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE].bottom = GBBB(propertiesAnchor, 2) - 4; + + // Wall slope dropdown + SetWidgetDisabled(WIDX_WALL_DROPDOWN_SLOPE, !canBeSloped); + InvalidateWidget(WIDX_WALL_DROPDOWN_SLOPE); + SetWidgetDisabled(WIDX_WALL_DROPDOWN_SLOPE_BUTTON, !canBeSloped); + InvalidateWidget(WIDX_WALL_DROPDOWN_SLOPE_BUTTON); + // Wall animation frame spinner + SetWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME, !hasAnimation); + SetWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE, !hasAnimation); + SetWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE, !hasAnimation); break; + } case TileElementType::LargeScenery: - p = TileInspectorPage::LargeScenery; + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; break; case TileElementType::Banner: - p = TileInspectorPage::Banner; + widgets[WIDX_BANNER_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; + widgets[WIDX_BANNER_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; + widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_BANNER_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; + widgets[WIDX_BANNER_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; + widgets[WIDX_BANNER_CHECK_BLOCK_NE].top = GBBT(propertiesAnchor, 1); + widgets[WIDX_BANNER_CHECK_BLOCK_NE].bottom = GBBB(propertiesAnchor, 1); + widgets[WIDX_BANNER_CHECK_BLOCK_SE].top = GBBT(propertiesAnchor, 2); + widgets[WIDX_BANNER_CHECK_BLOCK_SE].bottom = GBBB(propertiesAnchor, 2); + widgets[WIDX_BANNER_CHECK_BLOCK_SW].top = GBBT(propertiesAnchor, 2); + widgets[WIDX_BANNER_CHECK_BLOCK_SW].bottom = GBBB(propertiesAnchor, 2); + widgets[WIDX_BANNER_CHECK_BLOCK_NW].top = GBBT(propertiesAnchor, 1); + widgets[WIDX_BANNER_CHECK_BLOCK_NW].bottom = GBBB(propertiesAnchor, 1); + SetCheckboxValue( + WIDX_BANNER_CHECK_BLOCK_NE, + (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((0 - GetCurrentRotation()) & 3)))); + SetCheckboxValue( + WIDX_BANNER_CHECK_BLOCK_SE, + (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((1 - GetCurrentRotation()) & 3)))); + SetCheckboxValue( + WIDX_BANNER_CHECK_BLOCK_SW, + (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((2 - GetCurrentRotation()) & 3)))); + SetCheckboxValue( + WIDX_BANNER_CHECK_BLOCK_NW, + (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((3 - GetCurrentRotation()) & 3)))); break; + + default: + break; // Nothing. } } + }; - if (tileInspectorPage != p) - { - SetPage(p); - Invalidate(); - } - // X and Y spinners - SetWidgetDisabledAndInvalidate( - WIDX_SPINNER_X_INCREASE, !(_tileSelected && ((_toolMap.x / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); - SetWidgetDisabledAndInvalidate(WIDX_SPINNER_X_DECREASE, !(_tileSelected && ((_toolMap.x / 32) > 0))); - SetWidgetDisabledAndInvalidate( - WIDX_SPINNER_Y_INCREASE, !(_tileSelected && ((_toolMap.y / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); - SetWidgetDisabledAndInvalidate(WIDX_SPINNER_Y_DECREASE, !(_tileSelected && ((_toolMap.y / 32) > 0))); - - // Sort buttons - SetWidgetDisabledAndInvalidate(WIDX_BUTTON_SORT, !(_tileSelected && windowTileInspectorElementCount > 1)); - - // Move Up button - SetWidgetDisabledAndInvalidate( - WIDX_BUTTON_MOVE_UP, - !(windowTileInspectorSelectedIndex != -1 - && windowTileInspectorSelectedIndex < windowTileInspectorElementCount - 1)); - - // Move Down button - SetWidgetDisabledAndInvalidate(WIDX_BUTTON_MOVE_DOWN, !(windowTileInspectorSelectedIndex > 0)); - - // Copy button - SetWidgetDisabledAndInvalidate(WIDX_BUTTON_COPY, !(windowTileInspectorSelectedIndex >= 0)); - - // Paste button - SetWidgetDisabledAndInvalidate(WIDX_BUTTON_PASTE, !(_tileSelected && _elementCopied)); - - widgets[WIDX_BACKGROUND].bottom = height - 1; - - if (tileInspectorPage == TileInspectorPage::Default) - { - widgets[WIDX_GROUPBOX_DETAILS].type = WindowWidgetType::Empty; - widgets[WIDX_GROUPBOX_PROPERTIES].type = WindowWidgetType::Empty; - widgets[WIDX_LIST].bottom = height - PADDING_BOTTOM; - } - else - { - widgets[WIDX_GROUPBOX_DETAILS].type = WindowWidgetType::Groupbox; - widgets[WIDX_GROUPBOX_PROPERTIES].type = WindowWidgetType::Groupbox; - auto pageIndex = EnumValue(tileInspectorPage) - 1; - widgets[WIDX_GROUPBOX_DETAILS].text = PageGroupBoxSettings[pageIndex].string_id; - widgets[WIDX_GROUPBOX_DETAILS].top = height - PageGroupBoxSettings[pageIndex].details_top_offset; - widgets[WIDX_GROUPBOX_DETAILS].bottom = height - PageGroupBoxSettings[pageIndex].details_bottom_offset; - widgets[WIDX_GROUPBOX_PROPERTIES].top = height - PageGroupBoxSettings[pageIndex].properties_top_offset; - widgets[WIDX_GROUPBOX_PROPERTIES].bottom = height - PageGroupBoxSettings[pageIndex].properties_bottom_offset; - widgets[WIDX_LIST].bottom = widgets[WIDX_GROUPBOX_DETAILS].top - GROUPBOX_PADDING; - } - - // The default page doesn't need further invalidation - if (tileInspectorPage == TileInspectorPage::Default) - return; - - // Using a switch, because I don't think giving each page their own callbacks is - // needed here, as only the mouseup and invalidate functions are different. - const int32_t propertiesAnchor = widgets[WIDX_GROUPBOX_PROPERTIES].top; - - switch (tileElement->GetType()) - { - case TileElementType::Surface: - widgets[WIDX_SURFACE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_SURFACE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_SURFACE_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_SURFACE_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_SURFACE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_SURFACE_BUTTON_REMOVE_FENCES].top = GBBT(propertiesAnchor, 1); - widgets[WIDX_SURFACE_BUTTON_REMOVE_FENCES].bottom = GBBB(propertiesAnchor, 1); - widgets[WIDX_SURFACE_BUTTON_RESTORE_FENCES].top = GBBT(propertiesAnchor, 1); - widgets[WIDX_SURFACE_BUTTON_RESTORE_FENCES].bottom = GBBB(propertiesAnchor, 1); - widgets[WIDX_SURFACE_CHECK_CORNER_N].top = GBBT(propertiesAnchor, 2) + 7 * 0; - widgets[WIDX_SURFACE_CHECK_CORNER_N].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_N].top + 13; - widgets[WIDX_SURFACE_CHECK_CORNER_E].top = GBBT(propertiesAnchor, 2) + 7 * 1; - widgets[WIDX_SURFACE_CHECK_CORNER_E].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_E].top + 13; - widgets[WIDX_SURFACE_CHECK_CORNER_S].top = GBBT(propertiesAnchor, 2) + 7 * 2; - widgets[WIDX_SURFACE_CHECK_CORNER_S].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_S].top + 13; - widgets[WIDX_SURFACE_CHECK_CORNER_W].top = GBBT(propertiesAnchor, 2) + 7 * 1; - widgets[WIDX_SURFACE_CHECK_CORNER_W].bottom = widgets[WIDX_SURFACE_CHECK_CORNER_W].top + 13; - widgets[WIDX_SURFACE_CHECK_DIAGONAL].top = GBBT(propertiesAnchor, 3) + 7 * 1; - widgets[WIDX_SURFACE_CHECK_DIAGONAL].bottom = widgets[WIDX_SURFACE_CHECK_DIAGONAL].top + 13; - SetCheckboxValue( - WIDX_SURFACE_CHECK_CORNER_N, - tileElement->AsSurface()->GetSlope() & (1 << ((2 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_SURFACE_CHECK_CORNER_E, - tileElement->AsSurface()->GetSlope() & (1 << ((3 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_SURFACE_CHECK_CORNER_S, - tileElement->AsSurface()->GetSlope() & (1 << ((0 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_SURFACE_CHECK_CORNER_W, - tileElement->AsSurface()->GetSlope() & (1 << ((1 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_SURFACE_CHECK_DIAGONAL, tileElement->AsSurface()->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT); - break; - - case TileElementType::Path: - widgets[WIDX_PATH_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_PATH_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_PATH_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_PATH_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_PATH_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_PATH_CHECK_BROKEN].top = GBBT(propertiesAnchor, 1); - widgets[WIDX_PATH_CHECK_BROKEN].bottom = GBBB(propertiesAnchor, 1); - widgets[WIDX_PATH_CHECK_SLOPED].top = GBBT(propertiesAnchor, 2); - widgets[WIDX_PATH_CHECK_SLOPED].bottom = GBBB(propertiesAnchor, 2); - widgets[WIDX_PATH_CHECK_JUNCTION_RAILINGS].top = GBBT(propertiesAnchor, 3); - widgets[WIDX_PATH_CHECK_JUNCTION_RAILINGS].bottom = GBBB(propertiesAnchor, 3); - widgets[WIDX_PATH_CHECK_EDGE_N].top = GBBT(propertiesAnchor, 4) + 7 * 0; - widgets[WIDX_PATH_CHECK_EDGE_N].bottom = widgets[WIDX_PATH_CHECK_EDGE_N].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_NE].top = GBBT(propertiesAnchor, 4) + 7 * 1; - widgets[WIDX_PATH_CHECK_EDGE_NE].bottom = widgets[WIDX_PATH_CHECK_EDGE_NE].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_E].top = GBBT(propertiesAnchor, 4) + 7 * 2; - widgets[WIDX_PATH_CHECK_EDGE_E].bottom = widgets[WIDX_PATH_CHECK_EDGE_E].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_SE].top = GBBT(propertiesAnchor, 4) + 7 * 3; - widgets[WIDX_PATH_CHECK_EDGE_SE].bottom = widgets[WIDX_PATH_CHECK_EDGE_SE].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_S].top = GBBT(propertiesAnchor, 4) + 7 * 4; - widgets[WIDX_PATH_CHECK_EDGE_S].bottom = widgets[WIDX_PATH_CHECK_EDGE_S].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_SW].top = GBBT(propertiesAnchor, 4) + 7 * 3; - widgets[WIDX_PATH_CHECK_EDGE_SW].bottom = widgets[WIDX_PATH_CHECK_EDGE_SW].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_W].top = GBBT(propertiesAnchor, 4) + 7 * 2; - widgets[WIDX_PATH_CHECK_EDGE_W].bottom = widgets[WIDX_PATH_CHECK_EDGE_W].top + 13; - widgets[WIDX_PATH_CHECK_EDGE_NW].top = GBBT(propertiesAnchor, 4) + 7 * 1; - widgets[WIDX_PATH_CHECK_EDGE_NW].bottom = widgets[WIDX_PATH_CHECK_EDGE_NW].top + 13; - SetCheckboxValue(WIDX_PATH_CHECK_SLOPED, tileElement->AsPath()->IsSloped()); - SetCheckboxValue(WIDX_PATH_CHECK_JUNCTION_RAILINGS, tileElement->AsPath()->HasJunctionRailings()); - SetCheckboxValue(WIDX_PATH_CHECK_BROKEN, tileElement->AsPath()->IsBroken()); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_NE, tileElement->AsPath()->GetEdges() & (1 << ((0 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_SE, tileElement->AsPath()->GetEdges() & (1 << ((1 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_SW, tileElement->AsPath()->GetEdges() & (1 << ((2 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_NW, tileElement->AsPath()->GetEdges() & (1 << ((3 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_E, tileElement->AsPath()->GetCorners() & (1 << ((0 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_S, tileElement->AsPath()->GetCorners() & (1 << ((1 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_W, tileElement->AsPath()->GetCorners() & (1 << ((2 - GetCurrentRotation()) & 3))); - SetCheckboxValue( - WIDX_PATH_CHECK_EDGE_N, tileElement->AsPath()->GetCorners() & (1 << ((3 - GetCurrentRotation()) & 3))); - break; - - case TileElementType::Track: - widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].top = GBBT(propertiesAnchor, 0); - widgets[WIDX_TRACK_CHECK_APPLY_TO_ALL].bottom = GBBB(propertiesAnchor, 0); - widgets[WIDX_TRACK_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 1) + 3; - widgets[WIDX_TRACK_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 1) - 3; - widgets[WIDX_TRACK_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 1) + 4; - widgets[WIDX_TRACK_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 1) - 4; - widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 1) + 4; - widgets[WIDX_TRACK_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 1) - 4; - widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].top = GBBT(propertiesAnchor, 2); - widgets[WIDX_TRACK_CHECK_CHAIN_LIFT].bottom = GBBB(propertiesAnchor, 2); - widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].top = GBBT(propertiesAnchor, 3); - widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].bottom = GBBB(propertiesAnchor, 3); - widgets[WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE].top = GBBT(propertiesAnchor, 4); - widgets[WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE].bottom = GBBB(propertiesAnchor, 4); - SetCheckboxValue(WIDX_TRACK_CHECK_APPLY_TO_ALL, _applyToAll); - SetCheckboxValue(WIDX_TRACK_CHECK_CHAIN_LIFT, tileElement->AsTrack()->HasChain()); - SetCheckboxValue(WIDX_TRACK_CHECK_BRAKE_CLOSED, tileElement->AsTrack()->IsBrakeClosed()); - widgets[WIDX_TRACK_CHECK_BRAKE_CLOSED].content = tileElement->AsTrack()->IsBlockStart() - ? STR_TILE_INSPECTOR_TRACK_BLOCK_BRAKE - : STR_TILE_INSPECTOR_TRACK_BRAKE_CLOSED; - SetCheckboxValue(WIDX_TRACK_CHECK_IS_INDESTRUCTIBLE, tileElement->AsTrack()->IsIndestructible()); - break; - - case TileElementType::SmallScenery: - { - // Raise / Lower - widgets[WIDX_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_SCENERY_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - - // Quadrant checkboxes - widgets[WIDX_SCENERY_CHECK_QUARTER_N].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 0; - widgets[WIDX_SCENERY_CHECK_QUARTER_N].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_N].top + 13; - widgets[WIDX_SCENERY_CHECK_QUARTER_E].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 1; - widgets[WIDX_SCENERY_CHECK_QUARTER_E].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_E].top + 13; - widgets[WIDX_SCENERY_CHECK_QUARTER_S].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 2; - widgets[WIDX_SCENERY_CHECK_QUARTER_S].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_S].top + 13; - widgets[WIDX_SCENERY_CHECK_QUARTER_W].top = GBBT(propertiesAnchor, 1) - 5 + 7 * 1; - widgets[WIDX_SCENERY_CHECK_QUARTER_W].bottom = widgets[WIDX_SCENERY_CHECK_QUARTER_W].top + 13; - // This gets the relative rotation, by subtracting the camera's rotation, and wrapping it between 0-3 inclusive - bool N = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((0 - GetCurrentRotation()) & 3); - bool E = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((1 - GetCurrentRotation()) & 3); - bool S = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((2 - GetCurrentRotation()) & 3); - bool W = tileElement->AsSmallScenery()->GetSceneryQuadrant() == ((3 - GetCurrentRotation()) & 3); - SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_N, N); - SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_E, E); - SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_S, S); - SetCheckboxValue(WIDX_SCENERY_CHECK_QUARTER_W, W); - - // Collision checkboxes - widgets[WIDX_SCENERY_CHECK_COLLISION_N].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 0; - widgets[WIDX_SCENERY_CHECK_COLLISION_N].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_N].top + 13; - widgets[WIDX_SCENERY_CHECK_COLLISION_E].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 1; - widgets[WIDX_SCENERY_CHECK_COLLISION_E].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_E].top + 13; - widgets[WIDX_SCENERY_CHECK_COLLISION_S].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 2; - widgets[WIDX_SCENERY_CHECK_COLLISION_S].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_S].top + 13; - widgets[WIDX_SCENERY_CHECK_COLLISION_W].top = GBBT(propertiesAnchor, 2) + 5 + 7 * 1; - widgets[WIDX_SCENERY_CHECK_COLLISION_W].bottom = widgets[WIDX_SCENERY_CHECK_COLLISION_W].top + 13; - auto occupiedQuadrants = tileElement->GetOccupiedQuadrants(); - N = (occupiedQuadrants & (1 << ((2 - GetCurrentRotation()) & 3))) != 0; - E = (occupiedQuadrants & (1 << ((3 - GetCurrentRotation()) & 3))) != 0; - S = (occupiedQuadrants & (1 << ((0 - GetCurrentRotation()) & 3))) != 0; - W = (occupiedQuadrants & (1 << ((1 - GetCurrentRotation()) & 3))) != 0; - SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_N, N); - SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_E, E); - SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_S, S); - SetCheckboxValue(WIDX_SCENERY_CHECK_COLLISION_W, W); - break; - } - - case TileElementType::Entrance: - widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_ENTRANCE_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_ENTRANCE_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_ENTRANCE_BUTTON_MAKE_USABLE].top = GBBT(propertiesAnchor, 1); - widgets[WIDX_ENTRANCE_BUTTON_MAKE_USABLE].bottom = GBBB(propertiesAnchor, 1); - SetWidgetDisabled( - WIDX_ENTRANCE_BUTTON_MAKE_USABLE, - !(tileElement->AsEntrance()->GetEntranceType() != ENTRANCE_TYPE_PARK_ENTRANCE)); - break; - - case TileElementType::Wall: - { - bool canBeSloped = false; - bool hasAnimation = false; - const auto wallEntry = tileElement->AsWall()->GetEntry(); - if (wallEntry != nullptr) - { - canBeSloped = !(wallEntry->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE); - hasAnimation = wallEntry->flags & WALL_SCENERY_IS_DOOR; - } - - widgets[WIDX_WALL_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_WALL_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_WALL_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_WALL_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_WALL_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_WALL_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_WALL_DROPDOWN_SLOPE].top = GBBT(propertiesAnchor, 1) + 3; - widgets[WIDX_WALL_DROPDOWN_SLOPE].bottom = GBBB(propertiesAnchor, 1) - 3; - widgets[WIDX_WALL_DROPDOWN_SLOPE].text = WallSlopeStringIds[tileElement->AsWall()->GetSlope()]; - widgets[WIDX_WALL_DROPDOWN_SLOPE_BUTTON].top = GBBT(propertiesAnchor, 1) + 4; - widgets[WIDX_WALL_DROPDOWN_SLOPE_BUTTON].bottom = GBBB(propertiesAnchor, 1) - 4; - widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].top = GBBT(propertiesAnchor, 2) + 3; - widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME].bottom = GBBB(propertiesAnchor, 2) - 3; - widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE].top = GBBT(propertiesAnchor, 2) + 4; - widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE].bottom = GBBB(propertiesAnchor, 2) - 4; - widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE].top = GBBT(propertiesAnchor, 2) + 4; - widgets[WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE].bottom = GBBB(propertiesAnchor, 2) - 4; - - // Wall slope dropdown - SetWidgetDisabled(WIDX_WALL_DROPDOWN_SLOPE, !canBeSloped); - InvalidateWidget(WIDX_WALL_DROPDOWN_SLOPE); - SetWidgetDisabled(WIDX_WALL_DROPDOWN_SLOPE_BUTTON, !canBeSloped); - InvalidateWidget(WIDX_WALL_DROPDOWN_SLOPE_BUTTON); - // Wall animation frame spinner - SetWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME, !hasAnimation); - SetWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME_INCREASE, !hasAnimation); - SetWidgetDisabled(WIDX_WALL_SPINNER_ANIMATION_FRAME_DECREASE, !hasAnimation); - break; - } - - case TileElementType::LargeScenery: - widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_LARGE_SCENERY_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - break; - - case TileElementType::Banner: - widgets[WIDX_BANNER_SPINNER_HEIGHT].top = GBBT(propertiesAnchor, 0) + 3; - widgets[WIDX_BANNER_SPINNER_HEIGHT].bottom = GBBB(propertiesAnchor, 0) - 3; - widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_BANNER_SPINNER_HEIGHT_INCREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_BANNER_SPINNER_HEIGHT_DECREASE].top = GBBT(propertiesAnchor, 0) + 4; - widgets[WIDX_BANNER_SPINNER_HEIGHT_DECREASE].bottom = GBBB(propertiesAnchor, 0) - 4; - widgets[WIDX_BANNER_CHECK_BLOCK_NE].top = GBBT(propertiesAnchor, 1); - widgets[WIDX_BANNER_CHECK_BLOCK_NE].bottom = GBBB(propertiesAnchor, 1); - widgets[WIDX_BANNER_CHECK_BLOCK_SE].top = GBBT(propertiesAnchor, 2); - widgets[WIDX_BANNER_CHECK_BLOCK_SE].bottom = GBBB(propertiesAnchor, 2); - widgets[WIDX_BANNER_CHECK_BLOCK_SW].top = GBBT(propertiesAnchor, 2); - widgets[WIDX_BANNER_CHECK_BLOCK_SW].bottom = GBBB(propertiesAnchor, 2); - widgets[WIDX_BANNER_CHECK_BLOCK_NW].top = GBBT(propertiesAnchor, 1); - widgets[WIDX_BANNER_CHECK_BLOCK_NW].bottom = GBBB(propertiesAnchor, 1); - SetCheckboxValue( - WIDX_BANNER_CHECK_BLOCK_NE, - (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((0 - GetCurrentRotation()) & 3)))); - SetCheckboxValue( - WIDX_BANNER_CHECK_BLOCK_SE, - (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((1 - GetCurrentRotation()) & 3)))); - SetCheckboxValue( - WIDX_BANNER_CHECK_BLOCK_SW, - (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((2 - GetCurrentRotation()) & 3)))); - SetCheckboxValue( - WIDX_BANNER_CHECK_BLOCK_NW, - (tileElement->AsBanner()->GetAllowedEdges() & (1 << ((3 - GetCurrentRotation()) & 3)))); - break; - - default: - break; // Nothing. - } + WindowBase* WindowTileInspectorOpen() + { + WindowBase* window = WindowBringToFrontByClass(WindowClass::TileInspector); + if (window == nullptr) + window = WindowCreate(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE); + return window; } -}; -WindowBase* WindowTileInspectorOpen() -{ - WindowBase* window = WindowBringToFrontByClass(WindowClass::TileInspector); - if (window == nullptr) - window = WindowCreate(WindowClass::TileInspector, ScreenCoordsXY(0, 29), WW, WH, WF_RESIZABLE); - return window; -} + void WindowTileInspectorClearClipboard() + { + auto* window = WindowFindByClass(WindowClass::TileInspector); + if (window != nullptr) + static_cast(window)->ClearClipboard(); + } -void WindowTileInspectorClearClipboard() -{ - auto* window = WindowFindByClass(WindowClass::TileInspector); - if (window != nullptr) - static_cast(window)->ClearClipboard(); -} - -void WindowTileInspectorKeyboardShortcutToggleInvisibility() -{ - auto* window = WindowFindByClass(WindowClass::TileInspector); - if (window != nullptr) - static_cast(window)->ToggleInvisibility(); -} + void WindowTileInspectorKeyboardShortcutToggleInvisibility() + { + auto* window = WindowFindByClass(WindowClass::TileInspector); + if (window != nullptr) + static_cast(window)->ToggleInvisibility(); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index 17870cdf4a..2afad31f02 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -15,7 +15,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowTitleExitWidgetIdx { WIDX_EXIT, }; @@ -24,43 +26,44 @@ static Widget _titleExitWidgets[] = { MakeWidget({0, 0}, {40, 64}, WindowWidgetType::ImgBtn, WindowColour::Tertiary, ImageId(SPR_MENU_EXIT), STR_EXIT), kWidgetsEnd, }; -// clang-format on + // clang-format on -class TitleExitWindow final : public Window -{ - void OnOpen() override + class TitleExitWindow final : public Window { - widgets = _titleExitWidgets; - InitScrollWidgets(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - if (gIntroState != IntroState::None) - return; - - switch (widgetIndex) + void OnOpen() override { - case WIDX_EXIT: - ContextQuit(); - // game_do_command(0, 1, 0, 0, 5, 3, 0); - break; - }; - } + widgets = _titleExitWidgets; + InitScrollWidgets(); + } - void OnDraw(DrawPixelInfo& dpi) override + void OnMouseUp(WidgetIndex widgetIndex) override + { + if (gIntroState != IntroState::None) + return; + + switch (widgetIndex) + { + case WIDX_EXIT: + ContextQuit(); + // game_do_command(0, 1, 0, 0, 5, 3, 0); + break; + }; + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + } + }; + + /** + * Creates the window containing the exit button on the title screen. + * rct2: 0x0066B624 (part of 0x0066B3E8) + */ + WindowBase* WindowTitleExitOpen() { - DrawWidgets(dpi); + return WindowCreate( + WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), 40, 64, + WF_STICK_TO_BACK | WF_TRANSPARENT); } -}; - -/** - * Creates the window containing the exit button on the title screen. - * rct2: 0x0066B624 (part of 0x0066B3E8) - */ -WindowBase* WindowTitleExitOpen() -{ - return WindowCreate( - WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), 40, 64, - WF_STICK_TO_BACK | WF_TRANSPARENT); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index d70897312d..8b68d437ca 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -14,64 +14,67 @@ #include #include -static constexpr int32_t WW = 232; -static constexpr int32_t WH = 136; - -enum +namespace OpenRCT2::Ui::Windows { - WIDX_LOGO -}; + static constexpr int32_t WW = 232; + static constexpr int32_t WH = 136; -static Widget _titleLogoWidgets[] = { - MakeWidget({ 0, 0 }, { WW + 1, WH + 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), - kWidgetsEnd, -}; - -class TitleLogoWindow final : public Window -{ -public: - /** - * Creates the window containing the logo and the expansion packs on the title screen. - * rct2: 0x0066B679 (part of 0x0066B3E8) - */ - void OnOpen() override + enum { - widgets = _titleLogoWidgets; - WindowInitScrollWidgets(*this); - colours[0] = TRANSLUCENT(COLOUR_GREY); - colours[1] = TRANSLUCENT(COLOUR_GREY); - colours[2] = TRANSLUCENT(COLOUR_GREY); - } + WIDX_LOGO + }; - void OnMouseUp(WidgetIndex widgetIndex) override + static Widget _titleLogoWidgets[] = { + MakeWidget({ 0, 0 }, { WW + 1, WH + 1 }, WindowWidgetType::ImgBtn, WindowColour::Primary), + kWidgetsEnd, + }; + + class TitleLogoWindow final : public Window { - switch (widgetIndex) + public: + /** + * Creates the window containing the logo and the expansion packs on the title screen. + * rct2: 0x0066B679 (part of 0x0066B3E8) + */ + void OnOpen() override { - case WIDX_LOGO: - WindowAboutOpen(); - break; + widgets = _titleLogoWidgets; + WindowInitScrollWidgets(*this); + colours[0] = TRANSLUCENT(COLOUR_GREY); + colours[1] = TRANSLUCENT(COLOUR_GREY); + colours[2] = TRANSLUCENT(COLOUR_GREY); } - } - /** - * - * rct2: 0x0066B872 - */ - void OnDraw(DrawPixelInfo& dpi) override - { - auto screenCoords = windowPos + ScreenCoordsXY{ 2, 2 }; - GfxDrawSprite(dpi, ImageId(SPR_G2_LOGO), screenCoords); - GfxDrawSprite(dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 }); - } -}; + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_LOGO: + WindowAboutOpen(); + break; + } + } -WindowBase* WindowTitleLogoOpen() -{ - auto* window = WindowBringToFrontByClass(WindowClass::TitleLogo); - if (window == nullptr) + /** + * + * rct2: 0x0066B872 + */ + void OnDraw(DrawPixelInfo& dpi) override + { + auto screenCoords = windowPos + ScreenCoordsXY{ 2, 2 }; + GfxDrawSprite(dpi, ImageId(SPR_G2_LOGO), screenCoords); + GfxDrawSprite(dpi, ImageId(SPR_G2_TITLE), screenCoords + ScreenCoordsXY{ 104, 18 }); + } + }; + + WindowBase* WindowTitleLogoOpen() { - window = WindowCreate( - WindowClass::TitleLogo, ScreenCoordsXY(0, 0), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT); + auto* window = WindowBringToFrontByClass(WindowClass::TitleLogo); + if (window == nullptr) + { + window = WindowCreate( + WindowClass::TitleLogo, ScreenCoordsXY(0, 0), WW, WH, WF_STICK_TO_BACK | WF_TRANSPARENT); + } + return window; } - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index eadabe6888..06fec7320f 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -23,7 +23,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_START_NEW_GAME, WIDX_CONTINUE_SAVED_GAME, @@ -53,238 +55,239 @@ static Widget _titleMenuWidgets[] = { MakeWidget({0, 0}, UpdateButtonDims, WindowWidgetType::Empty, WindowColour::Secondary, STR_UPDATE_AVAILABLE), kWidgetsEnd, }; -// clang-format on + // clang-format on -static void WindowTitleMenuScenarioselectCallback(const utf8* path) -{ - GameNotifyMapChange(); - OpenRCT2::GetContext()->LoadParkFromFile(path, false, true); - GameLoadScripts(); - GameNotifyMapChanged(); -} - -static void InvokeCustomToolboxMenuItem(size_t index) -{ -#ifdef ENABLE_SCRIPTING - const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; - size_t i = 0; - for (const auto& item : customMenuItems) + static void WindowTitleMenuScenarioselectCallback(const utf8* path) { - if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Toolbox) - { - if (i == index) - { - item.Invoke(); - break; - } - i++; - } + GameNotifyMapChange(); + OpenRCT2::GetContext()->LoadParkFromFile(path, false, true); + GameLoadScripts(); + GameNotifyMapChanged(); } -#endif -} -class TitleMenuWindow final : public Window -{ -private: - ScreenRect _filterRect; - -public: - void OnOpen() override + static void InvokeCustomToolboxMenuItem(size_t index) { - widgets = _titleMenuWidgets; +#ifdef ENABLE_SCRIPTING + const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; + size_t i = 0; + for (const auto& item : customMenuItems) + { + if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Toolbox) + { + if (i == index) + { + item.Invoke(); + break; + } + i++; + } + } +#endif + } + + class TitleMenuWindow final : public Window + { + private: + ScreenRect _filterRect; + + public: + void OnOpen() override + { + widgets = _titleMenuWidgets; #ifdef DISABLE_NETWORK - widgets[WIDX_MULTIPLAYER].type = WindowWidgetType::Empty; + widgets[WIDX_MULTIPLAYER].type = WindowWidgetType::Empty; #endif - int32_t x = 0; - for (Widget* widget = widgets; widget != &widgets[WIDX_NEW_VERSION]; widget++) - { - if (widget->type != WindowWidgetType::Empty) + int32_t x = 0; + for (Widget* widget = widgets; widget != &widgets[WIDX_NEW_VERSION]; widget++) { - widget->left = x; - widget->right = x + MenuButtonDims.width - 1; + if (widget->type != WindowWidgetType::Empty) + { + widget->left = x; + widget->right = x + MenuButtonDims.width - 1; - x += MenuButtonDims.width; + x += MenuButtonDims.width; + } + } + width = x; + widgets[WIDX_NEW_VERSION].right = width; + windowPos.x = (ContextGetWidth() - width) / 2; + colours[1] = TRANSLUCENT(COLOUR_LIGHT_ORANGE); + + InitScrollWidgets(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + WindowBase* windowToOpen = nullptr; + + switch (widgetIndex) + { + case WIDX_START_NEW_GAME: + windowToOpen = WindowFindByClass(WindowClass::ScenarioSelect); + if (windowToOpen != nullptr) + { + WindowBringToFront(*windowToOpen); + } + else + { + WindowCloseByClass(WindowClass::Loadsave); + WindowCloseByClass(WindowClass::ServerList); + WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback); + } + break; + case WIDX_CONTINUE_SAVED_GAME: + windowToOpen = WindowFindByClass(WindowClass::Loadsave); + if (windowToOpen != nullptr) + { + WindowBringToFront(*windowToOpen); + } + else + { + WindowCloseByClass(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::ServerList); + auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); + GameActions::Execute(&loadOrQuitAction); + } + break; + case WIDX_MULTIPLAYER: + windowToOpen = WindowFindByClass(WindowClass::ServerList); + if (windowToOpen != nullptr) + { + WindowBringToFront(*windowToOpen); + } + else + { + WindowCloseByClass(WindowClass::ScenarioSelect); + WindowCloseByClass(WindowClass::Loadsave); + ContextOpenWindow(WindowClass::ServerList); + } + break; + case WIDX_NEW_VERSION: + ContextOpenWindowView(WV_NEW_VERSION_INFO); + break; } } - width = x; - widgets[WIDX_NEW_VERSION].right = width; - windowPos.x = (ContextGetWidth() - width) / 2; - colours[1] = TRANSLUCENT(COLOUR_LIGHT_ORANGE); - InitScrollWidgets(); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - WindowBase* windowToOpen = nullptr; - - switch (widgetIndex) + void OnMouseDown(WidgetIndex widgetIndex) override { - case WIDX_START_NEW_GAME: - windowToOpen = WindowFindByClass(WindowClass::ScenarioSelect); - if (windowToOpen != nullptr) - { - WindowBringToFront(*windowToOpen); - } - else - { - WindowCloseByClass(WindowClass::Loadsave); - WindowCloseByClass(WindowClass::ServerList); - WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback); - } - break; - case WIDX_CONTINUE_SAVED_GAME: - windowToOpen = WindowFindByClass(WindowClass::Loadsave); - if (windowToOpen != nullptr) - { - WindowBringToFront(*windowToOpen); - } - else - { - WindowCloseByClass(WindowClass::ScenarioSelect); - WindowCloseByClass(WindowClass::ServerList); - auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); - GameActions::Execute(&loadOrQuitAction); - } - break; - case WIDX_MULTIPLAYER: - windowToOpen = WindowFindByClass(WindowClass::ServerList); - if (windowToOpen != nullptr) - { - WindowBringToFront(*windowToOpen); - } - else - { - WindowCloseByClass(WindowClass::ScenarioSelect); - WindowCloseByClass(WindowClass::Loadsave); - ContextOpenWindow(WindowClass::ServerList); - } - break; - case WIDX_NEW_VERSION: - ContextOpenWindowView(WV_NEW_VERSION_INFO); - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - if (widgetIndex == WIDX_GAME_TOOLS) - { - int32_t i = 0; - gDropdownItems[i++].Format = STR_SCENARIO_EDITOR; - gDropdownItems[i++].Format = STR_CONVERT_SAVED_GAME_TO_SCENARIO; - gDropdownItems[i++].Format = STR_ROLLER_COASTER_DESIGNER; - gDropdownItems[i++].Format = STR_TRACK_DESIGNS_MANAGER; - gDropdownItems[i++].Format = STR_OPEN_USER_CONTENT_FOLDER; + if (widgetIndex == WIDX_GAME_TOOLS) + { + int32_t i = 0; + gDropdownItems[i++].Format = STR_SCENARIO_EDITOR; + gDropdownItems[i++].Format = STR_CONVERT_SAVED_GAME_TO_SCENARIO; + gDropdownItems[i++].Format = STR_ROLLER_COASTER_DESIGNER; + gDropdownItems[i++].Format = STR_TRACK_DESIGNS_MANAGER; + gDropdownItems[i++].Format = STR_OPEN_USER_CONTENT_FOLDER; #ifdef ENABLE_SCRIPTING - auto hasCustomItems = false; - const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; - if (!customMenuItems.empty()) - { - for (const auto& item : customMenuItems) + auto hasCustomItems = false; + const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; + if (!customMenuItems.empty()) { - if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Toolbox) + for (const auto& item : customMenuItems) { - // Add seperator - if (!hasCustomItems) + if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Toolbox) { - hasCustomItems = true; - gDropdownItems[i++].Format = STR_EMPTY; - } + // Add seperator + if (!hasCustomItems) + { + hasCustomItems = true; + gDropdownItems[i++].Format = STR_EMPTY; + } - gDropdownItems[i].Format = STR_STRING; - auto sz = item.Text.c_str(); - std::memcpy(&gDropdownItems[i].Args, &sz, sizeof(const char*)); - i++; + gDropdownItems[i].Format = STR_STRING; + auto sz = item.Text.c_str(); + std::memcpy(&gDropdownItems[i].Args, &sz, sizeof(const char*)); + i++; + } } } - } #endif - Widget* widget = &widgets[widgetIndex]; - int32_t yOffset = 0; - if (i > 5) - { - yOffset = -(widget->height() + 5 + (i * 12)); - } - - WindowDropdownShowText( - windowPos + ScreenCoordsXY{ widget->left, widget->top + yOffset }, widget->height() + 1, - TRANSLUCENT(colours[0]), Dropdown::Flag::StayOpen, i); - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (selectedIndex == -1) - { - return; - } - if (widgetIndex == WIDX_GAME_TOOLS) - { - switch (selectedIndex) - { - case DDIDX_SCENARIO_EDITOR: - Editor::Load(); - break; - case DDIDX_CONVERT_SAVED_GAME: - Editor::ConvertSaveToScenario(); - break; - case DDIDX_TRACK_DESIGNER: - Editor::LoadTrackDesigner(); - break; - case DDIDX_TRACK_MANAGER: - Editor::LoadTrackManager(); - break; - case DDIDX_OPEN_CONTENT_FOLDER: + Widget* widget = &widgets[widgetIndex]; + int32_t yOffset = 0; + if (i > 5) { - auto context = OpenRCT2::GetContext(); - auto env = context->GetPlatformEnvironment(); - auto uiContext = context->GetUiContext(); - uiContext->OpenFolder(env->GetDirectoryPath(OpenRCT2::DIRBASE::USER)); - break; + yOffset = -(widget->height() + 5 + (i * 12)); } - default: - InvokeCustomToolboxMenuItem(selectedIndex - DDIDX_CUSTOM_BEGIN); - break; + + WindowDropdownShowText( + windowPos + ScreenCoordsXY{ widget->left, widget->top + yOffset }, widget->height() + 1, + TRANSLUCENT(colours[0]), Dropdown::Flag::StayOpen, i); } } - } - CursorID OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID cursorId) override - { - gTooltipCloseTimeout = gCurrentRealTimeTicks + 2000; - return cursorId; - } - - void OnPrepareDraw() override - { - _filterRect = { windowPos + ScreenCoordsXY{ 0, UpdateButtonDims.height }, - windowPos + ScreenCoordsXY{ width - 1, MenuButtonDims.height + UpdateButtonDims.height - 1 } }; - if (OpenRCT2::GetContext()->HasNewVersionInfo()) + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override { - widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; - _filterRect.Point1.y = windowPos.y; + if (selectedIndex == -1) + { + return; + } + if (widgetIndex == WIDX_GAME_TOOLS) + { + switch (selectedIndex) + { + case DDIDX_SCENARIO_EDITOR: + Editor::Load(); + break; + case DDIDX_CONVERT_SAVED_GAME: + Editor::ConvertSaveToScenario(); + break; + case DDIDX_TRACK_DESIGNER: + Editor::LoadTrackDesigner(); + break; + case DDIDX_TRACK_MANAGER: + Editor::LoadTrackManager(); + break; + case DDIDX_OPEN_CONTENT_FOLDER: + { + auto context = OpenRCT2::GetContext(); + auto env = context->GetPlatformEnvironment(); + auto uiContext = context->GetUiContext(); + uiContext->OpenFolder(env->GetDirectoryPath(OpenRCT2::DIRBASE::USER)); + break; + } + default: + InvokeCustomToolboxMenuItem(selectedIndex - DDIDX_CUSTOM_BEGIN); + break; + } + } } - } - void OnDraw(DrawPixelInfo& dpi) override + CursorID OnCursor(WidgetIndex, const ScreenCoordsXY&, CursorID cursorId) override + { + gTooltipCloseTimeout = gCurrentRealTimeTicks + 2000; + return cursorId; + } + + void OnPrepareDraw() override + { + _filterRect = { windowPos + ScreenCoordsXY{ 0, UpdateButtonDims.height }, + windowPos + ScreenCoordsXY{ width - 1, MenuButtonDims.height + UpdateButtonDims.height - 1 } }; + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + { + widgets[WIDX_NEW_VERSION].type = WindowWidgetType::Button; + _filterRect.Point1.y = windowPos.y; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + GfxFilterRect(dpi, _filterRect, FilterPaletteID::Palette51); + DrawWidgets(dpi); + } + }; + + /** + * Creates the window containing the menu buttons on the title screen. + */ + WindowBase* WindowTitleMenuOpen() { - GfxFilterRect(dpi, _filterRect, FilterPaletteID::Palette51); - DrawWidgets(dpi); + const uint16_t windowHeight = MenuButtonDims.height + UpdateButtonDims.height; + return WindowCreate( + WindowClass::TitleMenu, ScreenCoordsXY(0, ContextGetHeight() - 182), 0, windowHeight, + WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND); } -}; - -/** - * Creates the window containing the menu buttons on the title screen. - */ -WindowBase* WindowTitleMenuOpen() -{ - const uint16_t windowHeight = MenuButtonDims.height + UpdateButtonDims.height; - return WindowCreate( - WindowClass::TitleMenu, ScreenCoordsXY(0, ContextGetHeight() - 182), 0, windowHeight, - WF_STICK_TO_BACK | WF_TRANSPARENT | WF_NO_BACKGROUND); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index fee3b088db..639b960a17 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -14,7 +14,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowTitleOptionsWidgetIdx { WIDX_OPTIONS, }; @@ -23,44 +25,46 @@ static Widget _windowTitleOptionsWidgets[] = { MakeWidget({0, 0}, {80, 15}, WindowWidgetType::Button, WindowColour::Tertiary, STR_OPTIONS, STR_OPTIONS_TIP), kWidgetsEnd, }; -// clang-format on + // clang-format on -class TitleOptionsWindow final : public Window -{ -public: - void OnOpen() override + class TitleOptionsWindow final : public Window { - widgets = _windowTitleOptionsWidgets; - WindowInitScrollWidgets(*this); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_OPTIONS: - ContextOpenWindow(WindowClass::Options); - break; + widgets = _windowTitleOptionsWidgets; + WindowInitScrollWidgets(*this); } - } - void OnDraw(DrawPixelInfo& dpi) override + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_OPTIONS: + ContextOpenWindow(WindowClass::Options); + break; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + } + }; + + /** + * Creates the window containing the options button on the title screen. + */ + WindowBase* WindowTitleOptionsOpen() { - DrawWidgets(dpi); - } -}; + auto* window = WindowBringToFrontByClass(WindowClass::TitleOptions); + if (window == nullptr) + { + window = WindowCreate( + WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), 80, 15, + WF_STICK_TO_BACK | WF_TRANSPARENT); + } -/** - * Creates the window containing the options button on the title screen. - */ -WindowBase* WindowTitleOptionsOpen() -{ - auto* window = WindowBringToFrontByClass(WindowClass::TitleOptions); - if (window == nullptr) - { - window = WindowCreate( - WindowClass::TitleOptions, ScreenCoordsXY(ContextGetWidth() - 80, 0), 80, 15, WF_STICK_TO_BACK | WF_TRANSPARENT); + return window; } - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 2517e1046a..049d0d0c13 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -18,7 +18,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum { WIDX_BACKGROUND }; @@ -28,181 +30,183 @@ static Widget _tooltipWidgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class TooltipWindow final : public Window -{ -private: - u8string _tooltipText; - int16_t _tooltipNumLines = 1; - -public: - TooltipWindow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) + class TooltipWindow final : public Window { - int32_t textWidth = FormatTextForTooltip(message); - int32_t textHeight = ((_tooltipNumLines + 1) * FontGetLineHeight(FontStyle::Small)); + private: + u8string _tooltipText; + int16_t _tooltipNumLines = 1; - width = textWidth + 5; - height = textHeight + 4; + public: + TooltipWindow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) + { + int32_t textWidth = FormatTextForTooltip(message); + int32_t textHeight = ((_tooltipNumLines + 1) * FontGetLineHeight(FontStyle::Small)); - widgets = _tooltipWidgets; - widgets[WIDX_BACKGROUND].right = width; - widgets[WIDX_BACKGROUND].bottom = height; + width = textWidth + 5; + height = textHeight + 4; - UpdatePosition(screenCoords); + widgets = _tooltipWidgets; + widgets[WIDX_BACKGROUND].right = width; + widgets[WIDX_BACKGROUND].bottom = height; + + UpdatePosition(screenCoords); + } + + void UpdatePosition(ScreenCoordsXY screenCoords) + { + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + screenCoords.x = std::clamp(screenCoords.x - (width / 2), 0, screenWidth - width); + + // TODO The cursor size will be relative to the window DPI. + // The amount to offset the y should be adjusted. + + const int32_t cursorHeight = 20; + const int32_t cursorMargin = 4; + const int32_t cursorOffset = cursorHeight + cursorMargin; + + const int32_t maxY = screenHeight - height; + + if (screenCoords.y + cursorOffset > maxY) + { + // Display the tooltip above the cursor if there is not enough space below. + screenCoords.y -= (height + cursorMargin); + } + else + { + // Display the tooltip under the cursor if there is enough space below. + screenCoords.y += cursorOffset; + } + + screenCoords.y = std::clamp(screenCoords.y, cursorOffset, maxY); + + if (windowPos != screenCoords) + { + WindowSetPosition(*this, screenCoords); + } + } + + void OnOpen() override + { + ResetTooltipNotShown(); + } + + void OnUpdate() override + { + UpdatePosition(gTooltipCursor); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + int32_t left = windowPos.x; + int32_t top = windowPos.y; + int32_t right = windowPos.x + width - 1; + int32_t bottom = windowPos.y + height - 1; + + // Background + GfxFilterRect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45); + GfxFilterRect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange); + + // Sides + GfxFilterRect(dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); + GfxFilterRect(dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); + GfxFilterRect(dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3); + GfxFilterRect(dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3); + + // Corners + GfxFilterPixel(dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3); + GfxFilterPixel(dpi, { right - 1, top + 1 }, FilterPaletteID::PaletteDarken3); + GfxFilterPixel(dpi, { left + 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); + GfxFilterPixel(dpi, { right - 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); + + // Text + left = windowPos.x + ((width + 1) / 2) - 1; + top = windowPos.y + 1; + DrawStringCentredRaw(dpi, { left, top }, _tooltipNumLines, _tooltipText.data(), FontStyle::Small); + } + + private: + // Returns the width of the new tooltip text + int32_t FormatTextForTooltip(const OpenRCT2String& message) + { + const u8string tempString = ::FormatStringID(message.str, message.args.Data()); + + OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() }; + formattedMessage.args.Add(tempString.c_str()); + const u8string tooltipTextUnwrapped = ::FormatStringID(formattedMessage.str, formattedMessage.args.Data()); + + auto textWidth = GfxGetStringWidthNewLined(tooltipTextUnwrapped, FontStyle::Small); + textWidth = std::min(textWidth, 196); + + int32_t numLines; + textWidth = GfxWrapString(tooltipTextUnwrapped, textWidth + 1, FontStyle::Small, &_tooltipText, &numLines); + _tooltipNumLines = numLines; + return textWidth; + } + }; + + void WindowTooltipReset(const ScreenCoordsXY& screenCoords) + { + gTooltipCursor = screenCoords; + gTooltipCloseTimeout = 0; + gTooltipWidget.window_classification = WindowClass::Null; + InputSetState(InputState::Normal); + InputSetFlag(INPUT_FLAG_4, false); } - void UpdatePosition(ScreenCoordsXY screenCoords) + void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) { - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - screenCoords.x = std::clamp(screenCoords.x - (width / 2), 0, screenWidth - width); + auto tooltipWindow = std::make_unique(message, screenCoords); + auto windowPos = tooltipWindow->windowPos; + auto width = tooltipWindow->width; + auto height = tooltipWindow->height; + WindowCreate( + std::move(tooltipWindow), WindowClass::Tooltip, windowPos, width, height, WF_TRANSPARENT | WF_STICK_TO_FRONT); + } - // TODO The cursor size will be relative to the window DPI. - // The amount to offset the y should be adjusted. + void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) + { + if (widgetWindow == nullptr || widgetIndex == -1) + return; - const int32_t cursorHeight = 20; - const int32_t cursorMargin = 4; - const int32_t cursorOffset = cursorHeight + cursorMargin; + auto widget = &widgetWindow->widgets[widgetIndex]; + widgetWindow->OnPrepareDraw(); - const int32_t maxY = screenHeight - height; - - if (screenCoords.y + cursorOffset > maxY) + OpenRCT2String result; + if (widget->flags & WIDGET_FLAGS::TOOLTIP_IS_STRING) { - // Display the tooltip above the cursor if there is not enough space below. - screenCoords.y -= (height + cursorMargin); + auto tooltipString = widget->sztooltip; + if (*tooltipString == 0) + return; + + result.str = STR_STRING_TOOLTIP; + result.args = Formatter(); + result.args.Add(tooltipString); + + gTooltipWidget.window_classification = widgetWindow->classification; + gTooltipWidget.window_number = widgetWindow->number; + gTooltipWidget.widget_index = widgetIndex; } else { - // Display the tooltip under the cursor if there is enough space below. - screenCoords.y += cursorOffset; + auto stringId = widget->tooltip; + gTooltipWidget.window_classification = widgetWindow->classification; + gTooltipWidget.window_number = widgetWindow->number; + gTooltipWidget.widget_index = widgetIndex; + result = widgetWindow->OnTooltip(widgetIndex, stringId); + if (result.str == STR_NONE) + return; } - screenCoords.y = std::clamp(screenCoords.y, cursorOffset, maxY); - - if (windowPos != screenCoords) - { - WindowSetPosition(*this, screenCoords); - } + WindowTooltipShow(result, screenCoords); } - void OnOpen() override + void WindowTooltipClose() { - ResetTooltipNotShown(); + WindowCloseByClass(WindowClass::Tooltip); + gTooltipCloseTimeout = 0; + gTooltipWidget.window_classification = WindowClass::Null; } - - void OnUpdate() override - { - UpdatePosition(gTooltipCursor); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - int32_t left = windowPos.x; - int32_t top = windowPos.y; - int32_t right = windowPos.x + width - 1; - int32_t bottom = windowPos.y + height - 1; - - // Background - GfxFilterRect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::Palette45); - GfxFilterRect(dpi, { { left + 1, top + 1 }, { right - 1, bottom - 1 } }, FilterPaletteID::PaletteGlassLightOrange); - - // Sides - GfxFilterRect(dpi, { { left + 0, top + 2 }, { left + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); - GfxFilterRect(dpi, { { right + 0, top + 2 }, { right + 0, bottom - 2 } }, FilterPaletteID::PaletteDarken3); - GfxFilterRect(dpi, { { left + 2, bottom + 0 }, { right - 2, bottom + 0 } }, FilterPaletteID::PaletteDarken3); - GfxFilterRect(dpi, { { left + 2, top + 0 }, { right - 2, top + 0 } }, FilterPaletteID::PaletteDarken3); - - // Corners - GfxFilterPixel(dpi, { left + 1, top + 1 }, FilterPaletteID::PaletteDarken3); - GfxFilterPixel(dpi, { right - 1, top + 1 }, FilterPaletteID::PaletteDarken3); - GfxFilterPixel(dpi, { left + 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); - GfxFilterPixel(dpi, { right - 1, bottom - 1 }, FilterPaletteID::PaletteDarken3); - - // Text - left = windowPos.x + ((width + 1) / 2) - 1; - top = windowPos.y + 1; - DrawStringCentredRaw(dpi, { left, top }, _tooltipNumLines, _tooltipText.data(), FontStyle::Small); - } - -private: - // Returns the width of the new tooltip text - int32_t FormatTextForTooltip(const OpenRCT2String& message) - { - const u8string tempString = FormatStringID(message.str, message.args.Data()); - - OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() }; - formattedMessage.args.Add(tempString.c_str()); - const u8string tooltipTextUnwrapped = FormatStringID(formattedMessage.str, formattedMessage.args.Data()); - - auto textWidth = GfxGetStringWidthNewLined(tooltipTextUnwrapped, FontStyle::Small); - textWidth = std::min(textWidth, 196); - - int32_t numLines; - textWidth = GfxWrapString(tooltipTextUnwrapped, textWidth + 1, FontStyle::Small, &_tooltipText, &numLines); - _tooltipNumLines = numLines; - return textWidth; - } -}; - -void WindowTooltipReset(const ScreenCoordsXY& screenCoords) -{ - gTooltipCursor = screenCoords; - gTooltipCloseTimeout = 0; - gTooltipWidget.window_classification = WindowClass::Null; - InputSetState(InputState::Normal); - InputSetFlag(INPUT_FLAG_4, false); -} - -void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords) -{ - auto tooltipWindow = std::make_unique(message, screenCoords); - auto windowPos = tooltipWindow->windowPos; - auto width = tooltipWindow->width; - auto height = tooltipWindow->height; - WindowCreate(std::move(tooltipWindow), WindowClass::Tooltip, windowPos, width, height, WF_TRANSPARENT | WF_STICK_TO_FRONT); -} - -void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) -{ - if (widgetWindow == nullptr || widgetIndex == -1) - return; - - auto widget = &widgetWindow->widgets[widgetIndex]; - widgetWindow->OnPrepareDraw(); - - OpenRCT2String result; - if (widget->flags & WIDGET_FLAGS::TOOLTIP_IS_STRING) - { - auto tooltipString = widget->sztooltip; - if (*tooltipString == 0) - return; - - result.str = STR_STRING_TOOLTIP; - result.args = Formatter(); - result.args.Add(tooltipString); - - gTooltipWidget.window_classification = widgetWindow->classification; - gTooltipWidget.window_number = widgetWindow->number; - gTooltipWidget.widget_index = widgetIndex; - } - else - { - auto stringId = widget->tooltip; - gTooltipWidget.window_classification = widgetWindow->classification; - gTooltipWidget.window_number = widgetWindow->number; - gTooltipWidget.widget_index = widgetIndex; - result = widgetWindow->OnTooltip(widgetIndex, stringId); - if (result.str == STR_NONE) - return; - } - - WindowTooltipShow(result, screenCoords); -} - -void WindowTooltipClose() -{ - WindowCloseByClass(WindowClass::Tooltip); - gTooltipCloseTimeout = 0; - gTooltipWidget.window_classification = WindowClass::Null; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index ec93fe72da..b349881355 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -73,143 +73,142 @@ #include #include -using namespace OpenRCT2; -using namespace OpenRCT2::Ui; - -enum +namespace OpenRCT2::Ui::Windows { - WIDX_PAUSE, - WIDX_FILE_MENU, - WIDX_MUTE, - WIDX_ZOOM_OUT, - WIDX_ZOOM_IN, - WIDX_ROTATE, - WIDX_VIEW_MENU, - WIDX_MAP, + enum + { + WIDX_PAUSE, + WIDX_FILE_MENU, + WIDX_MUTE, + WIDX_ZOOM_OUT, + WIDX_ZOOM_IN, + WIDX_ROTATE, + WIDX_VIEW_MENU, + WIDX_MAP, - WIDX_LAND, - WIDX_WATER, - WIDX_SCENERY, - WIDX_PATH, - WIDX_CONSTRUCT_RIDE, - WIDX_RIDES, - WIDX_PARK, - WIDX_STAFF, - WIDX_GUESTS, - WIDX_CLEAR_SCENERY, + WIDX_LAND, + WIDX_WATER, + WIDX_SCENERY, + WIDX_PATH, + WIDX_CONSTRUCT_RIDE, + WIDX_RIDES, + WIDX_PARK, + WIDX_STAFF, + WIDX_GUESTS, + WIDX_CLEAR_SCENERY, - WIDX_FASTFORWARD, - WIDX_CHEATS, - WIDX_DEBUG, - WIDX_FINANCES, - WIDX_RESEARCH, - WIDX_NEWS, - WIDX_NETWORK, - WIDX_CHAT, + WIDX_FASTFORWARD, + WIDX_CHEATS, + WIDX_DEBUG, + WIDX_FINANCES, + WIDX_RESEARCH, + WIDX_NEWS, + WIDX_NETWORK, + WIDX_CHAT, - WIDX_SEPARATOR, -}; + WIDX_SEPARATOR, + }; -validate_global_widx(WC_TOP_TOOLBAR, WIDX_PAUSE); -validate_global_widx(WC_TOP_TOOLBAR, WIDX_LAND); -validate_global_widx(WC_TOP_TOOLBAR, WIDX_WATER); -validate_global_widx(WC_TOP_TOOLBAR, WIDX_SCENERY); -validate_global_widx(WC_TOP_TOOLBAR, WIDX_PATH); + validate_global_widx(WC_TOP_TOOLBAR, WIDX_PAUSE); + validate_global_widx(WC_TOP_TOOLBAR, WIDX_LAND); + validate_global_widx(WC_TOP_TOOLBAR, WIDX_WATER); + validate_global_widx(WC_TOP_TOOLBAR, WIDX_SCENERY); + validate_global_widx(WC_TOP_TOOLBAR, WIDX_PATH); -enum FileMenuDdidx -{ - DDIDX_NEW_GAME = 0, - DDIDX_LOAD_GAME = 1, - DDIDX_SAVE_GAME = 2, - DDIDX_SAVE_GAME_AS = 3, - // separator - DDIDX_ABOUT = 5, - DDIDX_OPTIONS = 6, - DDIDX_SCREENSHOT = 7, - DDIDX_GIANT_SCREENSHOT = 8, - // separator - DDIDX_FILE_BUG_ON_GITHUB = 10, - DDIDX_UPDATE_AVAILABLE = 11, - // separator - DDIDX_QUIT_TO_MENU = 13, - DDIDX_EXIT_OPENRCT2 = 14, -}; + enum FileMenuDdidx + { + DDIDX_NEW_GAME = 0, + DDIDX_LOAD_GAME = 1, + DDIDX_SAVE_GAME = 2, + DDIDX_SAVE_GAME_AS = 3, + // separator + DDIDX_ABOUT = 5, + DDIDX_OPTIONS = 6, + DDIDX_SCREENSHOT = 7, + DDIDX_GIANT_SCREENSHOT = 8, + // separator + DDIDX_FILE_BUG_ON_GITHUB = 10, + DDIDX_UPDATE_AVAILABLE = 11, + // separator + DDIDX_QUIT_TO_MENU = 13, + DDIDX_EXIT_OPENRCT2 = 14, + }; -enum TopToolbarViewMenuDdidx -{ - DDIDX_UNDERGROUND_INSIDE = 0, - DDIDX_TRANSPARENT_WATER = 1, - DDIDX_HIDE_BASE = 2, - DDIDX_HIDE_VERTICAL = 3, - // separator - DDIDX_HIDE_RIDES = 5, - DDIDX_HIDE_VEHICLES = 6, - DDIDX_HIDE_VEGETATION = 7, - DDIDX_HIDE_SCENERY = 8, - DDIDX_HIDE_PATHS = 9, - DDIDX_HIDE_SUPPORTS = 10, - DDIDX_HIDE_GUESTS = 11, - DDIDX_HIDE_STAFF = 12, - // separator - DDIDX_LAND_HEIGHTS = 14, - DDIDX_TRACK_HEIGHTS = 15, - DDIDX_PATH_HEIGHTS = 16, - // separator - DDIDX_VIEW_CLIPPING = 18, - DDIDX_HIGHLIGHT_PATH_ISSUES = 19, - // separator - DDIDX_TRANSPARENCY = 21, + enum TopToolbarViewMenuDdidx + { + DDIDX_UNDERGROUND_INSIDE = 0, + DDIDX_TRANSPARENT_WATER = 1, + DDIDX_HIDE_BASE = 2, + DDIDX_HIDE_VERTICAL = 3, + // separator + DDIDX_HIDE_RIDES = 5, + DDIDX_HIDE_VEHICLES = 6, + DDIDX_HIDE_VEGETATION = 7, + DDIDX_HIDE_SCENERY = 8, + DDIDX_HIDE_PATHS = 9, + DDIDX_HIDE_SUPPORTS = 10, + DDIDX_HIDE_GUESTS = 11, + DDIDX_HIDE_STAFF = 12, + // separator + DDIDX_LAND_HEIGHTS = 14, + DDIDX_TRACK_HEIGHTS = 15, + DDIDX_PATH_HEIGHTS = 16, + // separator + DDIDX_VIEW_CLIPPING = 18, + DDIDX_HIGHLIGHT_PATH_ISSUES = 19, + // separator + DDIDX_TRANSPARENCY = 21, - TOP_TOOLBAR_VIEW_MENU_COUNT, -}; + TOP_TOOLBAR_VIEW_MENU_COUNT, + }; -enum TopToolbarDebugDdidx -{ - DDIDX_CONSOLE = 0, - DDIDX_DEBUG_PAINT = 1, + enum TopToolbarDebugDdidx + { + DDIDX_CONSOLE = 0, + DDIDX_DEBUG_PAINT = 1, - TOP_TOOLBAR_DEBUG_COUNT, -}; + TOP_TOOLBAR_DEBUG_COUNT, + }; -enum TopToolbarNetworkDdidx -{ - DDIDX_MULTIPLAYER = 0, - DDIDX_MULTIPLAYER_RECONNECT = 1, + enum TopToolbarNetworkDdidx + { + DDIDX_MULTIPLAYER = 0, + DDIDX_MULTIPLAYER_RECONNECT = 1, - TOP_TOOLBAR_NETWORK_COUNT, -}; + TOP_TOOLBAR_NETWORK_COUNT, + }; -enum -{ - DDIDX_CHEATS, - DDIDX_TILE_INSPECTOR = 1, - DDIDX_OBJECT_SELECTION = 2, - DDIDX_INVENTIONS_LIST = 3, - DDIDX_SCENARIO_OPTIONS = 4, - DDIDX_OBJECTIVE_OPTIONS = 5, - // 6 is a separator - DDIDX_ENABLE_SANDBOX_MODE = 7, - DDIDX_DISABLE_CLEARANCE_CHECKS = 8, - DDIDX_DISABLE_SUPPORT_LIMITS = 9, + enum + { + DDIDX_CHEATS, + DDIDX_TILE_INSPECTOR = 1, + DDIDX_OBJECT_SELECTION = 2, + DDIDX_INVENTIONS_LIST = 3, + DDIDX_SCENARIO_OPTIONS = 4, + DDIDX_OBJECTIVE_OPTIONS = 5, + // 6 is a separator + DDIDX_ENABLE_SANDBOX_MODE = 7, + DDIDX_DISABLE_CLEARANCE_CHECKS = 8, + DDIDX_DISABLE_SUPPORT_LIMITS = 9, - TOP_TOOLBAR_CHEATS_COUNT, -}; + TOP_TOOLBAR_CHEATS_COUNT, + }; -enum -{ - DDIDX_SHOW_MAP, - DDIDX_OPEN_VIEWPORT, -}; + enum + { + DDIDX_SHOW_MAP, + DDIDX_OPEN_VIEWPORT, + }; -enum -{ - DDIDX_ROTATE_CLOCKWISE, - DDIDX_ROTATE_ANTI_CLOCKWISE, -}; + enum + { + DDIDX_ROTATE_CLOCKWISE, + DDIDX_ROTATE_ANTI_CLOCKWISE, + }; #pragma region Toolbar_widget_ordering -// clang-format off + // clang-format off // from left to right static constexpr int32_t left_aligned_widgets_order[] = { WIDX_PAUSE, @@ -282,250 +281,327 @@ static Widget _topToolbarWidgets[] = { MakeWidget ({ 0, 0}, {10, 1}, WindowWidgetType::Empty, WindowColour::Primary ), // Artificial widget separator kWidgetsEnd, }; -// clang-format on + // clang-format on -static void ScenarioSelectCallback(const utf8* path); + static void ScenarioSelectCallback(const utf8* path); -class TopToolbar final : public Window -{ -private: - bool _landToolBlocked{ false }; - uint8_t _unkF64F0E{ 0 }; - int16_t _unkF64F0A{ 0 }; - - void InitViewMenu(Widget& widget); - - void ViewMenuDropdown(int16_t dropdownIndex); - - void InitMapMenu(Widget& widget); - - void MapMenuDropdown(int16_t dropdownIndex); - - void InitFastforwardMenu(Widget& widget); - - void FastforwardMenuDropdown(int16_t dropdownIndex); - - void InitRotateMenu(Widget& widget); - - void RotateMenuDropdown(int16_t dropdownIndex); - - void InitCheatsMenu(Widget& widget); - - void CheatsMenuDropdown(int16_t dropdownIndex); - - void InitDebugMenu(Widget& widget); - - void DebugMenuDropdown(int16_t dropdownIndex); - - void InitNetworkMenu(Widget& widget); - - void NetworkMenuDropdown(int16_t dropdownIndex); - - /** - * - * rct2: 0x0066CCE7 - */ - void ToggleFootpathWindow() + class TopToolbar final : public Window { - if (WindowFindByClass(WindowClass::Footpath) == nullptr) - { - ContextOpenWindow(WindowClass::Footpath); - } - else - { - ToolCancel(); - WindowCloseByClass(WindowClass::Footpath); - } - } + private: + bool _landToolBlocked{ false }; + uint8_t _unkF64F0E{ 0 }; + int16_t _unkF64F0A{ 0 }; - /** - * - * rct2: 0x0066CD54 - */ - void ToggleLandWindow(WidgetIndex widgetIndex) - { - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar - && gCurrentToolWidget.widget_index == WIDX_LAND) - { - ToolCancel(); - } - else - { - _landToolBlocked = false; - ShowGridlines(); - ToolSet(*this, widgetIndex, Tool::DigDown); - InputSetFlag(INPUT_FLAG_6, true); - ContextOpenWindow(WindowClass::Land); - } - } + void InitViewMenu(Widget& widget); - /** - * - * rct2: 0x0066CD0C - */ - void ToggleClearSceneryWindow(WidgetIndex widgetIndex) - { - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar - && gCurrentToolWidget.widget_index == WIDX_CLEAR_SCENERY)) + void ViewMenuDropdown(int16_t dropdownIndex); + + void InitMapMenu(Widget& widget); + + void MapMenuDropdown(int16_t dropdownIndex); + + void InitFastforwardMenu(Widget& widget); + + void FastforwardMenuDropdown(int16_t dropdownIndex); + + void InitRotateMenu(Widget& widget); + + void RotateMenuDropdown(int16_t dropdownIndex); + + void InitCheatsMenu(Widget& widget); + + void CheatsMenuDropdown(int16_t dropdownIndex); + + void InitDebugMenu(Widget& widget); + + void DebugMenuDropdown(int16_t dropdownIndex); + + void InitNetworkMenu(Widget& widget); + + void NetworkMenuDropdown(int16_t dropdownIndex); + + /** + * + * rct2: 0x0066CCE7 + */ + void ToggleFootpathWindow() { - ToolCancel(); - } - else - { - ShowGridlines(); - ToolSet(*this, widgetIndex, Tool::Crosshair); - InputSetFlag(INPUT_FLAG_6, true); - ContextOpenWindow(WindowClass::ClearScenery); - } - } - - /** - * - * rct2: 0x0066CD9C - */ - void ToggleWaterWindow(WidgetIndex widgetIndex) - { - if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar - && gCurrentToolWidget.widget_index == WIDX_WATER) - { - ToolCancel(); - } - else - { - _landToolBlocked = false; - ShowGridlines(); - ToolSet(*this, widgetIndex, Tool::WaterDown); - InputSetFlag(INPUT_FLAG_6, true); - ContextOpenWindow(WindowClass::Water); - } - } - - /** - * - * rct2: 0x0068E213 - */ - void ToolUpdateSceneryClear(const ScreenCoordsXY& screenPos) - { - if (!ToolUpdateLandPaint(screenPos)) - return; - - auto action = GetClearAction(); - auto result = GameActions::Query(&action); - auto cost = (result.Error == GameActions::Status::Ok ? result.Cost : kMoney64Undefined); - if (gClearSceneryCost != cost) - { - gClearSceneryCost = cost; - WindowInvalidateByClass(WindowClass::ClearScenery); - } - } - - int8_t ToolUpdateLandPaint(const ScreenCoordsXY& screenPos) - { - uint8_t state_changed = 0; - - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - auto mapTile = ScreenGetMapXY(screenPos, nullptr); - - if (!mapTile.has_value()) - { - if (gClearSceneryCost != kMoney64Undefined) + if (WindowFindByClass(WindowClass::Footpath) == nullptr) { - gClearSceneryCost = kMoney64Undefined; + ContextOpenWindow(WindowClass::Footpath); + } + else + { + ToolCancel(); + WindowCloseByClass(WindowClass::Footpath); + } + } + + /** + * + * rct2: 0x0066CD54 + */ + void ToggleLandWindow(WidgetIndex widgetIndex) + { + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar + && gCurrentToolWidget.widget_index == WIDX_LAND) + { + ToolCancel(); + } + else + { + _landToolBlocked = false; + ShowGridlines(); + ToolSet(*this, widgetIndex, Tool::DigDown); + InputSetFlag(INPUT_FLAG_6, true); + ContextOpenWindow(WindowClass::Land); + } + } + + /** + * + * rct2: 0x0066CD0C + */ + void ToggleClearSceneryWindow(WidgetIndex widgetIndex) + { + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar + && gCurrentToolWidget.widget_index == WIDX_CLEAR_SCENERY)) + { + ToolCancel(); + } + else + { + ShowGridlines(); + ToolSet(*this, widgetIndex, Tool::Crosshair); + InputSetFlag(INPUT_FLAG_6, true); + ContextOpenWindow(WindowClass::ClearScenery); + } + } + + /** + * + * rct2: 0x0066CD9C + */ + void ToggleWaterWindow(WidgetIndex widgetIndex) + { + if ((InputTestFlag(INPUT_FLAG_TOOL_ACTIVE)) && gCurrentToolWidget.window_classification == WindowClass::TopToolbar + && gCurrentToolWidget.widget_index == WIDX_WATER) + { + ToolCancel(); + } + else + { + _landToolBlocked = false; + ShowGridlines(); + ToolSet(*this, widgetIndex, Tool::WaterDown); + InputSetFlag(INPUT_FLAG_6, true); + ContextOpenWindow(WindowClass::Water); + } + } + + /** + * + * rct2: 0x0068E213 + */ + void ToolUpdateSceneryClear(const ScreenCoordsXY& screenPos) + { + if (!ToolUpdateLandPaint(screenPos)) + return; + + auto action = GetClearAction(); + auto result = GameActions::Query(&action); + auto cost = (result.Error == GameActions::Status::Ok ? result.Cost : kMoney64Undefined); + if (gClearSceneryCost != cost) + { + gClearSceneryCost = cost; WindowInvalidateByClass(WindowClass::ClearScenery); } + } + + int8_t ToolUpdateLandPaint(const ScreenCoordsXY& screenPos) + { + uint8_t state_changed = 0; + + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + + auto mapTile = ScreenGetMapXY(screenPos, nullptr); + + if (!mapTile.has_value()) + { + if (gClearSceneryCost != kMoney64Undefined) + { + gClearSceneryCost = kMoney64Undefined; + WindowInvalidateByClass(WindowClass::ClearScenery); + } + return state_changed; + } + + if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + state_changed++; + } + + if (gMapSelectType != MAP_SELECT_TYPE_FULL) + { + gMapSelectType = MAP_SELECT_TYPE_FULL; + state_changed++; + } + + int16_t tool_size = std::max(1, gLandToolSize); + int16_t tool_length = (tool_size - 1) * 32; + + // Move to tool bottom left + mapTile->x -= (tool_size - 1) * 16; + mapTile->y -= (tool_size - 1) * 16; + mapTile = mapTile->ToTileStart(); + + if (gMapSelectPositionA.x != mapTile->x) + { + gMapSelectPositionA.x = mapTile->x; + state_changed++; + } + + if (gMapSelectPositionA.y != mapTile->y) + { + gMapSelectPositionA.y = mapTile->y; + state_changed++; + } + + mapTile->x += tool_length; + mapTile->y += tool_length; + + if (gMapSelectPositionB.x != mapTile->x) + { + gMapSelectPositionB.x = mapTile->x; + state_changed++; + } + + if (gMapSelectPositionB.y != mapTile->y) + { + gMapSelectPositionB.y = mapTile->y; + state_changed++; + } + + MapInvalidateSelectionRect(); return state_changed; } - if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + /** + * + * rct2: 0x00664280 + */ + void ToolUpdateLand(const ScreenCoordsXY& screenPos) { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - state_changed++; - } + const bool mapCtrlPressed = InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z); - if (gMapSelectType != MAP_SELECT_TYPE_FULL) - { - gMapSelectType = MAP_SELECT_TYPE_FULL; - state_changed++; - } + MapInvalidateSelectionRect(); - int16_t tool_size = std::max(1, gLandToolSize); - int16_t tool_length = (tool_size - 1) * 32; - - // Move to tool bottom left - mapTile->x -= (tool_size - 1) * 16; - mapTile->y -= (tool_size - 1) * 16; - mapTile = mapTile->ToTileStart(); - - if (gMapSelectPositionA.x != mapTile->x) - { - gMapSelectPositionA.x = mapTile->x; - state_changed++; - } - - if (gMapSelectPositionA.y != mapTile->y) - { - gMapSelectPositionA.y = mapTile->y; - state_changed++; - } - - mapTile->x += tool_length; - mapTile->y += tool_length; - - if (gMapSelectPositionB.x != mapTile->x) - { - gMapSelectPositionB.x = mapTile->x; - state_changed++; - } - - if (gMapSelectPositionB.y != mapTile->y) - { - gMapSelectPositionB.y = mapTile->y; - state_changed++; - } - - MapInvalidateSelectionRect(); - return state_changed; - } - - /** - * - * rct2: 0x00664280 - */ - void ToolUpdateLand(const ScreenCoordsXY& screenPos) - { - const bool mapCtrlPressed = InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z); - - MapInvalidateSelectionRect(); - - if (gCurrentToolId == Tool::UpDownArrow) - { - if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) - return; - - money64 lower_cost = SelectionLowerLand(0); - money64 raise_cost = SelectionRaiseLand(0); - - if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) + if (gCurrentToolId == Tool::UpDownArrow) { - gLandToolRaiseCost = raise_cost; - gLandToolLowerCost = lower_cost; - WindowInvalidateByClass(WindowClass::Land); + if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + return; + + money64 lower_cost = SelectionLowerLand(0); + money64 raise_cost = SelectionRaiseLand(0); + + if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) + { + gLandToolRaiseCost = raise_cost; + gLandToolLowerCost = lower_cost; + WindowInvalidateByClass(WindowClass::Land); + } + return; } - return; - } - int16_t tool_size = gLandToolSize; - std::optional mapTile; - uint8_t side{}; + int16_t tool_size = gLandToolSize; + std::optional mapTile; + uint8_t side{}; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - if (tool_size == 1) - { - int32_t selectionType; - // Get selection type and map coordinates from mouse x,y position - ScreenPosToMapPos(screenPos, &selectionType); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + if (tool_size == 1) + { + int32_t selectionType; + // Get selection type and map coordinates from mouse x,y position + ScreenPosToMapPos(screenPos, &selectionType); + mapTile = ScreenGetMapXYSide(screenPos, &side); + + if (!mapTile.has_value()) + { + money64 lower_cost = kMoney64Undefined; + money64 raise_cost = kMoney64Undefined; + + if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) + { + gLandToolRaiseCost = raise_cost; + gLandToolLowerCost = lower_cost; + WindowInvalidateByClass(WindowClass::Land); + } + return; + } + + uint8_t state_changed = 0; + + if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + state_changed++; + } + + if (gMapSelectType != selectionType) + { + gMapSelectType = selectionType; + state_changed++; + } + + if ((gMapSelectType != MAP_SELECT_TYPE_EDGE_0 + (side & 0xFF)) && mapCtrlPressed) + { + gMapSelectType = MAP_SELECT_TYPE_EDGE_0 + (side & 0xFF); + state_changed++; + } + + if (gMapSelectPositionA.x != mapTile->x) + { + gMapSelectPositionA.x = mapTile->x; + state_changed++; + } + + if (gMapSelectPositionA.y != mapTile->y) + { + gMapSelectPositionA.y = mapTile->y; + state_changed++; + } + + if (gMapSelectPositionB.x != mapTile->x) + { + gMapSelectPositionB.x = mapTile->x; + state_changed++; + } + + if (gMapSelectPositionB.y != mapTile->y) + { + gMapSelectPositionB.y = mapTile->y; + state_changed++; + } + + MapInvalidateSelectionRect(); + if (!state_changed) + return; + + money64 lower_cost = SelectionLowerLand(0); + money64 raise_cost = SelectionRaiseLand(0); + + if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) + { + gLandToolRaiseCost = raise_cost; + gLandToolLowerCost = lower_cost; + WindowInvalidateByClass(WindowClass::Land); + } + return; + } + + // Get map coordinates and the side of the tile that is being hovered over mapTile = ScreenGetMapXYSide(screenPos, &side); if (!mapTile.has_value()) @@ -550,9 +626,9 @@ private: state_changed++; } - if (gMapSelectType != selectionType) + if (gMapSelectType != MAP_SELECT_TYPE_FULL) { - gMapSelectType = selectionType; + gMapSelectType = MAP_SELECT_TYPE_FULL; state_changed++; } @@ -562,6 +638,34 @@ private: state_changed++; } + if (tool_size == 0) + tool_size = 1; + + int16_t tool_length = (tool_size - 1) * 32; + + // Decide on shape of the brush for bigger selection size + switch (gMapSelectType) + { + case MAP_SELECT_TYPE_EDGE_0: + case MAP_SELECT_TYPE_EDGE_2: + // Line + mapTile->y -= (tool_size - 1) * 16; + mapTile->y = mapTile->ToTileStart().y; + break; + case MAP_SELECT_TYPE_EDGE_1: + case MAP_SELECT_TYPE_EDGE_3: + // Line + mapTile->x -= (tool_size - 1) * 16; + mapTile->x = mapTile->ToTileStart().x; + break; + default: + // Move to tool bottom left + mapTile->x -= (tool_size - 1) * 16; + mapTile->y -= (tool_size - 1) * 16; + mapTile = mapTile->ToTileStart(); + break; + } + if (gMapSelectPositionA.x != mapTile->x) { gMapSelectPositionA.x = mapTile->x; @@ -574,6 +678,27 @@ private: state_changed++; } + // Go to other side + switch (gMapSelectType) + { + case MAP_SELECT_TYPE_EDGE_0: + case MAP_SELECT_TYPE_EDGE_2: + // Line + mapTile->y += tool_length; + gMapSelectType = MAP_SELECT_TYPE_FULL; + break; + case MAP_SELECT_TYPE_EDGE_1: + case MAP_SELECT_TYPE_EDGE_3: + // Line + mapTile->x += tool_length; + gMapSelectType = MAP_SELECT_TYPE_FULL; + break; + default: + mapTile->x += tool_length; + mapTile->y += tool_length; + break; + } + if (gMapSelectPositionB.x != mapTile->x) { gMapSelectPositionB.x = mapTile->x; @@ -599,145 +724,111 @@ private: gLandToolLowerCost = lower_cost; WindowInvalidateByClass(WindowClass::Land); } - return; } - // Get map coordinates and the side of the tile that is being hovered over - mapTile = ScreenGetMapXYSide(screenPos, &side); - - if (!mapTile.has_value()) + /** + * + * rct2: 0x006E6BDC + */ + void ToolUpdateWater(const ScreenCoordsXY& screenPos) { - money64 lower_cost = kMoney64Undefined; - money64 raise_cost = kMoney64Undefined; + MapInvalidateSelectionRect(); - if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) + if (gCurrentToolId == Tool::UpDownArrow) { - gLandToolRaiseCost = raise_cost; - gLandToolLowerCost = lower_cost; - WindowInvalidateByClass(WindowClass::Land); + if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + return; + + auto waterLowerAction = WaterLowerAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); + auto waterRaiseAction = WaterRaiseAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); + + auto res = GameActions::Query(&waterLowerAction); + money64 lowerCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + + res = GameActions::Query(&waterRaiseAction); + money64 raiseCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + + if (gWaterToolRaiseCost != raiseCost || gWaterToolLowerCost != lowerCost) + { + gWaterToolRaiseCost = raiseCost; + gWaterToolLowerCost = lowerCost; + WindowInvalidateByClass(WindowClass::Water); + } + return; } - return; - } - uint8_t state_changed = 0; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - state_changed++; - } + auto info = GetMapCoordinatesFromPos( + screenPos, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water)); - if (gMapSelectType != MAP_SELECT_TYPE_FULL) - { - gMapSelectType = MAP_SELECT_TYPE_FULL; - state_changed++; - } + if (info.SpriteType == ViewportInteractionItem::None) + { + if (gWaterToolRaiseCost != kMoney64Undefined || gWaterToolLowerCost != kMoney64Undefined) + { + gWaterToolRaiseCost = kMoney64Undefined; + gWaterToolLowerCost = kMoney64Undefined; + WindowInvalidateByClass(WindowClass::Water); + } + return; + } - if ((gMapSelectType != MAP_SELECT_TYPE_EDGE_0 + (side & 0xFF)) && mapCtrlPressed) - { - gMapSelectType = MAP_SELECT_TYPE_EDGE_0 + (side & 0xFF); - state_changed++; - } + auto mapTile = info.Loc.ToTileCentre(); - if (tool_size == 0) - tool_size = 1; + uint8_t state_changed = 0; - int16_t tool_length = (tool_size - 1) * 32; - - // Decide on shape of the brush for bigger selection size - switch (gMapSelectType) - { - case MAP_SELECT_TYPE_EDGE_0: - case MAP_SELECT_TYPE_EDGE_2: - // Line - mapTile->y -= (tool_size - 1) * 16; - mapTile->y = mapTile->ToTileStart().y; - break; - case MAP_SELECT_TYPE_EDGE_1: - case MAP_SELECT_TYPE_EDGE_3: - // Line - mapTile->x -= (tool_size - 1) * 16; - mapTile->x = mapTile->ToTileStart().x; - break; - default: - // Move to tool bottom left - mapTile->x -= (tool_size - 1) * 16; - mapTile->y -= (tool_size - 1) * 16; - mapTile = mapTile->ToTileStart(); - break; - } - - if (gMapSelectPositionA.x != mapTile->x) - { - gMapSelectPositionA.x = mapTile->x; - state_changed++; - } - - if (gMapSelectPositionA.y != mapTile->y) - { - gMapSelectPositionA.y = mapTile->y; - state_changed++; - } - - // Go to other side - switch (gMapSelectType) - { - case MAP_SELECT_TYPE_EDGE_0: - case MAP_SELECT_TYPE_EDGE_2: - // Line - mapTile->y += tool_length; - gMapSelectType = MAP_SELECT_TYPE_FULL; - break; - case MAP_SELECT_TYPE_EDGE_1: - case MAP_SELECT_TYPE_EDGE_3: - // Line - mapTile->x += tool_length; - gMapSelectType = MAP_SELECT_TYPE_FULL; - break; - default: - mapTile->x += tool_length; - mapTile->y += tool_length; - break; - } - - if (gMapSelectPositionB.x != mapTile->x) - { - gMapSelectPositionB.x = mapTile->x; - state_changed++; - } - - if (gMapSelectPositionB.y != mapTile->y) - { - gMapSelectPositionB.y = mapTile->y; - state_changed++; - } - - MapInvalidateSelectionRect(); - if (!state_changed) - return; - - money64 lower_cost = SelectionLowerLand(0); - money64 raise_cost = SelectionRaiseLand(0); - - if (gLandToolRaiseCost != raise_cost || gLandToolLowerCost != lower_cost) - { - gLandToolRaiseCost = raise_cost; - gLandToolLowerCost = lower_cost; - WindowInvalidateByClass(WindowClass::Land); - } - } - - /** - * - * rct2: 0x006E6BDC - */ - void ToolUpdateWater(const ScreenCoordsXY& screenPos) - { - MapInvalidateSelectionRect(); - - if (gCurrentToolId == Tool::UpDownArrow) - { if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + state_changed++; + } + + if (gMapSelectType != MAP_SELECT_TYPE_FULL_WATER) + { + gMapSelectType = MAP_SELECT_TYPE_FULL_WATER; + state_changed++; + } + + int16_t tool_size = std::max(1, gLandToolSize); + int16_t tool_length = (tool_size - 1) * 32; + + // Move to tool bottom left + mapTile.x -= (tool_size - 1) * 16; + mapTile.y -= (tool_size - 1) * 16; + mapTile.x &= 0xFFE0; + mapTile.y &= 0xFFE0; + + if (gMapSelectPositionA.x != mapTile.x) + { + gMapSelectPositionA.x = mapTile.x; + state_changed++; + } + + if (gMapSelectPositionA.y != mapTile.y) + { + gMapSelectPositionA.y = mapTile.y; + state_changed++; + } + + mapTile.x += tool_length; + mapTile.y += tool_length; + + if (gMapSelectPositionB.x != mapTile.x) + { + gMapSelectPositionB.x = mapTile.x; + state_changed++; + } + + if (gMapSelectPositionB.y != mapTile.y) + { + gMapSelectPositionB.y = mapTile.y; + state_changed++; + } + + MapInvalidateSelectionRect(); + if (!state_changed) return; auto waterLowerAction = WaterLowerAction( @@ -757,976 +848,1105 @@ private: gWaterToolLowerCost = lowerCost; WindowInvalidateByClass(WindowClass::Water); } - return; } - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - - auto info = GetMapCoordinatesFromPos( - screenPos, EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water)); - - if (info.SpriteType == ViewportInteractionItem::None) + /** + * + * rct2: 0x006E287B + */ + void ToolUpdateScenery(const ScreenCoordsXY& screenPos) { - if (gWaterToolRaiseCost != kMoney64Undefined || gWaterToolLowerCost != kMoney64Undefined) + MapInvalidateSelectionRect(); + MapInvalidateMapSelectionTiles(); + + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - gWaterToolRaiseCost = kMoney64Undefined; - gWaterToolLowerCost = kMoney64Undefined; - WindowInvalidateByClass(WindowClass::Water); + VirtualFloorInvalidate(); } - return; - } - auto mapTile = info.Loc.ToTileCentre(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - uint8_t state_changed = 0; + if (gWindowSceneryPaintEnabled) + return; + if (gWindowSceneryEyedropperEnabled) + return; - if (!(gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - state_changed++; - } - - if (gMapSelectType != MAP_SELECT_TYPE_FULL_WATER) - { - gMapSelectType = MAP_SELECT_TYPE_FULL_WATER; - state_changed++; - } - - int16_t tool_size = std::max(1, gLandToolSize); - int16_t tool_length = (tool_size - 1) * 32; - - // Move to tool bottom left - mapTile.x -= (tool_size - 1) * 16; - mapTile.y -= (tool_size - 1) * 16; - mapTile.x &= 0xFFE0; - mapTile.y &= 0xFFE0; - - if (gMapSelectPositionA.x != mapTile.x) - { - gMapSelectPositionA.x = mapTile.x; - state_changed++; - } - - if (gMapSelectPositionA.y != mapTile.y) - { - gMapSelectPositionA.y = mapTile.y; - state_changed++; - } - - mapTile.x += tool_length; - mapTile.y += tool_length; - - if (gMapSelectPositionB.x != mapTile.x) - { - gMapSelectPositionB.x = mapTile.x; - state_changed++; - } - - if (gMapSelectPositionB.y != mapTile.y) - { - gMapSelectPositionB.y = mapTile.y; - state_changed++; - } - - MapInvalidateSelectionRect(); - if (!state_changed) - return; - - auto waterLowerAction = WaterLowerAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); - auto waterRaiseAction = WaterRaiseAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); - - auto res = GameActions::Query(&waterLowerAction); - money64 lowerCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - - res = GameActions::Query(&waterRaiseAction); - money64 raiseCost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - - if (gWaterToolRaiseCost != raiseCost || gWaterToolLowerCost != lowerCost) - { - gWaterToolRaiseCost = raiseCost; - gWaterToolLowerCost = lowerCost; - WindowInvalidateByClass(WindowClass::Water); - } - } - - /** - * - * rct2: 0x006E287B - */ - void ToolUpdateScenery(const ScreenCoordsXY& screenPos) - { - MapInvalidateSelectionRect(); - MapInvalidateMapSelectionTiles(); - - if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) - { - VirtualFloorInvalidate(); - } - - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - - if (gWindowSceneryPaintEnabled) - return; - if (gWindowSceneryEyedropperEnabled) - return; - - const auto selection = WindowSceneryGetTabSelection(); - if (selection.IsUndefined()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - money64 cost = 0; - - switch (selection.SceneryType) - { - case SCENERY_TYPE_SMALL: + const auto selection = WindowSceneryGetTabSelection(); + if (selection.IsUndefined()) { - CoordsXY mapTile = {}; - uint8_t quadrant; - Direction rotation; + SceneryRemoveGhostToolPlacement(); + return; + } - Sub6E1F34SmallScenery(screenPos, selection.EntryIndex, mapTile, &quadrant, &rotation); + money64 cost = 0; - if (mapTile.IsNull()) + switch (selection.SceneryType) + { + case SCENERY_TYPE_SMALL: { - SceneryRemoveGhostToolPlacement(); - return; - } + CoordsXY mapTile = {}; + uint8_t quadrant; + Direction rotation; - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - if (gWindowSceneryScatterEnabled) - { - uint16_t cluster_size = (gWindowSceneryScatterSize - 1) * COORDS_XY_STEP; - gMapSelectPositionA.x = mapTile.x - cluster_size / 2; - gMapSelectPositionA.y = mapTile.y - cluster_size / 2; - gMapSelectPositionB.x = mapTile.x + cluster_size / 2; - gMapSelectPositionB.y = mapTile.y + cluster_size / 2; - if (gWindowSceneryScatterSize % 2 == 0) + Sub6E1F34SmallScenery(screenPos, selection.EntryIndex, mapTile, &quadrant, &rotation); + + if (mapTile.IsNull()) { - gMapSelectPositionB.x += COORDS_XY_STEP; - gMapSelectPositionB.y += COORDS_XY_STEP; + SceneryRemoveGhostToolPlacement(); + return; } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + if (gWindowSceneryScatterEnabled) + { + uint16_t cluster_size = (gWindowSceneryScatterSize - 1) * COORDS_XY_STEP; + gMapSelectPositionA.x = mapTile.x - cluster_size / 2; + gMapSelectPositionA.y = mapTile.y - cluster_size / 2; + gMapSelectPositionB.x = mapTile.x + cluster_size / 2; + gMapSelectPositionB.y = mapTile.y + cluster_size / 2; + if (gWindowSceneryScatterSize % 2 == 0) + { + gMapSelectPositionB.x += COORDS_XY_STEP; + gMapSelectPositionB.y += COORDS_XY_STEP; + } + } + else + { + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + } + + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selection.EntryIndex); + + gMapSelectType = MAP_SELECT_TYPE_FULL; + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) + { + gMapSelectType = MAP_SELECT_TYPE_QUARTER_0 + (quadrant ^ 2); + } + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E + && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_SMALL + && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + _unkF64F0E = quadrant; + _unkF64F0A = gSceneryPlaceZ; + + uint8_t attemptsLeft = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + attemptsLeft = 20; + } + + for (; attemptsLeft != 0; attemptsLeft--) + { + cost = TryPlaceGhostSmallScenery( + { mapTile, gSceneryPlaceZ, rotation }, quadrant, selection.EntryIndex, gWindowSceneryPrimaryColour, + gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + if (cost != kMoney64Undefined) + break; + gSceneryPlaceZ += 8; + } + + gSceneryPlaceCost = cost; + break; } - else + case SCENERY_TYPE_PATH_ITEM: { + CoordsXY mapTile = {}; + int32_t z; + + Sub6E1F34PathItem(screenPos, selection.EntryIndex, mapTile, &z); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; gMapSelectPositionA.x = mapTile.x; gMapSelectPositionA.y = mapTile.y; gMapSelectPositionB.x = mapTile.x; gMapSelectPositionB.y = mapTile.y; - } + gMapSelectType = MAP_SELECT_TYPE_FULL; - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selection.EntryIndex); + MapInvalidateSelectionRect(); - gMapSelectType = MAP_SELECT_TYPE_FULL; - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE) && !gWindowSceneryScatterEnabled) - { - gMapSelectType = MAP_SELECT_TYPE_QUARTER_0 + (quadrant ^ 2); - } - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_0) && mapTile == gSceneryGhostPosition && quadrant == _unkF64F0E - && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_SMALL - && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - _unkF64F0E = quadrant; - _unkF64F0A = gSceneryPlaceZ; - - uint8_t attemptsLeft = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - attemptsLeft = 20; - } - - for (; attemptsLeft != 0; attemptsLeft--) - { - cost = TryPlaceGhostSmallScenery( - { mapTile, gSceneryPlaceZ, rotation }, quadrant, selection.EntryIndex, gWindowSceneryPrimaryColour, - gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - if (cost != kMoney64Undefined) - break; - gSceneryPlaceZ += 8; - } - - gSceneryPlaceCost = cost; - break; - } - case SCENERY_TYPE_PATH_ITEM: - { - CoordsXY mapTile = {}; - int32_t z; - - Sub6E1F34PathItem(screenPos, selection.EntryIndex, mapTile, &z); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - gMapSelectType = MAP_SELECT_TYPE_FULL; - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition - && z == gSceneryGhostPosition.z) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - cost = TryPlaceGhostPathAddition({ mapTile, z }, selection.EntryIndex); - - gSceneryPlaceCost = cost; - break; - } - case SCENERY_TYPE_WALL: - { - CoordsXY mapTile = {}; - uint8_t edge; - - Sub6E1F34Wall(screenPos, selection.EntryIndex, mapTile, &edge); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - gMapSelectType = MAP_SELECT_TYPE_EDGE_0 + edge; - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition - && edge == gSceneryGhostWallRotation && gSceneryPlaceZ == _unkF64F0A) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - gSceneryGhostWallRotation = edge; - _unkF64F0A = gSceneryPlaceZ; - - uint8_t attemptsLeft = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - attemptsLeft = 20; - } - - cost = 0; - for (; attemptsLeft != 0; attemptsLeft--) - { - cost = TryPlaceGhostWall( - { mapTile, gSceneryPlaceZ }, edge, selection.EntryIndex, gWindowSceneryPrimaryColour, - gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - if (cost != kMoney64Undefined) - break; - gSceneryPlaceZ += 8; - } - - gSceneryPlaceCost = cost; - break; - } - case SCENERY_TYPE_LARGE: - { - CoordsXY mapTile = {}; - Direction direction; - - Sub6E1F34LargeScenery(screenPos, selection.EntryIndex, mapTile, &direction); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selection.EntryIndex); - gMapSelectionTiles.clear(); - - for (auto* tile = sceneryEntry->tiles; tile->x_offset != static_cast(static_cast(0xFFFF)); - tile++) - { - CoordsXY tileLocation = { tile->x_offset, tile->y_offset }; - auto rotatedTileCoords = tileLocation.Rotate(direction); - - rotatedTileCoords.x += mapTile.x; - rotatedTileCoords.y += mapTile.y; - - gMapSelectionTiles.push_back(rotatedTileCoords); - } - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - MapInvalidateMapSelectionTiles(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition - && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_LARGE - && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - gSceneryPlaceObject.SceneryType = SCENERY_TYPE_LARGE; - gSceneryPlaceObject.EntryIndex = selection.EntryIndex; - _unkF64F0A = gSceneryPlaceZ; - - uint8_t attemptsLeft = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - attemptsLeft = 20; - } - - cost = 0; - for (; attemptsLeft != 0; attemptsLeft--) - { - cost = TryPlaceGhostLargeScenery( - { mapTile, gSceneryPlaceZ, direction }, selection.EntryIndex, gWindowSceneryPrimaryColour, - gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - if (cost != kMoney64Undefined) - break; - gSceneryPlaceZ += COORDS_Z_STEP; - } - - gSceneryPlaceCost = cost; - break; - } - case SCENERY_TYPE_BANNER: - { - CoordsXY mapTile = {}; - Direction direction; - int32_t z; - - Sub6E1F34Banner(screenPos, selection.EntryIndex, mapTile, &z, &direction); - - if (mapTile.IsNull()) - { - SceneryRemoveGhostToolPlacement(); - return; - } - - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectPositionA.x = mapTile.x; - gMapSelectPositionA.y = mapTile.y; - gMapSelectPositionB.x = mapTile.x; - gMapSelectPositionB.y = mapTile.y; - gMapSelectType = MAP_SELECT_TYPE_FULL; - - MapInvalidateSelectionRect(); - - // If no change in ghost placement - if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition - && z == gSceneryGhostPosition.z && direction == gSceneryPlaceRotation) - { - return; - } - - SceneryRemoveGhostToolPlacement(); - - cost = TryPlaceGhostBanner({ mapTile, z, direction }, selection.EntryIndex); - - gSceneryPlaceCost = cost; - break; - } - } - } - - /** - * - * rct2: 0x006644DD - */ - money64 SelectionRaiseLand(uint8_t flag) - { - int32_t centreX = (gMapSelectPositionA.x + gMapSelectPositionB.x) / 2; - int32_t centreY = (gMapSelectPositionA.y + gMapSelectPositionB.y) / 2; - centreX += 16; - centreY += 16; - - if (gLandMountainMode) - { - auto landSmoothAction = LandSmoothAction( - { centreX, centreY }, - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType, - false); - auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSmoothAction) - : GameActions::Query(&landSmoothAction); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - } - - auto landRaiseAction = LandRaiseAction( - { centreX, centreY }, - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType); - auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landRaiseAction) - : GameActions::Query(&landRaiseAction); - - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - } - - /** - * - * rct2: 0x006645B3 - */ - money64 SelectionLowerLand(uint8_t flag) - { - int32_t centreX = (gMapSelectPositionA.x + gMapSelectPositionB.x) / 2; - int32_t centreY = (gMapSelectPositionA.y + gMapSelectPositionB.y) / 2; - centreX += 16; - centreY += 16; - - if (gLandMountainMode) - { - auto landSmoothAction = LandSmoothAction( - { centreX, centreY }, - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType, - true); - auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSmoothAction) - : GameActions::Query(&landSmoothAction); - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - } - - auto landLowerAction = LandLowerAction( - { centreX, centreY }, - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType); - auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landLowerAction) - : GameActions::Query(&landLowerAction); - - return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; - } - - /** - * part of window_top_toolbar_tool_drag(0x0066CB4E) - * rct2: 0x00664454 - */ - void LandToolDrag(const ScreenCoordsXY& screenPos) - { - auto* window = WindowFindFromPoint(screenPos); - if (window == nullptr) - return; - WidgetIndex widget_index = WindowFindWidgetFromPoint(*window, screenPos); - if (widget_index == -1) - return; - const auto& widget = window->widgets[widget_index]; - if (widget.type != WindowWidgetType::Viewport) - return; - const auto* selectedViewport = window->viewport; - if (selectedViewport == nullptr) - return; - - int16_t tile_height = selectedViewport->zoom.ApplyInversedTo(-16); - - int32_t y_diff = screenPos.y - gInputDragLast.y; - - if (y_diff <= tile_height) - { - gInputDragLast.y += tile_height; - - SelectionRaiseLand(GAME_COMMAND_FLAG_APPLY); - - gLandToolRaiseCost = kMoney64Undefined; - gLandToolLowerCost = kMoney64Undefined; - } - else if (y_diff >= -tile_height) - { - gInputDragLast.y -= tile_height; - - SelectionLowerLand(GAME_COMMAND_FLAG_APPLY); - - gLandToolRaiseCost = kMoney64Undefined; - gLandToolLowerCost = kMoney64Undefined; - } - } - - /** - * part of window_top_toolbar_tool_drag(0x0066CB4E) - * rct2: 0x006E6D4B - */ - void WaterToolDrag(const ScreenCoordsXY& screenPos) - { - auto* window = WindowFindFromPoint(screenPos); - if (window == nullptr || window->viewport == nullptr) - return; - - int16_t dx = window->viewport->zoom.ApplyInversedTo(-16); - - auto offsetPos = screenPos - ScreenCoordsXY{ 0, gInputDragLast.y }; - - if (offsetPos.y <= dx) - { - gInputDragLast.y += dx; - - auto waterRaiseAction = WaterRaiseAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); - GameActions::Execute(&waterRaiseAction); - - gWaterToolRaiseCost = kMoney64Undefined; - gWaterToolLowerCost = kMoney64Undefined; - - return; - } - - dx = -dx; - - if (offsetPos.y >= dx) - { - gInputDragLast.y += dx; - - auto waterLowerAction = WaterLowerAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); - GameActions::Execute(&waterLowerAction); - gWaterToolRaiseCost = kMoney64Undefined; - gWaterToolLowerCost = kMoney64Undefined; - - return; - } - } - - /** - * - * rct2: 0x006E24F6 - * On failure returns kMoney64Undefined - * On success places ghost scenery and returns cost to place proper - */ - money64 TryPlaceGhostSmallScenery( - CoordsXYZD loc, uint8_t quadrant, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, - colour_t tertiaryColour) - { - SceneryRemoveGhostToolPlacement(); - - // 6e252b - auto smallSceneryPlaceAction = SmallSceneryPlaceAction( - loc, quadrant, entryIndex, primaryColour, secondaryColour, tertiaryColour); - smallSceneryPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - auto res = GameActions::Execute(&smallSceneryPlaceAction); - if (res.Error != GameActions::Status::Ok) - return kMoney64Undefined; - - const auto placementData = res.GetData(); - - gSceneryPlaceRotation = loc.direction; - gSceneryPlaceObject.SceneryType = SCENERY_TYPE_SMALL; - gSceneryPlaceObject.EntryIndex = entryIndex; - - gSceneryGhostPosition = { loc, placementData.BaseHeight }; - gSceneryQuadrant = placementData.SceneryQuadrant; - if (placementData.GroundFlags & ELEMENT_IS_UNDERGROUND) - { - // Set underground on - ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOn); - } - else - { - // Set underground off - ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOff); - } - - gSceneryGhostType |= SCENERY_GHOST_FLAG_0; - return res.Cost; - } - - money64 TryPlaceGhostPathAddition(CoordsXYZ loc, ObjectEntryIndex entryIndex) - { - SceneryRemoveGhostToolPlacement(); - - // 6e265b - auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction(loc, entryIndex); - footpathAdditionPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); - footpathAdditionPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - { - return; - } - gSceneryGhostPosition = loc; - gSceneryGhostType |= SCENERY_GHOST_FLAG_1; - }); - auto res = GameActions::Execute(&footpathAdditionPlaceAction); - if (res.Error != GameActions::Status::Ok) - return kMoney64Undefined; - - return res.Cost; - } - - money64 TryPlaceGhostWall( - CoordsXYZ loc, uint8_t edge, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, - colour_t tertiaryColour) - { - SceneryRemoveGhostToolPlacement(); - - // 6e26b0 - auto wallPlaceAction = WallPlaceAction(entryIndex, loc, edge, primaryColour, secondaryColour, tertiaryColour); - wallPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); - wallPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - return; - - const auto placementData = result->GetData(); - gSceneryGhostPosition = { loc, placementData.BaseHeight }; - gSceneryGhostWallRotation = edge; - - gSceneryGhostType |= SCENERY_GHOST_FLAG_2; - }); - - auto res = GameActions::Execute(&wallPlaceAction); - if (res.Error != GameActions::Status::Ok) - return kMoney64Undefined; - - return res.Cost; - } - - money64 TryPlaceGhostLargeScenery( - CoordsXYZD loc, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, colour_t tertiaryColour) - { - SceneryRemoveGhostToolPlacement(); - - // 6e25a7 - auto sceneryPlaceAction = LargeSceneryPlaceAction(loc, entryIndex, primaryColour, secondaryColour, tertiaryColour); - sceneryPlaceAction.SetFlags( - GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); - auto res = GameActions::Execute(&sceneryPlaceAction); - if (res.Error != GameActions::Status::Ok) - return kMoney64Undefined; - - const auto placementData = res.GetData(); - - gSceneryPlaceRotation = loc.direction; - - gSceneryGhostPosition = { loc, placementData.firstTileHeight }; - if (placementData.GroundFlags & ELEMENT_IS_UNDERGROUND) - { - // Set underground on - ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOn); - } - else - { - // Set underground off - ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOff); - } - - gSceneryGhostType |= SCENERY_GHOST_FLAG_3; - return res.Cost; - } - - money64 TryPlaceGhostBanner(CoordsXYZD loc, ObjectEntryIndex entryIndex) - { - SceneryRemoveGhostToolPlacement(); - - // 6e2612 - auto primaryColour = gWindowSceneryPrimaryColour; - auto bannerPlaceAction = BannerPlaceAction(loc, entryIndex, primaryColour); - bannerPlaceAction.SetFlags( - GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); - auto res = GameActions::Execute(&bannerPlaceAction); - if (res.Error != GameActions::Status::Ok) - return kMoney64Undefined; - - gSceneryGhostPosition = loc; - gSceneryGhostPosition.z += PATH_HEIGHT_STEP; - gSceneryPlaceRotation = loc.direction; - gSceneryGhostType |= SCENERY_GHOST_FLAG_4; - return res.Cost; - } - - /** - * - * rct2: 0x006E3158 - */ - void RepaintSceneryToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) - { - auto flag = EnumsToFlags( - ViewportInteractionItem::Scenery, ViewportInteractionItem::Wall, ViewportInteractionItem::LargeScenery, - ViewportInteractionItem::Banner); - auto info = GetMapCoordinatesFromPos(screenCoords, flag); - switch (info.SpriteType) - { - case ViewportInteractionItem::Scenery: - { - auto* sceneryEntry = info.Element->AsSmallScenery()->GetEntry(); - - // If can't repaint - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) - return; - - uint8_t quadrant = info.Element->AsSmallScenery()->GetSceneryQuadrant(); - auto repaintScenery = SmallScenerySetColourAction( - { info.Loc, info.Element->GetBaseZ() }, quadrant, info.Element->AsSmallScenery()->GetEntryIndex(), - gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - GameActions::Execute(&repaintScenery); - break; - } - case ViewportInteractionItem::Wall: - { - auto* scenery_entry = info.Element->AsWall()->GetEntry(); - - // If can't repaint - if (!(scenery_entry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS))) - return; - - auto repaintScenery = WallSetColourAction( - { info.Loc, info.Element->GetBaseZ(), info.Element->GetDirection() }, gWindowSceneryPrimaryColour, - gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - GameActions::Execute(&repaintScenery); - break; - } - case ViewportInteractionItem::LargeScenery: - { - auto* sceneryEntry = info.Element->AsLargeScenery()->GetEntry(); - - // If can't repaint - if (!(sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) - return; - - auto repaintScenery = LargeScenerySetColourAction( - { info.Loc, info.Element->GetBaseZ(), info.Element->GetDirection() }, - info.Element->AsLargeScenery()->GetSequenceIndex(), gWindowSceneryPrimaryColour, - gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - GameActions::Execute(&repaintScenery); - break; - } - case ViewportInteractionItem::Banner: - { - auto banner = info.Element->AsBanner()->GetBanner(); - if (banner != nullptr) - { - auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); - if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_1) && mapTile == gSceneryGhostPosition + && z == gSceneryGhostPosition.z) { - auto repaintScenery = BannerSetColourAction( - { info.Loc, info.Element->GetBaseZ(), info.Element->AsBanner()->GetPosition() }, - gWindowSceneryPrimaryColour); - - GameActions::Execute(&repaintScenery); + return; } - } - break; - } - default: - return; - } - } - void SceneryEyedropperToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) - { - auto flag = EnumsToFlags( - ViewportInteractionItem::Scenery, ViewportInteractionItem::Wall, ViewportInteractionItem::LargeScenery, - ViewportInteractionItem::Banner, ViewportInteractionItem::PathAddition); - auto info = GetMapCoordinatesFromPos(screenCoords, flag); - switch (info.SpriteType) + SceneryRemoveGhostToolPlacement(); + + cost = TryPlaceGhostPathAddition({ mapTile, z }, selection.EntryIndex); + + gSceneryPlaceCost = cost; + break; + } + case SCENERY_TYPE_WALL: + { + CoordsXY mapTile = {}; + uint8_t edge; + + Sub6E1F34Wall(screenPos, selection.EntryIndex, mapTile, &edge); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + gMapSelectType = MAP_SELECT_TYPE_EDGE_0 + edge; + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_2) && mapTile == gSceneryGhostPosition + && edge == gSceneryGhostWallRotation && gSceneryPlaceZ == _unkF64F0A) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + gSceneryGhostWallRotation = edge; + _unkF64F0A = gSceneryPlaceZ; + + uint8_t attemptsLeft = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + attemptsLeft = 20; + } + + cost = 0; + for (; attemptsLeft != 0; attemptsLeft--) + { + cost = TryPlaceGhostWall( + { mapTile, gSceneryPlaceZ }, edge, selection.EntryIndex, gWindowSceneryPrimaryColour, + gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + if (cost != kMoney64Undefined) + break; + gSceneryPlaceZ += 8; + } + + gSceneryPlaceCost = cost; + break; + } + case SCENERY_TYPE_LARGE: + { + CoordsXY mapTile = {}; + Direction direction; + + Sub6E1F34LargeScenery(screenPos, selection.EntryIndex, mapTile, &direction); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selection.EntryIndex); + gMapSelectionTiles.clear(); + + for (auto* tile = sceneryEntry->tiles; + tile->x_offset != static_cast(static_cast(0xFFFF)); tile++) + { + CoordsXY tileLocation = { tile->x_offset, tile->y_offset }; + auto rotatedTileCoords = tileLocation.Rotate(direction); + + rotatedTileCoords.x += mapTile.x; + rotatedTileCoords.y += mapTile.y; + + gMapSelectionTiles.push_back(rotatedTileCoords); + } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + MapInvalidateMapSelectionTiles(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_3) && mapTile == gSceneryGhostPosition + && gSceneryPlaceZ == _unkF64F0A && gSceneryPlaceObject.SceneryType == SCENERY_TYPE_LARGE + && gSceneryPlaceObject.EntryIndex == selection.EntryIndex) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + gSceneryPlaceObject.SceneryType = SCENERY_TYPE_LARGE; + gSceneryPlaceObject.EntryIndex = selection.EntryIndex; + _unkF64F0A = gSceneryPlaceZ; + + uint8_t attemptsLeft = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + attemptsLeft = 20; + } + + cost = 0; + for (; attemptsLeft != 0; attemptsLeft--) + { + cost = TryPlaceGhostLargeScenery( + { mapTile, gSceneryPlaceZ, direction }, selection.EntryIndex, gWindowSceneryPrimaryColour, + gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + if (cost != kMoney64Undefined) + break; + gSceneryPlaceZ += COORDS_Z_STEP; + } + + gSceneryPlaceCost = cost; + break; + } + case SCENERY_TYPE_BANNER: + { + CoordsXY mapTile = {}; + Direction direction; + int32_t z; + + Sub6E1F34Banner(screenPos, selection.EntryIndex, mapTile, &z, &direction); + + if (mapTile.IsNull()) + { + SceneryRemoveGhostToolPlacement(); + return; + } + + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectPositionA.x = mapTile.x; + gMapSelectPositionA.y = mapTile.y; + gMapSelectPositionB.x = mapTile.x; + gMapSelectPositionB.y = mapTile.y; + gMapSelectType = MAP_SELECT_TYPE_FULL; + + MapInvalidateSelectionRect(); + + // If no change in ghost placement + if ((gSceneryGhostType & SCENERY_GHOST_FLAG_4) && mapTile == gSceneryGhostPosition + && z == gSceneryGhostPosition.z && direction == gSceneryPlaceRotation) + { + return; + } + + SceneryRemoveGhostToolPlacement(); + + cost = TryPlaceGhostBanner({ mapTile, z, direction }, selection.EntryIndex); + + gSceneryPlaceCost = cost; + break; + } + } + } + + /** + * + * rct2: 0x006644DD + */ + money64 SelectionRaiseLand(uint8_t flag) { - case ViewportInteractionItem::Scenery: + int32_t centreX = (gMapSelectPositionA.x + gMapSelectPositionB.x) / 2; + int32_t centreY = (gMapSelectPositionA.y + gMapSelectPositionB.y) / 2; + centreX += 16; + centreY += 16; + + if (gLandMountainMode) { - SmallSceneryElement* sceneryElement = info.Element->AsSmallScenery(); - auto entryIndex = sceneryElement->GetEntryIndex(); - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); - if (sceneryEntry != nullptr) - { - WindowScenerySetSelectedItem( - { SCENERY_TYPE_SMALL, entryIndex }, sceneryElement->GetPrimaryColour(), - sceneryElement->GetSecondaryColour(), sceneryElement->GetTertiaryColour(), - sceneryElement->GetDirectionWithOffset(GetCurrentRotation())); - } - break; + auto landSmoothAction = LandSmoothAction( + { centreX, centreY }, + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + gMapSelectType, false); + auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSmoothAction) + : GameActions::Query(&landSmoothAction); + return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; } - case ViewportInteractionItem::Wall: + + auto landRaiseAction = LandRaiseAction( + { centreX, centreY }, + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType); + auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landRaiseAction) + : GameActions::Query(&landRaiseAction); + + return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + } + + /** + * + * rct2: 0x006645B3 + */ + money64 SelectionLowerLand(uint8_t flag) + { + int32_t centreX = (gMapSelectPositionA.x + gMapSelectPositionB.x) / 2; + int32_t centreY = (gMapSelectPositionA.y + gMapSelectPositionB.y) / 2; + centreX += 16; + centreY += 16; + + if (gLandMountainMode) { - auto entryIndex = info.Element->AsWall()->GetEntryIndex(); - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); - if (sceneryEntry != nullptr) - { - WindowScenerySetSelectedItem( - { SCENERY_TYPE_WALL, entryIndex }, info.Element->AsWall()->GetPrimaryColour(), - info.Element->AsWall()->GetSecondaryColour(), info.Element->AsWall()->GetTertiaryColour(), - std::nullopt); - } - break; + auto landSmoothAction = LandSmoothAction( + { centreX, centreY }, + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + gMapSelectType, true); + auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landSmoothAction) + : GameActions::Query(&landSmoothAction); + return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; } - case ViewportInteractionItem::LargeScenery: + + auto landLowerAction = LandLowerAction( + { centreX, centreY }, + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, gMapSelectType); + auto res = (flag & GAME_COMMAND_FLAG_APPLY) ? GameActions::Execute(&landLowerAction) + : GameActions::Query(&landLowerAction); + + return res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + } + + /** + * part of window_top_toolbar_tool_drag(0x0066CB4E) + * rct2: 0x00664454 + */ + void LandToolDrag(const ScreenCoordsXY& screenPos) + { + auto* window = WindowFindFromPoint(screenPos); + if (window == nullptr) + return; + WidgetIndex widget_index = WindowFindWidgetFromPoint(*window, screenPos); + if (widget_index == -1) + return; + const auto& widget = window->widgets[widget_index]; + if (widget.type != WindowWidgetType::Viewport) + return; + const auto* selectedViewport = window->viewport; + if (selectedViewport == nullptr) + return; + + int16_t tile_height = selectedViewport->zoom.ApplyInversedTo(-16); + + int32_t y_diff = screenPos.y - gInputDragLast.y; + + if (y_diff <= tile_height) { - auto entryIndex = info.Element->AsLargeScenery()->GetEntryIndex(); - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); - if (sceneryEntry != nullptr) - { - WindowScenerySetSelectedItem( - { SCENERY_TYPE_LARGE, entryIndex }, info.Element->AsLargeScenery()->GetPrimaryColour(), - info.Element->AsLargeScenery()->GetSecondaryColour(), std::nullopt, - (GetCurrentRotation() + info.Element->GetDirection()) & 3); - } - break; + gInputDragLast.y += tile_height; + + SelectionRaiseLand(GAME_COMMAND_FLAG_APPLY); + + gLandToolRaiseCost = kMoney64Undefined; + gLandToolLowerCost = kMoney64Undefined; } - case ViewportInteractionItem::Banner: + else if (y_diff >= -tile_height) { - auto banner = info.Element->AsBanner()->GetBanner(); - if (banner != nullptr) + gInputDragLast.y -= tile_height; + + SelectionLowerLand(GAME_COMMAND_FLAG_APPLY); + + gLandToolRaiseCost = kMoney64Undefined; + gLandToolLowerCost = kMoney64Undefined; + } + } + + /** + * part of window_top_toolbar_tool_drag(0x0066CB4E) + * rct2: 0x006E6D4B + */ + void WaterToolDrag(const ScreenCoordsXY& screenPos) + { + auto* window = WindowFindFromPoint(screenPos); + if (window == nullptr || window->viewport == nullptr) + return; + + int16_t dx = window->viewport->zoom.ApplyInversedTo(-16); + + auto offsetPos = screenPos - ScreenCoordsXY{ 0, gInputDragLast.y }; + + if (offsetPos.y <= dx) + { + gInputDragLast.y += dx; + + auto waterRaiseAction = WaterRaiseAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); + GameActions::Execute(&waterRaiseAction); + + gWaterToolRaiseCost = kMoney64Undefined; + gWaterToolLowerCost = kMoney64Undefined; + + return; + } + + dx = -dx; + + if (offsetPos.y >= dx) + { + gInputDragLast.y += dx; + + auto waterLowerAction = WaterLowerAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }); + GameActions::Execute(&waterLowerAction); + gWaterToolRaiseCost = kMoney64Undefined; + gWaterToolLowerCost = kMoney64Undefined; + + return; + } + } + + /** + * + * rct2: 0x006E24F6 + * On failure returns kMoney64Undefined + * On success places ghost scenery and returns cost to place proper + */ + money64 TryPlaceGhostSmallScenery( + CoordsXYZD loc, uint8_t quadrant, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, + colour_t tertiaryColour) + { + SceneryRemoveGhostToolPlacement(); + + // 6e252b + auto smallSceneryPlaceAction = SmallSceneryPlaceAction( + loc, quadrant, entryIndex, primaryColour, secondaryColour, tertiaryColour); + smallSceneryPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + auto res = GameActions::Execute(&smallSceneryPlaceAction); + if (res.Error != GameActions::Status::Ok) + return kMoney64Undefined; + + const auto placementData = res.GetData(); + + gSceneryPlaceRotation = loc.direction; + gSceneryPlaceObject.SceneryType = SCENERY_TYPE_SMALL; + gSceneryPlaceObject.EntryIndex = entryIndex; + + gSceneryGhostPosition = { loc, placementData.BaseHeight }; + gSceneryQuadrant = placementData.SceneryQuadrant; + if (placementData.GroundFlags & ELEMENT_IS_UNDERGROUND) + { + // Set underground on + ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOn); + } + else + { + // Set underground off + ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOff); + } + + gSceneryGhostType |= SCENERY_GHOST_FLAG_0; + return res.Cost; + } + + money64 TryPlaceGhostPathAddition(CoordsXYZ loc, ObjectEntryIndex entryIndex) + { + SceneryRemoveGhostToolPlacement(); + + // 6e265b + auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction(loc, entryIndex); + footpathAdditionPlaceAction.SetFlags(GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED); + footpathAdditionPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) { - auto sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); + return; + } + gSceneryGhostPosition = loc; + gSceneryGhostType |= SCENERY_GHOST_FLAG_1; + }); + auto res = GameActions::Execute(&footpathAdditionPlaceAction); + if (res.Error != GameActions::Status::Ok) + return kMoney64Undefined; + + return res.Cost; + } + + money64 TryPlaceGhostWall( + CoordsXYZ loc, uint8_t edge, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, + colour_t tertiaryColour) + { + SceneryRemoveGhostToolPlacement(); + + // 6e26b0 + auto wallPlaceAction = WallPlaceAction(entryIndex, loc, edge, primaryColour, secondaryColour, tertiaryColour); + wallPlaceAction.SetFlags( + GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); + wallPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + return; + + const auto placementData = result->GetData(); + gSceneryGhostPosition = { loc, placementData.BaseHeight }; + gSceneryGhostWallRotation = edge; + + gSceneryGhostType |= SCENERY_GHOST_FLAG_2; + }); + + auto res = GameActions::Execute(&wallPlaceAction); + if (res.Error != GameActions::Status::Ok) + return kMoney64Undefined; + + return res.Cost; + } + + money64 TryPlaceGhostLargeScenery( + CoordsXYZD loc, ObjectEntryIndex entryIndex, colour_t primaryColour, colour_t secondaryColour, + colour_t tertiaryColour) + { + SceneryRemoveGhostToolPlacement(); + + // 6e25a7 + auto sceneryPlaceAction = LargeSceneryPlaceAction(loc, entryIndex, primaryColour, secondaryColour, tertiaryColour); + sceneryPlaceAction.SetFlags( + GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); + auto res = GameActions::Execute(&sceneryPlaceAction); + if (res.Error != GameActions::Status::Ok) + return kMoney64Undefined; + + const auto placementData = res.GetData(); + + gSceneryPlaceRotation = loc.direction; + + gSceneryGhostPosition = { loc, placementData.firstTileHeight }; + if (placementData.GroundFlags & ELEMENT_IS_UNDERGROUND) + { + // Set underground on + ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOn); + } + else + { + // Set underground off + ViewportSetVisibility(ViewportVisibility::UndergroundViewGhostOff); + } + + gSceneryGhostType |= SCENERY_GHOST_FLAG_3; + return res.Cost; + } + + money64 TryPlaceGhostBanner(CoordsXYZD loc, ObjectEntryIndex entryIndex) + { + SceneryRemoveGhostToolPlacement(); + + // 6e2612 + auto primaryColour = gWindowSceneryPrimaryColour; + auto bannerPlaceAction = BannerPlaceAction(loc, entryIndex, primaryColour); + bannerPlaceAction.SetFlags( + GAME_COMMAND_FLAG_GHOST | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND); + auto res = GameActions::Execute(&bannerPlaceAction); + if (res.Error != GameActions::Status::Ok) + return kMoney64Undefined; + + gSceneryGhostPosition = loc; + gSceneryGhostPosition.z += PATH_HEIGHT_STEP; + gSceneryPlaceRotation = loc.direction; + gSceneryGhostType |= SCENERY_GHOST_FLAG_4; + return res.Cost; + } + + /** + * + * rct2: 0x006E3158 + */ + void RepaintSceneryToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) + { + auto flag = EnumsToFlags( + ViewportInteractionItem::Scenery, ViewportInteractionItem::Wall, ViewportInteractionItem::LargeScenery, + ViewportInteractionItem::Banner); + auto info = GetMapCoordinatesFromPos(screenCoords, flag); + switch (info.SpriteType) + { + case ViewportInteractionItem::Scenery: + { + auto* sceneryEntry = info.Element->AsSmallScenery()->GetEntry(); + + // If can't repaint + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_HAS_PRIMARY_COLOUR | SMALL_SCENERY_FLAG_HAS_GLASS)) + return; + + uint8_t quadrant = info.Element->AsSmallScenery()->GetSceneryQuadrant(); + auto repaintScenery = SmallScenerySetColourAction( + { info.Loc, info.Element->GetBaseZ() }, quadrant, info.Element->AsSmallScenery()->GetEntryIndex(), + gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + GameActions::Execute(&repaintScenery); + break; + } + case ViewportInteractionItem::Wall: + { + auto* scenery_entry = info.Element->AsWall()->GetEntry(); + + // If can't repaint + if (!(scenery_entry->flags & (WALL_SCENERY_HAS_PRIMARY_COLOUR | WALL_SCENERY_HAS_GLASS))) + return; + + auto repaintScenery = WallSetColourAction( + { info.Loc, info.Element->GetBaseZ(), info.Element->GetDirection() }, gWindowSceneryPrimaryColour, + gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + GameActions::Execute(&repaintScenery); + break; + } + case ViewportInteractionItem::LargeScenery: + { + auto* sceneryEntry = info.Element->AsLargeScenery()->GetEntry(); + + // If can't repaint + if (!(sceneryEntry->flags & LARGE_SCENERY_FLAG_HAS_PRIMARY_COLOUR)) + return; + + auto repaintScenery = LargeScenerySetColourAction( + { info.Loc, info.Element->GetBaseZ(), info.Element->GetDirection() }, + info.Element->AsLargeScenery()->GetSequenceIndex(), gWindowSceneryPrimaryColour, + gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + GameActions::Execute(&repaintScenery); + break; + } + case ViewportInteractionItem::Banner: + { + auto banner = info.Element->AsBanner()->GetBanner(); + if (banner != nullptr) + { + auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); + if (bannerEntry->flags & BANNER_ENTRY_FLAG_HAS_PRIMARY_COLOUR) + { + auto repaintScenery = BannerSetColourAction( + { info.Loc, info.Element->GetBaseZ(), info.Element->AsBanner()->GetPosition() }, + gWindowSceneryPrimaryColour); + + GameActions::Execute(&repaintScenery); + } + } + break; + } + default: + return; + } + } + + void SceneryEyedropperToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) + { + auto flag = EnumsToFlags( + ViewportInteractionItem::Scenery, ViewportInteractionItem::Wall, ViewportInteractionItem::LargeScenery, + ViewportInteractionItem::Banner, ViewportInteractionItem::PathAddition); + auto info = GetMapCoordinatesFromPos(screenCoords, flag); + switch (info.SpriteType) + { + case ViewportInteractionItem::Scenery: + { + SmallSceneryElement* sceneryElement = info.Element->AsSmallScenery(); + auto entryIndex = sceneryElement->GetEntryIndex(); + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); if (sceneryEntry != nullptr) { WindowScenerySetSelectedItem( - { SCENERY_TYPE_BANNER, banner->type }, std::nullopt, std::nullopt, std::nullopt, std::nullopt); + { SCENERY_TYPE_SMALL, entryIndex }, sceneryElement->GetPrimaryColour(), + sceneryElement->GetSecondaryColour(), sceneryElement->GetTertiaryColour(), + sceneryElement->GetDirectionWithOffset(GetCurrentRotation())); } + break; } - break; - } - case ViewportInteractionItem::PathAddition: - { - auto entryIndex = info.Element->AsPath()->GetAdditionEntryIndex(); - auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); - if (pathAdditionEntry != nullptr) + case ViewportInteractionItem::Wall: { - WindowScenerySetSelectedItem( - { SCENERY_TYPE_PATH_ITEM, entryIndex }, std::nullopt, std::nullopt, std::nullopt, std::nullopt); - } - break; - } - default: - break; - } - } - - void Sub6E1F34UpdateScreenCoordsAndButtonsPressed(bool canRaiseItem, ScreenCoordsXY& screenPos) - { - if (!canRaiseItem && !GetGameState().Cheats.DisableSupportLimits) - { - gSceneryCtrlPressed = false; - gSceneryShiftPressed = false; - } - else - { - if (!gSceneryCtrlPressed) - { - if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z)) - { - // CTRL pressed - constexpr auto flag = EnumsToFlags( - ViewportInteractionItem::Terrain, ViewportInteractionItem::Ride, ViewportInteractionItem::Scenery, - ViewportInteractionItem::Footpath, ViewportInteractionItem::Wall, - ViewportInteractionItem::LargeScenery); - auto info = GetMapCoordinatesFromPos(screenPos, flag); - - if (info.SpriteType != ViewportInteractionItem::None) + auto entryIndex = info.Element->AsWall()->GetEntryIndex(); + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); + if (sceneryEntry != nullptr) { - gSceneryCtrlPressed = true; - gSceneryCtrlPressZ = info.Element->GetBaseZ(); + WindowScenerySetSelectedItem( + { SCENERY_TYPE_WALL, entryIndex }, info.Element->AsWall()->GetPrimaryColour(), + info.Element->AsWall()->GetSecondaryColour(), info.Element->AsWall()->GetTertiaryColour(), + std::nullopt); } + break; } + case ViewportInteractionItem::LargeScenery: + { + auto entryIndex = info.Element->AsLargeScenery()->GetEntryIndex(); + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); + if (sceneryEntry != nullptr) + { + WindowScenerySetSelectedItem( + { SCENERY_TYPE_LARGE, entryIndex }, info.Element->AsLargeScenery()->GetPrimaryColour(), + info.Element->AsLargeScenery()->GetSecondaryColour(), std::nullopt, + (GetCurrentRotation() + info.Element->GetDirection()) & 3); + } + break; + } + case ViewportInteractionItem::Banner: + { + auto banner = info.Element->AsBanner()->GetBanner(); + if (banner != nullptr) + { + auto sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(banner->type); + if (sceneryEntry != nullptr) + { + WindowScenerySetSelectedItem( + { SCENERY_TYPE_BANNER, banner->type }, std::nullopt, std::nullopt, std::nullopt, std::nullopt); + } + } + break; + } + case ViewportInteractionItem::PathAddition: + { + auto entryIndex = info.Element->AsPath()->GetAdditionEntryIndex(); + auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry(entryIndex); + if (pathAdditionEntry != nullptr) + { + WindowScenerySetSelectedItem( + { SCENERY_TYPE_PATH_ITEM, entryIndex }, std::nullopt, std::nullopt, std::nullopt, std::nullopt); + } + break; + } + default: + break; + } + } + + void Sub6E1F34UpdateScreenCoordsAndButtonsPressed(bool canRaiseItem, ScreenCoordsXY& screenPos) + { + if (!canRaiseItem && !GetGameState().Cheats.DisableSupportLimits) + { + gSceneryCtrlPressed = false; + gSceneryShiftPressed = false; } else { - if (!(InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z))) + if (!gSceneryCtrlPressed) { - // CTRL not pressed - gSceneryCtrlPressed = false; - } - } - - if (!gSceneryShiftPressed) - { - if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_SHIFT_Z)) - { - // SHIFT pressed - gSceneryShiftPressed = true; - gSceneryShiftPressX = screenPos.x; - gSceneryShiftPressY = screenPos.y; - gSceneryShiftPressZOffset = 0; - } - } - else - { - if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_SHIFT_Z)) - { - // SHIFT pressed - gSceneryShiftPressZOffset = (gSceneryShiftPressY - screenPos.y + 4); - // Scale delta by zoom to match mouse position. - auto* mainWnd = WindowGetMain(); - if (mainWnd != nullptr && mainWnd->viewport != nullptr) + if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z)) { - gSceneryShiftPressZOffset = mainWnd->viewport->zoom.ApplyTo(gSceneryShiftPressZOffset); - } - gSceneryShiftPressZOffset = Floor2(gSceneryShiftPressZOffset, 8); + // CTRL pressed + constexpr auto flag = EnumsToFlags( + ViewportInteractionItem::Terrain, ViewportInteractionItem::Ride, ViewportInteractionItem::Scenery, + ViewportInteractionItem::Footpath, ViewportInteractionItem::Wall, + ViewportInteractionItem::LargeScenery); + auto info = GetMapCoordinatesFromPos(screenPos, flag); - screenPos.x = gSceneryShiftPressX; - screenPos.y = gSceneryShiftPressY; + if (info.SpriteType != ViewportInteractionItem::None) + { + gSceneryCtrlPressed = true; + gSceneryCtrlPressZ = info.Element->GetBaseZ(); + } + } } else { - // SHIFT not pressed - gSceneryShiftPressed = false; + if (!(InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_COPY_Z))) + { + // CTRL not pressed + gSceneryCtrlPressed = false; + } + } + + if (!gSceneryShiftPressed) + { + if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_SHIFT_Z)) + { + // SHIFT pressed + gSceneryShiftPressed = true; + gSceneryShiftPressX = screenPos.x; + gSceneryShiftPressY = screenPos.y; + gSceneryShiftPressZOffset = 0; + } + } + else + { + if (InputTestPlaceObjectModifier(PLACE_OBJECT_MODIFIER_SHIFT_Z)) + { + // SHIFT pressed + gSceneryShiftPressZOffset = (gSceneryShiftPressY - screenPos.y + 4); + // Scale delta by zoom to match mouse position. + auto* mainWnd = WindowGetMain(); + if (mainWnd != nullptr && mainWnd->viewport != nullptr) + { + gSceneryShiftPressZOffset = mainWnd->viewport->zoom.ApplyTo(gSceneryShiftPressZOffset); + } + gSceneryShiftPressZOffset = Floor2(gSceneryShiftPressZOffset, 8); + + screenPos.x = gSceneryShiftPressX; + screenPos.y = gSceneryShiftPressY; + } + else + { + // SHIFT not pressed + gSceneryShiftPressed = false; + } } } } - } - void Sub6E1F34SmallScenery( - const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outQuadrant, - Direction* outRotation) - { - auto* w = WindowFindByClass(WindowClass::Scenery); - - if (w == nullptr) + void Sub6E1F34SmallScenery( + const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outQuadrant, + Direction* outRotation) { - gridPos.SetNull(); - return; - } + auto* w = WindowFindByClass(WindowClass::Scenery); - auto screenPos = sourceScreenPos; - uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo( - std::numeric_limits::max() - 32); - bool can_raise_item = false; + if (w == nullptr) + { + gridPos.SetNull(); + return; + } - const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryIndex); - if (sceneryEntry == nullptr) - { - gridPos.SetNull(); - return; - } + auto screenPos = sourceScreenPos; + uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo( + std::numeric_limits::max() - 32); + bool can_raise_item = false; - maxPossibleHeight -= sceneryEntry->height; - if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) - { - can_raise_item = true; - } + const auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryIndex); + if (sceneryEntry == nullptr) + { + gridPos.SetNull(); + return; + } - Sub6E1F34UpdateScreenCoordsAndButtonsPressed(can_raise_item, screenPos); + maxPossibleHeight -= sceneryEntry->height; + if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_STACKABLE)) + { + can_raise_item = true; + } - // Small scenery - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) - { - uint8_t quadrant = 0; + Sub6E1F34UpdateScreenCoordsAndButtonsPressed(can_raise_item, screenPos); + + // Small scenery + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) + { + uint8_t quadrant = 0; + + // If CTRL not pressed + if (!gSceneryCtrlPressed) + { + auto gridCoords = ScreenGetMapXYQuadrant(screenPos, &quadrant); + if (!gridCoords.has_value()) + { + gridPos.SetNull(); + return; + } + gridPos = gridCoords.value(); + + gSceneryPlaceZ = 0; + + // If SHIFT pressed + if (gSceneryShiftPressed) + { + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); + + if (surfaceElement == nullptr) + { + gridPos.SetNull(); + return; + } + + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; + z += gSceneryShiftPressZOffset; + + z = std::clamp(z, 16, maxPossibleHeight); + + gSceneryPlaceZ = z; + } + } + else + { + int16_t z = gSceneryCtrlPressZ; + + auto mapCoords = ScreenGetMapXYQuadrantWithZ(screenPos, z, &quadrant); + if (!mapCoords.has_value()) + { + gridPos.SetNull(); + return; + } + gridPos = mapCoords.value(); + + // If SHIFT pressed + if (gSceneryShiftPressed) + { + z += gSceneryShiftPressZOffset; + } + + z = std::clamp(z, 16, maxPossibleHeight); + + gSceneryPlaceZ = z; + } + + if (gridPos.IsNull()) + return; + + uint8_t rotation = gWindowSceneryRotation; + + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + { + rotation = UtilRand() & 0xFF; + } + + rotation -= GetCurrentRotation(); + rotation &= 0x3; + + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) + { + VirtualFloorSetHeight(gSceneryPlaceZ); + } + + *outQuadrant = quadrant ^ 2; + *outRotation = rotation; + + return; + } // If CTRL not pressed if (!gSceneryCtrlPressed) { - auto gridCoords = ScreenGetMapXYQuadrant(screenPos, &quadrant); + constexpr auto flag = EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water); + + auto info = GetMapCoordinatesFromPos(screenPos, flag); + gridPos = info.Loc; + + if (info.SpriteType == ViewportInteractionItem::None) + { + gridPos.SetNull(); + return; + } + + // If CTRL and SHIFT not pressed + gSceneryPlaceZ = 0; + + // If SHIFT pressed + if (gSceneryShiftPressed) + { + auto surfaceElement = MapGetSurfaceElementAt(gridPos); + + if (surfaceElement == nullptr) + { + gridPos.SetNull(); + return; + } + + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; + z += gSceneryShiftPressZOffset; + + z = std::clamp(z, 16, maxPossibleHeight); + + gSceneryPlaceZ = z; + } + } + else + { + int16_t z = gSceneryCtrlPressZ; + auto coords = ScreenGetMapXYWithZ(screenPos, z); + if (coords.has_value()) + { + gridPos = *coords; + } + else + { + gridPos.SetNull(); + } + // If SHIFT pressed + if (gSceneryShiftPressed) + { + z += gSceneryShiftPressZOffset; + } + + z = std::clamp(z, 16, maxPossibleHeight); + + gSceneryPlaceZ = z; + } + + if (gridPos.IsNull()) + return; + + gridPos = gridPos.ToTileStart(); + uint8_t rotation = gWindowSceneryRotation; + + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + { + rotation = UtilRand() & 0xFF; + } + + rotation -= GetCurrentRotation(); + rotation &= 0x3; + + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) + { + VirtualFloorSetHeight(gSceneryPlaceZ); + } + + *outQuadrant = 0; + *outRotation = rotation; + } + + void Sub6E1F34PathItem( + const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ) + { + auto* w = WindowFindByClass(WindowClass::Scenery); + + if (w == nullptr) + { + gridPos.SetNull(); + return; + } + + auto screenPos = sourceScreenPos; + Sub6E1F34UpdateScreenCoordsAndButtonsPressed(false, screenPos); + + // Path bits + constexpr auto flag = EnumsToFlags(ViewportInteractionItem::Footpath, ViewportInteractionItem::PathAddition); + auto info = GetMapCoordinatesFromPos(screenPos, flag); + gridPos = info.Loc; + + if (info.SpriteType == ViewportInteractionItem::None) + { + gridPos.SetNull(); + return; + } + + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) + { + VirtualFloorSetHeight(gSceneryPlaceZ); + } + + *outZ = info.Element->GetBaseZ(); + } + + void Sub6E1F34Wall( + const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outEdges) + { + auto* w = WindowFindByClass(WindowClass::Scenery); + + if (w == nullptr) + { + gridPos.SetNull(); + return; + } + + auto screenPos = sourceScreenPos; + uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo( + std::numeric_limits::max() - 32); + + auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryIndex); + if (wallEntry != nullptr) + { + maxPossibleHeight -= wallEntry->height; + } + + Sub6E1F34UpdateScreenCoordsAndButtonsPressed(true, screenPos); + + // Walls + uint8_t edge; + // If CTRL not pressed + if (!gSceneryCtrlPressed) + { + auto gridCoords = ScreenGetMapXYSide(screenPos, &edge); if (!gridCoords.has_value()) { gridPos.SetNull(); @@ -1758,8 +1978,7 @@ private: else { int16_t z = gSceneryCtrlPressZ; - - auto mapCoords = ScreenGetMapXYQuadrantWithZ(screenPos, z, &quadrant); + auto mapCoords = ScreenGetMapXYSideWithZ(screenPos, z, &edge); if (!mapCoords.has_value()) { gridPos.SetNull(); @@ -1781,13 +2000,103 @@ private: if (gridPos.IsNull()) return; - uint8_t rotation = gWindowSceneryRotation; - - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - rotation = UtilRand() & 0xFF; + VirtualFloorSetHeight(gSceneryPlaceZ); } + *outEdges = edge; + } + + void Sub6E1F34LargeScenery( + const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, Direction* outDirection) + { + auto* w = WindowFindByClass(WindowClass::Scenery); + + if (w == nullptr) + { + gridPos.SetNull(); + return; + } + + auto screenPos = sourceScreenPos; + uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo( + std::numeric_limits::max() - 32); + + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryIndex); + if (sceneryEntry) + { + int16_t maxClearZ = 0; + for (int32_t i = 0; sceneryEntry->tiles[i].x_offset != -1; ++i) + { + maxClearZ = std::max(maxClearZ, sceneryEntry->tiles[i].z_clearance); + } + maxPossibleHeight = std::max(0, maxPossibleHeight - maxClearZ); + } + + Sub6E1F34UpdateScreenCoordsAndButtonsPressed(true, screenPos); + + // Large scenery + // If CTRL not pressed + if (!gSceneryCtrlPressed) + { + const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenPos); + gridPos = mapCoords; + + if (gridPos.IsNull()) + return; + + gSceneryPlaceZ = 0; + + // If SHIFT pressed + if (gSceneryShiftPressed) + { + auto* surfaceElement = MapGetSurfaceElementAt(gridPos); + + if (surfaceElement == nullptr) + { + gridPos.SetNull(); + return; + } + + int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; + z += gSceneryShiftPressZOffset; + + z = std::clamp(z, 16, maxPossibleHeight); + + gSceneryPlaceZ = z; + } + } + else + { + int16_t z = gSceneryCtrlPressZ; + auto coords = ScreenGetMapXYWithZ(screenPos, z); + if (coords.has_value()) + { + gridPos = *coords; + } + else + { + gridPos.SetNull(); + } + + // If SHIFT pressed + if (gSceneryShiftPressed) + { + z += gSceneryShiftPressZOffset; + } + + z = std::clamp(z, 16, maxPossibleHeight); + + gSceneryPlaceZ = z; + } + + if (gridPos.IsNull()) + return; + + gridPos = gridPos.ToTileStart(); + + Direction rotation = gWindowSceneryRotation; rotation -= GetCurrentRotation(); rotation &= 0x3; @@ -1796,17 +2105,26 @@ private: VirtualFloorSetHeight(gSceneryPlaceZ); } - *outQuadrant = quadrant ^ 2; - *outRotation = rotation; - - return; + *outDirection = rotation; } - // If CTRL not pressed - if (!gSceneryCtrlPressed) + void Sub6E1F34Banner( + const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ, + Direction* outDirection) { - constexpr auto flag = EnumsToFlags(ViewportInteractionItem::Terrain, ViewportInteractionItem::Water); + auto* w = WindowFindByClass(WindowClass::Scenery); + if (w == nullptr) + { + gridPos.SetNull(); + return; + } + + auto screenPos = sourceScreenPos; + Sub6E1F34UpdateScreenCoordsAndButtonsPressed(false, screenPos); + + // Banner + constexpr auto flag = EnumsToFlags(ViewportInteractionItem::Footpath, ViewportInteractionItem::PathAddition); auto info = GetMapCoordinatesFromPos(screenPos, flag); gridPos = info.Loc; @@ -1816,1066 +2134,694 @@ private: return; } - // If CTRL and SHIFT not pressed - gSceneryPlaceZ = 0; + uint8_t rotation = gWindowSceneryRotation; + rotation -= GetCurrentRotation(); + rotation &= 0x3; - // If SHIFT pressed - if (gSceneryShiftPressed) + auto z = info.Element->GetBaseZ(); + + if (info.Element->AsPath()->IsSloped()) { - auto surfaceElement = MapGetSurfaceElementAt(gridPos); - - if (surfaceElement == nullptr) + if (rotation != DirectionReverse(info.Element->AsPath()->GetSlopeDirection())) { - gridPos.SetNull(); - return; + z += (2 * COORDS_Z_STEP); } - - int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; - z += gSceneryShiftPressZOffset; - - z = std::clamp(z, 16, maxPossibleHeight); - - gSceneryPlaceZ = z; - } - } - else - { - int16_t z = gSceneryCtrlPressZ; - auto coords = ScreenGetMapXYWithZ(screenPos, z); - if (coords.has_value()) - { - gridPos = *coords; - } - else - { - gridPos.SetNull(); - } - // If SHIFT pressed - if (gSceneryShiftPressed) - { - z += gSceneryShiftPressZOffset; } - z = std::clamp(z, 16, maxPossibleHeight); - - gSceneryPlaceZ = z; - } - - if (gridPos.IsNull()) - return; - - gridPos = gridPos.ToTileStart(); - uint8_t rotation = gWindowSceneryRotation; - - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) - { - rotation = UtilRand() & 0xFF; - } - - rotation -= GetCurrentRotation(); - rotation &= 0x3; - - if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) - { - VirtualFloorSetHeight(gSceneryPlaceZ); - } - - *outQuadrant = 0; - *outRotation = rotation; - } - - void Sub6E1F34PathItem( - const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ) - { - auto* w = WindowFindByClass(WindowClass::Scenery); - - if (w == nullptr) - { - gridPos.SetNull(); - return; - } - - auto screenPos = sourceScreenPos; - Sub6E1F34UpdateScreenCoordsAndButtonsPressed(false, screenPos); - - // Path bits - constexpr auto flag = EnumsToFlags(ViewportInteractionItem::Footpath, ViewportInteractionItem::PathAddition); - auto info = GetMapCoordinatesFromPos(screenPos, flag); - gridPos = info.Loc; - - if (info.SpriteType == ViewportInteractionItem::None) - { - gridPos.SetNull(); - return; - } - - if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) - { - VirtualFloorSetHeight(gSceneryPlaceZ); - } - - *outZ = info.Element->GetBaseZ(); - } - - void Sub6E1F34Wall( - const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, uint8_t* outEdges) - { - auto* w = WindowFindByClass(WindowClass::Scenery); - - if (w == nullptr) - { - gridPos.SetNull(); - return; - } - - auto screenPos = sourceScreenPos; - uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo( - std::numeric_limits::max() - 32); - - auto* wallEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryIndex); - if (wallEntry != nullptr) - { - maxPossibleHeight -= wallEntry->height; - } - - Sub6E1F34UpdateScreenCoordsAndButtonsPressed(true, screenPos); - - // Walls - uint8_t edge; - // If CTRL not pressed - if (!gSceneryCtrlPressed) - { - auto gridCoords = ScreenGetMapXYSide(screenPos, &edge); - if (!gridCoords.has_value()) + if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) { - gridPos.SetNull(); + VirtualFloorSetHeight(gSceneryPlaceZ); + } + + *outDirection = rotation; + *outZ = z; + } + + /** + * + * rct2: 0x006E2CC6 + */ + void SceneryToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) + { + SceneryRemoveGhostToolPlacement(); + if (gWindowSceneryPaintEnabled & 1) + { + RepaintSceneryToolDown(screenCoords, widgetIndex); return; } - gridPos = gridCoords.value(); - gSceneryPlaceZ = 0; - - // If SHIFT pressed - if (gSceneryShiftPressed) + if (gWindowSceneryEyedropperEnabled) { - auto* surfaceElement = MapGetSurfaceElementAt(gridPos); - - if (surfaceElement == nullptr) - { - gridPos.SetNull(); - return; - } - - int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; - z += gSceneryShiftPressZOffset; - - z = std::clamp(z, 16, maxPossibleHeight); - - gSceneryPlaceZ = z; - } - } - else - { - int16_t z = gSceneryCtrlPressZ; - auto mapCoords = ScreenGetMapXYSideWithZ(screenPos, z, &edge); - if (!mapCoords.has_value()) - { - gridPos.SetNull(); + SceneryEyedropperToolDown(screenCoords, widgetIndex); return; } - gridPos = mapCoords.value(); - // If SHIFT pressed - if (gSceneryShiftPressed) + auto selectedTab = WindowSceneryGetTabSelection(); + uint8_t sceneryType = selectedTab.SceneryType; + uint16_t selectedScenery = selectedTab.EntryIndex; + CoordsXY gridPos; + + switch (sceneryType) { - z += gSceneryShiftPressZOffset; - } - - z = std::clamp(z, 16, maxPossibleHeight); - - gSceneryPlaceZ = z; - } - - if (gridPos.IsNull()) - return; - - if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) - { - VirtualFloorSetHeight(gSceneryPlaceZ); - } - - *outEdges = edge; - } - - void Sub6E1F34LargeScenery( - const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, Direction* outDirection) - { - auto* w = WindowFindByClass(WindowClass::Scenery); - - if (w == nullptr) - { - gridPos.SetNull(); - return; - } - - auto screenPos = sourceScreenPos; - uint16_t maxPossibleHeight = ZoomLevel::max().ApplyTo( - std::numeric_limits::max() - 32); - - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(sceneryIndex); - if (sceneryEntry) - { - int16_t maxClearZ = 0; - for (int32_t i = 0; sceneryEntry->tiles[i].x_offset != -1; ++i) - { - maxClearZ = std::max(maxClearZ, sceneryEntry->tiles[i].z_clearance); - } - maxPossibleHeight = std::max(0, maxPossibleHeight - maxClearZ); - } - - Sub6E1F34UpdateScreenCoordsAndButtonsPressed(true, screenPos); - - // Large scenery - // If CTRL not pressed - if (!gSceneryCtrlPressed) - { - const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenPos); - gridPos = mapCoords; - - if (gridPos.IsNull()) - return; - - gSceneryPlaceZ = 0; - - // If SHIFT pressed - if (gSceneryShiftPressed) - { - auto* surfaceElement = MapGetSurfaceElementAt(gridPos); - - if (surfaceElement == nullptr) + case SCENERY_TYPE_SMALL: { - gridPos.SetNull(); - return; - } + uint8_t quadrant; + Direction rotation; + Sub6E1F34SmallScenery(screenCoords, selectedScenery, gridPos, &quadrant, &rotation); + if (gridPos.IsNull()) + return; - int16_t z = (surfaceElement->GetBaseZ()) & 0xFFF0; - z += gSceneryShiftPressZOffset; - - z = std::clamp(z, 16, maxPossibleHeight); - - gSceneryPlaceZ = z; - } - } - else - { - int16_t z = gSceneryCtrlPressZ; - auto coords = ScreenGetMapXYWithZ(screenPos, z); - if (coords.has_value()) - { - gridPos = *coords; - } - else - { - gridPos.SetNull(); - } - - // If SHIFT pressed - if (gSceneryShiftPressed) - { - z += gSceneryShiftPressZOffset; - } - - z = std::clamp(z, 16, maxPossibleHeight); - - gSceneryPlaceZ = z; - } - - if (gridPos.IsNull()) - return; - - gridPos = gridPos.ToTileStart(); - - Direction rotation = gWindowSceneryRotation; - rotation -= GetCurrentRotation(); - rotation &= 0x3; - - if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) - { - VirtualFloorSetHeight(gSceneryPlaceZ); - } - - *outDirection = rotation; - } - - void Sub6E1F34Banner( - const ScreenCoordsXY& sourceScreenPos, ObjectEntryIndex sceneryIndex, CoordsXY& gridPos, int32_t* outZ, - Direction* outDirection) - { - auto* w = WindowFindByClass(WindowClass::Scenery); - - if (w == nullptr) - { - gridPos.SetNull(); - return; - } - - auto screenPos = sourceScreenPos; - Sub6E1F34UpdateScreenCoordsAndButtonsPressed(false, screenPos); - - // Banner - constexpr auto flag = EnumsToFlags(ViewportInteractionItem::Footpath, ViewportInteractionItem::PathAddition); - auto info = GetMapCoordinatesFromPos(screenPos, flag); - gridPos = info.Loc; - - if (info.SpriteType == ViewportInteractionItem::None) - { - gridPos.SetNull(); - return; - } - - uint8_t rotation = gWindowSceneryRotation; - rotation -= GetCurrentRotation(); - rotation &= 0x3; - - auto z = info.Element->GetBaseZ(); - - if (info.Element->AsPath()->IsSloped()) - { - if (rotation != DirectionReverse(info.Element->AsPath()->GetSlopeDirection())) - { - z += (2 * COORDS_Z_STEP); - } - } - - if (gConfigGeneral.VirtualFloorStyle != VirtualFloorStyles::Off) - { - VirtualFloorSetHeight(gSceneryPlaceZ); - } - - *outDirection = rotation; - *outZ = z; - } - - /** - * - * rct2: 0x006E2CC6 - */ - void SceneryToolDown(const ScreenCoordsXY& screenCoords, WidgetIndex widgetIndex) - { - SceneryRemoveGhostToolPlacement(); - if (gWindowSceneryPaintEnabled & 1) - { - RepaintSceneryToolDown(screenCoords, widgetIndex); - return; - } - - if (gWindowSceneryEyedropperEnabled) - { - SceneryEyedropperToolDown(screenCoords, widgetIndex); - return; - } - - auto selectedTab = WindowSceneryGetTabSelection(); - uint8_t sceneryType = selectedTab.SceneryType; - uint16_t selectedScenery = selectedTab.EntryIndex; - CoordsXY gridPos; - - switch (sceneryType) - { - case SCENERY_TYPE_SMALL: - { - uint8_t quadrant; - Direction rotation; - Sub6E1F34SmallScenery(screenCoords, selectedScenery, gridPos, &quadrant, &rotation); - if (gridPos.IsNull()) - return; - - int32_t quantity = 1; - bool isCluster = gWindowSceneryScatterEnabled - && (NetworkGetMode() != NETWORK_MODE_CLIENT - || NetworkCanPerformCommand(NetworkGetCurrentPlayerGroupIndex(), -2)); - - if (isCluster) - { - switch (gWindowSceneryScatterDensity) - { - case ScatterToolDensity::LowDensity: - quantity = gWindowSceneryScatterSize; - break; - - case ScatterToolDensity::MediumDensity: - quantity = gWindowSceneryScatterSize * 2; - break; - - case ScatterToolDensity::HighDensity: - quantity = gWindowSceneryScatterSize * 3; - break; - } - } - - bool forceError = true; - for (int32_t q = 0; q < quantity; q++) - { - int32_t zCoordinate = gSceneryPlaceZ; - auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selectedScenery); - - int16_t cur_grid_x = gridPos.x; - int16_t cur_grid_y = gridPos.y; + int32_t quantity = 1; + bool isCluster = gWindowSceneryScatterEnabled + && (NetworkGetMode() != NETWORK_MODE_CLIENT + || NetworkCanPerformCommand(NetworkGetCurrentPlayerGroupIndex(), -2)); if (isCluster) { - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) + switch (gWindowSceneryScatterDensity) { - quadrant = UtilRand() & 3; - } + case ScatterToolDensity::LowDensity: + quantity = gWindowSceneryScatterSize; + break; - int16_t grid_x_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); - int16_t grid_y_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); - if (gWindowSceneryScatterSize % 2 == 0) - { - grid_x_offset += 1; - grid_y_offset += 1; - } - cur_grid_x += grid_x_offset * COORDS_XY_STEP; - cur_grid_y += grid_y_offset * COORDS_XY_STEP; + case ScatterToolDensity::MediumDensity: + quantity = gWindowSceneryScatterSize * 2; + break; - if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) - { - gSceneryPlaceRotation = (gSceneryPlaceRotation + 1) & 3; + case ScatterToolDensity::HighDensity: + quantity = gWindowSceneryScatterSize * 3; + break; } } + bool forceError = true; + for (int32_t q = 0; q < quantity; q++) + { + int32_t zCoordinate = gSceneryPlaceZ; + auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry(selectedScenery); + + int16_t cur_grid_x = gridPos.x; + int16_t cur_grid_y = gridPos.y; + + if (isCluster) + { + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) + { + quadrant = UtilRand() & 3; + } + + int16_t grid_x_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); + int16_t grid_y_offset = (UtilRand() % gWindowSceneryScatterSize) - (gWindowSceneryScatterSize / 2); + if (gWindowSceneryScatterSize % 2 == 0) + { + grid_x_offset += 1; + grid_y_offset += 1; + } + cur_grid_x += grid_x_offset * COORDS_XY_STEP; + cur_grid_y += grid_y_offset * COORDS_XY_STEP; + + if (!sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_ROTATABLE)) + { + gSceneryPlaceRotation = (gSceneryPlaceRotation + 1) & 3; + } + } + + uint8_t zAttemptRange = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) + { + zAttemptRange = 20; + } + + auto success = GameActions::Status::Unknown; + // Try find a valid z coordinate + for (; zAttemptRange != 0; zAttemptRange--) + { + auto smallSceneryPlaceAction = SmallSceneryPlaceAction( + { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, + gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + auto res = GameActions::Query(&smallSceneryPlaceAction); + success = res.Error; + if (res.Error == GameActions::Status::Ok) + { + break; + } + + if (res.Error == GameActions::Status::InsufficientFunds) + { + break; + } + if (zAttemptRange != 1) + { + gSceneryPlaceZ += 8; + } + } + + // Actually place + if (success == GameActions::Status::Ok || ((q + 1 == quantity) && forceError)) + { + auto smallSceneryPlaceAction = SmallSceneryPlaceAction( + { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, + gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + smallSceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + } + }); + auto res = GameActions::Execute(&smallSceneryPlaceAction); + if (res.Error == GameActions::Status::Ok) + { + forceError = false; + } + + if (res.Error == GameActions::Status::InsufficientFunds) + { + break; + } + } + gSceneryPlaceZ = zCoordinate; + } + break; + } + case SCENERY_TYPE_PATH_ITEM: + { + int32_t z; + Sub6E1F34PathItem(screenCoords, selectedScenery, gridPos, &z); + if (gridPos.IsNull()) + return; + + auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery); + + footpathAdditionPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + if (result->Error != GameActions::Status::Ok) + { + return; + } + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + }); + auto res = GameActions::Execute(&footpathAdditionPlaceAction); + break; + } + case SCENERY_TYPE_WALL: + { + uint8_t edges; + Sub6E1F34Wall(screenCoords, selectedScenery, gridPos, &edges); + if (gridPos.IsNull()) + return; + uint8_t zAttemptRange = 1; if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) { zAttemptRange = 20; } - auto success = GameActions::Status::Unknown; - // Try find a valid z coordinate for (; zAttemptRange != 0; zAttemptRange--) { - auto smallSceneryPlaceAction = SmallSceneryPlaceAction( - { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, - gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - auto res = GameActions::Query(&smallSceneryPlaceAction); - success = res.Error; + auto wallPlaceAction = WallPlaceAction( + selectedScenery, { gridPos, gSceneryPlaceZ }, edges, gWindowSceneryPrimaryColour, + gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); + + auto res = GameActions::Query(&wallPlaceAction); if (res.Error == GameActions::Status::Ok) { break; } - if (res.Error == GameActions::Status::InsufficientFunds) + if (const auto* message = std::get_if(&res.ErrorMessage)) { - break; + if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) + { + break; + } } + if (zAttemptRange != 1) { gSceneryPlaceZ += 8; } } - // Actually place - if (success == GameActions::Status::Ok || ((q + 1 == quantity) && forceError)) - { - auto smallSceneryPlaceAction = SmallSceneryPlaceAction( - { cur_grid_x, cur_grid_y, gSceneryPlaceZ, gSceneryPlaceRotation }, quadrant, selectedScenery, - gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - smallSceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - } - }); - auto res = GameActions::Execute(&smallSceneryPlaceAction); - if (res.Error == GameActions::Status::Ok) - { - forceError = false; - } - - if (res.Error == GameActions::Status::InsufficientFunds) - { - break; - } - } - gSceneryPlaceZ = zCoordinate; - } - break; - } - case SCENERY_TYPE_PATH_ITEM: - { - int32_t z; - Sub6E1F34PathItem(screenCoords, selectedScenery, gridPos, &z); - if (gridPos.IsNull()) - return; - - auto footpathAdditionPlaceAction = FootpathAdditionPlaceAction({ gridPos, z }, selectedScenery); - - footpathAdditionPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error != GameActions::Status::Ok) - { - return; - } - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - }); - auto res = GameActions::Execute(&footpathAdditionPlaceAction); - break; - } - case SCENERY_TYPE_WALL: - { - uint8_t edges; - Sub6E1F34Wall(screenCoords, selectedScenery, gridPos, &edges); - if (gridPos.IsNull()) - return; - - uint8_t zAttemptRange = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - zAttemptRange = 20; - } - - for (; zAttemptRange != 0; zAttemptRange--) - { auto wallPlaceAction = WallPlaceAction( selectedScenery, { gridPos, gSceneryPlaceZ }, edges, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - auto res = GameActions::Query(&wallPlaceAction); - if (res.Error == GameActions::Status::Ok) + wallPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + } + }); + auto res = GameActions::Execute(&wallPlaceAction); + break; + } + case SCENERY_TYPE_LARGE: + { + Direction direction; + Sub6E1F34LargeScenery(screenCoords, selectedScenery, gridPos, &direction); + if (gridPos.IsNull()) + return; + + uint8_t zAttemptRange = 1; + if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) { - break; + zAttemptRange = 20; } - if (const auto* message = std::get_if(&res.ErrorMessage)) + for (; zAttemptRange != 0; zAttemptRange--) { - if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) + CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; + + auto sceneryPlaceAction = LargeSceneryPlaceAction( + loc, selectedScenery, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, + gWindowSceneryTertiaryColour); + + auto res = GameActions::Query(&sceneryPlaceAction); + if (res.Error == GameActions::Status::Ok) { break; } + + if (const auto* message = std::get_if(&res.ErrorMessage)) + { + if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) + { + break; + } + } + + if (zAttemptRange != 1) + { + gSceneryPlaceZ += 8; + } } - if (zAttemptRange != 1) - { - gSceneryPlaceZ += 8; - } - } - - auto wallPlaceAction = WallPlaceAction( - selectedScenery, { gridPos, gSceneryPlaceZ }, edges, gWindowSceneryPrimaryColour, - gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - wallPlaceAction.SetCallback([](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - } - }); - auto res = GameActions::Execute(&wallPlaceAction); - break; - } - case SCENERY_TYPE_LARGE: - { - Direction direction; - Sub6E1F34LargeScenery(screenCoords, selectedScenery, gridPos, &direction); - if (gridPos.IsNull()) - return; - - uint8_t zAttemptRange = 1; - if (gSceneryPlaceZ != 0 && gSceneryShiftPressed) - { - zAttemptRange = 20; - } - - for (; zAttemptRange != 0; zAttemptRange--) - { CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; auto sceneryPlaceAction = LargeSceneryPlaceAction( loc, selectedScenery, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, gWindowSceneryTertiaryColour); - - auto res = GameActions::Query(&sceneryPlaceAction); - if (res.Error == GameActions::Status::Ok) - { - break; - } - - if (const auto* message = std::get_if(&res.ErrorMessage)) - { - if (*message == STR_NOT_ENOUGH_CASH_REQUIRES || *message == STR_CAN_ONLY_BUILD_THIS_ON_WATER) + sceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) { - break; - } - } - - if (zAttemptRange != 1) - { - gSceneryPlaceZ += 8; - } - } - - CoordsXYZD loc = { gridPos, gSceneryPlaceZ, direction }; - - auto sceneryPlaceAction = LargeSceneryPlaceAction( - loc, selectedScenery, gWindowSceneryPrimaryColour, gWindowScenerySecondaryColour, - gWindowSceneryTertiaryColour); - sceneryPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - } - else - { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, { loc.x, loc.y, gSceneryPlaceZ }); - } - }); - auto res = GameActions::Execute(&sceneryPlaceAction); - break; - } - case SCENERY_TYPE_BANNER: - { - int32_t z; - Direction direction; - Sub6E1F34Banner(screenCoords, selectedScenery, gridPos, &z, &direction); - if (gridPos.IsNull()) - return; - - CoordsXYZD loc{ gridPos, z, direction }; - auto primaryColour = gWindowSceneryPrimaryColour; - auto bannerPlaceAction = BannerPlaceAction(loc, selectedScenery, primaryColour); - bannerPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) - { - auto data = result->GetData(); - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); - ContextOpenDetailWindow(WD_BANNER, data.bannerId.ToUnderlying()); - } - }); - GameActions::Execute(&bannerPlaceAction); - break; - } - } - } - - ClearAction GetClearAction() - { - auto range = MapRange(gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y); - - ClearableItems itemsToClear = 0; - - if (gClearSmallScenery) - itemsToClear |= CLEARABLE_ITEMS::SCENERY_SMALL; - if (gClearLargeScenery) - itemsToClear |= CLEARABLE_ITEMS::SCENERY_LARGE; - if (gClearFootpath) - itemsToClear |= CLEARABLE_ITEMS::SCENERY_FOOTPATH; - - return ClearAction(range, itemsToClear); - } - -public: - void OnMouseUp(WidgetIndex widgetIndex) override - { - WindowBase* mainWindow; - - switch (widgetIndex) - { - case WIDX_PAUSE: - if (NetworkGetMode() != NETWORK_MODE_CLIENT) - { - auto pauseToggleAction = PauseToggleAction(); - GameActions::Execute(&pauseToggleAction); - } - break; - case WIDX_ZOOM_OUT: - if ((mainWindow = WindowGetMain()) != nullptr) - WindowZoomOut(*mainWindow, false); - break; - case WIDX_ZOOM_IN: - if ((mainWindow = WindowGetMain()) != nullptr) - WindowZoomIn(*mainWindow, false); - break; - case WIDX_CLEAR_SCENERY: - ToggleClearSceneryWindow(WIDX_CLEAR_SCENERY); - break; - case WIDX_LAND: - ToggleLandWindow(WIDX_LAND); - break; - case WIDX_WATER: - ToggleWaterWindow(WIDX_WATER); - break; - case WIDX_SCENERY: - if (!ToolSet(*this, WIDX_SCENERY, Tool::Arrow)) - { - InputSetFlag(INPUT_FLAG_6, true); - ContextOpenWindow(WindowClass::Scenery); - } - break; - case WIDX_PATH: - ToggleFootpathWindow(); - break; - case WIDX_CONSTRUCT_RIDE: - ContextOpenWindow(WindowClass::ConstructRide); - break; - case WIDX_RIDES: - ContextOpenWindow(WindowClass::RideList); - break; - case WIDX_PARK: - ContextOpenWindow(WindowClass::ParkInformation); - break; - case WIDX_STAFF: - ContextOpenWindow(WindowClass::StaffList); - break; - case WIDX_GUESTS: - ContextOpenWindow(WindowClass::GuestList); - break; - case WIDX_FINANCES: - ContextOpenWindow(WindowClass::Finances); - break; - case WIDX_RESEARCH: - ContextOpenWindow(WindowClass::Research); - break; - case WIDX_NEWS: - ContextOpenWindow(WindowClass::RecentNews); - break; - case WIDX_MUTE: - OpenRCT2::Audio::ToggleAllSounds(); - break; - case WIDX_CHAT: - if (ChatAvailable()) - { - ChatToggle(); - } - else - { - ContextShowError(STR_CHAT_UNAVAILABLE, STR_NONE, {}); - } - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - int32_t numItems = 0; - Widget& widget = widgets[widgetIndex]; - - switch (widgetIndex) - { - case WIDX_FILE_MENU: - if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - { - gDropdownItems[numItems++].Format = STR_ABOUT; - gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; - - if (OpenRCT2::GetContext()->HasNewVersionInfo()) - gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; - - gDropdownItems[numItems++].Format = STR_EMPTY; - - if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) - gDropdownItems[numItems++].Format = STR_QUIT_ROLLERCOASTER_DESIGNER; - else - gDropdownItems[numItems++].Format = STR_QUIT_TRACK_DESIGNS_MANAGER; - - gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; - } - else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - { - gDropdownItems[numItems++].Format = STR_LOAD_LANDSCAPE; - gDropdownItems[numItems++].Format = STR_SAVE_LANDSCAPE; - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_ABOUT; - gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; - - if (OpenRCT2::GetContext()->HasNewVersionInfo()) - gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; - - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_QUIT_SCENARIO_EDITOR; - gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; - } - else - { - gDropdownItems[numItems++].Format = STR_NEW_GAME; - gDropdownItems[numItems++].Format = STR_LOAD_GAME; - gDropdownItems[numItems++].Format = STR_SAVE_GAME; - gDropdownItems[numItems++].Format = STR_SAVE_GAME_AS; - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_ABOUT; - gDropdownItems[numItems++].Format = STR_OPTIONS; - gDropdownItems[numItems++].Format = STR_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; - - if (OpenRCT2::GetContext()->HasNewVersionInfo()) - gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; - - gDropdownItems[numItems++].Format = STR_EMPTY; - gDropdownItems[numItems++].Format = STR_QUIT_TO_MENU; - gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; - } - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, - Dropdown::Flag::StayOpen, numItems); - break; - case WIDX_CHEATS: - InitCheatsMenu(widget); - break; - case WIDX_VIEW_MENU: - InitViewMenu(widget); - break; - case WIDX_MAP: - InitMapMenu(widget); - break; - case WIDX_FASTFORWARD: - InitFastforwardMenu(widget); - break; - case WIDX_ROTATE: - InitRotateMenu(widget); - break; - case WIDX_DEBUG: - InitDebugMenu(widget); - break; - case WIDX_NETWORK: - InitNetworkMenu(widget); - break; - } - } - - void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override - { - if (selectedIndex == -1) - { - return; - } - switch (widgetIndex) - { - case WIDX_FILE_MENU: - - // New game is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of - // the other modes. - if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR)) - selectedIndex += 1; - - // Quicksave is only available in the normal game. Skip one position to avoid incorrect mappings in the menus of - // the other modes. - if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR) && selectedIndex > DDIDX_LOAD_GAME) - selectedIndex += 1; - - // Track designer and track designs manager start with About, not Load/save - if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) - selectedIndex += DDIDX_ABOUT; - - // The "Update available" menu item is only available when there is one - if (selectedIndex >= DDIDX_UPDATE_AVAILABLE && !OpenRCT2::GetContext()->HasNewVersionInfo()) - selectedIndex += 1; - - switch (selectedIndex) - { - case DDIDX_NEW_GAME: - { - auto intent = Intent(WindowClass::ScenarioSelect); - intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(ScenarioSelectCallback)); - ContextOpenIntent(&intent); - break; - } - case DDIDX_LOAD_GAME: - { - auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); - GameActions::Execute(&loadOrQuitAction); - break; - } - case DDIDX_SAVE_GAME: - ToolCancel(); - SaveGame(); - break; - case DDIDX_SAVE_GAME_AS: - if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - { - auto intent = Intent(WindowClass::Loadsave); - intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); - intent.PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName); - ContextOpenIntent(&intent); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); } else { - ToolCancel(); - SaveGameAs(); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, { loc.x, loc.y, gSceneryPlaceZ }); } - break; - case DDIDX_ABOUT: - ContextOpenWindow(WindowClass::About); - break; - case DDIDX_OPTIONS: - ContextOpenWindow(WindowClass::Options); - break; - case DDIDX_SCREENSHOT: - gScreenshotCountdown = 10; - break; - case DDIDX_GIANT_SCREENSHOT: - ScreenshotGiant(); - break; - case DDIDX_FILE_BUG_ON_GITHUB: + }); + auto res = GameActions::Execute(&sceneryPlaceAction); + break; + } + case SCENERY_TYPE_BANNER: + { + int32_t z; + Direction direction; + Sub6E1F34Banner(screenCoords, selectedScenery, gridPos, &z, &direction); + if (gridPos.IsNull()) + return; + + CoordsXYZD loc{ gridPos, z, direction }; + auto primaryColour = gWindowSceneryPrimaryColour; + auto bannerPlaceAction = BannerPlaceAction(loc, selectedScenery, primaryColour); + bannerPlaceAction.SetCallback([=](const GameAction* ga, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + auto data = result->GetData(); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, result->Position); + ContextOpenDetailWindow(WD_BANNER, data.bannerId.ToUnderlying()); + } + }); + GameActions::Execute(&bannerPlaceAction); + break; + } + } + } + + ClearAction GetClearAction() + { + auto range = MapRange(gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y); + + ClearableItems itemsToClear = 0; + + if (gClearSmallScenery) + itemsToClear |= CLEARABLE_ITEMS::SCENERY_SMALL; + if (gClearLargeScenery) + itemsToClear |= CLEARABLE_ITEMS::SCENERY_LARGE; + if (gClearFootpath) + itemsToClear |= CLEARABLE_ITEMS::SCENERY_FOOTPATH; + + return ClearAction(range, itemsToClear); + } + + public: + void OnMouseUp(WidgetIndex widgetIndex) override + { + WindowBase* mainWindow; + + switch (widgetIndex) + { + case WIDX_PAUSE: + if (NetworkGetMode() != NETWORK_MODE_CLIENT) { - std::string url = "https://github.com/OpenRCT2/OpenRCT2/issues/new?" - "assignees=&labels=bug&template=bug_report.yaml"; - // Automatically fill the "OpenRCT2 build" input - auto versionStr = String::URLEncode(gVersionInfoFull); - url.append("&f299dd2a20432827d99b648f73eb4649b23f8ec98d158d6f82b81e43196ee36b=" + versionStr); - OpenRCT2::GetContext()->GetUiContext()->OpenURL(url); + auto pauseToggleAction = PauseToggleAction(); + GameActions::Execute(&pauseToggleAction); } break; - case DDIDX_UPDATE_AVAILABLE: - ContextOpenWindowView(WV_NEW_VERSION_INFO); - break; - case DDIDX_QUIT_TO_MENU: + case WIDX_ZOOM_OUT: + if ((mainWindow = WindowGetMain()) != nullptr) + WindowZoomOut(*mainWindow, false); + break; + case WIDX_ZOOM_IN: + if ((mainWindow = WindowGetMain()) != nullptr) + WindowZoomIn(*mainWindow, false); + break; + case WIDX_CLEAR_SCENERY: + ToggleClearSceneryWindow(WIDX_CLEAR_SCENERY); + break; + case WIDX_LAND: + ToggleLandWindow(WIDX_LAND); + break; + case WIDX_WATER: + ToggleWaterWindow(WIDX_WATER); + break; + case WIDX_SCENERY: + if (!ToolSet(*this, WIDX_SCENERY, Tool::Arrow)) { - WindowCloseByClass(WindowClass::ManageTrackDesign); - WindowCloseByClass(WindowClass::TrackDeletePrompt); - auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt, PromptMode::SaveBeforeQuit); - GameActions::Execute(&loadOrQuitAction); - break; + InputSetFlag(INPUT_FLAG_6, true); + ContextOpenWindow(WindowClass::Scenery); } - case DDIDX_EXIT_OPENRCT2: - ContextQuit(); + break; + case WIDX_PATH: + ToggleFootpathWindow(); + break; + case WIDX_CONSTRUCT_RIDE: + ContextOpenWindow(WindowClass::ConstructRide); + break; + case WIDX_RIDES: + ContextOpenWindow(WindowClass::RideList); + break; + case WIDX_PARK: + ContextOpenWindow(WindowClass::ParkInformation); + break; + case WIDX_STAFF: + ContextOpenWindow(WindowClass::StaffList); + break; + case WIDX_GUESTS: + ContextOpenWindow(WindowClass::GuestList); + break; + case WIDX_FINANCES: + ContextOpenWindow(WindowClass::Finances); + break; + case WIDX_RESEARCH: + ContextOpenWindow(WindowClass::Research); + break; + case WIDX_NEWS: + ContextOpenWindow(WindowClass::RecentNews); + break; + case WIDX_MUTE: + OpenRCT2::Audio::ToggleAllSounds(); + break; + case WIDX_CHAT: + if (ChatAvailable()) + { + ChatToggle(); + } + else + { + ContextShowError(STR_CHAT_UNAVAILABLE, STR_NONE, {}); + } + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + int32_t numItems = 0; + Widget& widget = widgets[widgetIndex]; + + switch (widgetIndex) + { + case WIDX_FILE_MENU: + if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + { + gDropdownItems[numItems++].Format = STR_ABOUT; + gDropdownItems[numItems++].Format = STR_OPTIONS; + gDropdownItems[numItems++].Format = STR_SCREENSHOT; + gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; + + gDropdownItems[numItems++].Format = STR_EMPTY; + + if (gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) + gDropdownItems[numItems++].Format = STR_QUIT_ROLLERCOASTER_DESIGNER; + else + gDropdownItems[numItems++].Format = STR_QUIT_TRACK_DESIGNS_MANAGER; + + gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; + } + else if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + gDropdownItems[numItems++].Format = STR_LOAD_LANDSCAPE; + gDropdownItems[numItems++].Format = STR_SAVE_LANDSCAPE; + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_ABOUT; + gDropdownItems[numItems++].Format = STR_OPTIONS; + gDropdownItems[numItems++].Format = STR_SCREENSHOT; + gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; + + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_QUIT_SCENARIO_EDITOR; + gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; + } + else + { + gDropdownItems[numItems++].Format = STR_NEW_GAME; + gDropdownItems[numItems++].Format = STR_LOAD_GAME; + gDropdownItems[numItems++].Format = STR_SAVE_GAME; + gDropdownItems[numItems++].Format = STR_SAVE_GAME_AS; + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_ABOUT; + gDropdownItems[numItems++].Format = STR_OPTIONS; + gDropdownItems[numItems++].Format = STR_SCREENSHOT; + gDropdownItems[numItems++].Format = STR_GIANT_SCREENSHOT; + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_FILE_BUG_ON_GITHUB; + + if (OpenRCT2::GetContext()->HasNewVersionInfo()) + gDropdownItems[numItems++].Format = STR_UPDATE_AVAILABLE; + + gDropdownItems[numItems++].Format = STR_EMPTY; + gDropdownItems[numItems++].Format = STR_QUIT_TO_MENU; + gDropdownItems[numItems++].Format = STR_EXIT_OPENRCT2; + } + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, + Dropdown::Flag::StayOpen, numItems); + break; + case WIDX_CHEATS: + InitCheatsMenu(widget); + break; + case WIDX_VIEW_MENU: + InitViewMenu(widget); + break; + case WIDX_MAP: + InitMapMenu(widget); + break; + case WIDX_FASTFORWARD: + InitFastforwardMenu(widget); + break; + case WIDX_ROTATE: + InitRotateMenu(widget); + break; + case WIDX_DEBUG: + InitDebugMenu(widget); + break; + case WIDX_NETWORK: + InitNetworkMenu(widget); + break; + } + } + + void OnDropdown(WidgetIndex widgetIndex, int32_t selectedIndex) override + { + if (selectedIndex == -1) + { + return; + } + switch (widgetIndex) + { + case WIDX_FILE_MENU: + + // New game is only available in the normal game. Skip one position to avoid incorrect mappings in the menus + // of the other modes. + if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR)) + selectedIndex += 1; + + // Quicksave is only available in the normal game. Skip one position to avoid incorrect mappings in the + // menus of the other modes. + if (gScreenFlags & (SCREEN_FLAGS_SCENARIO_EDITOR) && selectedIndex > DDIDX_LOAD_GAME) + selectedIndex += 1; + + // Track designer and track designs manager start with About, not Load/save + if (gScreenFlags & (SCREEN_FLAGS_TRACK_DESIGNER | SCREEN_FLAGS_TRACK_MANAGER)) + selectedIndex += DDIDX_ABOUT; + + // The "Update available" menu item is only available when there is one + if (selectedIndex >= DDIDX_UPDATE_AVAILABLE && !OpenRCT2::GetContext()->HasNewVersionInfo()) + selectedIndex += 1; + + switch (selectedIndex) + { + case DDIDX_NEW_GAME: + { + auto intent = Intent(WindowClass::ScenarioSelect); + intent.PutExtra(INTENT_EXTRA_CALLBACK, reinterpret_cast(ScenarioSelectCallback)); + ContextOpenIntent(&intent); + break; + } + case DDIDX_LOAD_GAME: + { + auto loadOrQuitAction = LoadOrQuitAction(LoadOrQuitModes::OpenSavePrompt); + GameActions::Execute(&loadOrQuitAction); + break; + } + case DDIDX_SAVE_GAME: + ToolCancel(); + SaveGame(); + break; + case DDIDX_SAVE_GAME_AS: + if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + { + auto intent = Intent(WindowClass::Loadsave); + intent.PutExtra(INTENT_EXTRA_LOADSAVE_TYPE, LOADSAVETYPE_SAVE | LOADSAVETYPE_LANDSCAPE); + intent.PutExtra(INTENT_EXTRA_PATH, GetGameState().ScenarioName); + ContextOpenIntent(&intent); + } + else + { + ToolCancel(); + SaveGameAs(); + } + break; + case DDIDX_ABOUT: + ContextOpenWindow(WindowClass::About); + break; + case DDIDX_OPTIONS: + ContextOpenWindow(WindowClass::Options); + break; + case DDIDX_SCREENSHOT: + gScreenshotCountdown = 10; + break; + case DDIDX_GIANT_SCREENSHOT: + ScreenshotGiant(); + break; + case DDIDX_FILE_BUG_ON_GITHUB: + { + std::string url = "https://github.com/OpenRCT2/OpenRCT2/issues/new?" + "assignees=&labels=bug&template=bug_report.yaml"; + // Automatically fill the "OpenRCT2 build" input + auto versionStr = String::URLEncode(gVersionInfoFull); + url.append("&f299dd2a20432827d99b648f73eb4649b23f8ec98d158d6f82b81e43196ee36b=" + versionStr); + OpenRCT2::GetContext()->GetUiContext()->OpenURL(url); + } break; - } - break; - case WIDX_CHEATS: - CheatsMenuDropdown(selectedIndex); - break; - case WIDX_VIEW_MENU: - ViewMenuDropdown(selectedIndex); - break; - case WIDX_MAP: - MapMenuDropdown(selectedIndex); - break; - case WIDX_FASTFORWARD: - FastforwardMenuDropdown(selectedIndex); - break; - case WIDX_ROTATE: - RotateMenuDropdown(selectedIndex); - break; - case WIDX_DEBUG: - DebugMenuDropdown(selectedIndex); - break; - case WIDX_NETWORK: - NetworkMenuDropdown(selectedIndex); - break; + case DDIDX_UPDATE_AVAILABLE: + ContextOpenWindowView(WV_NEW_VERSION_INFO); + break; + case DDIDX_QUIT_TO_MENU: + { + WindowCloseByClass(WindowClass::ManageTrackDesign); + WindowCloseByClass(WindowClass::TrackDeletePrompt); + auto loadOrQuitAction = LoadOrQuitAction( + LoadOrQuitModes::OpenSavePrompt, PromptMode::SaveBeforeQuit); + GameActions::Execute(&loadOrQuitAction); + break; + } + case DDIDX_EXIT_OPENRCT2: + ContextQuit(); + break; + } + break; + case WIDX_CHEATS: + CheatsMenuDropdown(selectedIndex); + break; + case WIDX_VIEW_MENU: + ViewMenuDropdown(selectedIndex); + break; + case WIDX_MAP: + MapMenuDropdown(selectedIndex); + break; + case WIDX_FASTFORWARD: + FastforwardMenuDropdown(selectedIndex); + break; + case WIDX_ROTATE: + RotateMenuDropdown(selectedIndex); + break; + case WIDX_DEBUG: + DebugMenuDropdown(selectedIndex); + break; + case WIDX_NETWORK: + NetworkMenuDropdown(selectedIndex); + break; + } } - } - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - case WIDX_CLEAR_SCENERY: - ToolUpdateSceneryClear(screenCoords); - break; - case WIDX_LAND: - if (gLandPaintMode) - ToolUpdateLandPaint(screenCoords); - else - ToolUpdateLand(screenCoords); - break; - case WIDX_WATER: - ToolUpdateWater(screenCoords); - break; - case WIDX_SCENERY: - ToolUpdateScenery(screenCoords); - break; + switch (widgetIndex) + { + case WIDX_CLEAR_SCENERY: + ToolUpdateSceneryClear(screenCoords); + break; + case WIDX_LAND: + if (gLandPaintMode) + ToolUpdateLandPaint(screenCoords); + else + ToolUpdateLand(screenCoords); + break; + case WIDX_WATER: + ToolUpdateWater(screenCoords); + break; + case WIDX_SCENERY: + ToolUpdateScenery(screenCoords); + break; #ifdef ENABLE_SCRIPTING - default: - auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; - if (customTool) - { - customTool->OnUpdate(screenCoords); - } - break; + default: + auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; + if (customTool) + { + customTool->OnUpdate(screenCoords); + } + break; #endif + } } - } - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - case WIDX_CLEAR_SCENERY: - if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) - { - auto action = GetClearAction(); - GameActions::Execute(&action); - gCurrentToolId = Tool::Crosshair; - } - break; - case WIDX_LAND: - if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) - { - auto surfaceSetStyleAction = SurfaceSetStyleAction( - { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, - gLandToolTerrainSurface, gLandToolTerrainEdge); - - GameActions::Execute(&surfaceSetStyleAction); - - gCurrentToolId = Tool::UpDownArrow; - } - else - { - _landToolBlocked = true; - } - break; - case WIDX_WATER: - if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) - { - gCurrentToolId = Tool::UpDownArrow; - } - else - { - _landToolBlocked = true; - } - break; - case WIDX_SCENERY: - SceneryToolDown(screenCoords, widgetIndex); - break; -#ifdef ENABLE_SCRIPTING - default: - auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; - if (customTool) - { - customTool->OnDown(screenCoords); - } - break; -#endif - } - } - - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - switch (widgetIndex) - { - case WIDX_CLEAR_SCENERY: - if (WindowFindByClass(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) - { - auto action = GetClearAction(); - GameActions::Execute(&action); - gCurrentToolId = Tool::Crosshair; - } - break; - case WIDX_LAND: - // Custom setting to only change land style instead of raising or lowering land - if (gLandPaintMode) - { + switch (widgetIndex) + { + case WIDX_CLEAR_SCENERY: + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) + { + auto action = GetClearAction(); + GameActions::Execute(&action); + gCurrentToolId = Tool::Crosshair; + } + break; + case WIDX_LAND: if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) { auto surfaceSetStyleAction = SurfaceSetStyleAction( @@ -2884,981 +2830,1039 @@ public: GameActions::Execute(&surfaceSetStyleAction); - // The tool is set to 12 here instead of 3 so that the dragging cursor is not the elevation change - // cursor + gCurrentToolId = Tool::UpDownArrow; + } + else + { + _landToolBlocked = true; + } + break; + case WIDX_WATER: + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) + { + gCurrentToolId = Tool::UpDownArrow; + } + else + { + _landToolBlocked = true; + } + break; + case WIDX_SCENERY: + SceneryToolDown(screenCoords, widgetIndex); + break; +#ifdef ENABLE_SCRIPTING + default: + auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; + if (customTool) + { + customTool->OnDown(screenCoords); + } + break; +#endif + } + } + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + switch (widgetIndex) + { + case WIDX_CLEAR_SCENERY: + if (WindowFindByClass(WindowClass::Error) == nullptr && (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE)) + { + auto action = GetClearAction(); + GameActions::Execute(&action); gCurrentToolId = Tool::Crosshair; } - } - else - { + break; + case WIDX_LAND: + // Custom setting to only change land style instead of raising or lowering land + if (gLandPaintMode) + { + if (gMapSelectFlags & MAP_SELECT_FLAG_ENABLE) + { + auto surfaceSetStyleAction = SurfaceSetStyleAction( + { gMapSelectPositionA.x, gMapSelectPositionA.y, gMapSelectPositionB.x, gMapSelectPositionB.y }, + gLandToolTerrainSurface, gLandToolTerrainEdge); + + GameActions::Execute(&surfaceSetStyleAction); + + // The tool is set to 12 here instead of 3 so that the dragging cursor is not the elevation change + // cursor + gCurrentToolId = Tool::Crosshair; + } + } + else + { + if (!_landToolBlocked) + { + LandToolDrag(screenCoords); + } + } + break; + case WIDX_WATER: if (!_landToolBlocked) { - LandToolDrag(screenCoords); + WaterToolDrag(screenCoords); } - } - break; - case WIDX_WATER: - if (!_landToolBlocked) - { - WaterToolDrag(screenCoords); - } - break; - case WIDX_SCENERY: - if (gWindowSceneryPaintEnabled & 1) - SceneryToolDown(screenCoords, widgetIndex); - if (gWindowSceneryEyedropperEnabled) - SceneryToolDown(screenCoords, widgetIndex); - break; + break; + case WIDX_SCENERY: + if (gWindowSceneryPaintEnabled & 1) + SceneryToolDown(screenCoords, widgetIndex); + if (gWindowSceneryEyedropperEnabled) + SceneryToolDown(screenCoords, widgetIndex); + break; #ifdef ENABLE_SCRIPTING - default: - auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; - if (customTool) + default: + auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; + if (customTool) + { + customTool->OnDrag(screenCoords); + } + break; +#endif + } + } + + void OnToolUp(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + _landToolBlocked = false; + switch (widgetIndex) + { + case WIDX_LAND: + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gCurrentToolId = Tool::DigDown; + break; + case WIDX_WATER: + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gCurrentToolId = Tool::WaterDown; + break; + case WIDX_CLEAR_SCENERY: + MapInvalidateSelectionRect(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gCurrentToolId = Tool::Crosshair; + break; +#ifdef ENABLE_SCRIPTING + default: + auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; + if (customTool) + { + customTool->OnUp(screenCoords); + } + break; +#endif + } + } + + void OnToolAbort(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_LAND: + case WIDX_WATER: + case WIDX_CLEAR_SCENERY: + HideGridlines(); + break; +#ifdef ENABLE_SCRIPTING + default: + auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; + if (customTool) + { + customTool->OnAbort(); + customTool = {}; + } + break; +#endif + } + } + + void OnPrepareDraw() override + { + int32_t x, widgetIndex, widgetWidth, firstAlignment; + Widget* widget; + + // Enable / disable buttons + widgets[WIDX_PAUSE].type = WindowWidgetType::TrnBtn; + widgets[WIDX_FILE_MENU].type = WindowWidgetType::TrnBtn; + widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::TrnBtn; + widgets[WIDX_ZOOM_IN].type = WindowWidgetType::TrnBtn; + widgets[WIDX_ROTATE].type = WindowWidgetType::TrnBtn; + widgets[WIDX_VIEW_MENU].type = WindowWidgetType::TrnBtn; + widgets[WIDX_MAP].type = WindowWidgetType::TrnBtn; + widgets[WIDX_MUTE].type = WindowWidgetType::TrnBtn; + widgets[WIDX_CHAT].type = WindowWidgetType::TrnBtn; + widgets[WIDX_LAND].type = WindowWidgetType::TrnBtn; + widgets[WIDX_WATER].type = WindowWidgetType::TrnBtn; + widgets[WIDX_SCENERY].type = WindowWidgetType::TrnBtn; + widgets[WIDX_PATH].type = WindowWidgetType::TrnBtn; + widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::TrnBtn; + widgets[WIDX_RIDES].type = WindowWidgetType::TrnBtn; + widgets[WIDX_PARK].type = WindowWidgetType::TrnBtn; + widgets[WIDX_STAFF].type = WindowWidgetType::TrnBtn; + widgets[WIDX_GUESTS].type = WindowWidgetType::TrnBtn; + widgets[WIDX_CLEAR_SCENERY].type = WindowWidgetType::TrnBtn; + widgets[WIDX_FINANCES].type = WindowWidgetType::TrnBtn; + widgets[WIDX_RESEARCH].type = WindowWidgetType::TrnBtn; + widgets[WIDX_FASTFORWARD].type = WindowWidgetType::TrnBtn; + widgets[WIDX_CHEATS].type = WindowWidgetType::TrnBtn; + widgets[WIDX_DEBUG].type = gConfigGeneral.DebuggingTools ? WindowWidgetType::TrnBtn : WindowWidgetType::Empty; + widgets[WIDX_NEWS].type = WindowWidgetType::TrnBtn; + widgets[WIDX_NETWORK].type = WindowWidgetType::TrnBtn; + + if (!gConfigInterface.ToolbarShowMute) + widgets[WIDX_MUTE].type = WindowWidgetType::Empty; + + if (!gConfigInterface.ToolbarShowChat) + widgets[WIDX_CHAT].type = WindowWidgetType::Empty; + + if (!gConfigInterface.ToolbarShowResearch) + widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; + + if (!gConfigInterface.ToolbarShowCheats) + widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; + + if (!gConfigInterface.ToolbarShowNews) + widgets[WIDX_NEWS].type = WindowWidgetType::Empty; + + if (!gConfigInterface.ToolbarShowZoom) + { + widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; + widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; + } + + if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR || gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; + } + + if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.ToolbarShowFinances) + widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; + + if (gScreenFlags & SCREEN_FLAGS_EDITOR) + { + widgets[WIDX_PARK].type = WindowWidgetType::Empty; + widgets[WIDX_STAFF].type = WindowWidgetType::Empty; + widgets[WIDX_GUESTS].type = WindowWidgetType::Empty; + widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; + widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; + widgets[WIDX_NEWS].type = WindowWidgetType::Empty; + widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; + + auto& gameState = GetGameState(); + if (gameState.EditorStep != EditorStep::LandscapeEditor) { - customTool->OnDrag(screenCoords); + widgets[WIDX_LAND].type = WindowWidgetType::Empty; + widgets[WIDX_WATER].type = WindowWidgetType::Empty; } - break; + + if (gameState.EditorStep != EditorStep::RollercoasterDesigner) + { + widgets[WIDX_RIDES].type = WindowWidgetType::Empty; + widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::Empty; + widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; + } + + if (gameState.EditorStep != EditorStep::LandscapeEditor + && gameState.EditorStep != EditorStep::RollercoasterDesigner) + { + widgets[WIDX_MAP].type = WindowWidgetType::Empty; + widgets[WIDX_SCENERY].type = WindowWidgetType::Empty; + widgets[WIDX_PATH].type = WindowWidgetType::Empty; + widgets[WIDX_CLEAR_SCENERY].type = WindowWidgetType::Empty; + + widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; + widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; + widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; + widgets[WIDX_VIEW_MENU].type = WindowWidgetType::Empty; + } + } + + switch (NetworkGetMode()) + { + case NETWORK_MODE_NONE: + widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; + widgets[WIDX_CHAT].type = WindowWidgetType::Empty; + break; + case NETWORK_MODE_CLIENT: + widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; + [[fallthrough]]; + case NETWORK_MODE_SERVER: + widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; + break; + } + + // Align left hand side toolbar buttons + firstAlignment = 1; + x = 0; + for (size_t i = 0; i < std::size(left_aligned_widgets_order); ++i) + { + widgetIndex = left_aligned_widgets_order[i]; + widget = &widgets[widgetIndex]; + if (widget->type == WindowWidgetType::Empty && widgetIndex != WIDX_SEPARATOR) + continue; + + if (firstAlignment && widgetIndex == WIDX_SEPARATOR) + continue; + + widgetWidth = widget->width(); + widget->left = x; + x += widgetWidth; + widget->right = x; + x += 1; + firstAlignment = 0; + } + + // Align right hand side toolbar buttons if necessary + int32_t screenWidth = ContextGetWidth(); + firstAlignment = 1; + x = std::max(640, screenWidth); + for (size_t i = 0; i < std::size(right_aligned_widgets_order); ++i) + { + widgetIndex = right_aligned_widgets_order[i]; + widget = &widgets[widgetIndex]; + if (widget->type == WindowWidgetType::Empty && widgetIndex != WIDX_SEPARATOR) + continue; + + if (firstAlignment && widgetIndex == WIDX_SEPARATOR) + continue; + + widgetWidth = widget->width(); + x -= 1; + widget->right = x; + x -= widgetWidth; + widget->left = x; + firstAlignment = 0; + } + + // Footpath button pressed down + if (WindowFindByClass(WindowClass::Footpath) == nullptr) + pressed_widgets &= ~(1uLL << WIDX_PATH); + else + pressed_widgets |= (1uLL << WIDX_PATH); + + if (gGamePaused & GAME_PAUSED_NORMAL) + pressed_widgets |= (1uLL << WIDX_PAUSE); + else + pressed_widgets &= ~(1uLL << WIDX_PAUSE); + + if (!OpenRCT2::Audio::gGameSoundsOff) + widgets[WIDX_MUTE].image = ImageId(SPR_G2_TOOLBAR_MUTE, FilterPaletteID::PaletteNull); + else + widgets[WIDX_MUTE].image = ImageId(SPR_G2_TOOLBAR_UNMUTE, FilterPaletteID::PaletteNull); + + // Set map button to the right image. + if (widgets[WIDX_MAP].type != WindowWidgetType::Empty) + { + static constexpr uint32_t _imageIdByRotation[] = { + SPR_G2_MAP_NORTH, + SPR_G2_MAP_WEST, + SPR_G2_MAP_SOUTH, + SPR_G2_MAP_EAST, + }; + + uint32_t mapImageId = _imageIdByRotation[GetCurrentRotation()]; + widgets[WIDX_MAP].image = ImageId(mapImageId, FilterPaletteID::PaletteNull); + } + + // Zoomed out/in disable. Not sure where this code is in the original. + const auto* mainWindow = WindowGetMain(); + if (mainWindow == nullptr || mainWindow->viewport == nullptr) + { + LOG_ERROR("mainWindow or mainWindow->viewport is null!"); + return; + } + + if (mainWindow->viewport->zoom == ZoomLevel::min()) + { + disabled_widgets |= (1uLL << WIDX_ZOOM_IN); + } + else if (mainWindow->viewport->zoom >= ZoomLevel::max()) + { + disabled_widgets |= (1uLL << WIDX_ZOOM_OUT); + } + else + { + disabled_widgets &= ~((1uLL << WIDX_ZOOM_IN) | (1uLL << WIDX_ZOOM_OUT)); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + const auto& gameState = GetGameState(); + int32_t imgId; + + WindowDrawWidgets(*this, dpi); + + ScreenCoordsXY screenPos{}; + // Draw staff button image (setting masks to the staff colours) + if (widgets[WIDX_STAFF].type != WindowWidgetType::Empty) + { + screenPos = { windowPos.x + widgets[WIDX_STAFF].left, windowPos.y + widgets[WIDX_STAFF].top }; + imgId = SPR_TOOLBAR_STAFF; + if (WidgetIsPressed(*this, WIDX_STAFF)) + imgId++; + GfxDrawSprite(dpi, ImageId(imgId, gameState.StaffHandymanColour, gameState.StaffMechanicColour), screenPos); + } + + // Draw fast forward button + if (widgets[WIDX_FASTFORWARD].type != WindowWidgetType::Empty) + { + screenPos = { windowPos.x + widgets[WIDX_FASTFORWARD].left + 0, + windowPos.y + widgets[WIDX_FASTFORWARD].top + 0 }; + if (WidgetIsPressed(*this, WIDX_FASTFORWARD)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_G2_FASTFORWARD), screenPos + ScreenCoordsXY{ 6, 3 }); + + for (int32_t i = 0; i < gGameSpeed && gGameSpeed <= 4; i++) + { + GfxDrawSprite(dpi, ImageId(SPR_G2_SPEED_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 5, 15 }); + } + for (int32_t i = 0; i < 3 && i < gGameSpeed - 4 && gGameSpeed >= 5; i++) + { + GfxDrawSprite(dpi, ImageId(SPR_G2_HYPER_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 6, 15 }); + } + } + + // Draw cheats button + if (widgets[WIDX_CHEATS].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_CHEATS].left - 1, widgets[WIDX_CHEATS].top - 1 }; + if (WidgetIsPressed(*this, WIDX_CHEATS)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_G2_SANDBOX), screenPos); + + // Draw an overlay if clearance checks are disabled + if (GetGameState().Cheats.DisableClearanceChecks) + { + auto colour = static_cast(EnumValue(COLOUR_DARK_ORANGE) | EnumValue(COLOUR_FLAG_OUTLINE)); + DrawTextBasic( + dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {}, + { colour, TextAlignment::RIGHT }); + } + } + + // Draw chat button + if (widgets[WIDX_CHAT].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_CHAT].left, widgets[WIDX_CHAT].top - 2 }; + if (WidgetIsPressed(*this, WIDX_CHAT)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_G2_CHAT), screenPos); + } + + // Draw debug button + if (widgets[WIDX_DEBUG].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_DEBUG].left, widgets[WIDX_DEBUG].top - 1 }; + if (WidgetIsPressed(*this, WIDX_DEBUG)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_TAB_GEARS_0), screenPos); + } + + // Draw research button + if (widgets[WIDX_RESEARCH].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_RESEARCH].left - 1, widgets[WIDX_RESEARCH].top }; + if (WidgetIsPressed(*this, WIDX_RESEARCH)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0), screenPos); + } + + // Draw finances button + if (widgets[WIDX_FINANCES].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_FINANCES].left + 3, widgets[WIDX_FINANCES].top + 1 }; + if (WidgetIsPressed(*this, WIDX_FINANCES)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenPos); + } + + // Draw news button + if (widgets[WIDX_NEWS].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_NEWS].left + 3, widgets[WIDX_NEWS].top + 0 }; + if (WidgetIsPressed(*this, WIDX_NEWS)) + screenPos.y++; + GfxDrawSprite(dpi, ImageId(SPR_G2_TAB_NEWS), screenPos); + } + + // Draw network button + if (widgets[WIDX_NETWORK].type != WindowWidgetType::Empty) + { + screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_NETWORK].left + 3, widgets[WIDX_NETWORK].top + 0 }; + if (WidgetIsPressed(*this, WIDX_NETWORK)) + screenPos.y++; + + // Draw (de)sync icon. + imgId = (NetworkIsDesynchronised() ? SPR_G2_MULTIPLAYER_DESYNC : SPR_G2_MULTIPLAYER_SYNC); + GfxDrawSprite(dpi, ImageId(imgId), screenPos + ScreenCoordsXY{ 3, 11 }); + + // Draw number of players. + auto ft = Formatter(); + ft.Add(NetworkGetNumVisiblePlayers()); + auto colour = static_cast(EnumValue(COLOUR_WHITE) | EnumValue(COLOUR_FLAG_OUTLINE)); + DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft, { colour, TextAlignment::RIGHT }); + } + } + }; + + static void ScenarioSelectCallback(const utf8* path) + { + WindowCloseByClass(WindowClass::EditorObjectSelection); + GameNotifyMapChange(); + GetContext()->LoadParkFromFile(path, false, true); + GameLoadScripts(); + GameNotifyMapChanged(); + } + + /** + * Creates the main game top toolbar window. + * rct2: 0x0066B485 (part of 0x0066B3E8) + */ + WindowBase* WindowTopToolbarOpen() + { + TopToolbar* window = WindowCreate( + WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), TOP_TOOLBAR_HEIGHT + 1, + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); + + window->widgets = _topToolbarWidgets; + + WindowInitScrollWidgets(*window); + + return window; + } + + /** + * + * rct2: 0x0066D104 + */ + bool LandToolIsActive() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar) + return false; + if (gCurrentToolWidget.widget_index != WIDX_LAND) + return false; + return true; + } + + /** + * + * rct2: 0x0066D125 + */ + bool ClearSceneryToolIsActive() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar) + return false; + if (gCurrentToolWidget.widget_index != WIDX_CLEAR_SCENERY) + return false; + return true; + } + + /** + * + * rct2: 0x0066D125 + */ + bool WaterToolIsActive() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar) + return false; + if (gCurrentToolWidget.widget_index != WIDX_WATER) + return false; + return true; + } + + void TopToolbar::InitViewMenu(Widget& widget) + { + using namespace Dropdown; + constexpr ItemExt items[] = { + ToggleOption(DDIDX_UNDERGROUND_INSIDE, STR_UNDERGROUND_VIEW), + ToggleOption(DDIDX_TRANSPARENT_WATER, STR_VIEWPORT_TRANSPARENT_WATER), + ToggleOption(DDIDX_HIDE_BASE, STR_REMOVE_BASE_LAND), + ToggleOption(DDIDX_HIDE_VERTICAL, STR_REMOVE_VERTICAL_FACES), + Separator(), + ToggleOption(DDIDX_HIDE_RIDES, STR_SEE_THROUGH_RIDES), + ToggleOption(DDIDX_HIDE_VEHICLES, STR_SEE_THROUGH_VEHICLES), + ToggleOption(DDIDX_HIDE_VEGETATION, STR_SEE_THROUGH_VEGETATION), + ToggleOption(DDIDX_HIDE_SCENERY, STR_SEE_THROUGH_SCENERY), + ToggleOption(DDIDX_HIDE_PATHS, STR_SEE_THROUGH_PATHS), + ToggleOption(DDIDX_HIDE_SUPPORTS, STR_SEE_THROUGH_SUPPORTS), + ToggleOption(DDIDX_HIDE_GUESTS, STR_SEE_THROUGH_GUESTS), + ToggleOption(DDIDX_HIDE_STAFF, STR_SEE_THROUGH_STAFF), + Separator(), + ToggleOption(DDIDX_LAND_HEIGHTS, STR_HEIGHT_MARKS_ON_LAND), + ToggleOption(DDIDX_TRACK_HEIGHTS, STR_HEIGHT_MARKS_ON_RIDE_TRACKS), + ToggleOption(DDIDX_PATH_HEIGHTS, STR_HEIGHT_MARKS_ON_PATHS), + Separator(), + ToggleOption(DDIDX_VIEW_CLIPPING, STR_VIEW_CLIPPING_MENU), + ToggleOption(DDIDX_HIGHLIGHT_PATH_ISSUES, STR_HIGHLIGHT_PATH_ISSUES_MENU), + Separator(), + ToggleOption(DDIDX_TRANSPARENCY, STR_TRANSPARENCY_OPTIONS), + }; + + static_assert(ItemIDsMatchIndices(items)); + + SetItems(items); + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1] | 0x80, 0, + TOP_TOOLBAR_VIEW_MENU_COUNT); + + // Set checkmarks + auto* mainViewport = WindowGetMain()->viewport; + if (mainViewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) + Dropdown::SetChecked(DDIDX_UNDERGROUND_INSIDE, true); + if (gConfigGeneral.TransparentWater) + Dropdown::SetChecked(DDIDX_TRANSPARENT_WATER, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_BASE) + Dropdown::SetChecked(DDIDX_HIDE_BASE, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_VERTICAL) + Dropdown::SetChecked(DDIDX_HIDE_VERTICAL, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_RIDES) + Dropdown::SetChecked(DDIDX_HIDE_RIDES, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_VEHICLES) + Dropdown::SetChecked(DDIDX_HIDE_VEHICLES, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_VEGETATION) + Dropdown::SetChecked(DDIDX_HIDE_VEGETATION, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_SCENERY) + Dropdown::SetChecked(DDIDX_HIDE_SCENERY, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_PATHS) + Dropdown::SetChecked(DDIDX_HIDE_PATHS, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_SUPPORTS) + Dropdown::SetChecked(DDIDX_HIDE_SUPPORTS, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_GUESTS) + Dropdown::SetChecked(DDIDX_HIDE_GUESTS, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIDE_STAFF) + Dropdown::SetChecked(DDIDX_HIDE_STAFF, true); + if (mainViewport->flags & VIEWPORT_FLAG_LAND_HEIGHTS) + Dropdown::SetChecked(DDIDX_LAND_HEIGHTS, true); + if (mainViewport->flags & VIEWPORT_FLAG_TRACK_HEIGHTS) + Dropdown::SetChecked(DDIDX_TRACK_HEIGHTS, true); + if (mainViewport->flags & VIEWPORT_FLAG_PATH_HEIGHTS) + Dropdown::SetChecked(DDIDX_PATH_HEIGHTS, true); + if (mainViewport->flags & VIEWPORT_FLAG_CLIP_VIEW) + Dropdown::SetChecked(DDIDX_VIEW_CLIPPING, true); + if (mainViewport->flags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) + Dropdown::SetChecked(DDIDX_HIGHLIGHT_PATH_ISSUES, true); + + gDropdownDefaultIndex = DDIDX_UNDERGROUND_INSIDE; + + // Opaque water relies on RCT1 sprites. + if (!IsCsgLoaded()) + { + Dropdown::SetDisabled(DDIDX_TRANSPARENT_WATER, true); + } + } + + void TopToolbar::ViewMenuDropdown(int16_t dropdownIndex) + { + auto* w = WindowGetMain(); + if (w != nullptr) + { + switch (dropdownIndex) + { + case DDIDX_UNDERGROUND_INSIDE: + w->viewport->flags ^= VIEWPORT_FLAG_UNDERGROUND_INSIDE; + break; + case DDIDX_TRANSPARENT_WATER: + gConfigGeneral.TransparentWater ^= 1; + ConfigSaveDefault(); + break; + case DDIDX_HIDE_BASE: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_BASE; + break; + case DDIDX_HIDE_VERTICAL: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VERTICAL; + break; + case DDIDX_HIDE_RIDES: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_RIDES; + break; + case DDIDX_HIDE_VEHICLES: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VEHICLES; + break; + case DDIDX_HIDE_VEGETATION: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VEGETATION; + break; + case DDIDX_HIDE_SCENERY: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_SCENERY; + break; + case DDIDX_HIDE_PATHS: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_PATHS; + break; + case DDIDX_HIDE_SUPPORTS: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_SUPPORTS; + break; + case DDIDX_HIDE_GUESTS: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_GUESTS; + break; + case DDIDX_HIDE_STAFF: + w->viewport->flags ^= VIEWPORT_FLAG_HIDE_STAFF; + break; + case DDIDX_LAND_HEIGHTS: + w->viewport->flags ^= VIEWPORT_FLAG_LAND_HEIGHTS; + break; + case DDIDX_TRACK_HEIGHTS: + w->viewport->flags ^= VIEWPORT_FLAG_TRACK_HEIGHTS; + break; + case DDIDX_PATH_HEIGHTS: + w->viewport->flags ^= VIEWPORT_FLAG_PATH_HEIGHTS; + break; + case DDIDX_VIEW_CLIPPING: + if (WindowFindByClass(WindowClass::ViewClipping) == nullptr) + { + ContextOpenWindow(WindowClass::ViewClipping); + } + else + { + // If window is already open, toggle the view clipping on/off + w->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; + } + break; + case DDIDX_HIGHLIGHT_PATH_ISSUES: + w->viewport->flags ^= VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES; + break; + case DDIDX_TRANSPARENCY: + ContextOpenWindow(WindowClass::Transparency); + break; + default: + return; + } + w->Invalidate(); + } + } + + void TopToolbar::InitMapMenu(Widget& widget) + { + auto i = 0; + gDropdownItems[i++].Format = STR_SHORTCUT_SHOW_MAP; + gDropdownItems[i++].Format = STR_EXTRA_VIEWPORT; + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && GetGameState().EditorStep == EditorStep::LandscapeEditor) + { + gDropdownItems[i++].Format = STR_MAPGEN_WINDOW_TITLE; + } + +#ifdef ENABLE_SCRIPTING + const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; + if (!customMenuItems.empty()) + { + gDropdownItems[i++].Format = STR_EMPTY; + for (const auto& item : customMenuItems) + { + if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Standard) + { + gDropdownItems[i].Format = STR_STRING; + auto sz = item.Text.c_str(); + std::memcpy(&gDropdownItems[i].Args, &sz, sizeof(const char*)); + i++; + } + } + } +#endif + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1] | 0x80, 0, i); + gDropdownDefaultIndex = DDIDX_SHOW_MAP; + } + + void TopToolbar::MapMenuDropdown(int16_t dropdownIndex) + { + int32_t customStartIndex = 3; + if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && GetGameState().EditorStep == EditorStep::LandscapeEditor) + { + customStartIndex++; + } + + if (dropdownIndex < customStartIndex) + { + switch (dropdownIndex) + { + case 0: + ContextOpenWindow(WindowClass::Map); + break; + case 1: + ContextOpenWindow(WindowClass::Viewport); + break; + case 2: + ContextOpenWindow(WindowClass::Mapgen); + break; + } + } + else + { +#ifdef ENABLE_SCRIPTING + const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; + auto customIndex = static_cast(dropdownIndex - customStartIndex); + size_t i = 0; + for (const auto& item : customMenuItems) + { + if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Standard) + { + if (i == customIndex) + { + item.Invoke(); + break; + } + i++; + } + } #endif } } - void OnToolUp(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + void TopToolbar::InitFastforwardMenu(Widget& widget) { - _landToolBlocked = false; - switch (widgetIndex) + int32_t num_items = 4; + gDropdownItems[0].Format = STR_TOGGLE_OPTION; + gDropdownItems[1].Format = STR_TOGGLE_OPTION; + gDropdownItems[2].Format = STR_TOGGLE_OPTION; + gDropdownItems[3].Format = STR_TOGGLE_OPTION; + if (gConfigGeneral.DebuggingTools) { - case WIDX_LAND: - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gCurrentToolId = Tool::DigDown; - break; - case WIDX_WATER: - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gCurrentToolId = Tool::WaterDown; - break; - case WIDX_CLEAR_SCENERY: - MapInvalidateSelectionRect(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gCurrentToolId = Tool::Crosshair; - break; -#ifdef ENABLE_SCRIPTING - default: - auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; - if (customTool) - { - customTool->OnUp(screenCoords); - } - break; -#endif + gDropdownItems[4].Format = STR_EMPTY; + gDropdownItems[5].Format = STR_TOGGLE_OPTION; + gDropdownItems[5].Args = STR_SPEED_HYPER; + num_items = 6; + } + + gDropdownItems[0].Args = STR_SPEED_NORMAL; + gDropdownItems[1].Args = STR_SPEED_QUICK; + gDropdownItems[2].Args = STR_SPEED_FAST; + gDropdownItems[3].Args = STR_SPEED_TURBO; + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, 0, num_items); + + // Set checkmarks + if (gGameSpeed <= 4) + { + Dropdown::SetChecked(gGameSpeed - 1, true); + } + if (gGameSpeed == 8) + { + Dropdown::SetChecked(5, true); + } + + if (gConfigGeneral.DebuggingTools) + { + gDropdownDefaultIndex = (gGameSpeed == 8 ? 0 : gGameSpeed); + } + else + { + gDropdownDefaultIndex = (gGameSpeed >= 4 ? 0 : gGameSpeed); + } + if (gDropdownDefaultIndex == 4) + { + gDropdownDefaultIndex = 5; } } - void OnToolAbort(WidgetIndex widgetIndex) override + void TopToolbar::FastforwardMenuDropdown(int16_t dropdownIndex) { - switch (widgetIndex) + auto* w = WindowGetMain(); + if (w != nullptr) { - case WIDX_LAND: - case WIDX_WATER: - case WIDX_CLEAR_SCENERY: - HideGridlines(); - break; -#ifdef ENABLE_SCRIPTING - default: - auto& customTool = OpenRCT2::Scripting::ActiveCustomTool; - if (customTool) - { - customTool->OnAbort(); - customTool = {}; - } - break; -#endif + if (dropdownIndex >= 0 && dropdownIndex <= 5) + { + auto newSpeed = dropdownIndex + 1; + if (newSpeed >= 5) + newSpeed = 8; + + auto setSpeedAction = GameSetSpeedAction(newSpeed); + GameActions::Execute(&setSpeedAction); + } } } - void OnPrepareDraw() override + void TopToolbar::InitRotateMenu(Widget& widget) { - int32_t x, widgetIndex, widgetWidth, firstAlignment; - Widget* widget; + gDropdownItems[0].Format = STR_ROTATE_CLOCKWISE; + gDropdownItems[1].Format = STR_ROTATE_ANTI_CLOCKWISE; - // Enable / disable buttons - widgets[WIDX_PAUSE].type = WindowWidgetType::TrnBtn; - widgets[WIDX_FILE_MENU].type = WindowWidgetType::TrnBtn; - widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::TrnBtn; - widgets[WIDX_ZOOM_IN].type = WindowWidgetType::TrnBtn; - widgets[WIDX_ROTATE].type = WindowWidgetType::TrnBtn; - widgets[WIDX_VIEW_MENU].type = WindowWidgetType::TrnBtn; - widgets[WIDX_MAP].type = WindowWidgetType::TrnBtn; - widgets[WIDX_MUTE].type = WindowWidgetType::TrnBtn; - widgets[WIDX_CHAT].type = WindowWidgetType::TrnBtn; - widgets[WIDX_LAND].type = WindowWidgetType::TrnBtn; - widgets[WIDX_WATER].type = WindowWidgetType::TrnBtn; - widgets[WIDX_SCENERY].type = WindowWidgetType::TrnBtn; - widgets[WIDX_PATH].type = WindowWidgetType::TrnBtn; - widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::TrnBtn; - widgets[WIDX_RIDES].type = WindowWidgetType::TrnBtn; - widgets[WIDX_PARK].type = WindowWidgetType::TrnBtn; - widgets[WIDX_STAFF].type = WindowWidgetType::TrnBtn; - widgets[WIDX_GUESTS].type = WindowWidgetType::TrnBtn; - widgets[WIDX_CLEAR_SCENERY].type = WindowWidgetType::TrnBtn; - widgets[WIDX_FINANCES].type = WindowWidgetType::TrnBtn; - widgets[WIDX_RESEARCH].type = WindowWidgetType::TrnBtn; - widgets[WIDX_FASTFORWARD].type = WindowWidgetType::TrnBtn; - widgets[WIDX_CHEATS].type = WindowWidgetType::TrnBtn; - widgets[WIDX_DEBUG].type = gConfigGeneral.DebuggingTools ? WindowWidgetType::TrnBtn : WindowWidgetType::Empty; - widgets[WIDX_NEWS].type = WindowWidgetType::TrnBtn; - widgets[WIDX_NETWORK].type = WindowWidgetType::TrnBtn; + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1] | 0x80, 0, 2); - if (!gConfigInterface.ToolbarShowMute) - widgets[WIDX_MUTE].type = WindowWidgetType::Empty; + gDropdownDefaultIndex = DDIDX_ROTATE_CLOCKWISE; + } - if (!gConfigInterface.ToolbarShowChat) - widgets[WIDX_CHAT].type = WindowWidgetType::Empty; - - if (!gConfigInterface.ToolbarShowResearch) - widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; - - if (!gConfigInterface.ToolbarShowCheats) - widgets[WIDX_CHEATS].type = WindowWidgetType::Empty; - - if (!gConfigInterface.ToolbarShowNews) - widgets[WIDX_NEWS].type = WindowWidgetType::Empty; - - if (!gConfigInterface.ToolbarShowZoom) + void TopToolbar::RotateMenuDropdown(int16_t dropdownIndex) + { + if (dropdownIndex == 0) { - widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; - widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; + ViewportRotateAll(1); } - - if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR || gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + else if (dropdownIndex == 1) { - widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; + ViewportRotateAll(-1); } + } - if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) || !gConfigInterface.ToolbarShowFinances) - widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; + void TopToolbar::InitCheatsMenu(Widget& widget) + { + using namespace Dropdown; + + constexpr ItemExt items[] = { + ToggleOption(DDIDX_CHEATS, STR_CHEAT_TITLE), + ToggleOption(DDIDX_TILE_INSPECTOR, STR_DEBUG_DROPDOWN_TILE_INSPECTOR), + ToggleOption(DDIDX_OBJECT_SELECTION, STR_DEBUG_DROPDOWN_OBJECT_SELECTION), + ToggleOption(DDIDX_INVENTIONS_LIST, STR_DEBUG_DROPDOWN_INVENTIONS_LIST), + ToggleOption(DDIDX_SCENARIO_OPTIONS, STR_DEBUG_DROPDOWN_SCENARIO_OPTIONS), + ToggleOption(DDIDX_OBJECTIVE_OPTIONS, STR_CHEATS_MENU_OBJECTIVE_OPTIONS), + Separator(), + ToggleOption(DDIDX_ENABLE_SANDBOX_MODE, STR_ENABLE_SANDBOX_MODE), + ToggleOption(DDIDX_DISABLE_CLEARANCE_CHECKS, STR_DISABLE_CLEARANCE_CHECKS), + ToggleOption(DDIDX_DISABLE_SUPPORT_LIMITS, STR_DISABLE_SUPPORT_LIMITS), + }; + static_assert(ItemIDsMatchIndices(items)); + + SetItems(items); + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, 0, + TOP_TOOLBAR_CHEATS_COUNT); + + // Disable items that are not yet available in multiplayer + if (NetworkGetMode() != NETWORK_MODE_NONE) + { + Dropdown::SetDisabled(DDIDX_OBJECT_SELECTION, true); + Dropdown::SetDisabled(DDIDX_INVENTIONS_LIST, true); + Dropdown::SetDisabled(DDIDX_OBJECTIVE_OPTIONS, true); + } if (gScreenFlags & SCREEN_FLAGS_EDITOR) { - widgets[WIDX_PARK].type = WindowWidgetType::Empty; - widgets[WIDX_STAFF].type = WindowWidgetType::Empty; - widgets[WIDX_GUESTS].type = WindowWidgetType::Empty; - widgets[WIDX_FINANCES].type = WindowWidgetType::Empty; - widgets[WIDX_RESEARCH].type = WindowWidgetType::Empty; - widgets[WIDX_NEWS].type = WindowWidgetType::Empty; - widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; - - auto& gameState = GetGameState(); - if (gameState.EditorStep != EditorStep::LandscapeEditor) - { - widgets[WIDX_LAND].type = WindowWidgetType::Empty; - widgets[WIDX_WATER].type = WindowWidgetType::Empty; - } - - if (gameState.EditorStep != EditorStep::RollercoasterDesigner) - { - widgets[WIDX_RIDES].type = WindowWidgetType::Empty; - widgets[WIDX_CONSTRUCT_RIDE].type = WindowWidgetType::Empty; - widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; - } - - if (gameState.EditorStep != EditorStep::LandscapeEditor - && gameState.EditorStep != EditorStep::RollercoasterDesigner) - { - widgets[WIDX_MAP].type = WindowWidgetType::Empty; - widgets[WIDX_SCENERY].type = WindowWidgetType::Empty; - widgets[WIDX_PATH].type = WindowWidgetType::Empty; - widgets[WIDX_CLEAR_SCENERY].type = WindowWidgetType::Empty; - - widgets[WIDX_ZOOM_OUT].type = WindowWidgetType::Empty; - widgets[WIDX_ZOOM_IN].type = WindowWidgetType::Empty; - widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; - widgets[WIDX_VIEW_MENU].type = WindowWidgetType::Empty; - } + Dropdown::SetDisabled(DDIDX_OBJECT_SELECTION, true); + Dropdown::SetDisabled(DDIDX_INVENTIONS_LIST, true); + Dropdown::SetDisabled(DDIDX_SCENARIO_OPTIONS, true); + Dropdown::SetDisabled(DDIDX_OBJECTIVE_OPTIONS, true); + Dropdown::SetDisabled(DDIDX_ENABLE_SANDBOX_MODE, true); } - switch (NetworkGetMode()) + if (GetGameState().Cheats.SandboxMode) { - case NETWORK_MODE_NONE: - widgets[WIDX_NETWORK].type = WindowWidgetType::Empty; - widgets[WIDX_CHAT].type = WindowWidgetType::Empty; - break; - case NETWORK_MODE_CLIENT: - widgets[WIDX_PAUSE].type = WindowWidgetType::Empty; - [[fallthrough]]; - case NETWORK_MODE_SERVER: - widgets[WIDX_FASTFORWARD].type = WindowWidgetType::Empty; - break; + Dropdown::SetChecked(DDIDX_ENABLE_SANDBOX_MODE, true); } - - // Align left hand side toolbar buttons - firstAlignment = 1; - x = 0; - for (size_t i = 0; i < std::size(left_aligned_widgets_order); ++i) + if (GetGameState().Cheats.DisableClearanceChecks) { - widgetIndex = left_aligned_widgets_order[i]; - widget = &widgets[widgetIndex]; - if (widget->type == WindowWidgetType::Empty && widgetIndex != WIDX_SEPARATOR) - continue; - - if (firstAlignment && widgetIndex == WIDX_SEPARATOR) - continue; - - widgetWidth = widget->width(); - widget->left = x; - x += widgetWidth; - widget->right = x; - x += 1; - firstAlignment = 0; + Dropdown::SetChecked(DDIDX_DISABLE_CLEARANCE_CHECKS, true); } - - // Align right hand side toolbar buttons if necessary - int32_t screenWidth = ContextGetWidth(); - firstAlignment = 1; - x = std::max(640, screenWidth); - for (size_t i = 0; i < std::size(right_aligned_widgets_order); ++i) + if (GetGameState().Cheats.DisableSupportLimits) { - widgetIndex = right_aligned_widgets_order[i]; - widget = &widgets[widgetIndex]; - if (widget->type == WindowWidgetType::Empty && widgetIndex != WIDX_SEPARATOR) - continue; - - if (firstAlignment && widgetIndex == WIDX_SEPARATOR) - continue; - - widgetWidth = widget->width(); - x -= 1; - widget->right = x; - x -= widgetWidth; - widget->left = x; - firstAlignment = 0; + Dropdown::SetChecked(DDIDX_DISABLE_SUPPORT_LIMITS, true); } - // Footpath button pressed down - if (WindowFindByClass(WindowClass::Footpath) == nullptr) - pressed_widgets &= ~(1uLL << WIDX_PATH); - else - pressed_widgets |= (1uLL << WIDX_PATH); - - if (gGamePaused & GAME_PAUSED_NORMAL) - pressed_widgets |= (1uLL << WIDX_PAUSE); - else - pressed_widgets &= ~(1uLL << WIDX_PAUSE); - - if (!OpenRCT2::Audio::gGameSoundsOff) - widgets[WIDX_MUTE].image = ImageId(SPR_G2_TOOLBAR_MUTE, FilterPaletteID::PaletteNull); - else - widgets[WIDX_MUTE].image = ImageId(SPR_G2_TOOLBAR_UNMUTE, FilterPaletteID::PaletteNull); - - // Set map button to the right image. - if (widgets[WIDX_MAP].type != WindowWidgetType::Empty) - { - static constexpr uint32_t _imageIdByRotation[] = { - SPR_G2_MAP_NORTH, - SPR_G2_MAP_WEST, - SPR_G2_MAP_SOUTH, - SPR_G2_MAP_EAST, - }; - - uint32_t mapImageId = _imageIdByRotation[GetCurrentRotation()]; - widgets[WIDX_MAP].image = ImageId(mapImageId, FilterPaletteID::PaletteNull); - } - - // Zoomed out/in disable. Not sure where this code is in the original. - const auto* mainWindow = WindowGetMain(); - if (mainWindow == nullptr || mainWindow->viewport == nullptr) - { - LOG_ERROR("mainWindow or mainWindow->viewport is null!"); - return; - } - - if (mainWindow->viewport->zoom == ZoomLevel::min()) - { - disabled_widgets |= (1uLL << WIDX_ZOOM_IN); - } - else if (mainWindow->viewport->zoom >= ZoomLevel::max()) - { - disabled_widgets |= (1uLL << WIDX_ZOOM_OUT); - } - else - { - disabled_widgets &= ~((1uLL << WIDX_ZOOM_IN) | (1uLL << WIDX_ZOOM_OUT)); - } + gDropdownDefaultIndex = DDIDX_CHEATS; } - void OnDraw(DrawPixelInfo& dpi) override - { - const auto& gameState = GetGameState(); - int32_t imgId; - - WindowDrawWidgets(*this, dpi); - - ScreenCoordsXY screenPos{}; - // Draw staff button image (setting masks to the staff colours) - if (widgets[WIDX_STAFF].type != WindowWidgetType::Empty) - { - screenPos = { windowPos.x + widgets[WIDX_STAFF].left, windowPos.y + widgets[WIDX_STAFF].top }; - imgId = SPR_TOOLBAR_STAFF; - if (WidgetIsPressed(*this, WIDX_STAFF)) - imgId++; - GfxDrawSprite(dpi, ImageId(imgId, gameState.StaffHandymanColour, gameState.StaffMechanicColour), screenPos); - } - - // Draw fast forward button - if (widgets[WIDX_FASTFORWARD].type != WindowWidgetType::Empty) - { - screenPos = { windowPos.x + widgets[WIDX_FASTFORWARD].left + 0, windowPos.y + widgets[WIDX_FASTFORWARD].top + 0 }; - if (WidgetIsPressed(*this, WIDX_FASTFORWARD)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_G2_FASTFORWARD), screenPos + ScreenCoordsXY{ 6, 3 }); - - for (int32_t i = 0; i < gGameSpeed && gGameSpeed <= 4; i++) - { - GfxDrawSprite(dpi, ImageId(SPR_G2_SPEED_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 5, 15 }); - } - for (int32_t i = 0; i < 3 && i < gGameSpeed - 4 && gGameSpeed >= 5; i++) - { - GfxDrawSprite(dpi, ImageId(SPR_G2_HYPER_ARROW), screenPos + ScreenCoordsXY{ 5 + i * 6, 15 }); - } - } - - // Draw cheats button - if (widgets[WIDX_CHEATS].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_CHEATS].left - 1, widgets[WIDX_CHEATS].top - 1 }; - if (WidgetIsPressed(*this, WIDX_CHEATS)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_G2_SANDBOX), screenPos); - - // Draw an overlay if clearance checks are disabled - if (GetGameState().Cheats.DisableClearanceChecks) - { - auto colour = static_cast(EnumValue(COLOUR_DARK_ORANGE) | EnumValue(COLOUR_FLAG_OUTLINE)); - DrawTextBasic( - dpi, screenPos + ScreenCoordsXY{ 26, 2 }, STR_OVERLAY_CLEARANCE_CHECKS_DISABLED, {}, - { colour, TextAlignment::RIGHT }); - } - } - - // Draw chat button - if (widgets[WIDX_CHAT].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_CHAT].left, widgets[WIDX_CHAT].top - 2 }; - if (WidgetIsPressed(*this, WIDX_CHAT)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_G2_CHAT), screenPos); - } - - // Draw debug button - if (widgets[WIDX_DEBUG].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_DEBUG].left, widgets[WIDX_DEBUG].top - 1 }; - if (WidgetIsPressed(*this, WIDX_DEBUG)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_TAB_GEARS_0), screenPos); - } - - // Draw research button - if (widgets[WIDX_RESEARCH].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_RESEARCH].left - 1, widgets[WIDX_RESEARCH].top }; - if (WidgetIsPressed(*this, WIDX_RESEARCH)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_TAB_FINANCES_RESEARCH_0), screenPos); - } - - // Draw finances button - if (widgets[WIDX_FINANCES].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_FINANCES].left + 3, widgets[WIDX_FINANCES].top + 1 }; - if (WidgetIsPressed(*this, WIDX_FINANCES)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_FINANCE), screenPos); - } - - // Draw news button - if (widgets[WIDX_NEWS].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_NEWS].left + 3, widgets[WIDX_NEWS].top + 0 }; - if (WidgetIsPressed(*this, WIDX_NEWS)) - screenPos.y++; - GfxDrawSprite(dpi, ImageId(SPR_G2_TAB_NEWS), screenPos); - } - - // Draw network button - if (widgets[WIDX_NETWORK].type != WindowWidgetType::Empty) - { - screenPos = windowPos + ScreenCoordsXY{ widgets[WIDX_NETWORK].left + 3, widgets[WIDX_NETWORK].top + 0 }; - if (WidgetIsPressed(*this, WIDX_NETWORK)) - screenPos.y++; - - // Draw (de)sync icon. - imgId = (NetworkIsDesynchronised() ? SPR_G2_MULTIPLAYER_DESYNC : SPR_G2_MULTIPLAYER_SYNC); - GfxDrawSprite(dpi, ImageId(imgId), screenPos + ScreenCoordsXY{ 3, 11 }); - - // Draw number of players. - auto ft = Formatter(); - ft.Add(NetworkGetNumVisiblePlayers()); - auto colour = static_cast(EnumValue(COLOUR_WHITE) | EnumValue(COLOUR_FLAG_OUTLINE)); - DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ 23, 1 }, STR_COMMA16, ft, { colour, TextAlignment::RIGHT }); - } - } -}; - -static void ScenarioSelectCallback(const utf8* path) -{ - WindowCloseByClass(WindowClass::EditorObjectSelection); - GameNotifyMapChange(); - GetContext()->LoadParkFromFile(path, false, true); - GameLoadScripts(); - GameNotifyMapChanged(); -} - -/** - * Creates the main game top toolbar window. - * rct2: 0x0066B485 (part of 0x0066B3E8) - */ -WindowBase* WindowTopToolbarOpen() -{ - TopToolbar* window = WindowCreate( - WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), TOP_TOOLBAR_HEIGHT + 1, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_NO_BACKGROUND); - - window->widgets = _topToolbarWidgets; - - WindowInitScrollWidgets(*window); - - return window; -} - -/** - * - * rct2: 0x0066D104 - */ -bool LandToolIsActive() -{ - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar) - return false; - if (gCurrentToolWidget.widget_index != WIDX_LAND) - return false; - return true; -} - -/** - * - * rct2: 0x0066D125 - */ -bool ClearSceneryToolIsActive() -{ - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar) - return false; - if (gCurrentToolWidget.widget_index != WIDX_CLEAR_SCENERY) - return false; - return true; -} - -/** - * - * rct2: 0x0066D125 - */ -bool WaterToolIsActive() -{ - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WindowClass::TopToolbar) - return false; - if (gCurrentToolWidget.widget_index != WIDX_WATER) - return false; - return true; -} - -void TopToolbar::InitViewMenu(Widget& widget) -{ - using namespace Dropdown; - constexpr ItemExt items[] = { - ToggleOption(DDIDX_UNDERGROUND_INSIDE, STR_UNDERGROUND_VIEW), - ToggleOption(DDIDX_TRANSPARENT_WATER, STR_VIEWPORT_TRANSPARENT_WATER), - ToggleOption(DDIDX_HIDE_BASE, STR_REMOVE_BASE_LAND), - ToggleOption(DDIDX_HIDE_VERTICAL, STR_REMOVE_VERTICAL_FACES), - Separator(), - ToggleOption(DDIDX_HIDE_RIDES, STR_SEE_THROUGH_RIDES), - ToggleOption(DDIDX_HIDE_VEHICLES, STR_SEE_THROUGH_VEHICLES), - ToggleOption(DDIDX_HIDE_VEGETATION, STR_SEE_THROUGH_VEGETATION), - ToggleOption(DDIDX_HIDE_SCENERY, STR_SEE_THROUGH_SCENERY), - ToggleOption(DDIDX_HIDE_PATHS, STR_SEE_THROUGH_PATHS), - ToggleOption(DDIDX_HIDE_SUPPORTS, STR_SEE_THROUGH_SUPPORTS), - ToggleOption(DDIDX_HIDE_GUESTS, STR_SEE_THROUGH_GUESTS), - ToggleOption(DDIDX_HIDE_STAFF, STR_SEE_THROUGH_STAFF), - Separator(), - ToggleOption(DDIDX_LAND_HEIGHTS, STR_HEIGHT_MARKS_ON_LAND), - ToggleOption(DDIDX_TRACK_HEIGHTS, STR_HEIGHT_MARKS_ON_RIDE_TRACKS), - ToggleOption(DDIDX_PATH_HEIGHTS, STR_HEIGHT_MARKS_ON_PATHS), - Separator(), - ToggleOption(DDIDX_VIEW_CLIPPING, STR_VIEW_CLIPPING_MENU), - ToggleOption(DDIDX_HIGHLIGHT_PATH_ISSUES, STR_HIGHLIGHT_PATH_ISSUES_MENU), - Separator(), - ToggleOption(DDIDX_TRANSPARENCY, STR_TRANSPARENCY_OPTIONS), - }; - - static_assert(ItemIDsMatchIndices(items)); - - SetItems(items); - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1] | 0x80, 0, - TOP_TOOLBAR_VIEW_MENU_COUNT); - - // Set checkmarks - auto* mainViewport = WindowGetMain()->viewport; - if (mainViewport->flags & VIEWPORT_FLAG_UNDERGROUND_INSIDE) - Dropdown::SetChecked(DDIDX_UNDERGROUND_INSIDE, true); - if (gConfigGeneral.TransparentWater) - Dropdown::SetChecked(DDIDX_TRANSPARENT_WATER, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_BASE) - Dropdown::SetChecked(DDIDX_HIDE_BASE, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_VERTICAL) - Dropdown::SetChecked(DDIDX_HIDE_VERTICAL, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_RIDES) - Dropdown::SetChecked(DDIDX_HIDE_RIDES, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_VEHICLES) - Dropdown::SetChecked(DDIDX_HIDE_VEHICLES, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_VEGETATION) - Dropdown::SetChecked(DDIDX_HIDE_VEGETATION, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_SCENERY) - Dropdown::SetChecked(DDIDX_HIDE_SCENERY, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_PATHS) - Dropdown::SetChecked(DDIDX_HIDE_PATHS, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_SUPPORTS) - Dropdown::SetChecked(DDIDX_HIDE_SUPPORTS, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_GUESTS) - Dropdown::SetChecked(DDIDX_HIDE_GUESTS, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIDE_STAFF) - Dropdown::SetChecked(DDIDX_HIDE_STAFF, true); - if (mainViewport->flags & VIEWPORT_FLAG_LAND_HEIGHTS) - Dropdown::SetChecked(DDIDX_LAND_HEIGHTS, true); - if (mainViewport->flags & VIEWPORT_FLAG_TRACK_HEIGHTS) - Dropdown::SetChecked(DDIDX_TRACK_HEIGHTS, true); - if (mainViewport->flags & VIEWPORT_FLAG_PATH_HEIGHTS) - Dropdown::SetChecked(DDIDX_PATH_HEIGHTS, true); - if (mainViewport->flags & VIEWPORT_FLAG_CLIP_VIEW) - Dropdown::SetChecked(DDIDX_VIEW_CLIPPING, true); - if (mainViewport->flags & VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES) - Dropdown::SetChecked(DDIDX_HIGHLIGHT_PATH_ISSUES, true); - - gDropdownDefaultIndex = DDIDX_UNDERGROUND_INSIDE; - - // Opaque water relies on RCT1 sprites. - if (!IsCsgLoaded()) - { - Dropdown::SetDisabled(DDIDX_TRANSPARENT_WATER, true); - } -} - -void TopToolbar::ViewMenuDropdown(int16_t dropdownIndex) -{ - auto* w = WindowGetMain(); - if (w != nullptr) + void TopToolbar::CheatsMenuDropdown(int16_t dropdownIndex) { switch (dropdownIndex) { - case DDIDX_UNDERGROUND_INSIDE: - w->viewport->flags ^= VIEWPORT_FLAG_UNDERGROUND_INSIDE; + case DDIDX_CHEATS: + ContextOpenWindow(WindowClass::Cheats); break; - case DDIDX_TRANSPARENT_WATER: - gConfigGeneral.TransparentWater ^= 1; - ConfigSaveDefault(); + case DDIDX_TILE_INSPECTOR: + ContextOpenWindow(WindowClass::TileInspector); break; - case DDIDX_HIDE_BASE: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_BASE; + case DDIDX_OBJECT_SELECTION: + WindowCloseAll(); + ContextOpenWindow(WindowClass::EditorObjectSelection); break; - case DDIDX_HIDE_VERTICAL: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VERTICAL; + case DDIDX_INVENTIONS_LIST: + ContextOpenWindow(WindowClass::EditorInventionList); break; - case DDIDX_HIDE_RIDES: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_RIDES; + case DDIDX_SCENARIO_OPTIONS: + ContextOpenWindow(WindowClass::EditorScenarioOptions); break; - case DDIDX_HIDE_VEHICLES: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VEHICLES; + case DDIDX_OBJECTIVE_OPTIONS: + ContextOpenWindow(WindowClass::EditorObjectiveOptions); break; - case DDIDX_HIDE_VEGETATION: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_VEGETATION; + case DDIDX_ENABLE_SANDBOX_MODE: + CheatsSet(CheatType::SandboxMode, !GetGameState().Cheats.SandboxMode); break; - case DDIDX_HIDE_SCENERY: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_SCENERY; + case DDIDX_DISABLE_CLEARANCE_CHECKS: + CheatsSet(CheatType::DisableClearanceChecks, !GetGameState().Cheats.DisableClearanceChecks); break; - case DDIDX_HIDE_PATHS: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_PATHS; + case DDIDX_DISABLE_SUPPORT_LIMITS: + CheatsSet(CheatType::DisableSupportLimits, !GetGameState().Cheats.DisableSupportLimits); break; - case DDIDX_HIDE_SUPPORTS: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_SUPPORTS; - break; - case DDIDX_HIDE_GUESTS: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_GUESTS; - break; - case DDIDX_HIDE_STAFF: - w->viewport->flags ^= VIEWPORT_FLAG_HIDE_STAFF; - break; - case DDIDX_LAND_HEIGHTS: - w->viewport->flags ^= VIEWPORT_FLAG_LAND_HEIGHTS; - break; - case DDIDX_TRACK_HEIGHTS: - w->viewport->flags ^= VIEWPORT_FLAG_TRACK_HEIGHTS; - break; - case DDIDX_PATH_HEIGHTS: - w->viewport->flags ^= VIEWPORT_FLAG_PATH_HEIGHTS; - break; - case DDIDX_VIEW_CLIPPING: - if (WindowFindByClass(WindowClass::ViewClipping) == nullptr) - { - ContextOpenWindow(WindowClass::ViewClipping); - } - else - { - // If window is already open, toggle the view clipping on/off - w->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; - } - break; - case DDIDX_HIGHLIGHT_PATH_ISSUES: - w->viewport->flags ^= VIEWPORT_FLAG_HIGHLIGHT_PATH_ISSUES; - break; - case DDIDX_TRANSPARENCY: - ContextOpenWindow(WindowClass::Transparency); - break; - default: - return; } - w->Invalidate(); - } -} - -void TopToolbar::InitMapMenu(Widget& widget) -{ - auto i = 0; - gDropdownItems[i++].Format = STR_SHORTCUT_SHOW_MAP; - gDropdownItems[i++].Format = STR_EXTRA_VIEWPORT; - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && GetGameState().EditorStep == EditorStep::LandscapeEditor) - { - gDropdownItems[i++].Format = STR_MAPGEN_WINDOW_TITLE; } -#ifdef ENABLE_SCRIPTING - const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; - if (!customMenuItems.empty()) + void TopToolbar::InitDebugMenu(Widget& widget) { - gDropdownItems[i++].Format = STR_EMPTY; - for (const auto& item : customMenuItems) + gDropdownItems[DDIDX_CONSOLE].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIDX_CONSOLE].Args = STR_DEBUG_DROPDOWN_CONSOLE; + gDropdownItems[DDIDX_DEBUG_PAINT].Format = STR_TOGGLE_OPTION; + gDropdownItems[DDIDX_DEBUG_PAINT].Args = STR_DEBUG_DROPDOWN_DEBUG_PAINT; + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, + Dropdown::Flag::StayOpen, TOP_TOOLBAR_DEBUG_COUNT); + + Dropdown::SetChecked(DDIDX_DEBUG_PAINT, WindowFindByClass(WindowClass::DebugPaint) != nullptr); + } + + void TopToolbar::DebugMenuDropdown(int16_t dropdownIndex) + { + auto* w = WindowGetMain(); + if (w != nullptr) { - if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Standard) + switch (dropdownIndex) { - gDropdownItems[i].Format = STR_STRING; - auto sz = item.Text.c_str(); - std::memcpy(&gDropdownItems[i].Args, &sz, sizeof(const char*)); - i++; - } - } - } -#endif - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1] | 0x80, 0, i); - gDropdownDefaultIndex = DDIDX_SHOW_MAP; -} - -void TopToolbar::MapMenuDropdown(int16_t dropdownIndex) -{ - int32_t customStartIndex = 3; - if ((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && GetGameState().EditorStep == EditorStep::LandscapeEditor) - { - customStartIndex++; - } - - if (dropdownIndex < customStartIndex) - { - switch (dropdownIndex) - { - case 0: - ContextOpenWindow(WindowClass::Map); - break; - case 1: - ContextOpenWindow(WindowClass::Viewport); - break; - case 2: - ContextOpenWindow(WindowClass::Mapgen); - break; - } - } - else - { -#ifdef ENABLE_SCRIPTING - const auto& customMenuItems = OpenRCT2::Scripting::CustomMenuItems; - auto customIndex = static_cast(dropdownIndex - customStartIndex); - size_t i = 0; - for (const auto& item : customMenuItems) - { - if (item.Kind == OpenRCT2::Scripting::CustomToolbarMenuItemKind::Standard) - { - if (i == customIndex) + case DDIDX_CONSOLE: { - item.Invoke(); + auto& console = GetInGameConsole(); + console.Open(); break; } - i++; + case DDIDX_DEBUG_PAINT: + if (WindowFindByClass(WindowClass::DebugPaint) == nullptr) + { + ContextOpenWindow(WindowClass::DebugPaint); + } + else + { + WindowCloseByClass(WindowClass::DebugPaint); + } + break; } } -#endif - } -} - -void TopToolbar::InitFastforwardMenu(Widget& widget) -{ - int32_t num_items = 4; - gDropdownItems[0].Format = STR_TOGGLE_OPTION; - gDropdownItems[1].Format = STR_TOGGLE_OPTION; - gDropdownItems[2].Format = STR_TOGGLE_OPTION; - gDropdownItems[3].Format = STR_TOGGLE_OPTION; - if (gConfigGeneral.DebuggingTools) - { - gDropdownItems[4].Format = STR_EMPTY; - gDropdownItems[5].Format = STR_TOGGLE_OPTION; - gDropdownItems[5].Args = STR_SPEED_HYPER; - num_items = 6; } - gDropdownItems[0].Args = STR_SPEED_NORMAL; - gDropdownItems[1].Args = STR_SPEED_QUICK; - gDropdownItems[2].Args = STR_SPEED_FAST; - gDropdownItems[3].Args = STR_SPEED_TURBO; - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, 0, num_items); - - // Set checkmarks - if (gGameSpeed <= 4) + void TopToolbar::InitNetworkMenu(Widget& widget) { - Dropdown::SetChecked(gGameSpeed - 1, true); - } - if (gGameSpeed == 8) - { - Dropdown::SetChecked(5, true); + gDropdownItems[DDIDX_MULTIPLAYER].Format = STR_MULTIPLAYER; + gDropdownItems[DDIDX_MULTIPLAYER_RECONNECT].Format = STR_MULTIPLAYER_RECONNECT; + + WindowDropdownShowText( + { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, 0, + TOP_TOOLBAR_NETWORK_COUNT); + + Dropdown::SetDisabled(DDIDX_MULTIPLAYER_RECONNECT, !NetworkIsDesynchronised()); + + gDropdownDefaultIndex = DDIDX_MULTIPLAYER; } - if (gConfigGeneral.DebuggingTools) + void TopToolbar::NetworkMenuDropdown(int16_t dropdownIndex) { - gDropdownDefaultIndex = (gGameSpeed == 8 ? 0 : gGameSpeed); - } - else - { - gDropdownDefaultIndex = (gGameSpeed >= 4 ? 0 : gGameSpeed); - } - if (gDropdownDefaultIndex == 4) - { - gDropdownDefaultIndex = 5; - } -} - -void TopToolbar::FastforwardMenuDropdown(int16_t dropdownIndex) -{ - auto* w = WindowGetMain(); - if (w != nullptr) - { - if (dropdownIndex >= 0 && dropdownIndex <= 5) + auto* w = WindowGetMain(); + if (w != nullptr) { - auto newSpeed = dropdownIndex + 1; - if (newSpeed >= 5) - newSpeed = 8; - - auto setSpeedAction = GameSetSpeedAction(newSpeed); - GameActions::Execute(&setSpeedAction); - } - } -} - -void TopToolbar::InitRotateMenu(Widget& widget) -{ - gDropdownItems[0].Format = STR_ROTATE_CLOCKWISE; - gDropdownItems[1].Format = STR_ROTATE_ANTI_CLOCKWISE; - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[1] | 0x80, 0, 2); - - gDropdownDefaultIndex = DDIDX_ROTATE_CLOCKWISE; -} - -void TopToolbar::RotateMenuDropdown(int16_t dropdownIndex) -{ - if (dropdownIndex == 0) - { - ViewportRotateAll(1); - } - else if (dropdownIndex == 1) - { - ViewportRotateAll(-1); - } -} - -void TopToolbar::InitCheatsMenu(Widget& widget) -{ - using namespace Dropdown; - - constexpr ItemExt items[] = { - ToggleOption(DDIDX_CHEATS, STR_CHEAT_TITLE), - ToggleOption(DDIDX_TILE_INSPECTOR, STR_DEBUG_DROPDOWN_TILE_INSPECTOR), - ToggleOption(DDIDX_OBJECT_SELECTION, STR_DEBUG_DROPDOWN_OBJECT_SELECTION), - ToggleOption(DDIDX_INVENTIONS_LIST, STR_DEBUG_DROPDOWN_INVENTIONS_LIST), - ToggleOption(DDIDX_SCENARIO_OPTIONS, STR_DEBUG_DROPDOWN_SCENARIO_OPTIONS), - ToggleOption(DDIDX_OBJECTIVE_OPTIONS, STR_CHEATS_MENU_OBJECTIVE_OPTIONS), - Separator(), - ToggleOption(DDIDX_ENABLE_SANDBOX_MODE, STR_ENABLE_SANDBOX_MODE), - ToggleOption(DDIDX_DISABLE_CLEARANCE_CHECKS, STR_DISABLE_CLEARANCE_CHECKS), - ToggleOption(DDIDX_DISABLE_SUPPORT_LIMITS, STR_DISABLE_SUPPORT_LIMITS), - }; - static_assert(ItemIDsMatchIndices(items)); - - SetItems(items); - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, 0, - TOP_TOOLBAR_CHEATS_COUNT); - - // Disable items that are not yet available in multiplayer - if (NetworkGetMode() != NETWORK_MODE_NONE) - { - Dropdown::SetDisabled(DDIDX_OBJECT_SELECTION, true); - Dropdown::SetDisabled(DDIDX_INVENTIONS_LIST, true); - Dropdown::SetDisabled(DDIDX_OBJECTIVE_OPTIONS, true); - } - - if (gScreenFlags & SCREEN_FLAGS_EDITOR) - { - Dropdown::SetDisabled(DDIDX_OBJECT_SELECTION, true); - Dropdown::SetDisabled(DDIDX_INVENTIONS_LIST, true); - Dropdown::SetDisabled(DDIDX_SCENARIO_OPTIONS, true); - Dropdown::SetDisabled(DDIDX_OBJECTIVE_OPTIONS, true); - Dropdown::SetDisabled(DDIDX_ENABLE_SANDBOX_MODE, true); - } - - if (GetGameState().Cheats.SandboxMode) - { - Dropdown::SetChecked(DDIDX_ENABLE_SANDBOX_MODE, true); - } - if (GetGameState().Cheats.DisableClearanceChecks) - { - Dropdown::SetChecked(DDIDX_DISABLE_CLEARANCE_CHECKS, true); - } - if (GetGameState().Cheats.DisableSupportLimits) - { - Dropdown::SetChecked(DDIDX_DISABLE_SUPPORT_LIMITS, true); - } - - gDropdownDefaultIndex = DDIDX_CHEATS; -} - -void TopToolbar::CheatsMenuDropdown(int16_t dropdownIndex) -{ - switch (dropdownIndex) - { - case DDIDX_CHEATS: - ContextOpenWindow(WindowClass::Cheats); - break; - case DDIDX_TILE_INSPECTOR: - ContextOpenWindow(WindowClass::TileInspector); - break; - case DDIDX_OBJECT_SELECTION: - WindowCloseAll(); - ContextOpenWindow(WindowClass::EditorObjectSelection); - break; - case DDIDX_INVENTIONS_LIST: - ContextOpenWindow(WindowClass::EditorInventionList); - break; - case DDIDX_SCENARIO_OPTIONS: - ContextOpenWindow(WindowClass::EditorScenarioOptions); - break; - case DDIDX_OBJECTIVE_OPTIONS: - ContextOpenWindow(WindowClass::EditorObjectiveOptions); - break; - case DDIDX_ENABLE_SANDBOX_MODE: - CheatsSet(CheatType::SandboxMode, !GetGameState().Cheats.SandboxMode); - break; - case DDIDX_DISABLE_CLEARANCE_CHECKS: - CheatsSet(CheatType::DisableClearanceChecks, !GetGameState().Cheats.DisableClearanceChecks); - break; - case DDIDX_DISABLE_SUPPORT_LIMITS: - CheatsSet(CheatType::DisableSupportLimits, !GetGameState().Cheats.DisableSupportLimits); - break; - } -} - -void TopToolbar::InitDebugMenu(Widget& widget) -{ - gDropdownItems[DDIDX_CONSOLE].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIDX_CONSOLE].Args = STR_DEBUG_DROPDOWN_CONSOLE; - gDropdownItems[DDIDX_DEBUG_PAINT].Format = STR_TOGGLE_OPTION; - gDropdownItems[DDIDX_DEBUG_PAINT].Args = STR_DEBUG_DROPDOWN_DEBUG_PAINT; - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, - Dropdown::Flag::StayOpen, TOP_TOOLBAR_DEBUG_COUNT); - - Dropdown::SetChecked(DDIDX_DEBUG_PAINT, WindowFindByClass(WindowClass::DebugPaint) != nullptr); -} - -void TopToolbar::DebugMenuDropdown(int16_t dropdownIndex) -{ - auto* w = WindowGetMain(); - if (w != nullptr) - { - switch (dropdownIndex) - { - case DDIDX_CONSOLE: + switch (dropdownIndex) { - auto& console = GetInGameConsole(); - console.Open(); - break; + case DDIDX_MULTIPLAYER: + ContextOpenWindow(WindowClass::Multiplayer); + break; + case DDIDX_MULTIPLAYER_RECONNECT: + NetworkReconnect(); + break; } - case DDIDX_DEBUG_PAINT: - if (WindowFindByClass(WindowClass::DebugPaint) == nullptr) - { - ContextOpenWindow(WindowClass::DebugPaint); - } - else - { - WindowCloseByClass(WindowClass::DebugPaint); - } - break; } } -} - -void TopToolbar::InitNetworkMenu(Widget& widget) -{ - gDropdownItems[DDIDX_MULTIPLAYER].Format = STR_MULTIPLAYER; - gDropdownItems[DDIDX_MULTIPLAYER_RECONNECT].Format = STR_MULTIPLAYER_RECONNECT; - - WindowDropdownShowText( - { windowPos.x + widget.left, windowPos.y + widget.top }, widget.height() + 1, colours[0] | 0x80, 0, - TOP_TOOLBAR_NETWORK_COUNT); - - Dropdown::SetDisabled(DDIDX_MULTIPLAYER_RECONNECT, !NetworkIsDesynchronised()); - - gDropdownDefaultIndex = DDIDX_MULTIPLAYER; -} - -void TopToolbar::NetworkMenuDropdown(int16_t dropdownIndex) -{ - auto* w = WindowGetMain(); - if (w != nullptr) - { - switch (dropdownIndex) - { - case DDIDX_MULTIPLAYER: - ContextOpenWindow(WindowClass::Multiplayer); - break; - case DDIDX_MULTIPLAYER_RECONNECT: - NetworkReconnect(); - break; - } - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index d6ddb2561b..57e1650753 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -17,16 +17,18 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_STRING; -static constexpr int32_t WH = 44; -static constexpr int32_t WW = 250; -static constexpr int32_t WH_DELETE_PROMPT = 74; -static constexpr int32_t WW_DELETE_PROMPT = 250; -static constexpr int32_t TrackDesignNameMaxLength = 127; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_STRING; + static constexpr int32_t WH = 44; + static constexpr int32_t WW = 250; + static constexpr int32_t WH_DELETE_PROMPT = 74; + static constexpr int32_t WW_DELETE_PROMPT = 250; + static constexpr int32_t TrackDesignNameMaxLength = 127; #pragma region Widgets -// clang-format off + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -51,16 +53,19 @@ static Widget _trackDeletePromptWidgets[] = { MakeWidget({130, 54}, {110, 12}, WindowWidgetType::Button, WindowColour::Primary, STR_CANCEL ), kWidgetsEnd, }; - +// clang-format on #pragma endregion -class TrackDesignManageWindow final : public Window -{ + class TrackDesignManageWindow final : public Window + { private: - TrackDesignFileRef* _trackDesignFileReference{nullptr}; + TrackDesignFileRef* _trackDesignFileReference{ nullptr }; public: - TrackDesignManageWindow(TrackDesignFileRef* tdFileRef) : _trackDesignFileReference(tdFileRef){} + TrackDesignManageWindow(TrackDesignFileRef* tdFileRef) + : _trackDesignFileReference(tdFileRef) + { + } void OnOpen() override; void OnClose() override; @@ -68,170 +73,174 @@ class TrackDesignManageWindow final : public Window void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override; void OnDraw(DrawPixelInfo& dpi) override; - void OnResize() override - { - ResizeFrame(); - } -}; + void OnResize() override + { + ResizeFrame(); + } + }; -class TrackDeletePromptWindow final : public Window -{ + class TrackDeletePromptWindow final : public Window + { private: - TrackDesignFileRef* _trackDesignFileReference{nullptr}; + TrackDesignFileRef* _trackDesignFileReference{ nullptr }; public: - TrackDeletePromptWindow(TrackDesignFileRef* tdFileRef) : _trackDesignFileReference(tdFileRef){} + TrackDeletePromptWindow(TrackDesignFileRef* tdFileRef) + : _trackDesignFileReference(tdFileRef) + { + } void OnOpen() override; void OnMouseUp(WidgetIndex widgetIndex) override; void OnDraw(DrawPixelInfo& dpi) override; - void OnResize() override + void OnResize() override + { + ResizeFrame(); + } + }; + + static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef); + + /** + * + * rct2: 0x006D348F + */ + WindowBase* WindowTrackManageOpen(TrackDesignFileRef* tdFileRef) { - ResizeFrame(); + WindowCloseByClass(WindowClass::ManageTrackDesign); + auto trackDesignManageWindow = std::make_unique(tdFileRef); + auto* window = WindowCreate( + std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, + WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); + + return window; } -}; -static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef); - -/** - * - * rct2: 0x006D348F - */ -WindowBase* WindowTrackManageOpen(TrackDesignFileRef* tdFileRef) -{ - WindowCloseByClass(WindowClass::ManageTrackDesign); - auto trackDesignManageWindow = std::make_unique(tdFileRef); - auto* window = WindowCreate( - std::move(trackDesignManageWindow), WindowClass::ManageTrackDesign, {}, WW, WH, - WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_CENTRE_SCREEN | WF_AUTO_POSITION); - - return window; -} - -void TrackDesignManageWindow::OnOpen() -{ - widgets = _trackManageWidgets; - WindowInitScrollWidgets(*this); - - WindowTrackDesignListSetBeingUpdated(true); -} - -void TrackDesignManageWindow::OnClose() -{ - WindowTrackDesignListSetBeingUpdated(false); -} - -void TrackDesignManageWindow::OnMouseUp(WidgetIndex widgetIndex) -{ - switch (widgetIndex) + void TrackDesignManageWindow::OnOpen() { - case WIDX_CLOSE: + widgets = _trackManageWidgets; + WindowInitScrollWidgets(*this); + + WindowTrackDesignListSetBeingUpdated(true); + } + + void TrackDesignManageWindow::OnClose() + { + WindowTrackDesignListSetBeingUpdated(false); + } + + void TrackDesignManageWindow::OnMouseUp(WidgetIndex widgetIndex) + { + switch (widgetIndex) + { + case WIDX_CLOSE: + WindowCloseByClass(WindowClass::TrackDeletePrompt); + Close(); + break; + case WIDX_RENAME: + WindowTextInputRawOpen( + this, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {}, + _trackDesignFileReference->name.c_str(), TrackDesignNameMaxLength); + break; + case WIDX_DELETE: + WindowTrackDeletePromptOpen(_trackDesignFileReference); + break; + } + } + + void TrackDesignManageWindow::OnTextInput(WidgetIndex widgetIndex, std::string_view text) + { + if (widgetIndex != WIDX_RENAME) + { + return; + } + else if (text.empty()) + { + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NONE, {}); + return; + } + else if (!Platform::IsFilenameValid(text)) + { + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NEW_NAME_CONTAINS_INVALID_CHARACTERS, {}); + return; + } + + if (TrackRepositoryRename(_trackDesignFileReference->path, std::string(text))) + { WindowCloseByClass(WindowClass::TrackDeletePrompt); Close(); - break; - case WIDX_RENAME: - WindowTextInputRawOpen( - this, widgetIndex, STR_TRACK_DESIGN_RENAME_TITLE, STR_TRACK_DESIGN_RENAME_DESC, {}, - _trackDesignFileReference->name.c_str(), TrackDesignNameMaxLength); - break; - case WIDX_DELETE: - WindowTrackDeletePromptOpen(_trackDesignFileReference); - break; - } -} - -void TrackDesignManageWindow::OnTextInput(WidgetIndex widgetIndex, std::string_view text) -{ - if (widgetIndex != WIDX_RENAME) - { - return; - } - else if (text.empty()) - { - ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NONE, {}); - return; - } - else if (!Platform::IsFilenameValid(text)) - { - ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_NEW_NAME_CONTAINS_INVALID_CHARACTERS, {}); - return; + WindowTrackDesignListReloadTracks(); + } + else + { + ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_ANOTHER_FILE_EXISTS_WITH_NAME_OR_FILE_IS_WRITE_PROTECTED, {}); + } } - if (TrackRepositoryRename(_trackDesignFileReference->path, std::string(text))) + void TrackDesignManageWindow::OnDraw(DrawPixelInfo& dpi) + { + Formatter::Common().Add(_trackDesignFileReference->name.c_str()); + DrawWidgets(dpi); + } + + /** + * + * rct2: 0x006D35CD + */ + static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef) { WindowCloseByClass(WindowClass::TrackDeletePrompt); - Close(); - WindowTrackDesignListReloadTracks(); + + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + auto trackDeletePromptWindow = std::make_unique(tdFileRef); + WindowCreate( + std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, + ScreenCoordsXY( + std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), + WW_DELETE_PROMPT, WH_DELETE_PROMPT, WF_STICK_TO_FRONT | WF_TRANSPARENT); } - else + + void TrackDeletePromptWindow::OnOpen() { - ContextShowError(STR_CANT_RENAME_TRACK_DESIGN, STR_ANOTHER_FILE_EXISTS_WITH_NAME_OR_FILE_IS_WRITE_PROTECTED, {}); + widgets = _trackDeletePromptWidgets; + WindowInitScrollWidgets(*this); } -} -void TrackDesignManageWindow::OnDraw(DrawPixelInfo& dpi) -{ - Formatter::Common().Add(_trackDesignFileReference->name.c_str()); - DrawWidgets(dpi); -} - -/** - * - * rct2: 0x006D35CD - */ -static void WindowTrackDeletePromptOpen(TrackDesignFileRef* tdFileRef) -{ - WindowCloseByClass(WindowClass::TrackDeletePrompt); - - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - auto trackDeletePromptWindow = std::make_unique(tdFileRef); - WindowCreate( - std::move(trackDeletePromptWindow), WindowClass::TrackDeletePrompt, ScreenCoordsXY( - std::max(TOP_TOOLBAR_HEIGHT + 1, (screenWidth - WW_DELETE_PROMPT) / 2), (screenHeight - WH_DELETE_PROMPT) / 2), WW_DELETE_PROMPT, WH_DELETE_PROMPT, - WF_STICK_TO_FRONT | WF_TRANSPARENT); -} - -void TrackDeletePromptWindow::OnOpen() -{ - widgets = _trackDeletePromptWidgets; - WindowInitScrollWidgets(*this); -} - -void TrackDeletePromptWindow::OnMouseUp(WidgetIndex widgetIndex) -{ - switch (widgetIndex) + void TrackDeletePromptWindow::OnMouseUp(WidgetIndex widgetIndex) { - case WIDX_CLOSE: - case WIDX_PROMPT_CANCEL: - Close(); - break; - case WIDX_PROMPT_DELETE: - // tdPath has to be saved before window is closed, as that would blank it out. - auto tdPath = _trackDesignFileReference->path; - Close(); - if (TrackRepositoryDelete(tdPath)) - { - WindowCloseByClass(WindowClass::ManageTrackDesign); - WindowTrackDesignListReloadTracks(); - } - else - { - ContextShowError(STR_CANT_DELETE_TRACK_DESIGN, STR_FILE_IS_WRITE_PROTECTED_OR_LOCKED, {}); - } - break; + switch (widgetIndex) + { + case WIDX_CLOSE: + case WIDX_PROMPT_CANCEL: + Close(); + break; + case WIDX_PROMPT_DELETE: + // tdPath has to be saved before window is closed, as that would blank it out. + auto tdPath = _trackDesignFileReference->path; + Close(); + if (TrackRepositoryDelete(tdPath)) + { + WindowCloseByClass(WindowClass::ManageTrackDesign); + WindowTrackDesignListReloadTracks(); + } + else + { + ContextShowError(STR_CANT_DELETE_TRACK_DESIGN, STR_FILE_IS_WRITE_PROTECTED_OR_LOCKED, {}); + } + break; + } } -} -void TrackDeletePromptWindow::OnDraw(DrawPixelInfo& dpi) -{ - DrawWidgets(dpi); - - auto ft = Formatter(); - ft.Add(_trackDesignFileReference->name.c_str()); - DrawTextWrapped( - dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), - STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE }); -} + void TrackDeletePromptWindow::OnDraw(DrawPixelInfo& dpi) + { + DrawWidgets(dpi); + auto ft = Formatter(); + ft.Add(_trackDesignFileReference->name.c_str()); + DrawTextWrapped( + dpi, { windowPos.x + (WW_DELETE_PROMPT / 2), windowPos.y + ((WH_DELETE_PROMPT / 2) - 9) }, (WW_DELETE_PROMPT - 4), + STR_ARE_YOU_SURE_YOU_WANT_TO_PERMANENTLY_DELETE_TRACK, ft, { TextAlignment::CENTRE }); + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 446b274cfd..75156eb9ca 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -34,22 +34,23 @@ #include #include -using namespace OpenRCT2; using namespace OpenRCT2::TrackMetaData; -static constexpr StringId WINDOW_TITLE = STR_STRING; -static constexpr int32_t WH = 124; -static constexpr int32_t WW = 200; -constexpr int16_t TRACK_MINI_PREVIEW_WIDTH = 168; -constexpr int16_t TRACK_MINI_PREVIEW_HEIGHT = 78; -constexpr uint16_t TRACK_MINI_PREVIEW_SIZE = TRACK_MINI_PREVIEW_WIDTH * TRACK_MINI_PREVIEW_HEIGHT; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_STRING; + static constexpr int32_t WH = 124; + static constexpr int32_t WW = 200; + constexpr int16_t TRACK_MINI_PREVIEW_WIDTH = 168; + constexpr int16_t TRACK_MINI_PREVIEW_HEIGHT = 78; + constexpr uint16_t TRACK_MINI_PREVIEW_SIZE = TRACK_MINI_PREVIEW_WIDTH * TRACK_MINI_PREVIEW_HEIGHT; -static constexpr uint8_t _PaletteIndexColourEntrance = PALETTE_INDEX_20; // White -static constexpr uint8_t _PaletteIndexColourExit = PALETTE_INDEX_10; // Black -static constexpr uint8_t _PaletteIndexColourTrack = PALETTE_INDEX_248; // Grey (dark) -static constexpr uint8_t _PaletteIndexColourStation = PALETTE_INDEX_252; // Grey (light) + static constexpr uint8_t _PaletteIndexColourEntrance = PALETTE_INDEX_20; // White + static constexpr uint8_t _PaletteIndexColourExit = PALETTE_INDEX_10; // Black + static constexpr uint8_t _PaletteIndexColourTrack = PALETTE_INDEX_248; // Grey (dark) + static constexpr uint8_t _PaletteIndexColourStation = PALETTE_INDEX_252; // Grey (light) -// clang-format off + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -71,580 +72,583 @@ static Widget _trackPlaceWidgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -class TrackDesignPlaceWindow final : public Window -{ -public: - void OnOpen() override + class TrackDesignPlaceWindow final : public Window { - widgets = _trackPlaceWidgets; - WindowInitScrollWidgets(*this); - ToolSet(*this, WIDX_PRICE, Tool::Crosshair); - InputSetFlag(INPUT_FLAG_6, true); - WindowPushOthersRight(*this); - ShowGridlines(); - _miniPreview.resize(TRACK_MINI_PREVIEW_SIZE); - _placementCost = kMoney64Undefined; - _placementLoc.SetNull(); - _currentTrackPieceDirection = (2 - GetCurrentRotation()) & 3; - } - - void OnClose() override - { - ClearProvisional(); - ViewportSetVisibility(ViewportVisibility::Default); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - HideGridlines(); - _miniPreview.clear(); - _miniPreview.shrink_to_fit(); - _trackDesign = nullptr; - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - case WIDX_ROTATE: + widgets = _trackPlaceWidgets; + WindowInitScrollWidgets(*this); + ToolSet(*this, WIDX_PRICE, Tool::Crosshair); + InputSetFlag(INPUT_FLAG_6, true); + WindowPushOthersRight(*this); + ShowGridlines(); + _miniPreview.resize(TRACK_MINI_PREVIEW_SIZE); + _placementCost = kMoney64Undefined; + _placementLoc.SetNull(); + _currentTrackPieceDirection = (2 - GetCurrentRotation()) & 3; + } + + void OnClose() override + { + ClearProvisional(); + ViewportSetVisibility(ViewportVisibility::Default); + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + HideGridlines(); + _miniPreview.clear(); + _miniPreview.shrink_to_fit(); + _trackDesign = nullptr; + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_ROTATE: + ClearProvisional(); + _currentTrackPieceDirection = (_currentTrackPieceDirection + 1) & 3; + Invalidate(); + _placementLoc.SetNull(); + DrawMiniPreview(_trackDesign.get()); + break; + case WIDX_MIRROR: + TrackDesignMirror(_trackDesign.get()); + _currentTrackPieceDirection = (0 - _currentTrackPieceDirection) & 3; + Invalidate(); + _placementLoc.SetNull(); + DrawMiniPreview(_trackDesign.get()); + break; + case WIDX_SELECT_DIFFERENT_DESIGN: + Close(); + + auto intent = Intent(WindowClass::TrackDesignList); + intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, _window_track_list_item.Type); + intent.PutExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, _window_track_list_item.EntryIndex); + ContextOpenIntent(&intent); + break; + } + } + + void OnUpdate() override + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + if (gCurrentToolWidget.window_classification != WindowClass::TrackDesignPlace) + Close(); + } + + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + TrackDesignState tds{}; + int16_t mapZ; + + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; + + // Get the tool map position + CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); + if (mapCoords.IsNull()) + { ClearProvisional(); - _currentTrackPieceDirection = (_currentTrackPieceDirection + 1) & 3; - Invalidate(); - _placementLoc.SetNull(); - DrawMiniPreview(_trackDesign.get()); - break; - case WIDX_MIRROR: - TrackDesignMirror(_trackDesign.get()); - _currentTrackPieceDirection = (0 - _currentTrackPieceDirection) & 3; - Invalidate(); - _placementLoc.SetNull(); - DrawMiniPreview(_trackDesign.get()); - break; - case WIDX_SELECT_DIFFERENT_DESIGN: - Close(); + return; + } - auto intent = Intent(WindowClass::TrackDesignList); - intent.PutExtra(INTENT_EXTRA_RIDE_TYPE, _window_track_list_item.Type); - intent.PutExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX, _window_track_list_item.EntryIndex); - ContextOpenIntent(&intent); - break; + // Check if tool map position has changed since last update + if (mapCoords == _placementLoc) + { + TrackDesignPreviewDrawOutlines( + tds, _trackDesign.get(), RideGetTemporaryForPreview(), { mapCoords, 0, _currentTrackPieceDirection }); + return; + } + + money64 cost = kMoney64Undefined; + + // Get base Z position + mapZ = GetBaseZ(mapCoords); + CoordsXYZD trackLoc = { mapCoords, mapZ, _currentTrackPieceDirection }; + + if (GameIsNotPaused() || GetGameState().Cheats.BuildInPauseMode) + { + ClearProvisional(); + auto res = FindValidTrackDesignPlaceHeight(trackLoc, GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + + if (res.Error == GameActions::Status::Ok) + { + // Valid location found. Place the ghost at the location. + auto tdAction = TrackDesignAction(trackLoc, *_trackDesign); + tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + tdAction.SetCallback([&](const GameAction*, const GameActions::Result* result) { + if (result->Error == GameActions::Status::Ok) + { + _placementGhostRideId = result->GetData(); + _placementGhostLoc = trackLoc; + _hasPlacementGhost = true; + } + }); + res = GameActions::Execute(&tdAction); + cost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + } + } + + _placementLoc = trackLoc; + if (cost != _placementCost) + { + _placementCost = cost; + WidgetInvalidate(*this, WIDX_PRICE); + } + + TrackDesignPreviewDrawOutlines(tds, _trackDesign.get(), RideGetTemporaryForPreview(), trackLoc); } - } - void OnUpdate() override - { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - if (gCurrentToolWidget.window_classification != WindowClass::TrackDesignPlace) - Close(); - } - - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - TrackDesignState tds{}; - int16_t mapZ; - - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - // Get the tool map position - CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - if (mapCoords.IsNull()) + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { ClearProvisional(); - return; - } + MapInvalidateMapSelectionTiles(); + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; + gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - // Check if tool map position has changed since last update - if (mapCoords == _placementLoc) - { - TrackDesignPreviewDrawOutlines( - tds, _trackDesign.get(), RideGetTemporaryForPreview(), { mapCoords, 0, _currentTrackPieceDirection }); - return; - } + const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); + if (mapCoords.IsNull()) + return; - money64 cost = kMoney64Undefined; - - // Get base Z position - mapZ = GetBaseZ(mapCoords); - CoordsXYZD trackLoc = { mapCoords, mapZ, _currentTrackPieceDirection }; - - if (GameIsNotPaused() || GetGameState().Cheats.BuildInPauseMode) - { - ClearProvisional(); - auto res = FindValidTrackDesignPlaceHeight(trackLoc, GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + // Try increasing Z until a feasible placement is found + int16_t mapZ = GetBaseZ(mapCoords); + CoordsXYZ trackLoc = { mapCoords, mapZ }; + auto res = FindValidTrackDesignPlaceHeight(trackLoc, 0); if (res.Error == GameActions::Status::Ok) { - // Valid location found. Place the ghost at the location. - auto tdAction = TrackDesignAction(trackLoc, *_trackDesign); - tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + auto tdAction = TrackDesignAction({ trackLoc, _currentTrackPieceDirection }, *_trackDesign); tdAction.SetCallback([&](const GameAction*, const GameActions::Result* result) { if (result->Error == GameActions::Status::Ok) { - _placementGhostRideId = result->GetData(); - _placementGhostLoc = trackLoc; - _hasPlacementGhost = true; + rideId = result->GetData(); + auto getRide = GetRide(rideId); + if (getRide != nullptr) + { + WindowCloseByClass(WindowClass::Error); + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackLoc); + + _currentRideIndex = rideId; + if (TrackDesignAreEntranceAndExitPlaced()) + { + auto intent = Intent(WindowClass::Ride); + intent.PutExtra(INTENT_EXTRA_RIDE_ID, rideId.ToUnderlying()); + ContextOpenIntent(&intent); + auto wnd = WindowFindByClass(WindowClass::TrackDesignPlace); + WindowClose(*wnd); + } + else + { + RideInitialiseConstructionWindow(*getRide); + auto wnd = WindowFindByClass(WindowClass::RideConstruction); + wnd->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); + } + } + } + else + { + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, result->Position); } }); - res = GameActions::Execute(&tdAction); - cost = res.Error == GameActions::Status::Ok ? res.Cost : kMoney64Undefined; + GameActions::Execute(&tdAction); + return; + } + + // Unable to build track + OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, trackLoc); + + auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); + windowManager->ShowError(res.GetErrorTitle(), res.GetErrorMessage()); + } + + void OnToolAbort(WidgetIndex widgetIndex) override + { + ClearProvisional(); + } + + void OnViewportRotate() override + { + DrawMiniPreview(_trackDesign.get()); + } + + void OnPrepareDraw() override + { + DrawMiniPreview(_trackDesign.get()); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + auto ft = Formatter::Common(); + ft.Add(_trackDesign->name.c_str()); + WindowDrawWidgets(*this, dpi); + + // Draw mini tile preview + DrawPixelInfo clippedDpi; + if (ClipDrawPixelInfo(clippedDpi, dpi, this->windowPos + ScreenCoordsXY{ 4, 18 }, 168, 78)) + { + G1Element g1temp = {}; + g1temp.offset = _miniPreview.data(); + g1temp.width = TRACK_MINI_PREVIEW_WIDTH; + g1temp.height = TRACK_MINI_PREVIEW_HEIGHT; + GfxSetG1Element(SPR_TEMP, &g1temp); + DrawingEngineInvalidateImage(SPR_TEMP); + GfxDrawSprite(clippedDpi, ImageId(SPR_TEMP, NOT_TRANSLUCENT(this->colours[0])), { 0, 0 }); + } + + // Price + if (_placementCost != kMoney64Undefined && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + ft = Formatter(); + ft.Add(_placementCost); + DrawTextBasic(dpi, this->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); } } - _placementLoc = trackLoc; - if (cost != _placementCost) + void OnResize() override { - _placementCost = cost; - WidgetInvalidate(*this, WIDX_PRICE); + ResizeFrame(); } - TrackDesignPreviewDrawOutlines(tds, _trackDesign.get(), RideGetTemporaryForPreview(), trackLoc); - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - ClearProvisional(); - MapInvalidateMapSelectionTiles(); - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT; - gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW; - - const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords); - if (mapCoords.IsNull()) - return; - - // Try increasing Z until a feasible placement is found - int16_t mapZ = GetBaseZ(mapCoords); - CoordsXYZ trackLoc = { mapCoords, mapZ }; - - auto res = FindValidTrackDesignPlaceHeight(trackLoc, 0); - if (res.Error == GameActions::Status::Ok) + void ClearProvisionalTemporarily() { - auto tdAction = TrackDesignAction({ trackLoc, _currentTrackPieceDirection }, *_trackDesign); - tdAction.SetCallback([&](const GameAction*, const GameActions::Result* result) { - if (result->Error == GameActions::Status::Ok) + if (_hasPlacementGhost) + { + auto provRide = GetRide(_placementGhostRideId); + if (provRide != nullptr) { - rideId = result->GetData(); - auto getRide = GetRide(rideId); - if (getRide != nullptr) - { - WindowCloseByClass(WindowClass::Error); - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::PlaceItem, trackLoc); + TrackDesignPreviewRemoveGhosts(_trackDesign.get(), *provRide, _placementGhostLoc); + } + } + } - _currentRideIndex = rideId; - if (TrackDesignAreEntranceAndExitPlaced()) - { - auto intent = Intent(WindowClass::Ride); - intent.PutExtra(INTENT_EXTRA_RIDE_ID, rideId.ToUnderlying()); - ContextOpenIntent(&intent); - auto wnd = WindowFindByClass(WindowClass::TrackDesignPlace); - WindowClose(*wnd); - } - else - { - RideInitialiseConstructionWindow(*getRide); - auto wnd = WindowFindByClass(WindowClass::RideConstruction); - wnd->OnMouseUp(WC_RIDE_CONSTRUCTION__WIDX_ENTRANCE); - } - } + void RestoreProvisional() + { + if (_hasPlacementGhost) + { + auto tdAction = TrackDesignAction({ _placementGhostLoc }, *_trackDesign); + tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); + auto res = GameActions::Execute(&tdAction); + if (res.Error != GameActions::Status::Ok) + { + _hasPlacementGhost = false; + } + } + } + + void Init(std::unique_ptr&& trackDesign) + { + _trackDesign = std::move(trackDesign); + } + + void DrawMiniPreview(TrackDesign* td6) + { + ClearMiniPreview(); + + // First pass is used to determine the width and height of the image so it can centre it + CoordsXY min = { 0, 0 }; + CoordsXY max = { 0, 0 }; + for (int32_t pass = 0; pass < 2; pass++) + { + CoordsXY origin = { 0, 0 }; + if (pass == 1) + { + origin.x -= ((max.x + min.x) >> 6) * COORDS_XY_STEP; + origin.y -= ((max.y + min.y) >> 6) * COORDS_XY_STEP; + } + + const auto& rtd = GetRideTypeDescriptor(td6->type); + if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + DrawMiniPreviewMaze(td6, pass, origin, min, max); } else { - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, result->Position); + DrawMiniPreviewTrack(td6, pass, origin, min, max); } - }); - GameActions::Execute(&tdAction); - return; - } - - // Unable to build track - OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Error, trackLoc); - - auto windowManager = GetContext()->GetUiContext()->GetWindowManager(); - windowManager->ShowError(res.GetErrorTitle(), res.GetErrorMessage()); - } - - void OnToolAbort(WidgetIndex widgetIndex) override - { - ClearProvisional(); - } - - void OnViewportRotate() override - { - DrawMiniPreview(_trackDesign.get()); - } - - void OnPrepareDraw() override - { - DrawMiniPreview(_trackDesign.get()); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - auto ft = Formatter::Common(); - ft.Add(_trackDesign->name.c_str()); - WindowDrawWidgets(*this, dpi); - - // Draw mini tile preview - DrawPixelInfo clippedDpi; - if (ClipDrawPixelInfo(clippedDpi, dpi, this->windowPos + ScreenCoordsXY{ 4, 18 }, 168, 78)) - { - G1Element g1temp = {}; - g1temp.offset = _miniPreview.data(); - g1temp.width = TRACK_MINI_PREVIEW_WIDTH; - g1temp.height = TRACK_MINI_PREVIEW_HEIGHT; - GfxSetG1Element(SPR_TEMP, &g1temp); - DrawingEngineInvalidateImage(SPR_TEMP); - GfxDrawSprite(clippedDpi, ImageId(SPR_TEMP, NOT_TRANSLUCENT(this->colours[0])), { 0, 0 }); - } - - // Price - if (_placementCost != kMoney64Undefined && !(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - ft = Formatter(); - ft.Add(_placementCost); - DrawTextBasic(dpi, this->windowPos + ScreenCoordsXY{ 88, 94 }, STR_COST_LABEL, ft, { TextAlignment::CENTRE }); - } - } - - void OnResize() override - { - ResizeFrame(); - } - - void ClearProvisionalTemporarily() - { - if (_hasPlacementGhost) - { - auto provRide = GetRide(_placementGhostRideId); - if (provRide != nullptr) - { - TrackDesignPreviewRemoveGhosts(_trackDesign.get(), *provRide, _placementGhostLoc); } } - } - void RestoreProvisional() - { - if (_hasPlacementGhost) + void ClearMiniPreview() { - auto tdAction = TrackDesignAction({ _placementGhostLoc }, *_trackDesign); - tdAction.SetFlags(GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST); - auto res = GameActions::Execute(&tdAction); - if (res.Error != GameActions::Status::Ok) - { - _hasPlacementGhost = false; - } - } - } - - void Init(std::unique_ptr&& trackDesign) - { - _trackDesign = std::move(trackDesign); - } - - void DrawMiniPreview(TrackDesign* td6) - { - ClearMiniPreview(); - - // First pass is used to determine the width and height of the image so it can centre it - CoordsXY min = { 0, 0 }; - CoordsXY max = { 0, 0 }; - for (int32_t pass = 0; pass < 2; pass++) - { - CoordsXY origin = { 0, 0 }; - if (pass == 1) - { - origin.x -= ((max.x + min.x) >> 6) * COORDS_XY_STEP; - origin.y -= ((max.y + min.y) >> 6) * COORDS_XY_STEP; - } - - const auto& rtd = GetRideTypeDescriptor(td6->type); - if (rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) - { - DrawMiniPreviewMaze(td6, pass, origin, min, max); - } - else - { - DrawMiniPreviewTrack(td6, pass, origin, min, max); - } - } - } - - void ClearMiniPreview() - { - // Fill with transparent colour. - std::fill(_miniPreview.begin(), _miniPreview.end(), PALETTE_INDEX_0); - } - -private: - std::unique_ptr _trackDesign; - - CoordsXY _placementLoc; - RideId _placementGhostRideId; - bool _hasPlacementGhost; - money64 _placementCost; - CoordsXYZD _placementGhostLoc; - - std::vector _miniPreview; - - void ClearProvisional() - { - if (_hasPlacementGhost) - { - auto newRide = GetRide(_placementGhostRideId); - if (newRide != nullptr) - { - TrackDesignPreviewRemoveGhosts(_trackDesign.get(), *newRide, _placementGhostLoc); - _hasPlacementGhost = false; - } - } - } - - int32_t GetBaseZ(const CoordsXY& loc) - { - auto surfaceElement = MapGetSurfaceElementAt(loc); - if (surfaceElement == nullptr) - return 0; - - auto z = surfaceElement->GetBaseZ(); - - // Increase Z above slope - if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) - { - z += 16; - - // Increase Z above double slope - if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) - z += 16; + // Fill with transparent colour. + std::fill(_miniPreview.begin(), _miniPreview.end(), PALETTE_INDEX_0); } - // Increase Z above water - if (surfaceElement->GetWaterHeight() > 0) - z = std::max(z, surfaceElement->GetWaterHeight()); + private: + std::unique_ptr _trackDesign; - return z - + TrackDesignGetZPlacement( - _trackDesign.get(), RideGetTemporaryForPreview(), { loc, z, _currentTrackPieceDirection }); - } + CoordsXY _placementLoc; + RideId _placementGhostRideId; + bool _hasPlacementGhost; + money64 _placementCost; + CoordsXYZD _placementGhostLoc; - void DrawMiniPreviewEntrances( - const TrackDesign& td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max, Direction rotation) - { - for (const auto& entrance : td6.entrance_elements) + std::vector _miniPreview; + + void ClearProvisional() { - auto rotatedAndOffsetEntrance = origin + entrance.Location.ToCoordsXY().Rotate(rotation); - - if (pass == 0) + if (_hasPlacementGhost) { - min.x = std::min(min.x, rotatedAndOffsetEntrance.x); - max.x = std::max(max.x, rotatedAndOffsetEntrance.x); - min.y = std::min(min.y, rotatedAndOffsetEntrance.y); - max.y = std::max(max.y, rotatedAndOffsetEntrance.y); - } - else - { - auto pixelPosition = DrawMiniPreviewGetPixelPosition(rotatedAndOffsetEntrance); - if (DrawMiniPreviewIsPixelInBounds(pixelPosition)) + auto newRide = GetRide(_placementGhostRideId); + if (newRide != nullptr) { - uint8_t* pixel = DrawMiniPreviewGetPixelPtr(pixelPosition); - uint8_t colour = entrance.IsExit ? _PaletteIndexColourExit : _PaletteIndexColourEntrance; - for (int32_t i = 0; i < 4; i++) - { - pixel[338 + i] = colour; // x + 2, y + 2 - pixel[168 + i] = colour; // y + 1 - pixel[2 + i] = colour; // x + 2 - pixel[172 + i] = colour; // x + 4, y + 1 - } + TrackDesignPreviewRemoveGhosts(_trackDesign.get(), *newRide, _placementGhostLoc); + _hasPlacementGhost = false; } } } - } - void DrawMiniPreviewTrack(TrackDesign* td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max) - { - const uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3; - - CoordsXY curTrackStart = origin; - uint8_t curTrackRotation = rotation; - for (const auto& trackElement : td6->track_elements) + int32_t GetBaseZ(const CoordsXY& loc) { - // Follow a single track piece shape - const auto& ted = GetTrackElementDescriptor(trackElement.Type); - const PreviewTrack* trackBlock = ted.Block; - while (trackBlock->index != 255) + auto surfaceElement = MapGetSurfaceElementAt(loc); + if (surfaceElement == nullptr) + return 0; + + auto z = surfaceElement->GetBaseZ(); + + // Increase Z above slope + if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_ALL_CORNERS_UP) { - auto rotatedAndOffsetTrackBlock = curTrackStart - + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(curTrackRotation); + z += 16; + + // Increase Z above double slope + if (surfaceElement->GetSlope() & TILE_ELEMENT_SLOPE_DOUBLE_HEIGHT) + z += 16; + } + + // Increase Z above water + if (surfaceElement->GetWaterHeight() > 0) + z = std::max(z, surfaceElement->GetWaterHeight()); + + return z + + TrackDesignGetZPlacement( + _trackDesign.get(), RideGetTemporaryForPreview(), { loc, z, _currentTrackPieceDirection }); + } + + void DrawMiniPreviewEntrances( + const TrackDesign& td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max, Direction rotation) + { + for (const auto& entrance : td6.entrance_elements) + { + auto rotatedAndOffsetEntrance = origin + entrance.Location.ToCoordsXY().Rotate(rotation); if (pass == 0) { - min.x = std::min(min.x, rotatedAndOffsetTrackBlock.x); - max.x = std::max(max.x, rotatedAndOffsetTrackBlock.x); - min.y = std::min(min.y, rotatedAndOffsetTrackBlock.y); - max.y = std::max(max.y, rotatedAndOffsetTrackBlock.y); + min.x = std::min(min.x, rotatedAndOffsetEntrance.x); + max.x = std::max(max.x, rotatedAndOffsetEntrance.x); + min.y = std::min(min.y, rotatedAndOffsetEntrance.y); + max.y = std::max(max.y, rotatedAndOffsetEntrance.y); } else { - auto pixelPosition = DrawMiniPreviewGetPixelPosition(rotatedAndOffsetTrackBlock); + auto pixelPosition = DrawMiniPreviewGetPixelPosition(rotatedAndOffsetEntrance); + if (DrawMiniPreviewIsPixelInBounds(pixelPosition)) + { + uint8_t* pixel = DrawMiniPreviewGetPixelPtr(pixelPosition); + uint8_t colour = entrance.IsExit ? _PaletteIndexColourExit : _PaletteIndexColourEntrance; + for (int32_t i = 0; i < 4; i++) + { + pixel[338 + i] = colour; // x + 2, y + 2 + pixel[168 + i] = colour; // y + 1 + pixel[2 + i] = colour; // x + 2 + pixel[172 + i] = colour; // x + 4, y + 1 + } + } + } + } + } + + void DrawMiniPreviewTrack(TrackDesign* td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max) + { + const uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3; + + CoordsXY curTrackStart = origin; + uint8_t curTrackRotation = rotation; + for (const auto& trackElement : td6->track_elements) + { + // Follow a single track piece shape + const auto& ted = GetTrackElementDescriptor(trackElement.Type); + const PreviewTrack* trackBlock = ted.Block; + while (trackBlock->index != 255) + { + auto rotatedAndOffsetTrackBlock = curTrackStart + + CoordsXY{ trackBlock->x, trackBlock->y }.Rotate(curTrackRotation); + + if (pass == 0) + { + min.x = std::min(min.x, rotatedAndOffsetTrackBlock.x); + max.x = std::max(max.x, rotatedAndOffsetTrackBlock.x); + min.y = std::min(min.y, rotatedAndOffsetTrackBlock.y); + max.y = std::max(max.y, rotatedAndOffsetTrackBlock.y); + } + else + { + auto pixelPosition = DrawMiniPreviewGetPixelPosition(rotatedAndOffsetTrackBlock); + if (DrawMiniPreviewIsPixelInBounds(pixelPosition)) + { + uint8_t* pixel = DrawMiniPreviewGetPixelPtr(pixelPosition); + + auto bits = trackBlock->var_08.Rotate(curTrackRotation & 3).GetBaseQuarterOccupied(); + + // Station track is a lighter colour + uint8_t colour = (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) + ? _PaletteIndexColourStation + : _PaletteIndexColourTrack; + + for (int32_t i = 0; i < 4; i++) + { + if (bits & 1) + pixel[338 + i] = colour; // x + 2, y + 2 + if (bits & 2) + pixel[168 + i] = colour; // y + 1 + if (bits & 4) + pixel[2 + i] = colour; // x + 2 + if (bits & 8) + pixel[172 + i] = colour; // x + 4, y + 1 + } + } + } + trackBlock++; + } + + // Change rotation and next position based on track curvature + curTrackRotation &= 3; + + const TrackCoordinates* track_coordinate = &ted.Coordinates; + + curTrackStart += CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(curTrackRotation); + curTrackRotation += track_coordinate->rotation_end - track_coordinate->rotation_begin; + curTrackRotation &= 3; + if (track_coordinate->rotation_end & 4) + { + curTrackRotation |= 4; + } + if (!(curTrackRotation & 4)) + { + curTrackStart += CoordsDirectionDelta[curTrackRotation]; + } + } + + DrawMiniPreviewEntrances(*td6, pass, origin, min, max, rotation); + } + + void DrawMiniPreviewMaze(TrackDesign* td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max) + { + uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3; + for (const auto& mazeElement : td6->maze_elements) + { + auto rotatedMazeCoords = origin + TileCoordsXY{ mazeElement.x, mazeElement.y }.ToCoordsXY().Rotate(rotation); + + if (pass == 0) + { + min.x = std::min(min.x, rotatedMazeCoords.x); + max.x = std::max(max.x, rotatedMazeCoords.x); + min.y = std::min(min.y, rotatedMazeCoords.y); + max.y = std::max(max.y, rotatedMazeCoords.y); + } + else + { + auto pixelPosition = DrawMiniPreviewGetPixelPosition(rotatedMazeCoords); if (DrawMiniPreviewIsPixelInBounds(pixelPosition)) { uint8_t* pixel = DrawMiniPreviewGetPixelPtr(pixelPosition); - auto bits = trackBlock->var_08.Rotate(curTrackRotation & 3).GetBaseQuarterOccupied(); - - // Station track is a lighter colour - uint8_t colour = (ted.SequenceProperties[0] & TRACK_SEQUENCE_FLAG_ORIGIN) ? _PaletteIndexColourStation - : _PaletteIndexColourTrack; - + uint8_t colour = _PaletteIndexColourTrack; for (int32_t i = 0; i < 4; i++) { - if (bits & 1) - pixel[338 + i] = colour; // x + 2, y + 2 - if (bits & 2) - pixel[168 + i] = colour; // y + 1 - if (bits & 4) - pixel[2 + i] = colour; // x + 2 - if (bits & 8) - pixel[172 + i] = colour; // x + 4, y + 1 + pixel[338 + i] = colour; // x + 2, y + 2 + pixel[168 + i] = colour; // y + 1 + pixel[2 + i] = colour; // x + 2 + pixel[172 + i] = colour; // x + 4, y + 1 } } } - trackBlock++; } - // Change rotation and next position based on track curvature - curTrackRotation &= 3; - - const TrackCoordinates* track_coordinate = &ted.Coordinates; - - curTrackStart += CoordsXY{ track_coordinate->x, track_coordinate->y }.Rotate(curTrackRotation); - curTrackRotation += track_coordinate->rotation_end - track_coordinate->rotation_begin; - curTrackRotation &= 3; - if (track_coordinate->rotation_end & 4) - { - curTrackRotation |= 4; - } - if (!(curTrackRotation & 4)) - { - curTrackStart += CoordsDirectionDelta[curTrackRotation]; - } + DrawMiniPreviewEntrances(*td6, pass, origin, min, max, rotation); } - DrawMiniPreviewEntrances(*td6, pass, origin, min, max, rotation); - } - - void DrawMiniPreviewMaze(TrackDesign* td6, int32_t pass, const CoordsXY& origin, CoordsXY& min, CoordsXY& max) - { - uint8_t rotation = (_currentTrackPieceDirection + GetCurrentRotation()) & 3; - for (const auto& mazeElement : td6->maze_elements) + ScreenCoordsXY DrawMiniPreviewGetPixelPosition(const CoordsXY& location) { - auto rotatedMazeCoords = origin + TileCoordsXY{ mazeElement.x, mazeElement.y }.ToCoordsXY().Rotate(rotation); + auto tilePos = TileCoordsXY(location); + return { (80 + (tilePos.y - tilePos.x) * 4), (38 + (tilePos.y + tilePos.x) * 2) }; + } - if (pass == 0) + bool DrawMiniPreviewIsPixelInBounds(const ScreenCoordsXY& pixel) + { + return pixel.x >= 0 && pixel.y >= 0 && pixel.x <= 160 && pixel.y <= 75; + } + + uint8_t* DrawMiniPreviewGetPixelPtr(const ScreenCoordsXY& pixel) + { + return &_miniPreview[pixel.y * TRACK_MINI_PREVIEW_WIDTH + pixel.x]; + } + + GameActions::Result FindValidTrackDesignPlaceHeight(CoordsXYZ& loc, uint32_t newFlags) + { + GameActions::Result res; + for (int32_t i = 0; i < 7; i++, loc.z += 8) { - min.x = std::min(min.x, rotatedMazeCoords.x); - max.x = std::max(max.x, rotatedMazeCoords.x); - min.y = std::min(min.y, rotatedMazeCoords.y); - max.y = std::max(max.y, rotatedMazeCoords.y); - } - else - { - auto pixelPosition = DrawMiniPreviewGetPixelPosition(rotatedMazeCoords); - if (DrawMiniPreviewIsPixelInBounds(pixelPosition)) + auto tdAction = TrackDesignAction( + CoordsXYZD{ loc.x, loc.y, loc.z, _currentTrackPieceDirection }, *_trackDesign); + tdAction.SetFlags(newFlags); + res = GameActions::Query(&tdAction); + + // If successful don't keep trying. + // If failure due to no money then increasing height only makes problem worse + if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::InsufficientFunds) { - uint8_t* pixel = DrawMiniPreviewGetPixelPtr(pixelPosition); - - uint8_t colour = _PaletteIndexColourTrack; - for (int32_t i = 0; i < 4; i++) - { - pixel[338 + i] = colour; // x + 2, y + 2 - pixel[168 + i] = colour; // y + 1 - pixel[2 + i] = colour; // x + 2 - pixel[172 + i] = colour; // x + 4, y + 1 - } + return res; } } + return res; } + }; - DrawMiniPreviewEntrances(*td6, pass, origin, min, max, rotation); - } - - ScreenCoordsXY DrawMiniPreviewGetPixelPosition(const CoordsXY& location) + WindowBase* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef) { - auto tilePos = TileCoordsXY(location); - return { (80 + (tilePos.y - tilePos.x) * 4), (38 + (tilePos.y + tilePos.x) * 2) }; - } + std::unique_ptr openTrackDesign = TrackDesignImport(tdFileRef->path.c_str()); - bool DrawMiniPreviewIsPixelInBounds(const ScreenCoordsXY& pixel) - { - return pixel.x >= 0 && pixel.y >= 0 && pixel.x <= 160 && pixel.y <= 75; - } - - uint8_t* DrawMiniPreviewGetPixelPtr(const ScreenCoordsXY& pixel) - { - return &_miniPreview[pixel.y * TRACK_MINI_PREVIEW_WIDTH + pixel.x]; - } - - GameActions::Result FindValidTrackDesignPlaceHeight(CoordsXYZ& loc, uint32_t newFlags) - { - GameActions::Result res; - for (int32_t i = 0; i < 7; i++, loc.z += 8) + if (openTrackDesign == nullptr) { - auto tdAction = TrackDesignAction(CoordsXYZD{ loc.x, loc.y, loc.z, _currentTrackPieceDirection }, *_trackDesign); - tdAction.SetFlags(newFlags); - res = GameActions::Query(&tdAction); - - // If successful don't keep trying. - // If failure due to no money then increasing height only makes problem worse - if (res.Error == GameActions::Status::Ok || res.Error == GameActions::Status::InsufficientFunds) - { - return res; - } + return nullptr; } - return res; + + WindowCloseConstructionWindows(); + + auto* window = WindowFocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); + if (window != nullptr) + { + window->Init(std::move(openTrackDesign)); + } + return window; } -}; -WindowBase* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef) -{ - std::unique_ptr openTrackDesign = TrackDesignImport(tdFileRef->path.c_str()); - - if (openTrackDesign == nullptr) + void TrackPlaceClearProvisionalTemporarily() { - return nullptr; + auto* trackPlaceWnd = static_cast(WindowFindByClass(WindowClass::TrackDesignPlace)); + if (trackPlaceWnd != nullptr) + { + trackPlaceWnd->ClearProvisionalTemporarily(); + } } - WindowCloseConstructionWindows(); - - auto* window = WindowFocusOrCreate(WindowClass::TrackDesignPlace, WW, WH, 0); - if (window != nullptr) + void TrackPlaceRestoreProvisional() { - window->Init(std::move(openTrackDesign)); + auto* trackPlaceWnd = static_cast(WindowFindByClass(WindowClass::TrackDesignPlace)); + if (trackPlaceWnd != nullptr) + { + trackPlaceWnd->RestoreProvisional(); + } } - return window; -} - -void TrackPlaceClearProvisionalTemporarily() -{ - auto* trackPlaceWnd = static_cast(WindowFindByClass(WindowClass::TrackDesignPlace)); - if (trackPlaceWnd != nullptr) - { - trackPlaceWnd->ClearProvisionalTemporarily(); - } -} - -void TrackPlaceRestoreProvisional() -{ - auto* trackPlaceWnd = static_cast(WindowFindByClass(WindowClass::TrackDesignPlace)); - if (trackPlaceWnd != nullptr) - { - trackPlaceWnd->RestoreProvisional(); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 5274e79342..edc4b91b8e 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -28,14 +28,16 @@ #include #include -static constexpr StringId WINDOW_TITLE = STR_SELECT_DESIGN; -static constexpr int32_t WH = 441; -static constexpr int32_t WW = 600; -static constexpr int32_t DEBUG_PATH_HEIGHT = 12; -static constexpr int32_t ROTATE_AND_SCENERY_BUTTON_SIZE = 24; -static constexpr int32_t WINDOW_PADDING = 5; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_SELECT_DESIGN; + static constexpr int32_t WH = 441; + static constexpr int32_t WW = 600; + static constexpr int32_t DEBUG_PATH_HEIGHT = 12; + static constexpr int32_t ROTATE_AND_SCENERY_BUTTON_SIZE = 24; + static constexpr int32_t WINDOW_PADDING = 5; -// clang-format off + // clang-format off enum { WIDX_BACKGROUND, WIDX_TITLE, @@ -63,658 +65,634 @@ static Widget _trackListWidgets[] = { kWidgetsEnd, }; -// clang-format on + // clang-format on -constexpr uint16_t TRACK_DESIGN_INDEX_UNLOADED = UINT16_MAX; + constexpr uint16_t TRACK_DESIGN_INDEX_UNLOADED = UINT16_MAX; -RideSelection _window_track_list_item; + RideSelection _window_track_list_item; -class TrackListWindow final : public Window -{ -private: - std::vector _trackDesigns; - utf8 _filterString[USER_STRING_MAX_LENGTH]{}; - std::vector _filteredTrackIds; - uint16_t _loadedTrackDesignIndex; - std::unique_ptr _loadedTrackDesign; - std::vector _trackDesignPreviewPixels; - bool _selectedItemIsBeingUpdated; - bool _reloadTrackDesigns; - - void FilterList() + class TrackListWindow final : public Window { - _filteredTrackIds.clear(); + private: + std::vector _trackDesigns; + utf8 _filterString[USER_STRING_MAX_LENGTH]{}; + std::vector _filteredTrackIds; + uint16_t _loadedTrackDesignIndex; + std::unique_ptr _loadedTrackDesign; + std::vector _trackDesignPreviewPixels; + bool _selectedItemIsBeingUpdated; + bool _reloadTrackDesigns; - // Nothing to filter, so fill the list with all indices - if (String::LengthOf(_filterString) == 0) + void FilterList() { - for (uint16_t i = 0; i < _trackDesigns.size(); i++) - _filteredTrackIds.push_back(i); + _filteredTrackIds.clear(); - return; - } - - // Convert filter to uppercase - const auto filterStringUpper = String::ToUpper(_filterString); - - // Fill the set with indices for tracks that match the filter - for (uint16_t i = 0; i < _trackDesigns.size(); i++) - { - const auto trackNameUpper = String::ToUpper(_trackDesigns[i].name); - if (trackNameUpper.find(filterStringUpper) != std::string::npos) + // Nothing to filter, so fill the list with all indices + if (String::LengthOf(_filterString) == 0) { - _filteredTrackIds.push_back(i); - } - } + for (uint16_t i = 0; i < _trackDesigns.size(); i++) + _filteredTrackIds.push_back(i); - // Ensure that the selected item is still in the list. - if (static_cast(selected_list_item) >= _filteredTrackIds.size()) - { - selected_list_item = 0; - } - } - - void SelectFromList(int32_t listIndex) - { - OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, this->windowPos.x + (this->width / 2)); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - if (listIndex == 0) - { - Close(); - RideConstructNew(_window_track_list_item); return; } - listIndex--; - } - // Displays a message if the ride can't load, fix #4080 - if (_loadedTrackDesign == nullptr) - { - ContextShowError(STR_CANT_BUILD_THIS_HERE, STR_TRACK_LOAD_FAILED_ERROR, {}); - return; - } + // Convert filter to uppercase + const auto filterStringUpper = String::ToUpper(_filterString); - if (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) - { - gTrackDesignSceneryToggle = true; - } - - uint16_t trackDesignIndex = _filteredTrackIds[listIndex]; - TrackDesignFileRef* tdRef = &_trackDesigns[trackDesignIndex]; - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - auto intent = Intent(WindowClass::ManageTrackDesign); - intent.PutExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); - ContextOpenIntent(&intent); - } - else - { - if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED - && (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE)) + // Fill the set with indices for tracks that match the filter + for (uint16_t i = 0; i < _trackDesigns.size(); i++) { - ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); - } - - auto intent = Intent(WindowClass::TrackDesignPlace); - intent.PutExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); - ContextOpenIntent(&intent); - } - } - - int32_t GetListItemFromPosition(const ScreenCoordsXY& screenCoords) - { - size_t maxItems = _filteredTrackIds.size(); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - // Extra item: custom design - maxItems++; - } - - int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; - if (index < 0 || static_cast(index) >= maxItems) - { - index = -1; - } - return index; - } - - void LoadDesignsList(RideSelection item) - { - auto repo = OpenRCT2::GetContext()->GetTrackDesignRepository(); - std::string entryName; - if (item.Type < 0x80) - { - if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) - { - entryName = GetRideEntryName(item.EntryIndex); - } - } - _trackDesigns = repo->GetItemsForObjectEntry(item.Type, entryName); - - FilterList(); - } - - bool LoadDesignPreview(const u8string& path) - { - _loadedTrackDesign = TrackDesignImport(path.c_str()); - if (_loadedTrackDesign != nullptr) - { - TrackDesignDrawPreview(_loadedTrackDesign.get(), _trackDesignPreviewPixels.data()); - return true; - } - return false; - } - -public: - TrackListWindow(const RideSelection item) - { - _window_track_list_item = item; - } - - void OnOpen() override - { - LoadDesignsList(_window_track_list_item); - - String::Set(_filterString, sizeof(_filterString), ""); - _trackListWidgets[WIDX_FILTER_STRING].string = _filterString; - widgets = _trackListWidgets; - - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - widgets[WIDX_BACK].type = WindowWidgetType::Empty; - } - else - { - widgets[WIDX_BACK].type = WindowWidgetType::TableHeader; - } - - WindowInitScrollWidgets(*this); - _selectedItemIsBeingUpdated = false; - _reloadTrackDesigns = false; - // Start with first track highlighted - selected_list_item = 0; - if (_trackDesigns.size() != 0 && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - selected_list_item = 1; - } - gTrackDesignSceneryToggle = false; - WindowPushOthersRight(*this); - _currentTrackPieceDirection = 2; - _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); - - _loadedTrackDesign = nullptr; - _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; - } - - void OnClose() override - { - // Dispose track design and preview - _loadedTrackDesign = nullptr; - _trackDesignPreviewPixels.clear(); - _trackDesignPreviewPixels.shrink_to_fit(); - - // Dispose track list - _trackDesigns.clear(); - - // If gScreenAge is zero, we're already in the process - // of loading the track manager, so we shouldn't try - // to do it again. Otherwise, this window will get - // another close signal from the track manager load function, - // 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); - Editor::LoadTrackManager(); - } - } - - void OnMouseUp(const WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: - Close(); - break; - case WIDX_ROTATE: - _currentTrackPieceDirection++; - _currentTrackPieceDirection %= 4; - Invalidate(); - break; - case WIDX_TOGGLE_SCENERY: - gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; - _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; - Invalidate(); - break; - case WIDX_BACK: - Close(); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + const auto trackNameUpper = String::ToUpper(_trackDesigns[i].name); + if (trackNameUpper.find(filterStringUpper) != std::string::npos) { - ContextOpenWindow(WindowClass::ConstructRide); - } - break; - case WIDX_FILTER_STRING: - WindowStartTextbox(*this, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); // TODO check this out - break; - case WIDX_FILTER_CLEAR: - // Keep the highlighted item selected - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - if (selected_list_item != -1 && _filteredTrackIds.size() > static_cast(selected_list_item)) - selected_list_item = _filteredTrackIds[selected_list_item]; - else - selected_list_item = -1; - } - else - { - if (selected_list_item != 0) - selected_list_item = _filteredTrackIds[selected_list_item - 1] + 1; + _filteredTrackIds.push_back(i); } + } - String::Set(_filterString, sizeof(_filterString), ""); - FilterList(); - Invalidate(); - break; - } - } - - ScreenSize OnScrollGetSize(const int32_t scrollIndex) override - { - size_t numItems = _filteredTrackIds.size(); - if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - // Extra item: custom design - numItems++; - } - int32_t scrollHeight = static_cast(numItems * SCROLLABLE_ROW_HEIGHT); - - return { width, scrollHeight }; - } - - void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (!_selectedItemIsBeingUpdated) - { - int32_t i = GetListItemFromPosition(screenCoords); - if (i != -1) + // Ensure that the selected item is still in the list. + if (static_cast(selected_list_item) >= _filteredTrackIds.size()) { - SelectFromList(i); + selected_list_item = 0; } } - } - void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override - { - if (!_selectedItemIsBeingUpdated) + void SelectFromList(int32_t listIndex) { - int32_t i = GetListItemFromPosition(screenCoords); - if (i != -1 && selected_list_item != i) + OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::Click1, 0, this->windowPos.x + (this->width / 2)); + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { - selected_list_item = i; - Invalidate(); + if (listIndex == 0) + { + Close(); + RideConstructNew(_window_track_list_item); + return; + } + listIndex--; } - } - } - void OnTextInput(const WidgetIndex widgetIndex, std::string_view text) override - { - if (widgetIndex != WIDX_FILTER_STRING) - return; - - if (String::Equals(_filterString, std::string(text).c_str())) - return; - - String::Set(_filterString, sizeof(_filterString), std::string(text).c_str()); - - FilterList(); - - scrolls->v_top = 0; - - Invalidate(); - } - - void OnPrepareDraw() override - { - StringId stringId = STR_NONE; - const auto* entry = GetRideEntryByIndex(_window_track_list_item.EntryIndex); - - if (entry != nullptr) - { - RideNaming rideName = GetRideNaming(_window_track_list_item.Type, *entry); - stringId = rideName.Name; - } - - Formatter::Common().Add(stringId); - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS; - widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_RENAME_OR_DELETE_IT; - } - else - { - widgets[WIDX_TITLE].text = STR_SELECT_DESIGN; - widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP; - } - - if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) || selected_list_item != 0) - { - pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; - disabled_widgets &= ~(1uLL << WIDX_TRACK_PREVIEW); - widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; - widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::FlatBtn; - if (gTrackDesignSceneryToggle) + // Displays a message if the ride can't load, fix #4080 + if (_loadedTrackDesign == nullptr) { - pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); + ContextShowError(STR_CANT_BUILD_THIS_HERE, STR_TRACK_LOAD_FAILED_ERROR, {}); + return; + } + + if (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) + { + gTrackDesignSceneryToggle = true; + } + + uint16_t trackDesignIndex = _filteredTrackIds[listIndex]; + TrackDesignFileRef* tdRef = &_trackDesigns[trackDesignIndex]; + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + auto intent = Intent(WindowClass::ManageTrackDesign); + intent.PutExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); + ContextOpenIntent(&intent); } else { - pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); + if (_loadedTrackDesignIndex != TRACK_DESIGN_INDEX_UNLOADED + && (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE)) + { + ContextShowError(STR_THIS_DESIGN_WILL_BE_BUILT_WITH_AN_ALTERNATIVE_VEHICLE_TYPE, STR_NONE, {}); + } + + auto intent = Intent(WindowClass::TrackDesignPlace); + intent.PutExtra(INTENT_EXTRA_TRACK_DESIGN, tdRef); + ContextOpenIntent(&intent); } } - else + + int32_t GetListItemFromPosition(const ScreenCoordsXY& screenCoords) { - pressed_widgets &= ~(1uLL << WIDX_TRACK_PREVIEW); - disabled_widgets |= (1uLL << WIDX_TRACK_PREVIEW); - widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; - widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::Empty; + size_t maxItems = _filteredTrackIds.size(); + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + // Extra item: custom design + maxItems++; + } + + int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT; + if (index < 0 || static_cast(index) >= maxItems) + { + index = -1; + } + return index; } - // When debugging tools are on, shift everything up a bit to make room for displaying the path. - const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? (WINDOW_PADDING + DEBUG_PATH_HEIGHT) : WINDOW_PADDING; - widgets[WIDX_TRACK_LIST].bottom = height - bottomMargin; - widgets[WIDX_ROTATE].bottom = height - bottomMargin; - widgets[WIDX_ROTATE].top = widgets[WIDX_ROTATE].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE; - widgets[WIDX_TOGGLE_SCENERY].bottom = widgets[WIDX_ROTATE].top; - widgets[WIDX_TOGGLE_SCENERY].top = widgets[WIDX_TOGGLE_SCENERY].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE; - } - - void OnUpdate() override - { - if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) + void LoadDesignsList(RideSelection item) { - WindowUpdateTextboxCaret(); - WidgetInvalidate(*this, WIDX_FILTER_STRING); // TODO Check this + auto repo = OpenRCT2::GetContext()->GetTrackDesignRepository(); + std::string entryName; + if (item.Type < 0x80) + { + if (GetRideTypeDescriptor(item.Type).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY)) + { + entryName = GetRideEntryName(item.EntryIndex); + } + } + _trackDesigns = repo->GetItemsForObjectEntry(item.Type, entryName); + + FilterList(); } - if (_reloadTrackDesigns) + bool LoadDesignPreview(const u8string& path) + { + _loadedTrackDesign = TrackDesignImport(path.c_str()); + if (_loadedTrackDesign != nullptr) + { + TrackDesignDrawPreview(_loadedTrackDesign.get(), _trackDesignPreviewPixels.data()); + return true; + } + return false; + } + + public: + TrackListWindow(const RideSelection item) + { + _window_track_list_item = item; + } + + void OnOpen() override { LoadDesignsList(_window_track_list_item); - selected_list_item = 0; - Invalidate(); - _reloadTrackDesigns = false; - } - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); + String::Set(_filterString, sizeof(_filterString), ""); + _trackListWidgets[WIDX_FILTER_STRING].string = _filterString; + widgets = _trackListWidgets; - int32_t listItemIndex = selected_list_item; - if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) == 0) - { - // Because the first item in the list is "Build a custom design", lower the index by one - listItemIndex--; - } - - if (_filteredTrackIds.empty() || listItemIndex == -1) - return; - - int32_t trackIndex = _filteredTrackIds[listItemIndex]; - - // Track preview - auto& tdWidget = widgets[WIDX_TRACK_PREVIEW]; - int32_t colour = ColourMapA[colours[0]].darkest; - u8string path = _trackDesigns[trackIndex].path; - - // Show track file path (in debug mode) - if (gConfigGeneral.DebuggingTools) - { - const auto shortPath = ShortenPath(path, width, FontStyle::Medium); - auto ft = Formatter(); - ft.Add(shortPath.c_str()); - DrawTextBasic( - dpi, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft, - { colours[1] }); // TODO Check dpi - } - - auto screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.top + 1 }; - GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi - - if (_loadedTrackDesignIndex != trackIndex) - { - if (LoadDesignPreview(path)) + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) { - _loadedTrackDesignIndex = trackIndex; + widgets[WIDX_BACK].type = WindowWidgetType::Empty; } else { - _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; + widgets[WIDX_BACK].type = WindowWidgetType::TableHeader; + } + + WindowInitScrollWidgets(*this); + _selectedItemIsBeingUpdated = false; + _reloadTrackDesigns = false; + // Start with first track highlighted + selected_list_item = 0; + if (_trackDesigns.size() != 0 && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + selected_list_item = 1; + } + gTrackDesignSceneryToggle = false; + WindowPushOthersRight(*this); + _currentTrackPieceDirection = 2; + _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); + + _loadedTrackDesign = nullptr; + _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; + } + + void OnClose() override + { + // Dispose track design and preview + _loadedTrackDesign = nullptr; + _trackDesignPreviewPixels.clear(); + _trackDesignPreviewPixels.shrink_to_fit(); + + // Dispose track list + _trackDesigns.clear(); + + // If gScreenAge is zero, we're already in the process + // of loading the track manager, so we shouldn't try + // to do it again. Otherwise, this window will get + // another close signal from the track manager load function, + // 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); + Editor::LoadTrackManager(); } } - if (!_loadedTrackDesign) + void OnMouseUp(const WidgetIndex widgetIndex) override { - return; - } - - auto trackPreview = screenPos; - screenPos = windowPos + ScreenCoordsXY{ tdWidget.midX(), tdWidget.midY() }; - - G1Element g1temp = {}; - g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); - g1temp.width = 370; - g1temp.height = 217; - g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; - GfxSetG1Element(SPR_TEMP, &g1temp); - DrawingEngineInvalidateImage(SPR_TEMP); - GfxDrawSprite(dpi, ImageId(SPR_TEMP), trackPreview); - - screenPos.y = windowPos.y + tdWidget.bottom - 12; - - // Warnings - if ((_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE) - && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) - { - // Vehicle design not available - DrawTextEllipsised(dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE }); - screenPos.y -= SCROLLABLE_ROW_HEIGHT; - } - - if (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) - { - if (!gTrackDesignSceneryToggle) + switch (widgetIndex) { - // Scenery not available - DrawTextEllipsised( - dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); - screenPos.y -= SCROLLABLE_ROW_HEIGHT; + case WIDX_CLOSE: + Close(); + break; + case WIDX_ROTATE: + _currentTrackPieceDirection++; + _currentTrackPieceDirection %= 4; + Invalidate(); + break; + case WIDX_TOGGLE_SCENERY: + gTrackDesignSceneryToggle = !gTrackDesignSceneryToggle; + _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; + Invalidate(); + break; + case WIDX_BACK: + Close(); + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + ContextOpenWindow(WindowClass::ConstructRide); + } + break; + case WIDX_FILTER_STRING: + WindowStartTextbox( + *this, widgetIndex, STR_STRING, _filterString, sizeof(_filterString)); // TODO check this out + break; + case WIDX_FILTER_CLEAR: + // Keep the highlighted item selected + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + if (selected_list_item != -1 && _filteredTrackIds.size() > static_cast(selected_list_item)) + selected_list_item = _filteredTrackIds[selected_list_item]; + else + selected_list_item = -1; + } + else + { + if (selected_list_item != 0) + selected_list_item = _filteredTrackIds[selected_list_item - 1] + 1; + } + + String::Set(_filterString, sizeof(_filterString), ""); + FilterList(); + Invalidate(); + break; } } - // Track design name - auto ft = Formatter(); - ft.Add(_trackDesigns[trackIndex].name.c_str()); - DrawTextEllipsised(dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE }); - - // Information - screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.bottom + 2 }; - - // Stats - ft = Formatter(); - ft.Add(_loadedTrackDesign->excitement * 10); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(_loadedTrackDesign->intensity * 10); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT; - - ft = Formatter(); - ft.Add(_loadedTrackDesign->nausea * 10); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); - screenPos.y += LIST_ROW_HEIGHT + 4; - - // Information for tracked rides. - if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + ScreenSize OnScrollGetSize(const int32_t scrollIndex) override { - const auto& rtd = GetRideTypeDescriptor(_loadedTrackDesign->type); - if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + size_t numItems = _filteredTrackIds.size(); + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) { - if (_loadedTrackDesign->type == RIDE_TYPE_MINI_GOLF) + // Extra item: custom design + numItems++; + } + int32_t scrollHeight = static_cast(numItems * SCROLLABLE_ROW_HEIGHT); + + return { width, scrollHeight }; + } + + void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (!_selectedItemIsBeingUpdated) + { + int32_t i = GetListItemFromPosition(screenCoords); + if (i != -1) { - // Holes - ft = Formatter(); - ft.Add(_loadedTrackDesign->holes & 0x1F); - DrawTextBasic(dpi, screenPos, STR_HOLES, ft); - screenPos.y += LIST_ROW_HEIGHT; + SelectFromList(i); + } + } + } + + void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override + { + if (!_selectedItemIsBeingUpdated) + { + int32_t i = GetListItemFromPosition(screenCoords); + if (i != -1 && selected_list_item != i) + { + selected_list_item = i; + Invalidate(); + } + } + } + + void OnTextInput(const WidgetIndex widgetIndex, std::string_view text) override + { + if (widgetIndex != WIDX_FILTER_STRING) + return; + + if (String::Equals(_filterString, std::string(text).c_str())) + return; + + String::Set(_filterString, sizeof(_filterString), std::string(text).c_str()); + + FilterList(); + + scrolls->v_top = 0; + + Invalidate(); + } + + void OnPrepareDraw() override + { + StringId stringId = STR_NONE; + const auto* entry = GetRideEntryByIndex(_window_track_list_item.EntryIndex); + + if (entry != nullptr) + { + RideNaming rideName = GetRideNaming(_window_track_list_item.Type, *entry); + stringId = rideName.Name; + } + + Formatter::Common().Add(stringId); + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + widgets[WIDX_TITLE].text = STR_TRACK_DESIGNS; + widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_RENAME_OR_DELETE_IT; + } + else + { + widgets[WIDX_TITLE].text = STR_SELECT_DESIGN; + widgets[WIDX_TRACK_LIST].tooltip = STR_CLICK_ON_DESIGN_TO_BUILD_IT_TIP; + } + + if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) || selected_list_item != 0) + { + pressed_widgets |= 1uLL << WIDX_TRACK_PREVIEW; + disabled_widgets &= ~(1uLL << WIDX_TRACK_PREVIEW); + widgets[WIDX_ROTATE].type = WindowWidgetType::FlatBtn; + widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::FlatBtn; + if (gTrackDesignSceneryToggle) + { + pressed_widgets &= ~(1uLL << WIDX_TOGGLE_SCENERY); } else { - // Maximum speed - ft = Formatter(); - ft.Add(((_loadedTrackDesign->max_speed << 16) * 9) >> 18); - DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; - - // Average speed - ft = Formatter(); - ft.Add(((_loadedTrackDesign->average_speed << 16) * 9) >> 18); - DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); - screenPos.y += LIST_ROW_HEIGHT; + pressed_widgets |= (1uLL << WIDX_TOGGLE_SCENERY); } - - // Ride length - ft = Formatter(); - ft.Add(STR_RIDE_LENGTH_ENTRY); - ft.Add(_loadedTrackDesign->ride_length); - DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) - { - // Maximum positive vertical Gs - ft = Formatter(); - ft.Add(_loadedTrackDesign->max_positive_vertical_g * 32); - DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - - // Maximum negative vertical Gs - ft = Formatter(); - ft.Add(_loadedTrackDesign->max_negative_vertical_g * 32); - DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - - // Maximum lateral Gs - ft = Formatter(); - ft.Add(_loadedTrackDesign->max_lateral_g * 32); - DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); - screenPos.y += LIST_ROW_HEIGHT; - - if (_loadedTrackDesign->total_air_time != 0) - { - // Total air time - ft = Formatter(); - ft.Add(_loadedTrackDesign->total_air_time * 25); - DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - } - - if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) - { - // Drops - ft = Formatter(); - ft.Add(_loadedTrackDesign->drops & 0x3F); - DrawTextBasic(dpi, screenPos, STR_DROPS, ft); - screenPos.y += LIST_ROW_HEIGHT; - - // Drop height is multiplied by 0.75 - ft = Formatter(); - ft.Add((_loadedTrackDesign->highest_drop_height * 3) / 4); - DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (_loadedTrackDesign->type != RIDE_TYPE_MINI_GOLF) - { - uint16_t inversions = _loadedTrackDesign->inversions & 0x1F; - if (inversions != 0) - { - ft = Formatter(); - ft.Add(inversions); - // Inversions - DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - } - screenPos.y += 4; - } - - if (_loadedTrackDesign->space_required_x != 0xFF) - { - // Space required - ft = Formatter(); - ft.Add(_loadedTrackDesign->space_required_x); - ft.Add(_loadedTrackDesign->space_required_y); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); - screenPos.y += LIST_ROW_HEIGHT; - } - - if (_loadedTrackDesign->cost != 0) - { - ft = Formatter(); - ft.Add(_loadedTrackDesign->cost); - DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); - } - } - - void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override - { - uint8_t paletteIndex = ColourMapA[colours[0]].mid_light; - GfxClear(&dpi, paletteIndex); - - auto screenCoords = ScreenCoordsXY{ 0, 0 }; - size_t listIndex = 0; - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - if (_trackDesigns.empty()) - { - // No track designs - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE); - return; - } - } - else - { - // Build custom track item - StringId stringId; - if (listIndex == static_cast(selected_list_item)) - { - // Highlight - GfxFilterRect( - dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }, - FilterPaletteID::PaletteDarken1); - stringId = STR_WINDOW_COLOUR_2_STRINGID; } else { - stringId = STR_BLACK_STRING; + pressed_widgets &= ~(1uLL << WIDX_TRACK_PREVIEW); + disabled_widgets |= (1uLL << WIDX_TRACK_PREVIEW); + widgets[WIDX_ROTATE].type = WindowWidgetType::Empty; + widgets[WIDX_TOGGLE_SCENERY].type = WindowWidgetType::Empty; } - auto ft = Formatter(); - ft.Add(STR_BUILD_CUSTOM_DESIGN); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); - screenCoords.y += SCROLLABLE_ROW_HEIGHT; - listIndex++; + // When debugging tools are on, shift everything up a bit to make room for displaying the path. + const int32_t bottomMargin = gConfigGeneral.DebuggingTools ? (WINDOW_PADDING + DEBUG_PATH_HEIGHT) : WINDOW_PADDING; + widgets[WIDX_TRACK_LIST].bottom = height - bottomMargin; + widgets[WIDX_ROTATE].bottom = height - bottomMargin; + widgets[WIDX_ROTATE].top = widgets[WIDX_ROTATE].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE; + widgets[WIDX_TOGGLE_SCENERY].bottom = widgets[WIDX_ROTATE].top; + widgets[WIDX_TOGGLE_SCENERY].top = widgets[WIDX_TOGGLE_SCENERY].bottom - ROTATE_AND_SCENERY_BUTTON_SIZE; } - for (auto i : _filteredTrackIds) + void OnUpdate() override { - if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y < dpi.y + dpi.height) + if (gCurrentTextBox.window.classification == classification && gCurrentTextBox.window.number == number) { + WindowUpdateTextboxCaret(); + WidgetInvalidate(*this, WIDX_FILTER_STRING); // TODO Check this + } + + if (_reloadTrackDesigns) + { + LoadDesignsList(_window_track_list_item); + selected_list_item = 0; + Invalidate(); + _reloadTrackDesigns = false; + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + + int32_t listItemIndex = selected_list_item; + if ((gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) == 0) + { + // Because the first item in the list is "Build a custom design", lower the index by one + listItemIndex--; + } + + if (_filteredTrackIds.empty() || listItemIndex == -1) + return; + + int32_t trackIndex = _filteredTrackIds[listItemIndex]; + + // Track preview + auto& tdWidget = widgets[WIDX_TRACK_PREVIEW]; + int32_t colour = ColourMapA[colours[0]].darkest; + u8string path = _trackDesigns[trackIndex].path; + + // Show track file path (in debug mode) + if (gConfigGeneral.DebuggingTools) + { + const auto shortPath = ShortenPath(path, width, FontStyle::Medium); + auto ft = Formatter(); + ft.Add(shortPath.c_str()); + DrawTextBasic( + dpi, windowPos + ScreenCoordsXY{ 0, height - DEBUG_PATH_HEIGHT - 3 }, STR_STRING, ft, + { colours[1] }); // TODO Check dpi + } + + auto screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.top + 1 }; + GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); // TODO Check dpi + + if (_loadedTrackDesignIndex != trackIndex) + { + if (LoadDesignPreview(path)) + { + _loadedTrackDesignIndex = trackIndex; + } + else + { + _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; + } + } + + if (!_loadedTrackDesign) + { + return; + } + + auto trackPreview = screenPos; + screenPos = windowPos + ScreenCoordsXY{ tdWidget.midX(), tdWidget.midY() }; + + G1Element g1temp = {}; + g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); + g1temp.width = 370; + g1temp.height = 217; + g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; + GfxSetG1Element(SPR_TEMP, &g1temp); + DrawingEngineInvalidateImage(SPR_TEMP); + GfxDrawSprite(dpi, ImageId(SPR_TEMP), trackPreview); + + screenPos.y = windowPos.y + tdWidget.bottom - 12; + + // Warnings + if ((_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_VEHICLE_UNAVAILABLE) + && !(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER)) + { + // Vehicle design not available + DrawTextEllipsised(dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + screenPos.y -= SCROLLABLE_ROW_HEIGHT; + } + + if (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE) + { + if (!gTrackDesignSceneryToggle) + { + // Scenery not available + DrawTextEllipsised( + dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE }); + screenPos.y -= SCROLLABLE_ROW_HEIGHT; + } + } + + // Track design name + auto ft = Formatter(); + ft.Add(_trackDesigns[trackIndex].name.c_str()); + DrawTextEllipsised(dpi, screenPos, 368, STR_TRACK_PREVIEW_NAME_FORMAT, ft, { TextAlignment::CENTRE }); + + // Information + screenPos = windowPos + ScreenCoordsXY{ tdWidget.left + 1, tdWidget.bottom + 2 }; + + // Stats + ft = Formatter(); + ft.Add(_loadedTrackDesign->excitement * 10); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_EXCITEMENT_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(_loadedTrackDesign->intensity * 10); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_INTENSITY_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT; + + ft = Formatter(); + ft.Add(_loadedTrackDesign->nausea * 10); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_NAUSEA_RATING, ft); + screenPos.y += LIST_ROW_HEIGHT + 4; + + // Information for tracked rides. + if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_TRACK)) + { + const auto& rtd = GetRideTypeDescriptor(_loadedTrackDesign->type); + if (!rtd.HasFlag(RIDE_TYPE_FLAG_IS_MAZE)) + { + if (_loadedTrackDesign->type == RIDE_TYPE_MINI_GOLF) + { + // Holes + ft = Formatter(); + ft.Add(_loadedTrackDesign->holes & 0x1F); + DrawTextBasic(dpi, screenPos, STR_HOLES, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + else + { + // Maximum speed + ft = Formatter(); + ft.Add(((_loadedTrackDesign->max_speed << 16) * 9) >> 18); + DrawTextBasic(dpi, screenPos, STR_MAX_SPEED, ft); + screenPos.y += LIST_ROW_HEIGHT; + + // Average speed + ft = Formatter(); + ft.Add(((_loadedTrackDesign->average_speed << 16) * 9) >> 18); + DrawTextBasic(dpi, screenPos, STR_AVERAGE_SPEED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + // Ride length + ft = Formatter(); + ft.Add(STR_RIDE_LENGTH_ENTRY); + ft.Add(_loadedTrackDesign->ride_length); + DrawTextEllipsised(dpi, screenPos, 214, STR_TRACK_LIST_RIDE_LENGTH, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_G_FORCES)) + { + // Maximum positive vertical Gs + ft = Formatter(); + ft.Add(_loadedTrackDesign->max_positive_vertical_g * 32); + DrawTextBasic(dpi, screenPos, STR_MAX_POSITIVE_VERTICAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + + // Maximum negative vertical Gs + ft = Formatter(); + ft.Add(_loadedTrackDesign->max_negative_vertical_g * 32); + DrawTextBasic(dpi, screenPos, STR_MAX_NEGATIVE_VERTICAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + + // Maximum lateral Gs + ft = Formatter(); + ft.Add(_loadedTrackDesign->max_lateral_g * 32); + DrawTextBasic(dpi, screenPos, STR_MAX_LATERAL_G, ft); + screenPos.y += LIST_ROW_HEIGHT; + + if (_loadedTrackDesign->total_air_time != 0) + { + // Total air time + ft = Formatter(); + ft.Add(_loadedTrackDesign->total_air_time * 25); + DrawTextBasic(dpi, screenPos, STR_TOTAL_AIR_TIME, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + + if (GetRideTypeDescriptor(_loadedTrackDesign->type).HasFlag(RIDE_TYPE_FLAG_HAS_DROPS)) + { + // Drops + ft = Formatter(); + ft.Add(_loadedTrackDesign->drops & 0x3F); + DrawTextBasic(dpi, screenPos, STR_DROPS, ft); + screenPos.y += LIST_ROW_HEIGHT; + + // Drop height is multiplied by 0.75 + ft = Formatter(); + ft.Add((_loadedTrackDesign->highest_drop_height * 3) / 4); + DrawTextBasic(dpi, screenPos, STR_HIGHEST_DROP_HEIGHT, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (_loadedTrackDesign->type != RIDE_TYPE_MINI_GOLF) + { + uint16_t inversions = _loadedTrackDesign->inversions & 0x1F; + if (inversions != 0) + { + ft = Formatter(); + ft.Add(inversions); + // Inversions + DrawTextBasic(dpi, screenPos, STR_INVERSIONS, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + } + screenPos.y += 4; + } + + if (_loadedTrackDesign->space_required_x != 0xFF) + { + // Space required + ft = Formatter(); + ft.Add(_loadedTrackDesign->space_required_x); + ft.Add(_loadedTrackDesign->space_required_y); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_SPACE_REQUIRED, ft); + screenPos.y += LIST_ROW_HEIGHT; + } + + if (_loadedTrackDesign->cost != 0) + { + ft = Formatter(); + ft.Add(_loadedTrackDesign->cost); + DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft); + } + } + + void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override + { + uint8_t paletteIndex = ColourMapA[colours[0]].mid_light; + GfxClear(&dpi, paletteIndex); + + auto screenCoords = ScreenCoordsXY{ 0, 0 }; + size_t listIndex = 0; + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + if (_trackDesigns.empty()) + { + // No track designs + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, STR_NO_TRACK_DESIGNS_OF_THIS_TYPE); + return; + } + } + else + { + // Build custom track item StringId stringId; if (listIndex == static_cast(selected_list_item)) { @@ -729,65 +707,91 @@ public: stringId = STR_BLACK_STRING; } - // Draw track name auto ft = Formatter(); - ft.Add(STR_TRACK_LIST_NAME_FORMAT); - ft.Add(_trackDesigns[i].name.c_str()); + ft.Add(STR_BUILD_CUSTOM_DESIGN); DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + listIndex++; } - screenCoords.y += SCROLLABLE_ROW_HEIGHT; - listIndex++; + for (auto i : _filteredTrackIds) + { + if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y < dpi.y + dpi.height) + { + StringId stringId; + if (listIndex == static_cast(selected_list_item)) + { + // Highlight + GfxFilterRect( + dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } }, + FilterPaletteID::PaletteDarken1); + stringId = STR_WINDOW_COLOUR_2_STRINGID; + } + else + { + stringId = STR_BLACK_STRING; + } + + // Draw track name + auto ft = Formatter(); + ft.Add(STR_TRACK_LIST_NAME_FORMAT); + ft.Add(_trackDesigns[i].name.c_str()); + DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft); + } + + screenCoords.y += SCROLLABLE_ROW_HEIGHT; + listIndex++; + } + } + + void OnResize() override + { + ResizeFrame(); + } + + void SetIsBeingUpdated(const bool beingUpdated) + { + _selectedItemIsBeingUpdated = beingUpdated; + } + + void ReloadTrackDesigns() + { + _reloadTrackDesigns = true; + } + }; + + WindowBase* WindowTrackListOpen(const RideSelection item) + { + WindowCloseConstructionWindows(); + ScreenCoordsXY screenPos{}; + if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) + { + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + screenPos = { screenWidth / 2 - 300, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; + } + else + { + screenPos = { 0, TOP_TOOLBAR_HEIGHT + 2 }; + } + return WindowCreate(WindowClass::TrackDesignList, WW, WH, 0, item); + } + + void WindowTrackDesignListReloadTracks() + { + auto* trackListWindow = static_cast(WindowFindByClass(WindowClass::TrackDesignList)); + if (trackListWindow != nullptr) + { + trackListWindow->ReloadTrackDesigns(); } } - void OnResize() override + void WindowTrackDesignListSetBeingUpdated(const bool beingUpdated) { - ResizeFrame(); + auto* trackListWindow = static_cast(WindowFindByClass(WindowClass::TrackDesignList)); + if (trackListWindow != nullptr) + { + trackListWindow->SetIsBeingUpdated(beingUpdated); + } } - - void SetIsBeingUpdated(const bool beingUpdated) - { - _selectedItemIsBeingUpdated = beingUpdated; - } - - void ReloadTrackDesigns() - { - _reloadTrackDesigns = true; - } -}; - -WindowBase* WindowTrackListOpen(const RideSelection item) -{ - WindowCloseConstructionWindows(); - ScreenCoordsXY screenPos{}; - if (gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) - { - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - screenPos = { screenWidth / 2 - 300, std::max(TOP_TOOLBAR_HEIGHT + 1, screenHeight / 2 - 200) }; - } - else - { - screenPos = { 0, TOP_TOOLBAR_HEIGHT + 2 }; - } - return WindowCreate(WindowClass::TrackDesignList, WW, WH, 0, item); -} - -void WindowTrackDesignListReloadTracks() -{ - auto* trackListWindow = static_cast(WindowFindByClass(WindowClass::TrackDesignList)); - if (trackListWindow != nullptr) - { - trackListWindow->ReloadTrackDesigns(); - } -} - -void WindowTrackDesignListSetBeingUpdated(const bool beingUpdated) -{ - auto* trackListWindow = static_cast(WindowFindByClass(WindowClass::TrackDesignList)); - if (trackListWindow != nullptr) - { - trackListWindow->SetIsBeingUpdated(beingUpdated); - } -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 76e158d4f6..823e53ddb3 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -30,9 +30,9 @@ #include #include -using namespace OpenRCT2; - -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WINDOW_TRANSPARENCY_WIDGET_IDX { WIDX_BACKGROUND, @@ -87,176 +87,177 @@ static Widget _transparancyWidgets[] = { kWidgetsEnd }, }; -// clang-format on + // clang-format on -class TransparencyWindow final : public Window -{ -private: -public: - void OnOpen() override + class TransparencyWindow final : public Window { - widgets = _transparancyWidgets; - WindowPushOthersBelow(*this); - - auto* w = WindowGetMain(); - if (w != nullptr) - windowPos.x = ((w->width / 2) - (width / 2)); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + private: + public: + void OnOpen() override { - case WIDX_CLOSE: - Close(); - break; - default: - ToggleViewportFlag(widgetIndex); - break; + widgets = _transparancyWidgets; + WindowPushOthersBelow(*this); + + auto* w = WindowGetMain(); + if (w != nullptr) + windowPos.x = ((w->width / 2) - (width / 2)); } - } - void OnPrepareDraw() override - { - uint32_t wflags = 0; - WindowBase* w = WindowGetMain(); + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + default: + ToggleViewportFlag(widgetIndex); + break; + } + } - pressed_widgets = 0; - disabled_widgets = 0; + void OnPrepareDraw() override + { + uint32_t wflags = 0; + WindowBase* w = WindowGetMain(); + + pressed_widgets = 0; + disabled_widgets = 0; + + if (w != nullptr) + wflags = w->viewport->flags; + + SetWidgetPressed(WIDX_HIDE_VEGETATION, (wflags & VIEWPORT_FLAG_HIDE_VEGETATION)); + SetWidgetPressed(WIDX_HIDE_SCENERY, (wflags & VIEWPORT_FLAG_HIDE_SCENERY)); + SetWidgetPressed(WIDX_HIDE_PATHS, (wflags & VIEWPORT_FLAG_HIDE_PATHS)); + SetWidgetPressed(WIDX_HIDE_RIDES, (wflags & VIEWPORT_FLAG_HIDE_RIDES)); + SetWidgetPressed(WIDX_HIDE_VEHICLES, (wflags & VIEWPORT_FLAG_HIDE_VEHICLES)); + SetWidgetPressed(WIDX_HIDE_SUPPORTS, (wflags & VIEWPORT_FLAG_HIDE_SUPPORTS)); + SetWidgetPressed(WIDX_HIDE_GUESTS, (wflags & VIEWPORT_FLAG_HIDE_GUESTS)); + SetWidgetPressed(WIDX_HIDE_STAFF, (wflags & VIEWPORT_FLAG_HIDE_STAFF)); + SetWidgetPressed(WIDX_INVISIBLE_VEGETATION, (wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION)); + SetWidgetPressed(WIDX_INVISIBLE_SCENERY, (wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY)); + SetWidgetPressed(WIDX_INVISIBLE_PATHS, (wflags & VIEWPORT_FLAG_INVISIBLE_PATHS)); + SetWidgetPressed(WIDX_INVISIBLE_RIDES, (wflags & VIEWPORT_FLAG_INVISIBLE_RIDES)); + SetWidgetPressed(WIDX_INVISIBLE_VEHICLES, (wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES)); + SetWidgetPressed(WIDX_INVISIBLE_SUPPORTS, (wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS)); + + for (WidgetIndex i = WIDX_INVISIBLE_VEGETATION; i <= WIDX_INVISIBLE_SUPPORTS; i++) + { + widgets[i].image = ImageId(IsWidgetPressed(i) ? SPR_G2_BUTTON_HIDE_FULL : SPR_G2_BUTTON_HIDE_PARTIAL); + } + } + + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); + // Locate mechanic button image + const auto& widget = widgets[WIDX_HIDE_STAFF]; + auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; + auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, GetGameState().StaffMechanicColour); + GfxDrawSprite(dpi, image, screenCoords); + } + + private: + uint32_t ToggleTransparency(uint32_t wflags, uint32_t transparencyFlag, uint32_t seeThroughFlag) + { + wflags ^= transparencyFlag; + if (wflags & transparencyFlag) + { + wflags |= seeThroughFlag; + } + SaveInConfig(wflags); + return wflags; + } + + void ToggleViewportFlag(WidgetIndex widgetIndex) + { + uint32_t wflags = 0; + WindowBase* w = WindowGetMain(); + + if (w == nullptr) + return; - if (w != nullptr) wflags = w->viewport->flags; - SetWidgetPressed(WIDX_HIDE_VEGETATION, (wflags & VIEWPORT_FLAG_HIDE_VEGETATION)); - SetWidgetPressed(WIDX_HIDE_SCENERY, (wflags & VIEWPORT_FLAG_HIDE_SCENERY)); - SetWidgetPressed(WIDX_HIDE_PATHS, (wflags & VIEWPORT_FLAG_HIDE_PATHS)); - SetWidgetPressed(WIDX_HIDE_RIDES, (wflags & VIEWPORT_FLAG_HIDE_RIDES)); - SetWidgetPressed(WIDX_HIDE_VEHICLES, (wflags & VIEWPORT_FLAG_HIDE_VEHICLES)); - SetWidgetPressed(WIDX_HIDE_SUPPORTS, (wflags & VIEWPORT_FLAG_HIDE_SUPPORTS)); - SetWidgetPressed(WIDX_HIDE_GUESTS, (wflags & VIEWPORT_FLAG_HIDE_GUESTS)); - SetWidgetPressed(WIDX_HIDE_STAFF, (wflags & VIEWPORT_FLAG_HIDE_STAFF)); - SetWidgetPressed(WIDX_INVISIBLE_VEGETATION, (wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION)); - SetWidgetPressed(WIDX_INVISIBLE_SCENERY, (wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY)); - SetWidgetPressed(WIDX_INVISIBLE_PATHS, (wflags & VIEWPORT_FLAG_INVISIBLE_PATHS)); - SetWidgetPressed(WIDX_INVISIBLE_RIDES, (wflags & VIEWPORT_FLAG_INVISIBLE_RIDES)); - SetWidgetPressed(WIDX_INVISIBLE_VEHICLES, (wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES)); - SetWidgetPressed(WIDX_INVISIBLE_SUPPORTS, (wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS)); + switch (widgetIndex) + { + case WIDX_HIDE_RIDES: + wflags ^= VIEWPORT_FLAG_HIDE_RIDES; + break; + case WIDX_HIDE_VEHICLES: + wflags ^= VIEWPORT_FLAG_HIDE_VEHICLES; + break; + case WIDX_HIDE_SCENERY: + wflags ^= VIEWPORT_FLAG_HIDE_SCENERY; + break; + case WIDX_HIDE_VEGETATION: + wflags ^= VIEWPORT_FLAG_HIDE_VEGETATION; + break; + case WIDX_HIDE_PATHS: + wflags ^= VIEWPORT_FLAG_HIDE_PATHS; + break; + case WIDX_HIDE_SUPPORTS: + wflags ^= VIEWPORT_FLAG_HIDE_SUPPORTS; + break; + case WIDX_INVISIBLE_RIDES: + wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_RIDES, VIEWPORT_FLAG_HIDE_RIDES); + break; + case WIDX_INVISIBLE_VEHICLES: + wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_VEHICLES, VIEWPORT_FLAG_HIDE_VEHICLES); + break; + case WIDX_INVISIBLE_SCENERY: + wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_SCENERY, VIEWPORT_FLAG_HIDE_SCENERY); + break; + case WIDX_INVISIBLE_VEGETATION: + wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_VEGETATION, VIEWPORT_FLAG_HIDE_VEGETATION); + break; + case WIDX_INVISIBLE_PATHS: + wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_PATHS, VIEWPORT_FLAG_HIDE_PATHS); + break; + case WIDX_INVISIBLE_SUPPORTS: + wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_SUPPORTS, VIEWPORT_FLAG_HIDE_SUPPORTS); + break; + case WIDX_HIDE_GUESTS: + wflags ^= VIEWPORT_FLAG_HIDE_GUESTS; + break; + case WIDX_HIDE_STAFF: + wflags ^= VIEWPORT_FLAG_HIDE_STAFF; + break; + default: + return; + } - for (WidgetIndex i = WIDX_INVISIBLE_VEGETATION; i <= WIDX_INVISIBLE_SUPPORTS; i++) - { - widgets[i].image = ImageId(IsWidgetPressed(i) ? SPR_G2_BUTTON_HIDE_FULL : SPR_G2_BUTTON_HIDE_PARTIAL); - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); - // Locate mechanic button image - const auto& widget = widgets[WIDX_HIDE_STAFF]; - auto screenCoords = windowPos + ScreenCoordsXY{ widget.left, widget.top }; - auto image = ImageId(SPR_MECHANIC, COLOUR_BLACK, GetGameState().StaffMechanicColour); - GfxDrawSprite(dpi, image, screenCoords); - } - -private: - uint32_t ToggleTransparency(uint32_t wflags, uint32_t transparencyFlag, uint32_t seeThroughFlag) - { - wflags ^= transparencyFlag; - if (wflags & transparencyFlag) - { - wflags |= seeThroughFlag; - } - SaveInConfig(wflags); - return wflags; - } - - void ToggleViewportFlag(WidgetIndex widgetIndex) - { - uint32_t wflags = 0; - WindowBase* w = WindowGetMain(); - - if (w == nullptr) - return; - - wflags = w->viewport->flags; - - switch (widgetIndex) - { - case WIDX_HIDE_RIDES: - wflags ^= VIEWPORT_FLAG_HIDE_RIDES; - break; - case WIDX_HIDE_VEHICLES: - wflags ^= VIEWPORT_FLAG_HIDE_VEHICLES; - break; - case WIDX_HIDE_SCENERY: - wflags ^= VIEWPORT_FLAG_HIDE_SCENERY; - break; - case WIDX_HIDE_VEGETATION: - wflags ^= VIEWPORT_FLAG_HIDE_VEGETATION; - break; - case WIDX_HIDE_PATHS: - wflags ^= VIEWPORT_FLAG_HIDE_PATHS; - break; - case WIDX_HIDE_SUPPORTS: - wflags ^= VIEWPORT_FLAG_HIDE_SUPPORTS; - break; - case WIDX_INVISIBLE_RIDES: - wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_RIDES, VIEWPORT_FLAG_HIDE_RIDES); - break; - case WIDX_INVISIBLE_VEHICLES: - wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_VEHICLES, VIEWPORT_FLAG_HIDE_VEHICLES); - break; - case WIDX_INVISIBLE_SCENERY: - wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_SCENERY, VIEWPORT_FLAG_HIDE_SCENERY); - break; - case WIDX_INVISIBLE_VEGETATION: - wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_VEGETATION, VIEWPORT_FLAG_HIDE_VEGETATION); - break; - case WIDX_INVISIBLE_PATHS: - wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_PATHS, VIEWPORT_FLAG_HIDE_PATHS); - break; - case WIDX_INVISIBLE_SUPPORTS: - wflags = ToggleTransparency(wflags, VIEWPORT_FLAG_INVISIBLE_SUPPORTS, VIEWPORT_FLAG_HIDE_SUPPORTS); - break; - case WIDX_HIDE_GUESTS: - wflags ^= VIEWPORT_FLAG_HIDE_GUESTS; - break; - case WIDX_HIDE_STAFF: - wflags ^= VIEWPORT_FLAG_HIDE_STAFF; - break; - default: + if (w->viewport->flags == wflags) return; + + w->viewport->flags = wflags; + w->Invalidate(); } - if (w->viewport->flags == wflags) - return; + void SaveInConfig(uint32_t wflags) + { + gConfigGeneral.InvisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES; + gConfigGeneral.InvisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES; + gConfigGeneral.InvisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY; + gConfigGeneral.InvisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION; + gConfigGeneral.InvisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS; + gConfigGeneral.InvisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS; + ConfigSaveDefault(); + } - w->viewport->flags = wflags; - w->Invalidate(); - } + void OnResize() override + { + ResizeFrame(); + } + }; - void SaveInConfig(uint32_t wflags) + WindowBase* WindowTransparencyOpen() { - gConfigGeneral.InvisibleRides = wflags & VIEWPORT_FLAG_INVISIBLE_RIDES; - gConfigGeneral.InvisibleVehicles = wflags & VIEWPORT_FLAG_INVISIBLE_VEHICLES; - gConfigGeneral.InvisibleScenery = wflags & VIEWPORT_FLAG_INVISIBLE_SCENERY; - gConfigGeneral.InvisibleTrees = wflags & VIEWPORT_FLAG_INVISIBLE_VEGETATION; - gConfigGeneral.InvisiblePaths = wflags & VIEWPORT_FLAG_INVISIBLE_PATHS; - gConfigGeneral.InvisibleSupports = wflags & VIEWPORT_FLAG_INVISIBLE_SUPPORTS; - ConfigSaveDefault(); + auto* window = WindowBringToFrontByClass(WindowClass::Transparency); + if (window == nullptr) + window = WindowCreate(WindowClass::Transparency, ScreenCoordsXY(32, 32), WW, WH); + + return window; } - - void OnResize() override - { - ResizeFrame(); - } -}; - -WindowBase* WindowTransparencyOpen() -{ - auto* window = WindowBringToFrontByClass(WindowClass::Transparency); - if (window == nullptr) - window = WindowCreate(WindowClass::Transparency, ScreenCoordsXY(32, 32), WW, WH); - - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index c3a7e8513a..cf4815ba61 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -21,7 +21,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowViewClippingWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -63,350 +65,351 @@ static Widget _viewClippingWidgets[] = { #pragma endregion -// clang-format on -class ViewClippingWindow final : public Window -{ -private: - CoordsXY _selectionStart; - CoordsXY _previousClipSelectionA; - CoordsXY _previousClipSelectionB; - bool _toolActive{ false }; - bool _dragging{ false }; - static inline DisplayType _clipHeightDisplayType; - -public: - void OnCloseButton() + // clang-format on + class ViewClippingWindow final : public Window { - OnClose(); - } + private: + CoordsXY _selectionStart; + CoordsXY _previousClipSelectionA; + CoordsXY _previousClipSelectionB; + bool _toolActive{ false }; + bool _dragging{ false }; + static inline DisplayType _clipHeightDisplayType; - void OnMouseUp(WidgetIndex widgetIndex) override - { - // mouseup appears to be used for buttons, checkboxes - switch (widgetIndex) + public: + void OnCloseButton() { - case WIDX_CLOSE: - WindowClose(*this); - break; - case WIDX_CLIP_CHECKBOX_ENABLE: + OnClose(); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + // mouseup appears to be used for buttons, checkboxes + switch (widgetIndex) { - // Toggle height clipping. + case WIDX_CLOSE: + WindowClose(*this); + break; + case WIDX_CLIP_CHECKBOX_ENABLE: + { + // Toggle height clipping. + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + { + mainWindow->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; + mainWindow->Invalidate(); + } + this->Invalidate(); + break; + } + case WIDX_CLIP_HEIGHT_VALUE: + // Toggle display of the cut height value in RAW vs UNITS + if (_clipHeightDisplayType == DisplayType::DisplayRaw) + { + _clipHeightDisplayType = DisplayType::DisplayUnits; + } + else + { + _clipHeightDisplayType = DisplayType::DisplayRaw; + } + this->Invalidate(); + break; + case WIDX_CLIP_SELECTOR: + // Activate the selection tool + ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair); + _toolActive = true; + _dragging = false; + + // Reset clip selection to show all tiles + _previousClipSelectionA = gClipSelectionA; + _previousClipSelectionB = gClipSelectionB; + gClipSelectionA = { 0, 0 }; + gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; + GfxInvalidateScreen(); + break; + case WIDX_CLIP_CLEAR: + if (IsActive()) + { + _toolActive = false; + ToolCancel(); + } + gClipSelectionA = { 0, 0 }; + gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; + GfxInvalidateScreen(); + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + WindowBase* mainWindow; + + switch (widgetIndex) + { + case WIDX_CLIP_HEIGHT_INCREASE: + if (gClipHeight < 255) + SetClipHeight(gClipHeight + 1); + mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + mainWindow->Invalidate(); + break; + case WIDX_CLIP_HEIGHT_DECREASE: + if (gClipHeight > 0) + SetClipHeight(gClipHeight - 1); + mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + mainWindow->Invalidate(); + break; + } + } + + void OnUpdate() override + { + const auto& widget = widgets[WIDX_CLIP_HEIGHT_SLIDER]; + const ScrollBar* const scroll = &this->scrolls[0]; + const int16_t scroll_width = widget.width() - 1; + const uint8_t clip_height = static_cast( + (static_cast(scroll->h_left) / (scroll->h_right - scroll_width)) * 255); + if (clip_height != gClipHeight) + { + gClipHeight = clip_height; + + // Update the main window accordingly. WindowBase* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - mainWindow->viewport->flags ^= VIEWPORT_FLAG_CLIP_VIEW; mainWindow->Invalidate(); } - this->Invalidate(); - break; } - case WIDX_CLIP_HEIGHT_VALUE: - // Toggle display of the cut height value in RAW vs UNITS - if (_clipHeightDisplayType == DisplayType::DisplayRaw) - { - _clipHeightDisplayType = DisplayType::DisplayUnits; - } - else - { - _clipHeightDisplayType = DisplayType::DisplayRaw; - } - this->Invalidate(); - break; - case WIDX_CLIP_SELECTOR: - // Activate the selection tool - ToolSet(*this, WIDX_BACKGROUND, Tool::Crosshair); - _toolActive = true; - _dragging = false; - // Reset clip selection to show all tiles - _previousClipSelectionA = gClipSelectionA; - _previousClipSelectionB = gClipSelectionB; - gClipSelectionA = { 0, 0 }; - gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; - GfxInvalidateScreen(); - break; - case WIDX_CLIP_CLEAR: - if (IsActive()) - { - _toolActive = false; - ToolCancel(); - } - gClipSelectionA = { 0, 0 }; - gClipSelectionB = { MAXIMUM_MAP_SIZE_BIG - 1, MAXIMUM_MAP_SIZE_BIG - 1 }; - GfxInvalidateScreen(); - break; + // Restore previous selection if the tool has been interrupted + if (_toolActive && !IsActive()) + { + _toolActive = false; + gClipSelectionA = _previousClipSelectionA; + gClipSelectionB = _previousClipSelectionB; + } + + WidgetInvalidate(*this, WIDX_CLIP_HEIGHT_SLIDER); } - } - void OnMouseDown(WidgetIndex widgetIndex) override - { - WindowBase* mainWindow; - - switch (widgetIndex) + void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - case WIDX_CLIP_HEIGHT_INCREASE: - if (gClipHeight < 255) - SetClipHeight(gClipHeight + 1); - mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - mainWindow->Invalidate(); - break; - case WIDX_CLIP_HEIGHT_DECREASE: - if (gClipHeight > 0) - SetClipHeight(gClipHeight - 1); - mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - mainWindow->Invalidate(); - break; + if (_dragging) + { + return; + } + + int32_t direction; + auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); + if (mapCoords.has_value()) + { + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + MapInvalidateTileFull(gMapSelectPositionA); + gMapSelectPositionA = gMapSelectPositionB = mapCoords.value(); + MapInvalidateTileFull(mapCoords.value()); + gMapSelectType = MAP_SELECT_TYPE_FULL; + } } - } - void OnUpdate() override - { - const auto& widget = widgets[WIDX_CLIP_HEIGHT_SLIDER]; - const ScrollBar* const scroll = &this->scrolls[0]; - const int16_t scroll_width = widget.width() - 1; - const uint8_t clip_height = static_cast( - (static_cast(scroll->h_left) / (scroll->h_right - scroll_width)) * 255); - if (clip_height != gClipHeight) + void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override { - gClipHeight = clip_height; + int32_t direction; + auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); + if (mapCoords.has_value()) + { + _dragging = true; + _selectionStart = mapCoords.value(); + } + } + + void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override + { + if (!_dragging) + { + return; + } + + int32_t direction; + auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); + if (mapCoords) + { + MapInvalidateSelectionRect(); + gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; + gMapSelectPositionA.x = std::min(_selectionStart.x, mapCoords->x); + gMapSelectPositionB.x = std::max(_selectionStart.x, mapCoords->x); + gMapSelectPositionA.y = std::min(_selectionStart.y, mapCoords->y); + gMapSelectPositionB.y = std::max(_selectionStart.y, mapCoords->y); + gMapSelectType = MAP_SELECT_TYPE_FULL; + MapInvalidateSelectionRect(); + } + } + + void OnToolUp(WidgetIndex, const ScreenCoordsXY&) override + { + gClipSelectionA = gMapSelectPositionA; + gClipSelectionB = gMapSelectPositionB; + _toolActive = false; + ToolCancel(); + GfxInvalidateScreen(); + } + + void OnPrepareDraw() override + { + WidgetScrollUpdateThumbs(*this, WIDX_CLIP_HEIGHT_SLIDER); - // Update the main window accordingly. WindowBase* mainWindow = WindowGetMain(); if (mainWindow != nullptr) { - mainWindow->Invalidate(); + WidgetSetCheckboxValue(*this, WIDX_CLIP_CHECKBOX_ENABLE, mainWindow->viewport->flags & VIEWPORT_FLAG_CLIP_VIEW); + } + + if (IsActive()) + { + this->pressed_widgets |= 1uLL << WIDX_CLIP_SELECTOR; + } + else + { + this->pressed_widgets &= ~(1uLL << WIDX_CLIP_SELECTOR); } } - // Restore previous selection if the tool has been interrupted - if (_toolActive && !IsActive()) + void OnDraw(DrawPixelInfo& dpi) override { - _toolActive = false; - gClipSelectionA = _previousClipSelectionA; - gClipSelectionB = _previousClipSelectionB; - } + WindowDrawWidgets(*this, dpi); - WidgetInvalidate(*this, WIDX_CLIP_HEIGHT_SLIDER); - } + // Clip height value + auto screenCoords = this->windowPos + ScreenCoordsXY{ 8, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; + DrawTextBasic(dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] }); - void OnToolUpdate(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (_dragging) - { - return; - } + screenCoords = this->windowPos + + ScreenCoordsXY{ this->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - int32_t direction; - auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); - if (mapCoords.has_value()) - { - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - MapInvalidateTileFull(gMapSelectPositionA); - gMapSelectPositionA = gMapSelectPositionB = mapCoords.value(); - MapInvalidateTileFull(mapCoords.value()); - gMapSelectType = MAP_SELECT_TYPE_FULL; - } - } - - void OnToolDown(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - int32_t direction; - auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); - if (mapCoords.has_value()) - { - _dragging = true; - _selectionStart = mapCoords.value(); - } - } - - void OnToolDrag(WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords) override - { - if (!_dragging) - { - return; - } - - int32_t direction; - auto mapCoords = ScreenPosToMapPos(screenCoords, &direction); - if (mapCoords) - { - MapInvalidateSelectionRect(); - gMapSelectFlags |= MAP_SELECT_FLAG_ENABLE; - gMapSelectPositionA.x = std::min(_selectionStart.x, mapCoords->x); - gMapSelectPositionB.x = std::max(_selectionStart.x, mapCoords->x); - gMapSelectPositionA.y = std::min(_selectionStart.y, mapCoords->y); - gMapSelectPositionB.y = std::max(_selectionStart.y, mapCoords->y); - gMapSelectType = MAP_SELECT_TYPE_FULL; - MapInvalidateSelectionRect(); - } - } - - void OnToolUp(WidgetIndex, const ScreenCoordsXY&) override - { - gClipSelectionA = gMapSelectPositionA; - gClipSelectionB = gMapSelectPositionB; - _toolActive = false; - ToolCancel(); - GfxInvalidateScreen(); - } - - void OnPrepareDraw() override - { - WidgetScrollUpdateThumbs(*this, WIDX_CLIP_HEIGHT_SLIDER); - - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - { - WidgetSetCheckboxValue(*this, WIDX_CLIP_CHECKBOX_ENABLE, mainWindow->viewport->flags & VIEWPORT_FLAG_CLIP_VIEW); - } - - if (IsActive()) - { - this->pressed_widgets |= 1uLL << WIDX_CLIP_SELECTOR; - } - else - { - this->pressed_widgets &= ~(1uLL << WIDX_CLIP_SELECTOR); - } - } - - void OnDraw(DrawPixelInfo& dpi) override - { - WindowDrawWidgets(*this, dpi); - - // Clip height value - auto screenCoords = this->windowPos + ScreenCoordsXY{ 8, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - DrawTextBasic(dpi, screenCoords, STR_VIEW_CLIPPING_HEIGHT_VALUE, {}, { this->colours[0] }); - - screenCoords = this->windowPos - + ScreenCoordsXY{ this->widgets[WIDX_CLIP_HEIGHT_VALUE].left + 1, this->widgets[WIDX_CLIP_HEIGHT_VALUE].top }; - - switch (_clipHeightDisplayType) - { - case DisplayType::DisplayRaw: - default: + switch (_clipHeightDisplayType) { - auto ft = Formatter(); - ft.Add(static_cast(gClipHeight)); - - // Printing the raw value. - DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); - break; - } - case DisplayType::DisplayUnits: - { - // Print the value in the configured height label type: - if (gConfigGeneral.ShowHeightAsUnits) + case DisplayType::DisplayRaw: + default: { - // Height label is Units. auto ft = Formatter(); - ft.Add(static_cast(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0))); - DrawTextBasic( - dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, - { this->colours[0] }); // Printing the value in Height Units. + ft.Add(static_cast(gClipHeight)); + + // Printing the raw value. + DrawTextBasic(dpi, screenCoords, STR_FORMAT_INTEGER, ft, { this->colours[0] }); + break; } - else + case DisplayType::DisplayUnits: { - // Height label is Real Values. - // Print the value in the configured measurement units. - switch (gConfigGeneral.MeasurementFormat) + // Print the value in the configured height label type: + if (gConfigGeneral.ShowHeightAsUnits) { - case MeasurementFormat::Metric: - case MeasurementFormat::SI: + // Height label is Units. + auto ft = Formatter(); + ft.Add(static_cast(FIXED_1DP(gClipHeight, 0) / 2 - FIXED_1DP(7, 0))); + DrawTextBasic( + dpi, screenCoords, STR_UNIT1DP_NO_SUFFIX, ft, + { this->colours[0] }); // Printing the value in Height Units. + } + else + { + // Height label is Real Values. + // Print the value in the configured measurement units. + switch (gConfigGeneral.MeasurementFormat) { - auto ft = Formatter(); - ft.Add( - static_cast(FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50))); - DrawTextBasic(dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] }); - break; - } - case MeasurementFormat::Imperial: - { - auto ft = Formatter(); - ft.Add( - static_cast(FIXED_1DP(gClipHeight, 0) / 2.0f * 5 - FIXED_1DP(35, 0))); - DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { this->colours[0] }); - break; + case MeasurementFormat::Metric: + case MeasurementFormat::SI: + { + auto ft = Formatter(); + ft.Add( + static_cast(FIXED_2DP(gClipHeight, 0) / 2 * 1.5f - FIXED_2DP(10, 50))); + DrawTextBasic(dpi, screenCoords, STR_UNIT2DP_SUFFIX_METRES, ft, { this->colours[0] }); + break; + } + case MeasurementFormat::Imperial: + { + auto ft = Formatter(); + ft.Add( + static_cast(FIXED_1DP(gClipHeight, 0) / 2.0f * 5 - FIXED_1DP(35, 0))); + DrawTextBasic(dpi, screenCoords, STR_UNIT1DP_SUFFIX_FEET, ft, { this->colours[0] }); + break; + } } } } } } - } - ScreenSize OnScrollGetSize(int32_t scrollIndex) override - { - return { 1000, 0 }; - } - - void OnOpen() override - { - this->widgets = _viewClippingWidgets; - this->hold_down_widgets = (1uLL << WIDX_CLIP_HEIGHT_INCREASE) | (1uL << WIDX_CLIP_HEIGHT_DECREASE); - WindowInitScrollWidgets(*this); - - _clipHeightDisplayType = DisplayType::DisplayUnits; - - // Initialise the clip height slider from the current clip height value. - this->SetClipHeight(gClipHeight); - - WindowPushOthersBelow(*this); - - // Get the main viewport to set the view clipping flag. - WindowBase* mainWindow = WindowGetMain(); - - // Turn on view clipping when the window is opened. - if (mainWindow != nullptr) + ScreenSize OnScrollGetSize(int32_t scrollIndex) override { - mainWindow->viewport->flags |= VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); + return { 1000, 0 }; } - } - void OnResize() override - { - ResizeFrame(); - } - -private: - void OnClose() override - { - // Turn off view clipping when the window is closed. - WindowBase* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) + void OnOpen() override { - mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW; - mainWindow->Invalidate(); + this->widgets = _viewClippingWidgets; + this->hold_down_widgets = (1uLL << WIDX_CLIP_HEIGHT_INCREASE) | (1uL << WIDX_CLIP_HEIGHT_DECREASE); + WindowInitScrollWidgets(*this); + + _clipHeightDisplayType = DisplayType::DisplayUnits; + + // Initialise the clip height slider from the current clip height value. + this->SetClipHeight(gClipHeight); + + WindowPushOthersBelow(*this); + + // Get the main viewport to set the view clipping flag. + WindowBase* mainWindow = WindowGetMain(); + + // Turn on view clipping when the window is opened. + if (mainWindow != nullptr) + { + mainWindow->viewport->flags |= VIEWPORT_FLAG_CLIP_VIEW; + mainWindow->Invalidate(); + } } - } - void SetClipHeight(const uint8_t clipHeight) - { - gClipHeight = clipHeight; - const auto& widget = widgets[WIDX_CLIP_HEIGHT_SLIDER]; - const float clip_height_ratio = static_cast(gClipHeight) / 255; - this->scrolls[0].h_left = static_cast( - std::ceil(clip_height_ratio * (this->scrolls[0].h_right - (widget.width() - 1)))); - } + void OnResize() override + { + ResizeFrame(); + } - bool IsActive() - { - if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) - return false; - if (gCurrentToolWidget.window_classification != WindowClass::ViewClipping) - return false; - return _toolActive; - } -}; + private: + void OnClose() override + { + // Turn off view clipping when the window is closed. + WindowBase* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + { + mainWindow->viewport->flags &= ~VIEWPORT_FLAG_CLIP_VIEW; + mainWindow->Invalidate(); + } + } -WindowBase* WindowViewClippingOpen() -{ - auto* window = WindowBringToFrontByClass(WindowClass::ViewClipping); - if (window == nullptr) + void SetClipHeight(const uint8_t clipHeight) + { + gClipHeight = clipHeight; + const auto& widget = widgets[WIDX_CLIP_HEIGHT_SLIDER]; + const float clip_height_ratio = static_cast(gClipHeight) / 255; + this->scrolls[0].h_left = static_cast( + std::ceil(clip_height_ratio * (this->scrolls[0].h_right - (widget.width() - 1)))); + } + + bool IsActive() + { + if (!(InputTestFlag(INPUT_FLAG_TOOL_ACTIVE))) + return false; + if (gCurrentToolWidget.window_classification != WindowClass::ViewClipping) + return false; + return _toolActive; + } + }; + + WindowBase* WindowViewClippingOpen() { - window = WindowCreate(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), WW, WH); + auto* window = WindowBringToFrontByClass(WindowClass::ViewClipping); + if (window == nullptr) + { + window = WindowCreate(WindowClass::ViewClipping, ScreenCoordsXY(32, 32), WW, WH); + } + return window; } - return window; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 9ddcaa4072..22091cec83 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -17,7 +17,9 @@ #include #include -// clang-format off +namespace OpenRCT2::Ui::Windows +{ + // clang-format off enum WindowViewportWidgetIdx { WIDX_BACKGROUND, @@ -53,187 +55,188 @@ static Widget _viewportWidgets[] = kWidgetsEnd, }; -// clang-format on + // clang-format on -class ViewportWindow final : public Window -{ -private: - void GetFreeViewportNumber() + class ViewportWindow final : public Window { - number = 1; - WindowVisitEach([&](WindowBase* w) { - if (w != nullptr && w != this && w->classification == WindowClass::Viewport) + private: + void GetFreeViewportNumber() + { + number = 1; + WindowVisitEach([&](WindowBase* w) { + if (w != nullptr && w != this && w->classification == WindowClass::Viewport) + { + if (w->number >= number) + number = w->number + 1; + } + }); + } + + public: + void OnOpen() override + { + GetFreeViewportNumber(); + + widgets = _viewportWidgets; + + // Create viewport + ViewportCreate(this, windowPos, width, height, Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ())); + if (viewport == nullptr) { - if (w->number >= number) - number = w->number + 1; - } - }); - } - -public: - void OnOpen() override - { - GetFreeViewportNumber(); - - widgets = _viewportWidgets; - - // Create viewport - ViewportCreate(this, windowPos, width, height, Focus(TileCoordsXYZ(128, 128, 0).ToCoordsXYZ())); - if (viewport == nullptr) - { - Close(); - WindowErrorOpen("Unexpected Error", "Failed to create viewport window."); - return; - } - - auto* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - { - Viewport* mainViewport = mainWindow->viewport; - int32_t x = mainViewport->viewPos.x + (mainViewport->view_width / 2); - int32_t y = mainViewport->viewPos.y + (mainViewport->view_height / 2); - savedViewPos = { x - (viewport->view_width / 2), y - (viewport->view_height / 2) }; - } - - viewport->flags |= VIEWPORT_FLAG_SOUND_ON | VIEWPORT_FLAG_INDEPEDENT_ROTATION; - - min_width = WW; - min_height = WH; - max_width = WW; - max_height = WH; - } - - void OnUpdate() override - { - auto* mainWindow = WindowGetMain(); - if (mainWindow == nullptr) - return; - - if (viewport != nullptr && viewport->flags != mainWindow->viewport->flags) - { - viewport->flags = mainWindow->viewport->flags | VIEWPORT_FLAG_INDEPEDENT_ROTATION; - Invalidate(); - } - - // Not sure how to invalidate part of the viewport that has changed, this will have to do for now - // widget_invalidate(*this, WIDX_VIEWPORT); - } - - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_CLOSE: Close(); - break; - case WIDX_ZOOM_IN: - { - if (viewport != nullptr && viewport->zoom > ZoomLevel::min()) - { - viewport->zoom--; - Invalidate(); - } - break; + WindowErrorOpen("Unexpected Error", "Failed to create viewport window."); + return; } - case WIDX_ZOOM_OUT: + + auto* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) { - if (viewport != nullptr && viewport->zoom < ZoomLevel::max()) - { - viewport->zoom++; - Invalidate(); - } - break; + Viewport* mainViewport = mainWindow->viewport; + int32_t x = mainViewport->viewPos.x + (mainViewport->view_width / 2); + int32_t y = mainViewport->viewPos.y + (mainViewport->view_height / 2); + savedViewPos = { x - (viewport->view_width / 2), y - (viewport->view_height / 2) }; } - case WIDX_LOCATE: + + viewport->flags |= VIEWPORT_FLAG_SOUND_ON | VIEWPORT_FLAG_INDEPEDENT_ROTATION; + + min_width = WW; + min_height = WH; + max_width = WW; + max_height = WH; + } + + void OnUpdate() override + { + auto* mainWindow = WindowGetMain(); + if (mainWindow == nullptr) + return; + + if (viewport != nullptr && viewport->flags != mainWindow->viewport->flags) { - auto* mainWindow = WindowGetMain(); - if (mainWindow != nullptr) - { - auto info = GetMapCoordinatesFromPos( - { windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll); - WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); - } - break; - } - case WIDX_ROTATE: - { - ViewportRotateSingle(this, 1); + viewport->flags = mainWindow->viewport->flags | VIEWPORT_FLAG_INDEPEDENT_ROTATION; Invalidate(); - break; + } + + // Not sure how to invalidate part of the viewport that has changed, this will have to do for now + // widget_invalidate(*this, WIDX_VIEWPORT); + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_ZOOM_IN: + { + if (viewport != nullptr && viewport->zoom > ZoomLevel::min()) + { + viewport->zoom--; + Invalidate(); + } + break; + } + case WIDX_ZOOM_OUT: + { + if (viewport != nullptr && viewport->zoom < ZoomLevel::max()) + { + viewport->zoom++; + Invalidate(); + } + break; + } + case WIDX_LOCATE: + { + auto* mainWindow = WindowGetMain(); + if (mainWindow != nullptr) + { + auto info = GetMapCoordinatesFromPos( + { windowPos.x + (width / 2), windowPos.y + (height / 2) }, ViewportInteractionItemAll); + WindowScrollToLocation(*mainWindow, { info.Loc, TileElementHeight(info.Loc) }); + } + break; + } + case WIDX_ROTATE: + { + ViewportRotateSingle(this, 1); + Invalidate(); + break; + } } } - } - void OnDraw(DrawPixelInfo& dpi) override - { - DrawWidgets(dpi); + void OnDraw(DrawPixelInfo& dpi) override + { + DrawWidgets(dpi); - // Draw viewport - if (viewport != nullptr) - WindowDrawViewport(dpi, *this); - } + // Draw viewport + if (viewport != nullptr) + WindowDrawViewport(dpi, *this); + } - void OnResize() override + void OnResize() override + { + int32_t screenWidth = ContextGetWidth(); + int32_t screenHeight = ContextGetHeight(); + + max_width = (screenWidth * 4) / 5; + max_height = (screenHeight * 4) / 5; + + min_width = WW; + min_height = WH; + + WindowSetResize(*this, min_width, min_height, max_width, max_height); + } + + void OnPrepareDraw() override + { + Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; + + ResizeFrameWithPage(); + widgets[WIDX_ZOOM_IN].left = width - 27; + widgets[WIDX_ZOOM_IN].right = width - 2; + widgets[WIDX_ZOOM_OUT].left = width - 27; + widgets[WIDX_ZOOM_OUT].right = width - 2; + widgets[WIDX_LOCATE].left = width - 27; + widgets[WIDX_LOCATE].right = width - 2; + widgets[WIDX_ROTATE].left = width - 27; + widgets[WIDX_ROTATE].right = width - 2; + widgets[WIDX_VIEWPORT].right = widgets[WIDX_ZOOM_IN].left - 1; + widgets[WIDX_VIEWPORT].bottom = widgets[WIDX_BACKGROUND].bottom - 3; + + // Set title + Formatter::Common().Add(number); + + // Set disabled widgets + disabled_widgets = 0; + if (viewport != nullptr && viewport->zoom == ZoomLevel::min()) + disabled_widgets |= 1uLL << WIDX_ZOOM_IN; + if (viewport != nullptr && viewport->zoom >= ZoomLevel::max()) + disabled_widgets |= 1uLL << WIDX_ZOOM_OUT; + + if (viewport != nullptr) + { + viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }; + viewport->width = widgets[WIDX_VIEWPORT].width() - 1; + viewport->height = widgets[WIDX_VIEWPORT].height() - 1; + viewport->view_width = viewport->zoom.ApplyTo(viewport->width); + viewport->view_height = viewport->zoom.ApplyTo(viewport->height); + } + } + }; + + WindowBase* WindowViewportOpen() { int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); + int32_t width = (screenWidth / 2); + int32_t height = (screenHeight / 2); - max_width = (screenWidth * 4) / 5; - max_height = (screenHeight * 4) / 5; + auto* w = WindowCreate(WindowClass::Viewport, std::max(WW, width), std::max(WH, height), WF_RESIZABLE); - min_width = WW; - min_height = WH; - - WindowSetResize(*this, min_width, min_height, max_width, max_height); + if (w != nullptr) + return w; + return nullptr; } - - void OnPrepareDraw() override - { - Widget* viewportWidget = &widgets[WIDX_VIEWPORT]; - - ResizeFrameWithPage(); - widgets[WIDX_ZOOM_IN].left = width - 27; - widgets[WIDX_ZOOM_IN].right = width - 2; - widgets[WIDX_ZOOM_OUT].left = width - 27; - widgets[WIDX_ZOOM_OUT].right = width - 2; - widgets[WIDX_LOCATE].left = width - 27; - widgets[WIDX_LOCATE].right = width - 2; - widgets[WIDX_ROTATE].left = width - 27; - widgets[WIDX_ROTATE].right = width - 2; - widgets[WIDX_VIEWPORT].right = widgets[WIDX_ZOOM_IN].left - 1; - widgets[WIDX_VIEWPORT].bottom = widgets[WIDX_BACKGROUND].bottom - 3; - - // Set title - Formatter::Common().Add(number); - - // Set disabled widgets - disabled_widgets = 0; - if (viewport != nullptr && viewport->zoom == ZoomLevel::min()) - disabled_widgets |= 1uLL << WIDX_ZOOM_IN; - if (viewport != nullptr && viewport->zoom >= ZoomLevel::max()) - disabled_widgets |= 1uLL << WIDX_ZOOM_OUT; - - if (viewport != nullptr) - { - viewport->pos = windowPos + ScreenCoordsXY{ viewportWidget->left + 1, viewportWidget->top + 1 }; - viewport->width = widgets[WIDX_VIEWPORT].width() - 1; - viewport->height = widgets[WIDX_VIEWPORT].height() - 1; - viewport->view_width = viewport->zoom.ApplyTo(viewport->width); - viewport->view_height = viewport->zoom.ApplyTo(viewport->height); - } - } -}; - -WindowBase* WindowViewportOpen() -{ - int32_t screenWidth = ContextGetWidth(); - int32_t screenHeight = ContextGetHeight(); - 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); - - if (w != nullptr) - return w; - return nullptr; -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index 28355ed396..fe82ebe890 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -18,13 +18,13 @@ #include #include -using namespace OpenRCT2; +namespace OpenRCT2::Ui::Windows +{ + static constexpr StringId WINDOW_TITLE = STR_WATER; + static constexpr int32_t WH = 77; + static constexpr int32_t WW = 76; -static constexpr StringId WINDOW_TITLE = STR_WATER; -static constexpr int32_t WH = 77; -static constexpr int32_t WW = 76; - -// clang-format off + // clang-format off enum WindowWaterWidgetIdx { WIDX_BACKGROUND, WIDX_TITLE, @@ -41,158 +41,160 @@ static Widget _waterWidgets[] = { MakeRemapWidget({43, 32}, {16, 16}, WindowWidgetType::TrnBtn, WindowColour::Tertiary, SPR_LAND_TOOL_INCREASE, STR_ADJUST_LARGER_WATER_TIP), // increment size kWidgetsEnd, }; -// clang-format on + // clang-format on -class WaterWindow final : public Window -{ -public: - void OnOpen() override + class WaterWindow final : public Window { - widgets = _waterWidgets; - hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); - WindowInitScrollWidgets(*this); - WindowPushOthersBelow(*this); - - gLandToolSize = 1; - gWaterToolRaiseCost = kMoney64Undefined; - gWaterToolLowerCost = kMoney64Undefined; - } - - void OnClose() override - { - // If the tool wasn't changed, turn tool off - if (WaterToolIsActive()) + public: + void OnOpen() override { - ToolCancel(); + widgets = _waterWidgets; + hold_down_widgets = (1uLL << WIDX_INCREMENT) | (1uLL << WIDX_DECREMENT); + WindowInitScrollWidgets(*this); + WindowPushOthersBelow(*this); + + gLandToolSize = 1; + gWaterToolRaiseCost = kMoney64Undefined; + gWaterToolLowerCost = kMoney64Undefined; } - } - void OnMouseUp(WidgetIndex widgetIndex) override - { - switch (widgetIndex) + void OnClose() override { - case WIDX_CLOSE: + // If the tool wasn't changed, turn tool off + if (WaterToolIsActive()) + { + ToolCancel(); + } + } + + void OnMouseUp(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_CLOSE: + Close(); + break; + case WIDX_PREVIEW: + InputSize(); + break; + } + } + + void OnMouseDown(WidgetIndex widgetIndex) override + { + switch (widgetIndex) + { + case WIDX_DECREMENT: + // Decrement land tool size + gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); + + // Invalidate the window + Invalidate(); + break; + case WIDX_INCREMENT: + // Increment land tool size + gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); + + // Invalidate the window + Invalidate(); + break; + } + } + + void OnUpdate() override + { + // Close window if another tool is open + if (!WaterToolIsActive()) + { Close(); - break; - case WIDX_PREVIEW: - InputSize(); - break; - } - } - - void OnMouseDown(WidgetIndex widgetIndex) override - { - switch (widgetIndex) - { - case WIDX_DECREMENT: - // Decrement land tool size - gLandToolSize = std::max(kLandToolMinimumSize, gLandToolSize - 1); - - // Invalidate the window - Invalidate(); - break; - case WIDX_INCREMENT: - // Increment land tool size - gLandToolSize = std::min(kLandToolMaximumSize, gLandToolSize + 1); - - // Invalidate the window - Invalidate(); - break; - } - } - - void OnUpdate() override - { - // Close window if another tool is open - if (!WaterToolIsActive()) - { - Close(); - } - } - - void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override - { - int32_t size; - char* end; - - if (widgetIndex != WIDX_PREVIEW) - { - return; - } - - std::string textStr = std::string(text); - size = strtol(textStr.c_str(), &end, 10); - if (*end == '\0') - { - size = std::max(kLandToolMinimumSize, size); - size = std::min(kLandToolMaximumSize, size); - gLandToolSize = size; - - Invalidate(); - } - } - - void OnPrepareDraw() override - { - // Set the preview image button to be pressed down - SetWidgetPressed(WIDX_PREVIEW, true); - - // Update the preview image - widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); - } - - void OnDraw(DrawPixelInfo& dpi) override - { - auto screenCoords = ScreenCoordsXY{ windowPos.x + widgets[WIDX_PREVIEW].midX(), - windowPos.y + widgets[WIDX_PREVIEW].midY() }; - - DrawWidgets(dpi); - // Draw number for tool sizes bigger than 7 - if (gLandToolSize > kLandToolMaximumSizeWithSprite) - { - auto ft = Formatter(); - ft.Add(gLandToolSize); - DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); - } - - if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) - { - // Draw raise cost amount - screenCoords = { widgets[WIDX_PREVIEW].midX() + windowPos.x, widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 }; - if (gWaterToolRaiseCost != kMoney64Undefined && gWaterToolRaiseCost != 0) - { - auto ft = Formatter(); - ft.Add(gWaterToolRaiseCost); - DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); - } - screenCoords.y += 10; - - // Draw lower cost amount - if (gWaterToolLowerCost != kMoney64Undefined && gWaterToolLowerCost != 0) - { - auto ft = Formatter(); - ft.Add(gWaterToolLowerCost); - DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); } } - } - void OnResize() override + void OnTextInput(WidgetIndex widgetIndex, std::string_view text) override + { + int32_t size; + char* end; + + if (widgetIndex != WIDX_PREVIEW) + { + return; + } + + std::string textStr = std::string(text); + size = strtol(textStr.c_str(), &end, 10); + if (*end == '\0') + { + size = std::max(kLandToolMinimumSize, size); + size = std::min(kLandToolMaximumSize, size); + gLandToolSize = size; + + Invalidate(); + } + } + + void OnPrepareDraw() override + { + // Set the preview image button to be pressed down + SetWidgetPressed(WIDX_PREVIEW, true); + + // Update the preview image + widgets[WIDX_PREVIEW].image = ImageId(LandTool::SizeToSpriteIndex(gLandToolSize)); + } + + void OnDraw(DrawPixelInfo& dpi) override + { + auto screenCoords = ScreenCoordsXY{ windowPos.x + widgets[WIDX_PREVIEW].midX(), + windowPos.y + widgets[WIDX_PREVIEW].midY() }; + + DrawWidgets(dpi); + // Draw number for tool sizes bigger than 7 + if (gLandToolSize > kLandToolMaximumSizeWithSprite) + { + auto ft = Formatter(); + ft.Add(gLandToolSize); + DrawTextBasic( + dpi, screenCoords - ScreenCoordsXY{ 0, 2 }, STR_LAND_TOOL_SIZE_VALUE, ft, { TextAlignment::CENTRE }); + } + + if (!(GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY)) + { + // Draw raise cost amount + screenCoords = { widgets[WIDX_PREVIEW].midX() + windowPos.x, widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 }; + if (gWaterToolRaiseCost != kMoney64Undefined && gWaterToolRaiseCost != 0) + { + auto ft = Formatter(); + ft.Add(gWaterToolRaiseCost); + DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } + screenCoords.y += 10; + + // Draw lower cost amount + if (gWaterToolLowerCost != kMoney64Undefined && gWaterToolLowerCost != 0) + { + auto ft = Formatter(); + ft.Add(gWaterToolLowerCost); + DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE }); + } + } + } + + void OnResize() override + { + ResizeFrame(); + } + + private: + void InputSize() + { + 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); + } + }; + + WindowBase* WindowWaterOpen() { - ResizeFrame(); + return WindowFocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } - -private: - void InputSize() - { - 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); - } -}; - -WindowBase* WindowWaterOpen() -{ - return WindowFocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); -} +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 87e217fd03..5c484af922 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -16,205 +16,208 @@ #include #include -using loadsave_callback = void (*)(int32_t result, const utf8* path); -using scenarioselect_callback = void (*)(const utf8* path); struct Peep; struct TileElement; struct Vehicle; +struct TrackDesign; enum class GuestListFilterType : int32_t; enum class ScatterToolDensity : uint8_t; +using loadsave_callback = void (*)(int32_t result, const utf8* path); +using scenarioselect_callback = void (*)(const utf8* path); -extern bool gWindowSceneryScatterEnabled; -extern uint16_t gWindowSceneryScatterSize; -extern ScatterToolDensity gWindowSceneryScatterDensity; -extern uint8_t gWindowSceneryPaintEnabled; -extern uint8_t gWindowSceneryRotation; -extern colour_t gWindowSceneryPrimaryColour; -extern colour_t gWindowScenerySecondaryColour; -extern colour_t gWindowSceneryTertiaryColour; -extern bool gWindowSceneryEyedropperEnabled; +namespace OpenRCT2::Ui::Windows +{ + extern bool gWindowSceneryScatterEnabled; + extern uint16_t gWindowSceneryScatterSize; + extern ScatterToolDensity gWindowSceneryScatterDensity; + extern uint8_t gWindowSceneryPaintEnabled; + extern uint8_t gWindowSceneryRotation; + extern colour_t gWindowSceneryPrimaryColour; + extern colour_t gWindowScenerySecondaryColour; + extern colour_t gWindowSceneryTertiaryColour; + extern bool gWindowSceneryEyedropperEnabled; -WindowBase* WindowAboutOpen(); -void WindowCampaignRefreshRides(); -WindowBase* WindowChangelogOpen(int personality); -WindowBase* WindowCheatsOpen(); -WindowBase* WindowClearSceneryOpen(); -WindowBase* CustomCurrencyWindowOpen(); -WindowBase* WindowDebugPaintOpen(); -WindowBase* WindowEditorInventionsListOpen(); -WindowBase* WindowEditorMainOpen(); -WindowBase* WindowEditorObjectiveOptionsOpen(); -WindowBase* WindowEditorScenarioOptionsOpen(); -WindowBase* WindowFootpathOpen(); -void WindowFootpathResetSelectedPath(); -WindowBase* WindowGuestOpen(Peep* peep); -WindowBase* WindowLandOpen(); -WindowBase* WindowLandRightsOpen(); -WindowBase* WindowMainOpen(); -WindowBase* WindowMapgenOpen(); -WindowBase* WindowMultiplayerOpen(); -WindowBase* WindowNewsOpen(); -WindowBase* WindowNewsOptionsOpen(); -WindowBase* WindowOptionsOpen(); -WindowBase* WindowSavePromptOpen(); + WindowBase* WindowAboutOpen(); + void WindowCampaignRefreshRides(); + WindowBase* WindowChangelogOpen(int personality); + WindowBase* WindowCheatsOpen(); + WindowBase* WindowClearSceneryOpen(); + WindowBase* CustomCurrencyWindowOpen(); + WindowBase* WindowDebugPaintOpen(); + WindowBase* WindowEditorInventionsListOpen(); + WindowBase* WindowEditorMainOpen(); + WindowBase* WindowEditorObjectiveOptionsOpen(); + WindowBase* WindowEditorScenarioOptionsOpen(); + WindowBase* WindowFootpathOpen(); + void WindowFootpathResetSelectedPath(); + WindowBase* WindowGuestOpen(Peep* peep); + WindowBase* WindowLandOpen(); + WindowBase* WindowLandRightsOpen(); + WindowBase* WindowMainOpen(); + WindowBase* WindowMapgenOpen(); + WindowBase* WindowMultiplayerOpen(); + WindowBase* WindowNewsOpen(); + WindowBase* WindowNewsOptionsOpen(); + WindowBase* WindowOptionsOpen(); + WindowBase* WindowSavePromptOpen(); #ifndef DISABLE_NETWORK -WindowBase* WindowServerListOpen(); -WindowBase* WindowServerStartOpen(); + WindowBase* WindowServerListOpen(); + WindowBase* WindowServerStartOpen(); #endif -WindowBase* WindowShortcutKeysOpen(); -WindowBase* WindowStaffListOpen(); -WindowBase* WindowStaffOpen(Peep* peep); -void WindowStaffListRefresh(); -WindowBase* WindowThemesOpen(); -WindowBase* WindowTitleExitOpen(); -WindowBase* WindowTitleLogoOpen(); -WindowBase* WindowTitleMenuOpen(); -WindowBase* WindowTitleOptionsOpen(); -WindowBase* WindowViewportOpen(); -WindowBase* WindowWaterOpen(); -WindowBase* WindowViewClippingOpen(); -WindowBase* WindowTransparencyOpen(); -WindowBase* WindowAssetPacksOpen(); + WindowBase* WindowShortcutKeysOpen(); + WindowBase* WindowStaffListOpen(); + WindowBase* WindowStaffOpen(Peep* peep); + void WindowStaffListRefresh(); + WindowBase* WindowThemesOpen(); + WindowBase* WindowTitleExitOpen(); + WindowBase* WindowTitleLogoOpen(); + WindowBase* WindowTitleMenuOpen(); + WindowBase* WindowTitleOptionsOpen(); + WindowBase* WindowViewportOpen(); + WindowBase* WindowWaterOpen(); + WindowBase* WindowViewClippingOpen(); + WindowBase* WindowTransparencyOpen(); + WindowBase* WindowAssetPacksOpen(); -// WC_FINANCES -WindowBase* WindowFinancesOpen(); -WindowBase* WindowFinancesResearchOpen(); -WindowBase* WindowFinancesMarketingOpen(); + // WC_FINANCES + WindowBase* WindowFinancesOpen(); + WindowBase* WindowFinancesResearchOpen(); + WindowBase* WindowFinancesMarketingOpen(); -// WC_PARK_INFORMATION -WindowBase* WindowParkAwardsOpen(); -WindowBase* WindowParkEntranceOpen(); -WindowBase* WindowParkGuestsOpen(); -WindowBase* WindowParkObjectiveOpen(); -WindowBase* WindowParkRatingOpen(); + // WC_PARK_INFORMATION + WindowBase* WindowParkAwardsOpen(); + WindowBase* WindowParkEntranceOpen(); + WindowBase* WindowParkGuestsOpen(); + WindowBase* WindowParkObjectiveOpen(); + WindowBase* WindowParkRatingOpen(); -WindowBase* WindowBannerOpen(rct_windownumber number); -WindowBase* WindowRideDemolishPromptOpen(const Ride& ride); -WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride); -WindowBase* WindowSignOpen(rct_windownumber number); -WindowBase* WindowSignSmallOpen(rct_windownumber number); -WindowBase* WindowPlayerOpen(uint8_t id); -WindowBase* WindowNewCampaignOpen(int16_t campaignType); + WindowBase* WindowBannerOpen(rct_windownumber number); + WindowBase* WindowRideDemolishPromptOpen(const Ride& ride); + WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride); + WindowBase* WindowSignOpen(rct_windownumber number); + WindowBase* WindowSignSmallOpen(rct_windownumber number); + WindowBase* WindowPlayerOpen(uint8_t id); + WindowBase* WindowNewCampaignOpen(int16_t campaignType); -WindowBase* WindowInstallTrackOpen(const utf8* path); -void WindowGuestListRefreshList(); -WindowBase* WindowGuestListOpen(); -WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index); -WindowBase* WindowStaffFirePromptOpen(Peep* peep); -WindowBase* WindowScenarioselectOpen(scenarioselect_callback callback); -WindowBase* WindowScenarioselectOpen(std::function callback); + WindowBase* WindowInstallTrackOpen(const utf8* path); + void WindowGuestListRefreshList(); + WindowBase* WindowGuestListOpen(); + WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index); + WindowBase* WindowStaffFirePromptOpen(Peep* peep); + WindowBase* WindowScenarioselectOpen(scenarioselect_callback callback); + WindowBase* WindowScenarioselectOpen(std::function callback); -WindowBase* WindowErrorOpen(StringId title, StringId message, const class Formatter& formatter); -WindowBase* WindowErrorOpen(std::string_view title, std::string_view message); -struct TrackDesign; -WindowBase* WindowLoadsaveOpen( - int32_t type, std::string_view defaultPath, std::function callback, - TrackDesign* trackDesign); -WindowBase* WindowTrackPlaceOpen(const struct TrackDesignFileRef* tdFileRef); -WindowBase* WindowTrackManageOpen(struct TrackDesignFileRef* tdFileRef); + WindowBase* WindowErrorOpen(StringId title, StringId message, const class Formatter& formatter); + WindowBase* WindowErrorOpen(std::string_view title, std::string_view message); -void TrackPlaceClearProvisionalTemporarily(); -void TrackPlaceRestoreProvisional(); + WindowBase* WindowLoadsaveOpen( + int32_t type, std::string_view defaultPath, std::function callback, + TrackDesign* trackDesign); + WindowBase* WindowTrackPlaceOpen(const struct TrackDesignFileRef* tdFileRef); + WindowBase* WindowTrackManageOpen(struct TrackDesignFileRef* tdFileRef); -WindowBase* WindowMapOpen(); -void WindowMapReset(); + void TrackPlaceClearProvisionalTemporarily(); + void TrackPlaceRestoreProvisional(); -WindowBase* WindowResearchOpen(); -void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); -void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); -void WindowResearchDevelopmentDraw(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex); -void WindowResearchFundingMouseDown(WindowBase* w, WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); -void WindowResearchFundingMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); -void WindowResearchFundingDropdown(WidgetIndex widgetIndex, int32_t selectedIndex, WidgetIndex baseWidgetIndex); -void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); -void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi); + WindowBase* WindowMapOpen(); + void WindowMapReset(); -WindowBase* WindowNewRideOpen(); -WindowBase* WindowNewRideOpenResearch(); -void WindowNewRideInitVars(); -void WindowNewRideFocus(RideSelection rideItem); + WindowBase* WindowResearchOpen(); + void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); + void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); + void WindowResearchDevelopmentDraw(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex); + void WindowResearchFundingMouseDown(WindowBase* w, WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); + void WindowResearchFundingMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); + void WindowResearchFundingDropdown(WidgetIndex widgetIndex, int32_t selectedIndex, WidgetIndex baseWidgetIndex); + void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); + void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi); -WindowBase* WindowRideListOpen(); -void WindowRideListRefreshList(WindowBase* w); + WindowBase* WindowNewRideOpen(); + WindowBase* WindowNewRideOpenResearch(); + void WindowNewRideInitVars(); + void WindowNewRideFocus(RideSelection rideItem); -WindowBase* WindowRideMainOpen(const Ride& ride); -WindowBase* WindowRideOpenTrack(TileElement* tileElement); -WindowBase* WindowRideOpenVehicle(Vehicle* vehicle); -void WindowRideInvalidateVehicle(const Vehicle& vehicle); -void WindowRidePaintResetVehicle(RideId rideIndex); -void WindowRideMeasurementsDesignCancel(); + WindowBase* WindowRideListOpen(); + void WindowRideListRefreshList(WindowBase* w); -// rct2: 0x00F635EE -extern RideSelection _window_track_list_item; -WindowBase* WindowTrackListOpen(RideSelection item); -void WindowTrackDesignListReloadTracks(); -void WindowTrackDesignListSetBeingUpdated(bool beingUpdated); + WindowBase* WindowRideMainOpen(const Ride& ride); + WindowBase* WindowRideOpenTrack(TileElement* tileElement); + WindowBase* WindowRideOpenVehicle(Vehicle* vehicle); + void WindowRideInvalidateVehicle(const Vehicle& vehicle); + void WindowRidePaintResetVehicle(RideId rideIndex); + void WindowRideMeasurementsDesignCancel(); -void SetMapTooltip(Formatter& ft); -const Formatter& GetMapTooltip(); -void WindowMapTooltipUpdateVisibility(); + // rct2: 0x00F635EE + extern RideSelection _window_track_list_item; + WindowBase* WindowTrackListOpen(RideSelection item); + void WindowTrackDesignListReloadTracks(); + void WindowTrackDesignListSetBeingUpdated(bool beingUpdated); -WindowBase* WindowMazeConstructionOpen(); -void WindowMazeConstructionUpdatePressedWidgets(); + void SetMapTooltip(Formatter& ft); + const Formatter& GetMapTooltip(); + void WindowMapTooltipUpdateVisibility(); -WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose); -WindowBase* WindowNetworkStatusOpenPassword(); -void WindowNetworkStatusClose(); + WindowBase* WindowMazeConstructionOpen(); + void WindowMazeConstructionUpdatePressedWidgets(); -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); + WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose); + WindowBase* WindowNetworkStatusOpenPassword(); + void WindowNetworkStatusClose(); -void WindowTextInputOpen( - std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, - std::function okCallback, std::function cancelCallback); + 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); -WindowBase* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); + void WindowTextInputOpen( + std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, + std::function okCallback, std::function cancelCallback); -WindowBase* WindowRideConstructionOpen(); -void WindowRideConstructionUpdateActiveElementsImpl(); -void WindowRideConstructionUpdateEnabledTrackPieces(); + WindowBase* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); -WindowBase* WindowTopToolbarOpen(); -bool LandToolIsActive(); -bool ClearSceneryToolIsActive(); -bool WaterToolIsActive(); + WindowBase* WindowRideConstructionOpen(); + void WindowRideConstructionUpdateActiveElementsImpl(); + void WindowRideConstructionUpdateEnabledTrackPieces(); -WindowBase* WindowSceneryOpen(); -void WindowScenerySetSelectedItem( - const ScenerySelection& sceneryconst, std::optional primary, const std::optional secondary, - const std::optional tertiary, const std::optional rotation); -void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex); -void WindowScenerySetDefaultPlacementConfiguration(); -void WindowSceneryInit(); -void WindowSceneryResetSelectedSceneryItems(); -const ScenerySelection WindowSceneryGetTabSelection(); + WindowBase* WindowTopToolbarOpen(); + bool LandToolIsActive(); + bool ClearSceneryToolIsActive(); + bool WaterToolIsActive(); -extern uint8_t gToolbarDirtyFlags; -WindowBase* WindowGameBottomToolbarOpen(); -void WindowGameBottomToolbarInvalidateNewsItem(); + WindowBase* WindowSceneryOpen(); + void WindowScenerySetSelectedItem( + const ScenerySelection& sceneryconst, std::optional primary, const std::optional secondary, + const std::optional tertiary, const std::optional rotation); + void WindowScenerySetSelectedTab(const ObjectEntryIndex sceneryGroupIndex); + void WindowScenerySetDefaultPlacementConfiguration(); + void WindowSceneryInit(); + void WindowSceneryResetSelectedSceneryItems(); + const ScenerySelection WindowSceneryGetTabSelection(); -WindowBase* WindowEditorBottomToolbarOpen(); + extern uint8_t gToolbarDirtyFlags; + WindowBase* WindowGameBottomToolbarOpen(); + void WindowGameBottomToolbarInvalidateNewsItem(); -WindowBase* WindowTileInspectorOpen(); -void WindowTileInspectorClearClipboard(); + WindowBase* WindowEditorBottomToolbarOpen(); -WindowBase* WindowEditorObjectSelectionOpen(); + WindowBase* WindowTileInspectorOpen(); + void WindowTileInspectorClearClipboard(); -void WindowTooltipReset(const ScreenCoordsXY& screenCoords); -void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords); -void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); -void WindowTooltipClose(); + WindowBase* WindowEditorObjectSelectionOpen(); -WindowBase* WindowSceneryScatterOpen(); -WindowBase* WindowPatrolAreaOpen(EntityId staffId); -EntityId WindowPatrolAreaGetCurrentStaffId(); + void WindowTooltipReset(const ScreenCoordsXY& screenCoords); + void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords); + void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); + void WindowTooltipClose(); -// clang-format off + WindowBase* WindowSceneryScatterOpen(); + WindowBase* WindowPatrolAreaOpen(EntityId staffId); + EntityId WindowPatrolAreaGetCurrentStaffId(); + + // 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::Caption, 0, 1, WIDTH - 2, 1, 14, TITLE, STR_WINDOW_TITLE_TIP }, \ @@ -223,4 +226,5 @@ EntityId WindowPatrolAreaGetCurrentStaffId(); #define WINDOW_SHIM(TITLE, WIDTH, HEIGHT) WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, STR_CLOSE_X) #define WINDOW_SHIM_WHITE(TITLE, WIDTH, HEIGHT) WINDOW_SHIM_RAW(TITLE, WIDTH, HEIGHT, STR_CLOSE_X_WHITE) -// clang-format on + // clang-format on +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index f671194564..800a20d703 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -611,9 +611,6 @@ Viewport* WindowGetViewport(WindowBase* window); void WindowRelocateWindows(int32_t width, int32_t height); void WindowResizeGui(int32_t width, int32_t height); void WindowResizeGuiScenarioEditor(int32_t width, int32_t height); -void RideConstructionToolupdateEntranceExit(const ScreenCoordsXY& screenCoords); -void RideConstructionToolupdateConstruct(const ScreenCoordsXY& screenCoords); -void RideConstructionTooldownConstruct(const ScreenCoordsXY& screenCoords); void InvalidateAllWindowsAfterInput(); void TextinputCancel(); @@ -635,28 +632,6 @@ Viewport* WindowGetPreviousViewport(Viewport* current); void WindowResetVisibilities(); void WindowInitAll(); -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(); - void WindowFollowSprite(WindowBase& w, EntityId spriteIndex); void WindowUnfollowSprite(WindowBase& w); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index dc1795a7fa..902fce5e98 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -1012,8 +1012,6 @@ void RideDelete(RideId id); const RideObjectEntry* GetRideEntryByIndex(ObjectEntryIndex index); std::string_view GetRideEntryName(ObjectEntryIndex index); -extern const StringId ColourSchemeNames[4]; - int32_t RideGetCount(); void RideInitAll(); void ResetAllRideBuildDates(); @@ -1084,8 +1082,6 @@ enum class RideSetSetting : uint8_t; money64 SetOperatingSetting(RideId rideId, RideSetSetting setting, uint8_t value); money64 SetOperatingSettingNested(RideId rideId, RideSetSetting setting, uint8_t value, uint8_t flags); -void UpdateGhostTrackAndArrow(); - uint32_t RideCustomersPerHour(const Ride& ride); uint32_t RideCustomersInLast5Minutes(const Ride& ride); From 9ebe65b55ab38446bdda012ab341ff3b6139194b Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 10 Mar 2024 15:35:18 +0100 Subject: [PATCH 053/191] =?UTF-8?q?Fix=20building=20sloped=20banked=203?= =?UTF-8?q?=C3=973=20turns=20when=20coaster=20also=20has=201=C3=971=20turn?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes a bug that would prevent the user from building 3×3 banked sloped turns, if the roller coaster also had 1×1 flat turns enabled. The Spinning Roller Coaster that @RealSteel89 is working on is the first one to do so, revealing this bug. --- src/openrct2-ui/windows/RideConstruction.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 82c99a013c..0149e5580e 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -340,8 +340,7 @@ static Widget _rideConstructionWidgets[] = { // Disable small curves if the start or end of the track is sloped. if (_previousTrackPitchEnd != TrackPitch::None || _currentTrackPitchEnd != TrackPitch::None) { - disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_LEFT_CURVE) - | (1uLL << WIDX_RIGHT_CURVE) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); + disabledWidgets |= (1uLL << WIDX_LEFT_CURVE_VERY_SMALL) | (1uLL << WIDX_RIGHT_CURVE_VERY_SMALL); } } if (!IsTrackEnabled(TRACK_SLOPE_CURVE)) From 78d95fc0bdf8edd348a8a8f04bbc6e9e3957a2fb Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sun, 10 Mar 2024 15:00:08 +0000 Subject: [PATCH 054/191] Pass DrawPixelInfo by reference (#21563) --- .../engines/opengl/OpenGLDrawingEngine.cpp | 140 +++++++++--------- src/openrct2-ui/interface/Widget.cpp | 4 +- .../scripting/ScGraphicsContext.hpp | 2 +- .../windows/EditorInventionsList.cpp | 2 +- .../windows/EditorObjectSelection.cpp | 2 +- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapGen.cpp | 4 +- src/openrct2-ui/windows/NewRide.cpp | 4 +- src/openrct2-ui/windows/Options.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 4 +- src/openrct2-ui/windows/ScenarioSelect.cpp | 2 +- src/openrct2-ui/windows/Scenery.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2-ui/windows/Themes.cpp | 2 +- src/openrct2-ui/windows/TrackList.cpp | 2 +- src/openrct2/Intro.cpp | 12 +- src/openrct2/drawing/Drawing.String.cpp | 4 +- src/openrct2/drawing/Drawing.h | 8 +- src/openrct2/drawing/IDrawingContext.h | 18 +-- src/openrct2/drawing/NewDrawing.cpp | 26 ++-- src/openrct2/drawing/X8DrawingEngine.cpp | 118 +++++++-------- src/openrct2/drawing/X8DrawingEngine.h | 20 +-- src/openrct2/interface/Viewport.cpp | 2 +- src/openrct2/paint/Paint.cpp | 2 +- 24 files changed, 194 insertions(+), 194 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 8d537e66f3..81ef8d588f 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -99,18 +99,18 @@ public: void ResetPalette(); void StartNewDraw(); - void Clear(DrawPixelInfo* dpi, uint8_t paletteIndex) override; - void FillRect(DrawPixelInfo* dpi, uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; + void Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) override; + void FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; void FilterRect( - DrawPixelInfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; - void DrawLine(DrawPixelInfo* dpi, uint32_t colour, const ScreenLine& line) override; - void DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, int32_t x, int32_t y) override; + DrawPixelInfo& dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; + void DrawLine(DrawPixelInfo& dpi, uint32_t colour, const ScreenLine& line) override; + void DrawSprite(DrawPixelInfo& dpi, const ImageId imageId, int32_t x, int32_t y) override; void DrawSpriteRawMasked( - DrawPixelInfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) override; - void DrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) override; - void DrawGlyph(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) override; + DrawPixelInfo& dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) override; + void DrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) override; + void DrawGlyph(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) override; void DrawTTFBitmap( - DrawPixelInfo* dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, + DrawPixelInfo& dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y, uint8_t hinting_threshold) override; void FlushCommandBuffers(); @@ -118,7 +118,7 @@ public: void FlushLines(); void FlushRectangles(); void HandleTransparency(); - void CalculcateClipping(DrawPixelInfo* dpi); + void CalculcateClipping(DrawPixelInfo& dpi); }; class OpenGLWeatherDrawer final : public IWeatherDrawer @@ -161,7 +161,7 @@ public: int32_t pixelX = xPixelOffset % dpi.width; int32_t pixelY = (xPixelOffset / dpi.width) % dpi.height; - _drawingContext->DrawLine(&dpi, patternPixel, { { pixelX, pixelY }, { pixelX + 1, pixelY + 1 } }); + _drawingContext->DrawLine(dpi, patternPixel, { { pixelX, pixelY }, { pixelX + 1, pixelY + 1 } }); } } @@ -285,7 +285,7 @@ public: assert(_screenFramebuffer != nullptr); _drawingContext->StartNewDraw(); - _drawingContext->CalculcateClipping(&_bitsDPI); + _drawingContext->CalculcateClipping(_bitsDPI); } void EndDraw() override @@ -323,7 +323,7 @@ public: void PaintWindows() override { - _drawingContext->CalculcateClipping(&_bitsDPI); + _drawingContext->CalculcateClipping(_bitsDPI); WindowUpdateAllViewports(); WindowDrawAll(_bitsDPI, 0, 0, _width, _height); @@ -331,7 +331,7 @@ public: void PaintWeather() override { - _drawingContext->CalculcateClipping(&_bitsDPI); + _drawingContext->CalculcateClipping(_bitsDPI); DrawWeather(_bitsDPI, &_weatherDrawer); } @@ -509,7 +509,7 @@ void OpenGLDrawingContext::StartNewDraw() _swapFramebuffer->Clear(); } -void OpenGLDrawingContext::Clear(DrawPixelInfo* dpi, uint8_t paletteIndex) +void OpenGLDrawingContext::Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) { CalculcateClipping(dpi); @@ -517,7 +517,7 @@ void OpenGLDrawingContext::Clear(DrawPixelInfo* dpi, uint8_t paletteIndex) } void OpenGLDrawingContext::FillRect( - DrawPixelInfo* dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) + DrawPixelInfo& dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) { CalculcateClipping(dpi); @@ -552,7 +552,7 @@ void OpenGLDrawingContext::FillRect( } void OpenGLDrawingContext::FilterRect( - DrawPixelInfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) + DrawPixelInfo& dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) { CalculcateClipping(dpi); @@ -575,7 +575,7 @@ void OpenGLDrawingContext::FilterRect( command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawLine(DrawPixelInfo* dpi, uint32_t colour, const ScreenLine& line) +void OpenGLDrawingContext::DrawLine(DrawPixelInfo& dpi, uint32_t colour, const ScreenLine& line) { CalculcateClipping(dpi); @@ -587,7 +587,7 @@ void OpenGLDrawingContext::DrawLine(DrawPixelInfo* dpi, uint32_t colour, const S command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, int32_t x, int32_t y) +void OpenGLDrawingContext::DrawSprite(DrawPixelInfo& dpi, const ImageId imageId, int32_t x, int32_t y) { CalculcateClipping(dpi); @@ -597,19 +597,19 @@ void OpenGLDrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, return; } - if (dpi->zoom_level > ZoomLevel{ 0 }) + if (dpi.zoom_level > ZoomLevel{ 0 }) { if (g1Element->flags & G1_FLAG_HAS_ZOOM_SPRITE) { DrawPixelInfo zoomedDPI; - zoomedDPI.bits = dpi->bits; - zoomedDPI.x = dpi->x >> 1; - zoomedDPI.y = dpi->y >> 1; - zoomedDPI.height = dpi->height >> 1; - zoomedDPI.width = dpi->width >> 1; - zoomedDPI.pitch = dpi->pitch; - zoomedDPI.zoom_level = dpi->zoom_level - 1; - DrawSprite(&zoomedDPI, imageId.WithIndex(imageId.GetIndex() - g1Element->zoomed_offset), x >> 1, y >> 1); + zoomedDPI.bits = dpi.bits; + zoomedDPI.x = dpi.x >> 1; + zoomedDPI.y = dpi.y >> 1; + zoomedDPI.height = dpi.height >> 1; + zoomedDPI.width = dpi.width >> 1; + zoomedDPI.pitch = dpi.pitch; + zoomedDPI.zoom_level = dpi.zoom_level - 1; + DrawSprite(zoomedDPI, imageId.WithIndex(imageId.GetIndex() - g1Element->zoomed_offset), x >> 1, y >> 1); return; } if (g1Element->flags & G1_FLAG_NO_ZOOM_DRAW) @@ -622,11 +622,11 @@ void OpenGLDrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, int32_t top = y + g1Element->y_offset; int32_t zoom_mask; - if (dpi->zoom_level >= ZoomLevel{ 0 }) - zoom_mask = dpi->zoom_level.ApplyTo(0xFFFFFFFF); + if (dpi.zoom_level >= ZoomLevel{ 0 }) + zoom_mask = dpi.zoom_level.ApplyTo(0xFFFFFFFF); else zoom_mask = 0xFFFFFFFF; - if (dpi->zoom_level != ZoomLevel{ 0 } && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) + if (dpi.zoom_level != ZoomLevel{ 0 } && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) { top -= ~zoom_mask; } @@ -642,7 +642,7 @@ void OpenGLDrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, int32_t right = left + g1Element->width; int32_t bottom = top + g1Element->height; - if (dpi->zoom_level != ZoomLevel{ 0 } && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) + if (dpi.zoom_level != ZoomLevel{ 0 } && (g1Element->flags & G1_FLAG_RLE_COMPRESSION)) { bottom += top & ~zoom_mask; } @@ -656,15 +656,15 @@ void OpenGLDrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, std::swap(top, bottom); } - left -= dpi->x; - top -= dpi->y; - right -= dpi->x; - bottom -= dpi->y; + left -= dpi.x; + top -= dpi.y; + right -= dpi.x; + bottom -= dpi.y; - left = dpi->zoom_level.ApplyInversedTo(left); - top = dpi->zoom_level.ApplyInversedTo(top); - right = dpi->zoom_level.ApplyInversedTo(right); - bottom = dpi->zoom_level.ApplyInversedTo(bottom); + left = dpi.zoom_level.ApplyInversedTo(left); + top = dpi.zoom_level.ApplyInversedTo(top); + right = dpi.zoom_level.ApplyInversedTo(right); + bottom = dpi.zoom_level.ApplyInversedTo(bottom); left += _spriteOffset.x; top += _spriteOffset.y; @@ -738,7 +738,7 @@ void OpenGLDrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, } void OpenGLDrawingContext::DrawSpriteRawMasked( - DrawPixelInfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) + DrawPixelInfo& dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) { CalculcateClipping(dpi); @@ -771,15 +771,15 @@ void OpenGLDrawingContext::DrawSpriteRawMasked( std::swap(top, bottom); } - left -= dpi->x; - top -= dpi->y; - right -= dpi->x; - bottom -= dpi->y; + left -= dpi.x; + top -= dpi.y; + right -= dpi.x; + bottom -= dpi.y; - left = dpi->zoom_level.ApplyInversedTo(left); - top = dpi->zoom_level.ApplyInversedTo(top); - right = dpi->zoom_level.ApplyInversedTo(right); - bottom = dpi->zoom_level.ApplyInversedTo(bottom); + left = dpi.zoom_level.ApplyInversedTo(left); + top = dpi.zoom_level.ApplyInversedTo(top); + right = dpi.zoom_level.ApplyInversedTo(right); + bottom = dpi.zoom_level.ApplyInversedTo(bottom); left += _spriteOffset.x; top += _spriteOffset.y; @@ -800,7 +800,7 @@ void OpenGLDrawingContext::DrawSpriteRawMasked( command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) +void OpenGLDrawingContext::DrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) { CalculcateClipping(dpi); @@ -852,7 +852,7 @@ void OpenGLDrawingContext::DrawSpriteSolid(DrawPixelInfo* dpi, const ImageId ima command.depth = _drawCount++; } -void OpenGLDrawingContext::DrawGlyph(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) +void OpenGLDrawingContext::DrawGlyph(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) { CalculcateClipping(dpi); @@ -878,15 +878,15 @@ void OpenGLDrawingContext::DrawGlyph(DrawPixelInfo* dpi, const ImageId image, in std::swap(top, bottom); } - left -= dpi->x; - top -= dpi->y; - right -= dpi->x; - bottom -= dpi->y; + left -= dpi.x; + top -= dpi.y; + right -= dpi.x; + bottom -= dpi.y; - left = dpi->zoom_level.ApplyInversedTo(left); - top = dpi->zoom_level.ApplyInversedTo(top); - right = dpi->zoom_level.ApplyInversedTo(right); - bottom = dpi->zoom_level.ApplyInversedTo(bottom); + left = dpi.zoom_level.ApplyInversedTo(left); + top = dpi.zoom_level.ApplyInversedTo(top); + right = dpi.zoom_level.ApplyInversedTo(right); + bottom = dpi.zoom_level.ApplyInversedTo(bottom); left += _spriteOffset.x; top += _spriteOffset.y; @@ -908,7 +908,7 @@ void OpenGLDrawingContext::DrawGlyph(DrawPixelInfo* dpi, const ImageId image, in } void OpenGLDrawingContext::DrawTTFBitmap( - DrawPixelInfo* dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, + DrawPixelInfo& dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y, uint8_t hinting_threshold) { CalculcateClipping(dpi); @@ -1067,24 +1067,24 @@ void OpenGLDrawingContext::HandleTransparency() _commandBuffers.transparent.clear(); } -void OpenGLDrawingContext::CalculcateClipping(DrawPixelInfo* dpi) +void OpenGLDrawingContext::CalculcateClipping(DrawPixelInfo& dpi) { auto screenDPI = _engine.GetDPI(); auto bytesPerRow = screenDPI->GetBytesPerRow(); - auto bitsOffset = static_cast(dpi->bits - screenDPI->bits); + auto bitsOffset = static_cast(dpi.bits - screenDPI->bits); # ifndef NDEBUG auto bitsSize = static_cast(screenDPI->height) * bytesPerRow; assert(bitsOffset < bitsSize); # endif - _clipLeft = static_cast(bitsOffset % bytesPerRow) + dpi->remX; - _clipTop = static_cast(bitsOffset / bytesPerRow) + dpi->remY; - _clipRight = _clipLeft + dpi->zoom_level.ApplyInversedTo(dpi->width); - _clipBottom = _clipTop + dpi->zoom_level.ApplyInversedTo(dpi->height); - _offsetX = _clipLeft - dpi->x; - _offsetY = _clipTop - dpi->y; - _spriteOffset.x = _clipLeft - dpi->remX; - _spriteOffset.y = _clipTop - dpi->remY; + _clipLeft = static_cast(bitsOffset % bytesPerRow) + dpi.remX; + _clipTop = static_cast(bitsOffset / bytesPerRow) + dpi.remY; + _clipRight = _clipLeft + dpi.zoom_level.ApplyInversedTo(dpi.width); + _clipBottom = _clipTop + dpi.zoom_level.ApplyInversedTo(dpi.height); + _offsetX = _clipLeft - dpi.x; + _offsetY = _clipTop - dpi.y; + _spriteOffset.x = _clipLeft - dpi.remX; + _spriteOffset.y = _clipTop - dpi.remY; } #endif /* DISABLE_OPENGL */ diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 0bec2d7d03..f85879ecdb 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -829,12 +829,12 @@ static void WidgetDrawImage(DrawPixelInfo& dpi, WindowBase& w, WidgetIndex widge // Draw greyed out (light border bottom right shadow) colour = w.colours[widget.colour]; colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter; - GfxDrawSpriteSolid(&dpi, image, screenCoords + ScreenCoordsXY{ 1, 1 }, colour); + GfxDrawSpriteSolid(dpi, image, screenCoords + ScreenCoordsXY{ 1, 1 }, colour); // Draw greyed out (dark) colour = w.colours[widget.colour]; colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light; - GfxDrawSpriteSolid(&dpi, image, screenCoords, colour); + GfxDrawSpriteSolid(dpi, image, screenCoords, colour); } else { diff --git a/src/openrct2-ui/scripting/ScGraphicsContext.hpp b/src/openrct2-ui/scripting/ScGraphicsContext.hpp index 9d444c5b12..9115d1033c 100644 --- a/src/openrct2-ui/scripting/ScGraphicsContext.hpp +++ b/src/openrct2-ui/scripting/ScGraphicsContext.hpp @@ -175,7 +175,7 @@ namespace OpenRCT2::Scripting void clear() { - GfxClear(&_dpi, _fill); + GfxClear(_dpi, _fill); } void clip(int32_t x, int32_t y, int32_t width, int32_t height) diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index 2b292e5efb..a64b1035ff 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -275,7 +275,7 @@ static Widget _inventionListDragWidgets[] = { // Draw background uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); + GfxClear(dpi, paletteIndex); int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width(); int32_t itemY = -SCROLLABLE_ROW_HEIGHT; diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 3aa91da3df..d0c5eef8f0 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -720,7 +720,7 @@ static std::vector _window_editor_object_selection_widgets = { bool ridePage = (GetSelectedObjectType() == ObjectType::Ride); uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); + GfxClear(dpi, paletteIndex); screenCoords.y = 0; for (size_t i = 0; i < _listItems.size(); i++) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 3c07bf2e23..b6aa56a318 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -775,7 +775,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { - GfxClear(&dpi, PALETTE_INDEX_10); + GfxClear(dpi, PALETTE_INDEX_10); G1Element g1temp = {}; g1temp.offset = _mapImageData.data(); diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 0c99fc1f98..d421df45d1 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -652,12 +652,12 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { // Draw greyed out (light border bottom right shadow) auto colour = colours[widget.colour]; colour = ColourMapA[NOT_TRANSLUCENT(colour)].lighter; - GfxDrawSpriteSolid(&dpi, image, pos + ScreenCoordsXY{ 1, 1 }, colour); + GfxDrawSpriteSolid(dpi, image, pos + ScreenCoordsXY{ 1, 1 }, colour); // Draw greyed out (dark) colour = colours[widget.colour]; colour = ColourMapA[NOT_TRANSLUCENT(colour)].mid_light; - GfxDrawSpriteSolid(&dpi, image, pos, colour); + GfxDrawSpriteSolid(dpi, image, pos, colour); } else { diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index d20b49db76..805f254de6 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -479,7 +479,7 @@ static Widget window_new_ride_widgets[] = { return; } - GfxClear(&dpi, ColourMapA[colours[1]].mid_light); + GfxClear(dpi, ColourMapA[colours[1]].mid_light); ScreenCoordsXY coords{ 1, 1 }; RideSelection* listItem = _windowNewRideListItems; @@ -497,7 +497,7 @@ static Widget window_new_ride_widgets[] = { // Draw ride image with feathered border auto mask = ImageId(SPR_NEW_RIDE_MASK); auto rideImage = ImageId(GetRideImage(*listItem)); - GfxDrawSpriteRawMasked(&dpi, coords + ScreenCoordsXY{ 2, 2 }, mask, rideImage); + GfxDrawSpriteRawMasked(dpi, coords + ScreenCoordsXY{ 2, 2 }, mask, rideImage); // Next position coords.x += 116; diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 9d2a0dab49..d7917b4c98 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2116,10 +2116,10 @@ static Widget *window_options_page_widgets[] = { // Draw greyed out (light border bottom right shadow) GfxDrawSpriteSolid( - &dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter); + dpi, ImageId(spriteIndex), screenCoords + ScreenCoordsXY{ 1, 1 }, ColourMapA[window_colour].lighter); // Draw greyed out (dark) - GfxDrawSpriteSolid(&dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light); + GfxDrawSpriteSolid(dpi, ImageId(spriteIndex), screenCoords, ColourMapA[window_colour].mid_light); } } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 2d09cbdff7..b15df0d039 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4739,7 +4739,7 @@ static_assert(std::size(RatingNames) == 6); windowPos + ScreenCoordsXY{ entrancePreviewWidget.left + 1, entrancePreviewWidget.top + 1 }, entrancePreviewWidget.width(), entrancePreviewWidget.height())) { - GfxClear(&clippedDpi, PALETTE_INDEX_12); + GfxClear(clippedDpi, PALETTE_INDEX_12); auto stationObj = ride->GetStationObject(); if (stationObj != nullptr && stationObj->BaseImageId != ImageIndexUndefined) @@ -5763,7 +5763,7 @@ static_assert(std::size(RatingNames) == 6); void GraphsOnScrollDraw(DrawPixelInfo& dpi, int32_t scrollIndex) { - GfxClear(&dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker); + GfxClear(dpi, ColourMapA[COLOUR_SATURATED_GREEN].darker); auto widget = &widgets[WIDX_GRAPH]; auto ride = GetRide(rideId); diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 795a87fda5..c545df6ec6 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -401,7 +401,7 @@ static Widget _scenarioSelectWidgets[] = { void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); + GfxClear(dpi, paletteIndex); StringId highlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_WINDOW_COLOUR_2_STRINGID; StringId unhighlighted_format = ScenarioSelectUseSmallFont() ? STR_WHITE_STRING : STR_BLACK_STRING; diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 5b8f444d42..d368131297 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -1635,7 +1635,7 @@ static Widget WindowSceneryBaseWidgets[] = { void ContentScrollDraw(DrawPixelInfo& dpi) { - GfxClear(&dpi, ColourMapA[colours[1]].mid_light); + GfxClear(dpi, ColourMapA[colours[1]].mid_light); auto numColumns = GetNumColumns(); auto tabIndex = _activeTabIndex; diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 3f520921e9..40ddebecae 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -335,7 +335,7 @@ static Widget _serverListWidgets[] = { void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override { uint8_t paletteIndex = ColourMapA[colours[1]].mid_light; - GfxClear(&dpi, paletteIndex); + GfxClear(dpi, paletteIndex); auto& listWidget = widgets[WIDX_LIST]; int32_t listWidgetWidth = listWidget.width(); diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 9356636964..168291d695 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -759,7 +759,7 @@ static WindowClass window_themes_tab_7_classes[] = { if ((colours[1] & 0x80) == 0) // GfxFillRect(dpi, dpi->x, dpi->y, dpi->x + dpi->width - 1, dpi->y + dpi->height - 1, // ColourMapA[colours[1]].mid_light); - GfxClear(&dpi, ColourMapA[colours[1]].mid_light); + GfxClear(dpi, ColourMapA[colours[1]].mid_light); screenCoords.y = 0; for (int32_t i = 0; i < GetColourSchemeTabCount(); i++) { diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index edc4b91b8e..440abd0cc3 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -677,7 +677,7 @@ static Widget _trackListWidgets[] = { void OnScrollDraw(const int32_t scrollIndex, DrawPixelInfo& dpi) override { uint8_t paletteIndex = ColourMapA[colours[0]].mid_light; - GfxClear(&dpi, paletteIndex); + GfxClear(dpi, paletteIndex); auto screenCoords = ScreenCoordsXY{ 0, 0 }; size_t listIndex = 0; diff --git a/src/openrct2/Intro.cpp b/src/openrct2/Intro.cpp index 8c9f024f4e..3fb9106a88 100644 --- a/src/openrct2/Intro.cpp +++ b/src/openrct2/Intro.cpp @@ -178,10 +178,10 @@ void IntroDraw(DrawPixelInfo& dpi) case IntroState::Disclaimer2: break; case IntroState::PublisherBegin: - GfxClear(&dpi, kBackgroundColourDark); + GfxClear(dpi, kBackgroundColourDark); break; case IntroState::PublisherScroll: - GfxClear(&dpi, kBackgroundColourDark); + GfxClear(dpi, kBackgroundColourDark); // Draw a white rectangle for the logo background (gives a bit of white margin) GfxFillRect( @@ -197,11 +197,11 @@ void IntroDraw(DrawPixelInfo& dpi) GfxDrawSprite(dpi, ImageId(SPR_INTRO_INFOGRAMES_11), { (screenWidth / 2) - 320 + 319, _introStateCounter + 319 }); break; case IntroState::DeveloperBegin: - GfxClear(&dpi, kBackgroundColourDark); + GfxClear(dpi, kBackgroundColourDark); GfxTransposePalette(PALETTE_G1_IDX_DEVELOPER, 255); break; case IntroState::DeveloperScroll: - GfxClear(&dpi, kBackgroundColourDark); + GfxClear(dpi, kBackgroundColourDark); // Draw Chris Sawyer logo GfxDrawSprite(dpi, ImageId(SPR_INTRO_CHRIS_SAWYER_00), { (screenWidth / 2) - 320 + 70, _introStateCounter }); @@ -233,7 +233,7 @@ void IntroDraw(DrawPixelInfo& dpi) ScreenIntroDrawLogo(dpi); break; case IntroState::Clear: - GfxClear(&dpi, kBackgroundColourDark); + GfxClear(dpi, kBackgroundColourDark); break; default: break; @@ -293,7 +293,7 @@ static void ScreenIntroDrawLogo(DrawPixelInfo& dpi) DrawingEngineInvalidateImage(SPR_INTRO_LOGO_11); DrawingEngineInvalidateImage(SPR_INTRO_LOGO_21); - GfxClear(&dpi, kBackgroundColourLogo); + GfxClear(dpi, kBackgroundColourLogo); GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_00), { imageX + 0, 0 }); GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_10), { imageX + 220, 0 }); GfxDrawSprite(dpi, ImageId(SPR_INTRO_LOGO_20), { imageX + 440, 0 }); diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index f8e44f4503..8d6ac1fd11 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -492,7 +492,7 @@ static void TTFDrawCharacterSprite(DrawPixelInfo& dpi, int32_t codepoint, TextDr } PaletteMap paletteMap(info->palette); - GfxDrawGlyph(&dpi, sprite, screenCoords, paletteMap); + GfxDrawGlyph(dpi, sprite, screenCoords, paletteMap); } info->x += characterWidth; @@ -548,7 +548,7 @@ static void TTFDrawStringRawTTF(DrawPixelInfo& dpi, std::string_view text, TextD uint8_t hint_thresh = use_hinting ? fontDesc->hinting_threshold : 0; drawingEngine->InvalidateImage(imageId); drawingContext->DrawTTFBitmap( - &dpi, info, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY, hint_thresh); + dpi, info, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY, hint_thresh); _ttfGlId++; if (_ttfGlId >= 1023) diff --git a/src/openrct2/drawing/Drawing.h b/src/openrct2/drawing/Drawing.h index cc375ef02a..a4225bd0f0 100644 --- a/src/openrct2/drawing/Drawing.h +++ b/src/openrct2/drawing/Drawing.h @@ -537,7 +537,7 @@ void GfxTransposePalette(int32_t pal, uint8_t product); void LoadPalette(); // other -void GfxClear(DrawPixelInfo* dpi, uint8_t paletteIndex); +void GfxClear(DrawPixelInfo& dpi, uint8_t paletteIndex); void GfxFilterPixel(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, FilterPaletteID palette); void GfxInvalidatePickedUpPeep(); void GfxDrawPickedUpPeep(DrawPixelInfo& dpi); @@ -569,10 +569,10 @@ void FASTCALL GfxSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& args); void FASTCALL GfxBmpSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& args); void FASTCALL GfxRleSpriteToBuffer(DrawPixelInfo& dpi, const DrawSpriteArgs& args); void FASTCALL GfxDrawSprite(DrawPixelInfo& dpi, const ImageId image_id, const ScreenCoordsXY& coords); -void FASTCALL GfxDrawGlyph(DrawPixelInfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); -void FASTCALL GfxDrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour); +void FASTCALL GfxDrawGlyph(DrawPixelInfo& dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); +void FASTCALL GfxDrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour); void FASTCALL GfxDrawSpriteRawMasked( - DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage); + DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage); void FASTCALL GfxDrawSpriteSoftware(DrawPixelInfo& dpi, const ImageId imageId, const ScreenCoordsXY& spriteCoords); void FASTCALL GfxDrawSpritePaletteSetSoftware( DrawPixelInfo& dpi, const ImageId imageId, const ScreenCoordsXY& coords, const PaletteMap& paletteMap); diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index ed1ec471ca..9bff8c72fb 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -20,20 +20,20 @@ namespace OpenRCT2::Drawing { virtual ~IDrawingContext() = default; - virtual void Clear(DrawPixelInfo* dpi, uint8_t paletteIndex) abstract; + virtual void Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) abstract; virtual void FillRect( - DrawPixelInfo* dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; + DrawPixelInfo& dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; virtual void FilterRect( - DrawPixelInfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; - virtual void DrawLine(DrawPixelInfo* dpi, uint32_t colour, const ScreenLine& line) abstract; - virtual void DrawSprite(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y) abstract; + DrawPixelInfo& dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) abstract; + virtual void DrawLine(DrawPixelInfo& dpi, uint32_t colour, const ScreenLine& line) abstract; + virtual void DrawSprite(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y) abstract; virtual void DrawSpriteRawMasked( - DrawPixelInfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) abstract; - virtual void DrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) abstract; + DrawPixelInfo& dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) abstract; + virtual void DrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) abstract; virtual void DrawGlyph( - DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) abstract; + DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) abstract; virtual void DrawTTFBitmap( - DrawPixelInfo* dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, + DrawPixelInfo& dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y, uint8_t hinting_threshold) abstract; }; diff --git a/src/openrct2/drawing/NewDrawing.cpp b/src/openrct2/drawing/NewDrawing.cpp index 217f9257c5..03399e1ed1 100644 --- a/src/openrct2/drawing/NewDrawing.cpp +++ b/src/openrct2/drawing/NewDrawing.cpp @@ -160,9 +160,9 @@ void GfxSetDirtyBlocks(const ScreenRect& rect) } } -void GfxClear(DrawPixelInfo* dpi, uint8_t paletteIndex) +void GfxClear(DrawPixelInfo& dpi, uint8_t paletteIndex) { - auto drawingEngine = dpi->DrawingEngine; + auto drawingEngine = dpi.DrawingEngine; if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); @@ -176,7 +176,7 @@ void GfxFillRect(DrawPixelInfo& dpi, const ScreenRect& rect, int32_t colour) if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); - dc->FillRect(&dpi, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); + dc->FillRect(dpi, colour, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); } } @@ -186,7 +186,7 @@ void GfxFilterRect(DrawPixelInfo& dpi, const ScreenRect& rect, FilterPaletteID p if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); - dc->FilterRect(&dpi, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); + dc->FilterRect(dpi, palette, rect.GetLeft(), rect.GetTop(), rect.GetRight(), rect.GetBottom()); } } @@ -196,7 +196,7 @@ void GfxDrawLine(DrawPixelInfo& dpi, const ScreenLine& line, int32_t colour) if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); - dc->DrawLine(&dpi, colour, line); + dc->DrawLine(dpi, colour, line); } } @@ -228,7 +228,7 @@ void GfxDrawDashedLine( { 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 } }); + dc->DrawLine(dpi, color, { { x, y }, { x + dxPrecise / precisionFactor, y + dyPrecise / precisionFactor } }); } } } @@ -239,13 +239,13 @@ void FASTCALL GfxDrawSprite(DrawPixelInfo& dpi, const ImageId imageId, const Scr if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); - dc->DrawSprite(&dpi, imageId, coords.x, coords.y); + dc->DrawSprite(dpi, imageId, coords.x, coords.y); } } -void FASTCALL GfxDrawGlyph(DrawPixelInfo* dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap) +void FASTCALL GfxDrawGlyph(DrawPixelInfo& dpi, const ImageId image, const ScreenCoordsXY& coords, const PaletteMap& paletteMap) { - auto drawingEngine = dpi->DrawingEngine; + auto drawingEngine = dpi.DrawingEngine; if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); @@ -254,9 +254,9 @@ void FASTCALL GfxDrawGlyph(DrawPixelInfo* dpi, const ImageId image, const Screen } void FASTCALL - GfxDrawSpriteRawMasked(DrawPixelInfo* dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage) + GfxDrawSpriteRawMasked(DrawPixelInfo& dpi, const ScreenCoordsXY& coords, const ImageId maskImage, const ImageId colourImage) { - auto drawingEngine = dpi->DrawingEngine; + auto drawingEngine = dpi.DrawingEngine; if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); @@ -264,9 +264,9 @@ void FASTCALL } } -void FASTCALL GfxDrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour) +void FASTCALL GfxDrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, const ScreenCoordsXY& coords, uint8_t colour) { - auto drawingEngine = dpi->DrawingEngine; + auto drawingEngine = dpi.DrawingEngine; if (drawingEngine != nullptr) { IDrawingContext* dc = drawingEngine->GetDrawingContext(); diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index a5f12264a0..c7f54ec56f 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -92,12 +92,12 @@ void X8WeatherDrawer::Draw( } } -void X8WeatherDrawer::Restore(DrawPixelInfo* dpi) +void X8WeatherDrawer::Restore(DrawPixelInfo& dpi) { if (_weatherPixelsCount > 0) { - uint32_t numPixels = (dpi->width + dpi->pitch) * dpi->height; - uint8_t* bits = dpi->bits; + uint32_t numPixels = (dpi.width + dpi.pitch) * dpi.height; + uint8_t* bits = dpi.bits; for (uint32_t i = 0; i < _weatherPixelsCount; i++) { WeatherPixel weatherPixel = _weatherPixels[i]; @@ -193,7 +193,7 @@ void X8DrawingEngine::BeginDraw() { Resize(_width, _height); } - _weatherDrawer.Restore(&_bitsDPI); + _weatherDrawer.Restore(_bitsDPI); } } @@ -460,16 +460,16 @@ X8DrawingContext::X8DrawingContext(X8DrawingEngine* engine) _engine = engine; } -void X8DrawingContext::Clear(DrawPixelInfo* dpi, uint8_t paletteIndex) +void X8DrawingContext::Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) { - int32_t w = dpi->zoom_level.ApplyInversedTo(dpi->width); - int32_t h = dpi->zoom_level.ApplyInversedTo(dpi->height); - uint8_t* ptr = dpi->bits; + int32_t w = dpi.zoom_level.ApplyInversedTo(dpi.width); + int32_t h = dpi.zoom_level.ApplyInversedTo(dpi.height); + uint8_t* ptr = dpi.bits; for (int32_t y = 0; y < h; y++) { std::fill_n(ptr, w, paletteIndex); - ptr += w + dpi->pitch; + ptr += w + dpi.pitch; } } @@ -521,47 +521,47 @@ static constexpr const uint16_t* Patterns[] = { }; // clang-format on -void X8DrawingContext::FillRect(DrawPixelInfo* dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) +void X8DrawingContext::FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t left, int32_t top, int32_t right, int32_t bottom) { if (left > right) return; if (top > bottom) return; - if (dpi->x > right) + if (dpi.x > right) return; - if (left >= dpi->x + dpi->width) + if (left >= dpi.x + dpi.width) return; - if (bottom < dpi->y) + if (bottom < dpi.y) return; - if (top >= dpi->y + dpi->height) + if (top >= dpi.y + dpi.height) return; uint16_t crossPattern = 0; - int32_t startX = left - dpi->x; + int32_t startX = left - dpi.x; if (startX < 0) { crossPattern ^= startX; startX = 0; } - int32_t endX = right - dpi->x + 1; - if (endX > dpi->width) + int32_t endX = right - dpi.x + 1; + if (endX > dpi.width) { - endX = dpi->width; + endX = dpi.width; } - int32_t startY = top - dpi->y; + int32_t startY = top - dpi.y; if (startY < 0) { crossPattern ^= startY; startY = 0; } - int32_t endY = bottom - dpi->y + 1; - if (endY > dpi->height) + int32_t endY = bottom - dpi.y + 1; + if (endY > dpi.height) { - endY = dpi->height; + endY = dpi.height; } int32_t width = endX - startX; @@ -570,10 +570,10 @@ void X8DrawingContext::FillRect(DrawPixelInfo* dpi, uint32_t colour, int32_t lef if (colour & 0x1000000) { // Cross hatching - uint8_t* dst = (startY * (dpi->width + dpi->pitch)) + startX + dpi->bits; + uint8_t* dst = (startY * (dpi.width + dpi.pitch)) + startX + dpi.bits; for (int32_t i = 0; i < height; i++) { - uint8_t* nextdst = dst + dpi->width + dpi->pitch; + uint8_t* nextdst = dst + dpi.width + dpi.pitch; uint32_t p = Numerics::ror32(crossPattern, 1); p = (p & 0xFFFF0000) | width; @@ -597,22 +597,22 @@ void X8DrawingContext::FillRect(DrawPixelInfo* dpi, uint32_t colour, int32_t lef } else if (colour & 0x4000000) { - uint8_t* dst = startY * (dpi->width + dpi->pitch) + startX + dpi->bits; + uint8_t* dst = startY * (dpi.width + dpi.pitch) + startX + dpi.bits; // The pattern loops every 15 lines this is which // part the pattern is on. - int32_t patternY = (startY + dpi->y) % 16; + int32_t patternY = (startY + dpi.y) % 16; // The pattern loops every 15 pixels this is which // part the pattern is on. - int32_t startPatternX = (startX + dpi->x) % 16; + int32_t startPatternX = (startX + dpi.x) % 16; int32_t patternX = startPatternX; const uint16_t* patternsrc = Patterns[colour >> 28]; // or possibly uint8_t)[esi*4] ? for (int32_t numLines = height; numLines > 0; numLines--) { - uint8_t* nextdst = dst + dpi->width + dpi->pitch; + uint8_t* nextdst = dst + dpi.width + dpi.pitch; uint16_t pattern = patternsrc[patternY]; for (int32_t numPixels = width; numPixels > 0; numPixels--) @@ -631,53 +631,53 @@ void X8DrawingContext::FillRect(DrawPixelInfo* dpi, uint32_t colour, int32_t lef } else { - uint8_t* dst = startY * (dpi->width + dpi->pitch) + startX + dpi->bits; + uint8_t* dst = startY * (dpi.width + dpi.pitch) + startX + dpi.bits; for (int32_t i = 0; i < height; i++) { std::fill_n(dst, width, colour & 0xFF); - dst += dpi->width + dpi->pitch; + dst += dpi.width + dpi.pitch; } } } void X8DrawingContext::FilterRect( - DrawPixelInfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) + DrawPixelInfo& dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) { if (left > right) return; if (top > bottom) return; - if (dpi->x > right) + if (dpi.x > right) return; - if (left >= dpi->x + dpi->width) + if (left >= dpi.x + dpi.width) return; - if (bottom < dpi->y) + if (bottom < dpi.y) return; - if (top >= dpi->y + dpi->height) + if (top >= dpi.y + dpi.height) return; - int32_t startX = left - dpi->x; + int32_t startX = left - dpi.x; if (startX < 0) { startX = 0; } - int32_t endX = right - dpi->x + 1; - if (endX > dpi->width) + int32_t endX = right - dpi.x + 1; + if (endX > dpi.width) { - endX = dpi->width; + endX = dpi.width; } - int32_t startY = top - dpi->y; + int32_t startY = top - dpi.y; if (startY < 0) { startY = 0; } - int32_t endY = bottom - dpi->y + 1; - if (endY > dpi->height) + int32_t endY = bottom - dpi.y + 1; + if (endY > dpi.height) { - endY = dpi->height; + endY = dpi.height; } int32_t width = endX - startX; @@ -686,21 +686,21 @@ void X8DrawingContext::FilterRect( // 0x2000000 // 00678B7E 00678C83 // Location in screen buffer? - uint8_t* dst = dpi->bits + uint8_t* dst = dpi.bits + static_cast( - dpi->zoom_level.ApplyInversedTo(startY) * (dpi->zoom_level.ApplyInversedTo(dpi->width) + dpi->pitch) - + dpi->zoom_level.ApplyInversedTo(startX)); + dpi.zoom_level.ApplyInversedTo(startY) * (dpi.zoom_level.ApplyInversedTo(dpi.width) + dpi.pitch) + + dpi.zoom_level.ApplyInversedTo(startX)); // Find colour in colour table? auto paletteMap = GetPaletteMapForColour(EnumValue(palette)); if (paletteMap.has_value()) { const auto& paletteEntries = paletteMap.value(); - const int32_t scaled_width = dpi->zoom_level.ApplyInversedTo(width); - const int32_t step = dpi->zoom_level.ApplyInversedTo(dpi->width) + dpi->pitch; + const int32_t scaled_width = dpi.zoom_level.ApplyInversedTo(width); + const int32_t step = dpi.zoom_level.ApplyInversedTo(dpi.width) + dpi.pitch; // Fill the rectangle with the colours from the colour table - auto c = dpi->zoom_level.ApplyInversedTo(height); + auto c = dpi.zoom_level.ApplyInversedTo(height); for (int32_t i = 0; i < c; i++) { uint8_t* nextdst = dst + step * i; @@ -713,33 +713,33 @@ void X8DrawingContext::FilterRect( } } -void X8DrawingContext::DrawLine(DrawPixelInfo* dpi, uint32_t colour, const ScreenLine& line) +void X8DrawingContext::DrawLine(DrawPixelInfo& dpi, uint32_t colour, const ScreenLine& line) { - GfxDrawLineSoftware(*dpi, line, colour); + GfxDrawLineSoftware(dpi, line, colour); } -void X8DrawingContext::DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, int32_t x, int32_t y) +void X8DrawingContext::DrawSprite(DrawPixelInfo& dpi, const ImageId imageId, int32_t x, int32_t y) { - GfxDrawSpriteSoftware(*dpi, imageId, { x, y }); + GfxDrawSpriteSoftware(dpi, imageId, { x, y }); } void X8DrawingContext::DrawSpriteRawMasked( - DrawPixelInfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) + DrawPixelInfo& dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) { - GfxDrawSpriteRawMaskedSoftware(*dpi, { x, y }, maskImage, colourImage); + GfxDrawSpriteRawMaskedSoftware(dpi, { x, y }, maskImage, colourImage); } -void X8DrawingContext::DrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) +void X8DrawingContext::DrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) { uint8_t palette[256]; std::fill_n(palette, sizeof(palette), colour); palette[0] = 0; const auto spriteCoords = ScreenCoordsXY{ x, y }; - GfxDrawSpritePaletteSetSoftware(*dpi, ImageId(image.GetIndex(), 0), spriteCoords, PaletteMap(palette)); + GfxDrawSpritePaletteSetSoftware(dpi, ImageId(image.GetIndex(), 0), spriteCoords, PaletteMap(palette)); } -void X8DrawingContext::DrawGlyph(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& paletteMap) +void X8DrawingContext::DrawGlyph(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& paletteMap) { - GfxDrawSpritePaletteSetSoftware(*dpi, image, { x, y }, paletteMap); + GfxDrawSpritePaletteSetSoftware(dpi, image, { x, y }, paletteMap); } diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index fb4eed44c5..97bc0b93bc 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -58,7 +58,7 @@ namespace OpenRCT2 void Draw( DrawPixelInfo& dpi, int32_t x, int32_t y, int32_t width, int32_t height, int32_t xStart, int32_t yStart, const uint8_t* weatherpattern) override; - void Restore(DrawPixelInfo* dpi); + void Restore(DrawPixelInfo& dpi); }; #ifdef __WARN_SUGGEST_FINAL_TYPES__ @@ -136,19 +136,19 @@ namespace OpenRCT2 public: explicit X8DrawingContext(X8DrawingEngine* engine); - void Clear(DrawPixelInfo* dpi, uint8_t paletteIndex) override; - void FillRect(DrawPixelInfo* dpi, uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; + void Clear(DrawPixelInfo& dpi, uint8_t paletteIndex) override; + void FillRect(DrawPixelInfo& dpi, uint32_t colour, int32_t x, int32_t y, int32_t w, int32_t h) override; void FilterRect( - DrawPixelInfo* dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; - void DrawLine(DrawPixelInfo* dpi, uint32_t colour, const ScreenLine& line) override; - void DrawSprite(DrawPixelInfo* dpi, const ImageId imageId, int32_t x, int32_t y) override; + DrawPixelInfo& dpi, FilterPaletteID palette, int32_t left, int32_t top, int32_t right, int32_t bottom) override; + void DrawLine(DrawPixelInfo& dpi, uint32_t colour, const ScreenLine& line) override; + void DrawSprite(DrawPixelInfo& dpi, const ImageId imageId, int32_t x, int32_t y) override; void DrawSpriteRawMasked( - DrawPixelInfo* dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) override; - void DrawSpriteSolid(DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) override; + DrawPixelInfo& dpi, int32_t x, int32_t y, const ImageId maskImage, const ImageId colourImage) override; + void DrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) override; void DrawGlyph( - DrawPixelInfo* dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& paletteMap) override; + DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& paletteMap) override; void DrawTTFBitmap( - DrawPixelInfo* dpi, TextDrawInfo* info, uint32_t image, const void* pixels, int32_t width, int32_t height, + DrawPixelInfo& dpi, TextDrawInfo* info, uint32_t image, const void* pixels, int32_t width, int32_t height, int32_t x, int32_t y, uint8_t hinting_threshold) override { } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 5e05f2c3b9..346bdda872 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -987,7 +987,7 @@ static void ViewportPaintColumn(PaintSession& session) { colour = COLOUR_BLACK; } - GfxClear(&session.DPI, colour); + GfxClear(session.DPI, colour); } PaintDrawStructs(session); diff --git a/src/openrct2/paint/Paint.cpp b/src/openrct2/paint/Paint.cpp index 3a99d2117f..53f82b608f 100644 --- a/src/openrct2/paint/Paint.cpp +++ b/src/openrct2/paint/Paint.cpp @@ -578,7 +578,7 @@ static void PaintAttachedPS(DrawPixelInfo& dpi, PaintStruct* ps, uint32_t viewFl auto imageId = PaintPSColourifyImage(ps, attached_ps->image_id, viewFlags); if (attached_ps->IsMasked) { - GfxDrawSpriteRawMasked(&dpi, screenCoords, imageId, attached_ps->ColourImageId); + GfxDrawSpriteRawMasked(dpi, screenCoords, imageId, attached_ps->ColourImageId); } else { From 65fa51976b31936682f5b9f15b46e4193c3801b0 Mon Sep 17 00:00:00 2001 From: Ryan Gudonis Date: Sun, 10 Mar 2024 11:06:43 -0400 Subject: [PATCH 055/191] Classify some LL scenarios as expert Adjust difficulty categories for Loopy Landscape scenarios: - Southern Sands - Tiny Towers - Nevermore Park - Pacifica --- distribution/changelog.txt | 1 + src/openrct2/scenario/ScenarioSources.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 3dd2d08bee..6262964752 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.10 (in development) ------------------------------------------------------------------------ - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. +- Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index fb361d91f0..373420e8bd 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -201,10 +201,10 @@ namespace ScenarioSources { SC_OCTAGON_PARK, "Octagon Park", SCENARIO_CATEGORY_CHALLENGING }, { SC_PLEASURE_ISLAND, "Pleasure Island", SCENARIO_CATEGORY_CHALLENGING }, { SC_ICICLE_WORLDS, "Icicle Worlds", SCENARIO_CATEGORY_CHALLENGING }, - { SC_SOUTHERN_SANDS, "Southern Sands", SCENARIO_CATEGORY_CHALLENGING }, - { SC_TINY_TOWERS, "Tiny Towers", SCENARIO_CATEGORY_CHALLENGING }, - { SC_NEVERMORE_PARK, "Nevermore Park", SCENARIO_CATEGORY_CHALLENGING }, - { SC_PACIFICA, "Pacifica", SCENARIO_CATEGORY_CHALLENGING }, + { SC_SOUTHERN_SANDS, "Southern Sands", SCENARIO_CATEGORY_EXPERT }, + { SC_TINY_TOWERS, "Tiny Towers", SCENARIO_CATEGORY_EXPERT }, + { SC_NEVERMORE_PARK, "Nevermore Park", SCENARIO_CATEGORY_EXPERT }, + { SC_PACIFICA, "Pacifica", SCENARIO_CATEGORY_EXPERT }, { SC_URBAN_JUNGLE, "Urban Jungle", SCENARIO_CATEGORY_EXPERT }, { SC_TERROR_TOWN, "Terror Town", SCENARIO_CATEGORY_EXPERT }, { SC_MEGAWORLD_PARK, "Megaworld Park", SCENARIO_CATEGORY_EXPERT }, From 24f5675cabd51ed9aa600244d159ae90ebf2b468 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 10 Mar 2024 18:48:06 +0100 Subject: [PATCH 056/191] Remove WindowBase::IsLegacy() function (#21572) --- src/openrct2-ui/interface/Window.cpp | 10 +--------- src/openrct2-ui/interface/Window.h | 1 - src/openrct2/interface/Window_internal.h | 5 ----- 3 files changed, 1 insertion(+), 15 deletions(-) diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index 006d09f793..b594080f9a 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -638,10 +638,7 @@ void WindowDrawWidgets(WindowBase& w, DrawPixelInfo& dpi) { if (w.windowPos.y + widget->top < dpi.y + dpi.height && w.windowPos.y + widget->bottom >= dpi.y) { - if (w.IsLegacy()) - WidgetDraw(dpi, w, widgetIndex); - else - w.OnDrawWidget(widgetIndex, dpi); + w.OnDrawWidget(widgetIndex, dpi); } } } @@ -691,11 +688,6 @@ void InvalidateAllWindowsAfterInput() }); } -bool Window::IsLegacy() -{ - return false; -} - void Window::OnDraw(DrawPixelInfo& dpi) { WindowDrawWidgets(*this, dpi); diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index 4bc771e920..0356e779e7 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -14,7 +14,6 @@ struct Window : WindowBase { - virtual bool IsLegacy() override; virtual void OnDraw(DrawPixelInfo& dpi) override; virtual void OnDrawWidget(WidgetIndex widgetIndex, DrawPixelInfo& dpi) override; diff --git a/src/openrct2/interface/Window_internal.h b/src/openrct2/interface/Window_internal.h index 2a1e3ffd9a..fd2a3b8cd0 100644 --- a/src/openrct2/interface/Window_internal.h +++ b/src/openrct2/interface/Window_internal.h @@ -80,11 +80,6 @@ struct WindowBase WindowBase& operator=(const WindowBase&) = delete; - virtual bool IsLegacy() - { - return true; - } - // Events virtual void OnOpen() { From b219ab1ed4c1aa026ad8280917318d2898100932 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 10 Mar 2024 18:48:23 +0100 Subject: [PATCH 057/191] Use LanguageGetString() if there is nothing to format --- src/openrct2-ui/windows/LoadSave.cpp | 3 +-- src/openrct2-ui/windows/Ride.cpp | 3 +-- src/openrct2/config/Config.cpp | 6 +++--- src/openrct2/title/TitleScreen.cpp | 6 +++--- src/openrct2/world/Park.cpp | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 93000d8d75..ca1f80dc80 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -462,8 +462,7 @@ static Widget window_loadsave_widgets[] = auto buffer = park.Name; if (buffer.empty()) { - // Use localised "Unnamed Park" if park name was empty. - buffer = FormatStringID(STR_UNNAMED_PARK, nullptr); + buffer = LanguageGetString(STR_UNNAMED_PARK); } path = Path::Combine(path, buffer); } diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index b15df0d039..235dbcf2ca 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -4855,8 +4855,7 @@ static_assert(std::size(RatingNames) == 6); auto& objManager = GetContext()->GetObjectManager(); auto musicObj = static_cast(objManager.GetLoadedObject(ObjectType::Music, musicObjectIndex)); - auto name = musicObj->NameStringId; - return FormatStringID(name, {}); + return LanguageGetString(musicObj->NameStringId); } /** diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index a4534b5721..d44e8bcb5e 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -841,7 +841,7 @@ bool ConfigFindOrBrowseInstallDirectory() auto uiContext = GetContext()->GetUiContext(); if (!uiContext->HasFilePicker()) { - uiContext->ShowMessageBox(FormatStringID(STR_NEEDS_RCT2_FILES_MANUAL, nullptr)); + uiContext->ShowMessageBox(LanguageGetString(STR_NEEDS_RCT2_FILES_MANUAL)); return false; } @@ -850,7 +850,7 @@ bool ConfigFindOrBrowseInstallDirectory() const char* g1DatPath = PATH_SEPARATOR "Data" PATH_SEPARATOR "g1.dat"; while (true) { - uiContext->ShowMessageBox(FormatStringID(STR_NEEDS_RCT2_FILES, nullptr)); + uiContext->ShowMessageBox(LanguageGetString(STR_NEEDS_RCT2_FILES)); std::string gog = LanguageGetString(STR_OWN_ON_GOG); std::string hdd = LanguageGetString(STR_INSTALLED_ON_HDD); @@ -889,7 +889,7 @@ bool ConfigFindOrBrowseInstallDirectory() std::string dummy; if (!Platform::FindApp("innoextract", &dummy)) { - uiContext->ShowMessageBox(FormatStringID(STR_INSTALL_INNOEXTRACT, nullptr)); + uiContext->ShowMessageBox(LanguageGetString(STR_INSTALL_INNOEXTRACT)); return false; } diff --git a/src/openrct2/title/TitleScreen.cpp b/src/openrct2/title/TitleScreen.cpp index 42192b387d..790663cd98 100644 --- a/src/openrct2/title/TitleScreen.cpp +++ b/src/openrct2/title/TitleScreen.cpp @@ -258,9 +258,9 @@ void TitleScreen::TitleInitialise() int32_t random = 0; bool safeSequence = false; - const std::string RCT1String = FormatStringID(STR_TITLE_SEQUENCE_RCT1, nullptr); - const std::string RCT1AAString = FormatStringID(STR_TITLE_SEQUENCE_RCT1_AA, nullptr); - const std::string RCT1LLString = FormatStringID(STR_TITLE_SEQUENCE_RCT1_AA_LL, nullptr); + const std::string RCT1String = LanguageGetString(STR_TITLE_SEQUENCE_RCT1); + const std::string RCT1AAString = LanguageGetString(STR_TITLE_SEQUENCE_RCT1_AA); + const std::string RCT1LLString = LanguageGetString(STR_TITLE_SEQUENCE_RCT1_AA_LL); // Ensure the random sequence chosen isn't from RCT1 or expansion if the player doesn't have it installed while (!safeSequence) diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 68ff18ee35..c68322a187 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -230,7 +230,7 @@ void Park::Initialise() { auto& gameState = GetGameState(); - Name = FormatStringID(STR_UNNAMED_PARK, nullptr); + Name = LanguageGetString(STR_UNNAMED_PARK); PluginStorage = {}; gameState.StaffHandymanColour = COLOUR_BRIGHT_RED; gameState.StaffMechanicColour = COLOUR_LIGHT_BLUE; From 1d3bd31ab874312ea19a5b083e49ee6a01c99fdb Mon Sep 17 00:00:00 2001 From: Duncan Date: Sun, 10 Mar 2024 18:15:49 +0000 Subject: [PATCH 058/191] Deduplicate FormatStringID symbols --- src/openrct2-ui/windows/Error.cpp | 4 ++-- src/openrct2-ui/windows/TextInput.cpp | 2 +- src/openrct2-ui/windows/Tooltip.cpp | 4 ++-- src/openrct2/actions/GameActionResult.cpp | 2 +- src/openrct2/config/Config.cpp | 2 +- src/openrct2/drawing/Text.cpp | 2 +- src/openrct2/entity/Peep.cpp | 2 +- src/openrct2/localisation/Localisation.cpp | 2 +- src/openrct2/localisation/Localisation.h | 2 +- src/openrct2/ride/Ride.cpp | 2 +- src/openrct2/scripting/bindings/entity/ScGuest.cpp | 2 +- src/openrct2/world/Banner.cpp | 2 +- 12 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 0ad3005c4a..1ba83e1758 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -168,8 +168,8 @@ static Widget window_error_widgets[] = { WindowBase* WindowErrorOpen(StringId title, StringId message, const Formatter& args) { - auto titlez = FormatStringID(title, args.Data()); - auto messagez = FormatStringID(message, args.Data()); + auto titlez = FormatStringIDLegacy(title, args.Data()); + auto messagez = FormatStringIDLegacy(message, args.Data()); return WindowErrorOpen(titlez, messagez); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/TextInput.cpp b/src/openrct2-ui/windows/TextInput.cpp index 0b1fb7a13b..ea78ce6948 100644 --- a/src/openrct2-ui/windows/TextInput.cpp +++ b/src/openrct2-ui/windows/TextInput.cpp @@ -404,7 +404,7 @@ namespace OpenRCT2::Ui::Windows WindowBase* call_w, WidgetIndex call_widget, StringId title, StringId description, const Formatter& descriptionArgs, StringId existing_text, uintptr_t existing_args, int32_t maxLength) { - auto existingText = FormatStringID(existing_text, &existing_args); + auto existingText = FormatStringIDLegacy(existing_text, &existing_args); WindowTextInputRawOpen(call_w, call_widget, title, description, descriptionArgs, existingText.c_str(), maxLength); } diff --git a/src/openrct2-ui/windows/Tooltip.cpp b/src/openrct2-ui/windows/Tooltip.cpp index 049d0d0c13..8417ba037b 100644 --- a/src/openrct2-ui/windows/Tooltip.cpp +++ b/src/openrct2-ui/windows/Tooltip.cpp @@ -131,11 +131,11 @@ static Widget _tooltipWidgets[] = { // Returns the width of the new tooltip text int32_t FormatTextForTooltip(const OpenRCT2String& message) { - const u8string tempString = ::FormatStringID(message.str, message.args.Data()); + const u8string tempString = FormatStringIDLegacy(message.str, message.args.Data()); OpenRCT2String formattedMessage{ STR_STRING_TOOLTIP, Formatter() }; formattedMessage.args.Add(tempString.c_str()); - const u8string tooltipTextUnwrapped = ::FormatStringID(formattedMessage.str, formattedMessage.args.Data()); + const u8string tooltipTextUnwrapped = FormatStringIDLegacy(formattedMessage.str, formattedMessage.args.Data()); auto textWidth = GfxGetStringWidthNewLined(tooltipTextUnwrapped, FontStyle::Small); textWidth = std::min(textWidth, 196); diff --git a/src/openrct2/actions/GameActionResult.cpp b/src/openrct2/actions/GameActionResult.cpp index 4de6f06b55..1d1d92fc4c 100644 --- a/src/openrct2/actions/GameActionResult.cpp +++ b/src/openrct2/actions/GameActionResult.cpp @@ -25,7 +25,7 @@ namespace GameActions } std::string operator()(const StringId strId) const { - return FormatStringID(strId, ErrorMessageArgs); + return FormatStringIDLegacy(strId, ErrorMessageArgs); } }; diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index d44e8bcb5e..9bcb48b865 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -927,7 +927,7 @@ bool ConfigFindOrBrowseInstallDirectory() return true; } - uiContext->ShowMessageBox(FormatStringID(STR_COULD_NOT_FIND_AT_PATH, &g1DatPath)); + uiContext->ShowMessageBox(FormatStringIDLegacy(STR_COULD_NOT_FIND_AT_PATH, &g1DatPath)); } } catch (const std::exception& ex) diff --git a/src/openrct2/drawing/Text.cpp b/src/openrct2/drawing/Text.cpp index 29efa04c28..e368a498b8 100644 --- a/src/openrct2/drawing/Text.cpp +++ b/src/openrct2/drawing/Text.cpp @@ -157,7 +157,7 @@ int32_t DrawTextWrapped( { const void* args = ft.Data(); - StaticLayout layout(FormatStringID(format, args), textPaint, width); + StaticLayout layout(FormatStringIDLegacy(format, args), textPaint, width); if (textPaint.Alignment == TextAlignment::CENTRE) { diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 1a28829cca..9584f4f9af 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -1586,7 +1586,7 @@ std::string Peep::GetName() const { Formatter ft; FormatNameTo(ft); - return ::FormatStringID(STR_STRINGID, ft.Data()); + return FormatStringIDLegacy(STR_STRINGID, ft.Data()); } bool Peep::SetName(std::string_view value) diff --git a/src/openrct2/localisation/Localisation.cpp b/src/openrct2/localisation/Localisation.cpp index 4e5da98eae..753d5a5271 100644 --- a/src/openrct2/localisation/Localisation.cpp +++ b/src/openrct2/localisation/Localisation.cpp @@ -265,7 +265,7 @@ const StringId PeepThoughts[] = { }; // clang-format on -std::string FormatStringID(StringId format, const void* args) +std::string FormatStringIDLegacy(StringId format, const void* args) { std::string buffer(256, 0); size_t len{}; diff --git a/src/openrct2/localisation/Localisation.h b/src/openrct2/localisation/Localisation.h index b7382de526..fe9da9f781 100644 --- a/src/openrct2/localisation/Localisation.h +++ b/src/openrct2/localisation/Localisation.h @@ -18,7 +18,7 @@ #include -std::string FormatStringID(StringId format, const void* args); +std::string FormatStringIDLegacy(StringId format, const void* args); void FormatStringToUpper(char* dest, size_t size, StringId format, const void* args); /** diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index bf838c6442..72e301d234 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -5712,7 +5712,7 @@ std::string Ride::GetName() const { Formatter ft; FormatNameTo(ft); - return FormatStringID(STR_STRINGID, reinterpret_cast(ft.Data())); + return FormatStringIDLegacy(STR_STRINGID, reinterpret_cast(ft.Data())); } void Ride::FormatNameTo(Formatter& ft) const diff --git a/src/openrct2/scripting/bindings/entity/ScGuest.cpp b/src/openrct2/scripting/bindings/entity/ScGuest.cpp index c865e2c136..f6072f989d 100644 --- a/src/openrct2/scripting/bindings/entity/ScGuest.cpp +++ b/src/openrct2/scripting/bindings/entity/ScGuest.cpp @@ -830,7 +830,7 @@ namespace OpenRCT2::Scripting // format string with arguments auto ft = Formatter(); PeepThoughtSetFormatArgs(&_backing, ft); - return FormatStringID(STR_STRINGID, ft.Data()); + return FormatStringIDLegacy(STR_STRINGID, ft.Data()); } } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/world/Banner.cpp b/src/openrct2/world/Banner.cpp index 6ae2f8c285..d116973d67 100644 --- a/src/openrct2/world/Banner.cpp +++ b/src/openrct2/world/Banner.cpp @@ -43,7 +43,7 @@ std::string Banner::GetText() const { Formatter ft; FormatTextTo(ft); - return FormatStringID(STR_STRINGID, ft.Data()); + return FormatStringIDLegacy(STR_STRINGID, ft.Data()); } void Banner::FormatTextTo(Formatter& ft, bool addColour) const From e4866061895a2039a69e277a0c0acdad2db70bb8 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sun, 10 Mar 2024 18:16:28 +0000 Subject: [PATCH 059/191] Move gPeepSpawns to GameState_t (#21570) --- src/openrct2/Editor.cpp | 2 +- src/openrct2/GameState.h | 2 ++ src/openrct2/actions/CheatSetAction.cpp | 2 +- src/openrct2/actions/FootpathPlaceAction.cpp | 7 +++-- src/openrct2/actions/FootpathRemoveAction.cpp | 7 +++-- src/openrct2/actions/LandSetRightsAction.cpp | 9 +++--- src/openrct2/actions/PeepSpawnPlaceAction.cpp | 30 +++++++++++-------- .../paint/tile_element/Paint.Surface.cpp | 5 ++-- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/peep/GuestPathfinding.cpp | 6 ++-- src/openrct2/rct1/S4Importer.cpp | 5 ++-- src/openrct2/rct2/S6Importer.cpp | 5 ++-- src/openrct2/world/Map.cpp | 8 ++--- src/openrct2/world/Map.h | 1 - src/openrct2/world/Park.cpp | 7 +++-- 15 files changed, 55 insertions(+), 43 deletions(-) diff --git a/src/openrct2/Editor.cpp b/src/openrct2/Editor.cpp index 3c6deb1040..174f7ad753 100644 --- a/src/openrct2/Editor.cpp +++ b/src/openrct2/Editor.cpp @@ -529,7 +529,7 @@ namespace Editor } } - if (gPeepSpawns.empty()) + if (gameState.PeepSpawns.empty()) { return { false, STR_PEEP_SPAWNS_NOT_SET }; } diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 539febfc85..b6b3a70e35 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -101,6 +101,8 @@ namespace OpenRCT2 std::vector RestrictedScenery; + std::vector PeepSpawns; + News::ItemQueues NewsItems; colour_t StaffHandymanColour; diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index c66939fe12..929ad83a06 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -767,7 +767,7 @@ void CheatSetAction::OwnAllLand() const } // Completely unown peep spawn points - for (const auto& spawn : gPeepSpawns) + for (const auto& spawn : GetGameState().PeepSpawns) { auto* surfaceElement = MapGetSurfaceElementAt(spawn); if (surfaceElement != nullptr) diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 342f00ea57..05385e3d64 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -474,11 +474,12 @@ void FootpathPlaceAction::AutomaticallySetPeepSpawn() const } } - if (gPeepSpawns.empty()) + auto& gameState = GetGameState(); + if (gameState.PeepSpawns.empty()) { - gPeepSpawns.emplace_back(); + gameState.PeepSpawns.emplace_back(); } - PeepSpawn* peepSpawn = &gPeepSpawns[0]; + PeepSpawn* peepSpawn = &gameState.PeepSpawns[0]; peepSpawn->x = _loc.x + (DirectionOffsets[direction].x * 15) + 16; peepSpawn->y = _loc.y + (DirectionOffsets[direction].y * 15) + 16; peepSpawn->direction = direction; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 96f3536247..8f11c358df 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -103,16 +103,17 @@ GameActions::Result FootpathRemoveAction::Execute() const TileElementRemove(footpathElement); FootpathUpdateQueueChains(); + auto& gameState = GetGameState(); // Remove the spawn point (if there is one in the current tile) - gPeepSpawns.erase( + gameState.PeepSpawns.erase( std::remove_if( - gPeepSpawns.begin(), gPeepSpawns.end(), + gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(), [this](const CoordsXYZ& spawn) { { return spawn.ToTileStart() == _loc.ToTileStart(); } }), - gPeepSpawns.end()); + gameState.PeepSpawns.end()); } else { diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 9b7de8c1d6..9ffc1cc6fe 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -184,18 +184,19 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& } } - res.Cost = GetGameState().LandPrice; + auto& gameState = GetGameState(); + res.Cost = gameState.LandPrice; if (isExecuting) { if (_ownership != OWNERSHIP_UNOWNED) { - gPeepSpawns.erase( + gameState.PeepSpawns.erase( std::remove_if( - gPeepSpawns.begin(), gPeepSpawns.end(), + gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(), [x = loc.x, y = loc.y](const auto& spawn) { return Floor2(spawn.x, 32) == x && Floor2(spawn.y, 32) == y; }), - gPeepSpawns.end()); + gameState.PeepSpawns.end()); } surfaceElement->SetOwnership(_ownership); ParkUpdateFencesAroundTile(loc); diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index ecd87e166c..fb6c2134ad 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -19,6 +19,8 @@ #include "../world/Park.h" #include "../world/Surface.h" +using namespace OpenRCT2; + PeepSpawnPlaceAction::PeepSpawnPlaceAction(const CoordsXYZD& location) : _location(location) { @@ -43,7 +45,7 @@ void PeepSpawnPlaceAction::Serialise(DataSerialiser& stream) GameActions::Result PeepSpawnPlaceAction::Query() const { - if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !OpenRCT2::GetGameState().Cheats.SandboxMode) + if (!(gScreenFlags & SCREEN_FLAGS_EDITOR) && !GetGameState().Cheats.SandboxMode) { return GameActions::Result(GameActions::Status::NotInEditorMode, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); } @@ -100,35 +102,37 @@ GameActions::Result PeepSpawnPlaceAction::Execute() const spawn.z = _location.z; spawn.direction = _location.direction; + auto& gameState = GetGameState(); // When attempting to place a peep spawn on a tile that already contains it, // remove that peep spawn instead. - if (!gPeepSpawns.empty()) + if (!gameState.PeepSpawns.empty()) { // When searching for existing spawns, ignore the direction. - auto foundSpawn = std::find_if(gPeepSpawns.begin(), gPeepSpawns.end(), [spawn](const CoordsXYZ& existingSpawn) { - { - return existingSpawn.ToTileStart() == spawn.ToTileStart(); - } - }); + auto foundSpawn = std::find_if( + gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(), [spawn](const CoordsXYZ& existingSpawn) { + { + return existingSpawn.ToTileStart() == spawn.ToTileStart(); + } + }); - if (foundSpawn != std::end(gPeepSpawns)) + if (foundSpawn != std::end(gameState.PeepSpawns)) { - gPeepSpawns.erase(foundSpawn); + gameState.PeepSpawns.erase(foundSpawn); MapInvalidateTileFull(spawn); return res; } } // If we have reached our max peep spawns, remove the oldest spawns - while (gPeepSpawns.size() >= OpenRCT2::Limits::MaxPeepSpawns) + while (gameState.PeepSpawns.size() >= Limits::MaxPeepSpawns) { - PeepSpawn oldestSpawn = *gPeepSpawns.begin(); - gPeepSpawns.erase(gPeepSpawns.begin()); + PeepSpawn oldestSpawn = *gameState.PeepSpawns.begin(); + gameState.PeepSpawns.erase(gameState.PeepSpawns.begin()); MapInvalidateTileFull(oldestSpawn); } // Set peep spawn - gPeepSpawns.push_back(spawn); + gameState.PeepSpawns.push_back(spawn); // Invalidate tile MapInvalidateTileFull(_location); diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index cde1e0a5d7..aa7d52b3f5 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1189,12 +1189,13 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con PaintPatrolArea(session, tileElement, height, surfaceShape); + auto& gameState = GetGameState(); // Draw Peep Spawns - if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || GetGameState().Cheats.SandboxMode) + if (((gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) || gameState.Cheats.SandboxMode) && session.ViewFlags & VIEWPORT_FLAG_LAND_OWNERSHIP) { const CoordsXY& pos = session.MapPosition; - for (auto& spawn : gPeepSpawns) + for (auto& spawn : gameState.PeepSpawns) { if ((spawn.x & 0xFFE0) == pos.x && (spawn.y & 0xFFE0) == pos.y) { diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 00ab7f958b..2ca2cb402e 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -528,7 +528,7 @@ namespace OpenRCT2 cs.ReadWrite(gameState.GuestInitialThirst); cs.ReadWrite(gameState.NextGuestNumber); - cs.ReadWriteVector(gPeepSpawns, [&cs](PeepSpawn& spawn) { + cs.ReadWriteVector(gameState.PeepSpawns, [&cs](PeepSpawn& spawn) { cs.ReadWrite(spawn.x); cs.ReadWrite(spawn.y); cs.ReadWrite(spawn.z); diff --git a/src/openrct2/peep/GuestPathfinding.cpp b/src/openrct2/peep/GuestPathfinding.cpp index bc93899351..51512b06d9 100644 --- a/src/openrct2/peep/GuestPathfinding.cpp +++ b/src/openrct2/peep/GuestPathfinding.cpp @@ -1589,14 +1589,14 @@ namespace OpenRCT2::PathFinding * Gets the nearest peep spawn relative to point, by using Manhattan distance. * @param x x coordinate of location * @param y y coordinate of location - * @return Index of gPeepSpawns (or 0xFF if no peep spawns exist). + * @return Index of gameState.PeepSpawns (or 0xFF if no peep spawns exist). */ static uint8_t GetNearestPeepSpawnIndex(uint16_t x, uint16_t y) { uint8_t chosenSpawn = 0xFF; uint16_t nearestDist = 0xFFFF; uint8_t i = 0; - for (const auto& spawn : gPeepSpawns) + for (const auto& spawn : GetGameState().PeepSpawns) { uint16_t dist = abs(spawn.x - x) + abs(spawn.y - y); if (dist < nearestDist) @@ -1622,7 +1622,7 @@ namespace OpenRCT2::PathFinding if (chosenSpawn == 0xFF) return GuestPathfindAimless(peep, edges); - const auto peepSpawnLoc = gPeepSpawns[chosenSpawn].ToTileStart(); + const auto peepSpawnLoc = GetGameState().PeepSpawns[chosenSpawn].ToTileStart(); Direction direction = peepSpawnLoc.direction; if (peepSpawnLoc.x == peep.NextLoc.x && peepSpawnLoc.y == peep.NextLoc.y) diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 1926551344..ac2758f4f5 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1410,14 +1410,15 @@ namespace RCT1 void ImportPeepSpawns() { - gPeepSpawns.clear(); + auto& gameState = GetGameState(); + gameState.PeepSpawns.clear(); for (size_t i = 0; i < Limits::MaxPeepSpawns; i++) { if (_s4.PeepSpawn[i].x != RCT12_PEEP_SPAWN_UNDEFINED) { PeepSpawn spawn = { _s4.PeepSpawn[i].x, _s4.PeepSpawn[i].y, _s4.PeepSpawn[i].z * 16, _s4.PeepSpawn[i].direction }; - gPeepSpawns.push_back(spawn); + gameState.PeepSpawns.push_back(spawn); } } } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 28f13df83a..802308716f 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1760,14 +1760,15 @@ namespace RCT2 _s6.PeepSpawns[0].z = 7; } - gPeepSpawns.clear(); + auto& gameState = GetGameState(); + gameState.PeepSpawns.clear(); for (size_t i = 0; i < Limits::MaxPeepSpawns; i++) { if (_s6.PeepSpawns[i].x != RCT12_PEEP_SPAWN_UNDEFINED) { PeepSpawn spawn = { _s6.PeepSpawns[i].x, _s6.PeepSpawns[i].y, _s6.PeepSpawns[i].z * 16, _s6.PeepSpawns[i].direction }; - gPeepSpawns.push_back(spawn); + gameState.PeepSpawns.push_back(spawn); } } } diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index d1b5e81d3e..6dea32e1a7 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -92,7 +92,6 @@ TileCoordsXY gWidePathTileLoopPosition; uint16_t gGrassSceneryTileLoopPosition; std::vector gMapSelectionTiles; -std::vector gPeepSpawns; bool gLandMountainMode; bool gLandPaintMode; @@ -1553,12 +1552,13 @@ static void ClearElementAt(const CoordsXY& loc, TileElement** elementPtr) */ static void ClearElementsAt(const CoordsXY& loc) { + auto& gameState = GetGameState(); // Remove the spawn point (if there is one in the current tile) - gPeepSpawns.erase( + gameState.PeepSpawns.erase( std::remove_if( - gPeepSpawns.begin(), gPeepSpawns.end(), + gameState.PeepSpawns.begin(), gameState.PeepSpawns.end(), [loc](const CoordsXY& spawn) { return spawn.ToTileStart() == loc.ToTileStart(); }), - gPeepSpawns.end()); + gameState.PeepSpawns.end()); TileElement* tileElement = MapGetFirstElementAt(loc); if (tileElement == nullptr) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 8708ebc0cf..b83626a45e 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -122,7 +122,6 @@ extern CoordsXYZ gMapSelectArrowPosition; extern uint8_t gMapSelectArrowDirection; extern std::vector gMapSelectionTiles; -extern std::vector gPeepSpawns; // Used in the land tool window to enable mountain tool / land smoothing extern bool gLandMountainMode; diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index c68322a187..5ed5f11495 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -57,9 +57,10 @@ static int32_t _forcedParkRating = -1; */ static PeepSpawn* GetRandomPeepSpawn() { - if (!gPeepSpawns.empty()) + auto& gameState = GetGameState(); + if (!gameState.PeepSpawns.empty()) { - return &gPeepSpawns[ScenarioRand() % gPeepSpawns.size()]; + return &gameState.PeepSpawns[ScenarioRand() % gameState.PeepSpawns.size()]; } return nullptr; @@ -255,7 +256,7 @@ void Park::Initialise() gameState.ParkEntranceFee = 10.00_GBP; - gPeepSpawns.clear(); + gameState.PeepSpawns.clear(); ParkEntranceReset(); gameState.ResearchPriorities = EnumsToFlags( From 1981ca6b0b046a9321e0a623b0e89d3eff1cf4fb Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 10 Mar 2024 19:46:21 +0100 Subject: [PATCH 060/191] Close #16582: Translate in-game console help text --- data/language/en-GB.txt | 1 + src/openrct2-ui/interface/InGameConsole.cpp | 11 +++++++++-- src/openrct2-ui/interface/InGameConsole.h | 4 +++- src/openrct2/localisation/StringIds.h | 2 ++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 47d8e0a254..d5664e614e 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3692,6 +3692,7 @@ STR_6619 :Object type cannot be restricted! STR_6620 :Object not found! STR_6621 :Restrict STR_6622 :Restrict object to the Scenario Editor and Sandbox mode. +STR_6623 :Type ‘help’ for a list of available commands. Type ‘hide’ to hide the console. ############# # Scenarios # diff --git a/src/openrct2-ui/interface/InGameConsole.cpp b/src/openrct2-ui/interface/InGameConsole.cpp index 0ac1b943d1..9e483837b6 100644 --- a/src/openrct2-ui/interface/InGameConsole.cpp +++ b/src/openrct2-ui/interface/InGameConsole.cpp @@ -21,6 +21,7 @@ #include #include #include +#include using namespace OpenRCT2::Ui; @@ -36,10 +37,10 @@ static int32_t InGameConsoleGetLineHeight() return FontGetLineHeight(InGameConsoleGetFontStyle()); } -InGameConsole::InGameConsole() +void InGameConsole::WriteInitial() { InteractiveConsole::WriteLine(OPENRCT2_NAME " " OPENRCT2_VERSION); - InteractiveConsole::WriteLine("Type 'help' for a list of available commands. Type 'hide' to hide the console."); + InteractiveConsole::WriteLine(LanguageGetString(STR_CONSOLE_HELPER_TEXT)); InteractiveConsole::WriteLine(""); WritePrompt(); } @@ -176,6 +177,12 @@ void InGameConsole::ClearLine() void InGameConsole::Open() { + if (!_isInitialised) + { + WriteInitial(); + _isInitialised = true; + } + _isOpen = true; ScrollToEnd(); RefreshCaret(); diff --git a/src/openrct2-ui/interface/InGameConsole.h b/src/openrct2-ui/interface/InGameConsole.h index 9d4966d1b2..d51a24f407 100644 --- a/src/openrct2-ui/interface/InGameConsole.h +++ b/src/openrct2-ui/interface/InGameConsole.h @@ -26,6 +26,7 @@ namespace OpenRCT2::Ui static constexpr int32_t CONSOLE_EDGE_PADDING = 4; static constexpr int32_t CONSOLE_CARET_WIDTH = 6; + bool _isInitialised = false; bool _isOpen = false; ScreenCoordsXY _consoleTopLeft; ScreenCoordsXY _consoleBottomRight; @@ -45,7 +46,7 @@ namespace OpenRCT2::Ui int32_t _caretScreenPosX = 0; public: - InGameConsole(); + InGameConsole() = default; InGameConsole(const InGameConsole& src) = delete; bool IsOpen() const @@ -71,6 +72,7 @@ namespace OpenRCT2::Ui void ClearInput(); void ClearLine(); void HistoryAdd(const u8string& src); + void WriteInitial(); void WritePrompt(); void ScrollToEnd(); void Invalidate() const; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 75dfd5ea15..53d6e6d344 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -4035,6 +4035,8 @@ enum : uint16_t STR_RESTRICT_SCENERY = 6621, STR_RESTRICT_SCENERY_TIP = 6622, + STR_CONSOLE_HELPER_TEXT = 6623, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; From 6950a74b37bc3036ca126068c55a15c6aab5642b Mon Sep 17 00:00:00 2001 From: Matt <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 10 Mar 2024 22:24:40 +0200 Subject: [PATCH 061/191] Fix #21565: Giant screenshots not working correctly --- src/openrct2/interface/Screenshot.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/interface/Screenshot.cpp b/src/openrct2/interface/Screenshot.cpp index 3d6f2227b1..9c649088b3 100644 --- a/src/openrct2/interface/Screenshot.cpp +++ b/src/openrct2/interface/Screenshot.cpp @@ -325,6 +325,8 @@ static Viewport GetGiantViewport(int32_t rotation, ZoomLevel zoom) viewport.width = zoom.ApplyInversedTo(viewport.view_width); viewport.height = zoom.ApplyInversedTo(viewport.view_height); viewport.zoom = zoom; + viewport.rotation = rotation; + return viewport; } @@ -498,7 +500,6 @@ int32_t CommandLineForScreenshot(const char** argv, int32_t argc, ScreenshotOpti auto zoom = ZoomLevel{ customZoom }; auto rotation = std::atoi(argv[4]) & 3; viewport = GetGiantViewport(rotation, zoom); - viewport.rotation = rotation; } else { @@ -650,14 +651,13 @@ void CaptureImage(const CaptureOptions& options) viewport.viewPos = { coords2d.x - ((options.Zoom.ApplyTo(viewport.view_width)) / 2), coords2d.y - ((options.Zoom.ApplyTo(viewport.view_height)) / 2) }; viewport.zoom = options.Zoom; + viewport.rotation = options.Rotation; } else { viewport = GetGiantViewport(options.Rotation, options.Zoom); } - viewport.rotation = options.Rotation; - if (options.Transparent) { viewport.flags |= VIEWPORT_FLAG_TRANSPARENT_BACKGROUND; From 632f29e6a92c8d34c918bf3a73c9e582c77cd19f Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 11 Mar 2024 00:21:45 +0100 Subject: [PATCH 062/191] Name segment constants --- .../paint/tile_element/Paint.Entrance.cpp | 4 +- .../paint/tile_element/Paint.LargeScenery.cpp | 4 +- .../paint/tile_element/Paint.Path.cpp | 14 +- .../paint/tile_element/Paint.SmallScenery.cpp | 12 +- .../paint/tile_element/Paint.Surface.cpp | 152 +-- .../paint/tile_element/Paint.TileElement.cpp | 9 +- .../paint/tile_element/Paint.TileElement.h | 22 +- src/openrct2/ride/TrackPaint.cpp | 28 +- .../coaster/AirPoweredVerticalCoaster.cpp | 58 +- src/openrct2/ride/coaster/AlpineCoaster.cpp | 390 +++--- .../ride/coaster/BobsleighCoaster.cpp | 146 +-- .../ride/coaster/BolligerMabillardTrack.hpp | 686 +++++------ .../coaster/ClassicWoodenRollerCoaster.cpp | 68 +- .../ride/coaster/CompactInvertedCoaster.cpp | 500 ++++---- .../ride/coaster/CorkscrewRollerCoaster.cpp | 550 ++++----- .../ride/coaster/FlyingRollerCoaster.cpp | 1054 ++++++++--------- src/openrct2/ride/coaster/GigaCoaster.cpp | 932 +++++++-------- .../ride/coaster/HeartlineTwisterCoaster.cpp | 36 +- src/openrct2/ride/coaster/HybridCoaster.cpp | 850 ++++++------- .../ride/coaster/InvertedHairpinCoaster.cpp | 40 +- .../ride/coaster/InvertedImpulseCoaster.cpp | 28 +- .../ride/coaster/InvertedRollerCoaster.cpp | 578 ++++----- .../ride/coaster/JuniorRollerCoaster.cpp | 190 +-- .../ride/coaster/LayDownRollerCoaster.cpp | 470 ++++---- .../ride/coaster/LimLaunchedRollerCoaster.cpp | 260 ++-- .../ride/coaster/LoopingRollerCoaster.cpp | 516 ++++---- src/openrct2/ride/coaster/MineRide.cpp | 350 +++--- .../ride/coaster/MineTrainCoaster.cpp | 504 ++++---- .../ride/coaster/MiniRollerCoaster.cpp | 506 ++++---- .../ride/coaster/MiniSuspendedCoaster.cpp | 118 +- .../coaster/MultiDimensionRollerCoaster.cpp | 838 ++++++------- .../ride/coaster/ReverseFreefallCoaster.cpp | 16 +- .../ride/coaster/ReverserRollerCoaster.cpp | 72 +- .../coaster/SideFrictionRollerCoaster.cpp | 148 +-- .../ride/coaster/SingleRailRollerCoaster.cpp | 916 +++++++------- .../ride/coaster/StandUpRollerCoaster.cpp | 470 ++++---- src/openrct2/ride/coaster/Steeplechase.cpp | 122 +- .../ride/coaster/SuspendedSwingingCoaster.cpp | 244 ++-- src/openrct2/ride/coaster/VirginiaReel.cpp | 16 +- src/openrct2/ride/coaster/WildMouse.cpp | 42 +- .../ride/coaster/WoodenRollerCoaster.cpp | 622 +++++----- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 30 +- src/openrct2/ride/gentle/CarRide.cpp | 28 +- src/openrct2/ride/gentle/Circus.cpp | 10 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 10 +- src/openrct2/ride/gentle/Dodgems.cpp | 2 +- src/openrct2/ride/gentle/FerrisWheel.cpp | 2 +- src/openrct2/ride/gentle/FlyingSaucers.cpp | 2 +- src/openrct2/ride/gentle/GhostTrain.cpp | 22 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 10 +- src/openrct2/ride/gentle/Maze.cpp | 4 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 10 +- src/openrct2/ride/gentle/MiniGolf.cpp | 20 +- src/openrct2/ride/gentle/MiniHelicopters.cpp | 20 +- src/openrct2/ride/gentle/MonorailCycles.cpp | 36 +- src/openrct2/ride/gentle/ObservationTower.cpp | 22 +- src/openrct2/ride/gentle/SpaceRings.cpp | 18 +- src/openrct2/ride/gentle/SpiralSlide.cpp | 2 +- src/openrct2/ride/shops/Facility.cpp | 2 +- src/openrct2/ride/shops/Shop.cpp | 2 +- src/openrct2/ride/thrill/3dCinema.cpp | 10 +- src/openrct2/ride/thrill/Enterprise.cpp | 10 +- src/openrct2/ride/thrill/GoKarts.cpp | 12 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 22 +- src/openrct2/ride/thrill/MagicCarpet.cpp | 2 +- src/openrct2/ride/thrill/MotionSimulator.cpp | 2 +- src/openrct2/ride/thrill/RotoDrop.cpp | 22 +- .../ride/thrill/SwingingInverterShip.cpp | 2 +- src/openrct2/ride/thrill/SwingingShip.cpp | 2 +- src/openrct2/ride/thrill/TopSpin.cpp | 10 +- src/openrct2/ride/thrill/Twist.cpp | 10 +- src/openrct2/ride/transport/Chairlift.cpp | 20 +- src/openrct2/ride/transport/Lift.cpp | 22 +- .../ride/transport/MiniatureRailway.cpp | 66 +- src/openrct2/ride/transport/Monorail.cpp | 62 +- .../ride/transport/SuspendedMonorail.cpp | 118 +- src/openrct2/ride/water/BoatHire.cpp | 6 +- src/openrct2/ride/water/DinghySlide.cpp | 48 +- .../ride/water/DinghySlideCovered.cpp | 46 +- src/openrct2/ride/water/LogFlume.cpp | 54 +- src/openrct2/ride/water/RiverRapids.cpp | 18 +- src/openrct2/ride/water/SplashBoats.cpp | 68 +- src/openrct2/ride/water/SubmarineRide.cpp | 12 +- 83 files changed, 6740 insertions(+), 6737 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Entrance.cpp b/src/openrct2/paint/tile_element/Paint.Entrance.cpp index e041b91460..c97eb3e727 100644 --- a/src/openrct2/paint/tile_element/Paint.Entrance.cpp +++ b/src/openrct2/paint/tile_element/Paint.Entrance.cpp @@ -203,7 +203,7 @@ static void PaintRideEntranceExit(PaintSession& session, uint8_t direction, int3 session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, supportsImageTemplate); height += isExit ? 40 : 56; - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); } @@ -331,7 +331,7 @@ static void PaintParkEntrance(PaintSession& session, uint8_t direction, int32_t WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, supportsImageTemplate); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } diff --git a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp index 8372297e6c..67a4292d6b 100644 --- a/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.LargeScenery.cpp @@ -78,11 +78,11 @@ static void PaintLargeScenerySupports( int32_t clearanceHeight = Ceil2(tileElement.GetClearanceZ() + 15, 16); if (tile.flags & LARGE_SCENERY_TILE_FLAG_ALLOW_SUPPORTS_ABOVE) { - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, clearanceHeight, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, clearanceHeight, 0x20); } else { - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); } PaintUtilSetGeneralSupportHeight(session, clearanceHeight, 0x20); } diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 9c39bf7ba9..9f2f941514 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -913,36 +913,36 @@ static void PathPaintSegmentSupportHeight( if (pathElement.IsQueue() || (pathElement.GetEdgesAndCorners() != 0xFF && hasSupports)) { - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); return; } if (pathElement.GetEdgesAndCorners() == 0xFF) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, 0xFFFF, 0); return; } - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, 0xFFFF, 0); if (edges & EDGE_NE) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide, 0xFFFF, 0); } if (edges & EDGE_SE) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomRightSide, 0xFFFF, 0); } if (edges & EDGE_SW) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide, 0xFFFF, 0); } if (edges & EDGE_NW) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide, 0xFFFF, 0); } } diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index daf7d59a59..e3981fc0c1 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -78,32 +78,32 @@ static void SetSupportHeights( { if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, height, 0x20); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~SEGMENT_C4, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~kSegmentCentre, height, 0x20); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { auto direction = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) % 4; PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), height, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), height, 0x20); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG27 | SMALL_SCENERY_FLAG_FULL_TILE)) { - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, 0xFFFF, 0); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~kSegmentCentre, 0xFFFF, 0); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { auto direction = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) % 4; PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); } } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index aa7d52b3f5..d44c5ddd6f 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1466,8 +1466,8 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 00 PaintUtilSetSegmentSupportHeight( session, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 - | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide + | kSegmentBottomRightSide, height, 0); PaintUtilForceSetGeneralSupportHeight(session, height, 0); break; @@ -1479,10 +1479,10 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 01 01 01 // 1B 1B // 1B - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, height, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 1); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, height, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height, 1); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 6 + 6, 0x1B); PaintUtilForceSetGeneralSupportHeight(session, height, 1); break; @@ -1493,10 +1493,10 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 17 02 00 // 17 00 // 02 - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, height, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 2); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, height, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height, 2); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 6 + 6, 0x17); PaintUtilForceSetGeneralSupportHeight(session, height, 2); break; @@ -1507,9 +1507,9 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 03 03 03 // 03 03 // 03 - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC, height + 2, 3); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, height + 2 + 6, 3); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0, height + 2 + 6 + 6, 3); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner, height + 2, 3); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, height + 2 + 6, 3); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner, height + 2 + 6 + 6, 3); PaintUtilForceSetGeneralSupportHeight(session, height, 3); break; @@ -1520,10 +1520,10 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 04 04 04 // 00 00 // 00 - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0 | SEGMENT_D0 | SEGMENT_D4, height, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 4); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, height, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height, 4); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 6 + 6, 0x1E); PaintUtilForceSetGeneralSupportHeight(session, height, 4); break; @@ -1534,11 +1534,11 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 05 05 05 ░░ ░░ ░░ // 1B 1B ▒▒ ▒▒ // 1B ▓▓ - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 6 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height, 5); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height, 5); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 6 + 6, 0x1B); PaintUtilForceSetGeneralSupportHeight(session, height, 5); break; @@ -1549,9 +1549,9 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 06 06 06 ▓▓ ▒▒ ░░ // 06 06 ▒▒ ░░ // 06 ░░ - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0, height + 2, 6); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, height + 2 + 6, 6); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, height + 2 + 6 + 6, 6); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner, height + 2, 6); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, height + 2 + 6, 6); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner, height + 2 + 6 + 6, 6); PaintUtilForceSetGeneralSupportHeight(session, height, 6); break; @@ -1562,113 +1562,113 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 00 07 17 ▓▓ ▓▓ ░░ // 00 17 ▓▓ ▒▒ // 07 ▓▓ - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 4, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 7); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0 | SEGMENT_B8, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 4, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 4 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 7); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentLeftCorner, height + 4 + 6 + 6, 0); PaintUtilForceSetGeneralSupportHeight(session, height, 7); break; case 8: // Loc6620D8 - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C8 | SEGMENT_D0, height, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 8); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, height, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height, 8); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 6 + 6, 0x1D); PaintUtilForceSetGeneralSupportHeight(session, height, 8); break; case 9: // Loc66216D PaintUtilForceSetGeneralSupportHeight(session, height, 9); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8, height + 2, 9); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, height + 2 + 6, 9); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, height + 2 + 6 + 6, 9); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner, height + 2, 9); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, height + 2 + 6, 9); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, height + 2 + 6 + 6, 9); break; case 10: // Loc662206 PaintUtilForceSetGeneralSupportHeight(session, height, 0xA); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 6 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height, 0xA); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height, 0xA); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 6 + 6, 0x1D); break; case 11: // Loc66229B PaintUtilForceSetGeneralSupportHeight(session, height, 0xB); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 4, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0xB); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C0, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 4, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 4 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0xB); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentBottomCorner, height + 4 + 6 + 6, 0); break; case 12: // Loc662334 PaintUtilForceSetGeneralSupportHeight(session, height, 0xC); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0, height + 2, 0xC); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, height + 2 + 6, 0xC); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC, height + 2 + 6 + 6, 0xC); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner, height + 2, 0xC); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, height + 2 + 6, 0xC); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner, height + 2 + 6 + 6, 0xC); break; case 13: // Loc6623CD PaintUtilForceSetGeneralSupportHeight(session, height, 0xD); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 4, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0xD); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 4, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 4 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 0xD); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentRightCorner, height + 4 + 6 + 6, 0); break; case 14: // Loc662466 PaintUtilForceSetGeneralSupportHeight(session, height, 0xE); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 4, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0xE); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC | SEGMENT_B4, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 4, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 4 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0xE); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentTopCorner, height + 4 + 6 + 6, 0); break; case 23: // Loc6624FF PaintUtilForceSetGeneralSupportHeight(session, height, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 4, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6 + 6 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 4 + 6 + 6 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 4, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 4 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 4 + 6 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 4 + 6 + 6 + 6 + 6, 0x17); break; case 27: // Loc6625A0 PaintUtilForceSetGeneralSupportHeight(session, height, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 4, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6 + 6 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 4 + 6 + 6 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 4, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 4 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 4 + 6 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 4 + 6 + 6 + 6 + 6, 0x1B); break; case 29: // Loc662641 PaintUtilForceSetGeneralSupportHeight(session, height, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8, height + 4, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_D0, height + 4 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C0, height + 4 + 6 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_CC | SEGMENT_D4, height + 4 + 6 + 6 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_BC, height + 4 + 6 + 6 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 4, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 4 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 4 + 6 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 4 + 6 + 6 + 6 + 6, 0x1D); break; case 30: // Loc6626E2 PaintUtilForceSetGeneralSupportHeight(session, height, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C0, height + 4, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_D0 | SEGMENT_D4, height + 4 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B8 | SEGMENT_C4 | SEGMENT_BC, height + 4 + 6 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C8 | SEGMENT_CC, height + 4 + 6 + 6 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_B4, height + 4 + 6 + 6 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 4, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 4 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 4 + 6 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 4 + 6 + 6 + 6 + 6, 0x1E); break; } } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index a65d07fbf9..f60eca789c 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -38,8 +38,8 @@ static void BlankTilesPaint(PaintSession& session, int32_t x, int32_t y); static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoords); -const int32_t SEGMENTS_ALL = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC - | SEGMENT_D0 | SEGMENT_D4; +const int32_t kSegmentsAll = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide + | kSegmentBottomLeftSide | kSegmentBottomRightSide; /** * @@ -51,7 +51,7 @@ void TileElementPaintSetup(PaintSession& session, const CoordsXY& mapCoords, boo if (!MapIsEdge(mapCoords)) { - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilForceSetGeneralSupportHeight(session, -1, 0); session.Flags = isTrackPiecePreview ? PaintSessionFlags::IsTrackPiecePreview : 0; session.WaterHeight = 0xFFFF; @@ -378,7 +378,7 @@ void PaintUtilForceSetGeneralSupportHeight(PaintSession& session, int16_t height } const uint16_t segment_offsets[9] = { - SEGMENT_B4, SEGMENT_B8, SEGMENT_BC, SEGMENT_C0, SEGMENT_C4, SEGMENT_C8, SEGMENT_CC, SEGMENT_D0, SEGMENT_D4, + kSegmentTopCorner, kSegmentLeftCorner, kSegmentRightCorner, kSegmentBottomCorner, kSegmentCentre, kSegmentTopLeftSide, kSegmentTopRightSide, kSegmentBottomLeftSide, kSegmentBottomRightSide, }; void PaintUtilSetSegmentSupportHeight(PaintSession& session, int32_t segments, uint16_t height, uint8_t slope) @@ -399,6 +399,7 @@ void PaintUtilSetSegmentSupportHeight(PaintSession& session, int32_t segments, u uint16_t PaintUtilRotateSegments(uint16_t segments, uint8_t rotation) { + // Only kSegmentCentre falls beyond 0xFF, so this will be kept in place. uint8_t temp = segments & 0xFF; temp = Numerics::rol8(temp, rotation * 2); diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index 9df68ddace..5948d45a24 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -26,17 +26,19 @@ enum edge_t EDGE_TOPRIGHT = EDGE_NE }; +// This controls in which segment of a tile something is drawn. +// This is from a screen perspective, e.g. kSegmentTopCorner will always represent the part of top of the screen. enum { - SEGMENT_B4 = (1 << 0), // 0 - SEGMENT_CC = (1 << 1), // 6 - SEGMENT_BC = (1 << 2), // 2 - SEGMENT_D4 = (1 << 3), // 8 - SEGMENT_C0 = (1 << 4), // 3 - SEGMENT_D0 = (1 << 5), // 7 - SEGMENT_B8 = (1 << 6), // 1 - SEGMENT_C8 = (1 << 7), // 5 - SEGMENT_C4 = (1 << 8), // 4 + kSegmentTopCorner = (1 << 0), // 0 + kSegmentTopRightSide = (1 << 1), // 6 + kSegmentRightCorner = (1 << 2), // 2 + kSegmentBottomRightSide = (1 << 3), // 8 + kSegmentBottomCorner = (1 << 4), // 3 + kSegmentBottomLeftSide = (1 << 5), // 7 + kSegmentLeftCorner = (1 << 6), // 1 + kSegmentTopLeftSide = (1 << 7), // 5 + kSegmentCentre = (1 << 8), // 4 }; enum @@ -71,7 +73,7 @@ enum TUNNEL_TYPE_COUNT }; -extern const int32_t SEGMENTS_ALL; +extern const int32_t kSegmentsAll; extern const uint16_t segment_offsets[9]; extern bool gShowSupportSegmentHeights; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index fdcd509784..364589ccfa 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -114,10 +114,10 @@ const uint8_t edges_4x4[] = { // clang-format on const int32_t DiagBlockedSegments[] = { - SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC, - SEGMENT_C4 | SEGMENT_CC | SEGMENT_C8 | SEGMENT_B4, - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C0 | SEGMENT_D4, - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_C8, + kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentRightCorner, + kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentTopCorner, + kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide, + kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide, }; const MetalSupportPlace DiagSupportPlacement[] = { @@ -2138,16 +2138,16 @@ void TrackPaintUtilOnridePhotoPaint( } static constexpr uint16_t RightVerticalLoopSegments[] = { - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, 0, 0, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, - SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, + kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, }; void TrackPaintUtilRightVerticalLoopSegments(PaintSession& session, Direction direction, uint8_t trackSequence) @@ -2168,14 +2168,14 @@ void TrackPaintUtilLeftCorkscrewUpSupports(PaintSession& session, Direction dire if (direction == 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); } MetalASupportsPaintSetup(session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction != 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); } } diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index 9a3028be45..ad358300c9 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -184,7 +184,7 @@ static void AirPoweredVerticalRCTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -213,7 +213,7 @@ static void AirPoweredVerticalRCTrackStation( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -259,38 +259,38 @@ static void AirPoweredVerticalRCTrackRightQuarterTurn5( switch (trackSequence) { case 0: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -331,7 +331,7 @@ static void AirPoweredVerticalRCTrackFlatToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -361,7 +361,7 @@ static void AirPoweredVerticalRCTrackFlatToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -434,38 +434,38 @@ static void AirPoweredVerticalRCTrackBankedRightQuarterTurn5( switch (trackSequence) { case 0: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -507,7 +507,7 @@ static void AirPoweredVerticalRCTrackLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -537,7 +537,7 @@ static void AirPoweredVerticalRCTrackBrakes( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -658,7 +658,7 @@ static void AirPoweredVerticalRCTrackVerticalSlopeUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 1: @@ -690,7 +690,7 @@ static void AirPoweredVerticalRCTrackVerticalSlopeUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 4: @@ -713,7 +713,7 @@ static void AirPoweredVerticalRCTrackVerticalSlopeUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 5: @@ -738,7 +738,7 @@ static void AirPoweredVerticalRCTrackVerticalSlopeUp( PaintAddImageAsParentRotated( session, direction, supportsImageId, { 0, 0, height }, { { 3, 3, height }, { 26, 26, 126 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 6: @@ -761,7 +761,7 @@ static void AirPoweredVerticalRCTrackVerticalSlopeUp( PaintUtilSetVerticalTunnel(session, height + 240); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; } @@ -802,7 +802,7 @@ static void AirPoweredVerticalRCTrackVerticalUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -904,7 +904,7 @@ static void AirPoweredVerticalRCTrackVerticalTop( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -949,7 +949,7 @@ static void AirPoweredVerticalRCTrackBooster( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -973,7 +973,7 @@ static void AirPoweredVerticalRCTrackOnridePhoto( TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/AlpineCoaster.cpp b/src/openrct2/ride/coaster/AlpineCoaster.cpp index 2b09477330..31d7740c94 100644 --- a/src/openrct2/ride/coaster/AlpineCoaster.cpp +++ b/src/openrct2/ride/coaster/AlpineCoaster.cpp @@ -88,7 +88,7 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -121,7 +121,7 @@ namespace AlpineRC DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 4, 7); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -202,7 +202,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -283,7 +283,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -364,7 +364,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -427,7 +427,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -458,7 +458,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -498,7 +498,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -550,7 +550,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -583,7 +583,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -612,7 +612,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -645,7 +645,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -686,7 +686,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -738,7 +738,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -768,7 +768,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -797,13 +797,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -843,7 +843,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -888,7 +888,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -918,7 +918,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -947,13 +947,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -994,7 +994,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1048,7 +1048,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1076,7 +1076,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1104,7 +1104,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1168,7 +1168,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1205,7 +1205,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1233,7 +1233,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1261,7 +1261,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1325,7 +1325,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1362,7 +1362,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1390,7 +1390,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1418,7 +1418,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1482,7 +1482,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1519,7 +1519,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1547,7 +1547,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1575,7 +1575,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1639,7 +1639,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1676,7 +1676,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1704,7 +1704,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1732,7 +1732,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1796,7 +1796,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1833,7 +1833,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -1860,7 +1860,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -1887,7 +1887,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -1950,7 +1950,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -1988,7 +1988,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2016,7 +2016,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2044,7 +2044,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2108,7 +2108,7 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2155,7 +2155,7 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2200,7 +2200,7 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2266,7 +2266,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2318,7 +2318,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2370,7 +2370,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2422,7 +2422,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2489,7 +2489,7 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2517,7 +2517,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2535,7 +2535,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2549,7 +2549,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2579,7 +2579,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2602,7 +2602,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2616,7 +2616,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2634,7 +2634,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2664,7 +2664,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2687,7 +2687,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2705,7 +2705,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2719,7 +2719,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2749,7 +2749,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2772,7 +2772,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2786,7 +2786,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2804,7 +2804,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2834,7 +2834,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2857,7 +2857,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2875,7 +2875,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2889,7 +2889,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2919,7 +2919,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2942,7 +2942,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2956,7 +2956,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2974,7 +2974,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3004,7 +3004,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3027,7 +3027,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3045,7 +3045,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -3059,7 +3059,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -3089,7 +3089,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -3112,7 +3112,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3126,7 +3126,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -3144,7 +3144,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -3174,7 +3174,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -3197,7 +3197,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -3214,7 +3214,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -3227,7 +3227,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -3256,7 +3256,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -3280,7 +3280,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -3293,7 +3293,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -3310,7 +3310,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -3339,7 +3339,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -3363,7 +3363,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3381,7 +3381,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3395,7 +3395,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3425,7 +3425,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3448,7 +3448,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3462,7 +3462,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3480,7 +3480,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3510,7 +3510,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3533,7 +3533,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3547,7 +3547,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3561,7 +3561,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3591,7 +3591,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3614,7 +3614,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3628,7 +3628,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3642,7 +3642,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3672,7 +3672,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3719,7 +3719,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3750,7 +3750,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3793,7 +3793,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3848,7 +3848,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3881,7 +3881,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3910,7 +3910,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3943,7 +3943,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3987,7 +3987,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4039,7 +4039,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4069,7 +4069,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4098,13 +4098,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4144,7 +4144,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4189,7 +4189,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4219,7 +4219,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4248,13 +4248,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4295,7 +4295,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4356,7 +4356,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4402,7 +4402,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4446,7 +4446,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4497,7 +4497,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4557,7 +4557,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4590,7 +4590,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4619,7 +4619,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -4652,7 +4652,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4693,7 +4693,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4737,7 +4737,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4770,7 +4770,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4799,7 +4799,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -4832,7 +4832,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4873,7 +4873,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4933,7 +4933,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4968,7 +4968,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5004,7 +5004,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5045,7 +5045,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5089,7 +5089,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5125,7 +5125,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5162,7 +5162,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5203,7 +5203,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5250,7 +5250,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5282,7 +5282,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5325,7 +5325,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5369,7 +5369,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5401,7 +5401,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5439,7 +5439,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5487,7 +5487,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5519,7 +5519,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5562,7 +5562,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5606,7 +5606,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5638,7 +5638,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5676,7 +5676,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5750,7 +5750,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5784,7 +5784,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5813,7 +5813,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5846,7 +5846,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5890,7 +5890,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5934,7 +5934,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5968,7 +5968,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5997,7 +5997,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -6030,7 +6030,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6069,7 +6069,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6116,7 +6116,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6150,7 +6150,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6179,7 +6179,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6212,7 +6212,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6261,7 +6261,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6305,7 +6305,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6339,7 +6339,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6368,7 +6368,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -6401,7 +6401,7 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6445,7 +6445,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6505,7 +6505,7 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -6550,7 +6550,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6596,7 +6596,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -6643,7 +6643,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6689,7 +6689,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -6733,7 +6733,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6782,7 +6782,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -6826,7 +6826,7 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6875,7 +6875,7 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } diff --git a/src/openrct2/ride/coaster/BobsleighCoaster.cpp b/src/openrct2/ride/coaster/BobsleighCoaster.cpp index 43102659c2..f9dd7cec29 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -95,7 +95,7 @@ static void BobsleighRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -119,7 +119,7 @@ static void BobsleighRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -223,7 +223,7 @@ static void BobsleighRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -327,7 +327,7 @@ static void BobsleighRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -431,7 +431,7 @@ static void BobsleighRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -509,7 +509,7 @@ static void BobsleighRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -553,7 +553,7 @@ static void BobsleighRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -594,7 +594,7 @@ static void BobsleighRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -638,7 +638,7 @@ static void BobsleighRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -690,7 +690,7 @@ static void BobsleighRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -752,7 +752,7 @@ static void BobsleighRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -803,7 +803,7 @@ static void BobsleighRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -854,7 +854,7 @@ static void BobsleighRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -905,7 +905,7 @@ static void BobsleighRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -959,7 +959,7 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1003,7 +1003,7 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1044,7 +1044,7 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1088,7 +1088,7 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1140,7 +1140,7 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1209,7 +1209,7 @@ static void BobsleighRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1267,7 +1267,7 @@ static void BobsleighRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1325,7 +1325,7 @@ static void BobsleighRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1383,7 +1383,7 @@ static void BobsleighRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1466,7 +1466,7 @@ static void BobsleighRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1528,7 +1528,7 @@ static void BobsleighRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1573,7 +1573,7 @@ static void BobsleighRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1619,7 +1619,7 @@ static void BobsleighRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1671,7 +1671,7 @@ static void BobsleighRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1727,7 +1727,7 @@ static void BobsleighRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1773,7 +1773,7 @@ static void BobsleighRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1820,7 +1820,7 @@ static void BobsleighRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1872,7 +1872,7 @@ static void BobsleighRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1928,7 +1928,7 @@ static void BobsleighRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1971,7 +1971,7 @@ static void BobsleighRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2022,7 +2022,7 @@ static void BobsleighRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2087,7 +2087,7 @@ static void BobsleighRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2130,7 +2130,7 @@ static void BobsleighRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2181,7 +2181,7 @@ static void BobsleighRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2246,7 +2246,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2290,7 +2290,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2341,7 +2341,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2393,7 +2393,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2437,7 +2437,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2483,7 +2483,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2540,7 +2540,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2584,7 +2584,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2635,7 +2635,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2687,7 +2687,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2731,7 +2731,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2777,7 +2777,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2862,7 +2862,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2907,7 +2907,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2948,7 +2948,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2992,7 +2992,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3044,7 +3044,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3096,7 +3096,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3141,7 +3141,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3182,7 +3182,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3226,7 +3226,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3273,7 +3273,7 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3330,7 +3330,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3375,7 +3375,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3416,7 +3416,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3460,7 +3460,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3512,7 +3512,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3564,7 +3564,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3609,7 +3609,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3650,7 +3650,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3694,7 +3694,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3741,7 +3741,7 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3809,7 +3809,7 @@ static void BobsleighRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3847,7 +3847,7 @@ static void BobsleighRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3896,7 +3896,7 @@ static void BobsleighRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp index ac8e70509a..3a24b80486 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp @@ -96,7 +96,7 @@ static void BolligerMabillardTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -133,7 +133,7 @@ static void BolligerMabillardTrackStation( TrackPaintUtilDrawNarrowStationPlatform(session, ride, direction, height, 9, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -211,7 +211,7 @@ static void BolligerMabillardTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -289,7 +289,7 @@ static void BolligerMabillardTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -367,7 +367,7 @@ static void BolligerMabillardTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -457,7 +457,7 @@ static void BolligerMabillardTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -547,7 +547,7 @@ static void BolligerMabillardTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -625,7 +625,7 @@ static void BolligerMabillardTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -716,7 +716,7 @@ static void BolligerMabillardTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -748,7 +748,7 @@ static void BolligerMabillardTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -777,7 +777,7 @@ static void BolligerMabillardTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -809,7 +809,7 @@ static void BolligerMabillardTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -848,7 +848,7 @@ static void BolligerMabillardTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -904,7 +904,7 @@ static void BolligerMabillardTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -948,7 +948,7 @@ static void BolligerMabillardTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -992,7 +992,7 @@ static void BolligerMabillardTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1036,7 +1036,7 @@ static void BolligerMabillardTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1087,7 +1087,7 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1119,7 +1119,7 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1148,7 +1148,7 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1180,7 +1180,7 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1222,7 +1222,7 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1285,7 +1285,7 @@ static void BolligerMabillardTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1336,7 +1336,7 @@ static void BolligerMabillardTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1387,7 +1387,7 @@ static void BolligerMabillardTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1438,7 +1438,7 @@ static void BolligerMabillardTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1512,7 +1512,7 @@ static void BolligerMabillardTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1561,7 +1561,7 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1591,7 +1591,7 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1619,7 +1619,7 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1649,7 +1649,7 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1688,7 +1688,7 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1731,7 +1731,7 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1761,7 +1761,7 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1789,7 +1789,7 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1819,7 +1819,7 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1858,7 +1858,7 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1921,7 +1921,7 @@ static void BolligerMabillardTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1952,7 +1952,7 @@ static void BolligerMabillardTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1984,7 +1984,7 @@ static void BolligerMabillardTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2023,7 +2023,7 @@ static void BolligerMabillardTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2066,7 +2066,7 @@ static void BolligerMabillardTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2097,7 +2097,7 @@ static void BolligerMabillardTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2129,7 +2129,7 @@ static void BolligerMabillardTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2168,7 +2168,7 @@ static void BolligerMabillardTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2215,7 +2215,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2249,7 +2249,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2278,7 +2278,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2303,7 +2303,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2335,7 +2335,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2364,7 +2364,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2397,7 +2397,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2440,7 +2440,7 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2717,7 +2717,7 @@ static void BolligerMabillardTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2748,7 +2748,7 @@ static void BolligerMabillardTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2786,7 +2786,7 @@ static void BolligerMabillardTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2842,7 +2842,7 @@ static void BolligerMabillardTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2873,7 +2873,7 @@ static void BolligerMabillardTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2914,7 +2914,7 @@ static void BolligerMabillardTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2963,7 +2963,7 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3003,7 +3003,7 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3042,7 +3042,7 @@ static void BolligerMabillardTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3089,7 +3089,7 @@ static void BolligerMabillardTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3155,7 +3155,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3187,7 +3187,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3228,7 +3228,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3270,7 +3270,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3302,7 +3302,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3338,7 +3338,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3385,7 +3385,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3417,7 +3417,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3458,7 +3458,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3500,7 +3500,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3532,7 +3532,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3568,7 +3568,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3645,7 +3645,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3678,7 +3678,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3707,7 +3707,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3739,7 +3739,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3781,7 +3781,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3823,7 +3823,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3856,7 +3856,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3885,7 +3885,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3917,7 +3917,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3954,7 +3954,7 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4001,7 +4001,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4034,7 +4034,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4063,7 +4063,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4095,7 +4095,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4144,7 +4144,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4186,7 +4186,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4219,7 +4219,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4248,7 +4248,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4280,7 +4280,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4324,7 +4324,7 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4402,7 +4402,7 @@ static void BolligerMabillardTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4447,7 +4447,7 @@ static void BolligerMabillardTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4495,7 +4495,7 @@ static void BolligerMabillardTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4540,7 +4540,7 @@ static void BolligerMabillardTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4585,7 +4585,7 @@ static void BolligerMabillardTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4621,7 +4621,7 @@ static void BolligerMabillardTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -4676,7 +4676,7 @@ static void BolligerMabillardTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4729,7 +4729,7 @@ static void BolligerMabillardTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4784,7 +4784,7 @@ static void BolligerMabillardTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -4824,7 +4824,7 @@ static void BolligerMabillardTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -4869,7 +4869,7 @@ static void BolligerMabillardTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4898,7 +4898,7 @@ static void BolligerMabillardTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4927,13 +4927,13 @@ static void BolligerMabillardTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4970,7 +4970,7 @@ static void BolligerMabillardTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5014,7 +5014,7 @@ static void BolligerMabillardTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5043,7 +5043,7 @@ static void BolligerMabillardTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5072,13 +5072,13 @@ static void BolligerMabillardTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5115,7 +5115,7 @@ static void BolligerMabillardTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5179,7 +5179,7 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5208,7 +5208,7 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5237,13 +5237,13 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5280,7 +5280,7 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5324,7 +5324,7 @@ static void BolligerMabillardTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5353,7 +5353,7 @@ static void BolligerMabillardTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5382,13 +5382,13 @@ static void BolligerMabillardTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5425,7 +5425,7 @@ static void BolligerMabillardTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5483,7 +5483,7 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5510,7 +5510,7 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5537,7 +5537,7 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5592,7 +5592,7 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5629,7 +5629,7 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5656,7 +5656,7 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5683,7 +5683,7 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5738,7 +5738,7 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5775,7 +5775,7 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5802,7 +5802,7 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5829,7 +5829,7 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5884,7 +5884,7 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5921,7 +5921,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5948,7 +5948,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5975,7 +5975,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6030,7 +6030,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6067,7 +6067,7 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6094,7 +6094,7 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6121,7 +6121,7 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6176,7 +6176,7 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6213,7 +6213,7 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6240,7 +6240,7 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6267,7 +6267,7 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6322,7 +6322,7 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6359,7 +6359,7 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6386,7 +6386,7 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6413,7 +6413,7 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6468,7 +6468,7 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6505,7 +6505,7 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6532,7 +6532,7 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6559,7 +6559,7 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6614,7 +6614,7 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6651,7 +6651,7 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6678,7 +6678,7 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6705,7 +6705,7 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6760,7 +6760,7 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6797,7 +6797,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6823,7 +6823,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6849,7 +6849,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6903,7 +6903,7 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -6941,7 +6941,7 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6968,7 +6968,7 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6995,7 +6995,7 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7050,7 +7050,7 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7087,7 +7087,7 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7114,7 +7114,7 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7141,7 +7141,7 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7196,7 +7196,7 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7233,7 +7233,7 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7260,7 +7260,7 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7287,7 +7287,7 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7342,7 +7342,7 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7379,7 +7379,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7406,7 +7406,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7433,7 +7433,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7488,7 +7488,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -7525,7 +7525,7 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7552,7 +7552,7 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7579,7 +7579,7 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7634,7 +7634,7 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7671,7 +7671,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7698,7 +7698,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7725,7 +7725,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7780,7 +7780,7 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7817,7 +7817,7 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7844,7 +7844,7 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7871,7 +7871,7 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7926,7 +7926,7 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -7949,7 +7949,7 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7965,7 +7965,7 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7978,7 +7978,7 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8005,7 +8005,7 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8028,7 +8028,7 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8041,7 +8041,7 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8057,7 +8057,7 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8084,7 +8084,7 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8107,7 +8107,7 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8123,7 +8123,7 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8136,7 +8136,7 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8163,7 +8163,7 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8186,7 +8186,7 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8199,7 +8199,7 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8215,7 +8215,7 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8242,7 +8242,7 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8265,7 +8265,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8281,7 +8281,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8294,7 +8294,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8321,7 +8321,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8344,7 +8344,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8357,7 +8357,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8373,7 +8373,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8400,7 +8400,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8423,7 +8423,7 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8439,7 +8439,7 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8452,7 +8452,7 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8479,7 +8479,7 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8502,7 +8502,7 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8515,7 +8515,7 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8531,7 +8531,7 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8558,7 +8558,7 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8581,7 +8581,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8596,7 +8596,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8608,7 +8608,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8634,7 +8634,7 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8658,7 +8658,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8670,7 +8670,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8685,7 +8685,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8711,7 +8711,7 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8735,7 +8735,7 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8751,7 +8751,7 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8764,7 +8764,7 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8791,7 +8791,7 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8814,7 +8814,7 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8827,7 +8827,7 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8843,7 +8843,7 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8870,7 +8870,7 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8893,7 +8893,7 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8906,7 +8906,7 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8919,7 +8919,7 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8946,7 +8946,7 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8969,7 +8969,7 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8982,7 +8982,7 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8995,7 +8995,7 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9022,7 +9022,7 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9064,7 +9064,7 @@ static void BolligerMabillardTrackLeftBankToLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9104,7 +9104,7 @@ static void BolligerMabillardTrackLeftBankToLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9146,7 +9146,7 @@ static void BolligerMabillardTrackRightBankToRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9193,7 +9193,7 @@ static void BolligerMabillardTrackRightBankToRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9239,7 +9239,7 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegDownToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9282,7 +9282,7 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9321,7 +9321,7 @@ static void BolligerMabillardTrackRightQuarterTurn325DegDownToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9364,7 +9364,7 @@ static void BolligerMabillardTrackRightQuarterTurn325DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9397,7 +9397,7 @@ static void BolligerMabillardTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9435,7 +9435,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9477,7 +9477,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9517,7 +9517,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9566,7 +9566,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9629,7 +9629,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9660,7 +9660,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9688,7 +9688,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -9720,7 +9720,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9759,7 +9759,7 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9802,7 +9802,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9833,7 +9833,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9861,7 +9861,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -9893,7 +9893,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9932,7 +9932,7 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10002,7 +10002,7 @@ static void BolligerMabillardTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10050,7 +10050,7 @@ static void BolligerMabillardTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10098,7 +10098,7 @@ static void BolligerMabillardTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10146,7 +10146,7 @@ static void BolligerMabillardTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10227,7 +10227,7 @@ static void BolligerMabillardTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10272,7 +10272,7 @@ static void BolligerMabillardTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10317,7 +10317,7 @@ static void BolligerMabillardTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10362,7 +10362,7 @@ static void BolligerMabillardTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10446,7 +10446,7 @@ static void BolligerMabillardTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10494,7 +10494,7 @@ static void BolligerMabillardTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10542,7 +10542,7 @@ static void BolligerMabillardTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10590,7 +10590,7 @@ static void BolligerMabillardTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10669,7 +10669,7 @@ static void BolligerMabillardTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -10716,7 +10716,7 @@ static void BolligerMabillardTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -10823,7 +10823,7 @@ static void BolligerMabillardTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -10907,7 +10907,7 @@ static void BolligerMabillardTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -10971,7 +10971,7 @@ static void BolligerMabillardTrackBrakeForDrop( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -11009,7 +11009,7 @@ static void BolligerMabillardTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11043,7 +11043,7 @@ static void BolligerMabillardTrackHalfLoopUp( session, supportType, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11070,7 +11070,7 @@ static void BolligerMabillardTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -11099,7 +11099,7 @@ static void BolligerMabillardTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11177,7 +11177,7 @@ static void BolligerMabillardTrackLeftCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11206,7 +11206,7 @@ static void BolligerMabillardTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -11261,7 +11261,7 @@ static void BolligerMabillardTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11289,7 +11289,7 @@ static void BolligerMabillardTrackRightCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11318,7 +11318,7 @@ static void BolligerMabillardTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -11394,7 +11394,7 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11426,7 +11426,7 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 7, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11458,7 +11458,7 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -11499,7 +11499,7 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -11546,7 +11546,7 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -11578,7 +11578,7 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 16, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -11610,7 +11610,7 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11651,7 +11651,7 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -11731,7 +11731,7 @@ static void BolligerMabillardTrackLeftBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -11773,7 +11773,7 @@ static void BolligerMabillardTrackLeftBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11823,7 +11823,7 @@ static void BolligerMabillardTrackLeftBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11886,7 +11886,7 @@ static void BolligerMabillardTrackRightBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -11928,7 +11928,7 @@ static void BolligerMabillardTrackRightBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11978,7 +11978,7 @@ static void BolligerMabillardTrackRightBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -12041,7 +12041,7 @@ static void BolligerMabillardTrackPoweredLift( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -12082,7 +12082,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12111,7 +12111,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 9, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12140,7 +12140,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -12178,7 +12178,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12207,7 +12207,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -12236,7 +12236,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12270,7 +12270,7 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -12314,7 +12314,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12343,7 +12343,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 9, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12372,7 +12372,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -12410,7 +12410,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12439,7 +12439,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -12468,7 +12468,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12502,7 +12502,7 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -12557,7 +12557,7 @@ static void BolligerMabillardTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12585,7 +12585,7 @@ static void BolligerMabillardTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12617,7 +12617,7 @@ static void BolligerMabillardTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12658,7 +12658,7 @@ void BolligerMabillardTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -12700,7 +12700,7 @@ static void BolligerMabillardTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12726,7 +12726,7 @@ static void BolligerMabillardTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12752,7 +12752,7 @@ static void BolligerMabillardTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -12808,7 +12808,7 @@ static void BolligerMabillardTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12834,7 +12834,7 @@ static void BolligerMabillardTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12860,7 +12860,7 @@ static void BolligerMabillardTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -12907,7 +12907,7 @@ static void BolligerMabillardTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -12939,7 +12939,7 @@ static void BolligerMabillardTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12979,7 +12979,7 @@ static void BolligerMabillardTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -13015,7 +13015,7 @@ static void BolligerMabillardTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -13047,7 +13047,7 @@ static void BolligerMabillardTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -13087,7 +13087,7 @@ static void BolligerMabillardTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; diff --git a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp index 0cdacd6f7f..2c628ff3d4 100644 --- a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp @@ -255,7 +255,7 @@ static void ClassicWoodenRCTrackFlatToLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -289,7 +289,7 @@ static void ClassicWoodenRCTrackFlatToRightBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -336,7 +336,7 @@ static void ClassicWoodenRCTrackLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -385,7 +385,7 @@ static void ClassicWoodenRCTrackLeftBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -428,7 +428,7 @@ static void ClassicWoodenRCTrackRightBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -471,7 +471,7 @@ static void ClassicWoodenRCTrack25DegUpToLeftBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -514,7 +514,7 @@ static void ClassicWoodenRCTrack25DegUpToRightBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -774,13 +774,13 @@ static void ClassicWoodenRCTrackBankedRightQuarterTurn5( }; static constexpr int blockedSegments[7] = { - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, }; WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); @@ -938,10 +938,10 @@ static void ClassicWoodenRCTrackRightQuarterTurn3Bank( }; static constexpr int blockedSegments[4] = { - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, 0, - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, }; WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); @@ -1145,11 +1145,11 @@ static void ClassicWoodenRCTrackLeftEighthBankToDiag( }; static constexpr int blockedSegments[5] = { - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, }; if (trackSequence == 0 && (direction == 0 || direction == 3)) @@ -1348,11 +1348,11 @@ static void ClassicWoodenRCTrackRightEighthBankToDiag( }; static constexpr int blockedSegments[5] = { - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, }; if (trackSequence == 0 && (direction == 0 || direction == 3)) @@ -1498,7 +1498,7 @@ static void ClassicWoodenRCTrackDiagFlatToLeftBank( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1612,7 +1612,7 @@ static void ClassicWoodenRCTrackDiagFlatToRightBank( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1728,7 +1728,7 @@ static void ClassicWoodenRCTrackDiagLeftBank( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1849,7 +1849,7 @@ static void ClassicWoodenRCTrackDiagLeftBankTo25DegUp( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -1963,7 +1963,7 @@ static void ClassicWoodenRCTrackDiagRightBankTo25DegUp( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -2077,7 +2077,7 @@ static void ClassicWoodenRCTrackDiag25DegUpToLeftBank( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -2191,7 +2191,7 @@ static void ClassicWoodenRCTrackDiag25DegUpToRightBank( WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][1], height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index 2e8a253172..1d550776f6 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -83,7 +83,7 @@ static void CompactInvertedRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -118,7 +118,7 @@ static void CompactInvertedRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::TubesInverted); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -181,7 +181,7 @@ static void CompactInvertedRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -286,7 +286,7 @@ static void CompactInvertedRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -349,7 +349,7 @@ static void CompactInvertedRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -466,7 +466,7 @@ static void CompactInvertedRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -541,7 +541,7 @@ static void CompactInvertedRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -639,7 +639,7 @@ static void CompactInvertedRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -759,7 +759,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -797,7 +797,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -825,7 +825,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -855,7 +855,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -885,7 +885,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -944,7 +944,7 @@ static void CompactInvertedRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -987,7 +987,7 @@ static void CompactInvertedRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1030,7 +1030,7 @@ static void CompactInvertedRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1073,7 +1073,7 @@ static void CompactInvertedRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1118,7 +1118,7 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -1156,7 +1156,7 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1184,7 +1184,7 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1214,7 +1214,7 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1244,7 +1244,7 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -1303,7 +1303,7 @@ static void CompactInvertedRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1374,7 +1374,7 @@ static void CompactInvertedRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1445,7 +1445,7 @@ static void CompactInvertedRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1516,7 +1516,7 @@ static void CompactInvertedRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1619,7 +1619,7 @@ static void CompactInvertedRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1668,7 +1668,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -1704,7 +1704,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1729,7 +1729,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1757,7 +1757,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1783,7 +1783,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -1831,7 +1831,7 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -1867,7 +1867,7 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1892,7 +1892,7 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1920,7 +1920,7 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1946,7 +1946,7 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -2016,7 +2016,7 @@ static void CompactInvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2051,7 +2051,7 @@ static void CompactInvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -2094,7 +2094,7 @@ static void CompactInvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2138,7 +2138,7 @@ static void CompactInvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2189,7 +2189,7 @@ static void CompactInvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2224,7 +2224,7 @@ static void CompactInvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2267,7 +2267,7 @@ static void CompactInvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -2311,7 +2311,7 @@ static void CompactInvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2364,7 +2364,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2421,7 +2421,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( { { 29, 20, height + 29 }, { 2, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -2449,7 +2449,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2478,7 +2478,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2514,7 +2514,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2543,7 +2543,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2570,7 +2570,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( { { 0, 29, height + 29 }, { 32, 2, 63 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: @@ -2601,7 +2601,7 @@ static void CompactInvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2677,7 +2677,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2734,7 +2734,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( { { 0, 29, height + 29 }, { 32, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -2762,7 +2762,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2791,7 +2791,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2827,7 +2827,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2856,7 +2856,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2883,7 +2883,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( { { 0, 0, height + 29 }, { 32, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: @@ -2914,7 +2914,7 @@ static void CompactInvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2988,7 +2988,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3026,7 +3026,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3055,7 +3055,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3116,7 +3116,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3155,7 +3155,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3184,7 +3184,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3241,7 +3241,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3280,7 +3280,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3328,7 +3328,7 @@ static void CompactInvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3367,7 +3367,7 @@ static void CompactInvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3434,7 +3434,7 @@ static void CompactInvertedRCTrackLeftTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3467,7 +3467,7 @@ static void CompactInvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3504,7 +3504,7 @@ static void CompactInvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3541,7 +3541,7 @@ static void CompactInvertedRCTrackRightTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3574,7 +3574,7 @@ static void CompactInvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3611,7 +3611,7 @@ static void CompactInvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3653,7 +3653,7 @@ static void CompactInvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3679,7 +3679,7 @@ static void CompactInvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3706,7 +3706,7 @@ static void CompactInvertedRCTrackLeftTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3760,7 +3760,7 @@ static void CompactInvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3786,7 +3786,7 @@ static void CompactInvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3813,7 +3813,7 @@ static void CompactInvertedRCTrackRightTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3865,7 +3865,7 @@ static void CompactInvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3920,7 +3920,7 @@ static void CompactInvertedRCTrackHalfLoopUp( { { 29, 20, height + 29 }, { 2, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3949,7 +3949,7 @@ static void CompactInvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3982,7 +3982,7 @@ static void CompactInvertedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4031,7 +4031,7 @@ static void CompactInvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4066,7 +4066,7 @@ static void CompactInvertedRCTrackLeftCorkscrewUp( { { 6, 6, height + 24 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4107,7 +4107,7 @@ static void CompactInvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4149,7 +4149,7 @@ static void CompactInvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4184,7 +4184,7 @@ static void CompactInvertedRCTrackRightCorkscrewUp( { { 6, 6, height + 24 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4225,7 +4225,7 @@ static void CompactInvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4289,7 +4289,7 @@ static void CompactInvertedRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4334,7 +4334,7 @@ static void CompactInvertedRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4376,7 +4376,7 @@ static void CompactInvertedRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -4420,7 +4420,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4460,7 +4460,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4489,7 +4489,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4521,7 +4521,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4551,7 +4551,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -4603,7 +4603,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4643,7 +4643,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4672,7 +4672,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4704,7 +4704,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4734,7 +4734,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -4786,7 +4786,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -4826,7 +4826,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4855,7 +4855,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4887,7 +4887,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4917,7 +4917,7 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4969,7 +4969,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -5009,7 +5009,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5038,7 +5038,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5070,7 +5070,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5100,7 +5100,7 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5151,7 +5151,7 @@ static void CompactInvertedRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -5217,7 +5217,7 @@ static void CompactInvertedRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5299,7 +5299,7 @@ static void CompactInvertedRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5382,7 +5382,7 @@ static void CompactInvertedRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } @@ -5451,7 +5451,7 @@ static void CompactInvertedRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -5492,7 +5492,7 @@ static void CompactInvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -5528,7 +5528,7 @@ static void CompactInvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5557,13 +5557,13 @@ static void CompactInvertedRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5593,7 +5593,7 @@ static void CompactInvertedRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5657,7 +5657,7 @@ static void CompactInvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -5693,7 +5693,7 @@ static void CompactInvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5722,13 +5722,13 @@ static void CompactInvertedRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5758,7 +5758,7 @@ static void CompactInvertedRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5840,7 +5840,7 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -5876,7 +5876,7 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5905,13 +5905,13 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5942,7 +5942,7 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -6006,7 +6006,7 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -6042,7 +6042,7 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6071,13 +6071,13 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -6108,7 +6108,7 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -6188,7 +6188,7 @@ static void CompactInvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6215,7 +6215,7 @@ static void CompactInvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6242,7 +6242,7 @@ static void CompactInvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6270,7 +6270,7 @@ static void CompactInvertedRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6370,7 +6370,7 @@ static void CompactInvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6397,7 +6397,7 @@ static void CompactInvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6424,7 +6424,7 @@ static void CompactInvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6452,7 +6452,7 @@ static void CompactInvertedRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6499,7 +6499,7 @@ static void CompactInvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -6512,7 +6512,7 @@ static void CompactInvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -6525,7 +6525,7 @@ static void CompactInvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -6539,7 +6539,7 @@ static void CompactInvertedRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6600,7 +6600,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6627,7 +6627,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -6654,7 +6654,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -6682,7 +6682,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6729,7 +6729,7 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6742,7 +6742,7 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6755,7 +6755,7 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6769,7 +6769,7 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6816,7 +6816,7 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6829,7 +6829,7 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6842,7 +6842,7 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6856,7 +6856,7 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6917,7 +6917,7 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6944,7 +6944,7 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6971,7 +6971,7 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6999,7 +6999,7 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7060,7 +7060,7 @@ static void CompactInvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7087,7 +7087,7 @@ static void CompactInvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7114,7 +7114,7 @@ static void CompactInvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7142,7 +7142,7 @@ static void CompactInvertedRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7189,7 +7189,7 @@ static void CompactInvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -7202,7 +7202,7 @@ static void CompactInvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -7215,7 +7215,7 @@ static void CompactInvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -7229,7 +7229,7 @@ static void CompactInvertedRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7290,7 +7290,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7316,7 +7316,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7342,7 +7342,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7369,7 +7369,7 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7416,7 +7416,7 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7429,7 +7429,7 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7442,7 +7442,7 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7456,7 +7456,7 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7503,7 +7503,7 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7516,7 +7516,7 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7529,7 +7529,7 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7543,7 +7543,7 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7604,7 +7604,7 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7631,7 +7631,7 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7658,7 +7658,7 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7686,7 +7686,7 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7733,7 +7733,7 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7746,7 +7746,7 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7759,7 +7759,7 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7773,7 +7773,7 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7821,7 +7821,7 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7834,7 +7834,7 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7847,7 +7847,7 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7861,7 +7861,7 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7909,7 +7909,7 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7922,7 +7922,7 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7935,7 +7935,7 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7949,7 +7949,7 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7997,7 +7997,7 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8010,7 +8010,7 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8023,7 +8023,7 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8037,7 +8037,7 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -8085,7 +8085,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8098,7 +8098,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8111,7 +8111,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8125,7 +8125,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8172,7 +8172,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8185,7 +8185,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8198,7 +8198,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8212,7 +8212,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8259,7 +8259,7 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8272,7 +8272,7 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8285,7 +8285,7 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8299,7 +8299,7 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8346,7 +8346,7 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8359,7 +8359,7 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8372,7 +8372,7 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8386,7 +8386,7 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8433,7 +8433,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8445,7 +8445,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8457,7 +8457,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8470,7 +8470,7 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8517,7 +8517,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8529,7 +8529,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8541,7 +8541,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8554,7 +8554,7 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8601,7 +8601,7 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8614,7 +8614,7 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8627,7 +8627,7 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8641,7 +8641,7 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8688,7 +8688,7 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8701,7 +8701,7 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8714,7 +8714,7 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8728,7 +8728,7 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8775,7 +8775,7 @@ static void CompactInvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8788,7 +8788,7 @@ static void CompactInvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8801,7 +8801,7 @@ static void CompactInvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8815,7 +8815,7 @@ static void CompactInvertedRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -8863,7 +8863,7 @@ static void CompactInvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8876,7 +8876,7 @@ static void CompactInvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8889,7 +8889,7 @@ static void CompactInvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8903,7 +8903,7 @@ static void CompactInvertedRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -8956,7 +8956,7 @@ static void CompactInvertedRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp index e0744f3abc..2293fd0e7d 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp @@ -113,7 +113,7 @@ static void CorkscrewRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -148,7 +148,7 @@ static void CorkscrewRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -228,7 +228,7 @@ static void CorkscrewRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -308,7 +308,7 @@ static void CorkscrewRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -388,7 +388,7 @@ static void CorkscrewRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -480,7 +480,7 @@ static void CorkscrewRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -572,7 +572,7 @@ static void CorkscrewRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -652,7 +652,7 @@ static void CorkscrewRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -742,7 +742,7 @@ static void CorkscrewRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -774,7 +774,7 @@ static void CorkscrewRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -803,7 +803,7 @@ static void CorkscrewRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -835,7 +835,7 @@ static void CorkscrewRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -875,7 +875,7 @@ static void CorkscrewRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -931,7 +931,7 @@ static void CorkscrewRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -976,7 +976,7 @@ static void CorkscrewRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1021,7 +1021,7 @@ static void CorkscrewRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1066,7 +1066,7 @@ static void CorkscrewRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1111,7 +1111,7 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1143,7 +1143,7 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1172,7 +1172,7 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1204,7 +1204,7 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1247,7 +1247,7 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1310,7 +1310,7 @@ static void CorkscrewRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1362,7 +1362,7 @@ static void CorkscrewRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1414,7 +1414,7 @@ static void CorkscrewRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1466,7 +1466,7 @@ static void CorkscrewRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1537,7 +1537,7 @@ static void CorkscrewRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1587,7 +1587,7 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1617,7 +1617,7 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1645,7 +1645,7 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1675,7 +1675,7 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1715,7 +1715,7 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1759,7 +1759,7 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1789,7 +1789,7 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1817,7 +1817,7 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1847,7 +1847,7 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1887,7 +1887,7 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1949,7 +1949,7 @@ static void CorkscrewRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1980,7 +1980,7 @@ static void CorkscrewRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2012,7 +2012,7 @@ static void CorkscrewRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2052,7 +2052,7 @@ static void CorkscrewRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2096,7 +2096,7 @@ static void CorkscrewRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2128,7 +2128,7 @@ static void CorkscrewRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2161,7 +2161,7 @@ static void CorkscrewRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2201,7 +2201,7 @@ static void CorkscrewRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2248,7 +2248,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2282,7 +2282,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2311,7 +2311,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2336,7 +2336,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2368,7 +2368,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2397,7 +2397,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2430,7 +2430,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2473,7 +2473,7 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2753,7 +2753,7 @@ static void CorkscrewRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2784,7 +2784,7 @@ static void CorkscrewRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2823,7 +2823,7 @@ static void CorkscrewRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2879,7 +2879,7 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2910,7 +2910,7 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2952,7 +2952,7 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3001,7 +3001,7 @@ static void CorkscrewRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3042,7 +3042,7 @@ static void CorkscrewRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3082,7 +3082,7 @@ static void CorkscrewRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3129,7 +3129,7 @@ static void CorkscrewRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3187,7 +3187,7 @@ static void CorkscrewRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3221,7 +3221,7 @@ static void CorkscrewRCTrackHalfLoopUp( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3248,7 +3248,7 @@ static void CorkscrewRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3277,7 +3277,7 @@ static void CorkscrewRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3355,7 +3355,7 @@ static void CorkscrewRCTrackLeftCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3384,7 +3384,7 @@ static void CorkscrewRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3441,7 +3441,7 @@ static void CorkscrewRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3469,7 +3469,7 @@ static void CorkscrewRCTrackRightCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3498,7 +3498,7 @@ static void CorkscrewRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3574,7 +3574,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3606,7 +3606,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3648,7 +3648,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3691,7 +3691,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3723,7 +3723,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3760,7 +3760,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3808,7 +3808,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3840,7 +3840,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3882,7 +3882,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3925,7 +3925,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3957,7 +3957,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3994,7 +3994,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4070,7 +4070,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4103,7 +4103,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4132,7 +4132,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4164,7 +4164,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4207,7 +4207,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4250,7 +4250,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4283,7 +4283,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4312,7 +4312,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4344,7 +4344,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4382,7 +4382,7 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4430,7 +4430,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4463,7 +4463,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4492,7 +4492,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4524,7 +4524,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4567,7 +4567,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4610,7 +4610,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4643,7 +4643,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4672,7 +4672,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4704,7 +4704,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4742,7 +4742,7 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4818,7 +4818,7 @@ static void CorkscrewRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4863,7 +4863,7 @@ static void CorkscrewRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4910,7 +4910,7 @@ static void CorkscrewRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4946,7 +4946,7 @@ static void CorkscrewRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -4991,7 +4991,7 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5024,7 +5024,7 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 7, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5057,7 +5057,7 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -5099,7 +5099,7 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -5146,7 +5146,7 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -5179,7 +5179,7 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -5212,7 +5212,7 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5254,7 +5254,7 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -5314,7 +5314,7 @@ static void CorkscrewRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5343,7 +5343,7 @@ static void CorkscrewRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5372,13 +5372,13 @@ static void CorkscrewRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5415,7 +5415,7 @@ static void CorkscrewRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5460,7 +5460,7 @@ static void CorkscrewRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5489,7 +5489,7 @@ static void CorkscrewRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5518,13 +5518,13 @@ static void CorkscrewRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5561,7 +5561,7 @@ static void CorkscrewRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5624,7 +5624,7 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5653,7 +5653,7 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5682,13 +5682,13 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5725,7 +5725,7 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5770,7 +5770,7 @@ static void CorkscrewRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5799,7 +5799,7 @@ static void CorkscrewRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5828,13 +5828,13 @@ static void CorkscrewRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5871,7 +5871,7 @@ static void CorkscrewRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5927,7 +5927,7 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5954,7 +5954,7 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5981,7 +5981,7 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6040,7 +6040,7 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6116,7 +6116,7 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6143,7 +6143,7 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6170,7 +6170,7 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6229,7 +6229,7 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6266,7 +6266,7 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6293,7 +6293,7 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6320,7 +6320,7 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6381,7 +6381,7 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6418,7 +6418,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6445,7 +6445,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6472,7 +6472,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6531,7 +6531,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6568,7 +6568,7 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6595,7 +6595,7 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6622,7 +6622,7 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6683,7 +6683,7 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6720,7 +6720,7 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6747,7 +6747,7 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6774,7 +6774,7 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6835,7 +6835,7 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6872,7 +6872,7 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6899,7 +6899,7 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6926,7 +6926,7 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6985,7 +6985,7 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7022,7 +7022,7 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7049,7 +7049,7 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7076,7 +7076,7 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7135,7 +7135,7 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7172,7 +7172,7 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -7199,7 +7199,7 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -7226,7 +7226,7 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -7287,7 +7287,7 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -7324,7 +7324,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7350,7 +7350,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7376,7 +7376,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7434,7 +7434,7 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -7472,7 +7472,7 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7499,7 +7499,7 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7526,7 +7526,7 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7587,7 +7587,7 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7624,7 +7624,7 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7651,7 +7651,7 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7678,7 +7678,7 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7737,7 +7737,7 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7774,7 +7774,7 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7801,7 +7801,7 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7828,7 +7828,7 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7887,7 +7887,7 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7910,7 +7910,7 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7926,7 +7926,7 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7939,7 +7939,7 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7966,7 +7966,7 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7989,7 +7989,7 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8002,7 +8002,7 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8018,7 +8018,7 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8045,7 +8045,7 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8068,7 +8068,7 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8084,7 +8084,7 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8097,7 +8097,7 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8124,7 +8124,7 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8147,7 +8147,7 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8160,7 +8160,7 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8176,7 +8176,7 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8203,7 +8203,7 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8226,7 +8226,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8242,7 +8242,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8255,7 +8255,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8282,7 +8282,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8305,7 +8305,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8318,7 +8318,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8334,7 +8334,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8361,7 +8361,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8384,7 +8384,7 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8400,7 +8400,7 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8413,7 +8413,7 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8440,7 +8440,7 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8463,7 +8463,7 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8476,7 +8476,7 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8492,7 +8492,7 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8519,7 +8519,7 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8542,7 +8542,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8557,7 +8557,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8569,7 +8569,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8595,7 +8595,7 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8619,7 +8619,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8631,7 +8631,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8646,7 +8646,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8672,7 +8672,7 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8696,7 +8696,7 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8712,7 +8712,7 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8725,7 +8725,7 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8752,7 +8752,7 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8775,7 +8775,7 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8788,7 +8788,7 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8804,7 +8804,7 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8831,7 +8831,7 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8854,7 +8854,7 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8867,7 +8867,7 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8880,7 +8880,7 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8907,7 +8907,7 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8930,7 +8930,7 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8943,7 +8943,7 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8956,7 +8956,7 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8983,7 +8983,7 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9001,7 +9001,7 @@ static void CorkscrewRCTrackBlockBrakes( MetalASupportsPaintSetup(session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9048,7 +9048,7 @@ static void CorkscrewRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9086,7 +9086,7 @@ static void CorkscrewRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9112,7 +9112,7 @@ static void CorkscrewRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9138,7 +9138,7 @@ static void CorkscrewRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9191,7 +9191,7 @@ static void CorkscrewRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9217,7 +9217,7 @@ static void CorkscrewRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9243,7 +9243,7 @@ static void CorkscrewRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9290,7 +9290,7 @@ static void CorkscrewRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9323,7 +9323,7 @@ static void CorkscrewRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9360,7 +9360,7 @@ static void CorkscrewRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9395,7 +9395,7 @@ static void CorkscrewRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9428,7 +9428,7 @@ static void CorkscrewRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9465,7 +9465,7 @@ static void CorkscrewRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9507,7 +9507,7 @@ static void LayDownRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9534,7 +9534,7 @@ static void LayDownRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9562,7 +9562,7 @@ static void LayDownRCTrackLeftFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -9616,7 +9616,7 @@ static void LayDownRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9642,7 +9642,7 @@ static void LayDownRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9669,7 +9669,7 @@ static void LayDownRCTrackRightFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -9722,7 +9722,7 @@ static void LayDownRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9760,7 +9760,7 @@ static void LayDownRCTrackFlyerHalfLoopUp( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9787,7 +9787,7 @@ static void LayDownRCTrackFlyerHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -9816,7 +9816,7 @@ static void LayDownRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -9857,7 +9857,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( if (direction == 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); } MetalASupportsPaintSetup( @@ -9865,7 +9865,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( if (direction != 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); } @@ -9899,7 +9899,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9928,7 +9928,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -9985,7 +9985,7 @@ static void LayDownRCTrackRightFlyerCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10013,7 +10013,7 @@ static void LayDownRCTrackRightFlyerCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10042,7 +10042,7 @@ static void LayDownRCTrackRightFlyerCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); diff --git a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp index 69a9912482..0ccad1ac23 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -89,7 +89,7 @@ static void FlyingRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -132,7 +132,7 @@ static void FlyingRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -198,7 +198,7 @@ static void FlyingRCTrackStation( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -275,7 +275,7 @@ static void FlyingRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -334,7 +334,7 @@ static void FlyingRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -418,7 +418,7 @@ static void FlyingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } else @@ -455,7 +455,7 @@ static void FlyingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -533,7 +533,7 @@ static void FlyingRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -592,7 +592,7 @@ static void FlyingRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -682,7 +682,7 @@ static void FlyingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else @@ -725,7 +725,7 @@ static void FlyingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } @@ -780,7 +780,7 @@ static void FlyingRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else @@ -816,7 +816,7 @@ static void FlyingRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -929,7 +929,7 @@ static void FlyingRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -988,7 +988,7 @@ static void FlyingRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1116,7 +1116,7 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1149,7 +1149,7 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1178,7 +1178,7 @@ static void FlyingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1211,7 +1211,7 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1251,7 +1251,7 @@ static void FlyingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1286,7 +1286,7 @@ static void FlyingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -1328,7 +1328,7 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1357,7 +1357,7 @@ static void FlyingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1390,7 +1390,7 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1420,7 +1420,7 @@ static void FlyingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -1493,7 +1493,7 @@ static void FlyingRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1524,7 +1524,7 @@ static void FlyingRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1580,7 +1580,7 @@ static void FlyingRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1611,7 +1611,7 @@ static void FlyingRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1667,7 +1667,7 @@ static void FlyingRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1698,7 +1698,7 @@ static void FlyingRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1754,7 +1754,7 @@ static void FlyingRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1785,7 +1785,7 @@ static void FlyingRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1841,7 +1841,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1874,7 +1874,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1903,7 +1903,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1936,7 +1936,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1979,7 +1979,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2014,7 +2014,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -2054,7 +2054,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2082,7 +2082,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2113,7 +2113,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2143,7 +2143,7 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -2223,7 +2223,7 @@ static void FlyingRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -2254,7 +2254,7 @@ static void FlyingRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2345,7 +2345,7 @@ static void FlyingRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -2376,7 +2376,7 @@ static void FlyingRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2467,7 +2467,7 @@ static void FlyingRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -2498,7 +2498,7 @@ static void FlyingRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2589,7 +2589,7 @@ static void FlyingRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -2620,7 +2620,7 @@ static void FlyingRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2730,7 +2730,7 @@ static void FlyingRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -2761,7 +2761,7 @@ static void FlyingRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2822,7 +2822,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2853,7 +2853,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2881,7 +2881,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -2912,7 +2912,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2952,7 +2952,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2983,7 +2983,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3021,7 +3021,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3046,7 +3046,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -3075,7 +3075,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3101,7 +3101,7 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3162,7 +3162,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3193,7 +3193,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3221,7 +3221,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -3252,7 +3252,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3292,7 +3292,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3323,7 +3323,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3361,7 +3361,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3386,7 +3386,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -3415,7 +3415,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3441,7 +3441,7 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3520,7 +3520,7 @@ static void FlyingRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3554,7 +3554,7 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3589,7 +3589,7 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3629,7 +3629,7 @@ static void FlyingRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3664,7 +3664,7 @@ static void FlyingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -3703,7 +3703,7 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -3749,7 +3749,7 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3793,7 +3793,7 @@ static void FlyingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -3853,7 +3853,7 @@ static void FlyingRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3887,7 +3887,7 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3922,7 +3922,7 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3962,7 +3962,7 @@ static void FlyingRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3997,7 +3997,7 @@ static void FlyingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -4036,7 +4036,7 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -4082,7 +4082,7 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -4126,7 +4126,7 @@ static void FlyingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -4186,7 +4186,7 @@ static void FlyingRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4217,7 +4217,7 @@ static void FlyingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4256,7 +4256,7 @@ static void FlyingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4291,7 +4291,7 @@ static void FlyingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4331,7 +4331,7 @@ static void FlyingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4360,7 +4360,7 @@ static void FlyingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4433,7 +4433,7 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4464,7 +4464,7 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4506,7 +4506,7 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4541,7 +4541,7 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4581,7 +4581,7 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4610,7 +4610,7 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4676,7 +4676,7 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4717,7 +4717,7 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4748,7 +4748,7 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -4788,7 +4788,7 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -4845,7 +4845,7 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4896,7 +4896,7 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4927,7 +4927,7 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -4967,7 +4967,7 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -5047,7 +5047,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5079,7 +5079,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5121,7 +5121,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5164,7 +5164,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5196,7 +5196,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5233,7 +5233,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5281,7 +5281,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5313,7 +5313,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5355,7 +5355,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5398,7 +5398,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5430,7 +5430,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5467,7 +5467,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5543,7 +5543,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5576,7 +5576,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5605,7 +5605,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5637,7 +5637,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5680,7 +5680,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5723,7 +5723,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5756,7 +5756,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5785,7 +5785,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -5817,7 +5817,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5855,7 +5855,7 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5903,7 +5903,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5936,7 +5936,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5965,7 +5965,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5997,7 +5997,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6040,7 +6040,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6083,7 +6083,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6116,7 +6116,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6145,7 +6145,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -6177,7 +6177,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6215,7 +6215,7 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6333,7 +6333,7 @@ static void FlyingRCTrackLeftQuarterTurn160DegUp( } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -6419,7 +6419,7 @@ static void FlyingRCTrackRightQuarterTurn160DegUp( } } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -6468,7 +6468,7 @@ static void FlyingRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -6490,7 +6490,7 @@ static void FlyingRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -6519,7 +6519,7 @@ static void FlyingRCTrackBooster( { { 0, 6, height + 22 }, { 32, 20, 1 } }); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -6564,7 +6564,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -6604,7 +6604,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6633,7 +6633,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -6665,7 +6665,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6695,7 +6695,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -6747,7 +6747,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -6787,7 +6787,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6816,7 +6816,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -6848,7 +6848,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6878,7 +6878,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -6930,7 +6930,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -6970,7 +6970,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6999,7 +6999,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -7031,7 +7031,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7061,7 +7061,7 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -7113,7 +7113,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -7153,7 +7153,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7182,7 +7182,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -7214,7 +7214,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7244,7 +7244,7 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -7307,7 +7307,7 @@ static void FlyingRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -7337,7 +7337,7 @@ static void FlyingRCTrack25DegUpLeftBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -7421,7 +7421,7 @@ static void FlyingRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -7451,7 +7451,7 @@ static void FlyingRCTrack25DegUpRightBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -7525,7 +7525,7 @@ static void FlyingRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -7557,7 +7557,7 @@ static void FlyingRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } @@ -7618,7 +7618,7 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7648,7 +7648,7 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7677,13 +7677,13 @@ static void FlyingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -7725,7 +7725,7 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7761,7 +7761,7 @@ static void FlyingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -7799,7 +7799,7 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7828,13 +7828,13 @@ static void FlyingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -7865,7 +7865,7 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -7937,7 +7937,7 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7967,7 +7967,7 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7996,13 +7996,13 @@ static void FlyingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8044,7 +8044,7 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8080,7 +8080,7 @@ static void FlyingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8118,7 +8118,7 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8147,13 +8147,13 @@ static void FlyingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8184,7 +8184,7 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -8274,7 +8274,7 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8304,7 +8304,7 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8333,13 +8333,13 @@ static void FlyingRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8381,7 +8381,7 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8417,7 +8417,7 @@ static void FlyingRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8455,7 +8455,7 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8484,13 +8484,13 @@ static void FlyingRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8521,7 +8521,7 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -8593,7 +8593,7 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8623,7 +8623,7 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8652,13 +8652,13 @@ static void FlyingRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8700,7 +8700,7 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8736,7 +8736,7 @@ static void FlyingRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8774,7 +8774,7 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8803,13 +8803,13 @@ static void FlyingRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8840,7 +8840,7 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -8923,7 +8923,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8950,7 +8950,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8977,7 +8977,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9040,7 +9040,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9073,7 +9073,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9100,7 +9100,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9127,7 +9127,7 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9155,7 +9155,7 @@ static void FlyingRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9263,7 +9263,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9290,7 +9290,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9317,7 +9317,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9380,7 +9380,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -9413,7 +9413,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9440,7 +9440,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9467,7 +9467,7 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9495,7 +9495,7 @@ static void FlyingRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9559,7 +9559,7 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -9586,7 +9586,7 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -9613,7 +9613,7 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -9676,7 +9676,7 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -9695,7 +9695,7 @@ static void FlyingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -9708,7 +9708,7 @@ static void FlyingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -9721,7 +9721,7 @@ static void FlyingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -9735,7 +9735,7 @@ static void FlyingRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9799,7 +9799,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9826,7 +9826,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9853,7 +9853,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -9916,7 +9916,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -9949,7 +9949,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9976,7 +9976,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10003,7 +10003,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10031,7 +10031,7 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -10095,7 +10095,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10122,7 +10122,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10149,7 +10149,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10212,7 +10212,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10231,7 +10231,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10244,7 +10244,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10257,7 +10257,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10271,7 +10271,7 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -10335,7 +10335,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10362,7 +10362,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10389,7 +10389,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10452,7 +10452,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10471,7 +10471,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10484,7 +10484,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10497,7 +10497,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10511,7 +10511,7 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -10575,7 +10575,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10602,7 +10602,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10629,7 +10629,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10692,7 +10692,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10725,7 +10725,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10752,7 +10752,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10779,7 +10779,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10807,7 +10807,7 @@ static void FlyingRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -10871,7 +10871,7 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10898,7 +10898,7 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10925,7 +10925,7 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10988,7 +10988,7 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -11007,7 +11007,7 @@ static void FlyingRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11020,7 +11020,7 @@ static void FlyingRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -11033,7 +11033,7 @@ static void FlyingRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11047,7 +11047,7 @@ static void FlyingRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11111,7 +11111,7 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -11138,7 +11138,7 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -11165,7 +11165,7 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -11228,7 +11228,7 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -11247,7 +11247,7 @@ static void FlyingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -11260,7 +11260,7 @@ static void FlyingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -11273,7 +11273,7 @@ static void FlyingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -11287,7 +11287,7 @@ static void FlyingRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11351,7 +11351,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -11377,7 +11377,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -11403,7 +11403,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -11465,7 +11465,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } } @@ -11483,7 +11483,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11495,7 +11495,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11507,7 +11507,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11520,7 +11520,7 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11584,7 +11584,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11611,7 +11611,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11638,7 +11638,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11701,7 +11701,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -11720,7 +11720,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11733,7 +11733,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11746,7 +11746,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11760,7 +11760,7 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11824,7 +11824,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11851,7 +11851,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11878,7 +11878,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11941,7 +11941,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -11960,7 +11960,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11973,7 +11973,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11986,7 +11986,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -12000,7 +12000,7 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -12064,7 +12064,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12091,7 +12091,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12118,7 +12118,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12181,7 +12181,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12200,7 +12200,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12213,7 +12213,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12226,7 +12226,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12240,7 +12240,7 @@ static void FlyingRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -12290,7 +12290,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12306,7 +12306,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12319,7 +12319,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12350,7 +12350,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12369,7 +12369,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12382,7 +12382,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12395,7 +12395,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12409,7 +12409,7 @@ static void FlyingRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -12460,7 +12460,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12473,7 +12473,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12489,7 +12489,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12520,7 +12520,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12539,7 +12539,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12552,7 +12552,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12565,7 +12565,7 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12579,7 +12579,7 @@ static void FlyingRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -12630,7 +12630,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12646,7 +12646,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12659,7 +12659,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12690,7 +12690,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12709,7 +12709,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12722,7 +12722,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12735,7 +12735,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12749,7 +12749,7 @@ static void FlyingRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -12800,7 +12800,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12813,7 +12813,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12829,7 +12829,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12860,7 +12860,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12879,7 +12879,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12892,7 +12892,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12905,7 +12905,7 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12919,7 +12919,7 @@ static void FlyingRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -12970,7 +12970,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12986,7 +12986,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12999,7 +12999,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13030,7 +13030,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13049,7 +13049,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13062,7 +13062,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13075,7 +13075,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13089,7 +13089,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -13139,7 +13139,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13152,7 +13152,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13168,7 +13168,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13199,7 +13199,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13218,7 +13218,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13231,7 +13231,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13244,7 +13244,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13258,7 +13258,7 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -13308,7 +13308,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13324,7 +13324,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13337,7 +13337,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13368,7 +13368,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13387,7 +13387,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13400,7 +13400,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13413,7 +13413,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13427,7 +13427,7 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -13477,7 +13477,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13490,7 +13490,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13506,7 +13506,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13537,7 +13537,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13556,7 +13556,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13569,7 +13569,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13582,7 +13582,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13596,7 +13596,7 @@ static void FlyingRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -13646,7 +13646,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13661,7 +13661,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13673,7 +13673,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13703,7 +13703,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } } @@ -13721,7 +13721,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13733,7 +13733,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13745,7 +13745,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13758,7 +13758,7 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -13808,7 +13808,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13820,7 +13820,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13835,7 +13835,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13865,7 +13865,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } } @@ -13883,7 +13883,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -13895,7 +13895,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -13907,7 +13907,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -13920,7 +13920,7 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -13970,7 +13970,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13986,7 +13986,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13999,7 +13999,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14030,7 +14030,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14049,7 +14049,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14062,7 +14062,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14075,7 +14075,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14089,7 +14089,7 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -14139,7 +14139,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14152,7 +14152,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14168,7 +14168,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14199,7 +14199,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14218,7 +14218,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14231,7 +14231,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14244,7 +14244,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14258,7 +14258,7 @@ static void FlyingRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -14308,7 +14308,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14321,7 +14321,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14334,7 +14334,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14365,7 +14365,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -14384,7 +14384,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14397,7 +14397,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14410,7 +14410,7 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14424,7 +14424,7 @@ static void FlyingRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -14475,7 +14475,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14488,7 +14488,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14501,7 +14501,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14532,7 +14532,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -14551,7 +14551,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14564,7 +14564,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14577,7 +14577,7 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14591,7 +14591,7 @@ static void FlyingRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -14662,7 +14662,7 @@ static void FlyingRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14689,7 +14689,7 @@ static void FlyingRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14717,7 +14717,7 @@ static void FlyingRCTrackLeftFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -14775,7 +14775,7 @@ static void FlyingRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14801,7 +14801,7 @@ static void FlyingRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14828,7 +14828,7 @@ static void FlyingRCTrackRightFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -14878,7 +14878,7 @@ static void FlyingRCTrackLeftFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -14912,7 +14912,7 @@ static void FlyingRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14953,7 +14953,7 @@ static void FlyingRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14990,7 +14990,7 @@ static void FlyingRCTrackRightFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -15023,7 +15023,7 @@ static void FlyingRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -15064,7 +15064,7 @@ static void FlyingRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -15105,7 +15105,7 @@ static void FlyingRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15143,7 +15143,7 @@ static void FlyingRCTrackFlyerHalfLoopUp( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -15170,7 +15170,7 @@ static void FlyingRCTrackFlyerHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -15199,7 +15199,7 @@ static void FlyingRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15237,7 +15237,7 @@ static void FlyingRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15264,7 +15264,7 @@ static void FlyingRCTrackFlyerHalfLoopDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -15303,7 +15303,7 @@ static void FlyingRCTrackFlyerHalfLoopDown( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -15333,7 +15333,7 @@ static void FlyingRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15365,7 +15365,7 @@ static void FlyingRCTrackBlockBrakes( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -15387,7 +15387,7 @@ static void FlyingRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -15436,7 +15436,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15479,7 +15479,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15510,7 +15510,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15550,7 +15550,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15608,7 +15608,7 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15661,7 +15661,7 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15692,7 +15692,7 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15732,7 +15732,7 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15811,7 +15811,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15843,7 +15843,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15871,7 +15871,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -15904,7 +15904,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15944,7 +15944,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15975,7 +15975,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16013,7 +16013,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16038,7 +16038,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -16067,7 +16067,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16093,7 +16093,7 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16154,7 +16154,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -16186,7 +16186,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16214,7 +16214,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -16247,7 +16247,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16287,7 +16287,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16318,7 +16318,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16356,7 +16356,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16381,7 +16381,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -16410,7 +16410,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16436,7 +16436,7 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16522,7 +16522,7 @@ static void FlyingRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16552,7 +16552,7 @@ static void FlyingRCTrack25DegUpToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -16639,7 +16639,7 @@ static void FlyingRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16669,7 +16669,7 @@ static void FlyingRCTrack25DegUpToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -16756,7 +16756,7 @@ static void FlyingRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16786,7 +16786,7 @@ static void FlyingRCTrackLeftBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -16873,7 +16873,7 @@ static void FlyingRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16903,7 +16903,7 @@ static void FlyingRCTrackRightBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17019,7 +17019,7 @@ static void FlyingRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17049,7 +17049,7 @@ static void FlyingRCTrackLeftBankedFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17133,7 +17133,7 @@ static void FlyingRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17163,7 +17163,7 @@ static void FlyingRCTrackRightBankedFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17247,7 +17247,7 @@ static void FlyingRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17277,7 +17277,7 @@ static void FlyingRCTrackLeftBanked25DegUpToLeftBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17361,7 +17361,7 @@ static void FlyingRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17391,7 +17391,7 @@ static void FlyingRCTrackRightBanked25DegUpToRightBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17510,7 +17510,7 @@ static void FlyingRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17540,7 +17540,7 @@ static void FlyingRCTrackFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17627,7 +17627,7 @@ static void FlyingRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17657,7 +17657,7 @@ static void FlyingRCTrackFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17744,7 +17744,7 @@ static void FlyingRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17774,7 +17774,7 @@ static void FlyingRCTrackLeftBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17861,7 +17861,7 @@ static void FlyingRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17891,7 +17891,7 @@ static void FlyingRCTrackRightBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17999,7 +17999,7 @@ static void FlyingRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -18052,7 +18052,7 @@ static void FlyingRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -18106,7 +18106,7 @@ static void FlyingRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -18147,7 +18147,7 @@ static void FlyingRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -18186,7 +18186,7 @@ static void FlyingRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -18214,7 +18214,7 @@ static void FlyingRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -18246,7 +18246,7 @@ static void FlyingRCTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -18330,7 +18330,7 @@ static void FlyingRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -18385,7 +18385,7 @@ static void FlyingRCTrackHalfLoopInvertedUp( { { 29, 20, height + 29 }, { 2, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -18414,7 +18414,7 @@ static void FlyingRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -18447,7 +18447,7 @@ static void FlyingRCTrackHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -18495,7 +18495,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -18523,7 +18523,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -18552,7 +18552,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -18582,7 +18582,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18611,7 +18611,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -18640,7 +18640,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18686,7 +18686,7 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -18728,7 +18728,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -18756,7 +18756,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -18785,7 +18785,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -18815,7 +18815,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18844,7 +18844,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -18873,7 +18873,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18919,7 +18919,7 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; diff --git a/src/openrct2/ride/coaster/GigaCoaster.cpp b/src/openrct2/ride/coaster/GigaCoaster.cpp index 5b0b26ec6d..9cc6770d2f 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -164,7 +164,7 @@ static void GigaRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -198,7 +198,7 @@ static void GigaRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -309,7 +309,7 @@ static void GigaRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -389,7 +389,7 @@ static void GigaRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -500,7 +500,7 @@ static void GigaRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -592,7 +592,7 @@ static void GigaRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -684,7 +684,7 @@ static void GigaRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -795,7 +795,7 @@ static void GigaRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -885,7 +885,7 @@ static void GigaRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -917,7 +917,7 @@ static void GigaRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -946,7 +946,7 @@ static void GigaRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -978,7 +978,7 @@ static void GigaRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1018,7 +1018,7 @@ static void GigaRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1074,7 +1074,7 @@ static void GigaRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1119,7 +1119,7 @@ static void GigaRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1164,7 +1164,7 @@ static void GigaRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1209,7 +1209,7 @@ static void GigaRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1254,7 +1254,7 @@ static void GigaRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1286,7 +1286,7 @@ static void GigaRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1315,7 +1315,7 @@ static void GigaRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1347,7 +1347,7 @@ static void GigaRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1390,7 +1390,7 @@ static void GigaRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1453,7 +1453,7 @@ static void GigaRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1505,7 +1505,7 @@ static void GigaRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1557,7 +1557,7 @@ static void GigaRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1609,7 +1609,7 @@ static void GigaRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1680,7 +1680,7 @@ static void GigaRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1730,7 +1730,7 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1760,7 +1760,7 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1788,7 +1788,7 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1818,7 +1818,7 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1858,7 +1858,7 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1902,7 +1902,7 @@ static void GigaRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1932,7 +1932,7 @@ static void GigaRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1960,7 +1960,7 @@ static void GigaRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1990,7 +1990,7 @@ static void GigaRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2030,7 +2030,7 @@ static void GigaRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2092,7 +2092,7 @@ static void GigaRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2123,7 +2123,7 @@ static void GigaRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2155,7 +2155,7 @@ static void GigaRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2195,7 +2195,7 @@ static void GigaRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2239,7 +2239,7 @@ static void GigaRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2271,7 +2271,7 @@ static void GigaRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2304,7 +2304,7 @@ static void GigaRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2344,7 +2344,7 @@ static void GigaRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2388,7 +2388,7 @@ static void GigaRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2419,7 +2419,7 @@ static void GigaRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2458,7 +2458,7 @@ static void GigaRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2514,7 +2514,7 @@ static void GigaRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2545,7 +2545,7 @@ static void GigaRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2587,7 +2587,7 @@ static void GigaRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2636,7 +2636,7 @@ static void GigaRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2677,7 +2677,7 @@ static void GigaRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2717,7 +2717,7 @@ static void GigaRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2764,7 +2764,7 @@ static void GigaRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2829,7 +2829,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2861,7 +2861,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2903,7 +2903,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2946,7 +2946,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2978,7 +2978,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3015,7 +3015,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3063,7 +3063,7 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3095,7 +3095,7 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3137,7 +3137,7 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3180,7 +3180,7 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3212,7 +3212,7 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3249,7 +3249,7 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3325,7 +3325,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3358,7 +3358,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3387,7 +3387,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3419,7 +3419,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3462,7 +3462,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3505,7 +3505,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3538,7 +3538,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3567,7 +3567,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3599,7 +3599,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3637,7 +3637,7 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3685,7 +3685,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3718,7 +3718,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3747,7 +3747,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3779,7 +3779,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3828,7 +3828,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3871,7 +3871,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3904,7 +3904,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3933,7 +3933,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3965,7 +3965,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4009,7 +4009,7 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4085,7 +4085,7 @@ static void GigaRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4130,7 +4130,7 @@ static void GigaRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4183,7 +4183,7 @@ static void GigaRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4229,7 +4229,7 @@ static void GigaRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4275,7 +4275,7 @@ static void GigaRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4311,7 +4311,7 @@ static void GigaRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -4406,7 +4406,7 @@ static void GigaRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4473,7 +4473,7 @@ static void GigaRCTrackFlatTo60DegUpLongBase( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4540,7 +4540,7 @@ static void GigaRCTrackFlatTo60DegUpLongBase( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -4616,7 +4616,7 @@ static void GigaRCTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -4663,7 +4663,7 @@ static void GigaRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -4696,7 +4696,7 @@ static void GigaRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 12, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -4729,7 +4729,7 @@ static void GigaRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4771,7 +4771,7 @@ static void GigaRCTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -4838,7 +4838,7 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -4879,7 +4879,7 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 2: @@ -4926,7 +4926,7 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -4967,7 +4967,7 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5011,7 +5011,7 @@ static void GigaRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5040,7 +5040,7 @@ static void GigaRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5069,13 +5069,13 @@ static void GigaRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5112,7 +5112,7 @@ static void GigaRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5157,7 +5157,7 @@ static void GigaRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5186,7 +5186,7 @@ static void GigaRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5215,13 +5215,13 @@ static void GigaRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5258,7 +5258,7 @@ static void GigaRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5321,7 +5321,7 @@ static void GigaRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5350,7 +5350,7 @@ static void GigaRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5379,13 +5379,13 @@ static void GigaRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5422,7 +5422,7 @@ static void GigaRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5467,7 +5467,7 @@ static void GigaRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5496,7 +5496,7 @@ static void GigaRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5525,13 +5525,13 @@ static void GigaRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5568,7 +5568,7 @@ static void GigaRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5624,7 +5624,7 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5651,7 +5651,7 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5678,7 +5678,7 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5737,7 +5737,7 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5774,7 +5774,7 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5801,7 +5801,7 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5828,7 +5828,7 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5887,7 +5887,7 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5910,7 +5910,7 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5923,7 +5923,7 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5936,7 +5936,7 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5963,7 +5963,7 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6000,7 +6000,7 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6027,7 +6027,7 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6054,7 +6054,7 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6113,7 +6113,7 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6136,7 +6136,7 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6149,7 +6149,7 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6162,7 +6162,7 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6189,7 +6189,7 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6212,7 +6212,7 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6225,7 +6225,7 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6238,7 +6238,7 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6265,7 +6265,7 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6302,7 +6302,7 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6329,7 +6329,7 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6356,7 +6356,7 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6415,7 +6415,7 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6452,7 +6452,7 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6479,7 +6479,7 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6506,7 +6506,7 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6565,7 +6565,7 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6588,7 +6588,7 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6601,7 +6601,7 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6614,7 +6614,7 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6641,7 +6641,7 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6678,7 +6678,7 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6704,7 +6704,7 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6730,7 +6730,7 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6788,7 +6788,7 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -6812,7 +6812,7 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6825,7 +6825,7 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6838,7 +6838,7 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6865,7 +6865,7 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6888,7 +6888,7 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6901,7 +6901,7 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6914,7 +6914,7 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6941,7 +6941,7 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6978,7 +6978,7 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7005,7 +7005,7 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7032,7 +7032,7 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7091,7 +7091,7 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7114,7 +7114,7 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7130,7 +7130,7 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7143,7 +7143,7 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7170,7 +7170,7 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7193,7 +7193,7 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7206,7 +7206,7 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7222,7 +7222,7 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7249,7 +7249,7 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7272,7 +7272,7 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7288,7 +7288,7 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7301,7 +7301,7 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7328,7 +7328,7 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7351,7 +7351,7 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7364,7 +7364,7 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7380,7 +7380,7 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7407,7 +7407,7 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7430,7 +7430,7 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7446,7 +7446,7 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7459,7 +7459,7 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7486,7 +7486,7 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7509,7 +7509,7 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7522,7 +7522,7 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7538,7 +7538,7 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7565,7 +7565,7 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7588,7 +7588,7 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7604,7 +7604,7 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7617,7 +7617,7 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7644,7 +7644,7 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7667,7 +7667,7 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7680,7 +7680,7 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7696,7 +7696,7 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7723,7 +7723,7 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7746,7 +7746,7 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7761,7 +7761,7 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7773,7 +7773,7 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -7799,7 +7799,7 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -7823,7 +7823,7 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7835,7 +7835,7 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7850,7 +7850,7 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -7876,7 +7876,7 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -7900,7 +7900,7 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7916,7 +7916,7 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7929,7 +7929,7 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7956,7 +7956,7 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7979,7 +7979,7 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7992,7 +7992,7 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8008,7 +8008,7 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8035,7 +8035,7 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8058,7 +8058,7 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8071,7 +8071,7 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8084,7 +8084,7 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8111,7 +8111,7 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8134,7 +8134,7 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8147,7 +8147,7 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8160,7 +8160,7 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8187,7 +8187,7 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8213,7 +8213,7 @@ static void GigaRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -8252,7 +8252,7 @@ static void GigaRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8295,7 +8295,7 @@ static void GigaRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8336,7 +8336,7 @@ static void GigaRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8385,7 +8385,7 @@ static void GigaRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8447,7 +8447,7 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8478,7 +8478,7 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8506,7 +8506,7 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8538,7 +8538,7 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8578,7 +8578,7 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8622,7 +8622,7 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8653,7 +8653,7 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8681,7 +8681,7 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8713,7 +8713,7 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8753,7 +8753,7 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8822,7 +8822,7 @@ static void GigaRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8871,7 +8871,7 @@ static void GigaRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8920,7 +8920,7 @@ static void GigaRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8969,7 +8969,7 @@ static void GigaRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9047,7 +9047,7 @@ static void GigaRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9093,7 +9093,7 @@ static void GigaRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9139,7 +9139,7 @@ static void GigaRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9185,7 +9185,7 @@ static void GigaRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9266,7 +9266,7 @@ static void GigaRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9315,7 +9315,7 @@ static void GigaRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9364,7 +9364,7 @@ static void GigaRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9413,7 +9413,7 @@ static void GigaRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9475,7 +9475,7 @@ static void GigaRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9501,7 +9501,7 @@ static void GigaRCTrackPoweredLift( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9537,7 +9537,7 @@ static void GigaRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9593,7 +9593,7 @@ static void GigaRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9645,7 +9645,7 @@ static void GigaRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -9684,7 +9684,7 @@ static void GigaRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -9730,7 +9730,7 @@ static void GigaRCTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -9776,7 +9776,7 @@ static void GigaRCTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -9855,7 +9855,7 @@ static void GigaRCTrackLeftBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9897,7 +9897,7 @@ static void GigaRCTrackLeftBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -9947,7 +9947,7 @@ static void GigaRCTrackLeftBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10011,7 +10011,7 @@ static void GigaRCTrackRightBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -10053,7 +10053,7 @@ static void GigaRCTrackRightBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10103,7 +10103,7 @@ static void GigaRCTrackRightBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10161,7 +10161,7 @@ static void GigaRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10196,7 +10196,7 @@ static void GigaRCTrackHalfLoopUp( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10225,7 +10225,7 @@ static void GigaRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -10258,7 +10258,7 @@ static void GigaRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10315,7 +10315,7 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -10353,7 +10353,7 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -10382,7 +10382,7 @@ static void GigaRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -10411,7 +10411,7 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10447,7 +10447,7 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10476,7 +10476,7 @@ static void GigaRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -10513,7 +10513,7 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -10560,7 +10560,7 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -10868,7 +10868,7 @@ static void GigaRCTrackLeftCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10896,7 +10896,7 @@ static void GigaRCTrackLeftCorkscrewUp( { 0, 0, height }, { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10925,7 +10925,7 @@ static void GigaRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 40, session.SupportColours); @@ -10987,7 +10987,7 @@ static void GigaRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11015,7 +11015,7 @@ static void GigaRCTrackRightCorkscrewUp( { 0, 0, height }, { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11044,7 +11044,7 @@ static void GigaRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 40, session.SupportColours); @@ -11115,7 +11115,7 @@ static void GigaRCTrackLeftLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11155,7 +11155,7 @@ static void GigaRCTrackLeftLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11184,7 +11184,7 @@ static void GigaRCTrackLeftLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11193,7 +11193,7 @@ static void GigaRCTrackLeftLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11260,7 +11260,7 @@ static void GigaRCTrackLeftLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11315,7 +11315,7 @@ static void GigaRCTrackRightLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11355,7 +11355,7 @@ static void GigaRCTrackRightLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11384,7 +11384,7 @@ static void GigaRCTrackRightLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11393,7 +11393,7 @@ static void GigaRCTrackRightLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11459,7 +11459,7 @@ static void GigaRCTrackRightLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11528,7 +11528,7 @@ static void GigaRCTrackLeftMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11558,7 +11558,7 @@ static void GigaRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11597,7 +11597,7 @@ static void GigaRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11625,7 +11625,7 @@ static void GigaRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11655,7 +11655,7 @@ static void GigaRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) @@ -11706,7 +11706,7 @@ static void GigaRCTrackRightMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11736,7 +11736,7 @@ static void GigaRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11775,7 +11775,7 @@ static void GigaRCTrackRightMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11804,7 +11804,7 @@ static void GigaRCTrackRightMediumHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11834,7 +11834,7 @@ static void GigaRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { @@ -11909,7 +11909,7 @@ static void GigaRCTrackLeftZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -11938,7 +11938,7 @@ static void GigaRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11983,7 +11983,7 @@ static void GigaRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -12041,7 +12041,7 @@ static void GigaRCTrackRightZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -12070,7 +12070,7 @@ static void GigaRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -12115,7 +12115,7 @@ static void GigaRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -12178,7 +12178,7 @@ static void GigaRCTrackLeftLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12209,7 +12209,7 @@ static void GigaRCTrackLeftLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12241,14 +12241,14 @@ static void GigaRCTrackLeftLargeZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -12342,7 +12342,7 @@ static void GigaRCTrackRightLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12373,7 +12373,7 @@ static void GigaRCTrackRightLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12406,14 +12406,14 @@ static void GigaRCTrackRightLargeZeroGRollUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -12512,7 +12512,7 @@ static void GigaRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12540,7 +12540,7 @@ static void GigaRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12572,7 +12572,7 @@ static void GigaRCTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12625,7 +12625,7 @@ static void GigaRCTrackLeftBankToLeftQuarterTurn3Tile25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12670,7 +12670,7 @@ static void GigaRCTrackLeftBankToLeftQuarterTurn3Tile25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12716,7 +12716,7 @@ static void GigaRCTrackRightBankToRightQuarterTurn3Tile25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12761,7 +12761,7 @@ static void GigaRCTrackRightBankToRightQuarterTurn3Tile25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12804,7 +12804,7 @@ static void GigaRCTrackLeftQuarterTurn3Tile25DegDownToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12852,7 +12852,7 @@ static void GigaRCTrackLeftQuarterTurn3Tile25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12895,7 +12895,7 @@ static void GigaRCTrackRightQuarterTurn3Tile25DegDownToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12943,7 +12943,7 @@ static void GigaRCTrackRightQuarterTurn3Tile25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12986,7 +12986,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13022,7 +13022,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13051,7 +13051,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13093,7 +13093,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13122,7 +13122,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13151,7 +13151,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13185,7 +13185,7 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13229,7 +13229,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13265,7 +13265,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13294,7 +13294,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13336,7 +13336,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13365,7 +13365,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13394,7 +13394,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13428,7 +13428,7 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13492,7 +13492,7 @@ static void GigaRCTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -13539,7 +13539,7 @@ static void GigaRCTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -13573,7 +13573,7 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13586,7 +13586,7 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13599,7 +13599,7 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -13626,7 +13626,7 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13648,7 +13648,7 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13661,7 +13661,7 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13674,7 +13674,7 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -13701,7 +13701,7 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13723,7 +13723,7 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13736,7 +13736,7 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13749,7 +13749,7 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -13776,7 +13776,7 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13798,7 +13798,7 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13811,7 +13811,7 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13824,7 +13824,7 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -13851,7 +13851,7 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13894,7 +13894,7 @@ static void GigaRCTrackLeftEighthToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13923,7 +13923,7 @@ static void GigaRCTrackLeftEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -13952,13 +13952,13 @@ static void GigaRCTrackLeftEighthToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -13995,7 +13995,7 @@ static void GigaRCTrackLeftEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14039,7 +14039,7 @@ static void GigaRCTrackRightEighthToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14068,7 +14068,7 @@ static void GigaRCTrackRightEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14097,13 +14097,13 @@ static void GigaRCTrackRightEighthToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14140,7 +14140,7 @@ static void GigaRCTrackRightEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14187,7 +14187,7 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14216,13 +14216,13 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14251,7 +14251,7 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14288,7 +14288,7 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14334,7 +14334,7 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14363,13 +14363,13 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14398,7 +14398,7 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14433,7 +14433,7 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14489,7 +14489,7 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14505,7 +14505,7 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14518,7 +14518,7 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14545,7 +14545,7 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14567,7 +14567,7 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14580,7 +14580,7 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14596,7 +14596,7 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14623,7 +14623,7 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14645,7 +14645,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -14661,7 +14661,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -14674,7 +14674,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -14701,7 +14701,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -14723,7 +14723,7 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -14736,7 +14736,7 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -14752,7 +14752,7 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -14779,7 +14779,7 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -14829,7 +14829,7 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14842,7 +14842,7 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14855,7 +14855,7 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14882,7 +14882,7 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14904,7 +14904,7 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14917,7 +14917,7 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14930,7 +14930,7 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14957,7 +14957,7 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14979,7 +14979,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -14992,7 +14992,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15005,7 +15005,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15032,7 +15032,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15054,7 +15054,7 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15067,7 +15067,7 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15080,7 +15080,7 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15107,7 +15107,7 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15159,7 +15159,7 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15172,7 +15172,7 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15185,7 +15185,7 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15212,7 +15212,7 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15234,7 +15234,7 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15247,7 +15247,7 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15260,7 +15260,7 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15287,7 +15287,7 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15323,7 +15323,7 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15339,7 +15339,7 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15352,7 +15352,7 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15379,7 +15379,7 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15401,7 +15401,7 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15414,7 +15414,7 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15430,7 +15430,7 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15457,7 +15457,7 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15479,7 +15479,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15495,7 +15495,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15508,7 +15508,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15535,7 +15535,7 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15557,7 +15557,7 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15570,7 +15570,7 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15586,7 +15586,7 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15613,7 +15613,7 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15690,7 +15690,7 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15719,7 +15719,7 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15748,13 +15748,13 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -15791,7 +15791,7 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15841,7 +15841,7 @@ static void GigaRCTrackRightEighthBankToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15870,7 +15870,7 @@ static void GigaRCTrackRightEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15899,13 +15899,13 @@ static void GigaRCTrackRightEighthBankToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -15942,7 +15942,7 @@ static void GigaRCTrackRightEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15989,7 +15989,7 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16018,13 +16018,13 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16053,7 +16053,7 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16094,7 +16094,7 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16140,7 +16140,7 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16169,13 +16169,13 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16204,7 +16204,7 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16245,7 +16245,7 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16311,7 +16311,7 @@ static void GigaRCTrackDiagBrakes( session, MetalSupportType::Tubes, DiagSupportPlacement[direction], 0, height, session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp index bc53bf6ea7..1bbb7d7196 100644 --- a/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp +++ b/src/openrct2/ride/coaster/HeartlineTwisterCoaster.cpp @@ -90,7 +90,7 @@ static void HeartlineTwisterRCTrackFlat( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -114,7 +114,7 @@ static void HeartlineTwisterRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -212,7 +212,7 @@ static void HeartlineTwisterRCTrack25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -310,7 +310,7 @@ static void HeartlineTwisterRCTrack60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -408,7 +408,7 @@ static void HeartlineTwisterRCTrackFlatTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -506,7 +506,7 @@ static void HeartlineTwisterRCTrack25DegUpTo60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -604,7 +604,7 @@ static void HeartlineTwisterRCTrack60DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -702,7 +702,7 @@ static void HeartlineTwisterRCTrack25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -810,7 +810,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -878,7 +878,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferUp( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::Up25DegToFlat); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -921,7 +921,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -968,7 +968,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferUp( { PaintUtilPushTunnelRotated(session, direction, height - 16, TUNNEL_0); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1025,7 +1025,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferDown( { PaintUtilPushTunnelRotated(session, direction, height - 16, TUNNEL_0); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1093,7 +1093,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferDown( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::Up25DegToFlat); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1136,7 +1136,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferDown( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1188,7 +1188,7 @@ static void HeartlineTwisterRCTrackHeartlineTransferDown( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1429,7 +1429,7 @@ static void HeartlineTwisterRCTrackLeftHeartlineRoll( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1668,7 +1668,7 @@ static void HeartlineTwisterRCTrackRightHeartlineRoll( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 17f7e13242..31e3d3c221 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -53,7 +53,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -87,7 +87,7 @@ namespace HybridRC TrackPaintUtilDrawNarrowStationPlatform(session, ride, direction, height, 10, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -118,7 +118,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -175,7 +175,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -206,7 +206,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -289,7 +289,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -373,7 +373,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -404,7 +404,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -480,7 +480,7 @@ namespace HybridRC { { boundBoxOffsets[direction].x, boundBoxOffsets[direction].y, boundBoxOffsets[direction].z }, { boundBoxLengths[direction].x, boundBoxLengths[direction].y, boundBoxLengths[direction].z } }); PaintUtilSetVerticalTunnel(session, height + 32); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -532,7 +532,7 @@ namespace HybridRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetVerticalTunnel(session, height + 56); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -583,7 +583,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 48, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -621,7 +621,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -671,7 +671,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -710,7 +710,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -754,7 +754,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -810,12 +810,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -853,7 +853,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -892,14 +892,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -937,7 +937,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -982,7 +982,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1038,7 +1038,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1073,7 +1073,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1108,7 +1108,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1131,7 +1131,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1158,7 +1158,7 @@ namespace HybridRC { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1206,7 +1206,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1241,7 +1241,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1276,7 +1276,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1299,7 +1299,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1326,7 +1326,7 @@ namespace HybridRC { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1379,7 +1379,7 @@ namespace HybridRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1428,7 +1428,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1474,7 +1474,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1501,7 +1501,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1523,7 +1523,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1554,7 +1554,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1585,7 +1585,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1597,7 +1597,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1619,7 +1619,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1650,7 +1650,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1681,7 +1681,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1693,7 +1693,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1729,7 +1729,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1759,7 +1759,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1789,7 +1789,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1816,7 +1816,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1852,7 +1852,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1882,7 +1882,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1912,7 +1912,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1939,7 +1939,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1975,7 +1975,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2005,7 +2005,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2035,7 +2035,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2062,7 +2062,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2098,7 +2098,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2128,7 +2128,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2158,7 +2158,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2185,7 +2185,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2221,7 +2221,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2250,7 +2250,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2279,7 +2279,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2305,7 +2305,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; } @@ -2342,7 +2342,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2372,7 +2372,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2402,7 +2402,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2429,7 +2429,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2465,7 +2465,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -2495,7 +2495,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -2525,7 +2525,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -2552,7 +2552,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -2588,7 +2588,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2618,7 +2618,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2648,7 +2648,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -2675,7 +2675,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2711,7 +2711,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2741,7 +2741,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2771,7 +2771,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -2798,7 +2798,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2834,7 +2834,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -2864,7 +2864,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -2894,7 +2894,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -2921,7 +2921,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -2957,7 +2957,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2987,7 +2987,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3017,7 +3017,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3044,7 +3044,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3080,7 +3080,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3110,7 +3110,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3140,7 +3140,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3167,7 +3167,7 @@ namespace HybridRC break; } } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3209,7 +3209,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3249,7 +3249,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3311,7 +3311,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3359,7 +3359,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3407,7 +3407,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -3455,7 +3455,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -3523,7 +3523,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3550,7 +3550,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3570,7 +3570,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3586,7 +3586,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3599,7 +3599,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3621,7 +3621,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3637,7 +3637,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3657,7 +3657,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3670,7 +3670,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3692,7 +3692,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3712,7 +3712,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3728,7 +3728,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3741,7 +3741,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3763,7 +3763,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3779,7 +3779,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3799,7 +3799,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3812,7 +3812,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3834,7 +3834,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3854,7 +3854,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3870,7 +3870,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3883,7 +3883,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3905,7 +3905,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3921,7 +3921,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3941,7 +3941,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3954,7 +3954,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3976,7 +3976,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3996,7 +3996,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4012,7 +4012,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4025,7 +4025,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4047,7 +4047,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4063,7 +4063,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4083,7 +4083,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4096,7 +4096,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4118,7 +4118,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4137,7 +4137,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4152,7 +4152,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4164,7 +4164,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; } @@ -4187,7 +4187,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4202,7 +4202,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4221,7 +4221,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4233,7 +4233,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; } @@ -4256,7 +4256,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4276,7 +4276,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4292,7 +4292,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4305,7 +4305,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4327,7 +4327,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4343,7 +4343,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4363,7 +4363,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4376,7 +4376,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4398,7 +4398,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4418,7 +4418,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4434,7 +4434,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4447,7 +4447,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4469,7 +4469,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4485,7 +4485,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4505,7 +4505,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4518,7 +4518,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4572,7 +4572,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4611,7 +4611,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4661,7 +4661,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4723,12 +4723,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4766,7 +4766,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4808,14 +4808,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, (direction + 1) & 3), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -4853,7 +4853,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, (direction + 1) & 3), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4904,7 +4904,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4966,7 +4966,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5004,7 +5004,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5039,7 +5039,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5062,7 +5062,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5092,7 +5092,7 @@ namespace HybridRC { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5146,7 +5146,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5184,7 +5184,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5219,7 +5219,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5242,7 +5242,7 @@ namespace HybridRC session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5275,7 +5275,7 @@ namespace HybridRC { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5343,7 +5343,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5370,7 +5370,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5418,7 +5418,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5470,7 +5470,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5497,7 +5497,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5545,7 +5545,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5613,12 +5613,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5656,7 +5656,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -5695,14 +5695,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -5740,7 +5740,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -5789,7 +5789,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5841,12 +5841,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5884,7 +5884,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -5923,14 +5923,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -5968,7 +5968,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6017,7 +6017,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6087,7 +6087,7 @@ namespace HybridRC break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -6139,7 +6139,7 @@ namespace HybridRC break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -6194,7 +6194,7 @@ namespace HybridRC break; } PaintUtilSetVerticalTunnel(session, height + 96); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -6239,7 +6239,7 @@ namespace HybridRC break; } PaintUtilSetVerticalTunnel(session, height + 96); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -6302,7 +6302,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6347,7 +6347,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6392,7 +6392,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6437,7 +6437,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6513,7 +6513,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -6561,7 +6561,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -6609,7 +6609,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -6657,7 +6657,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -6727,7 +6727,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6769,7 +6769,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6828,7 +6828,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -6873,7 +6873,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -6918,7 +6918,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -6963,7 +6963,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7049,7 +7049,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7076,7 +7076,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7136,7 +7136,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7196,7 +7196,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7223,7 +7223,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7283,7 +7283,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7359,12 +7359,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7410,7 +7410,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7457,14 +7457,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -7510,7 +7510,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7571,7 +7571,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7631,12 +7631,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7682,7 +7682,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7729,14 +7729,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -7782,7 +7782,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7843,7 +7843,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7907,7 +7907,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7945,7 +7945,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7984,7 +7984,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8029,7 +8029,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8077,7 +8077,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8115,7 +8115,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8154,7 +8154,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8199,7 +8199,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8253,7 +8253,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8311,7 +8311,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8361,7 +8361,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8411,7 +8411,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -8469,7 +8469,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8514,7 +8514,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8568,7 +8568,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8626,7 +8626,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8676,7 +8676,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8726,7 +8726,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -8784,7 +8784,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8829,7 +8829,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8909,12 +8909,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8952,7 +8952,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8994,14 +8994,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, + kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -9039,7 +9039,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9090,7 +9090,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -9140,12 +9140,12 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -9183,7 +9183,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9225,14 +9225,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -9270,7 +9270,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9316,7 +9316,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9370,12 +9370,12 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9413,7 +9413,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9455,14 +9455,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -9500,7 +9500,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9551,7 +9551,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -9601,12 +9601,12 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -9644,7 +9644,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9686,14 +9686,14 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, + kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -9731,7 +9731,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9777,7 +9777,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9857,7 +9857,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9898,7 +9898,7 @@ namespace HybridRC } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9948,7 +9948,7 @@ namespace HybridRC } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10002,7 +10002,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10043,7 +10043,7 @@ namespace HybridRC } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10093,7 +10093,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10157,7 +10157,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -10193,7 +10193,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); @@ -10249,7 +10249,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10299,7 +10299,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -10337,7 +10337,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10391,7 +10391,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10455,7 +10455,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -10494,7 +10494,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10538,7 +10538,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); @@ -10594,7 +10594,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10644,7 +10644,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -10683,7 +10683,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10728,7 +10728,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -10782,7 +10782,7 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10845,7 +10845,7 @@ namespace HybridRC { 0, 0, height }, { { 0, 32, height + 8 }, { 32, 1, 48 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -10886,7 +10886,7 @@ namespace HybridRC } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -10931,7 +10931,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10954,7 +10954,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -10971,7 +10971,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -11012,7 +11012,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11042,7 +11042,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::FlatToUp60DegLongBaseSeq1); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11072,7 +11072,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::FlatToUp60DegLongBaseSeq2); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -11111,7 +11111,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 24, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -11154,7 +11154,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -11184,7 +11184,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::Up60DegToFlatLongBaseSeq1); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -11214,7 +11214,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::Up60DegToFlatLongBaseSeq2); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11253,7 +11253,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -11283,7 +11283,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -11297,7 +11297,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -11319,7 +11319,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -11368,7 +11368,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -11395,7 +11395,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11439,7 +11439,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -11494,7 +11494,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -11521,7 +11521,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11569,7 +11569,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -11621,7 +11621,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -11648,7 +11648,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11699,7 +11699,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -11747,7 +11747,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -11774,7 +11774,7 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11821,7 +11821,7 @@ namespace HybridRC PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -11865,7 +11865,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11896,7 +11896,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11928,14 +11928,14 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -11964,7 +11964,7 @@ namespace HybridRC { { 16, 0, height }, { 20, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -12011,7 +12011,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -12045,7 +12045,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12079,14 +12079,14 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -12117,7 +12117,7 @@ namespace HybridRC { { 16, 16, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -12157,7 +12157,7 @@ namespace HybridRC { { 0, 0, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -12191,14 +12191,14 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: WoodenASupportsPaintSetup( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -12232,7 +12232,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -12272,7 +12272,7 @@ namespace HybridRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -12312,7 +12312,7 @@ namespace HybridRC { { 0, 0, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -12345,14 +12345,14 @@ namespace HybridRC } WoodenASupportsPaintSetup( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -12386,7 +12386,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -12424,7 +12424,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -12480,7 +12480,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -12500,7 +12500,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12516,7 +12516,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -12535,7 +12535,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -12557,7 +12557,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -12573,7 +12573,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12593,7 +12593,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -12612,7 +12612,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -12634,7 +12634,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12654,7 +12654,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -12670,7 +12670,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -12689,7 +12689,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -12711,7 +12711,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12727,7 +12727,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -12747,7 +12747,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -12766,7 +12766,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -12816,7 +12816,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12836,7 +12836,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12852,7 +12852,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12871,7 +12871,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12893,7 +12893,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12909,7 +12909,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12929,7 +12929,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12948,7 +12948,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12970,7 +12970,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12990,7 +12990,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13006,7 +13006,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13025,7 +13025,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13047,7 +13047,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13063,7 +13063,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13083,7 +13083,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13102,7 +13102,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13152,7 +13152,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13172,7 +13172,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13188,7 +13188,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13207,7 +13207,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13229,7 +13229,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13245,7 +13245,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13265,7 +13265,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13284,7 +13284,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13320,7 +13320,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13340,7 +13340,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13356,7 +13356,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13375,7 +13375,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13397,7 +13397,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13413,7 +13413,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13433,7 +13433,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13452,7 +13452,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13474,7 +13474,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13494,7 +13494,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13510,7 +13510,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13529,7 +13529,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13551,7 +13551,7 @@ namespace HybridRC { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13567,7 +13567,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13587,7 +13587,7 @@ namespace HybridRC WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13606,7 +13606,7 @@ namespace HybridRC case 3: break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13681,7 +13681,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13715,7 +13715,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13749,14 +13749,14 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -13787,7 +13787,7 @@ namespace HybridRC { 0, 0, height }, { { 16, 0, height }, { 20, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13834,7 +13834,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13868,7 +13868,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13902,14 +13902,14 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -13940,7 +13940,7 @@ namespace HybridRC { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13984,7 +13984,7 @@ namespace HybridRC { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14022,13 +14022,13 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: WoodenASupportsPaintSetup( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14066,7 +14066,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14108,7 +14108,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14152,7 +14152,7 @@ namespace HybridRC { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14189,14 +14189,14 @@ namespace HybridRC } WoodenASupportsPaintSetup( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14234,7 +14234,7 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14276,7 +14276,7 @@ namespace HybridRC { PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } diff --git a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 97fb97ef8c..5e29b93588 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -69,7 +69,7 @@ static void InvertedHairpinRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -104,7 +104,7 @@ static void InvertedHairpinRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::TubesInverted); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -167,7 +167,7 @@ static void InvertedHairpinRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -272,7 +272,7 @@ static void InvertedHairpinRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -335,7 +335,7 @@ static void InvertedHairpinRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -452,7 +452,7 @@ static void InvertedHairpinRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -527,7 +527,7 @@ static void InvertedHairpinRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -625,7 +625,7 @@ static void InvertedHairpinRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -745,7 +745,7 @@ static void InvertedHairpinRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); @@ -784,7 +784,7 @@ static void InvertedHairpinRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -813,7 +813,7 @@ static void InvertedHairpinRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); @@ -870,7 +870,7 @@ static void InvertedHairpinRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -909,7 +909,7 @@ static void InvertedHairpinRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -957,7 +957,7 @@ static void InvertedHairpinRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -996,7 +996,7 @@ static void InvertedHairpinRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -1063,7 +1063,7 @@ static void InvertedHairpinRCTrackLeftQuarterTurn1( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); @@ -1169,7 +1169,7 @@ static void InvertedHairpinRCTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -1244,7 +1244,7 @@ static void InvertedHairpinRCTrack60DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1318,7 +1318,7 @@ static void InvertedHairpinRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1351,7 +1351,7 @@ static void InvertedHairpinRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index df30b6c977..4eb1307ffa 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -40,7 +40,7 @@ static void InvertedImpulseRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -75,7 +75,7 @@ static void InvertedImpulseRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::TubesInverted); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -109,7 +109,7 @@ static void InvertedImpulseRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -185,7 +185,7 @@ static void InvertedImpulseRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -219,7 +219,7 @@ static void InvertedImpulseRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -298,7 +298,7 @@ static void InvertedImpulseRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -345,7 +345,7 @@ static void InvertedImpulseRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -379,7 +379,7 @@ static void InvertedImpulseRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -496,7 +496,7 @@ static void InvertedImpulseRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -549,7 +549,7 @@ static void InvertedImpulseRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -603,7 +603,7 @@ static void InvertedImpulseRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } @@ -643,7 +643,7 @@ static void InvertedImpulseRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -693,7 +693,7 @@ static void InvertedImpulseRCTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -743,7 +743,7 @@ static void InvertedImpulseRCTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: diff --git a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp index 645b6e84e2..f426e4360f 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -68,7 +68,7 @@ static void InvertedRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -103,7 +103,7 @@ static void InvertedRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -166,7 +166,7 @@ static void InvertedRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -240,7 +240,7 @@ static void InvertedRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -303,7 +303,7 @@ static void InvertedRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -383,7 +383,7 @@ static void InvertedRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -423,7 +423,7 @@ static void InvertedRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -519,7 +519,7 @@ static void InvertedRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -637,7 +637,7 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -675,7 +675,7 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -703,7 +703,7 @@ static void InvertedRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -733,7 +733,7 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -763,7 +763,7 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -822,7 +822,7 @@ static void InvertedRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -865,7 +865,7 @@ static void InvertedRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -908,7 +908,7 @@ static void InvertedRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -951,7 +951,7 @@ static void InvertedRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -996,7 +996,7 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1034,7 +1034,7 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1062,7 +1062,7 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1092,7 +1092,7 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1122,7 +1122,7 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1181,7 +1181,7 @@ static void InvertedRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1250,7 +1250,7 @@ static void InvertedRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1319,7 +1319,7 @@ static void InvertedRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1388,7 +1388,7 @@ static void InvertedRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1489,7 +1489,7 @@ static void InvertedRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1538,7 +1538,7 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1574,7 +1574,7 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1599,7 +1599,7 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1627,7 +1627,7 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1653,7 +1653,7 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1701,7 +1701,7 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1737,7 +1737,7 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1762,7 +1762,7 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1790,7 +1790,7 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1816,7 +1816,7 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1886,7 +1886,7 @@ static void InvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1921,7 +1921,7 @@ static void InvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -1964,7 +1964,7 @@ static void InvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2008,7 +2008,7 @@ static void InvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2059,7 +2059,7 @@ static void InvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2094,7 +2094,7 @@ static void InvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2137,7 +2137,7 @@ static void InvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -2181,7 +2181,7 @@ static void InvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2234,7 +2234,7 @@ static void InvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2291,7 +2291,7 @@ static void InvertedRCTrackLeftVerticalLoop( { { 29, 20, height + 29 }, { 2, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -2319,7 +2319,7 @@ static void InvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2348,7 +2348,7 @@ static void InvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2384,7 +2384,7 @@ static void InvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2413,7 +2413,7 @@ static void InvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2440,7 +2440,7 @@ static void InvertedRCTrackLeftVerticalLoop( { { 0, 29, height + 29 }, { 32, 2, 63 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: @@ -2471,7 +2471,7 @@ static void InvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2547,7 +2547,7 @@ static void InvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2604,7 +2604,7 @@ static void InvertedRCTrackRightVerticalLoop( { { 0, 29, height + 29 }, { 32, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -2632,7 +2632,7 @@ static void InvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2661,7 +2661,7 @@ static void InvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2697,7 +2697,7 @@ static void InvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2726,7 +2726,7 @@ static void InvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2753,7 +2753,7 @@ static void InvertedRCTrackRightVerticalLoop( { { 0, 0, height + 29 }, { 32, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 9: @@ -2784,7 +2784,7 @@ static void InvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) @@ -2858,7 +2858,7 @@ static void InvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2896,7 +2896,7 @@ static void InvertedRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2925,7 +2925,7 @@ static void InvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2986,7 +2986,7 @@ static void InvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3025,7 +3025,7 @@ static void InvertedRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3054,7 +3054,7 @@ static void InvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3111,7 +3111,7 @@ static void InvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3150,7 +3150,7 @@ static void InvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3198,7 +3198,7 @@ static void InvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3237,7 +3237,7 @@ static void InvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3304,7 +3304,7 @@ static void InvertedRCTrackLeftTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3337,7 +3337,7 @@ static void InvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3374,7 +3374,7 @@ static void InvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3411,7 +3411,7 @@ static void InvertedRCTrackRightTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3444,7 +3444,7 @@ static void InvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3481,7 +3481,7 @@ static void InvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3523,7 +3523,7 @@ static void InvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3549,7 +3549,7 @@ static void InvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3576,7 +3576,7 @@ static void InvertedRCTrackLeftTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3630,7 +3630,7 @@ static void InvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3656,7 +3656,7 @@ static void InvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3683,7 +3683,7 @@ static void InvertedRCTrackRightTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3735,7 +3735,7 @@ static void InvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3790,7 +3790,7 @@ static void InvertedRCTrackHalfLoopUp( { { 29, 20, height + 29 }, { 2, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3819,7 +3819,7 @@ static void InvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3852,7 +3852,7 @@ static void InvertedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -3901,7 +3901,7 @@ static void InvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 50, session.SupportColours); @@ -3936,7 +3936,7 @@ static void InvertedRCTrackLeftCorkscrewUp( { { 6, 6, height + 24 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3977,7 +3977,7 @@ static void InvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4019,7 +4019,7 @@ static void InvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 50, session.SupportColours); @@ -4054,7 +4054,7 @@ static void InvertedRCTrackRightCorkscrewUp( { { 6, 6, height + 24 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4095,7 +4095,7 @@ static void InvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4159,7 +4159,7 @@ static void InvertedRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4204,7 +4204,7 @@ static void InvertedRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_INVERTED_4, +56, TUNNEL_INVERTED_5); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4246,7 +4246,7 @@ static void InvertedRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -4290,7 +4290,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -4330,7 +4330,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4359,7 +4359,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4391,7 +4391,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4421,7 +4421,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4473,7 +4473,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -4513,7 +4513,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4542,7 +4542,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4574,7 +4574,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4604,7 +4604,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4656,7 +4656,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4696,7 +4696,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4725,7 +4725,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4757,7 +4757,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4787,7 +4787,7 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -4839,7 +4839,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4879,7 +4879,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4908,7 +4908,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4940,7 +4940,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4970,7 +4970,7 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -5019,7 +5019,7 @@ static void InvertedRCTrack25DegUpLeftBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -5086,7 +5086,7 @@ static void InvertedRCTrack25DegUpRightBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -5155,7 +5155,7 @@ static void InvertedRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_INVERTED_3); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -5208,7 +5208,7 @@ static void InvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5244,7 +5244,7 @@ static void InvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5273,13 +5273,13 @@ static void InvertedRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5309,7 +5309,7 @@ static void InvertedRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5372,7 +5372,7 @@ static void InvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5408,7 +5408,7 @@ static void InvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5437,13 +5437,13 @@ static void InvertedRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5473,7 +5473,7 @@ static void InvertedRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5554,7 +5554,7 @@ static void InvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5590,7 +5590,7 @@ static void InvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5619,13 +5619,13 @@ static void InvertedRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5656,7 +5656,7 @@ static void InvertedRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5719,7 +5719,7 @@ static void InvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5755,7 +5755,7 @@ static void InvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5784,13 +5784,13 @@ static void InvertedRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5821,7 +5821,7 @@ static void InvertedRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5900,7 +5900,7 @@ static void InvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5927,7 +5927,7 @@ static void InvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5954,7 +5954,7 @@ static void InvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5982,7 +5982,7 @@ static void InvertedRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6061,7 +6061,7 @@ static void InvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6088,7 +6088,7 @@ static void InvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6115,7 +6115,7 @@ static void InvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6143,7 +6143,7 @@ static void InvertedRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6189,7 +6189,7 @@ static void InvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -6202,7 +6202,7 @@ static void InvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -6215,7 +6215,7 @@ static void InvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -6229,7 +6229,7 @@ static void InvertedRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6290,7 +6290,7 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6317,7 +6317,7 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -6344,7 +6344,7 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -6372,7 +6372,7 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6418,7 +6418,7 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6431,7 +6431,7 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6444,7 +6444,7 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6458,7 +6458,7 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6505,7 +6505,7 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6518,7 +6518,7 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6531,7 +6531,7 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6545,7 +6545,7 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6606,7 +6606,7 @@ static void InvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6633,7 +6633,7 @@ static void InvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6660,7 +6660,7 @@ static void InvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6688,7 +6688,7 @@ static void InvertedRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6748,7 +6748,7 @@ static void InvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6775,7 +6775,7 @@ static void InvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6802,7 +6802,7 @@ static void InvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6830,7 +6830,7 @@ static void InvertedRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6876,7 +6876,7 @@ static void InvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -6889,7 +6889,7 @@ static void InvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -6902,7 +6902,7 @@ static void InvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -6916,7 +6916,7 @@ static void InvertedRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6977,7 +6977,7 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7003,7 +7003,7 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7029,7 +7029,7 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7056,7 +7056,7 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7102,7 +7102,7 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7115,7 +7115,7 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7128,7 +7128,7 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7142,7 +7142,7 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7189,7 +7189,7 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7202,7 +7202,7 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7215,7 +7215,7 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7229,7 +7229,7 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7289,7 +7289,7 @@ static void InvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7316,7 +7316,7 @@ static void InvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7343,7 +7343,7 @@ static void InvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7371,7 +7371,7 @@ static void InvertedRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7417,7 +7417,7 @@ static void InvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7430,7 +7430,7 @@ static void InvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7443,7 +7443,7 @@ static void InvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7457,7 +7457,7 @@ static void InvertedRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7504,7 +7504,7 @@ static void InvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7517,7 +7517,7 @@ static void InvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7530,7 +7530,7 @@ static void InvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7544,7 +7544,7 @@ static void InvertedRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7591,7 +7591,7 @@ static void InvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7604,7 +7604,7 @@ static void InvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7617,7 +7617,7 @@ static void InvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7631,7 +7631,7 @@ static void InvertedRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7678,7 +7678,7 @@ static void InvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7691,7 +7691,7 @@ static void InvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7704,7 +7704,7 @@ static void InvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7718,7 +7718,7 @@ static void InvertedRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7765,7 +7765,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7778,7 +7778,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7791,7 +7791,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7805,7 +7805,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7851,7 +7851,7 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7864,7 +7864,7 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7877,7 +7877,7 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7891,7 +7891,7 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7937,7 +7937,7 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7950,7 +7950,7 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7963,7 +7963,7 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7977,7 +7977,7 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8023,7 +8023,7 @@ static void InvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8036,7 +8036,7 @@ static void InvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8049,7 +8049,7 @@ static void InvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8063,7 +8063,7 @@ static void InvertedRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8109,7 +8109,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8121,7 +8121,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8133,7 +8133,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8146,7 +8146,7 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8192,7 +8192,7 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8204,7 +8204,7 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8216,7 +8216,7 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8229,7 +8229,7 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8275,7 +8275,7 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8288,7 +8288,7 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8301,7 +8301,7 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8315,7 +8315,7 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8361,7 +8361,7 @@ static void InvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8374,7 +8374,7 @@ static void InvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8387,7 +8387,7 @@ static void InvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8401,7 +8401,7 @@ static void InvertedRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8447,7 +8447,7 @@ static void InvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8460,7 +8460,7 @@ static void InvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8473,7 +8473,7 @@ static void InvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8487,7 +8487,7 @@ static void InvertedRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -8534,7 +8534,7 @@ static void InvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8547,7 +8547,7 @@ static void InvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8560,7 +8560,7 @@ static void InvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8574,7 +8574,7 @@ static void InvertedRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -8640,7 +8640,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8668,7 +8668,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8697,7 +8697,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -8727,7 +8727,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -8756,7 +8756,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -8785,7 +8785,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -8827,7 +8827,7 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -8870,7 +8870,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8898,7 +8898,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8927,7 +8927,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -8957,7 +8957,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -8986,7 +8986,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -9015,7 +9015,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -9057,7 +9057,7 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -9102,7 +9102,7 @@ static void InvertedRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -9142,7 +9142,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9181,7 +9181,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9229,7 +9229,7 @@ static void InvertedRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9268,7 +9268,7 @@ static void InvertedRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9334,7 +9334,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9370,7 +9370,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9395,7 +9395,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -9423,7 +9423,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9449,7 +9449,7 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9497,7 +9497,7 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9533,7 +9533,7 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9558,7 +9558,7 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -9586,7 +9586,7 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9612,7 +9612,7 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9679,7 +9679,7 @@ static void InvertedRCTrack25DegUpToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9746,7 +9746,7 @@ static void InvertedRCTrack25DegUpToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9813,7 +9813,7 @@ static void InvertedRCTrackLeftBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9880,7 +9880,7 @@ static void InvertedRCTrackRightBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9979,7 +9979,7 @@ static void InvertedRCTrackLeftBankedFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10046,7 +10046,7 @@ static void InvertedRCTrackRightBankedFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10113,7 +10113,7 @@ static void InvertedRCTrackLeftBanked25DegUpToLeftBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10180,7 +10180,7 @@ static void InvertedRCTrackRightBanked25DegUpToRightBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10279,7 +10279,7 @@ static void InvertedRCTrackFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10346,7 +10346,7 @@ static void InvertedRCTrackFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10413,7 +10413,7 @@ static void InvertedRCTrackLeftBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10480,7 +10480,7 @@ static void InvertedRCTrackRightBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10561,7 +10561,7 @@ static void InvertedRCTrackBooster( { { 0, 6, height + 29 }, { 32, 20, 1 } }); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index e41536f1fd..a198a4aaf0 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -1867,7 +1867,7 @@ static void JuniorRCPaintTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1927,7 +1927,7 @@ static void JuniorRCPaintStation( TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1951,7 +1951,7 @@ static void JuniorRCPaintTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -1981,7 +1981,7 @@ static void JuniorRCPaintTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2023,7 +2023,7 @@ static void JuniorRCPaintTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2082,27 +2082,27 @@ static void JuniorRCRightQuarterTurn5TilesPaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -2166,7 +2166,7 @@ static void JuniorRCFlatToLeftBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2214,7 +2214,7 @@ static void JuniorRCFlatToRightBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2359,27 +2359,27 @@ static void JuniorRCBankedRightQuarterTurn5TilesPaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -2451,7 +2451,7 @@ static void JuniorRCLeftBankTo25DegUpPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2511,7 +2511,7 @@ static void JuniorRCRightBankTo25DegUpPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2572,7 +2572,7 @@ static void JuniorRC25DegUpToLeftBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2633,7 +2633,7 @@ static void JuniorRC25DegUpToRightBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2721,7 +2721,7 @@ static void JuniorRCLeftBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2781,27 +2781,27 @@ static void JuniorRCPaintTrackLeftQuarterTurn5Tiles25DegUp( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopCorner | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentRightCorner | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_C0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomCorner, direction), 0xFFFF, 0); break; } if (trackSequence == 3) @@ -2860,27 +2860,27 @@ static void JuniorRCPaintTrackRightQuarterTurn5Tiles25DegUp( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } if (trackSequence == 3) @@ -3000,16 +3000,16 @@ static void JuniorRCSBendLeftPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, (direction & 1)), 0xFFFF, 0); @@ -3104,16 +3104,16 @@ static void JuniorRCSBendRightPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, (direction & 1)), 0xFFFF, 0); @@ -3149,13 +3149,13 @@ static void JuniorRCRightQuarterTurn3TilesPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3265,13 +3265,13 @@ static void JuniorRCRightQuarterTurn3TilesBankPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3348,10 +3348,10 @@ static void JuniorRCPaintTrackRightQuarterTurn3Tiles25DegUp( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3431,10 +3431,10 @@ static void JuniorRCPaintTrackRightQuarterTurn3Tiles25DegDown( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3534,13 +3534,13 @@ static void JuniorRCRightHalfBankedHelixUpSmallPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3602,13 +3602,13 @@ static void JuniorRCRightHalfBankedHelixDownSmallPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3700,28 +3700,28 @@ static void JuniorRCRightHalfBankedHelixUpLargePaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -3784,28 +3784,28 @@ static void JuniorRCRightHalfBankedHelixDownLargePaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -3873,7 +3873,7 @@ static void JuniorRCBrakePaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3909,7 +3909,7 @@ static void JuniorRCBlockBrakePaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3959,19 +3959,19 @@ static void JuniorRCLeftEighthToDiagPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 2: - blockedSegments = SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_C8; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide; break; case 4: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C8 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } @@ -4025,19 +4025,19 @@ static void JuniorRCRightEighthToDiagPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; break; case 4: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomRightSide; break; } @@ -4192,19 +4192,19 @@ static void JuniorRCLeftEighthToDiagBankPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 2: - blockedSegments = SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_C8; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide; break; case 4: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C8 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } @@ -4339,19 +4339,19 @@ static void JuniorRCRightEighthToDiagBankPaintSetup( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; break; case 4: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomRightSide; break; } @@ -5119,7 +5119,7 @@ static void JuniorRCPaintTrack60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -5202,7 +5202,7 @@ static void JuniorRCPaintTrack25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5263,7 +5263,7 @@ static void JuniorRCPaintTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5520,7 +5520,7 @@ static void JuniorRCFlatTo60DegUpPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5579,7 +5579,7 @@ static void JuniorRC60DegUpToFlatPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5643,7 +5643,7 @@ static void JuniorRCBoosterPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_D0 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -5661,7 +5661,7 @@ static void JuniorRCTrackOnRidePhoto( TrackPaintUtilOnridePhotoPaint(session, direction, height + 3 + photoCameraOffset, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48 + photoCameraOffset, 0x20); } diff --git a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp index d675137923..a669ca7bbd 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -114,7 +114,7 @@ static void LayDownRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -152,7 +152,7 @@ static void LayDownRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::TubesInverted); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -230,7 +230,7 @@ static void LayDownRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -315,7 +315,7 @@ static void LayDownRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -387,7 +387,7 @@ static void LayDownRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -478,7 +478,7 @@ static void LayDownRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } @@ -527,7 +527,7 @@ static void LayDownRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -634,7 +634,7 @@ static void LayDownRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -763,7 +763,7 @@ static void LayDownRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -805,7 +805,7 @@ static void LayDownRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -834,7 +834,7 @@ static void LayDownRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -867,7 +867,7 @@ static void LayDownRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -897,7 +897,7 @@ static void LayDownRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -966,7 +966,7 @@ static void LayDownRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1018,7 +1018,7 @@ static void LayDownRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1070,7 +1070,7 @@ static void LayDownRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1122,7 +1122,7 @@ static void LayDownRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1176,7 +1176,7 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -1216,7 +1216,7 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1244,7 +1244,7 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1275,7 +1275,7 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1305,7 +1305,7 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -1374,7 +1374,7 @@ static void LayDownRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1454,7 +1454,7 @@ static void LayDownRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1534,7 +1534,7 @@ static void LayDownRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1614,7 +1614,7 @@ static void LayDownRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1726,7 +1726,7 @@ static void LayDownRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1784,7 +1784,7 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -1822,7 +1822,7 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1847,7 +1847,7 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1876,7 +1876,7 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1902,7 +1902,7 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -1960,7 +1960,7 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -1998,7 +1998,7 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2023,7 +2023,7 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -2052,7 +2052,7 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2078,7 +2078,7 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -2158,7 +2158,7 @@ static void LayDownRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2197,7 +2197,7 @@ static void LayDownRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -2243,7 +2243,7 @@ static void LayDownRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2287,7 +2287,7 @@ static void LayDownRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2348,7 +2348,7 @@ static void LayDownRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2387,7 +2387,7 @@ static void LayDownRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2433,7 +2433,7 @@ static void LayDownRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -2477,7 +2477,7 @@ static void LayDownRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2537,7 +2537,7 @@ static void LayDownRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2568,7 +2568,7 @@ static void LayDownRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2607,7 +2607,7 @@ static void LayDownRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2642,7 +2642,7 @@ static void LayDownRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -2682,7 +2682,7 @@ static void LayDownRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2711,7 +2711,7 @@ static void LayDownRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -2784,7 +2784,7 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2815,7 +2815,7 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2857,7 +2857,7 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2892,7 +2892,7 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -2932,7 +2932,7 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2961,7 +2961,7 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -3027,7 +3027,7 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3068,7 +3068,7 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3099,7 +3099,7 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3139,7 +3139,7 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3196,7 +3196,7 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3247,7 +3247,7 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3278,7 +3278,7 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3318,7 +3318,7 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3407,7 +3407,7 @@ static void LayDownRCTrackLeftQuarterTurn160DegUp( } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -3463,7 +3463,7 @@ static void LayDownRCTrackRightQuarterTurn160DegUp( } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -3513,7 +3513,7 @@ static void LayDownRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -3565,7 +3565,7 @@ static void LayDownRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } @@ -3611,7 +3611,7 @@ static void LayDownRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -3649,7 +3649,7 @@ static void LayDownRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3678,13 +3678,13 @@ static void LayDownRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3715,7 +3715,7 @@ static void LayDownRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3788,7 +3788,7 @@ static void LayDownRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -3826,7 +3826,7 @@ static void LayDownRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3855,13 +3855,13 @@ static void LayDownRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3892,7 +3892,7 @@ static void LayDownRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3983,7 +3983,7 @@ static void LayDownRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -4021,7 +4021,7 @@ static void LayDownRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4050,13 +4050,13 @@ static void LayDownRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4087,7 +4087,7 @@ static void LayDownRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -4160,7 +4160,7 @@ static void LayDownRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -4198,7 +4198,7 @@ static void LayDownRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4227,13 +4227,13 @@ static void LayDownRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4264,7 +4264,7 @@ static void LayDownRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -4353,7 +4353,7 @@ static void LayDownRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4380,7 +4380,7 @@ static void LayDownRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4407,7 +4407,7 @@ static void LayDownRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4435,7 +4435,7 @@ static void LayDownRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4583,7 +4583,7 @@ static void LayDownRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4610,7 +4610,7 @@ static void LayDownRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4637,7 +4637,7 @@ static void LayDownRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4665,7 +4665,7 @@ static void LayDownRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4721,7 +4721,7 @@ static void LayDownRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -4734,7 +4734,7 @@ static void LayDownRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -4747,7 +4747,7 @@ static void LayDownRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -4761,7 +4761,7 @@ static void LayDownRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4831,7 +4831,7 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4858,7 +4858,7 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4885,7 +4885,7 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4913,7 +4913,7 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4969,7 +4969,7 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4982,7 +4982,7 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -4995,7 +4995,7 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5009,7 +5009,7 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5065,7 +5065,7 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5078,7 +5078,7 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5091,7 +5091,7 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5105,7 +5105,7 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5175,7 +5175,7 @@ static void LayDownRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5202,7 +5202,7 @@ static void LayDownRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5229,7 +5229,7 @@ static void LayDownRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5257,7 +5257,7 @@ static void LayDownRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5313,7 +5313,7 @@ static void LayDownRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5326,7 +5326,7 @@ static void LayDownRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5339,7 +5339,7 @@ static void LayDownRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5353,7 +5353,7 @@ static void LayDownRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5409,7 +5409,7 @@ static void LayDownRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5422,7 +5422,7 @@ static void LayDownRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5435,7 +5435,7 @@ static void LayDownRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5449,7 +5449,7 @@ static void LayDownRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5505,7 +5505,7 @@ static void LayDownRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -5517,7 +5517,7 @@ static void LayDownRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -5529,7 +5529,7 @@ static void LayDownRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -5542,7 +5542,7 @@ static void LayDownRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5598,7 +5598,7 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5611,7 +5611,7 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5624,7 +5624,7 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5638,7 +5638,7 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5694,7 +5694,7 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5707,7 +5707,7 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5720,7 +5720,7 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5734,7 +5734,7 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5790,7 +5790,7 @@ static void LayDownRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5803,7 +5803,7 @@ static void LayDownRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5816,7 +5816,7 @@ static void LayDownRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5830,7 +5830,7 @@ static void LayDownRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -5886,7 +5886,7 @@ static void LayDownRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5899,7 +5899,7 @@ static void LayDownRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5912,7 +5912,7 @@ static void LayDownRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5926,7 +5926,7 @@ static void LayDownRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -5983,7 +5983,7 @@ static void LayDownRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5996,7 +5996,7 @@ static void LayDownRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6009,7 +6009,7 @@ static void LayDownRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6023,7 +6023,7 @@ static void LayDownRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -6080,7 +6080,7 @@ static void LayDownRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6093,7 +6093,7 @@ static void LayDownRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6106,7 +6106,7 @@ static void LayDownRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6120,7 +6120,7 @@ static void LayDownRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -6177,7 +6177,7 @@ static void LayDownRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6190,7 +6190,7 @@ static void LayDownRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6203,7 +6203,7 @@ static void LayDownRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6217,7 +6217,7 @@ static void LayDownRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -6274,7 +6274,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6287,7 +6287,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6300,7 +6300,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6314,7 +6314,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6370,7 +6370,7 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6383,7 +6383,7 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6396,7 +6396,7 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6410,7 +6410,7 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6466,7 +6466,7 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6479,7 +6479,7 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6492,7 +6492,7 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6506,7 +6506,7 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6562,7 +6562,7 @@ static void LayDownRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6575,7 +6575,7 @@ static void LayDownRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6588,7 +6588,7 @@ static void LayDownRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6602,7 +6602,7 @@ static void LayDownRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6658,7 +6658,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -6670,7 +6670,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -6682,7 +6682,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -6695,7 +6695,7 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6751,7 +6751,7 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -6763,7 +6763,7 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -6775,7 +6775,7 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -6788,7 +6788,7 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6844,7 +6844,7 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6857,7 +6857,7 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6870,7 +6870,7 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6884,7 +6884,7 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -6940,7 +6940,7 @@ static void LayDownRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6953,7 +6953,7 @@ static void LayDownRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6966,7 +6966,7 @@ static void LayDownRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6980,7 +6980,7 @@ static void LayDownRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7036,7 +7036,7 @@ static void LayDownRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7049,7 +7049,7 @@ static void LayDownRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7062,7 +7062,7 @@ static void LayDownRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7076,7 +7076,7 @@ static void LayDownRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7133,7 +7133,7 @@ static void LayDownRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7146,7 +7146,7 @@ static void LayDownRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7159,7 +7159,7 @@ static void LayDownRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7173,7 +7173,7 @@ static void LayDownRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -7236,7 +7236,7 @@ static void LayDownRCTrackLeftFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -7270,7 +7270,7 @@ static void LayDownRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7307,7 +7307,7 @@ static void LayDownRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7344,7 +7344,7 @@ static void LayDownRCTrackRightFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -7377,7 +7377,7 @@ static void LayDownRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7414,7 +7414,7 @@ static void LayDownRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7453,7 +7453,7 @@ static void LayDownRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7480,7 +7480,7 @@ static void LayDownRCTrackFlyerHalfLoopDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -7519,7 +7519,7 @@ static void LayDownRCTrackFlyerHalfLoopDown( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7549,7 +7549,7 @@ static void LayDownRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7588,7 +7588,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -7623,7 +7623,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewDown( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7662,7 +7662,7 @@ static void LayDownRCTrackLeftFlyerCorkscrewDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7709,7 +7709,7 @@ static void LayDownRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -7753,7 +7753,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -7793,7 +7793,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7822,7 +7822,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -7854,7 +7854,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7884,7 +7884,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -7935,7 +7935,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -7975,7 +7975,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8004,7 +8004,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8036,7 +8036,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8066,7 +8066,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -8117,7 +8117,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -8157,7 +8157,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8186,7 +8186,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8218,7 +8218,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8248,7 +8248,7 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8299,7 +8299,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -8339,7 +8339,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8368,7 +8368,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8400,7 +8400,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8430,7 +8430,7 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8481,7 +8481,7 @@ static void LayDownRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8536,7 +8536,7 @@ static void LayDownRCTrackHalfLoopInvertedUp( { { 29, 20, height + 29 }, { 2, 2, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -8565,7 +8565,7 @@ static void LayDownRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -8598,7 +8598,7 @@ static void LayDownRCTrackHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index a0fe9a4391..59aee5c018 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -61,7 +61,7 @@ static void LimLaunchedRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -106,7 +106,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -132,7 +132,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -161,7 +161,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -186,7 +186,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -218,7 +218,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -247,7 +247,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -272,7 +272,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -315,7 +315,7 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -591,7 +591,7 @@ static void LimLaunchedRCTrackLeftTwistDownToUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -633,7 +633,7 @@ static void LimLaunchedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -683,7 +683,7 @@ static void LimLaunchedRCTrackLeftTwistDownToUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; @@ -740,7 +740,7 @@ static void LimLaunchedRCTrackRightTwistDownToUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -782,7 +782,7 @@ static void LimLaunchedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -832,7 +832,7 @@ static void LimLaunchedRCTrackRightTwistDownToUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; @@ -887,7 +887,7 @@ static void LimLaunchedRCTrackLeftTwistUpToDown( PaintUtilPushTunnelRotated(session, direction, height - 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; @@ -929,7 +929,7 @@ static void LimLaunchedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -981,7 +981,7 @@ static void LimLaunchedRCTrackLeftTwistUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1036,7 +1036,7 @@ static void LimLaunchedRCTrackRightTwistUpToDown( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -1078,7 +1078,7 @@ static void LimLaunchedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1130,7 +1130,7 @@ static void LimLaunchedRCTrackRightTwistUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1201,7 +1201,7 @@ static void LimLaunchedRCTrackLeftCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1230,7 +1230,7 @@ static void LimLaunchedRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -1287,7 +1287,7 @@ static void LimLaunchedRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1315,7 +1315,7 @@ static void LimLaunchedRCTrackRightCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1344,7 +1344,7 @@ static void LimLaunchedRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -1406,7 +1406,7 @@ static void LimLaunchedRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1443,7 +1443,7 @@ static void LimLaunchedRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1496,7 +1496,7 @@ static void LimLaunchedRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1550,7 +1550,7 @@ static void LimLaunchedRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -1590,7 +1590,7 @@ static void LimLaunchedRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -1630,7 +1630,7 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -1658,7 +1658,7 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1690,7 +1690,7 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1721,7 +1721,7 @@ static void LimLaunchedRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1763,7 +1763,7 @@ static void LimLaunchedRCTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -1810,7 +1810,7 @@ static void LimLaunchedRCTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -1891,7 +1891,7 @@ static void LimLaunchedRCTrackLeftBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1933,7 +1933,7 @@ static void LimLaunchedRCTrackLeftBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1983,7 +1983,7 @@ static void LimLaunchedRCTrackLeftBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2047,7 +2047,7 @@ static void LimLaunchedRCTrackRightBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2089,7 +2089,7 @@ static void LimLaunchedRCTrackRightBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2139,7 +2139,7 @@ static void LimLaunchedRCTrackRightBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2197,7 +2197,7 @@ static void LimLaunchedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2232,7 +2232,7 @@ static void LimLaunchedRCTrackHalfLoopUp( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2261,7 +2261,7 @@ static void LimLaunchedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -2294,7 +2294,7 @@ static void LimLaunchedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2347,7 +2347,7 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2380,7 +2380,7 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2413,7 +2413,7 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 10, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -2455,7 +2455,7 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -2500,7 +2500,7 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -2533,7 +2533,7 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 18, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -2566,7 +2566,7 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2608,7 +2608,7 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -2667,7 +2667,7 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -2707,7 +2707,7 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2736,7 +2736,7 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2745,7 +2745,7 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2812,7 +2812,7 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2867,7 +2867,7 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -2907,7 +2907,7 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2936,7 +2936,7 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2945,7 +2945,7 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3011,7 +3011,7 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3080,7 +3080,7 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3110,7 +3110,7 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3149,7 +3149,7 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -3177,7 +3177,7 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -3207,7 +3207,7 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) @@ -3258,7 +3258,7 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3288,7 +3288,7 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3327,7 +3327,7 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -3356,7 +3356,7 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -3386,7 +3386,7 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { @@ -3461,7 +3461,7 @@ static void LimLaunchedRCTrackLeftZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -3490,7 +3490,7 @@ static void LimLaunchedRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3535,7 +3535,7 @@ static void LimLaunchedRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3593,7 +3593,7 @@ static void LimLaunchedRCTrackRightZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -3622,7 +3622,7 @@ static void LimLaunchedRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3667,7 +3667,7 @@ static void LimLaunchedRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3730,7 +3730,7 @@ static void LimLaunchedRCTrackLeftLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3761,7 +3761,7 @@ static void LimLaunchedRCTrackLeftLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3793,14 +3793,14 @@ static void LimLaunchedRCTrackLeftLargeZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3894,7 +3894,7 @@ static void LimLaunchedRCTrackRightLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3925,7 +3925,7 @@ static void LimLaunchedRCTrackRightLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3958,14 +3958,14 @@ static void LimLaunchedRCTrackRightLargeZeroGRollUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -4073,7 +4073,7 @@ static void LimLaunchedRCTrackLeftBankToLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4118,7 +4118,7 @@ static void LimLaunchedRCTrackLeftBankToLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4164,7 +4164,7 @@ static void LimLaunchedRCTrackRightBankToRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4209,7 +4209,7 @@ static void LimLaunchedRCTrackRightBankToRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4252,7 +4252,7 @@ static void LimLaunchedRCTrackLeftQuarterTurn325DegDownToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4300,7 +4300,7 @@ static void LimLaunchedRCTrackLeftQuarterTurn325DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4343,7 +4343,7 @@ static void LimLaunchedRCTrackRightQuarterTurn325DegDownToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4391,7 +4391,7 @@ static void LimLaunchedRCTrackRightQuarterTurn325DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4434,7 +4434,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4470,7 +4470,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -4499,7 +4499,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -4539,7 +4539,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4568,7 +4568,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -4597,7 +4597,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4631,7 +4631,7 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -4675,7 +4675,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4711,7 +4711,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -4740,7 +4740,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -4780,7 +4780,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4809,7 +4809,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -4838,7 +4838,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4872,7 +4872,7 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -4943,7 +4943,7 @@ static void LimLaunchedRCTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -4990,7 +4990,7 @@ static void LimLaunchedRCTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5024,7 +5024,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -5037,7 +5037,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -5050,7 +5050,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -5077,7 +5077,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -5099,7 +5099,7 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5112,7 +5112,7 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5125,7 +5125,7 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5152,7 +5152,7 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5174,7 +5174,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5187,7 +5187,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5200,7 +5200,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5227,7 +5227,7 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5249,7 +5249,7 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -5262,7 +5262,7 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -5275,7 +5275,7 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -5302,7 +5302,7 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -5340,7 +5340,7 @@ static void LimLaunchedRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index 9dc1ad95c5..06b35b7487 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -91,7 +91,7 @@ static void LoopingRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -122,7 +122,7 @@ static void LoopingRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -202,7 +202,7 @@ static void LoopingRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -282,7 +282,7 @@ static void LoopingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -362,7 +362,7 @@ static void LoopingRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -454,7 +454,7 @@ static void LoopingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -546,7 +546,7 @@ static void LoopingRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -626,7 +626,7 @@ static void LoopingRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -716,7 +716,7 @@ static void LoopingRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -748,7 +748,7 @@ static void LoopingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -777,7 +777,7 @@ static void LoopingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -809,7 +809,7 @@ static void LoopingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -849,7 +849,7 @@ static void LoopingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -905,7 +905,7 @@ static void LoopingRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -950,7 +950,7 @@ static void LoopingRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -995,7 +995,7 @@ static void LoopingRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1040,7 +1040,7 @@ static void LoopingRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1085,7 +1085,7 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1117,7 +1117,7 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1146,7 +1146,7 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1178,7 +1178,7 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1221,7 +1221,7 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1284,7 +1284,7 @@ static void LoopingRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1336,7 +1336,7 @@ static void LoopingRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1388,7 +1388,7 @@ static void LoopingRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1440,7 +1440,7 @@ static void LoopingRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1511,7 +1511,7 @@ static void LoopingRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1561,7 +1561,7 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1591,7 +1591,7 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1619,7 +1619,7 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1649,7 +1649,7 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1689,7 +1689,7 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1733,7 +1733,7 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1763,7 +1763,7 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1791,7 +1791,7 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1821,7 +1821,7 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1861,7 +1861,7 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1923,7 +1923,7 @@ static void LoopingRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1954,7 +1954,7 @@ static void LoopingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1986,7 +1986,7 @@ static void LoopingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2026,7 +2026,7 @@ static void LoopingRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2070,7 +2070,7 @@ static void LoopingRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2102,7 +2102,7 @@ static void LoopingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2135,7 +2135,7 @@ static void LoopingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2175,7 +2175,7 @@ static void LoopingRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2214,7 +2214,7 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2240,7 +2240,7 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2292,7 +2292,7 @@ static void LoopingRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2317,7 +2317,7 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2349,7 +2349,7 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2401,7 +2401,7 @@ static void LoopingRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2426,7 +2426,7 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2461,7 +2461,7 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2767,7 +2767,7 @@ static void LoopingRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2798,7 +2798,7 @@ static void LoopingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2837,7 +2837,7 @@ static void LoopingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2893,7 +2893,7 @@ static void LoopingRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2924,7 +2924,7 @@ static void LoopingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2966,7 +2966,7 @@ static void LoopingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3015,7 +3015,7 @@ static void LoopingRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3056,7 +3056,7 @@ static void LoopingRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3096,7 +3096,7 @@ static void LoopingRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3143,7 +3143,7 @@ static void LoopingRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3208,7 +3208,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3240,7 +3240,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3282,7 +3282,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3325,7 +3325,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3357,7 +3357,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3394,7 +3394,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3442,7 +3442,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3474,7 +3474,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3516,7 +3516,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3559,7 +3559,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3591,7 +3591,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3628,7 +3628,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3704,7 +3704,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3737,7 +3737,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3766,7 +3766,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3798,7 +3798,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3841,7 +3841,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3884,7 +3884,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3917,7 +3917,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3946,7 +3946,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3978,7 +3978,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4016,7 +4016,7 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4064,7 +4064,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4097,7 +4097,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4126,7 +4126,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4158,7 +4158,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4201,7 +4201,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4244,7 +4244,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4277,7 +4277,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4306,7 +4306,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4338,7 +4338,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4376,7 +4376,7 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4452,7 +4452,7 @@ static void LoopingRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4497,7 +4497,7 @@ static void LoopingRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4550,7 +4550,7 @@ static void LoopingRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4596,7 +4596,7 @@ static void LoopingRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4642,7 +4642,7 @@ static void LoopingRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4678,7 +4678,7 @@ static void LoopingRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -4736,7 +4736,7 @@ static void LoopingRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4765,7 +4765,7 @@ static void LoopingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4794,13 +4794,13 @@ static void LoopingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4837,7 +4837,7 @@ static void LoopingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4882,7 +4882,7 @@ static void LoopingRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4911,7 +4911,7 @@ static void LoopingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4940,13 +4940,13 @@ static void LoopingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4983,7 +4983,7 @@ static void LoopingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5046,7 +5046,7 @@ static void LoopingRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5075,7 +5075,7 @@ static void LoopingRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5104,13 +5104,13 @@ static void LoopingRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5147,7 +5147,7 @@ static void LoopingRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5192,7 +5192,7 @@ static void LoopingRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5221,7 +5221,7 @@ static void LoopingRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5250,13 +5250,13 @@ static void LoopingRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5293,7 +5293,7 @@ static void LoopingRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5349,7 +5349,7 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5376,7 +5376,7 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5403,7 +5403,7 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5462,7 +5462,7 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5493,7 +5493,7 @@ static void LoopingRCTrackDiagBrakes( session, MetalSupportType::Tubes, DiagSupportPlacement[direction], 0, height, session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -5528,7 +5528,7 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5555,7 +5555,7 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5582,7 +5582,7 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5641,7 +5641,7 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5678,7 +5678,7 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5705,7 +5705,7 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5732,7 +5732,7 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5793,7 +5793,7 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5830,7 +5830,7 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5857,7 +5857,7 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5884,7 +5884,7 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5943,7 +5943,7 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5980,7 +5980,7 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6007,7 +6007,7 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6034,7 +6034,7 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6095,7 +6095,7 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6132,7 +6132,7 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6159,7 +6159,7 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6186,7 +6186,7 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6247,7 +6247,7 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6284,7 +6284,7 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6311,7 +6311,7 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6338,7 +6338,7 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6397,7 +6397,7 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6434,7 +6434,7 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6461,7 +6461,7 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6488,7 +6488,7 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6547,7 +6547,7 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6584,7 +6584,7 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6611,7 +6611,7 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6638,7 +6638,7 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6699,7 +6699,7 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6736,7 +6736,7 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6762,7 +6762,7 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6788,7 +6788,7 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6846,7 +6846,7 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -6884,7 +6884,7 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6911,7 +6911,7 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6938,7 +6938,7 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6999,7 +6999,7 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7036,7 +7036,7 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7063,7 +7063,7 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7090,7 +7090,7 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7149,7 +7149,7 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7186,7 +7186,7 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7213,7 +7213,7 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7240,7 +7240,7 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7299,7 +7299,7 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7322,7 +7322,7 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7338,7 +7338,7 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7351,7 +7351,7 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7378,7 +7378,7 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7401,7 +7401,7 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7414,7 +7414,7 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7430,7 +7430,7 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7457,7 +7457,7 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7480,7 +7480,7 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7496,7 +7496,7 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7509,7 +7509,7 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7536,7 +7536,7 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7559,7 +7559,7 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7572,7 +7572,7 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7588,7 +7588,7 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7615,7 +7615,7 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7638,7 +7638,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7654,7 +7654,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7667,7 +7667,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7694,7 +7694,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7717,7 +7717,7 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7730,7 +7730,7 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7746,7 +7746,7 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7773,7 +7773,7 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7796,7 +7796,7 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7812,7 +7812,7 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7825,7 +7825,7 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7852,7 +7852,7 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7875,7 +7875,7 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7888,7 +7888,7 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7904,7 +7904,7 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7931,7 +7931,7 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7954,7 +7954,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7969,7 +7969,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7981,7 +7981,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8007,7 +8007,7 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8031,7 +8031,7 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8043,7 +8043,7 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8058,7 +8058,7 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8084,7 +8084,7 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8108,7 +8108,7 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8124,7 +8124,7 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8137,7 +8137,7 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8164,7 +8164,7 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8187,7 +8187,7 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8200,7 +8200,7 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8216,7 +8216,7 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8243,7 +8243,7 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8266,7 +8266,7 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8279,7 +8279,7 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8292,7 +8292,7 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8319,7 +8319,7 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8342,7 +8342,7 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8355,7 +8355,7 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8368,7 +8368,7 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8395,7 +8395,7 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8434,7 +8434,7 @@ static void LoopingRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -8473,7 +8473,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8516,7 +8516,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8557,7 +8557,7 @@ static void LoopingRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8606,7 +8606,7 @@ static void LoopingRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8668,7 +8668,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8699,7 +8699,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8727,7 +8727,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8759,7 +8759,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8799,7 +8799,7 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8843,7 +8843,7 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8874,7 +8874,7 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8902,7 +8902,7 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8934,7 +8934,7 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8974,7 +8974,7 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9043,7 +9043,7 @@ static void LoopingRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9092,7 +9092,7 @@ static void LoopingRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9141,7 +9141,7 @@ static void LoopingRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9190,7 +9190,7 @@ static void LoopingRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9268,7 +9268,7 @@ static void LoopingRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9314,7 +9314,7 @@ static void LoopingRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9360,7 +9360,7 @@ static void LoopingRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9406,7 +9406,7 @@ static void LoopingRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9487,7 +9487,7 @@ static void LoopingRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9536,7 +9536,7 @@ static void LoopingRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9585,7 +9585,7 @@ static void LoopingRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9634,7 +9634,7 @@ static void LoopingRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9696,7 +9696,7 @@ static void LoopingRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index 98cd3c2956..383c381c8d 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -50,7 +50,7 @@ static void MineRideTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -74,7 +74,7 @@ static void MineRideTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -135,7 +135,7 @@ static void MineRideTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -196,7 +196,7 @@ static void MineRideTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -257,7 +257,7 @@ static void MineRideTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -329,7 +329,7 @@ static void MineRideTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -361,7 +361,7 @@ static void MineRideTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -390,7 +390,7 @@ static void MineRideTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -422,7 +422,7 @@ static void MineRideTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -468,7 +468,7 @@ static void MineRideTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -539,7 +539,7 @@ static void MineRideTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -599,7 +599,7 @@ static void MineRideTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -659,7 +659,7 @@ static void MineRideTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -719,7 +719,7 @@ static void MineRideTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -770,7 +770,7 @@ static void MineRideTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -802,7 +802,7 @@ static void MineRideTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -831,7 +831,7 @@ static void MineRideTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -863,7 +863,7 @@ static void MineRideTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -912,7 +912,7 @@ static void MineRideTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -990,7 +990,7 @@ static void MineRideTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1057,7 +1057,7 @@ static void MineRideTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1124,7 +1124,7 @@ static void MineRideTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1191,7 +1191,7 @@ static void MineRideTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1277,7 +1277,7 @@ static void MineRideTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1333,7 +1333,7 @@ static void MineRideTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1364,7 +1364,7 @@ static void MineRideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1396,7 +1396,7 @@ static void MineRideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1442,7 +1442,7 @@ static void MineRideTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1492,7 +1492,7 @@ static void MineRideTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1524,7 +1524,7 @@ static void MineRideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1557,7 +1557,7 @@ static void MineRideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1603,7 +1603,7 @@ static void MineRideTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1653,7 +1653,7 @@ static void MineRideTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1684,7 +1684,7 @@ static void MineRideTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1729,7 +1729,7 @@ static void MineRideTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1791,7 +1791,7 @@ static void MineRideTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1822,7 +1822,7 @@ static void MineRideTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1870,7 +1870,7 @@ static void MineRideTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1932,7 +1932,7 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1964,7 +1964,7 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2012,7 +2012,7 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2061,7 +2061,7 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2093,7 +2093,7 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2136,7 +2136,7 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2190,7 +2190,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2222,7 +2222,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2270,7 +2270,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2319,7 +2319,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2351,7 +2351,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2394,7 +2394,7 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2476,7 +2476,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2509,7 +2509,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2538,7 +2538,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2570,7 +2570,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2619,7 +2619,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2668,7 +2668,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2701,7 +2701,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2730,7 +2730,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -2762,7 +2762,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2806,7 +2806,7 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2860,7 +2860,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2893,7 +2893,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2922,7 +2922,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2954,7 +2954,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3003,7 +3003,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3052,7 +3052,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3085,7 +3085,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3114,7 +3114,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3146,7 +3146,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3190,7 +3190,7 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3259,7 +3259,7 @@ static void MineRideTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3307,7 +3307,7 @@ static void MineRideTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3336,7 +3336,7 @@ static void MineRideTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3365,13 +3365,13 @@ static void MineRideTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3408,7 +3408,7 @@ static void MineRideTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3459,7 +3459,7 @@ static void MineRideTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3488,7 +3488,7 @@ static void MineRideTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3517,13 +3517,13 @@ static void MineRideTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3560,7 +3560,7 @@ static void MineRideTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3629,7 +3629,7 @@ static void MineRideTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3658,7 +3658,7 @@ static void MineRideTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3687,13 +3687,13 @@ static void MineRideTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3730,7 +3730,7 @@ static void MineRideTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3781,7 +3781,7 @@ static void MineRideTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3810,7 +3810,7 @@ static void MineRideTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3839,13 +3839,13 @@ static void MineRideTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3882,7 +3882,7 @@ static void MineRideTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3924,7 +3924,7 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3937,7 +3937,7 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3950,7 +3950,7 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3977,7 +3977,7 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4000,7 +4000,7 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4013,7 +4013,7 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4026,7 +4026,7 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4054,7 +4054,7 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4077,7 +4077,7 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4090,7 +4090,7 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4103,7 +4103,7 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4130,7 +4130,7 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4153,7 +4153,7 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4166,7 +4166,7 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4179,7 +4179,7 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4207,7 +4207,7 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4230,7 +4230,7 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4243,7 +4243,7 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4256,7 +4256,7 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4284,7 +4284,7 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4307,7 +4307,7 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4319,7 +4319,7 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4331,7 +4331,7 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4358,7 +4358,7 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -4382,7 +4382,7 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4395,7 +4395,7 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4408,7 +4408,7 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4435,7 +4435,7 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4458,7 +4458,7 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4474,7 +4474,7 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4487,7 +4487,7 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4514,7 +4514,7 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4537,7 +4537,7 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4550,7 +4550,7 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4566,7 +4566,7 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4593,7 +4593,7 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4616,7 +4616,7 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4632,7 +4632,7 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4645,7 +4645,7 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4672,7 +4672,7 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4695,7 +4695,7 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4708,7 +4708,7 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4724,7 +4724,7 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4751,7 +4751,7 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4774,7 +4774,7 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4790,7 +4790,7 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4803,7 +4803,7 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4830,7 +4830,7 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4853,7 +4853,7 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4866,7 +4866,7 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4882,7 +4882,7 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4909,7 +4909,7 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4932,7 +4932,7 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4948,7 +4948,7 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4961,7 +4961,7 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4989,7 +4989,7 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5012,7 +5012,7 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5025,7 +5025,7 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5041,7 +5041,7 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5069,7 +5069,7 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5092,7 +5092,7 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -5107,7 +5107,7 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -5119,7 +5119,7 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -5146,7 +5146,7 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -5170,7 +5170,7 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -5182,7 +5182,7 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -5197,7 +5197,7 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -5224,7 +5224,7 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -5248,7 +5248,7 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5264,7 +5264,7 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5277,7 +5277,7 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5304,7 +5304,7 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5327,7 +5327,7 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5340,7 +5340,7 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5356,7 +5356,7 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5383,7 +5383,7 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5406,7 +5406,7 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5419,7 +5419,7 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5432,7 +5432,7 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5459,7 +5459,7 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5482,7 +5482,7 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5495,7 +5495,7 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5508,7 +5508,7 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5535,7 +5535,7 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index b6e51bc7aa..cd52cda9cb 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -124,7 +124,7 @@ static void MineTrainRCTrackFlat( } } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -159,7 +159,7 @@ static void MineTrainRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -233,7 +233,7 @@ static void MineTrainRCTrack25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -278,7 +278,7 @@ static void MineTrainRCTrack60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -352,7 +352,7 @@ static void MineTrainRCTrackFlatTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -403,7 +403,7 @@ static void MineTrainRCTrack25DegUpTo60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -454,7 +454,7 @@ static void MineTrainRCTrack60DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -528,7 +528,7 @@ static void MineTrainRCTrack25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -623,12 +623,12 @@ static void MineTrainRCTrackLeftQuarterTurn5( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -663,7 +663,7 @@ static void MineTrainRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -701,14 +701,14 @@ static void MineTrainRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -743,7 +743,7 @@ static void MineTrainRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -788,7 +788,7 @@ static void MineTrainRCTrackLeftQuarterTurn5( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -846,7 +846,7 @@ static void MineTrainRCTrackFlatToLeftBank( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -893,7 +893,7 @@ static void MineTrainRCTrackFlatToRightBank( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -940,7 +940,7 @@ static void MineTrainRCTrackLeftBankToFlat( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -987,7 +987,7 @@ static void MineTrainRCTrackRightBankToFlat( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1037,12 +1037,12 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1078,7 +1078,7 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1119,14 +1119,14 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -1162,7 +1162,7 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1210,7 +1210,7 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1272,7 +1272,7 @@ static void MineTrainRCTrackLeftBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1323,7 +1323,7 @@ static void MineTrainRCTrackRightBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1374,7 +1374,7 @@ static void MineTrainRCTrack25DegUpToLeftBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1425,7 +1425,7 @@ static void MineTrainRCTrack25DegUpToRightBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1498,7 +1498,7 @@ static void MineTrainRCTrackLeftBank( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1550,12 +1550,12 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1592,7 +1592,7 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1631,14 +1631,14 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -1675,7 +1675,7 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1724,7 +1724,7 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1770,12 +1770,12 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1812,7 +1812,7 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1851,14 +1851,14 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -1895,7 +1895,7 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1944,7 +1944,7 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2011,7 +2011,7 @@ static void MineTrainRCTrackSBendLeft( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2046,7 +2046,7 @@ static void MineTrainRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2082,7 +2082,7 @@ static void MineTrainRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2127,7 +2127,7 @@ static void MineTrainRCTrackSBendLeft( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2176,7 +2176,7 @@ static void MineTrainRCTrackSBendRight( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2211,7 +2211,7 @@ static void MineTrainRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2247,7 +2247,7 @@ static void MineTrainRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2292,7 +2292,7 @@ static void MineTrainRCTrackSBendRight( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2341,7 +2341,7 @@ static void MineTrainRCTrackLeftQuarterTurn3( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2374,7 +2374,7 @@ static void MineTrainRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2418,7 +2418,7 @@ static void MineTrainRCTrackLeftQuarterTurn3( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2479,7 +2479,7 @@ static void MineTrainRCTrackLeftQuarterTurn3Bank( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2513,7 +2513,7 @@ static void MineTrainRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2560,7 +2560,7 @@ static void MineTrainRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2614,7 +2614,7 @@ static void MineTrainRCTrackLeftQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2625,7 +2625,7 @@ static void MineTrainRCTrackLeftQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2665,7 +2665,7 @@ static void MineTrainRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2710,7 +2710,7 @@ static void MineTrainRCTrackRightQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2721,7 +2721,7 @@ static void MineTrainRCTrackRightQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2761,7 +2761,7 @@ static void MineTrainRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2832,9 +2832,9 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2869,7 +2869,7 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2917,9 +2917,9 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2968,9 +2968,9 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3004,7 +3004,7 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3047,9 +3047,9 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3103,9 +3103,9 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3140,7 +3140,7 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3188,9 +3188,9 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3239,9 +3239,9 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3276,7 +3276,7 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3319,9 +3319,9 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3403,15 +3403,15 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3448,7 +3448,7 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3488,14 +3488,14 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -3535,7 +3535,7 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3584,9 +3584,9 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3635,15 +3635,15 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -3680,7 +3680,7 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3720,14 +3720,14 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -3767,7 +3767,7 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3811,9 +3811,9 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3867,15 +3867,15 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3912,7 +3912,7 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3949,14 +3949,14 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -3993,7 +3993,7 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4042,9 +4042,9 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4093,15 +4093,15 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -4138,7 +4138,7 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4175,14 +4175,14 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -4219,7 +4219,7 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4263,9 +4263,9 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4325,7 +4325,7 @@ static void MineTrainRCTrackBrakes( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4367,7 +4367,7 @@ static void MineTrainRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 2, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -4414,7 +4414,7 @@ static void MineTrainRCTrackLeftEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4449,7 +4449,7 @@ static void MineTrainRCTrackLeftEighthToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4484,14 +4484,14 @@ static void MineTrainRCTrackLeftEighthToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner3, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4518,7 +4518,7 @@ static void MineTrainRCTrackLeftEighthToDiag( { { 16, 0, height }, { 16, 16, 1 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4567,7 +4567,7 @@ static void MineTrainRCTrackRightEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4602,7 +4602,7 @@ static void MineTrainRCTrackRightEighthToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4637,14 +4637,14 @@ static void MineTrainRCTrackRightEighthToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4671,7 +4671,7 @@ static void MineTrainRCTrackRightEighthToDiag( { { 16, 16, height }, { 16, 16, 1 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4738,7 +4738,7 @@ static void MineTrainRCTrackLeftEighthBankToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4773,7 +4773,7 @@ static void MineTrainRCTrackLeftEighthBankToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4808,14 +4808,14 @@ static void MineTrainRCTrackLeftEighthBankToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner3, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4842,7 +4842,7 @@ static void MineTrainRCTrackLeftEighthBankToDiag( { { 16, 0, height }, { 16, 16, 1 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4891,7 +4891,7 @@ static void MineTrainRCTrackRightEighthBankToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4926,7 +4926,7 @@ static void MineTrainRCTrackRightEighthBankToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4961,14 +4961,14 @@ static void MineTrainRCTrackRightEighthBankToDiag( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4995,7 +4995,7 @@ static void MineTrainRCTrackRightEighthBankToDiag( { { 16, 16, height }, { 16, 16, 1 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5035,7 +5035,7 @@ static void MineTrainRCTrackDiagFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5050,7 +5050,7 @@ static void MineTrainRCTrackDiagFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5065,7 +5065,7 @@ static void MineTrainRCTrackDiagFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5077,7 +5077,7 @@ static void MineTrainRCTrackDiagFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5097,7 +5097,7 @@ static void MineTrainRCTrackDiagBrakes( session, WoodenSupportType::Mine, MineTrainRCDiagonalSupports[trackSequence][0], height, session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -5117,7 +5117,7 @@ static void MineTrainRCTrackDiagBlockBrakes( session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -5137,7 +5137,7 @@ static void MineTrainRCTrackDiag25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5153,7 +5153,7 @@ static void MineTrainRCTrackDiag25DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5169,7 +5169,7 @@ static void MineTrainRCTrackDiag25DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5181,7 +5181,7 @@ static void MineTrainRCTrackDiag25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5201,7 +5201,7 @@ static void MineTrainRCTrackDiag60DegUp( session, direction, session.TrackColours.WithIndex(20385), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5216,7 +5216,7 @@ static void MineTrainRCTrackDiag60DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5231,7 +5231,7 @@ static void MineTrainRCTrackDiag60DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5242,7 +5242,7 @@ static void MineTrainRCTrackDiag60DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5264,7 +5264,7 @@ static void MineTrainRCTrackDiagFlatTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5279,7 +5279,7 @@ static void MineTrainRCTrackDiagFlatTo25DegUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5294,7 +5294,7 @@ static void MineTrainRCTrackDiagFlatTo25DegUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5306,7 +5306,7 @@ static void MineTrainRCTrackDiagFlatTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5327,7 +5327,7 @@ static void MineTrainRCTrackDiag25DegUpTo60DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5342,7 +5342,7 @@ static void MineTrainRCTrackDiag25DegUpTo60DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5357,7 +5357,7 @@ static void MineTrainRCTrackDiag25DegUpTo60DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5368,7 +5368,7 @@ static void MineTrainRCTrackDiag25DegUpTo60DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5390,7 +5390,7 @@ static void MineTrainRCTrackDiag60DegUpTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5405,7 +5405,7 @@ static void MineTrainRCTrackDiag60DegUpTo25DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5420,7 +5420,7 @@ static void MineTrainRCTrackDiag60DegUpTo25DegUp( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5431,7 +5431,7 @@ static void MineTrainRCTrackDiag60DegUpTo25DegUp( { { 0, 0, height }, { 16, 16, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5453,7 +5453,7 @@ static void MineTrainRCTrackDiag25DegUpToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5469,7 +5469,7 @@ static void MineTrainRCTrackDiag25DegUpToFlat( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5485,7 +5485,7 @@ static void MineTrainRCTrackDiag25DegUpToFlat( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5497,7 +5497,7 @@ static void MineTrainRCTrackDiag25DegUpToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5519,7 +5519,7 @@ static void MineTrainRCTrackDiag25DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5535,7 +5535,7 @@ static void MineTrainRCTrackDiag25DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5551,7 +5551,7 @@ static void MineTrainRCTrackDiag25DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5563,7 +5563,7 @@ static void MineTrainRCTrackDiag25DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5584,7 +5584,7 @@ static void MineTrainRCTrackDiag60DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5599,7 +5599,7 @@ static void MineTrainRCTrackDiag60DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5614,7 +5614,7 @@ static void MineTrainRCTrackDiag60DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5625,7 +5625,7 @@ static void MineTrainRCTrackDiag60DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5647,7 +5647,7 @@ static void MineTrainRCTrackDiagFlatTo25DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: if (direction == 0) @@ -5662,7 +5662,7 @@ static void MineTrainRCTrackDiagFlatTo25DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 2: if (direction == 2) @@ -5677,7 +5677,7 @@ static void MineTrainRCTrackDiagFlatTo25DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 3: if (direction == 1) @@ -5688,7 +5688,7 @@ static void MineTrainRCTrackDiagFlatTo25DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -5710,7 +5710,7 @@ static void MineTrainRCTrackDiag25DegDownTo60DegDown( { { 0, 0, height }, { 16, 16, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5725,7 +5725,7 @@ static void MineTrainRCTrackDiag25DegDownTo60DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5740,7 +5740,7 @@ static void MineTrainRCTrackDiag25DegDownTo60DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5751,7 +5751,7 @@ static void MineTrainRCTrackDiag25DegDownTo60DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5772,7 +5772,7 @@ static void MineTrainRCTrackDiag60DegDownTo25DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5787,7 +5787,7 @@ static void MineTrainRCTrackDiag60DegDownTo25DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5802,7 +5802,7 @@ static void MineTrainRCTrackDiag60DegDownTo25DegDown( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5813,7 +5813,7 @@ static void MineTrainRCTrackDiag60DegDownTo25DegDown( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5835,7 +5835,7 @@ static void MineTrainRCTrackDiag25DegDownToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5850,7 +5850,7 @@ static void MineTrainRCTrackDiag25DegDownToFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5865,7 +5865,7 @@ static void MineTrainRCTrackDiag25DegDownToFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5877,7 +5877,7 @@ static void MineTrainRCTrackDiag25DegDownToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5898,7 +5898,7 @@ static void MineTrainRCTrackDiagFlatToLeftBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5915,7 +5915,7 @@ static void MineTrainRCTrackDiagFlatToLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5929,7 +5929,7 @@ static void MineTrainRCTrackDiagFlatToLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5940,7 +5940,7 @@ static void MineTrainRCTrackDiagFlatToLeftBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5961,7 +5961,7 @@ static void MineTrainRCTrackDiagFlatToRightBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5975,7 +5975,7 @@ static void MineTrainRCTrackDiagFlatToRightBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5992,7 +5992,7 @@ static void MineTrainRCTrackDiagFlatToRightBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6003,7 +6003,7 @@ static void MineTrainRCTrackDiagFlatToRightBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6024,7 +6024,7 @@ static void MineTrainRCTrackDiagLeftBankToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6041,7 +6041,7 @@ static void MineTrainRCTrackDiagLeftBankToFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6055,7 +6055,7 @@ static void MineTrainRCTrackDiagLeftBankToFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6066,7 +6066,7 @@ static void MineTrainRCTrackDiagLeftBankToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6087,7 +6087,7 @@ static void MineTrainRCTrackDiagRightBankToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6101,7 +6101,7 @@ static void MineTrainRCTrackDiagRightBankToFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6118,7 +6118,7 @@ static void MineTrainRCTrackDiagRightBankToFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6129,7 +6129,7 @@ static void MineTrainRCTrackDiagRightBankToFlat( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6150,7 +6150,7 @@ static void MineTrainRCTrackDiagLeftBankTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6167,7 +6167,7 @@ static void MineTrainRCTrackDiagLeftBankTo25DegUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6181,7 +6181,7 @@ static void MineTrainRCTrackDiagLeftBankTo25DegUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6192,7 +6192,7 @@ static void MineTrainRCTrackDiagLeftBankTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6213,7 +6213,7 @@ static void MineTrainRCTrackDiagRightBankTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6227,7 +6227,7 @@ static void MineTrainRCTrackDiagRightBankTo25DegUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6244,7 +6244,7 @@ static void MineTrainRCTrackDiagRightBankTo25DegUp( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6255,7 +6255,7 @@ static void MineTrainRCTrackDiagRightBankTo25DegUp( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6276,7 +6276,7 @@ static void MineTrainRCTrackDiag25DegUpToLeftBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6294,7 +6294,7 @@ static void MineTrainRCTrackDiag25DegUpToLeftBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6309,7 +6309,7 @@ static void MineTrainRCTrackDiag25DegUpToLeftBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6320,7 +6320,7 @@ static void MineTrainRCTrackDiag25DegUpToLeftBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6342,7 +6342,7 @@ static void MineTrainRCTrackDiag25DegUpToRightBank( { { -16, -16, height }, { 32, 32, 1 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6357,7 +6357,7 @@ static void MineTrainRCTrackDiag25DegUpToRightBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6375,7 +6375,7 @@ static void MineTrainRCTrackDiag25DegUpToRightBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6386,7 +6386,7 @@ static void MineTrainRCTrackDiag25DegUpToRightBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6449,7 +6449,7 @@ static void MineTrainRCTrackDiagLeftBankTo25DegDown( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6509,7 +6509,7 @@ static void MineTrainRCTrackDiagRightBankTo25DegDown( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6528,7 +6528,7 @@ static void MineTrainRCTrackDiag25DegDownToLeftBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6545,7 +6545,7 @@ static void MineTrainRCTrackDiag25DegDownToLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6559,7 +6559,7 @@ static void MineTrainRCTrackDiag25DegDownToLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6570,7 +6570,7 @@ static void MineTrainRCTrackDiag25DegDownToLeftBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6591,7 +6591,7 @@ static void MineTrainRCTrackDiag25DegDownToRightBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6605,7 +6605,7 @@ static void MineTrainRCTrackDiag25DegDownToRightBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6622,7 +6622,7 @@ static void MineTrainRCTrackDiag25DegDownToRightBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6633,7 +6633,7 @@ static void MineTrainRCTrackDiag25DegDownToRightBank( { { -16, -16, height }, { 32, 32, 1 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6655,7 +6655,7 @@ static void MineTrainRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6670,7 +6670,7 @@ static void MineTrainRCTrackDiagLeftBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6685,7 +6685,7 @@ static void MineTrainRCTrackDiagLeftBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6697,7 +6697,7 @@ static void MineTrainRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6719,7 +6719,7 @@ static void MineTrainRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6734,7 +6734,7 @@ static void MineTrainRCTrackDiagRightBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6749,7 +6749,7 @@ static void MineTrainRCTrackDiagRightBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6761,7 +6761,7 @@ static void MineTrainRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6779,7 +6779,7 @@ static void MineTrainRCTrackBlockBrakes( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Mine, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 149f7d049b..6e714205bf 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -111,7 +111,7 @@ static void MiniRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -145,7 +145,7 @@ static void MiniRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -255,7 +255,7 @@ static void MiniRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -316,7 +316,7 @@ static void MiniRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -426,7 +426,7 @@ static void MiniRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -493,7 +493,7 @@ static void MiniRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -560,7 +560,7 @@ static void MiniRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -670,7 +670,7 @@ static void MiniRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -766,7 +766,7 @@ static void MiniRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -798,7 +798,7 @@ static void MiniRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -827,7 +827,7 @@ static void MiniRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -859,7 +859,7 @@ static void MiniRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -905,7 +905,7 @@ static void MiniRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -976,7 +976,7 @@ static void MiniRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1036,7 +1036,7 @@ static void MiniRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1096,7 +1096,7 @@ static void MiniRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1156,7 +1156,7 @@ static void MiniRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1207,7 +1207,7 @@ static void MiniRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1239,7 +1239,7 @@ static void MiniRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1268,7 +1268,7 @@ static void MiniRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1300,7 +1300,7 @@ static void MiniRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1349,7 +1349,7 @@ static void MiniRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1427,7 +1427,7 @@ static void MiniRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1494,7 +1494,7 @@ static void MiniRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1561,7 +1561,7 @@ static void MiniRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1628,7 +1628,7 @@ static void MiniRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1714,7 +1714,7 @@ static void MiniRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1770,7 +1770,7 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1800,7 +1800,7 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1828,7 +1828,7 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1858,7 +1858,7 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1904,7 +1904,7 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1954,7 +1954,7 @@ static void MiniRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1984,7 +1984,7 @@ static void MiniRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2012,7 +2012,7 @@ static void MiniRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -2042,7 +2042,7 @@ static void MiniRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2088,7 +2088,7 @@ static void MiniRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2156,7 +2156,7 @@ static void MiniRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2187,7 +2187,7 @@ static void MiniRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2219,7 +2219,7 @@ static void MiniRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2265,7 +2265,7 @@ static void MiniRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2315,7 +2315,7 @@ static void MiniRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2347,7 +2347,7 @@ static void MiniRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2380,7 +2380,7 @@ static void MiniRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2426,7 +2426,7 @@ static void MiniRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2476,7 +2476,7 @@ static void MiniRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2507,7 +2507,7 @@ static void MiniRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2552,7 +2552,7 @@ static void MiniRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2614,7 +2614,7 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2645,7 +2645,7 @@ static void MiniRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2693,7 +2693,7 @@ static void MiniRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2748,7 +2748,7 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2795,7 +2795,7 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2841,7 +2841,7 @@ static void MiniRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2888,7 +2888,7 @@ static void MiniRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2959,7 +2959,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2991,7 +2991,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3039,7 +3039,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3088,7 +3088,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3120,7 +3120,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3163,7 +3163,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3217,7 +3217,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3249,7 +3249,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3297,7 +3297,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3346,7 +3346,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3378,7 +3378,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3421,7 +3421,7 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3503,7 +3503,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3536,7 +3536,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3565,7 +3565,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3597,7 +3597,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3646,7 +3646,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3695,7 +3695,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3728,7 +3728,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3757,7 +3757,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3789,7 +3789,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3833,7 +3833,7 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3887,7 +3887,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3920,7 +3920,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3949,7 +3949,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3981,7 +3981,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4030,7 +4030,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4079,7 +4079,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4112,7 +4112,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4141,7 +4141,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4173,7 +4173,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4217,7 +4217,7 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4293,7 +4293,7 @@ static void MiniRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4338,7 +4338,7 @@ static void MiniRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -4390,7 +4390,7 @@ static void MiniRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4451,7 +4451,7 @@ static void MiniRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4512,7 +4512,7 @@ static void MiniRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4550,7 +4550,7 @@ static void MiniRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -4614,7 +4614,7 @@ static void MiniRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4643,7 +4643,7 @@ static void MiniRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4672,13 +4672,13 @@ static void MiniRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4715,7 +4715,7 @@ static void MiniRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4766,7 +4766,7 @@ static void MiniRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4795,7 +4795,7 @@ static void MiniRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4824,13 +4824,13 @@ static void MiniRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4867,7 +4867,7 @@ static void MiniRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4936,7 +4936,7 @@ static void MiniRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4965,7 +4965,7 @@ static void MiniRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4994,13 +4994,13 @@ static void MiniRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5037,7 +5037,7 @@ static void MiniRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5088,7 +5088,7 @@ static void MiniRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5117,7 +5117,7 @@ static void MiniRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5146,13 +5146,13 @@ static void MiniRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5189,7 +5189,7 @@ static void MiniRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5245,7 +5245,7 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5272,7 +5272,7 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5299,7 +5299,7 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5358,7 +5358,7 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5395,7 +5395,7 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5422,7 +5422,7 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5449,7 +5449,7 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5510,7 +5510,7 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5533,7 +5533,7 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5546,7 +5546,7 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5559,7 +5559,7 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5587,7 +5587,7 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5624,7 +5624,7 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5651,7 +5651,7 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5678,7 +5678,7 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5737,7 +5737,7 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5760,7 +5760,7 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5773,7 +5773,7 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5786,7 +5786,7 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5814,7 +5814,7 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5837,7 +5837,7 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5850,7 +5850,7 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5863,7 +5863,7 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5891,7 +5891,7 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5928,7 +5928,7 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5955,7 +5955,7 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5982,7 +5982,7 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6043,7 +6043,7 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6080,7 +6080,7 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6107,7 +6107,7 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6134,7 +6134,7 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6195,7 +6195,7 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6218,7 +6218,7 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6231,7 +6231,7 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6244,7 +6244,7 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6272,7 +6272,7 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6309,7 +6309,7 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6335,7 +6335,7 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6361,7 +6361,7 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6421,7 +6421,7 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -6445,7 +6445,7 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6458,7 +6458,7 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6471,7 +6471,7 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6499,7 +6499,7 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6522,7 +6522,7 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6535,7 +6535,7 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6548,7 +6548,7 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6576,7 +6576,7 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6613,7 +6613,7 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6640,7 +6640,7 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6667,7 +6667,7 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6726,7 +6726,7 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6749,7 +6749,7 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6765,7 +6765,7 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6778,7 +6778,7 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6805,7 +6805,7 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6828,7 +6828,7 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6841,7 +6841,7 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6857,7 +6857,7 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6884,7 +6884,7 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6907,7 +6907,7 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6923,7 +6923,7 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6936,7 +6936,7 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6963,7 +6963,7 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6986,7 +6986,7 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6999,7 +6999,7 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7015,7 +7015,7 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7042,7 +7042,7 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7065,7 +7065,7 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7081,7 +7081,7 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7094,7 +7094,7 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7121,7 +7121,7 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7144,7 +7144,7 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7157,7 +7157,7 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7173,7 +7173,7 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7200,7 +7200,7 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7223,7 +7223,7 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7239,7 +7239,7 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7252,7 +7252,7 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7280,7 +7280,7 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7303,7 +7303,7 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7316,7 +7316,7 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7332,7 +7332,7 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7360,7 +7360,7 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7383,7 +7383,7 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7398,7 +7398,7 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7410,7 +7410,7 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -7437,7 +7437,7 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -7461,7 +7461,7 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -7473,7 +7473,7 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -7488,7 +7488,7 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -7515,7 +7515,7 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -7539,7 +7539,7 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7555,7 +7555,7 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7568,7 +7568,7 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7595,7 +7595,7 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7618,7 +7618,7 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7631,7 +7631,7 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7647,7 +7647,7 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7674,7 +7674,7 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7697,7 +7697,7 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7710,7 +7710,7 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7723,7 +7723,7 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7750,7 +7750,7 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7773,7 +7773,7 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7786,7 +7786,7 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7799,7 +7799,7 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7826,7 +7826,7 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7862,7 +7862,7 @@ static void MiniRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -7907,7 +7907,7 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7956,7 +7956,7 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8003,7 +8003,7 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8052,7 +8052,7 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8120,7 +8120,7 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8151,7 +8151,7 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8179,7 +8179,7 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8211,7 +8211,7 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8257,7 +8257,7 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8307,7 +8307,7 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8338,7 +8338,7 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8366,7 +8366,7 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8398,7 +8398,7 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8444,7 +8444,7 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8528,7 +8528,7 @@ static void MiniRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8592,7 +8592,7 @@ static void MiniRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8656,7 +8656,7 @@ static void MiniRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8720,7 +8720,7 @@ static void MiniRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8813,7 +8813,7 @@ static void MiniRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -8874,7 +8874,7 @@ static void MiniRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -8935,7 +8935,7 @@ static void MiniRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -8996,7 +8996,7 @@ static void MiniRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9092,7 +9092,7 @@ static void MiniRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9156,7 +9156,7 @@ static void MiniRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9220,7 +9220,7 @@ static void MiniRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9284,7 +9284,7 @@ static void MiniRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9359,7 +9359,7 @@ static void MiniRCTrackLeftCurvedLiftHill( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9406,7 +9406,7 @@ static void MiniRCTrackLeftCurvedLiftHill( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9451,7 +9451,7 @@ static void MiniRCTrackRightCurvedLiftHill( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9498,7 +9498,7 @@ static void MiniRCTrackRightCurvedLiftHill( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9535,7 +9535,7 @@ static void MiniRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp index fad5193241..fcce66bea3 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -57,7 +57,7 @@ static void MiniSuspendedRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -102,7 +102,7 @@ static void MiniSuspendedRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_1); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -165,7 +165,7 @@ static void MiniSuspendedRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -260,7 +260,7 @@ static void MiniSuspendedRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -355,7 +355,7 @@ static void MiniSuspendedRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -444,7 +444,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -491,7 +491,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -516,7 +516,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -544,7 +544,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -570,7 +570,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -638,7 +638,7 @@ static void MiniSuspendedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -682,7 +682,7 @@ static void MiniSuspendedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -723,7 +723,7 @@ static void MiniSuspendedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -763,7 +763,7 @@ static void MiniSuspendedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -821,7 +821,7 @@ static void MiniSuspendedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -865,7 +865,7 @@ static void MiniSuspendedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -906,7 +906,7 @@ static void MiniSuspendedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -946,7 +946,7 @@ static void MiniSuspendedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1004,7 +1004,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1050,7 +1050,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1075,7 +1075,7 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1147,7 +1147,7 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1194,7 +1194,7 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1223,13 +1223,13 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1260,7 +1260,7 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1323,7 +1323,7 @@ static void MiniSuspendedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1370,7 +1370,7 @@ static void MiniSuspendedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1399,13 +1399,13 @@ static void MiniSuspendedRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1436,7 +1436,7 @@ static void MiniSuspendedRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1515,7 +1515,7 @@ static void MiniSuspendedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1542,7 +1542,7 @@ static void MiniSuspendedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1569,7 +1569,7 @@ static void MiniSuspendedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1597,7 +1597,7 @@ static void MiniSuspendedRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1657,7 +1657,7 @@ static void MiniSuspendedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1684,7 +1684,7 @@ static void MiniSuspendedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1711,7 +1711,7 @@ static void MiniSuspendedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1739,7 +1739,7 @@ static void MiniSuspendedRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1799,7 +1799,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -1826,7 +1826,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1853,7 +1853,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -1881,7 +1881,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1941,7 +1941,7 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1968,7 +1968,7 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1995,7 +1995,7 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -2023,7 +2023,7 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -2083,7 +2083,7 @@ static void MiniSuspendedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2110,7 +2110,7 @@ static void MiniSuspendedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2137,7 +2137,7 @@ static void MiniSuspendedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -2165,7 +2165,7 @@ static void MiniSuspendedRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -2225,7 +2225,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2251,7 +2251,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2277,7 +2277,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2304,7 +2304,7 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -2364,7 +2364,7 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -2391,7 +2391,7 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -2418,7 +2418,7 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -2446,7 +2446,7 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index 5cee391fd7..2e6ffc3c65 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -133,7 +133,7 @@ static void MultiDimensionRCTrackFlat( } } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -155,7 +155,7 @@ static void MultiDimensionRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -221,7 +221,7 @@ static void MultiDimensionRCTrackStation( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -302,7 +302,7 @@ static void MultiDimensionRCTrack25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -332,7 +332,7 @@ static void MultiDimensionRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -415,7 +415,7 @@ static void MultiDimensionRCTrack60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } else @@ -452,7 +452,7 @@ static void MultiDimensionRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -534,7 +534,7 @@ static void MultiDimensionRCTrackFlatTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -564,7 +564,7 @@ static void MultiDimensionRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -653,7 +653,7 @@ static void MultiDimensionRCTrack25DegUpTo60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else @@ -696,7 +696,7 @@ static void MultiDimensionRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } @@ -750,7 +750,7 @@ static void MultiDimensionRCTrack60DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else @@ -786,7 +786,7 @@ static void MultiDimensionRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -903,7 +903,7 @@ static void MultiDimensionRCTrack25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -933,7 +933,7 @@ static void MultiDimensionRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1060,7 +1060,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1093,7 +1093,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1122,7 +1122,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1155,7 +1155,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1195,7 +1195,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1230,7 +1230,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -1272,7 +1272,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1301,7 +1301,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1334,7 +1334,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1364,7 +1364,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -1436,7 +1436,7 @@ static void MultiDimensionRCTrackFlatToLeftBank( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1467,7 +1467,7 @@ static void MultiDimensionRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1522,7 +1522,7 @@ static void MultiDimensionRCTrackFlatToRightBank( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1553,7 +1553,7 @@ static void MultiDimensionRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1608,7 +1608,7 @@ static void MultiDimensionRCTrackLeftBankToFlat( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1639,7 +1639,7 @@ static void MultiDimensionRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1694,7 +1694,7 @@ static void MultiDimensionRCTrackRightBankToFlat( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1725,7 +1725,7 @@ static void MultiDimensionRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1780,7 +1780,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1813,7 +1813,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1842,7 +1842,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1875,7 +1875,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1918,7 +1918,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1953,7 +1953,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -1993,7 +1993,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2021,7 +2021,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2052,7 +2052,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2082,7 +2082,7 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -2161,7 +2161,7 @@ static void MultiDimensionRCTrackLeftBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -2192,7 +2192,7 @@ static void MultiDimensionRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2282,7 +2282,7 @@ static void MultiDimensionRCTrackRightBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -2313,7 +2313,7 @@ static void MultiDimensionRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2403,7 +2403,7 @@ static void MultiDimensionRCTrack25DegUpToLeftBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -2434,7 +2434,7 @@ static void MultiDimensionRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2524,7 +2524,7 @@ static void MultiDimensionRCTrack25DegUpToRightBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -2555,7 +2555,7 @@ static void MultiDimensionRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2664,7 +2664,7 @@ static void MultiDimensionRCTrackLeftBank( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -2695,7 +2695,7 @@ static void MultiDimensionRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2755,7 +2755,7 @@ static void MultiDimensionRCTrackSBendLeft( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2786,7 +2786,7 @@ static void MultiDimensionRCTrackSBendLeft( { { 0, 6, height }, { 32, 26, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2817,7 +2817,7 @@ static void MultiDimensionRCTrackSBendLeft( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2855,7 +2855,7 @@ static void MultiDimensionRCTrackSBendLeft( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2890,7 +2890,7 @@ static void MultiDimensionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -2929,7 +2929,7 @@ static void MultiDimensionRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -2975,7 +2975,7 @@ static void MultiDimensionRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3019,7 +3019,7 @@ static void MultiDimensionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -3078,7 +3078,7 @@ static void MultiDimensionRCTrackSBendRight( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3109,7 +3109,7 @@ static void MultiDimensionRCTrackSBendRight( session, direction, session.TrackColours.WithIndex(15830), { 0, 0, height }, { 32, 26, 3 }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3140,7 +3140,7 @@ static void MultiDimensionRCTrackSBendRight( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3178,7 +3178,7 @@ static void MultiDimensionRCTrackSBendRight( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3213,7 +3213,7 @@ static void MultiDimensionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -3252,7 +3252,7 @@ static void MultiDimensionRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -3298,7 +3298,7 @@ static void MultiDimensionRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -3342,7 +3342,7 @@ static void MultiDimensionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -3401,7 +3401,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3432,7 +3432,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3471,7 +3471,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3506,7 +3506,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3546,7 +3546,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3575,7 +3575,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3647,7 +3647,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3678,7 +3678,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3720,7 +3720,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3755,7 +3755,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3795,7 +3795,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3824,7 +3824,7 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3894,7 +3894,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3925,7 +3925,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3967,7 +3967,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4009,7 +4009,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -4040,7 +4040,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4076,7 +4076,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4122,7 +4122,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4153,7 +4153,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4194,7 +4194,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4236,7 +4236,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4268,7 +4268,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4304,7 +4304,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4378,7 +4378,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4410,7 +4410,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4439,7 +4439,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4471,7 +4471,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4514,7 +4514,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4556,7 +4556,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: @@ -4588,7 +4588,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4617,7 +4617,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4649,7 +4649,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4686,7 +4686,7 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4732,7 +4732,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4764,7 +4764,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4793,7 +4793,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4825,7 +4825,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4867,7 +4867,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4909,7 +4909,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4942,7 +4942,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4971,7 +4971,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -5003,7 +5003,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5040,7 +5040,7 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5102,7 +5102,7 @@ static void MultiDimensionRCTrackBrakes( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -5124,7 +5124,7 @@ static void MultiDimensionRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -5170,7 +5170,7 @@ static void MultiDimensionRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -5232,7 +5232,7 @@ static void MultiDimensionRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } } @@ -5272,7 +5272,7 @@ static void MultiDimensionRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5309,7 +5309,7 @@ static void MultiDimensionRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5365,7 +5365,7 @@ static void MultiDimensionRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5406,7 +5406,7 @@ static void MultiDimensionRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5463,7 +5463,7 @@ static void MultiDimensionRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } else @@ -5501,7 +5501,7 @@ static void MultiDimensionRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } } @@ -5544,7 +5544,7 @@ static void MultiDimensionRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -5584,7 +5584,7 @@ static void MultiDimensionRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -5632,7 +5632,7 @@ static void MultiDimensionRCTrackLeftEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5659,7 +5659,7 @@ static void MultiDimensionRCTrackLeftEighthToDiag( { { 0, 16, height }, { 32, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5687,13 +5687,13 @@ static void MultiDimensionRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5732,7 +5732,7 @@ static void MultiDimensionRCTrackLeftEighthToDiag( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5767,7 +5767,7 @@ static void MultiDimensionRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -5805,7 +5805,7 @@ static void MultiDimensionRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5834,13 +5834,13 @@ static void MultiDimensionRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5871,7 +5871,7 @@ static void MultiDimensionRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -5942,7 +5942,7 @@ static void MultiDimensionRCTrackRightEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5969,7 +5969,7 @@ static void MultiDimensionRCTrackRightEighthToDiag( { { 0, 0, height }, { 32, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5997,13 +5997,13 @@ static void MultiDimensionRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6042,7 +6042,7 @@ static void MultiDimensionRCTrackRightEighthToDiag( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6077,7 +6077,7 @@ static void MultiDimensionRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -6115,7 +6115,7 @@ static void MultiDimensionRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6144,13 +6144,13 @@ static void MultiDimensionRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6181,7 +6181,7 @@ static void MultiDimensionRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -6270,7 +6270,7 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6297,7 +6297,7 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( { { 0, 16, height }, { 32, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6325,13 +6325,13 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6370,7 +6370,7 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6405,7 +6405,7 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -6443,7 +6443,7 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6472,13 +6472,13 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6509,7 +6509,7 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -6580,7 +6580,7 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6607,7 +6607,7 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( { { 0, 0, height }, { 32, 16, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6635,13 +6635,13 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6680,7 +6680,7 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6715,7 +6715,7 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -6753,7 +6753,7 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6782,13 +6782,13 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6819,7 +6819,7 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -6902,7 +6902,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6929,7 +6929,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6956,7 +6956,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7019,7 +7019,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7052,7 +7052,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7079,7 +7079,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7106,7 +7106,7 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7134,7 +7134,7 @@ static void MultiDimensionRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7276,7 +7276,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7303,7 +7303,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7330,7 +7330,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7393,7 +7393,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7426,7 +7426,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7453,7 +7453,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7480,7 +7480,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7508,7 +7508,7 @@ static void MultiDimensionRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7558,7 +7558,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -7571,7 +7571,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -7584,7 +7584,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -7615,7 +7615,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -7634,7 +7634,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -7647,7 +7647,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -7660,7 +7660,7 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -7674,7 +7674,7 @@ static void MultiDimensionRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -7738,7 +7738,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7765,7 +7765,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7792,7 +7792,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7855,7 +7855,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7888,7 +7888,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7915,7 +7915,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7942,7 +7942,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7970,7 +7970,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8020,7 +8020,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8033,7 +8033,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8046,7 +8046,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8077,7 +8077,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8096,7 +8096,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8109,7 +8109,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8122,7 +8122,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8136,7 +8136,7 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8186,7 +8186,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8199,7 +8199,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8212,7 +8212,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8243,7 +8243,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8262,7 +8262,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8275,7 +8275,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8288,7 +8288,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8302,7 +8302,7 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8366,7 +8366,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8393,7 +8393,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8420,7 +8420,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8483,7 +8483,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8516,7 +8516,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8543,7 +8543,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8570,7 +8570,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8598,7 +8598,7 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8662,7 +8662,7 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8689,7 +8689,7 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8716,7 +8716,7 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8779,7 +8779,7 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8798,7 +8798,7 @@ static void MultiDimensionRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8811,7 +8811,7 @@ static void MultiDimensionRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8824,7 +8824,7 @@ static void MultiDimensionRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8838,7 +8838,7 @@ static void MultiDimensionRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -8888,7 +8888,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -8901,7 +8901,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -8914,7 +8914,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -8945,7 +8945,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -8964,7 +8964,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -8977,7 +8977,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -8990,7 +8990,7 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -9004,7 +9004,7 @@ static void MultiDimensionRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9068,7 +9068,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -9094,7 +9094,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -9120,7 +9120,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -9182,7 +9182,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } } @@ -9200,7 +9200,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9213,7 +9213,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9226,7 +9226,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9240,7 +9240,7 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9290,7 +9290,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9303,7 +9303,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9316,7 +9316,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9347,7 +9347,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9366,7 +9366,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9379,7 +9379,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9392,7 +9392,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9406,7 +9406,7 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9456,7 +9456,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9469,7 +9469,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9482,7 +9482,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9513,7 +9513,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9532,7 +9532,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9545,7 +9545,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9558,7 +9558,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9572,7 +9572,7 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9636,7 +9636,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9663,7 +9663,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9690,7 +9690,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -9753,7 +9753,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -9772,7 +9772,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9785,7 +9785,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9798,7 +9798,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -9812,7 +9812,7 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -9862,7 +9862,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9878,7 +9878,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9891,7 +9891,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9922,7 +9922,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9941,7 +9941,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9954,7 +9954,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9967,7 +9967,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9981,7 +9981,7 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -10032,7 +10032,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10045,7 +10045,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10061,7 +10061,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10092,7 +10092,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -10111,7 +10111,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10124,7 +10124,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10137,7 +10137,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10151,7 +10151,7 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -10202,7 +10202,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10218,7 +10218,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10231,7 +10231,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10262,7 +10262,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -10281,7 +10281,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10294,7 +10294,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10307,7 +10307,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10321,7 +10321,7 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -10372,7 +10372,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10385,7 +10385,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10401,7 +10401,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10432,7 +10432,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -10451,7 +10451,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10464,7 +10464,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10477,7 +10477,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10491,7 +10491,7 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -10542,7 +10542,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10558,7 +10558,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10571,7 +10571,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10602,7 +10602,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10621,7 +10621,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10634,7 +10634,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10647,7 +10647,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10661,7 +10661,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -10711,7 +10711,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10724,7 +10724,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10740,7 +10740,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10771,7 +10771,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10790,7 +10790,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10803,7 +10803,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10816,7 +10816,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10830,7 +10830,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -10880,7 +10880,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10896,7 +10896,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10909,7 +10909,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10940,7 +10940,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10959,7 +10959,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10972,7 +10972,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10985,7 +10985,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10999,7 +10999,7 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11049,7 +11049,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11062,7 +11062,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -11078,7 +11078,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11109,7 +11109,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -11128,7 +11128,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11141,7 +11141,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -11154,7 +11154,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11168,7 +11168,7 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11218,7 +11218,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11233,7 +11233,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11245,7 +11245,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11275,7 +11275,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } } @@ -11293,7 +11293,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11305,7 +11305,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11317,7 +11317,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11330,7 +11330,7 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11380,7 +11380,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11392,7 +11392,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11407,7 +11407,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11437,7 +11437,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } } @@ -11455,7 +11455,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -11467,7 +11467,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -11479,7 +11479,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -11492,7 +11492,7 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11542,7 +11542,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11558,7 +11558,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11571,7 +11571,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11602,7 +11602,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11621,7 +11621,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11634,7 +11634,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11647,7 +11647,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11661,7 +11661,7 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11711,7 +11711,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11724,7 +11724,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11740,7 +11740,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11771,7 +11771,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11790,7 +11790,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11803,7 +11803,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11816,7 +11816,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11830,7 +11830,7 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -11880,7 +11880,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11893,7 +11893,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11906,7 +11906,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11937,7 +11937,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -11956,7 +11956,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11969,7 +11969,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11982,7 +11982,7 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11996,7 +11996,7 @@ static void MultiDimensionRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -12047,7 +12047,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12060,7 +12060,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12073,7 +12073,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12104,7 +12104,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12123,7 +12123,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12136,7 +12136,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12149,7 +12149,7 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12163,7 +12163,7 @@ static void MultiDimensionRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -12230,7 +12230,7 @@ static void MultiDimensionRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12257,7 +12257,7 @@ static void MultiDimensionRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12285,7 +12285,7 @@ static void MultiDimensionRCTrackLeftFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12339,7 +12339,7 @@ static void MultiDimensionRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12365,7 +12365,7 @@ static void MultiDimensionRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12392,7 +12392,7 @@ static void MultiDimensionRCTrackRightFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12442,7 +12442,7 @@ static void MultiDimensionRCTrackLeftFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12476,7 +12476,7 @@ static void MultiDimensionRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12513,7 +12513,7 @@ static void MultiDimensionRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12550,7 +12550,7 @@ static void MultiDimensionRCTrackRightFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12583,7 +12583,7 @@ static void MultiDimensionRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12620,7 +12620,7 @@ static void MultiDimensionRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12665,7 +12665,7 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12693,7 +12693,7 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -12721,7 +12721,7 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -12761,7 +12761,7 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12789,7 +12789,7 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12817,7 +12817,7 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -12848,7 +12848,7 @@ static void MultiDimensionRCTrackBlockBrakes( MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -12865,7 +12865,7 @@ static void MultiDimensionRCTrackBlockBrakes( { { 0, 6, height + 24 }, { 32, 20, 3 } }); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -12911,7 +12911,7 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12939,7 +12939,7 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12971,7 +12971,7 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13005,7 +13005,7 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13033,7 +13033,7 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13065,7 +13065,7 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -13110,7 +13110,7 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13138,7 +13138,7 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -13166,7 +13166,7 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -13206,7 +13206,7 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13234,7 +13234,7 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13262,7 +13262,7 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -13305,7 +13305,7 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -13333,7 +13333,7 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13365,7 +13365,7 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13399,7 +13399,7 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13427,7 +13427,7 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13459,7 +13459,7 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp index b6bac5439b..35ed6c1575 100644 --- a/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverseFreefallCoaster.cpp @@ -214,7 +214,7 @@ static void PaintReverseFreefallRCFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -255,7 +255,7 @@ static void PaintReverseFreefallRCStation( TrackPaintUtilDrawNarrowStationPlatform(session, ride, direction, height, 5, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -309,7 +309,7 @@ static void PaintReverseFreefallRCSlope( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 5: @@ -336,7 +336,7 @@ static void PaintReverseFreefallRCSlope( session, direction, supportsImageId, { 0, 0, height }, { { isDirection03 ? 3 : 11, 3, height }, { isDirection03 ? 26 : 18, 26, 126 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; case 6: @@ -356,7 +356,7 @@ static void PaintReverseFreefallRCSlope( } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + supportHeights[trackSequence], 0x20); break; } @@ -372,7 +372,7 @@ static void PaintReverseFreefallRCVertical( case 0: supportsImageId = session.SupportColours.WithIndex(reverse_freefall_rc_track_pieces_vertical_supports[direction]); PaintAddImageAsParent(session, supportsImageId, { 0, 0, height }, { { 3, 3, height }, { 26, 26, 79 } }); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -388,7 +388,7 @@ static void PaintReverseFreefallRCVertical( session, direction, trackImageId, { 0, 0, height }, { { 30, 6, height }, { 2, 20, 79 } }); } PaintUtilSetVerticalTunnel(session, height + 80); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -422,7 +422,7 @@ static void PaintReverseFreefallRCOnridePhoto( TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index 6cf0e81e0e..b9e2c29017 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -95,7 +95,7 @@ static void ReverserRCTrackFlat( } } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -120,7 +120,7 @@ static void ReverserRCTrackStation( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -213,7 +213,7 @@ static void ReverserRCTrack25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -306,7 +306,7 @@ static void ReverserRCTrackFlatTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -399,7 +399,7 @@ static void ReverserRCTrack25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -466,12 +466,12 @@ static void ReverserRCTrackLeftQuarterTurn5( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -504,7 +504,7 @@ static void ReverserRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -539,14 +539,14 @@ static void ReverserRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -579,7 +579,7 @@ static void ReverserRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -620,7 +620,7 @@ static void ReverserRCTrackLeftQuarterTurn5( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -678,7 +678,7 @@ static void ReverserRCTrackSBendLeft( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -715,7 +715,7 @@ static void ReverserRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -753,7 +753,7 @@ static void ReverserRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -798,7 +798,7 @@ static void ReverserRCTrackSBendLeft( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -847,7 +847,7 @@ static void ReverserRCTrackSBendRight( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -884,7 +884,7 @@ static void ReverserRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -922,7 +922,7 @@ static void ReverserRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -967,7 +967,7 @@ static void ReverserRCTrackSBendRight( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1016,7 +1016,7 @@ static void ReverserRCTrackLeftQuarterTurn3( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1047,7 +1047,7 @@ static void ReverserRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1091,7 +1091,7 @@ static void ReverserRCTrackLeftQuarterTurn3( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1131,7 +1131,7 @@ static void ReverserRCTrackBrakes( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1178,7 +1178,7 @@ static void ReverserRCTrackLeftReverser( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1213,7 +1213,7 @@ static void ReverserRCTrackLeftReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1248,7 +1248,7 @@ static void ReverserRCTrackLeftReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1283,7 +1283,7 @@ static void ReverserRCTrackLeftReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1318,7 +1318,7 @@ static void ReverserRCTrackLeftReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -1362,7 +1362,7 @@ static void ReverserRCTrackLeftReverser( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1411,7 +1411,7 @@ static void ReverserRCTrackRightReverser( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1446,7 +1446,7 @@ static void ReverserRCTrackRightReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1481,7 +1481,7 @@ static void ReverserRCTrackRightReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1516,7 +1516,7 @@ static void ReverserRCTrackRightReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1551,7 +1551,7 @@ static void ReverserRCTrackRightReverser( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -1595,7 +1595,7 @@ static void ReverserRCTrackRightReverser( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index 4989e79b3f..085b907469 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -145,7 +145,7 @@ static void SideFrictionRCTrackFlat( } } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -168,7 +168,7 @@ static void SideFrictionRCTrackStation( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -285,7 +285,7 @@ static void SideFrictionRCTrack25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -402,7 +402,7 @@ static void SideFrictionRCTrackFlatTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -519,7 +519,7 @@ static void SideFrictionRCTrack25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -598,12 +598,12 @@ static void SideFrictionRCTrackLeftQuarterTurn5( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -648,7 +648,7 @@ static void SideFrictionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -695,14 +695,14 @@ static void SideFrictionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -747,7 +747,7 @@ static void SideFrictionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -800,7 +800,7 @@ static void SideFrictionRCTrackLeftQuarterTurn5( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -870,7 +870,7 @@ static void SideFrictionRCTrackSBendLeft( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -919,7 +919,7 @@ static void SideFrictionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -969,7 +969,7 @@ static void SideFrictionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1026,7 +1026,7 @@ static void SideFrictionRCTrackSBendLeft( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1087,7 +1087,7 @@ static void SideFrictionRCTrackSBendRight( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1136,7 +1136,7 @@ static void SideFrictionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1186,7 +1186,7 @@ static void SideFrictionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1243,7 +1243,7 @@ static void SideFrictionRCTrackSBendRight( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1304,7 +1304,7 @@ static void SideFrictionRCTrackLeftQuarterTurn3( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1347,7 +1347,7 @@ static void SideFrictionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1403,7 +1403,7 @@ static void SideFrictionRCTrackLeftQuarterTurn3( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1449,7 +1449,7 @@ static void SideFrictionRCTrackBrakes( break; } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1508,7 +1508,7 @@ static void SideFrictionRCTrackLeftEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1555,7 +1555,7 @@ static void SideFrictionRCTrackLeftEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1602,7 +1602,7 @@ static void SideFrictionRCTrackLeftEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1625,7 +1625,7 @@ static void SideFrictionRCTrackLeftEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1664,7 +1664,7 @@ static void SideFrictionRCTrackLeftEighthToDiag( { { 16, 0, height + 27 }, { 16, 16, 0 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1725,7 +1725,7 @@ static void SideFrictionRCTrackRightEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1772,7 +1772,7 @@ static void SideFrictionRCTrackRightEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1819,7 +1819,7 @@ static void SideFrictionRCTrackRightEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1842,7 +1842,7 @@ static void SideFrictionRCTrackRightEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1881,7 +1881,7 @@ static void SideFrictionRCTrackRightEighthToDiag( { { 16, 16, height + 27 }, { 16, 16, 0 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1935,7 +1935,7 @@ static void SideFrictionRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1995,7 +1995,7 @@ static void SideFrictionRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2055,7 +2055,7 @@ static void SideFrictionRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2081,7 +2081,7 @@ static void SideFrictionRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2117,7 +2117,7 @@ static void SideFrictionRCTrackDiag25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2154,7 +2154,7 @@ static void SideFrictionRCTrackDiag25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2191,7 +2191,7 @@ static void SideFrictionRCTrackDiag25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2217,7 +2217,7 @@ static void SideFrictionRCTrackDiag25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2253,7 +2253,7 @@ static void SideFrictionRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2313,7 +2313,7 @@ static void SideFrictionRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2373,7 +2373,7 @@ static void SideFrictionRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2399,7 +2399,7 @@ static void SideFrictionRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2435,7 +2435,7 @@ static void SideFrictionRCTrackDiag25DegUpToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2472,7 +2472,7 @@ static void SideFrictionRCTrackDiag25DegUpToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2509,7 +2509,7 @@ static void SideFrictionRCTrackDiag25DegUpToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2535,7 +2535,7 @@ static void SideFrictionRCTrackDiag25DegUpToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2571,7 +2571,7 @@ static void SideFrictionRCTrackDiag25DegDown( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2608,7 +2608,7 @@ static void SideFrictionRCTrackDiag25DegDown( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2645,7 +2645,7 @@ static void SideFrictionRCTrackDiag25DegDown( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2671,7 +2671,7 @@ static void SideFrictionRCTrackDiag25DegDown( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2804,7 +2804,7 @@ static void SideFrictionRCTrackDiagFlatTo25DegDown( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -2838,7 +2838,7 @@ static void SideFrictionRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2898,7 +2898,7 @@ static void SideFrictionRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2958,7 +2958,7 @@ static void SideFrictionRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2984,7 +2984,7 @@ static void SideFrictionRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3053,7 +3053,7 @@ static void SideFrictionRCTrack60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -3124,7 +3124,7 @@ static void SideFrictionRCTrack25DegUpTo60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3195,7 +3195,7 @@ static void SideFrictionRCTrack60DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3221,7 +3221,7 @@ static void SideFrictionRCTrackDiag60DegUp( { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -3241,7 +3241,7 @@ static void SideFrictionRCTrackDiag60DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -3261,7 +3261,7 @@ static void SideFrictionRCTrackDiag60DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -3274,7 +3274,7 @@ static void SideFrictionRCTrackDiag60DegUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -3303,7 +3303,7 @@ static void SideFrictionRCTrackDiag60DegUpTo25DegUp( { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3325,7 +3325,7 @@ static void SideFrictionRCTrackDiag60DegUpTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3347,7 +3347,7 @@ static void SideFrictionRCTrackDiag60DegUpTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3360,7 +3360,7 @@ static void SideFrictionRCTrackDiag60DegUpTo25DegUp( { -16, -16, height }, { { 0, 0, height }, { 16, 16, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3389,7 +3389,7 @@ static void SideFrictionRCTrackDiag25DegUpTo60DegUp( { -16 + 4, -16 + 2, height }, { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3410,7 +3410,7 @@ static void SideFrictionRCTrackDiag25DegUpTo60DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3431,7 +3431,7 @@ static void SideFrictionRCTrackDiag25DegUpTo60DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3444,7 +3444,7 @@ static void SideFrictionRCTrackDiag25DegUpTo60DegUp( { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp index 5a45542689..929677e950 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -86,7 +86,7 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -119,7 +119,7 @@ namespace SingleRailRC DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 4, 7); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -198,7 +198,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -277,7 +277,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -356,7 +356,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -447,7 +447,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -538,7 +538,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -617,7 +617,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -695,7 +695,7 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -751,7 +751,7 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -803,7 +803,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -842,7 +842,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -887,7 +887,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -918,7 +918,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -957,7 +957,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1008,7 +1008,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1041,7 +1041,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1070,7 +1070,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1103,7 +1103,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1143,7 +1143,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1194,7 +1194,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1224,7 +1224,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1253,13 +1253,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1299,7 +1299,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1343,7 +1343,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1373,7 +1373,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1402,13 +1402,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1448,7 +1448,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1503,7 +1503,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1532,7 +1532,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1561,7 +1561,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1626,7 +1626,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1648,7 +1648,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1661,7 +1661,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1674,7 +1674,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1703,7 +1703,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1726,7 +1726,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1740,7 +1740,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1754,7 +1754,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1784,7 +1784,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1822,7 +1822,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1851,7 +1851,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1880,7 +1880,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1945,7 +1945,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1983,7 +1983,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2012,7 +2012,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2041,7 +2041,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2106,7 +2106,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2144,7 +2144,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2173,7 +2173,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2202,7 +2202,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2267,7 +2267,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2305,7 +2305,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2334,7 +2334,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2363,7 +2363,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2428,7 +2428,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2466,7 +2466,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2494,7 +2494,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2522,7 +2522,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2586,7 +2586,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -2625,7 +2625,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2654,7 +2654,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2683,7 +2683,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2748,7 +2748,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2786,7 +2786,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -2815,7 +2815,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -2844,7 +2844,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -2909,7 +2909,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -2947,7 +2947,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2976,7 +2976,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3005,7 +3005,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3070,7 +3070,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3108,7 +3108,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3137,7 +3137,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3166,7 +3166,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3231,7 +3231,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3269,7 +3269,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -3298,7 +3298,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -3327,7 +3327,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -3392,7 +3392,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -3430,7 +3430,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3459,7 +3459,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3488,7 +3488,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3553,7 +3553,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3591,7 +3591,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3620,7 +3620,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3649,7 +3649,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3714,7 +3714,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3760,7 +3760,7 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3804,7 +3804,7 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3869,7 +3869,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3920,7 +3920,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3971,7 +3971,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -4022,7 +4022,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -4088,7 +4088,7 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4116,7 +4116,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4134,7 +4134,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4148,7 +4148,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4178,7 +4178,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4201,7 +4201,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4215,7 +4215,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4233,7 +4233,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4263,7 +4263,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4286,7 +4286,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4304,7 +4304,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4318,7 +4318,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4348,7 +4348,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4371,7 +4371,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4385,7 +4385,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4403,7 +4403,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4433,7 +4433,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4456,7 +4456,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4474,7 +4474,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4488,7 +4488,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4518,7 +4518,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4541,7 +4541,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4555,7 +4555,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4573,7 +4573,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4603,7 +4603,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4626,7 +4626,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4644,7 +4644,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4658,7 +4658,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4688,7 +4688,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4711,7 +4711,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4725,7 +4725,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4743,7 +4743,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4773,7 +4773,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4796,7 +4796,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4813,7 +4813,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4826,7 +4826,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4855,7 +4855,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -4879,7 +4879,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -4892,7 +4892,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -4909,7 +4909,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -4938,7 +4938,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -4962,7 +4962,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4980,7 +4980,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4994,7 +4994,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5024,7 +5024,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5047,7 +5047,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5061,7 +5061,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5079,7 +5079,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5109,7 +5109,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5132,7 +5132,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5146,7 +5146,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5160,7 +5160,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5190,7 +5190,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5213,7 +5213,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5227,7 +5227,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5241,7 +5241,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5271,7 +5271,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5322,7 +5322,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5357,7 +5357,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5404,7 +5404,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5463,7 +5463,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5500,7 +5500,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5533,7 +5533,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5570,7 +5570,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5618,7 +5618,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5673,7 +5673,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5707,7 +5707,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5740,13 +5740,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5790,7 +5790,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5838,7 +5838,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5872,7 +5872,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5905,13 +5905,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5955,7 +5955,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6019,7 +6019,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6068,7 +6068,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6115,7 +6115,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6170,7 +6170,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6233,7 +6233,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6270,7 +6270,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6303,7 +6303,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -6340,7 +6340,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6384,7 +6384,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6431,7 +6431,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6468,7 +6468,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6501,7 +6501,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -6538,7 +6538,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6582,7 +6582,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6644,7 +6644,7 @@ namespace SingleRailRC break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -6688,7 +6688,7 @@ namespace SingleRailRC break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_1, +56, TUNNEL_2); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -6744,7 +6744,7 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -6790,7 +6790,7 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -6856,7 +6856,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6904,7 +6904,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6952,7 +6952,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7000,7 +7000,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7073,7 +7073,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7118,7 +7118,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7163,7 +7163,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7208,7 +7208,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7281,7 +7281,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7326,7 +7326,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7388,7 +7388,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7436,7 +7436,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7484,7 +7484,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7532,7 +7532,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7605,7 +7605,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7654,7 +7654,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7701,7 +7701,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7756,7 +7756,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7819,7 +7819,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7856,7 +7856,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7889,7 +7889,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -7926,7 +7926,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7970,7 +7970,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8017,7 +8017,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8054,7 +8054,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8087,7 +8087,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8124,7 +8124,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8168,7 +8168,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8227,7 +8227,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8263,7 +8263,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8300,7 +8300,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8340,7 +8340,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8383,7 +8383,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8419,7 +8419,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8456,7 +8456,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8496,7 +8496,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8542,7 +8542,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8574,7 +8574,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8616,7 +8616,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8659,7 +8659,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8691,7 +8691,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8728,7 +8728,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8775,7 +8775,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8807,7 +8807,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8849,7 +8849,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8892,7 +8892,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8924,7 +8924,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8961,7 +8961,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9034,7 +9034,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9068,7 +9068,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9097,7 +9097,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -9130,7 +9130,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9173,7 +9173,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9216,7 +9216,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9250,7 +9250,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9279,7 +9279,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -9312,7 +9312,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9350,7 +9350,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9396,7 +9396,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9430,7 +9430,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9459,7 +9459,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -9492,7 +9492,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9541,7 +9541,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9584,7 +9584,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9618,7 +9618,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9647,7 +9647,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -9680,7 +9680,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9724,7 +9724,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9815,7 +9815,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9858,7 +9858,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -9908,7 +9908,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -9973,7 +9973,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -10016,7 +10016,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10066,7 +10066,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10124,7 +10124,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10159,7 +10159,7 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10189,7 +10189,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -10222,7 +10222,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10261,7 +10261,7 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -10296,7 +10296,7 @@ namespace SingleRailRC } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10340,7 +10340,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10373,7 +10373,7 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10406,7 +10406,7 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 10, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -10448,7 +10448,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -10493,7 +10493,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -10526,7 +10526,7 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 18, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -10559,7 +10559,7 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10601,7 +10601,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -10647,7 +10647,7 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -10690,7 +10690,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10718,7 +10718,7 @@ namespace SingleRailRC { 0, 0, height }, { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10747,7 +10747,7 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -10803,7 +10803,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10831,7 +10831,7 @@ namespace SingleRailRC { 0, 0, height }, { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10860,7 +10860,7 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -10932,7 +10932,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10975,7 +10975,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11004,7 +11004,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11014,7 +11014,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11082,7 +11082,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11137,7 +11137,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_BC | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11180,7 +11180,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11209,7 +11209,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11219,7 +11219,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11286,7 +11286,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -11357,7 +11357,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11390,7 +11390,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11433,7 +11433,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11463,7 +11463,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11496,7 +11496,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) @@ -11551,7 +11551,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11586,7 +11586,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_CC | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction), + kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11631,7 +11631,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11664,7 +11664,7 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11699,7 +11699,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_B4, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { @@ -11774,7 +11774,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -11804,7 +11804,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11850,7 +11850,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -11908,7 +11908,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -11938,7 +11938,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11984,7 +11984,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -12052,7 +12052,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12088,7 +12088,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12126,7 +12126,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -12134,7 +12134,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), + kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -12238,7 +12238,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12274,7 +12274,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12313,7 +12313,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -12321,7 +12321,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -12425,7 +12425,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12453,7 +12453,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12485,7 +12485,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12543,7 +12543,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12592,7 +12592,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12643,7 +12643,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12692,7 +12692,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12739,7 +12739,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12792,7 +12792,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12839,7 +12839,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12892,7 +12892,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12935,7 +12935,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12971,7 +12971,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13001,7 +13001,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13044,7 +13044,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13073,7 +13073,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13103,7 +13103,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13138,7 +13138,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13182,7 +13182,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13218,7 +13218,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13248,7 +13248,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13291,7 +13291,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13320,7 +13320,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13350,7 +13350,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13385,7 +13385,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13505,7 +13505,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -13596,7 +13596,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -13646,7 +13646,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13675,7 +13675,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13704,7 +13704,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -13769,7 +13769,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13807,7 +13807,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13836,7 +13836,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13865,7 +13865,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -13930,7 +13930,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13968,7 +13968,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13997,7 +13997,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14026,7 +14026,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14091,7 +14091,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14129,7 +14129,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -14158,7 +14158,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -14187,7 +14187,7 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -14252,13 +14252,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } - // SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4; + // kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; // b4 // c8 cc // b8 c4 bc @@ -14315,7 +14315,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14349,7 +14349,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14382,13 +14382,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14432,7 +14432,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14480,7 +14480,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14514,7 +14514,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14547,13 +14547,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14597,7 +14597,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14651,7 +14651,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14684,13 +14684,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14724,7 +14724,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14765,7 +14765,7 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14818,7 +14818,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14851,13 +14851,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14891,7 +14891,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14930,7 +14930,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14987,7 +14987,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15005,7 +15005,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -15019,7 +15019,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -15049,7 +15049,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15072,7 +15072,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15086,7 +15086,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -15104,7 +15104,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -15134,7 +15134,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15157,7 +15157,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15175,7 +15175,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15189,7 +15189,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15219,7 +15219,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15242,7 +15242,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15256,7 +15256,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15274,7 +15274,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15304,7 +15304,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15355,7 +15355,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15369,7 +15369,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15383,7 +15383,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15413,7 +15413,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15436,7 +15436,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15450,7 +15450,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15464,7 +15464,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15494,7 +15494,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15517,7 +15517,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15531,7 +15531,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15545,7 +15545,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15575,7 +15575,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15598,7 +15598,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15612,7 +15612,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15626,7 +15626,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15656,7 +15656,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15707,7 +15707,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15721,7 +15721,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15735,7 +15735,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15766,7 +15766,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15789,7 +15789,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15803,7 +15803,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15817,7 +15817,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15848,7 +15848,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15885,7 +15885,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15903,7 +15903,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15917,7 +15917,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15947,7 +15947,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15970,7 +15970,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15984,7 +15984,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -16002,7 +16002,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -16032,7 +16032,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -16055,7 +16055,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -16073,7 +16073,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -16087,7 +16087,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -16117,7 +16117,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -16140,7 +16140,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -16154,7 +16154,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -16172,7 +16172,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -16202,7 +16202,7 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -16277,7 +16277,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -16311,7 +16311,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16344,13 +16344,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -16394,7 +16394,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16442,7 +16442,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -16476,7 +16476,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16509,13 +16509,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -16559,7 +16559,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16613,7 +16613,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16646,13 +16646,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16686,7 +16686,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16725,7 +16725,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16778,7 +16778,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16811,13 +16811,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16851,7 +16851,7 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16890,7 +16890,7 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } diff --git a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp index a1d6373763..14140d8283 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -107,7 +107,7 @@ static void StandUpRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -142,7 +142,7 @@ static void StandUpRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -214,7 +214,7 @@ static void StandUpRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -290,7 +290,7 @@ static void StandUpRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -362,7 +362,7 @@ static void StandUpRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -450,7 +450,7 @@ static void StandUpRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -538,7 +538,7 @@ static void StandUpRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -610,7 +610,7 @@ static void StandUpRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -696,7 +696,7 @@ static void StandUpRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -724,7 +724,7 @@ static void StandUpRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -749,7 +749,7 @@ static void StandUpRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -777,7 +777,7 @@ static void StandUpRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -813,7 +813,7 @@ static void StandUpRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -859,7 +859,7 @@ static void StandUpRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -894,7 +894,7 @@ static void StandUpRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -929,7 +929,7 @@ static void StandUpRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -964,7 +964,7 @@ static void StandUpRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1009,7 +1009,7 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1041,7 +1041,7 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1070,7 +1070,7 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1102,7 +1102,7 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1145,7 +1145,7 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1198,7 +1198,7 @@ static void StandUpRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1240,7 +1240,7 @@ static void StandUpRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1282,7 +1282,7 @@ static void StandUpRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1324,7 +1324,7 @@ static void StandUpRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1391,7 +1391,7 @@ static void StandUpRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1464,7 +1464,7 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1517,7 +1517,7 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1567,7 +1567,7 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1620,7 +1620,7 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1683,7 +1683,7 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1750,7 +1750,7 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1803,7 +1803,7 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1853,7 +1853,7 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1906,7 +1906,7 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1969,7 +1969,7 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2027,7 +2027,7 @@ static void StandUpRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2056,7 +2056,7 @@ static void StandUpRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2086,7 +2086,7 @@ static void StandUpRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2122,7 +2122,7 @@ static void StandUpRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2162,7 +2162,7 @@ static void StandUpRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2192,7 +2192,7 @@ static void StandUpRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2223,7 +2223,7 @@ static void StandUpRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2259,7 +2259,7 @@ static void StandUpRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2300,7 +2300,7 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2334,7 +2334,7 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2359,7 +2359,7 @@ static void StandUpRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2384,7 +2384,7 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2416,7 +2416,7 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2441,7 +2441,7 @@ static void StandUpRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2474,7 +2474,7 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2511,7 +2511,7 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2779,7 +2779,7 @@ static void StandUpRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2806,7 +2806,7 @@ static void StandUpRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2841,7 +2841,7 @@ static void StandUpRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2897,7 +2897,7 @@ static void StandUpRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2928,7 +2928,7 @@ static void StandUpRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2970,7 +2970,7 @@ static void StandUpRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3046,7 +3046,7 @@ static void StandUpRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3114,7 +3114,7 @@ static void StandUpRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3181,7 +3181,7 @@ static void StandUpRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3261,7 +3261,7 @@ static void StandUpRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3319,7 +3319,7 @@ static void StandUpRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3352,7 +3352,7 @@ static void StandUpRCTrackHalfLoopUp( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3378,7 +3378,7 @@ static void StandUpRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3407,7 +3407,7 @@ static void StandUpRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3485,7 +3485,7 @@ static void StandUpRCTrackLeftCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3514,7 +3514,7 @@ static void StandUpRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3571,7 +3571,7 @@ static void StandUpRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3599,7 +3599,7 @@ static void StandUpRCTrackRightCorkscrewUp( { { 6, 6, height + 10 }, { 20, 20, 3 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3628,7 +3628,7 @@ static void StandUpRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3704,7 +3704,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3736,7 +3736,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3778,7 +3778,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3821,7 +3821,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3853,7 +3853,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3890,7 +3890,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3938,7 +3938,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3970,7 +3970,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4012,7 +4012,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4055,7 +4055,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4087,7 +4087,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4124,7 +4124,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4200,7 +4200,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4233,7 +4233,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4262,7 +4262,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4294,7 +4294,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4337,7 +4337,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4380,7 +4380,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4413,7 +4413,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4442,7 +4442,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4474,7 +4474,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4512,7 +4512,7 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4560,7 +4560,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4593,7 +4593,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4622,7 +4622,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4654,7 +4654,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4697,7 +4697,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4740,7 +4740,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4773,7 +4773,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4802,7 +4802,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4834,7 +4834,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4872,7 +4872,7 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4932,7 +4932,7 @@ static void StandUpRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4968,7 +4968,7 @@ static void StandUpRCTrackOnRidePhoto( } TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -5010,7 +5010,7 @@ static void StandUpRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5039,7 +5039,7 @@ static void StandUpRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5068,13 +5068,13 @@ static void StandUpRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5111,7 +5111,7 @@ static void StandUpRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5156,7 +5156,7 @@ static void StandUpRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5185,7 +5185,7 @@ static void StandUpRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5214,13 +5214,13 @@ static void StandUpRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5257,7 +5257,7 @@ static void StandUpRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5320,7 +5320,7 @@ static void StandUpRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5349,7 +5349,7 @@ static void StandUpRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5378,13 +5378,13 @@ static void StandUpRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5421,7 +5421,7 @@ static void StandUpRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5466,7 +5466,7 @@ static void StandUpRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5495,7 +5495,7 @@ static void StandUpRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5524,13 +5524,13 @@ static void StandUpRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5567,7 +5567,7 @@ static void StandUpRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5623,7 +5623,7 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5650,7 +5650,7 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5677,7 +5677,7 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5736,7 +5736,7 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5811,7 +5811,7 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5838,7 +5838,7 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5865,7 +5865,7 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5924,7 +5924,7 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5961,7 +5961,7 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5988,7 +5988,7 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6015,7 +6015,7 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6076,7 +6076,7 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6113,7 +6113,7 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6140,7 +6140,7 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6167,7 +6167,7 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6226,7 +6226,7 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6263,7 +6263,7 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6290,7 +6290,7 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6317,7 +6317,7 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6378,7 +6378,7 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6415,7 +6415,7 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6442,7 +6442,7 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6469,7 +6469,7 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6530,7 +6530,7 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6567,7 +6567,7 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6594,7 +6594,7 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6621,7 +6621,7 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6680,7 +6680,7 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6717,7 +6717,7 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6744,7 +6744,7 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6771,7 +6771,7 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6830,7 +6830,7 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6867,7 +6867,7 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6894,7 +6894,7 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6921,7 +6921,7 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6982,7 +6982,7 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -7019,7 +7019,7 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7045,7 +7045,7 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7071,7 +7071,7 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7129,7 +7129,7 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -7167,7 +7167,7 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7194,7 +7194,7 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7221,7 +7221,7 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7282,7 +7282,7 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7319,7 +7319,7 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7346,7 +7346,7 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7373,7 +7373,7 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7432,7 +7432,7 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7469,7 +7469,7 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7496,7 +7496,7 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7523,7 +7523,7 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7582,7 +7582,7 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7605,7 +7605,7 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7621,7 +7621,7 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7634,7 +7634,7 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7661,7 +7661,7 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7684,7 +7684,7 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7697,7 +7697,7 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7713,7 +7713,7 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7740,7 +7740,7 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7763,7 +7763,7 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7779,7 +7779,7 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7792,7 +7792,7 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7819,7 +7819,7 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7842,7 +7842,7 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7855,7 +7855,7 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7871,7 +7871,7 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7898,7 +7898,7 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7921,7 +7921,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7937,7 +7937,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7950,7 +7950,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7977,7 +7977,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8000,7 +8000,7 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8013,7 +8013,7 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8029,7 +8029,7 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8056,7 +8056,7 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8079,7 +8079,7 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8095,7 +8095,7 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8108,7 +8108,7 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8135,7 +8135,7 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8158,7 +8158,7 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8171,7 +8171,7 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8187,7 +8187,7 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8214,7 +8214,7 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8237,7 +8237,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8252,7 +8252,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8264,7 +8264,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8290,7 +8290,7 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8314,7 +8314,7 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -8326,7 +8326,7 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -8341,7 +8341,7 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -8367,7 +8367,7 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -8391,7 +8391,7 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8407,7 +8407,7 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8420,7 +8420,7 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8447,7 +8447,7 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8470,7 +8470,7 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8483,7 +8483,7 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8499,7 +8499,7 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8526,7 +8526,7 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8549,7 +8549,7 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8562,7 +8562,7 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8575,7 +8575,7 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8602,7 +8602,7 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8625,7 +8625,7 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8638,7 +8638,7 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8651,7 +8651,7 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8678,7 +8678,7 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8701,7 +8701,7 @@ static void StandUpRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/Steeplechase.cpp b/src/openrct2/ride/coaster/Steeplechase.cpp index c8c3114c32..927e25f993 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -72,7 +72,7 @@ static void SteeplechaseTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -96,7 +96,7 @@ static void SteeplechaseTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -174,7 +174,7 @@ static void SteeplechaseTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -252,7 +252,7 @@ static void SteeplechaseTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -330,7 +330,7 @@ static void SteeplechaseTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -398,7 +398,7 @@ static void SteeplechaseTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -426,7 +426,7 @@ static void SteeplechaseTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -451,7 +451,7 @@ static void SteeplechaseTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -479,7 +479,7 @@ static void SteeplechaseTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -521,7 +521,7 @@ static void SteeplechaseTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -576,7 +576,7 @@ static void SteeplechaseTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -606,7 +606,7 @@ static void SteeplechaseTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -637,7 +637,7 @@ static void SteeplechaseTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -679,7 +679,7 @@ static void SteeplechaseTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -725,7 +725,7 @@ static void SteeplechaseTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -756,7 +756,7 @@ static void SteeplechaseTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -788,7 +788,7 @@ static void SteeplechaseTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -830,7 +830,7 @@ static void SteeplechaseTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -876,7 +876,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -903,7 +903,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -944,7 +944,7 @@ static void SteeplechaseTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -983,7 +983,7 @@ static void SteeplechaseTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1031,7 +1031,7 @@ static void SteeplechaseTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1060,7 +1060,7 @@ static void SteeplechaseTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1089,13 +1089,13 @@ static void SteeplechaseTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1132,7 +1132,7 @@ static void SteeplechaseTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1183,7 +1183,7 @@ static void SteeplechaseTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1212,7 +1212,7 @@ static void SteeplechaseTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1241,13 +1241,13 @@ static void SteeplechaseTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1285,7 +1285,7 @@ static void SteeplechaseTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1341,7 +1341,7 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1368,7 +1368,7 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1395,7 +1395,7 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1456,7 +1456,7 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1512,7 +1512,7 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1539,7 +1539,7 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1566,7 +1566,7 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1627,7 +1627,7 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1664,7 +1664,7 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1691,7 +1691,7 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1718,7 +1718,7 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1779,7 +1779,7 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1816,7 +1816,7 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1843,7 +1843,7 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1870,7 +1870,7 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1931,7 +1931,7 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1968,7 +1968,7 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1995,7 +1995,7 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2022,7 +2022,7 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2083,7 +2083,7 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2120,7 +2120,7 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2146,7 +2146,7 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2172,7 +2172,7 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2232,7 +2232,7 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -2270,7 +2270,7 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2297,7 +2297,7 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2324,7 +2324,7 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2385,7 +2385,7 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2415,7 +2415,7 @@ static void SteeplechaseTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index 5f4a5b60b5..85558214c5 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -61,7 +61,7 @@ static void SuspendedSwingingRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -96,7 +96,7 @@ static void SuspendedSwingingRCTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Tubes); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -159,7 +159,7 @@ static void SuspendedSwingingRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -233,7 +233,7 @@ static void SuspendedSwingingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -296,7 +296,7 @@ static void SuspendedSwingingRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -376,7 +376,7 @@ static void SuspendedSwingingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -451,7 +451,7 @@ static void SuspendedSwingingRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -547,7 +547,7 @@ static void SuspendedSwingingRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -665,7 +665,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -703,7 +703,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -731,7 +731,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -761,7 +761,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -791,7 +791,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -848,7 +848,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -884,7 +884,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -909,7 +909,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -938,7 +938,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -964,7 +964,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1012,7 +1012,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1048,7 +1048,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1073,7 +1073,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1102,7 +1102,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1128,7 +1128,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1194,7 +1194,7 @@ static void SuspendedSwingingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1227,7 +1227,7 @@ static void SuspendedSwingingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -1268,7 +1268,7 @@ static void SuspendedSwingingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1308,7 +1308,7 @@ static void SuspendedSwingingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1355,7 +1355,7 @@ static void SuspendedSwingingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1388,7 +1388,7 @@ static void SuspendedSwingingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1429,7 +1429,7 @@ static void SuspendedSwingingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -1469,7 +1469,7 @@ static void SuspendedSwingingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1520,7 +1520,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1558,7 +1558,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1587,7 +1587,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1644,7 +1644,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1683,7 +1683,7 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1731,7 +1731,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1770,7 +1770,7 @@ static void SuspendedSwingingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1829,7 +1829,7 @@ static void SuspendedSwingingRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1873,7 +1873,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -1913,7 +1913,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1942,7 +1942,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1974,7 +1974,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2004,7 +2004,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2056,7 +2056,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -2096,7 +2096,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2125,7 +2125,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2157,7 +2157,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2187,7 +2187,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2239,7 +2239,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2279,7 +2279,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2308,7 +2308,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2340,7 +2340,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2370,7 +2370,7 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -2422,7 +2422,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2462,7 +2462,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2491,7 +2491,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2523,7 +2523,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2553,7 +2553,7 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -2605,7 +2605,7 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2641,7 +2641,7 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2670,13 +2670,13 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2707,7 +2707,7 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2770,7 +2770,7 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2806,7 +2806,7 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2835,13 +2835,13 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2872,7 +2872,7 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -2951,7 +2951,7 @@ static void SuspendedSwingingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2978,7 +2978,7 @@ static void SuspendedSwingingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3005,7 +3005,7 @@ static void SuspendedSwingingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3033,7 +3033,7 @@ static void SuspendedSwingingRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3093,7 +3093,7 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3120,7 +3120,7 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3147,7 +3147,7 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3175,7 +3175,7 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3221,7 +3221,7 @@ static void SuspendedSwingingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -3234,7 +3234,7 @@ static void SuspendedSwingingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -3247,7 +3247,7 @@ static void SuspendedSwingingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -3261,7 +3261,7 @@ static void SuspendedSwingingRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3322,7 +3322,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -3349,7 +3349,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -3376,7 +3376,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -3404,7 +3404,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3450,7 +3450,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3463,7 +3463,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3476,7 +3476,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -3490,7 +3490,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3537,7 +3537,7 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3550,7 +3550,7 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3563,7 +3563,7 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -3577,7 +3577,7 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3638,7 +3638,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3665,7 +3665,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3692,7 +3692,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3720,7 +3720,7 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3780,7 +3780,7 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3807,7 +3807,7 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3834,7 +3834,7 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3862,7 +3862,7 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -3908,7 +3908,7 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -3921,7 +3921,7 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -3934,7 +3934,7 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -3947,7 +3947,7 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } @@ -3984,7 +3984,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -4010,7 +4010,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -4036,7 +4036,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -4063,7 +4063,7 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4109,7 +4109,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -4122,7 +4122,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4135,7 +4135,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -4149,7 +4149,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4196,7 +4196,7 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -4209,7 +4209,7 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4222,7 +4222,7 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -4236,7 +4236,7 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4296,7 +4296,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4323,7 +4323,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -4350,7 +4350,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -4378,7 +4378,7 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -4429,7 +4429,7 @@ static void SuspendedSwingingRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index baaeab5211..4e684ab78b 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -245,7 +245,7 @@ static void PaintVirginiaReelTrackFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -305,7 +305,7 @@ static void PaintVirginiaReelTrack25DegUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -360,7 +360,7 @@ static void PaintVirginiaReelTrackFlatTo25DegUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -420,7 +420,7 @@ static void PaintVirginiaReelTrack25DegUpToFlat( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -480,7 +480,7 @@ static void PaintVirginiaReelStation( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -498,13 +498,13 @@ static void PaintVirginiaReelTrackLeftQuarterTurn3Tiles( { case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; case 0: case 3: WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(SEGMENTS_ALL, direction), 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); break; } @@ -559,7 +559,7 @@ static void PaintVirginiaReelTrackLeftQuarterTurn1Tile( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index 588daa88ad..cb127cd801 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -185,7 +185,7 @@ static void WildMouseTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -220,7 +220,7 @@ static void WildMouseTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -253,7 +253,7 @@ static void WildMouseTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -301,7 +301,7 @@ static void WildMouseTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -334,7 +334,7 @@ static void WildMouseTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -382,7 +382,7 @@ static void WildMouseTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -430,7 +430,7 @@ static void WildMouseTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -463,7 +463,7 @@ static void WildMouseTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -558,13 +558,13 @@ static void WildMouseTrackRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0; + blockedSegments = kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide; break; case 2: - blockedSegments = SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; case 3: - blockedSegments = SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4; + blockedSegments = kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -619,10 +619,10 @@ static void WildMouseTrackRightQuarterTurn325DegDown( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0; + blockedSegments = kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide; break; case 3: - blockedSegments = SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4; + blockedSegments = kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -697,10 +697,10 @@ static void WildMouseTrackRightQuarterTurn325DegUp( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0; + blockedSegments = kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide; break; case 3: - blockedSegments = SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4; + blockedSegments = kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -755,7 +755,7 @@ static void WildMouseTrackLeftQuarterTurn1( MetalASupportsPaintSetup(session, MetalSupportType::Tubes, MetalSupportPlace::Centre, -1, height, session.SupportColours); TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -811,7 +811,7 @@ static void WildMouseTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -867,7 +867,7 @@ static void WildMouseTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -901,7 +901,7 @@ static void WildMouseTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -926,7 +926,7 @@ static void WildMouseTrackRotationControlToggle( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -945,7 +945,7 @@ static void WildMouseTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index a2814c3439..78620cdce9 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -502,7 +502,7 @@ static void WoodenRCTrackFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -536,7 +536,7 @@ static void WoodenRCTrackStation( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); TrackPaintUtilDrawStation2(session, ride, direction, height, trackElement, 9, 11); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -624,7 +624,7 @@ static void WoodenRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -692,7 +692,7 @@ static void WoodenRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -780,7 +780,7 @@ static void WoodenRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -893,7 +893,7 @@ static void WoodenRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -1007,7 +1007,7 @@ static void WoodenRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -1095,7 +1095,7 @@ static void WoodenRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1471,27 +1471,27 @@ static void WoodenRCTrackRightQuarterTurn5( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 2: - blockedSegments = SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 - | SEGMENT_D4; + blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide + | kSegmentBottomRightSide; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 5: - blockedSegments = SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; case 6: - blockedSegments = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC - | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide + | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -1552,7 +1552,7 @@ static void WoodenRCTrackFlatToLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1601,7 +1601,7 @@ static void WoodenRCTrackFlatToRightBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1941,27 +1941,27 @@ static void WoodenRCTrackBankedRightQuarterTurn5( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 2: - blockedSegments = SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 - | SEGMENT_D4; + blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide + | kSegmentBottomRightSide; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 5: - blockedSegments = SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; case 6: - blockedSegments = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC - | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide + | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -2030,7 +2030,7 @@ static void WoodenRCTrackLeftBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2087,7 +2087,7 @@ static void WoodenRCTrackRightBankTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2144,7 +2144,7 @@ static void WoodenRCTrack25DegUpToLeftBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2201,7 +2201,7 @@ static void WoodenRCTrack25DegUpToRightBank( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2260,7 +2260,7 @@ static void WoodenRCTrackLeftBank( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2339,12 +2339,12 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2405,7 +2405,7 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2468,14 +2468,14 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -2542,7 +2542,7 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2625,7 +2625,7 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2697,12 +2697,12 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2763,7 +2763,7 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2826,14 +2826,14 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -2900,7 +2900,7 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2979,7 +2979,7 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3073,7 +3073,7 @@ static void WoodenRCTrackSBendLeft( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3134,7 +3134,7 @@ static void WoodenRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3196,7 +3196,7 @@ static void WoodenRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3265,7 +3265,7 @@ static void WoodenRCTrackSBendLeft( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3339,7 +3339,7 @@ static void WoodenRCTrackSBendRight( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3400,7 +3400,7 @@ static void WoodenRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3462,7 +3462,7 @@ static void WoodenRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3531,7 +3531,7 @@ static void WoodenRCTrackSBendRight( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3573,7 +3573,7 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -3607,7 +3607,7 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3636,7 +3636,7 @@ static void WoodenRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -3665,7 +3665,7 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3701,7 +3701,7 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3730,7 +3730,7 @@ static void WoodenRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -3763,7 +3763,7 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3800,7 +3800,7 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -4119,7 +4119,7 @@ static void WoodenRCTrackLeftQuarterTurn3( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4174,7 +4174,7 @@ static void WoodenRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4242,7 +4242,7 @@ static void WoodenRCTrackLeftQuarterTurn3( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4332,7 +4332,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4393,7 +4393,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4467,7 +4467,7 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4551,7 +4551,7 @@ static void WoodenRCTrackLeftQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4559,7 +4559,7 @@ static void WoodenRCTrackLeftQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4633,7 +4633,7 @@ static void WoodenRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4707,7 +4707,7 @@ static void WoodenRCTrackRightQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4715,7 +4715,7 @@ static void WoodenRCTrackRightQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4789,7 +4789,7 @@ static void WoodenRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4890,9 +4890,9 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4973,7 +4973,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5048,9 +5048,9 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5126,9 +5126,9 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5209,7 +5209,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5279,9 +5279,9 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5363,9 +5363,9 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5446,7 +5446,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5521,9 +5521,9 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5599,9 +5599,9 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5681,7 +5681,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5751,9 +5751,9 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5860,15 +5860,15 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5929,7 +5929,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5990,14 +5990,14 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -6058,7 +6058,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6128,9 +6128,9 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6200,15 +6200,15 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -6269,7 +6269,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6330,14 +6330,14 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -6398,7 +6398,7 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6463,9 +6463,9 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6541,15 +6541,15 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6610,7 +6610,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6671,14 +6671,14 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -6739,7 +6739,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6809,9 +6809,9 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6881,15 +6881,15 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_CC, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -6950,7 +6950,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7011,14 +7011,14 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -7079,7 +7079,7 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7144,9 +7144,9 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_D4, direction), 48, 0x20); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7250,7 +7250,7 @@ static void WoodenRCTrackLeftQuarterTurn160DegUp( break; } TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -7320,7 +7320,7 @@ static void WoodenRCTrackRightQuarterTurn160DegUp( break; } TrackPaintUtilRightQuarterTurn1TileTunnel(session, direction, height, -8, TUNNEL_SQUARE_7, +56, TUNNEL_SQUARE_8); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -7361,7 +7361,7 @@ static void WoodenRCTrackBrakes( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -7438,7 +7438,7 @@ static void WoodenRCTrack25DegUpLeftBanked( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7515,7 +7515,7 @@ static void WoodenRCTrack25DegUpRightBanked( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7564,7 +7564,7 @@ static void WoodenRCTrackOnRidePhoto( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); TrackPaintUtilOnridePhotoSmallPaint(session, direction, height + 16, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7701,7 +7701,7 @@ static void WoodenRCTrackWaterSplash( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7806,7 +7806,7 @@ static void WoodenRCTrackWaterSplash( } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7865,7 +7865,7 @@ static void WoodenRCTrackWaterSplash( } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7970,7 +7970,7 @@ static void WoodenRCTrackWaterSplash( } WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8076,7 +8076,7 @@ static void WoodenRCTrackWaterSplash( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8150,7 +8150,7 @@ static void WoodenRCTrackLeftEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8209,7 +8209,7 @@ static void WoodenRCTrackLeftEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8268,7 +8268,7 @@ static void WoodenRCTrackLeftEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8291,7 +8291,7 @@ static void WoodenRCTrackLeftEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8342,7 +8342,7 @@ static void WoodenRCTrackLeftEighthToDiag( { { 16, 0, height + 27 }, { 16, 16, 0 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8416,7 +8416,7 @@ static void WoodenRCTrackRightEighthToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8475,7 +8475,7 @@ static void WoodenRCTrackRightEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8534,7 +8534,7 @@ static void WoodenRCTrackRightEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8557,7 +8557,7 @@ static void WoodenRCTrackRightEighthToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8608,7 +8608,7 @@ static void WoodenRCTrackRightEighthToDiag( { { 16, 16, height }, { 16, 16, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8702,7 +8702,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8761,7 +8761,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8820,7 +8820,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8843,7 +8843,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8894,7 +8894,7 @@ static void WoodenRCTrackLeftEighthBankToDiag( { { 16, 0, height + 27 }, { 16, 16, 0 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8968,7 +8968,7 @@ static void WoodenRCTrackRightEighthBankToDiag( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9027,7 +9027,7 @@ static void WoodenRCTrackRightEighthBankToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9086,7 +9086,7 @@ static void WoodenRCTrackRightEighthBankToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9109,7 +9109,7 @@ static void WoodenRCTrackRightEighthBankToDiag( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -9160,7 +9160,7 @@ static void WoodenRCTrackRightEighthBankToDiag( { { 16, 16, height }, { 16, 16, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9638,7 +9638,7 @@ static void WoodenRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9710,7 +9710,7 @@ static void WoodenRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9782,7 +9782,7 @@ static void WoodenRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9814,7 +9814,7 @@ static void WoodenRCTrackDiagFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9857,7 +9857,7 @@ static void WoodenRCTrackDiag25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9907,7 +9907,7 @@ static void WoodenRCTrackDiag25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9956,7 +9956,7 @@ static void WoodenRCTrackDiag25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9988,7 +9988,7 @@ static void WoodenRCTrackDiag25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10014,7 +10014,7 @@ static void WoodenRCTrackDiag60DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -10038,7 +10038,7 @@ static void WoodenRCTrackDiag60DegUp( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -10064,7 +10064,7 @@ static void WoodenRCTrackDiag60DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -10079,7 +10079,7 @@ static void WoodenRCTrackDiag60DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -10122,7 +10122,7 @@ static void WoodenRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10194,7 +10194,7 @@ static void WoodenRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10266,7 +10266,7 @@ static void WoodenRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10298,7 +10298,7 @@ static void WoodenRCTrackDiagFlatTo25DegUp( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10324,7 +10324,7 @@ static void WoodenRCTrackDiag25DegUpTo60DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10348,7 +10348,7 @@ static void WoodenRCTrackDiag25DegUpTo60DegUp( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10374,7 +10374,7 @@ static void WoodenRCTrackDiag25DegUpTo60DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10389,7 +10389,7 @@ static void WoodenRCTrackDiag25DegUpTo60DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10415,7 +10415,7 @@ static void WoodenRCTrackDiag60DegUpTo25DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10439,7 +10439,7 @@ static void WoodenRCTrackDiag60DegUpTo25DegUp( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10463,7 +10463,7 @@ static void WoodenRCTrackDiag60DegUpTo25DegUp( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10478,7 +10478,7 @@ static void WoodenRCTrackDiag60DegUpTo25DegUp( { { 0, 0, height }, { 16, 16, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10521,7 +10521,7 @@ static void WoodenRCTrackDiag25DegUpToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10571,7 +10571,7 @@ static void WoodenRCTrackDiag25DegUpToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10620,7 +10620,7 @@ static void WoodenRCTrackDiag25DegUpToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10652,7 +10652,7 @@ static void WoodenRCTrackDiag25DegUpToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10695,7 +10695,7 @@ static void WoodenRCTrackDiag25DegDown( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10745,7 +10745,7 @@ static void WoodenRCTrackDiag25DegDown( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10794,7 +10794,7 @@ static void WoodenRCTrackDiag25DegDown( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10826,7 +10826,7 @@ static void WoodenRCTrackDiag25DegDown( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10852,7 +10852,7 @@ static void WoodenRCTrackDiag60DegDown( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -10876,7 +10876,7 @@ static void WoodenRCTrackDiag60DegDown( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -10900,7 +10900,7 @@ static void WoodenRCTrackDiag60DegDown( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -10915,7 +10915,7 @@ static void WoodenRCTrackDiag60DegDown( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -11086,7 +11086,7 @@ static void WoodenRCTrackDiagFlatTo25DegDown( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -11110,7 +11110,7 @@ static void WoodenRCTrackDiag25DegDownTo60DegDown( { { 0, 0, height }, { 16, 16, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11134,7 +11134,7 @@ static void WoodenRCTrackDiag25DegDownTo60DegDown( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11158,7 +11158,7 @@ static void WoodenRCTrackDiag25DegDownTo60DegDown( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11173,7 +11173,7 @@ static void WoodenRCTrackDiag25DegDownTo60DegDown( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -11199,7 +11199,7 @@ static void WoodenRCTrackDiag60DegDownTo25DegDown( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11223,7 +11223,7 @@ static void WoodenRCTrackDiag60DegDownTo25DegDown( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11247,7 +11247,7 @@ static void WoodenRCTrackDiag60DegDownTo25DegDown( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11262,7 +11262,7 @@ static void WoodenRCTrackDiag60DegDownTo25DegDown( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -11305,7 +11305,7 @@ static void WoodenRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11377,7 +11377,7 @@ static void WoodenRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11449,7 +11449,7 @@ static void WoodenRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11481,7 +11481,7 @@ static void WoodenRCTrackDiag25DegDownToFlat( break; } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11507,7 +11507,7 @@ static void WoodenRCTrackDiagFlatToLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11542,7 +11542,7 @@ static void WoodenRCTrackDiagFlatToLeftBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11577,7 +11577,7 @@ static void WoodenRCTrackDiagFlatToLeftBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11592,7 +11592,7 @@ static void WoodenRCTrackDiagFlatToLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -11618,7 +11618,7 @@ static void WoodenRCTrackDiagFlatToRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11653,7 +11653,7 @@ static void WoodenRCTrackDiagFlatToRightBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11688,7 +11688,7 @@ static void WoodenRCTrackDiagFlatToRightBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11703,7 +11703,7 @@ static void WoodenRCTrackDiagFlatToRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -11729,7 +11729,7 @@ static void WoodenRCTrackDiagLeftBankToFlat( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11764,7 +11764,7 @@ static void WoodenRCTrackDiagLeftBankToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11799,7 +11799,7 @@ static void WoodenRCTrackDiagLeftBankToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11814,7 +11814,7 @@ static void WoodenRCTrackDiagLeftBankToFlat( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -11840,7 +11840,7 @@ static void WoodenRCTrackDiagRightBankToFlat( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11875,7 +11875,7 @@ static void WoodenRCTrackDiagRightBankToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11910,7 +11910,7 @@ static void WoodenRCTrackDiagRightBankToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11925,7 +11925,7 @@ static void WoodenRCTrackDiagRightBankToFlat( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -11951,7 +11951,7 @@ static void WoodenRCTrackDiagLeftBankTo25DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11986,7 +11986,7 @@ static void WoodenRCTrackDiagLeftBankTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12021,7 +12021,7 @@ static void WoodenRCTrackDiagLeftBankTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12036,7 +12036,7 @@ static void WoodenRCTrackDiagLeftBankTo25DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12062,7 +12062,7 @@ static void WoodenRCTrackDiagRightBankTo25DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12097,7 +12097,7 @@ static void WoodenRCTrackDiagRightBankTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12132,7 +12132,7 @@ static void WoodenRCTrackDiagRightBankTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12147,7 +12147,7 @@ static void WoodenRCTrackDiagRightBankTo25DegUp( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12173,7 +12173,7 @@ static void WoodenRCTrackDiag25DegUpToLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12197,7 +12197,7 @@ static void WoodenRCTrackDiag25DegUpToLeftBank( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -12221,7 +12221,7 @@ static void WoodenRCTrackDiag25DegUpToLeftBank( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -12236,7 +12236,7 @@ static void WoodenRCTrackDiag25DegUpToLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -12262,7 +12262,7 @@ static void WoodenRCTrackDiag25DegUpToRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12286,7 +12286,7 @@ static void WoodenRCTrackDiag25DegUpToRightBank( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -12310,7 +12310,7 @@ static void WoodenRCTrackDiag25DegUpToRightBank( WoodenBSupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner2, direction, height + 16, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -12325,7 +12325,7 @@ static void WoodenRCTrackDiag25DegUpToRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -12413,7 +12413,7 @@ static void WoodenRCTrackDiagLeftBankTo25DegDown( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -12497,7 +12497,7 @@ static void WoodenRCTrackDiagRightBankTo25DegDown( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -12521,7 +12521,7 @@ static void WoodenRCTrackDiag25DegDownToLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12556,7 +12556,7 @@ static void WoodenRCTrackDiag25DegDownToLeftBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12591,7 +12591,7 @@ static void WoodenRCTrackDiag25DegDownToLeftBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12606,7 +12606,7 @@ static void WoodenRCTrackDiag25DegDownToLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12632,7 +12632,7 @@ static void WoodenRCTrackDiag25DegDownToRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12667,7 +12667,7 @@ static void WoodenRCTrackDiag25DegDownToRightBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12702,7 +12702,7 @@ static void WoodenRCTrackDiag25DegDownToRightBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12717,7 +12717,7 @@ static void WoodenRCTrackDiag25DegDownToRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12743,7 +12743,7 @@ static void WoodenRCTrackDiagLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12778,7 +12778,7 @@ static void WoodenRCTrackDiagLeftBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12813,7 +12813,7 @@ static void WoodenRCTrackDiagLeftBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12828,7 +12828,7 @@ static void WoodenRCTrackDiagLeftBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12854,7 +12854,7 @@ static void WoodenRCTrackDiagRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12889,7 +12889,7 @@ static void WoodenRCTrackDiagRightBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12924,7 +12924,7 @@ static void WoodenRCTrackDiagRightBank( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner1, height, session.SupportColours); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12939,7 +12939,7 @@ static void WoodenRCTrackDiagRightBank( { { -16, -16, height }, { 32, 32, 2 } }); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -13013,7 +13013,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13021,7 +13021,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13095,7 +13095,7 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13169,7 +13169,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13177,7 +13177,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13251,7 +13251,7 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13331,7 +13331,7 @@ static void WoodenRCTrackLeftQuarterTurn325DegDownToLeftBank( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13339,7 +13339,7 @@ static void WoodenRCTrackLeftQuarterTurn325DegDownToLeftBank( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13407,7 +13407,7 @@ static void WoodenRCTrackLeftQuarterTurn325DegDownToLeftBank( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13487,7 +13487,7 @@ static void WoodenRCTrackRightQuarterTurn325DegDownToRightBank( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13495,7 +13495,7 @@ static void WoodenRCTrackRightQuarterTurn325DegDownToRightBank( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13563,7 +13563,7 @@ static void WoodenRCTrackRightQuarterTurn325DegDownToRightBank( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13583,7 +13583,7 @@ static void WoodenRCTrackBlockBrakes( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -13655,7 +13655,7 @@ static void WoodenRCTrackLeftBankedQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13663,7 +13663,7 @@ static void WoodenRCTrackLeftBankedQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13737,7 +13737,7 @@ static void WoodenRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13811,7 +13811,7 @@ static void WoodenRCTrackRightBankedQuarterTurn325DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13819,7 +13819,7 @@ static void WoodenRCTrackRightBankedQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13893,7 +13893,7 @@ static void WoodenRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13987,12 +13987,12 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14053,7 +14053,7 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14116,14 +14116,14 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -14190,7 +14190,7 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14269,7 +14269,7 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14341,12 +14341,12 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14407,7 +14407,7 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14470,14 +14470,14 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -14544,7 +14544,7 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14623,7 +14623,7 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelLeft(session, height + 8, TUNNEL_SQUARE_8); break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14712,7 +14712,7 @@ static void WoodenRCTrack25DegUpToLeftBanked25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -14777,7 +14777,7 @@ static void WoodenRCTrack25DegUpToRightBanked25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -14842,7 +14842,7 @@ static void WoodenRCTrackLeftBanked25DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -14907,7 +14907,7 @@ static void WoodenRCTrackRightBanked25DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -15022,7 +15022,7 @@ static void WoodenRCTrackLeftBankedFlatToLeftBanked25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -15099,7 +15099,7 @@ static void WoodenRCTrackRightBankedFlatToRightBanked25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -15176,7 +15176,7 @@ static void WoodenRCTrackLeftBanked25DegUpToLeftBankedFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -15253,7 +15253,7 @@ static void WoodenRCTrackRightBanked25DegUpToRightBankedFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -15370,7 +15370,7 @@ static void WoodenRCTrackFlatToLeftBanked25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -15447,7 +15447,7 @@ static void WoodenRCTrackFlatToRightBanked25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -15524,7 +15524,7 @@ static void WoodenRCTrackLeftBanked25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -15601,7 +15601,7 @@ static void WoodenRCTrackRightBanked25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -15665,7 +15665,7 @@ static void WoodenRCTrackBooster( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index 320ae7afe6..b318de3f43 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -139,10 +139,10 @@ static void WoodenWildMouseTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D4, direction), height, + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), height, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -167,7 +167,7 @@ static void WoodenWildMouseTrackStation( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -208,7 +208,7 @@ static void WoodenWildMouseTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -257,7 +257,7 @@ static void WoodenWildMouseTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -298,7 +298,7 @@ static void WoodenWildMouseTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -351,7 +351,7 @@ static void WoodenWildMouseTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -403,7 +403,7 @@ static void WoodenWildMouseTrack60DegTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -444,7 +444,7 @@ static void WoodenWildMouseTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -539,13 +539,13 @@ static void WoodenWildMouseTrackRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 2: - blockedSegments = SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4; + blockedSegments = kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide; break; case 3: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -590,7 +590,7 @@ static void WoodenWildMouseTrackLeftQuarterTurn1( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::Corner3, direction, height, session.SupportColours); TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -650,7 +650,7 @@ static void WoodenWildMouseTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -702,7 +702,7 @@ static void WoodenWildMouseTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 593d5d306b..84142fe5f4 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -183,7 +183,7 @@ static void PaintCarRideTrackFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -221,7 +221,7 @@ static void PaintCarRideTrack25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -259,7 +259,7 @@ static void PaintCarRideTrackFlatTo25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 3, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -297,7 +297,7 @@ static void PaintCarRideTrack25DegUpToFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -366,7 +366,7 @@ static void PaintCarRideStation( TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -393,13 +393,13 @@ static void PaintCarRideTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -446,7 +446,7 @@ static void PaintCarRideTrackLeftQuarterTurn1Tile( TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -489,7 +489,7 @@ static void PaintCarRideTrackSpinningTunnel( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -539,7 +539,7 @@ static void PaintCarRideTrack60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -596,7 +596,7 @@ static void PaintCarRideTrack25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -653,7 +653,7 @@ static void PaintCarRideTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -708,7 +708,7 @@ static void PaintCarRideTrackLogBumps( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index be6463a0ca..9e786a5a84 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -94,24 +94,24 @@ static void PaintCircus( { case 1: // Top - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: // Right - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: // Left - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: // Bottom - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index aac85a1f2f..c8a75a2a10 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -118,24 +118,24 @@ static void PaintCrookedHouse( { case 1: // Top - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: // Right - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: // Left - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: // Bottom - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } diff --git a/src/openrct2/ride/gentle/Dodgems.cpp b/src/openrct2/ride/gentle/Dodgems.cpp index 0cf4622c72..c88892523a 100644 --- a/src/openrct2/ride/gentle/Dodgems.cpp +++ b/src/openrct2/ride/gentle/Dodgems.cpp @@ -98,7 +98,7 @@ static void PaintDodgems( } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, height + 36, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, height + 36, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } diff --git a/src/openrct2/ride/gentle/FerrisWheel.cpp b/src/openrct2/ride/gentle/FerrisWheel.cpp index 29935dbe11..394276eeba 100644 --- a/src/openrct2/ride/gentle/FerrisWheel.cpp +++ b/src/openrct2/ride/gentle/FerrisWheel.cpp @@ -165,7 +165,7 @@ static void PaintFerrisWheel( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 176, 0x20); } diff --git a/src/openrct2/ride/gentle/FlyingSaucers.cpp b/src/openrct2/ride/gentle/FlyingSaucers.cpp index 33b8344bbd..f2ab1973b6 100644 --- a/src/openrct2/ride/gentle/FlyingSaucers.cpp +++ b/src/openrct2/ride/gentle/FlyingSaucers.cpp @@ -58,7 +58,7 @@ static void PaintFlyingSaucers( session, edges, session.MapPosition, trackElement, ride, session.TrackColours, height, FlyingSaucersFenceSprites, session.CurrentRotation); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index b7dcf5b02c..cc943de923 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -195,7 +195,7 @@ static void PaintGhostTrainTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -233,7 +233,7 @@ static void PaintGhostTrainTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -282,7 +282,7 @@ static void PaintGhostTrainTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -303,7 +303,7 @@ static void PaintGhostTrainTrack25DegUpToFlatShared( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -397,7 +397,7 @@ static void PaintGhostTrainStation( TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -428,13 +428,13 @@ static void PaintGhostTrainTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -474,7 +474,7 @@ static void PaintGhostTrainTrackLeftQuarterTurn1Tile( TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, tunnelStartImage, 0, tunnelEndImage); MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -504,7 +504,7 @@ static void PaintGhostTrainTrackSpinningTunnel( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -527,7 +527,7 @@ static void PaintGhostTrainTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index 68016ed68c..da081b04bc 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -99,24 +99,24 @@ static void PaintHauntedHouse( { case 1: // top - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: // right - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: // left - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: // bottom - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index b7d8137ff2..f628c58382 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -68,7 +68,7 @@ static void MazePaintSetup( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, rotation, height, GetShopSupportColourScheme(session, trackElement)); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~SEGMENT_C4, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~kSegmentCentre, 0xFFFF, 0); int32_t baseImageId = 0; switch (ride.track_colour[0].supports) @@ -178,7 +178,7 @@ static void MazePaintSetup( imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnCentre); PaintAddImageAsParent(session, imageId, { 14, 14, height }, { { 15, 15, height + 2 }, { 2, 2, 8 } }); - PaintUtilSetSegmentSupportHeight(session, SEGMENT_C4, height + 12, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, height + 12, 0x20); } PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index b6bf4dbb69..8f9d30e249 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -149,24 +149,24 @@ static void PaintMerryGoRound( { case 1: // top - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: // right - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: // left - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: // bottom - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index c37a9232b7..f96d62c7a2 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -489,7 +489,7 @@ static void PaintMiniGolfTrackFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); if (MiniGolfPaintUtilShouldDrawFence(session, trackElement)) { @@ -526,7 +526,7 @@ static void PaintMiniGolfTrack25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); imageId = GetStationColourScheme(session, trackElement).WithIndex(MiniGolfTrackSprites25DegUp[direction][1]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 0, 10, height + 2 }, { 32, 1, 15 } }); @@ -565,7 +565,7 @@ static void PaintMiniGolfTrackFlatTo25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); imageId = GetStationColourScheme(session, trackElement).WithIndex(MiniGolfTrackSpritesFlatTo25DegUp[direction][1]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 0, 10, height + 2 }, { 32, 1, 11 } }); @@ -604,7 +604,7 @@ static void PaintMiniGolfTrack25DegUpToFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); imageId = GetStationColourScheme(session, trackElement).WithIndex(MiniGolfTrackSprites25DegUpToFlat[direction][1]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 0, 10, height + 2 }, { 32, 1, 11 } }); @@ -716,7 +716,7 @@ static void PaintMiniGolfStation( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -733,7 +733,7 @@ static void PaintMiniGolfTrackLeftQuarterTurn1Tile( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); const bool shouldDrawFence = MiniGolfPaintUtilShouldDrawFence(session, trackElement); @@ -817,7 +817,7 @@ static void PaintMiniGolfHoleAb( bool drewSupports = WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); if ((direction == 0 && trackSequence == 0) || (direction == 2 && trackSequence == 1)) @@ -890,7 +890,7 @@ static void PaintMiniGolfHoleC( bool drewSupports = WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); if ((direction == 0 && trackSequence == 0) || (direction == 2 && trackSequence == 1)) @@ -962,7 +962,7 @@ static void PaintMiniGolfHoleD( bool drewSupports = WoodenASupportsPaintSetup( session, WoodenSupportType::Truss, supportType, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); switch ((direction << 4) | trackSequence) @@ -1056,7 +1056,7 @@ static void PaintMiniGolfHoleE( bool drewSupports = WoodenASupportsPaintSetup( session, WoodenSupportType::Truss, supportType, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); switch ((direction << 4) | trackSequence) diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 0cd89a0cf8..5e127e3195 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -46,7 +46,7 @@ static void PaintMiniHelicoptersTrackStation( TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -78,7 +78,7 @@ static void PaintMiniHelicoptersTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -120,7 +120,7 @@ static void PaintMiniHelicoptersTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -162,7 +162,7 @@ static void PaintMiniHelicoptersTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -204,7 +204,7 @@ static void PaintMiniHelicoptersTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -248,17 +248,17 @@ static void PaintMiniHelicoptersTrackLeftQuarterTurn3Tiles( MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; case 3: MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner, direction), 0xFFFF, 0); break; } @@ -291,7 +291,7 @@ static void PaintMiniHelicoptersTrackLeftQuarterTurn1Tile( TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -326,7 +326,7 @@ static void PaintMiniHelicoptersTrackSpinningTunnel( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, GetStationColourScheme(session, trackElement)); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index ebc56a0e7d..c07416fae4 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -181,7 +181,7 @@ static void PaintMonorailCyclesTrackFlat( session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -214,7 +214,7 @@ static void PaintMonorailCyclesStation( TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -233,17 +233,17 @@ static void PaintMonorailCyclesTrackLeftQuarterTurn3Tiles( MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; case 3: MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner, direction), 0xFFFF, 0); break; } @@ -365,27 +365,27 @@ static void PaintMonorailCyclesTrackRightQuarterTurn5Tiles( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -479,25 +479,25 @@ static void PaintMonorailCyclesTrackSBendLeft( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction & 1), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction & 1), 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, direction & 1), + kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner, direction & 1), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction & 1), + kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction & 1), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0, direction & 1), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner, direction & 1), 0xFFFF, 0); break; } PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); @@ -582,25 +582,25 @@ static void PaintMonorailCyclesTrackSBendRight( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction & 1), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction & 1), 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC, direction & 1), + kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction & 1), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4, direction & 1), + kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner, direction & 1), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8, direction & 1), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner, direction & 1), 0xFFFF, 0); break; } PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index 368123a237..bd15e434f8 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -112,7 +112,7 @@ static void PaintObservationTowerBase( PaintAddImageAsParent(session, imageId, { 0, 0, height + 64 }, { { 8, 8, height + 64 }, { 2, 2, 30 } }); PaintUtilSetVerticalTunnel(session, height + 96); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); @@ -123,32 +123,32 @@ static void PaintObservationTowerBase( switch (trackSequence) { case 1: - blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; break; case 5: - blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 6: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; case 7: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 8: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~blockedSegments, height + 2, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -172,7 +172,7 @@ static void PaintObservationTowerSection( PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index 125f6e0a8e..e7fcf7059f 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -145,32 +145,32 @@ static void PaintSpaceRings( cornerSegments = 0; break; case 1: - cornerSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + cornerSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - cornerSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + cornerSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - cornerSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + cornerSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 4: - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; break; case 5: - cornerSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + cornerSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 6: - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; case 7: - cornerSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + cornerSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 8: - cornerSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + cornerSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } diff --git a/src/openrct2/ride/gentle/SpiralSlide.cpp b/src/openrct2/ride/gentle/SpiralSlide.cpp index 25e42e43d1..67333cb2d0 100644 --- a/src/openrct2/ride/gentle/SpiralSlide.cpp +++ b/src/openrct2/ride/gentle/SpiralSlide.cpp @@ -242,7 +242,7 @@ static void PaintSpiralSlide( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } diff --git a/src/openrct2/ride/shops/Facility.cpp b/src/openrct2/ride/shops/Facility.cpp index 66a0bf1ed9..6243f18a52 100644 --- a/src/openrct2/ride/shops/Facility.cpp +++ b/src/openrct2/ride/shops/Facility.cpp @@ -66,7 +66,7 @@ static void PaintFacility( PaintAddImageAsParent(session, imageId.WithIndexOffset(4), offset, { { 2, 28, height }, { 28, 2, 29 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); if (direction == 1 || direction == 2) diff --git a/src/openrct2/ride/shops/Shop.cpp b/src/openrct2/ride/shops/Shop.cpp index 6372598339..5360956c9e 100644 --- a/src/openrct2/ride/shops/Shop.cpp +++ b/src/openrct2/ride/shops/Shop.cpp @@ -52,7 +52,7 @@ static void PaintShop( PaintAddImageAsParent(session, imageFlags.WithIndex(imageIndex), offset, bb); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); if (direction == 1 || direction == 2) diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 3f07430e45..7e9a1f5833 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -95,24 +95,24 @@ static void Paint3dCinema( { case 1: // top - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: // right - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: // left - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: // bottom - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index f5b25ca126..0ddf318e6b 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -152,20 +152,20 @@ static void PaintEnterprise( switch (trackSequence) { case 0: - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 12: - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 15: - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 160, 0x20); } diff --git a/src/openrct2/ride/thrill/GoKarts.cpp b/src/openrct2/ride/thrill/GoKarts.cpp index 3529db59fe..ce4b70b20d 100644 --- a/src/openrct2/ride/thrill/GoKarts.cpp +++ b/src/openrct2/ride/thrill/GoKarts.cpp @@ -154,7 +154,7 @@ static void PaintGoKartsTrackFlat( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -208,7 +208,7 @@ static void PaintGoKartsTrack25DegUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -262,7 +262,7 @@ static void PaintGoKartsTrackFlatTo25DegUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -317,7 +317,7 @@ static void PaintGoKartsTrack25DegUpToFlat( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -452,7 +452,7 @@ static void PaintGoKartsStation( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -523,7 +523,7 @@ static void PaintGoKartsTrackLeftQuarterTurn1Tile( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index fb75df6822..00554249fb 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -129,35 +129,35 @@ static void PaintLaunchedFreefallBase( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; break; case 5: - blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 6: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; case 7: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 8: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~blockedSegments, height + 2, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -181,7 +181,7 @@ static void PaintLaunchedFreefallTowerSection( PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/thrill/MagicCarpet.cpp b/src/openrct2/ride/thrill/MagicCarpet.cpp index 3641edc309..d0ad5b2150 100644 --- a/src/openrct2/ride/thrill/MagicCarpet.cpp +++ b/src/openrct2/ride/thrill/MagicCarpet.cpp @@ -260,7 +260,7 @@ static void PaintMagicCarpet( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 176, 0x20); } diff --git a/src/openrct2/ride/thrill/MotionSimulator.cpp b/src/openrct2/ride/thrill/MotionSimulator.cpp index 9fc7a2e9fb..b1a8e0bd53 100644 --- a/src/openrct2/ride/thrill/MotionSimulator.cpp +++ b/src/openrct2/ride/thrill/MotionSimulator.cpp @@ -133,7 +133,7 @@ static void PaintMotionSimulator( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); } diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index ec68353f13..5b1b202833 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -134,7 +134,7 @@ static void PaintRotoDropBase( PaintAddImageAsParent(session, imageId, { 0, 0, height + 64 }, { { 8, 8, height + 64 }, { 2, 2, 30 } }); PaintUtilSetVerticalTunnel(session, height + 96); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); @@ -145,32 +145,32 @@ static void PaintRotoDropBase( switch (trackSequence) { case 1: - blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; break; case 5: - blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 6: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; case 7: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 8: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~blockedSegments, height + 2, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -202,7 +202,7 @@ static void PaintRotoDropTowerSection( PaintAddImageAsChild(session, imageId, { 0, 0, height }, { { 8, 8, height }, { 2, 2, 30 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/thrill/SwingingInverterShip.cpp b/src/openrct2/ride/thrill/SwingingInverterShip.cpp index 7340d1e6f1..4c497b8ab8 100644 --- a/src/openrct2/ride/thrill/SwingingInverterShip.cpp +++ b/src/openrct2/ride/thrill/SwingingInverterShip.cpp @@ -193,7 +193,7 @@ static void PaintSwingingInverterShip( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 176, 0x20); } diff --git a/src/openrct2/ride/thrill/SwingingShip.cpp b/src/openrct2/ride/thrill/SwingingShip.cpp index a030d9a157..0ffa116d77 100644 --- a/src/openrct2/ride/thrill/SwingingShip.cpp +++ b/src/openrct2/ride/thrill/SwingingShip.cpp @@ -192,7 +192,7 @@ static void PaintSwingingShip( } } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); if (stationObject != nullptr && !(stationObject->Flags & STATION_OBJECT_FLAGS::NO_PLATFORMS)) { diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 84c9700206..849360a302 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -225,24 +225,24 @@ static void PaintTopSpin( { case 1: // top - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: // right - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: // left - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: // bottom - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 112, 0x20); } diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index af20b093b7..8c7384b549 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -145,21 +145,21 @@ static void PaintTwist( switch (trackSequence) { case 1: - cornerSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 3: - cornerSegments = SEGMENT_CC | SEGMENT_BC | SEGMENT_D4; + cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; break; case 6: - cornerSegments = SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0; + cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; break; case 7: - cornerSegments = SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4; + cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~cornerSegments, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~cornerSegments, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 85c6f1a26d..640f015bb7 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -266,7 +266,7 @@ static void ChairliftPaintStationNeSw( session, imageId, { 30, 16, height + 2 }, { { 1, 16, height + 2 }, { 1, 1, 7 } }); // bound offset x is wrong? } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -363,7 +363,7 @@ static void ChairliftPaintStationSeNw( PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -400,7 +400,7 @@ static void ChairliftPaintFlat( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -438,7 +438,7 @@ static void ChairliftPaint25DegUp( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -492,8 +492,8 @@ static void ChairliftPaintFlatTo25DegUp( break; } - ChairliftPaintUtilDrawSupports(session, SEGMENT_C4, height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + ChairliftPaintUtilDrawSupports(session, kSegmentCentre, height); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -547,8 +547,8 @@ static void ChairliftPaint25DegUpToFlat( break; } - ChairliftPaintUtilDrawSupports(session, SEGMENT_C4, height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + ChairliftPaintUtilDrawSupports(session, kSegmentCentre, height); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -637,9 +637,9 @@ static void ChairliftPaintLeftQuarterTurn1Tile( break; } - ChairliftPaintUtilDrawSupports(session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_D0, direction), height); + ChairliftPaintUtilDrawSupports(session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), height); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index f7158dee74..774eaa6d46 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -61,7 +61,7 @@ static void PaintLiftBase( PaintLiftCage(session, -1, session.TrackColours, height + 64, session.CurrentRotation); PaintUtilSetVerticalTunnel(session, height + 96); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); @@ -81,32 +81,32 @@ static void PaintLiftBase( switch (trackSequence) { case 1: - blockedSegments = SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_CC | SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; break; case 5: - blockedSegments = SEGMENT_BC | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 6: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; case 7: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 8: - blockedSegments = SEGMENT_B8 | SEGMENT_D0 | SEGMENT_C0; + blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL & ~blockedSegments, height + 2, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~blockedSegments, height + 2, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -122,7 +122,7 @@ static void PaintLiftTowerSection( PaintLiftCage(session, -1, session.TrackColours, height, session.CurrentRotation); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 0e84fdbff7..138d734832 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -695,7 +695,7 @@ static void PaintMiniatureRailwayTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -720,7 +720,7 @@ static void PaintMiniatureRailwayStation( TrackPaintUtilDrawStation3(session, ride, direction, height + 2, height, trackElement); // covers shouldn't be offset by +2 - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 30, 0x20); } @@ -753,7 +753,7 @@ static void PaintMiniatureRailwayTrack25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::Up25DegRailway); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -786,7 +786,7 @@ static void PaintMiniatureRailwayTrackFlatTo25DegUp( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::FlatToUp25DegRailway); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -819,7 +819,7 @@ static void PaintMiniatureRailwayTrack25DegUpToFlat( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours, WoodenSupportTransitionType::Up25DegToFlatRailway); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1048,26 +1048,26 @@ static void PaintMiniatureRailwayTrackRightQuarterTurn5Tiles( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 - | SEGMENT_D4; + blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide + | kSegmentBottomRightSide; break; case 4: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; break; case 5: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide; break; case 6: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; } @@ -1175,16 +1175,16 @@ static void PaintMiniatureRailwayTrackSBendLeft( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); @@ -1283,16 +1283,16 @@ static void PaintMiniatureRailwayTrackSBendRight( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 3: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); @@ -1397,13 +1397,13 @@ static void PaintMiniatureRailwayTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENTS_ALL; + blockedSegments = kSegmentsAll; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -1586,7 +1586,7 @@ static void PaintMiniatureRailwayTrackLeftEighthToDiag( PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1753,7 +1753,7 @@ static void PaintMiniatureRailwayTrackRightEighthToDiag( PaintUtilPushTunnelRight(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1852,7 +1852,7 @@ static void MiniatureRailwayTrackDiagFlat( session, session.TrackColours.WithIndex(imageId), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1933,7 +1933,7 @@ static void MiniatureRailwayTrackDiag25DegUp( { { -16, -16, height + offsetB[direction] }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -1984,7 +1984,7 @@ static void MiniatureRailwayTrackDiagFlatTo25DegUp( session, session.TrackColours.WithIndex(imageId), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2063,7 +2063,7 @@ static void MiniatureRailwayTrackDiag25DegUpToFlat( { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -2141,7 +2141,7 @@ static void MiniatureRailwayTrackDiag25DegDown( { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -2218,7 +2218,7 @@ static void MiniatureRailwayTrackDiagFlatTo25DegDown( { { -16, -16, height + railOffsets[direction] }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -2267,7 +2267,7 @@ static void MiniatureRailwayTrackDiag25DegDownToFlat( session, session.TrackColours.WithIndex(imageId), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 2 } }); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 2980e64823..5870a3099b 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -415,7 +415,7 @@ static void PaintMonorailTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -466,7 +466,7 @@ static void PaintMonorailStation( TrackPaintUtilDrawStation(session, ride, direction, height, trackElement); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -509,7 +509,7 @@ static void PaintMonorailTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -552,7 +552,7 @@ static void PaintMonorailTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -595,7 +595,7 @@ static void PaintMonorailTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -665,19 +665,19 @@ static void PaintMonorailTrackRightQuarterTurn5Tiles( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide; break; case 3: - blockedSegments = SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4; + blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre; break; case 5: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide; break; case 6: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } @@ -775,16 +775,16 @@ static void PaintMonorailTrackSBendLeft( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); @@ -869,16 +869,16 @@ static void PaintMonorailTrackSBendRight( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); @@ -909,13 +909,13 @@ static void PaintMonorailTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -986,19 +986,19 @@ static void PaintMonorailTrackLeftEighthToDiag( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 2: - blockedSegments = SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_C8; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide; break; case 4: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C8 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; break; } @@ -1056,19 +1056,19 @@ static void PaintMonorailTrackRightEighthToDiag( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; break; case 1: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_C0 | SEGMENT_D4 | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_B4; + blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; break; case 3: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C0 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; break; case 4: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B8 | SEGMENT_C8 | SEGMENT_D4; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomRightSide; break; } diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index ef2ac05141..f9f2931321 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -41,7 +41,7 @@ static void SuspendedMonorailTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -76,7 +76,7 @@ static void SuspendedMonorailTrackStation( DrawSupportsSideBySide(session, direction, height, session.SupportColours, MetalSupportType::Boxed); TrackPaintUtilDrawStationInverted(session, ride, direction, height, trackElement, STATION_VARIANT_TALL); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_INVERTED_9); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -110,7 +110,7 @@ static void SuspendedMonorailTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -177,7 +177,7 @@ static void SuspendedMonorailTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -244,7 +244,7 @@ static void SuspendedMonorailTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -338,7 +338,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -376,7 +376,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -404,7 +404,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -434,7 +434,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -464,7 +464,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -525,7 +525,7 @@ static void SuspendedMonorailTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -560,7 +560,7 @@ static void SuspendedMonorailTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -603,7 +603,7 @@ static void SuspendedMonorailTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -647,7 +647,7 @@ static void SuspendedMonorailTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -698,7 +698,7 @@ static void SuspendedMonorailTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -733,7 +733,7 @@ static void SuspendedMonorailTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -776,7 +776,7 @@ static void SuspendedMonorailTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { @@ -820,7 +820,7 @@ static void SuspendedMonorailTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -871,7 +871,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -909,7 +909,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -938,7 +938,7 @@ static void SuspendedMonorailTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -999,7 +999,7 @@ static void SuspendedMonorailTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -1035,7 +1035,7 @@ static void SuspendedMonorailTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1064,13 +1064,13 @@ static void SuspendedMonorailTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1100,7 +1100,7 @@ static void SuspendedMonorailTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1163,7 +1163,7 @@ static void SuspendedMonorailTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -1199,7 +1199,7 @@ static void SuspendedMonorailTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1228,13 +1228,13 @@ static void SuspendedMonorailTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1264,7 +1264,7 @@ static void SuspendedMonorailTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); switch (direction) { @@ -1329,7 +1329,7 @@ static void SuspendedMonorailTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1342,7 +1342,7 @@ static void SuspendedMonorailTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1355,7 +1355,7 @@ static void SuspendedMonorailTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1369,7 +1369,7 @@ static void SuspendedMonorailTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1415,7 +1415,7 @@ static void SuspendedMonorailTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1428,7 +1428,7 @@ static void SuspendedMonorailTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1441,7 +1441,7 @@ static void SuspendedMonorailTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1455,7 +1455,7 @@ static void SuspendedMonorailTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1501,7 +1501,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -1514,7 +1514,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1527,7 +1527,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -1541,7 +1541,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1587,7 +1587,7 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1600,7 +1600,7 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1613,7 +1613,7 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1627,7 +1627,7 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1673,7 +1673,7 @@ static void SuspendedMonorailTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1686,7 +1686,7 @@ static void SuspendedMonorailTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1699,7 +1699,7 @@ static void SuspendedMonorailTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1713,7 +1713,7 @@ static void SuspendedMonorailTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1759,7 +1759,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 1: switch (direction) @@ -1771,7 +1771,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: switch (direction) @@ -1783,7 +1783,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: switch (direction) @@ -1796,7 +1796,7 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: @@ -1842,7 +1842,7 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -1855,7 +1855,7 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1868,7 +1868,7 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -1882,7 +1882,7 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); switch (direction) { case 0: diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index 0c72e16c79..cc604c2c92 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -57,7 +57,7 @@ static void PaintBoatHireTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } @@ -81,7 +81,7 @@ static void PaintBoatHireStation( session, ride, stationObj, session.MapPosition, direction, height, trackElement, session.CurrentRotation); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -125,7 +125,7 @@ static void PaintBoatHireTrackLeftQuarterTurn1Tile( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_C8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } diff --git a/src/openrct2/ride/water/DinghySlide.cpp b/src/openrct2/ride/water/DinghySlide.cpp index 4f13eff459..7947055858 100644 --- a/src/openrct2/ride/water/DinghySlide.cpp +++ b/src/openrct2/ride/water/DinghySlide.cpp @@ -238,7 +238,7 @@ static void DinghySlideTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -266,7 +266,7 @@ static void DinghySlideTrackStation( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -312,7 +312,7 @@ static void DinghySlideTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -349,7 +349,7 @@ static void DinghySlideTrack60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -395,7 +395,7 @@ static void DinghySlideTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -432,7 +432,7 @@ static void DinghySlideTrack25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -469,7 +469,7 @@ static void DinghySlideTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -515,7 +515,7 @@ static void DinghySlideTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -652,27 +652,27 @@ static void DinghySlideTrackRightQuarterTurn5( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -738,7 +738,7 @@ static void DinghySlideTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -753,7 +753,7 @@ static void DinghySlideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 2: @@ -769,7 +769,7 @@ static void DinghySlideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: @@ -779,7 +779,7 @@ static void DinghySlideTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -845,7 +845,7 @@ static void DinghySlideTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -860,7 +860,7 @@ static void DinghySlideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 2: @@ -876,7 +876,7 @@ static void DinghySlideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 3: @@ -886,7 +886,7 @@ static void DinghySlideTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -974,13 +974,13 @@ static void DinghySlideTrackRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); diff --git a/src/openrct2/ride/water/DinghySlideCovered.cpp b/src/openrct2/ride/water/DinghySlideCovered.cpp index 9e9102d5ac..25eb98dda3 100644 --- a/src/openrct2/ride/water/DinghySlideCovered.cpp +++ b/src/openrct2/ride/water/DinghySlideCovered.cpp @@ -194,7 +194,7 @@ static void DinghySlideTrackCoveredFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -231,7 +231,7 @@ static void DinghySlideTrackCovered25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -268,7 +268,7 @@ static void DinghySlideTrackCovered60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -305,7 +305,7 @@ static void DinghySlideTrackCoveredFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -342,7 +342,7 @@ static void DinghySlideTrackCovered25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -379,7 +379,7 @@ static void DinghySlideTrackCovered60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -416,7 +416,7 @@ static void DinghySlideTrackCovered25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -553,27 +553,27 @@ static void DinghySlideTrackCoveredRightQuarterTurn5( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; } @@ -632,7 +632,7 @@ static void DinghySlideTrackCoveredSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -647,7 +647,7 @@ static void DinghySlideTrackCoveredSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 2: @@ -663,7 +663,7 @@ static void DinghySlideTrackCoveredSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: @@ -673,7 +673,7 @@ static void DinghySlideTrackCoveredSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -739,7 +739,7 @@ static void DinghySlideTrackCoveredSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -754,7 +754,7 @@ static void DinghySlideTrackCoveredSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 2: @@ -770,7 +770,7 @@ static void DinghySlideTrackCoveredSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 3: @@ -780,7 +780,7 @@ static void DinghySlideTrackCoveredSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -868,13 +868,13 @@ static void DinghySlideTrackCoveredRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_BC; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; break; case 2: - blockedSegments = SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0; + blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; break; case 3: - blockedSegments = SEGMENT_D4 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_B8; + blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index f317be8a34..7211842e98 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -179,7 +179,7 @@ static void PaintLogFlumeTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -207,7 +207,7 @@ static void PaintLogFlumeTrackStation( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -243,7 +243,7 @@ static void PaintLogFlumeTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -279,7 +279,7 @@ static void PaintLogFlumeTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -315,7 +315,7 @@ static void PaintLogFlumeTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -351,7 +351,7 @@ static void PaintLogFlumeTrack25DegDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -387,7 +387,7 @@ static void PaintLogFlumeTrackFlatTo25DegDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -423,7 +423,7 @@ static void PaintLogFlumeTrack25DegDownToFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -471,7 +471,7 @@ static void PaintLogFlumeTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -486,7 +486,7 @@ static void PaintLogFlumeTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 2: @@ -502,7 +502,7 @@ static void PaintLogFlumeTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: @@ -512,7 +512,7 @@ static void PaintLogFlumeTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -578,7 +578,7 @@ static void PaintLogFlumeTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -593,7 +593,7 @@ static void PaintLogFlumeTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 2: @@ -609,7 +609,7 @@ static void PaintLogFlumeTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 3: @@ -619,7 +619,7 @@ static void PaintLogFlumeTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; } @@ -705,15 +705,15 @@ static void PaintLogFlumeTrackLeftQuarterTurn3Tiles( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; } @@ -784,15 +784,15 @@ static void PaintLogFlumeTrackRightQuarterTurn3Tiles( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C0 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; } @@ -814,7 +814,7 @@ static void PaintLogFlumeTrackOnRidePhoto( TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -839,7 +839,7 @@ static void PaintLogFlumeTrackReverser( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -883,7 +883,7 @@ static void LogFlumeTrack25Down60( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -925,7 +925,7 @@ static void LogFlumeTrack60Down( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -967,7 +967,7 @@ static void LogFlumeTrack60Down25( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } diff --git a/src/openrct2/ride/water/RiverRapids.cpp b/src/openrct2/ride/water/RiverRapids.cpp index 6a97d50850..b74c93cea5 100644 --- a/src/openrct2/ride/water/RiverRapids.cpp +++ b/src/openrct2/ride/water/RiverRapids.cpp @@ -308,7 +308,7 @@ static void PaintRiverRapidsTrackFlat( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -384,7 +384,7 @@ static void PaintRiverRapidsTrack25Deg(PaintSession& session, uint8_t direction, break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -452,7 +452,7 @@ static void PaintRiverRapidsTrack25DegToFlatA( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -519,7 +519,7 @@ static void PaintRiverRapidsTrack25DegToFlatB( break; } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -624,7 +624,7 @@ static void PaintRiverRapidsTrackLeftQuarterTurn1Tile( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -682,7 +682,7 @@ static void PaintRiverRapidsTrackRightQuarterTurn1Tile( WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -753,7 +753,7 @@ static void PaintRiverRapidsTrackWaterfall( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_INVERTED_9); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -795,7 +795,7 @@ static void PaintRiverRapidsTrackRapids( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -865,7 +865,7 @@ static void PaintRiverRapidsTrackWhirlpool( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 26c777febc..183668ce76 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -496,7 +496,7 @@ static void PaintSplashBoatsTrack25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -523,7 +523,7 @@ static void PaintSplashBoatsTrack60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -549,7 +549,7 @@ static void PaintSplashBoatsTrackFlatTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -575,7 +575,7 @@ static void PaintSplashBoatsTrack25DegUpToFlat( { PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -602,7 +602,7 @@ static void PaintSplashBoatsTrack25DegUpTo60DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -629,7 +629,7 @@ static void PaintSplashBoatsTrack60DegUpTo25DegUp( { PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -655,7 +655,7 @@ static void PaintSplashBoatsTrack25DegDown( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -688,7 +688,7 @@ static void PaintSplashBoatsTrackFlatTo25DegDown( { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -728,7 +728,7 @@ static void PaintSplashBoatsTrack25DegDownToFlat( { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -773,7 +773,7 @@ static void PaintSplashBoatsTrackFlat( PaintUtilPushTunnelLeft(session, height, TUNNEL_SQUARE_FLAT); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -808,7 +808,7 @@ static void PaintSplashBoatsStation( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -870,38 +870,38 @@ static void PaintSplashBoatsTrackLeftQuarterTurn5Tiles( switch (trackSequence) { case 0: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4 | SEGMENT_B8 | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_CC | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C4 | SEGMENT_B4 | SEGMENT_C0 | SEGMENT_C8 | SEGMENT_D0, + kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentCentre | kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_CC | SEGMENT_D4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_D0 | SEGMENT_C0 | SEGMENT_B8, direction), + PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentLeftCorner, direction), 0xFFFF, 0); break; case 6: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -982,38 +982,38 @@ static void PaintSplashBoatsTrackRightQuarterTurn5Tiles( switch (trackSequence) { case 0: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_BC | SEGMENT_C0 | SEGMENT_CC, direction), + PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_C4 | SEGMENT_B8 | SEGMENT_BC | SEGMENT_D0 | SEGMENT_D4, + kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C8 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_D4 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C8, direction), + PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 0xFFFF, 0); break; case 6: - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -1080,7 +1080,7 @@ static void PaintSplashBoatsTrackSBendLeft( session, direction, frontImageId, { 0, 0, height }, { { 0, 2, height + 27 }, { 32, 27, 0 } }); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -1093,7 +1093,7 @@ static void PaintSplashBoatsTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 2: @@ -1107,7 +1107,7 @@ static void PaintSplashBoatsTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 3: @@ -1116,7 +1116,7 @@ static void PaintSplashBoatsTrackSBendLeft( session, direction, frontImageId, { 0, 0, height }, { { 0, 2, height + 27 }, { 32, 27, 0 } }); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -1182,7 +1182,7 @@ static void PaintSplashBoatsTrackSBendRight( session, direction, frontImageId, { 0, 0, height }, { { 0, 2, height + 27 }, { 32, 27, 0 } }); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -1195,7 +1195,7 @@ static void PaintSplashBoatsTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0 | SEGMENT_D4, direction), + PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); break; case 2: @@ -1209,7 +1209,7 @@ static void PaintSplashBoatsTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, direction), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); break; case 3: @@ -1218,7 +1218,7 @@ static void PaintSplashBoatsTrackSBendRight( session, direction, frontImageId, { 0, 0, height }, { { 0, 2, height + 27 }, { 32, 27, 0 } }); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); break; } @@ -1268,7 +1268,7 @@ static void PaintSplashBoatsTrackOnRidePhoto( TrackPaintUtilOnridePhotoPaint(session, direction, height + 3, trackElement); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index a9c10d903c..1fae87ba46 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -91,7 +91,7 @@ static void SubmarineRidePaintTrackStation( session, ride, stationObj, session.MapPosition, direction, height, trackElement, session.CurrentRotation); } - PaintUtilSetSegmentSupportHeight(session, SEGMENTS_ALL, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -123,7 +123,7 @@ static void SubmarineRidePaintTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } @@ -142,17 +142,17 @@ static void SubmarineRidePaintTrackLeftQuarterTurn3Tiles( MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height - 16, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_D0 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_B4, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0 | SEGMENT_B8, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); break; case 3: MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height - 16, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D4 | SEGMENT_C0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner, direction), 0xFFFF, 0); break; } @@ -182,7 +182,7 @@ static void SubmarineRidePaintTrackLeftQuarterTurn1Tile( TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height - 16, 0, TUNNEL_0, 0, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C8 | SEGMENT_C4 | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } From 7ae98f742157e32d495b59d2d7cd9839808c193e Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 11 Mar 2024 01:12:35 +0100 Subject: [PATCH 063/191] Use EnumsToFlags() and create a proper enum --- .../paint/tile_element/Paint.Path.cpp | 17 +- .../paint/tile_element/Paint.SmallScenery.cpp | 18 +- .../paint/tile_element/Paint.Surface.cpp | 237 +- .../paint/tile_element/Paint.TileElement.cpp | 9 +- .../paint/tile_element/Paint.TileElement.h | 27 +- src/openrct2/ride/TrackPaint.cpp | 54 +- .../coaster/AirPoweredVerticalCoaster.cpp | 54 +- src/openrct2/ride/coaster/AlpineCoaster.cpp | 1404 ++++++- .../ride/coaster/BobsleighCoaster.cpp | 473 ++- .../ride/coaster/BolligerMabillardTrack.hpp | 2312 +++++++++-- .../coaster/ClassicWoodenRollerCoaster.cpp | 40 +- .../ride/coaster/CompactInvertedCoaster.cpp | 1680 ++++++-- .../ride/coaster/CorkscrewRollerCoaster.cpp | 1849 +++++++-- .../ride/coaster/FlyingRollerCoaster.cpp | 3616 ++++++++++++++--- src/openrct2/ride/coaster/GigaCoaster.cpp | 3160 +++++++++++--- src/openrct2/ride/coaster/HybridCoaster.cpp | 502 ++- .../ride/coaster/InvertedHairpinCoaster.cpp | 112 +- .../ride/coaster/InvertedImpulseCoaster.cpp | 65 +- .../ride/coaster/InvertedRollerCoaster.cpp | 1914 +++++++-- .../ride/coaster/JuniorRollerCoaster.cpp | 450 +- .../ride/coaster/LayDownRollerCoaster.cpp | 1634 ++++++-- .../ride/coaster/LimLaunchedRollerCoaster.cpp | 801 +++- .../ride/coaster/LoopingRollerCoaster.cpp | 1786 ++++++-- src/openrct2/ride/coaster/MineRide.cpp | 1242 +++++- .../ride/coaster/MineTrainCoaster.cpp | 658 ++- .../ride/coaster/MiniRollerCoaster.cpp | 1766 ++++++-- .../ride/coaster/MiniSuspendedCoaster.cpp | 417 +- .../coaster/MultiDimensionRollerCoaster.cpp | 2654 ++++++++++-- .../ride/coaster/ReverserRollerCoaster.cpp | 61 +- .../coaster/SideFrictionRollerCoaster.cpp | 61 +- .../ride/coaster/SingleRailRollerCoaster.cpp | 3152 ++++++++++++-- .../ride/coaster/StandUpRollerCoaster.cpp | 1645 ++++++-- src/openrct2/ride/coaster/Steeplechase.cpp | 427 +- .../ride/coaster/SuspendedSwingingCoaster.cpp | 857 +++- src/openrct2/ride/coaster/VirginiaReel.cpp | 8 +- src/openrct2/ride/coaster/WildMouse.cpp | 88 +- .../ride/coaster/WoodenRollerCoaster.cpp | 736 +++- src/openrct2/ride/coaster/WoodenWildMouse.cpp | 16 +- src/openrct2/ride/gentle/CarRide.cpp | 49 +- src/openrct2/ride/gentle/Circus.cpp | 9 +- src/openrct2/ride/gentle/CrookedHouse.cpp | 9 +- src/openrct2/ride/gentle/GhostTrain.cpp | 34 +- src/openrct2/ride/gentle/HauntedHouse.cpp | 9 +- src/openrct2/ride/gentle/Maze.cpp | 4 +- src/openrct2/ride/gentle/MerryGoRound.cpp | 9 +- src/openrct2/ride/gentle/MiniGolf.cpp | 27 +- src/openrct2/ride/gentle/MiniHelicopters.cpp | 51 +- src/openrct2/ride/gentle/MonorailCycles.cpp | 116 +- src/openrct2/ride/gentle/ObservationTower.cpp | 25 +- src/openrct2/ride/gentle/SpaceRings.cpp | 24 +- src/openrct2/ride/thrill/3dCinema.cpp | 9 +- src/openrct2/ride/thrill/Enterprise.cpp | 9 +- src/openrct2/ride/thrill/LaunchedFreefall.cpp | 25 +- src/openrct2/ride/thrill/RotoDrop.cpp | 25 +- src/openrct2/ride/thrill/TopSpin.cpp | 9 +- src/openrct2/ride/thrill/Twist.cpp | 9 +- src/openrct2/ride/transport/Chairlift.cpp | 8 +- src/openrct2/ride/transport/Lift.cpp | 25 +- .../ride/transport/MiniatureRailway.cpp | 37 +- src/openrct2/ride/transport/Monorail.cpp | 108 +- .../ride/transport/SuspendedMonorail.cpp | 413 +- src/openrct2/ride/water/BoatHire.cpp | 10 +- src/openrct2/ride/water/DinghySlide.cpp | 135 +- .../ride/water/DinghySlideCovered.cpp | 135 +- src/openrct2/ride/water/LogFlume.cpp | 159 +- src/openrct2/ride/water/SplashBoats.cpp | 80 +- src/openrct2/ride/water/SubmarineRide.cpp | 36 +- 67 files changed, 31971 insertions(+), 5629 deletions(-) diff --git a/src/openrct2/paint/tile_element/Paint.Path.cpp b/src/openrct2/paint/tile_element/Paint.Path.cpp index 9f2f941514..e8872a0866 100644 --- a/src/openrct2/paint/tile_element/Paint.Path.cpp +++ b/src/openrct2/paint/tile_element/Paint.Path.cpp @@ -919,30 +919,35 @@ static void PathPaintSegmentSupportHeight( if (pathElement.GetEdgesAndCorners() == 0xFF) { - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight( + session, + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + 0xFFFF, 0); return; } - PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::centre), 0xFFFF, 0); if (edges & EDGE_NE) { - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topRightSide), 0xFFFF, 0); } if (edges & EDGE_SE) { - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomRightSide, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomRightSide), 0xFFFF, 0); } if (edges & EDGE_SW) { - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomLeftSide), 0xFFFF, 0); } if (edges & EDGE_NW) { - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topLeftSide), 0xFFFF, 0); } } diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index e3981fc0c1..132ede111b 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -78,32 +78,38 @@ static void SetSupportHeights( { if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_FULL_TILE)) { - PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::centre), height, 0x20); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~kSegmentCentre, height, 0x20); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~EnumToFlag(PaintSegment::centre), height, 0x20); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { auto direction = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) % 4; PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), height, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + height, 0x20); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG27 | SMALL_SCENERY_FLAG_FULL_TILE)) { - PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::centre), 0xFFFF, 0); if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { - PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~kSegmentCentre, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~EnumToFlag(PaintSegment::centre), 0xFFFF, 0); } } else if (sceneryEntry.HasFlag(SMALL_SCENERY_FLAG_VOFFSET_CENTRE)) { auto direction = (sceneryElement.GetSceneryQuadrant() + session.CurrentRotation) % 4; PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); } } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index d44c5ddd6f..2d7ac5dd33 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -1464,11 +1464,7 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 00 00 00 // 00 00 // 00 - PaintUtilSetSegmentSupportHeight( - session, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide - | kSegmentBottomRightSide, - height, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, height, 0); PaintUtilForceSetGeneralSupportHeight(session, height, 0); break; @@ -1479,10 +1475,14 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 01 01 01 // 1B 1B // 1B - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, height, 0); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height, 1); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), height, + 0); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), height, 1); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), height + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomCorner), height + 6 + 6, 0x1B); PaintUtilForceSetGeneralSupportHeight(session, height, 1); break; @@ -1493,10 +1493,14 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 17 02 00 // 17 00 // 02 - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, height, 0); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height, 2); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + height, 0); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), height, 2); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), height + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::leftCorner), height + 6 + 6, 0x17); PaintUtilForceSetGeneralSupportHeight(session, height, 2); break; @@ -1507,9 +1511,15 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 03 03 03 // 03 03 // 03 - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner, height + 2, 3); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, height + 2 + 6, 3); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner, height + 2 + 6 + 6, 3); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner), + height + 2, 3); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + height + 2 + 6, 3); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner), + height + 2 + 6 + 6, 3); PaintUtilForceSetGeneralSupportHeight(session, height, 3); break; @@ -1520,10 +1530,14 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 04 04 04 // 00 00 // 00 - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, height, 0); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height, 4); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + height, 0); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), height, 4); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::topRightSide), height + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topCorner), height + 6 + 6, 0x1E); PaintUtilForceSetGeneralSupportHeight(session, height, 4); break; @@ -1534,11 +1548,14 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 05 05 05 ░░ ░░ ░░ // 1B 1B ▒▒ ▒▒ // 1B ▓▓ - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 6 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height, 5); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topCorner), height + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::topRightSide), height + 6, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), height, 5); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), height + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomCorner), height + 6 + 6, 0x1B); PaintUtilForceSetGeneralSupportHeight(session, height, 5); break; @@ -1549,9 +1566,15 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 06 06 06 ▓▓ ▒▒ ░░ // 06 06 ▒▒ ░░ // 06 ░░ - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner, height + 2, 6); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, height + 2 + 6, 6); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner, height + 2 + 6 + 6, 6); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::rightCorner, PaintSegment::bottomRightSide, PaintSegment::bottomCorner), + height + 2, 6); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + height + 2 + 6, 6); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner), + height + 2 + 6 + 6, 6); PaintUtilForceSetGeneralSupportHeight(session, height, 6); break; @@ -1562,113 +1585,169 @@ void PaintSurface(PaintSession& session, uint8_t direction, uint16_t height, con // 00 07 17 ▓▓ ▓▓ ░░ // 00 17 ▓▓ ▒▒ // 07 ▓▓ - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 4, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 4 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 7); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentLeftCorner, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::rightCorner), height + 4, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topRightSide, PaintSegment::bottomRightSide), height + 4 + 6, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), + height + 4 + 6 + 6, 7); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::leftCorner), + height + 4 + 6 + 6, 0); PaintUtilForceSetGeneralSupportHeight(session, height, 7); break; case 8: // Loc6620D8 - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, height, 0); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height, 8); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + height, 0); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), height, 8); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topRightSide, PaintSegment::bottomRightSide), height + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::rightCorner), height + 6 + 6, 0x1D); PaintUtilForceSetGeneralSupportHeight(session, height, 8); break; case 9: // Loc66216D PaintUtilForceSetGeneralSupportHeight(session, height, 9); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner, height + 2, 9); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, height + 2 + 6, 9); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, height + 2 + 6 + 6, 9); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner), height + 2, + 9); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + height + 2 + 6, 9); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + height + 2 + 6 + 6, 9); break; case 10: // Loc662206 PaintUtilForceSetGeneralSupportHeight(session, height, 0xA); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 6 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height, 0xA); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::leftCorner), height + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), height + 6, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), height, 0xA); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topRightSide, PaintSegment::bottomRightSide), height + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::rightCorner), height + 6 + 6, 0x1D); break; case 11: // Loc66229B PaintUtilForceSetGeneralSupportHeight(session, height, 0xB); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 4, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 4 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0xB); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentBottomCorner, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topCorner), height + 4, 0x1B); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::topRightSide), height + 4 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), + height + 4 + 6 + 6, 0xB); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::bottomCorner), + height + 4 + 6 + 6, 0); break; case 12: // Loc662334 PaintUtilForceSetGeneralSupportHeight(session, height, 0xC); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner, height + 2, 0xC); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, height + 2 + 6, 0xC); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner, height + 2 + 6 + 6, 0xC); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner), + height + 2, 0xC); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + height + 2 + 6, 0xC); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner), + height + 2 + 6 + 6, 0xC); break; case 13: // Loc6623CD PaintUtilForceSetGeneralSupportHeight(session, height, 0xD); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 4, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 4 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 0xD); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentRightCorner, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::leftCorner), height + 4, 0x1D); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), height + 4 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), + height + 4 + 6 + 6, 0xD); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topRightSide, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + height + 4 + 6 + 6, 0); break; case 14: // Loc662466 PaintUtilForceSetGeneralSupportHeight(session, height, 0xE); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 4, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 4 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0xE); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentTopCorner, height + 4 + 6 + 6, 0); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomCorner), height + 4, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), height + 4 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), + height + 4 + 6 + 6, 0xE); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::topCorner), + height + 4 + 6 + 6, 0); break; case 23: // Loc6624FF PaintUtilForceSetGeneralSupportHeight(session, height, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 4, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 4 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 4 + 6 + 6 + 6, 0x17); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 4 + 6 + 6 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::rightCorner), height + 4, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topRightSide, PaintSegment::bottomRightSide), height + 4 + 6, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), + height + 4 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), height + 4 + 6 + 6 + 6, 0x17); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::leftCorner), height + 4 + 6 + 6 + 6 + 6, 0x17); break; case 27: // Loc6625A0 PaintUtilForceSetGeneralSupportHeight(session, height, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 4, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 4 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 4 + 6 + 6 + 6, 0x1B); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 4 + 6 + 6 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topCorner), height + 4, 0x1B); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::topRightSide), height + 4 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), + height + 4 + 6 + 6, 0x1B); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), height + 4 + 6 + 6 + 6, + 0x1B); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomCorner), height + 4 + 6 + 6 + 6 + 6, 0x1B); break; case 29: // Loc662641 PaintUtilForceSetGeneralSupportHeight(session, height, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner, height + 4, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentBottomLeftSide, height + 4 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner | kSegmentCentre | kSegmentBottomCorner, height + 4 + 6 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopRightSide | kSegmentBottomRightSide, height + 4 + 6 + 6 + 6, 0x1D); - PaintUtilSetSegmentSupportHeight(session, kSegmentRightCorner, height + 4 + 6 + 6 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::leftCorner), height + 4, 0x1D); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), height + 4 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::bottomCorner), + height + 4 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topRightSide, PaintSegment::bottomRightSide), height + 4 + 6 + 6 + 6, 0x1D); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::rightCorner), height + 4 + 6 + 6 + 6 + 6, 0x1D); break; case 30: // Loc6626E2 PaintUtilForceSetGeneralSupportHeight(session, height, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomCorner, height + 4, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentBottomLeftSide | kSegmentBottomRightSide, height + 4 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentLeftCorner | kSegmentCentre | kSegmentRightCorner, height + 4 + 6 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopLeftSide | kSegmentTopRightSide, height + 4 + 6 + 6 + 6, 0x1E); - PaintUtilSetSegmentSupportHeight(session, kSegmentTopCorner, height + 4 + 6 + 6 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::bottomCorner), height + 4, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), height + 4 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::rightCorner), + height + 4 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight( + session, EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::topRightSide), height + 4 + 6 + 6 + 6, 0x1E); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::topCorner), height + 4 + 6 + 6 + 6 + 6, 0x1E); break; } } diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.cpp b/src/openrct2/paint/tile_element/Paint.TileElement.cpp index f60eca789c..0d4760f876 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.cpp +++ b/src/openrct2/paint/tile_element/Paint.TileElement.cpp @@ -38,9 +38,6 @@ static void BlankTilesPaint(PaintSession& session, int32_t x, int32_t y); static void PaintTileElementBase(PaintSession& session, const CoordsXY& origCoords); -const int32_t kSegmentsAll = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide - | kSegmentBottomLeftSide | kSegmentBottomRightSide; - /** * * rct2: 0x0068B35F @@ -378,7 +375,9 @@ void PaintUtilForceSetGeneralSupportHeight(PaintSession& session, int16_t height } const uint16_t segment_offsets[9] = { - kSegmentTopCorner, kSegmentLeftCorner, kSegmentRightCorner, kSegmentBottomCorner, kSegmentCentre, kSegmentTopLeftSide, kSegmentTopRightSide, kSegmentBottomLeftSide, kSegmentBottomRightSide, + EnumToFlag(PaintSegment::topCorner), EnumToFlag(PaintSegment::leftCorner), EnumToFlag(PaintSegment::rightCorner), + EnumToFlag(PaintSegment::bottomCorner), EnumToFlag(PaintSegment::centre), EnumToFlag(PaintSegment::topLeftSide), + EnumToFlag(PaintSegment::topRightSide), EnumToFlag(PaintSegment::bottomLeftSide), EnumToFlag(PaintSegment::bottomRightSide), }; void PaintUtilSetSegmentSupportHeight(PaintSession& session, int32_t segments, uint16_t height, uint8_t slope) @@ -399,7 +398,7 @@ void PaintUtilSetSegmentSupportHeight(PaintSession& session, int32_t segments, u uint16_t PaintUtilRotateSegments(uint16_t segments, uint8_t rotation) { - // Only kSegmentCentre falls beyond 0xFF, so this will be kept in place. + // Only the value representing PaintSegment::centre falls beyond 0xFF, so this will be kept in place. uint8_t temp = segments & 0xFF; temp = Numerics::rol8(temp, rotation * 2); diff --git a/src/openrct2/paint/tile_element/Paint.TileElement.h b/src/openrct2/paint/tile_element/Paint.TileElement.h index 5948d45a24..cea6ed18a4 100644 --- a/src/openrct2/paint/tile_element/Paint.TileElement.h +++ b/src/openrct2/paint/tile_element/Paint.TileElement.h @@ -27,19 +27,23 @@ enum edge_t }; // This controls in which segment of a tile something is drawn. -// This is from a screen perspective, e.g. kSegmentTopCorner will always represent the part of top of the screen. -enum +// This is from a screen perspective, e.g. topCorner will always represent the part of top of the screen. +enum class PaintSegment : uint16_t { - kSegmentTopCorner = (1 << 0), // 0 - kSegmentTopRightSide = (1 << 1), // 6 - kSegmentRightCorner = (1 << 2), // 2 - kSegmentBottomRightSide = (1 << 3), // 8 - kSegmentBottomCorner = (1 << 4), // 3 - kSegmentBottomLeftSide = (1 << 5), // 7 - kSegmentLeftCorner = (1 << 6), // 1 - kSegmentTopLeftSide = (1 << 7), // 5 - kSegmentCentre = (1 << 8), // 4 + topCorner = 0, + topRightSide = 1, + rightCorner = 2, + bottomRightSide = 3, + bottomCorner = 4, + bottomLeftSide = 5, + leftCorner = 6, + topLeftSide = 7, + centre = 8, }; +constexpr int32_t kSegmentsAll = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide); enum { @@ -73,7 +77,6 @@ enum TUNNEL_TYPE_COUNT }; -extern const int32_t kSegmentsAll; extern const uint16_t segment_offsets[9]; extern bool gShowSupportSegmentHeights; diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 364589ccfa..69735b0e89 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -114,10 +114,10 @@ const uint8_t edges_4x4[] = { // clang-format on const int32_t DiagBlockedSegments[] = { - kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentRightCorner, - kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentTopCorner, - kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide, - kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide, + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topLeftSide, PaintSegment::topCorner), + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide), + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::leftCorner, PaintSegment::topLeftSide), }; const MetalSupportPlace DiagSupportPlacement[] = { @@ -2138,16 +2138,28 @@ void TrackPaintUtilOnridePhotoPaint( } static constexpr uint16_t RightVerticalLoopSegments[] = { - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + EnumsToFlags(PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), 0, 0, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, - kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + EnumsToFlags(PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), }; void TrackPaintUtilRightVerticalLoopSegments(PaintSession& session, Direction direction, uint8_t trackSequence) @@ -2168,15 +2180,25 @@ void TrackPaintUtilLeftCorkscrewUpSupports(PaintSession& session, Direction dire if (direction == 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); } MetalASupportsPaintSetup(session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction != 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); } } diff --git a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp index ad358300c9..c49ec54db5 100644 --- a/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp +++ b/src/openrct2/ride/coaster/AirPoweredVerticalCoaster.cpp @@ -263,30 +263,47 @@ static void AirPoweredVerticalRCTrackRightQuarterTurn5( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre, + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: @@ -438,30 +455,47 @@ static void AirPoweredVerticalRCTrackBankedRightQuarterTurn5( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre, + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: diff --git a/src/openrct2/ride/coaster/AlpineCoaster.cpp b/src/openrct2/ride/coaster/AlpineCoaster.cpp index 31d7740c94..2ab9d5a0b0 100644 --- a/src/openrct2/ride/coaster/AlpineCoaster.cpp +++ b/src/openrct2/ride/coaster/AlpineCoaster.cpp @@ -88,7 +88,10 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -202,7 +205,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -283,7 +289,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -364,7 +373,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -427,7 +439,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -458,7 +476,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -498,7 +522,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -550,7 +580,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -583,7 +619,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -612,7 +651,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -645,7 +690,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -686,7 +734,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -738,7 +792,11 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -768,7 +826,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -797,13 +858,24 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -843,7 +915,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -888,7 +963,11 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -918,7 +997,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -947,13 +1029,24 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -994,7 +1087,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1048,7 +1144,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1076,7 +1178,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1104,7 +1212,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1168,7 +1282,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1205,7 +1325,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1233,7 +1359,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1261,7 +1393,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1325,7 +1463,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1362,7 +1506,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1390,7 +1540,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1418,7 +1574,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1482,7 +1644,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1519,7 +1687,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1547,7 +1721,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1575,7 +1755,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1639,7 +1825,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1676,7 +1868,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1704,7 +1902,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1732,7 +1936,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1796,7 +2006,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1833,7 +2049,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -1860,7 +2082,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -1887,7 +2115,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -1950,7 +2184,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -1988,7 +2228,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2016,7 +2262,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2044,7 +2296,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2108,7 +2366,13 @@ namespace AlpineRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2155,7 +2419,10 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2200,7 +2467,10 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2266,7 +2536,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2318,7 +2591,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2370,7 +2646,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2422,7 +2701,10 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2489,7 +2771,10 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2517,7 +2802,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2535,7 +2826,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2549,7 +2846,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2579,7 +2882,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2602,7 +2911,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2616,7 +2931,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2634,7 +2955,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2664,7 +2991,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2687,7 +3020,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2705,7 +3044,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2719,7 +3064,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2749,7 +3100,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2772,7 +3129,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2786,7 +3149,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -2804,7 +3173,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2834,7 +3209,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2857,7 +3238,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2875,7 +3262,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2889,7 +3282,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2919,7 +3318,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2942,7 +3347,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2956,7 +3367,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2974,7 +3391,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3004,7 +3427,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3027,7 +3456,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3045,7 +3480,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -3059,7 +3500,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -3089,7 +3536,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -3112,7 +3565,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3126,7 +3585,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -3144,7 +3609,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -3174,7 +3645,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -3197,7 +3674,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -3214,7 +3697,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -3227,7 +3716,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -3256,7 +3751,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -3280,7 +3781,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -3293,7 +3800,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -3310,7 +3823,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -3339,7 +3858,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -3363,7 +3888,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3381,7 +3912,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3395,7 +3932,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3425,7 +3968,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3448,7 +3997,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3462,7 +4017,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3480,7 +4041,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3510,7 +4077,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3533,7 +4106,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3547,7 +4126,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3561,7 +4146,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3591,7 +4182,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3614,7 +4211,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3628,7 +4231,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3642,7 +4251,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3672,7 +4287,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3719,7 +4340,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3750,7 +4377,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3793,7 +4426,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3848,7 +4487,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3881,7 +4526,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3910,7 +4558,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3943,7 +4597,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3987,7 +4644,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4039,7 +4702,11 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4069,7 +4736,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4098,13 +4768,24 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4144,7 +4825,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4189,7 +4873,11 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4219,7 +4907,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4248,13 +4939,24 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4295,7 +4997,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4356,7 +5061,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4402,7 +5113,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4446,7 +5163,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4497,7 +5220,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4557,7 +5286,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4590,7 +5325,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4619,7 +5357,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -4652,7 +5396,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4693,7 +5440,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4737,7 +5490,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4770,7 +5529,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4799,7 +5561,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -4832,7 +5600,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -4873,7 +5644,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4933,7 +5710,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4968,7 +5751,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5004,7 +5790,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5045,7 +5834,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5089,7 +5884,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5125,7 +5926,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5162,7 +5966,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5203,7 +6010,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5250,7 +6063,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5282,7 +6100,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5325,7 +6149,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5369,7 +6198,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5401,7 +6235,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5439,7 +6279,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5487,7 +6332,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5519,7 +6369,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5562,7 +6418,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5606,7 +6467,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5638,7 +6504,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5676,7 +6548,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5750,7 +6627,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5784,7 +6666,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5813,7 +6698,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5846,7 +6737,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5890,7 +6784,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5934,7 +6833,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5968,7 +6872,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5997,7 +6904,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -6030,7 +6943,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6069,7 +6985,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6116,7 +7037,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6150,7 +7076,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6179,7 +7108,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6212,7 +7147,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6261,7 +7199,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6305,7 +7248,12 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6339,7 +7287,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6368,7 +7319,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -6401,7 +7358,10 @@ namespace AlpineRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6445,7 +7405,12 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6505,7 +7470,10 @@ namespace AlpineRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -6550,7 +7518,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6596,7 +7570,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -6643,7 +7623,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6689,7 +7675,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -6733,7 +7725,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6782,7 +7780,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -6826,7 +7830,13 @@ namespace AlpineRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6875,7 +7885,13 @@ namespace AlpineRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } diff --git a/src/openrct2/ride/coaster/BobsleighCoaster.cpp b/src/openrct2/ride/coaster/BobsleighCoaster.cpp index f9dd7cec29..3dcc10d481 100644 --- a/src/openrct2/ride/coaster/BobsleighCoaster.cpp +++ b/src/openrct2/ride/coaster/BobsleighCoaster.cpp @@ -95,7 +95,10 @@ static void BobsleighRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -223,7 +226,10 @@ static void BobsleighRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -327,7 +333,10 @@ static void BobsleighRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -431,7 +440,10 @@ static void BobsleighRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -509,7 +521,13 @@ static void BobsleighRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -553,7 +571,11 @@ static void BobsleighRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -594,7 +616,13 @@ static void BobsleighRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -638,7 +666,11 @@ static void BobsleighRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -690,7 +722,13 @@ static void BobsleighRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -752,7 +790,10 @@ static void BobsleighRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -803,7 +844,10 @@ static void BobsleighRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -854,7 +898,10 @@ static void BobsleighRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -905,7 +952,10 @@ static void BobsleighRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -959,7 +1009,13 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1003,7 +1059,11 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1044,7 +1104,13 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1088,7 +1154,11 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1140,7 +1210,13 @@ static void BobsleighRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1209,7 +1285,10 @@ static void BobsleighRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1267,7 +1346,10 @@ static void BobsleighRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1325,7 +1407,10 @@ static void BobsleighRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1383,7 +1468,10 @@ static void BobsleighRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1466,7 +1554,10 @@ static void BobsleighRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1528,7 +1619,13 @@ static void BobsleighRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1573,7 +1670,11 @@ static void BobsleighRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1619,7 +1720,11 @@ static void BobsleighRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1671,7 +1776,13 @@ static void BobsleighRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1727,7 +1838,13 @@ static void BobsleighRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1773,7 +1890,11 @@ static void BobsleighRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1820,7 +1941,11 @@ static void BobsleighRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1872,7 +1997,13 @@ static void BobsleighRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1928,7 +2059,13 @@ static void BobsleighRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1971,7 +2108,13 @@ static void BobsleighRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2022,7 +2165,13 @@ static void BobsleighRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2087,7 +2236,13 @@ static void BobsleighRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2130,7 +2285,13 @@ static void BobsleighRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2181,7 +2342,13 @@ static void BobsleighRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2246,7 +2413,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2290,7 +2462,13 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2341,7 +2519,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2393,7 +2576,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2437,7 +2625,13 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2483,7 +2677,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2540,7 +2739,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2584,7 +2788,13 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2635,7 +2845,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2687,7 +2902,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2731,7 +2951,13 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2777,7 +3003,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2862,7 +3093,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2907,7 +3143,11 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2948,7 +3188,13 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2992,7 +3238,11 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3044,7 +3294,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3096,7 +3351,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3141,7 +3401,11 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3182,7 +3446,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3226,7 +3495,11 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3273,7 +3546,12 @@ static void BobsleighRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3330,7 +3608,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3375,7 +3658,11 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3416,7 +3703,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3460,7 +3752,11 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3512,7 +3808,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3564,7 +3865,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3609,7 +3915,11 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3650,7 +3960,13 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3694,7 +4010,11 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3741,7 +4061,12 @@ static void BobsleighRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3809,7 +4134,10 @@ static void BobsleighRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3847,7 +4175,10 @@ static void BobsleighRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp index 3a24b80486..eeb43bac0b 100644 --- a/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp +++ b/src/openrct2/ride/coaster/BolligerMabillardTrack.hpp @@ -96,7 +96,10 @@ static void BolligerMabillardTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -211,7 +214,10 @@ static void BolligerMabillardTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -289,7 +295,10 @@ static void BolligerMabillardTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -367,7 +376,10 @@ static void BolligerMabillardTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -457,7 +469,10 @@ static void BolligerMabillardTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -547,7 +562,10 @@ static void BolligerMabillardTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -625,7 +643,10 @@ static void BolligerMabillardTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -716,7 +737,13 @@ static void BolligerMabillardTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -748,7 +775,11 @@ static void BolligerMabillardTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -777,7 +808,13 @@ static void BolligerMabillardTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -809,7 +846,11 @@ static void BolligerMabillardTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -848,7 +889,13 @@ static void BolligerMabillardTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -904,7 +951,10 @@ static void BolligerMabillardTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -948,7 +998,10 @@ static void BolligerMabillardTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -992,7 +1045,10 @@ static void BolligerMabillardTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1036,7 +1092,10 @@ static void BolligerMabillardTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1087,7 +1146,13 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1119,7 +1184,11 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1148,7 +1217,13 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1180,7 +1255,11 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1222,7 +1301,13 @@ static void BolligerMabillardTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1285,7 +1370,10 @@ static void BolligerMabillardTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1336,7 +1424,10 @@ static void BolligerMabillardTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1387,7 +1478,10 @@ static void BolligerMabillardTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1438,7 +1532,10 @@ static void BolligerMabillardTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1512,7 +1609,10 @@ static void BolligerMabillardTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1561,7 +1661,13 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1591,7 +1697,11 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1619,7 +1729,13 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1649,7 +1765,11 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1688,7 +1808,13 @@ static void BolligerMabillardTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1731,7 +1857,13 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1761,7 +1893,11 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1789,7 +1925,12 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1819,7 +1960,11 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1858,7 +2003,13 @@ static void BolligerMabillardTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1921,7 +2072,13 @@ static void BolligerMabillardTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1952,7 +2109,11 @@ static void BolligerMabillardTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1984,7 +2145,11 @@ static void BolligerMabillardTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2023,7 +2188,13 @@ static void BolligerMabillardTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2066,7 +2237,13 @@ static void BolligerMabillardTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2097,7 +2274,11 @@ static void BolligerMabillardTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2129,7 +2310,11 @@ static void BolligerMabillardTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2168,7 +2353,13 @@ static void BolligerMabillardTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2215,7 +2406,11 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2249,7 +2444,11 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2278,7 +2477,13 @@ static void BolligerMabillardTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2303,7 +2508,11 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2335,7 +2544,11 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2364,7 +2577,13 @@ static void BolligerMabillardTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2397,7 +2616,11 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2440,7 +2663,11 @@ static void BolligerMabillardTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2717,7 +2944,13 @@ static void BolligerMabillardTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2748,7 +2981,13 @@ static void BolligerMabillardTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2786,7 +3025,13 @@ static void BolligerMabillardTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2842,7 +3087,13 @@ static void BolligerMabillardTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2873,7 +3124,13 @@ static void BolligerMabillardTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2914,7 +3171,13 @@ static void BolligerMabillardTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2963,7 +3226,13 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3003,7 +3272,13 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3042,7 +3317,13 @@ static void BolligerMabillardTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3089,7 +3370,13 @@ static void BolligerMabillardTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3155,7 +3442,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3187,7 +3479,13 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3228,7 +3526,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3270,7 +3573,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3302,7 +3610,13 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3338,7 +3652,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3385,7 +3704,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3417,7 +3741,13 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3458,7 +3788,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3500,7 +3835,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3532,7 +3872,13 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3568,7 +3914,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3645,7 +3996,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3678,7 +4034,11 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3707,7 +4067,13 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3739,7 +4105,11 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3781,7 +4151,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3823,7 +4198,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3856,7 +4236,11 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3885,7 +4269,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3917,7 +4306,11 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3954,7 +4347,12 @@ static void BolligerMabillardTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4001,7 +4399,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4034,7 +4437,11 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4063,7 +4470,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4095,7 +4507,11 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4144,7 +4560,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4186,7 +4607,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4219,7 +4645,11 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4248,7 +4678,13 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4280,7 +4716,11 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4324,7 +4764,12 @@ static void BolligerMabillardTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4495,7 +4940,10 @@ static void BolligerMabillardTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4540,7 +4988,10 @@ static void BolligerMabillardTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4585,7 +5036,10 @@ static void BolligerMabillardTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4676,7 +5130,10 @@ static void BolligerMabillardTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4729,7 +5186,10 @@ static void BolligerMabillardTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4784,7 +5244,10 @@ static void BolligerMabillardTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -4824,7 +5287,10 @@ static void BolligerMabillardTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -4869,7 +5335,10 @@ static void BolligerMabillardTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4898,7 +5367,11 @@ static void BolligerMabillardTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4927,13 +5400,24 @@ static void BolligerMabillardTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4970,7 +5454,11 @@ static void BolligerMabillardTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5014,7 +5502,10 @@ static void BolligerMabillardTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5043,7 +5534,11 @@ static void BolligerMabillardTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5072,13 +5567,24 @@ static void BolligerMabillardTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5115,7 +5621,11 @@ static void BolligerMabillardTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5179,7 +5689,10 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5208,7 +5721,11 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5237,13 +5754,24 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5280,7 +5808,11 @@ static void BolligerMabillardTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5324,7 +5856,10 @@ static void BolligerMabillardTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5353,7 +5888,11 @@ static void BolligerMabillardTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5382,13 +5921,24 @@ static void BolligerMabillardTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5425,7 +5975,11 @@ static void BolligerMabillardTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5483,7 +6037,13 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5510,7 +6070,12 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5537,7 +6102,13 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5592,7 +6163,13 @@ static void BolligerMabillardTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5629,7 +6206,13 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5656,7 +6239,12 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5683,7 +6271,13 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5738,7 +6332,13 @@ static void BolligerMabillardTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5775,7 +6375,13 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5802,7 +6408,12 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5829,7 +6440,13 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5884,7 +6501,13 @@ static void BolligerMabillardTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5921,7 +6544,13 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5948,7 +6577,12 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5975,7 +6609,13 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6030,7 +6670,13 @@ static void BolligerMabillardTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6067,7 +6713,13 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6094,7 +6746,12 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6121,7 +6778,13 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6176,7 +6839,13 @@ static void BolligerMabillardTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6213,7 +6882,13 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6240,7 +6915,12 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6267,7 +6947,13 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6322,7 +7008,13 @@ static void BolligerMabillardTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6359,7 +7051,13 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6386,7 +7084,12 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6413,7 +7116,13 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6468,7 +7177,13 @@ static void BolligerMabillardTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6505,7 +7220,13 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6532,7 +7253,12 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6559,7 +7285,13 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6614,7 +7346,13 @@ static void BolligerMabillardTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6651,7 +7389,13 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6678,7 +7422,12 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6705,7 +7454,13 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6760,7 +7515,13 @@ static void BolligerMabillardTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6797,7 +7558,13 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6823,7 +7590,12 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6849,7 +7621,13 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6903,7 +7681,13 @@ static void BolligerMabillardTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -6941,7 +7725,13 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6968,7 +7758,12 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6995,7 +7790,13 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7050,7 +7851,13 @@ static void BolligerMabillardTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7087,7 +7894,13 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7114,7 +7927,12 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7141,7 +7959,13 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7196,7 +8020,13 @@ static void BolligerMabillardTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7233,7 +8063,13 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7260,7 +8096,12 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7287,7 +8128,13 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7342,7 +8189,13 @@ static void BolligerMabillardTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7379,7 +8232,13 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7406,7 +8265,12 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7433,7 +8297,13 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7488,7 +8358,13 @@ static void BolligerMabillardTrackDiagFlatTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -7525,7 +8401,13 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7552,7 +8434,12 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7579,7 +8466,13 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7634,7 +8527,13 @@ static void BolligerMabillardTrackDiag60DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7671,7 +8570,13 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7698,7 +8603,12 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7725,7 +8635,13 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7780,7 +8696,13 @@ static void BolligerMabillardTrackDiagFlatTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7817,7 +8739,13 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7844,7 +8772,12 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7871,7 +8804,13 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7926,7 +8865,13 @@ static void BolligerMabillardTrackDiag60DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -7949,7 +8894,13 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7965,7 +8916,12 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7978,7 +8934,13 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8005,7 +8967,13 @@ static void BolligerMabillardTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8028,7 +8996,13 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8041,7 +9015,12 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8057,7 +9036,13 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8084,7 +9069,13 @@ static void BolligerMabillardTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8107,7 +9098,13 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8123,7 +9120,12 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8136,7 +9138,13 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8163,7 +9171,13 @@ static void BolligerMabillardTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8186,7 +9200,13 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8199,7 +9219,12 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8215,7 +9240,13 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8242,7 +9273,13 @@ static void BolligerMabillardTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8265,7 +9302,13 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8281,7 +9324,12 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8294,7 +9342,13 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8321,7 +9375,13 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8344,7 +9404,13 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8357,7 +9423,12 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8373,7 +9444,13 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8400,7 +9477,13 @@ static void BolligerMabillardTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8423,7 +9506,13 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8439,7 +9528,12 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8452,7 +9546,13 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8479,7 +9579,13 @@ static void BolligerMabillardTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8502,7 +9608,13 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8515,7 +9627,12 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8531,7 +9648,13 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8558,7 +9681,13 @@ static void BolligerMabillardTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8581,7 +9710,13 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8596,7 +9731,12 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8608,7 +9748,13 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8634,7 +9780,13 @@ static void BolligerMabillardTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8658,7 +9810,13 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8670,7 +9828,12 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8685,7 +9848,13 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8711,7 +9880,13 @@ static void BolligerMabillardTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8735,7 +9910,13 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8751,7 +9932,12 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8764,7 +9950,13 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8791,7 +9983,13 @@ static void BolligerMabillardTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8814,7 +10012,13 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8827,7 +10031,12 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8843,7 +10052,13 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8870,7 +10085,13 @@ static void BolligerMabillardTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8893,7 +10114,13 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8906,7 +10133,12 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8919,7 +10151,13 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8946,7 +10184,13 @@ static void BolligerMabillardTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8969,7 +10213,13 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8982,7 +10232,12 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8995,7 +10250,13 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9022,7 +10283,13 @@ static void BolligerMabillardTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9064,7 +10331,13 @@ static void BolligerMabillardTrackLeftBankToLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9104,7 +10377,13 @@ static void BolligerMabillardTrackLeftBankToLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9146,7 +10425,13 @@ static void BolligerMabillardTrackRightBankToRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9193,7 +10478,13 @@ static void BolligerMabillardTrackRightBankToRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9239,7 +10530,13 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegDownToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9282,7 +10579,13 @@ static void BolligerMabillardTrackLeftQuarterTurn325DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9321,7 +10624,13 @@ static void BolligerMabillardTrackRightQuarterTurn325DegDownToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -9364,7 +10673,13 @@ static void BolligerMabillardTrackRightQuarterTurn325DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -9397,7 +10712,10 @@ static void BolligerMabillardTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9435,7 +10753,13 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9477,7 +10801,13 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9517,7 +10847,13 @@ static void BolligerMabillardTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9566,7 +10902,13 @@ static void BolligerMabillardTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9629,7 +10971,13 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9660,7 +11008,11 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9688,7 +11040,13 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -9720,7 +11078,11 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9759,7 +11121,13 @@ static void BolligerMabillardTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9802,7 +11170,13 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9833,7 +11207,11 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9861,7 +11239,12 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -9893,7 +11276,11 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -9932,7 +11319,13 @@ static void BolligerMabillardTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10002,7 +11395,10 @@ static void BolligerMabillardTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10050,7 +11446,10 @@ static void BolligerMabillardTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10098,7 +11497,10 @@ static void BolligerMabillardTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10146,7 +11548,10 @@ static void BolligerMabillardTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -10227,7 +11632,10 @@ static void BolligerMabillardTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10272,7 +11680,10 @@ static void BolligerMabillardTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10317,7 +11728,10 @@ static void BolligerMabillardTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10362,7 +11776,10 @@ static void BolligerMabillardTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10446,7 +11863,10 @@ static void BolligerMabillardTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10494,7 +11914,10 @@ static void BolligerMabillardTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -10542,7 +11965,10 @@ static void BolligerMabillardTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10590,7 +12016,10 @@ static void BolligerMabillardTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -10669,7 +12098,10 @@ static void BolligerMabillardTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -10716,7 +12148,10 @@ static void BolligerMabillardTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -10823,7 +12258,10 @@ static void BolligerMabillardTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -10907,7 +12345,10 @@ static void BolligerMabillardTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -10971,7 +12412,10 @@ static void BolligerMabillardTrackBrakeForDrop( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -11009,7 +12453,10 @@ static void BolligerMabillardTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11070,7 +12517,11 @@ static void BolligerMabillardTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -11099,7 +12550,10 @@ static void BolligerMabillardTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11206,7 +12660,12 @@ static void BolligerMabillardTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -11261,7 +12720,12 @@ static void BolligerMabillardTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11318,7 +12782,12 @@ static void BolligerMabillardTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -11394,7 +12863,10 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11426,7 +12898,10 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 7, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11458,7 +12933,10 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -11499,7 +12977,10 @@ static void BolligerMabillardTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -11546,7 +13027,10 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -11578,7 +13062,10 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 16, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -11610,7 +13097,10 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11651,7 +13141,10 @@ static void BolligerMabillardTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -11731,7 +13224,12 @@ static void BolligerMabillardTrackLeftBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -11773,7 +13271,11 @@ static void BolligerMabillardTrackLeftBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11823,7 +13325,12 @@ static void BolligerMabillardTrackLeftBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11886,7 +13393,12 @@ static void BolligerMabillardTrackRightBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -11928,7 +13440,11 @@ static void BolligerMabillardTrackRightBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11978,7 +13494,12 @@ static void BolligerMabillardTrackRightBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -12041,7 +13562,10 @@ static void BolligerMabillardTrackPoweredLift( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -12082,7 +13606,10 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12111,7 +13638,10 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 9, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12140,7 +13670,11 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -12178,7 +13712,11 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12207,7 +13745,13 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -12236,7 +13780,11 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12270,7 +13818,11 @@ static void BolligerMabillardTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -12314,7 +13866,10 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12343,7 +13898,10 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 9, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12372,7 +13930,11 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -12410,7 +13972,11 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12439,7 +14005,13 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -12468,7 +14040,11 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -12502,7 +14078,11 @@ static void BolligerMabillardTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -12557,7 +14137,10 @@ static void BolligerMabillardTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12585,7 +14168,10 @@ static void BolligerMabillardTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12617,7 +14203,10 @@ static void BolligerMabillardTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12658,7 +14247,10 @@ void BolligerMabillardTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -12700,7 +14292,11 @@ static void BolligerMabillardTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12726,7 +14322,11 @@ static void BolligerMabillardTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12752,7 +14352,11 @@ static void BolligerMabillardTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -12808,7 +14412,11 @@ static void BolligerMabillardTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12834,7 +14442,11 @@ static void BolligerMabillardTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12860,7 +14472,11 @@ static void BolligerMabillardTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -12907,7 +14523,11 @@ static void BolligerMabillardTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -12939,7 +14559,11 @@ static void BolligerMabillardTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12979,7 +14603,11 @@ static void BolligerMabillardTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -13015,7 +14643,11 @@ static void BolligerMabillardTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup(session, supportType, MetalSupportPlace::Centre, 0, height + 4, session.SupportColours); @@ -13047,7 +14679,11 @@ static void BolligerMabillardTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -13087,7 +14723,11 @@ static void BolligerMabillardTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; diff --git a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp index 2c628ff3d4..abeb498630 100644 --- a/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicWoodenRollerCoaster.cpp @@ -774,13 +774,19 @@ static void ClassicWoodenRCTrackBankedRightQuarterTurn5( }; static constexpr int blockedSegments[7] = { - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentsAll, + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + kSegmentsAll, }; WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); @@ -938,10 +944,12 @@ static void ClassicWoodenRCTrackRightQuarterTurn3Bank( }; static constexpr int blockedSegments[4] = { - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentsAll, 0, - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags(PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), }; WoodenRCTrackPaintBb(session, &imageIds[direction][trackSequence][0], height); @@ -1145,11 +1153,7 @@ static void ClassicWoodenRCTrackLeftEighthBankToDiag( }; static constexpr int blockedSegments[5] = { - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentsAll, kSegmentsAll, kSegmentsAll, kSegmentsAll, kSegmentsAll, }; if (trackSequence == 0 && (direction == 0 || direction == 3)) @@ -1348,11 +1352,7 @@ static void ClassicWoodenRCTrackRightEighthBankToDiag( }; static constexpr int blockedSegments[5] = { - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + kSegmentsAll, kSegmentsAll, kSegmentsAll, kSegmentsAll, kSegmentsAll, }; if (trackSequence == 0 && (direction == 0 || direction == 3)) diff --git a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp index 1d550776f6..d01bfff6ce 100644 --- a/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp +++ b/src/openrct2/ride/coaster/CompactInvertedCoaster.cpp @@ -83,7 +83,10 @@ static void CompactInvertedRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -181,7 +184,10 @@ static void CompactInvertedRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -286,7 +292,10 @@ static void CompactInvertedRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -349,7 +358,10 @@ static void CompactInvertedRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -466,7 +478,10 @@ static void CompactInvertedRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -541,7 +556,10 @@ static void CompactInvertedRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -639,7 +657,10 @@ static void CompactInvertedRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -759,7 +780,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -797,7 +823,11 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -825,7 +855,13 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -855,7 +891,11 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -885,7 +925,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -944,8 +989,12 @@ static void CompactInvertedRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -987,8 +1036,12 @@ static void CompactInvertedRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1030,8 +1083,12 @@ static void CompactInvertedRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1073,8 +1130,12 @@ static void CompactInvertedRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1118,7 +1179,12 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -1156,7 +1222,11 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1184,7 +1254,13 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1214,7 +1290,11 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1244,7 +1324,12 @@ static void CompactInvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -1303,8 +1388,12 @@ static void CompactInvertedRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1374,8 +1463,12 @@ static void CompactInvertedRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1445,8 +1538,12 @@ static void CompactInvertedRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1516,8 +1613,12 @@ static void CompactInvertedRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1619,8 +1720,12 @@ static void CompactInvertedRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1668,7 +1773,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -1704,7 +1814,11 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1729,7 +1843,13 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1757,7 +1877,11 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1783,7 +1907,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -1831,7 +1960,12 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -1867,7 +2001,11 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1892,7 +2030,12 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1920,7 +2063,11 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1946,7 +2093,12 @@ static void CompactInvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 48, session.SupportColours); @@ -2016,7 +2168,13 @@ static void CompactInvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2051,7 +2209,11 @@ static void CompactInvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2094,7 +2256,11 @@ static void CompactInvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2138,7 +2304,13 @@ static void CompactInvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2189,7 +2361,13 @@ static void CompactInvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2224,7 +2402,11 @@ static void CompactInvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2267,7 +2449,11 @@ static void CompactInvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2311,7 +2497,13 @@ static void CompactInvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -2364,7 +2556,10 @@ static void CompactInvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2449,7 +2644,13 @@ static void CompactInvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2478,7 +2679,11 @@ static void CompactInvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2514,7 +2719,11 @@ static void CompactInvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2543,7 +2752,13 @@ static void CompactInvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2601,7 +2816,10 @@ static void CompactInvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2677,7 +2895,10 @@ static void CompactInvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2762,7 +2983,13 @@ static void CompactInvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2791,7 +3018,11 @@ static void CompactInvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2827,7 +3058,11 @@ static void CompactInvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2856,7 +3091,12 @@ static void CompactInvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2914,7 +3154,10 @@ static void CompactInvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2988,7 +3231,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3026,7 +3274,13 @@ static void CompactInvertedRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3055,7 +3309,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3116,7 +3375,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3155,7 +3419,13 @@ static void CompactInvertedRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3184,7 +3454,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3241,7 +3516,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3280,7 +3560,12 @@ static void CompactInvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3328,7 +3613,12 @@ static void CompactInvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3367,7 +3657,12 @@ static void CompactInvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -3434,7 +3729,11 @@ static void CompactInvertedRCTrackLeftTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3467,7 +3766,11 @@ static void CompactInvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3504,7 +3807,11 @@ static void CompactInvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3541,7 +3848,11 @@ static void CompactInvertedRCTrackRightTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3574,7 +3885,11 @@ static void CompactInvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3611,7 +3926,11 @@ static void CompactInvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3653,7 +3972,11 @@ static void CompactInvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3679,7 +4002,11 @@ static void CompactInvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3706,7 +4033,11 @@ static void CompactInvertedRCTrackLeftTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3760,7 +4091,11 @@ static void CompactInvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3786,7 +4121,11 @@ static void CompactInvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3813,7 +4152,11 @@ static void CompactInvertedRCTrackRightTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3865,7 +4208,10 @@ static void CompactInvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3949,7 +4295,11 @@ static void CompactInvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3982,7 +4332,10 @@ static void CompactInvertedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4031,7 +4384,10 @@ static void CompactInvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4107,7 +4463,10 @@ static void CompactInvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4149,7 +4508,10 @@ static void CompactInvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4225,7 +4587,10 @@ static void CompactInvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4376,7 +4741,10 @@ static void CompactInvertedRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -4420,7 +4788,12 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4460,7 +4833,11 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4489,7 +4866,13 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4521,7 +4904,11 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4551,7 +4938,12 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -4603,7 +4995,12 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4643,7 +5040,11 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4672,7 +5073,12 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4704,7 +5110,11 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4734,7 +5144,12 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -4786,7 +5201,12 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -4826,7 +5246,11 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4855,7 +5279,13 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4887,7 +5317,11 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4917,7 +5351,12 @@ static void CompactInvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -4969,7 +5408,12 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 56, session.SupportColours); @@ -5009,7 +5453,11 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5038,7 +5486,12 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5070,7 +5523,11 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5100,7 +5557,12 @@ static void CompactInvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5217,7 +5679,10 @@ static void CompactInvertedRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5299,7 +5764,10 @@ static void CompactInvertedRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5382,7 +5850,10 @@ static void CompactInvertedRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } @@ -5451,7 +5922,10 @@ static void CompactInvertedRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -5492,7 +5966,10 @@ static void CompactInvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -5528,7 +6005,11 @@ static void CompactInvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5557,13 +6038,24 @@ static void CompactInvertedRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5593,7 +6085,11 @@ static void CompactInvertedRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5657,7 +6153,10 @@ static void CompactInvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -5693,7 +6192,11 @@ static void CompactInvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5722,13 +6225,24 @@ static void CompactInvertedRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5758,7 +6272,11 @@ static void CompactInvertedRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5840,7 +6358,13 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -5876,7 +6400,11 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5905,13 +6433,24 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5942,7 +6481,10 @@ static void CompactInvertedRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6006,7 +6548,13 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -6042,7 +6590,11 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6071,13 +6623,24 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -6108,7 +6671,10 @@ static void CompactInvertedRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6188,7 +6754,13 @@ static void CompactInvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6215,7 +6787,12 @@ static void CompactInvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6242,7 +6819,13 @@ static void CompactInvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6270,7 +6853,13 @@ static void CompactInvertedRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6370,7 +6959,13 @@ static void CompactInvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6397,7 +6992,12 @@ static void CompactInvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6424,7 +7024,13 @@ static void CompactInvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6452,7 +7058,13 @@ static void CompactInvertedRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6499,7 +7111,13 @@ static void CompactInvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -6512,7 +7130,12 @@ static void CompactInvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -6525,7 +7148,13 @@ static void CompactInvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -6539,7 +7168,13 @@ static void CompactInvertedRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6600,7 +7235,13 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6627,7 +7268,12 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -6654,7 +7300,13 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -6682,7 +7334,13 @@ static void CompactInvertedRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6729,7 +7387,13 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6742,7 +7406,12 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6755,7 +7424,13 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6769,7 +7444,13 @@ static void CompactInvertedRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6816,7 +7497,13 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6829,7 +7516,12 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6842,7 +7534,13 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6856,7 +7554,13 @@ static void CompactInvertedRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6917,7 +7621,13 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6944,7 +7654,12 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6971,7 +7686,13 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6999,7 +7720,13 @@ static void CompactInvertedRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7060,7 +7787,13 @@ static void CompactInvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7087,7 +7820,12 @@ static void CompactInvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7114,7 +7852,13 @@ static void CompactInvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7142,7 +7886,13 @@ static void CompactInvertedRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7189,7 +7939,13 @@ static void CompactInvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -7202,7 +7958,12 @@ static void CompactInvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -7215,7 +7976,13 @@ static void CompactInvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -7229,7 +7996,13 @@ static void CompactInvertedRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7290,7 +8063,13 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7316,7 +8095,12 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7342,7 +8126,13 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7369,7 +8159,13 @@ static void CompactInvertedRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7416,7 +8212,13 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7429,7 +8231,12 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7442,7 +8249,13 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7456,7 +8269,13 @@ static void CompactInvertedRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7503,7 +8322,13 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7516,7 +8341,12 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7529,7 +8359,13 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7543,7 +8379,13 @@ static void CompactInvertedRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7604,7 +8446,13 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7631,7 +8479,12 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7658,7 +8511,13 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7686,7 +8545,13 @@ static void CompactInvertedRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7733,7 +8598,13 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7746,7 +8617,12 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7759,7 +8635,13 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7773,7 +8655,12 @@ static void CompactInvertedRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7821,7 +8708,13 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7834,7 +8727,12 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7847,7 +8745,13 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7861,7 +8765,12 @@ static void CompactInvertedRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7909,7 +8818,13 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7922,7 +8837,12 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7935,7 +8855,13 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7949,7 +8875,12 @@ static void CompactInvertedRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7997,7 +8928,13 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8010,7 +8947,12 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8023,7 +8965,13 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8037,7 +8985,12 @@ static void CompactInvertedRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8085,7 +9038,13 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8098,7 +9057,12 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8111,7 +9075,13 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8125,7 +9095,13 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8172,7 +9148,13 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8185,7 +9167,12 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8198,7 +9185,13 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8212,7 +9205,13 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8259,7 +9258,13 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8272,7 +9277,12 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8285,7 +9295,13 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8299,7 +9315,13 @@ static void CompactInvertedRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8346,7 +9368,13 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8359,7 +9387,12 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8372,7 +9405,13 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8386,7 +9425,13 @@ static void CompactInvertedRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8433,7 +9478,13 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8445,7 +9496,12 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8457,7 +9513,13 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8470,7 +9532,13 @@ static void CompactInvertedRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8517,7 +9585,13 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8529,7 +9603,12 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8541,7 +9620,13 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8554,7 +9639,13 @@ static void CompactInvertedRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8601,7 +9692,13 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8614,7 +9711,12 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8627,7 +9729,13 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8641,7 +9749,13 @@ static void CompactInvertedRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8688,7 +9802,13 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8701,7 +9821,12 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8714,7 +9839,13 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8728,7 +9859,13 @@ static void CompactInvertedRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8775,7 +9912,13 @@ static void CompactInvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8788,7 +9931,12 @@ static void CompactInvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8801,7 +9949,13 @@ static void CompactInvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8815,7 +9969,12 @@ static void CompactInvertedRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8863,7 +10022,13 @@ static void CompactInvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8876,7 +10041,12 @@ static void CompactInvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8889,7 +10059,13 @@ static void CompactInvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8903,7 +10079,12 @@ static void CompactInvertedRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8956,7 +10137,10 @@ static void CompactInvertedRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp index 2293fd0e7d..a99e9d3649 100644 --- a/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/CorkscrewRollerCoaster.cpp @@ -113,7 +113,10 @@ static void CorkscrewRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -228,7 +231,10 @@ static void CorkscrewRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -308,7 +314,10 @@ static void CorkscrewRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -388,7 +397,10 @@ static void CorkscrewRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -480,7 +492,10 @@ static void CorkscrewRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -572,7 +587,10 @@ static void CorkscrewRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -652,7 +670,10 @@ static void CorkscrewRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -742,7 +763,13 @@ static void CorkscrewRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -774,7 +801,11 @@ static void CorkscrewRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -803,7 +834,13 @@ static void CorkscrewRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -835,7 +872,11 @@ static void CorkscrewRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -875,7 +916,13 @@ static void CorkscrewRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -931,7 +978,10 @@ static void CorkscrewRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -976,7 +1026,10 @@ static void CorkscrewRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1021,7 +1074,10 @@ static void CorkscrewRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1066,7 +1122,10 @@ static void CorkscrewRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1111,7 +1170,13 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1143,7 +1208,11 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1172,7 +1241,13 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1204,7 +1279,11 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1247,7 +1326,13 @@ static void CorkscrewRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1310,7 +1395,10 @@ static void CorkscrewRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1362,7 +1450,10 @@ static void CorkscrewRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1414,7 +1505,10 @@ static void CorkscrewRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1466,7 +1560,10 @@ static void CorkscrewRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1537,7 +1634,10 @@ static void CorkscrewRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1587,7 +1687,13 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1617,7 +1723,11 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1645,7 +1755,13 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1675,7 +1791,11 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1715,7 +1835,13 @@ static void CorkscrewRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1759,7 +1885,13 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1789,7 +1921,11 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1817,7 +1953,12 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1847,7 +1988,11 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1887,7 +2032,13 @@ static void CorkscrewRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1949,7 +2100,13 @@ static void CorkscrewRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1980,7 +2137,11 @@ static void CorkscrewRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2012,7 +2173,11 @@ static void CorkscrewRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2052,7 +2217,13 @@ static void CorkscrewRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2096,7 +2267,13 @@ static void CorkscrewRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2128,7 +2305,11 @@ static void CorkscrewRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2161,7 +2342,11 @@ static void CorkscrewRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2201,7 +2386,13 @@ static void CorkscrewRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2248,7 +2439,11 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2282,7 +2477,11 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2311,7 +2510,13 @@ static void CorkscrewRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2336,7 +2541,11 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2368,7 +2577,11 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2397,7 +2610,13 @@ static void CorkscrewRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2430,7 +2649,11 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2473,7 +2696,11 @@ static void CorkscrewRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2753,7 +2980,13 @@ static void CorkscrewRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2784,7 +3017,13 @@ static void CorkscrewRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2823,7 +3062,13 @@ static void CorkscrewRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2879,7 +3124,13 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2910,7 +3161,13 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2952,7 +3209,13 @@ static void CorkscrewRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3001,7 +3264,13 @@ static void CorkscrewRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3042,7 +3311,13 @@ static void CorkscrewRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3082,7 +3357,13 @@ static void CorkscrewRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3129,7 +3410,13 @@ static void CorkscrewRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3187,7 +3474,10 @@ static void CorkscrewRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3248,7 +3538,11 @@ static void CorkscrewRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3277,7 +3571,10 @@ static void CorkscrewRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3384,7 +3681,12 @@ static void CorkscrewRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3441,7 +3743,12 @@ static void CorkscrewRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3498,7 +3805,12 @@ static void CorkscrewRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3574,7 +3886,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3606,7 +3923,13 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3648,7 +3971,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3691,7 +4019,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3723,7 +4056,13 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3760,7 +4099,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3808,7 +4152,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3840,7 +4189,13 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3882,7 +4237,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3925,7 +4285,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3957,7 +4322,13 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3994,7 +4365,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4070,7 +4446,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4103,7 +4484,11 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4132,7 +4517,13 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4164,7 +4555,11 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4207,7 +4602,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4250,7 +4650,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4283,7 +4688,11 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4312,7 +4721,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4344,7 +4758,11 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4382,7 +4800,12 @@ static void CorkscrewRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4430,7 +4853,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4463,7 +4891,11 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4492,7 +4924,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4524,7 +4961,11 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4567,7 +5008,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4610,7 +5056,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4643,7 +5094,11 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4672,7 +5127,13 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4704,7 +5165,11 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4742,7 +5207,12 @@ static void CorkscrewRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4910,7 +5380,10 @@ static void CorkscrewRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4991,7 +5464,10 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5024,7 +5500,10 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 7, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5057,7 +5536,10 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -5099,7 +5581,10 @@ static void CorkscrewRCTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -5146,7 +5631,10 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -5179,7 +5667,10 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 16, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -5212,7 +5703,10 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5254,7 +5748,10 @@ static void CorkscrewRCTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -5314,7 +5811,10 @@ static void CorkscrewRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5343,7 +5843,11 @@ static void CorkscrewRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5372,13 +5876,24 @@ static void CorkscrewRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5415,7 +5930,11 @@ static void CorkscrewRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5460,7 +5979,10 @@ static void CorkscrewRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5489,7 +6011,11 @@ static void CorkscrewRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5518,13 +6044,24 @@ static void CorkscrewRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5561,7 +6098,11 @@ static void CorkscrewRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5624,7 +6165,10 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5653,7 +6197,11 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5682,13 +6230,24 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5725,7 +6284,11 @@ static void CorkscrewRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5770,7 +6333,10 @@ static void CorkscrewRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5799,7 +6365,11 @@ static void CorkscrewRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5828,13 +6398,24 @@ static void CorkscrewRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5871,7 +6452,11 @@ static void CorkscrewRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5927,7 +6512,13 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5954,7 +6545,12 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5981,7 +6577,13 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6040,7 +6642,13 @@ static void CorkscrewRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6116,7 +6724,13 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6143,7 +6757,12 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6170,7 +6789,13 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6229,7 +6854,13 @@ static void CorkscrewRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6266,7 +6897,13 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6293,7 +6930,12 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6320,7 +6962,13 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6381,7 +7029,13 @@ static void CorkscrewRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6418,7 +7072,13 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6445,7 +7105,12 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6472,7 +7137,13 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6531,7 +7202,13 @@ static void CorkscrewRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6568,7 +7245,13 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6595,7 +7278,12 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6622,7 +7310,13 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6683,7 +7377,13 @@ static void CorkscrewRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6720,7 +7420,13 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6747,7 +7453,12 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6774,7 +7485,13 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6835,7 +7552,13 @@ static void CorkscrewRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6872,7 +7595,13 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6899,7 +7628,12 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6926,7 +7660,13 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6985,7 +7725,13 @@ static void CorkscrewRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7022,7 +7768,13 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7049,7 +7801,12 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7076,7 +7833,13 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7135,7 +7898,13 @@ static void CorkscrewRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7172,7 +7941,13 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -7199,7 +7974,12 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -7226,7 +8006,13 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -7287,7 +8073,13 @@ static void CorkscrewRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -7324,7 +8116,13 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7350,7 +8148,12 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7376,7 +8179,13 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7434,7 +8243,13 @@ static void CorkscrewRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -7472,7 +8287,13 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7499,7 +8320,12 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7526,7 +8352,13 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7587,7 +8419,13 @@ static void CorkscrewRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7624,7 +8462,13 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7651,7 +8495,12 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7678,7 +8527,13 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7737,7 +8592,13 @@ static void CorkscrewRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7774,7 +8635,13 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7801,7 +8668,12 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7828,7 +8700,13 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7887,7 +8765,13 @@ static void CorkscrewRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7910,7 +8794,13 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7926,7 +8816,12 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7939,7 +8834,13 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7966,7 +8867,13 @@ static void CorkscrewRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7989,7 +8896,13 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8002,7 +8915,12 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8018,7 +8936,13 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8045,7 +8969,13 @@ static void CorkscrewRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8068,7 +8998,13 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8084,7 +9020,12 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8097,7 +9038,13 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8124,7 +9071,13 @@ static void CorkscrewRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8147,7 +9100,13 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8160,7 +9119,12 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8176,7 +9140,13 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8203,7 +9173,13 @@ static void CorkscrewRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8226,7 +9202,13 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8242,7 +9224,12 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8255,7 +9242,13 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8282,7 +9275,13 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8305,7 +9304,13 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8318,7 +9323,12 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8334,7 +9344,13 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8361,7 +9377,13 @@ static void CorkscrewRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8384,7 +9406,13 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8400,7 +9428,12 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8413,7 +9446,13 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8440,7 +9479,13 @@ static void CorkscrewRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8463,7 +9508,13 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8476,7 +9527,12 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8492,7 +9548,13 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8519,7 +9581,13 @@ static void CorkscrewRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8542,7 +9610,13 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8557,7 +9631,12 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8569,7 +9648,13 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8595,7 +9680,13 @@ static void CorkscrewRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8619,7 +9710,13 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8631,7 +9728,12 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8646,7 +9748,13 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8672,7 +9780,13 @@ static void CorkscrewRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8696,7 +9810,13 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8712,7 +9832,12 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8725,7 +9850,13 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8752,7 +9883,13 @@ static void CorkscrewRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8775,7 +9912,13 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8788,7 +9931,12 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8804,7 +9952,13 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8831,7 +9985,13 @@ static void CorkscrewRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8854,7 +10014,13 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8867,7 +10033,12 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8880,7 +10051,13 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8907,7 +10084,13 @@ static void CorkscrewRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8930,7 +10113,13 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8943,7 +10132,12 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8956,7 +10150,13 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8983,7 +10183,13 @@ static void CorkscrewRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9001,7 +10207,10 @@ static void CorkscrewRCTrackBlockBrakes( MetalASupportsPaintSetup(session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9048,7 +10257,10 @@ static void CorkscrewRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9086,7 +10298,11 @@ static void CorkscrewRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9112,7 +10328,11 @@ static void CorkscrewRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9138,7 +10358,11 @@ static void CorkscrewRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9191,7 +10415,11 @@ static void CorkscrewRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9217,7 +10445,11 @@ static void CorkscrewRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9243,7 +10475,11 @@ static void CorkscrewRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9290,7 +10526,11 @@ static void CorkscrewRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9323,7 +10563,11 @@ static void CorkscrewRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9360,7 +10604,11 @@ static void CorkscrewRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9395,7 +10643,11 @@ static void CorkscrewRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -9428,7 +10680,11 @@ static void CorkscrewRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9465,7 +10721,11 @@ static void CorkscrewRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9507,7 +10767,11 @@ static void LayDownRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9534,7 +10798,11 @@ static void LayDownRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9562,7 +10830,11 @@ static void LayDownRCTrackLeftFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -9616,7 +10888,11 @@ static void LayDownRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9642,7 +10918,11 @@ static void LayDownRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9669,7 +10949,11 @@ static void LayDownRCTrackRightFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -9722,7 +11006,10 @@ static void LayDownRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9787,7 +11074,11 @@ static void LayDownRCTrackFlyerHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -9816,7 +11107,10 @@ static void LayDownRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -9857,7 +11151,12 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( if (direction == 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); } MetalASupportsPaintSetup( @@ -9865,7 +11164,12 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( if (direction != 2) { PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); } @@ -9928,7 +11232,12 @@ static void LayDownRCTrackLeftFlyerCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -9985,7 +11294,12 @@ static void LayDownRCTrackRightFlyerCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10042,7 +11356,12 @@ static void LayDownRCTrackRightFlyerCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); diff --git a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp index 0ccad1ac23..4c869ebc89 100644 --- a/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/FlyingRollerCoaster.cpp @@ -89,7 +89,10 @@ static void FlyingRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -132,7 +135,10 @@ static void FlyingRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -275,7 +281,10 @@ static void FlyingRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -334,7 +343,10 @@ static void FlyingRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -418,7 +430,10 @@ static void FlyingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } else @@ -455,7 +470,10 @@ static void FlyingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -533,7 +551,10 @@ static void FlyingRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -592,7 +613,10 @@ static void FlyingRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -682,7 +706,10 @@ static void FlyingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else @@ -725,7 +752,10 @@ static void FlyingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } @@ -780,7 +810,10 @@ static void FlyingRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } else @@ -816,7 +849,10 @@ static void FlyingRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -929,7 +965,10 @@ static void FlyingRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -988,7 +1027,10 @@ static void FlyingRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1116,7 +1158,13 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1149,7 +1197,10 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1178,7 +1229,13 @@ static void FlyingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1211,7 +1268,10 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1251,7 +1311,13 @@ static void FlyingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1286,7 +1352,12 @@ static void FlyingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -1328,7 +1399,10 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1357,7 +1431,13 @@ static void FlyingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1390,7 +1470,10 @@ static void FlyingRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1420,7 +1503,12 @@ static void FlyingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -1493,7 +1581,10 @@ static void FlyingRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1524,7 +1615,11 @@ static void FlyingRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1580,7 +1675,10 @@ static void FlyingRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1611,7 +1709,11 @@ static void FlyingRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1667,7 +1769,10 @@ static void FlyingRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1698,7 +1803,11 @@ static void FlyingRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1754,7 +1863,10 @@ static void FlyingRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -1785,7 +1897,11 @@ static void FlyingRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1841,7 +1957,13 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1874,7 +1996,10 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1903,7 +2028,13 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1936,7 +2067,10 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1979,7 +2113,13 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2014,7 +2154,12 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -2054,7 +2199,10 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2082,7 +2230,13 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2113,7 +2267,10 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2143,7 +2300,12 @@ static void FlyingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -2223,7 +2385,10 @@ static void FlyingRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -2254,7 +2419,11 @@ static void FlyingRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2345,7 +2514,10 @@ static void FlyingRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -2376,7 +2548,11 @@ static void FlyingRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2467,7 +2643,10 @@ static void FlyingRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -2498,7 +2677,11 @@ static void FlyingRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2589,7 +2772,10 @@ static void FlyingRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -2620,7 +2806,11 @@ static void FlyingRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2730,7 +2920,10 @@ static void FlyingRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -2761,7 +2954,11 @@ static void FlyingRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2822,7 +3019,13 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2853,7 +3056,10 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2881,7 +3087,13 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -2912,7 +3124,10 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2952,7 +3167,13 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2983,7 +3204,12 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3021,7 +3247,10 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3046,7 +3275,13 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -3075,7 +3310,10 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3101,7 +3339,12 @@ static void FlyingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3162,7 +3405,13 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3193,7 +3442,10 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3221,7 +3473,13 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -3252,7 +3510,10 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3292,7 +3553,13 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3323,7 +3590,12 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3361,7 +3633,10 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3386,7 +3661,13 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -3415,7 +3696,10 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3441,7 +3725,12 @@ static void FlyingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -3520,7 +3809,13 @@ static void FlyingRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3554,7 +3849,10 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3589,7 +3887,10 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3629,7 +3930,13 @@ static void FlyingRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3664,7 +3971,13 @@ static void FlyingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -3703,7 +4016,10 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3749,7 +4065,10 @@ static void FlyingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3793,7 +4112,13 @@ static void FlyingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -3853,7 +4178,13 @@ static void FlyingRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3887,7 +4218,10 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3922,7 +4256,10 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3962,7 +4299,13 @@ static void FlyingRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3997,7 +4340,13 @@ static void FlyingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -4036,7 +4385,10 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -4082,7 +4434,10 @@ static void FlyingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -4126,7 +4481,13 @@ static void FlyingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -4186,7 +4547,13 @@ static void FlyingRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4217,7 +4584,13 @@ static void FlyingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4256,7 +4629,13 @@ static void FlyingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4291,7 +4670,12 @@ static void FlyingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4331,7 +4715,13 @@ static void FlyingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4360,7 +4750,12 @@ static void FlyingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4433,7 +4828,13 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4464,7 +4865,13 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4506,7 +4913,13 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4541,7 +4954,12 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4581,7 +4999,13 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4610,7 +5034,12 @@ static void FlyingRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, @@ -4676,7 +5105,13 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4717,7 +5152,13 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4748,7 +5189,12 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -4788,7 +5234,12 @@ static void FlyingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -4845,7 +5296,13 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4896,7 +5353,13 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -4927,7 +5390,12 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -4967,7 +5435,12 @@ static void FlyingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -5047,7 +5520,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5079,7 +5557,13 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5121,7 +5605,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5164,7 +5653,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5196,7 +5690,13 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5233,7 +5733,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5281,7 +5786,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5313,7 +5823,13 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5355,7 +5871,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5398,7 +5919,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5430,7 +5956,13 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5467,7 +5999,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5543,7 +6080,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5576,7 +6118,11 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5605,7 +6151,13 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5637,7 +6189,11 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5680,7 +6236,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5723,7 +6284,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5756,7 +6322,11 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5785,7 +6355,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -5817,7 +6392,11 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5855,7 +6434,12 @@ static void FlyingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5903,7 +6487,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5936,7 +6525,11 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5965,7 +6558,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5997,7 +6595,11 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6040,7 +6642,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6083,7 +6690,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6116,7 +6728,11 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6145,7 +6761,13 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -6177,7 +6799,11 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6215,7 +6841,12 @@ static void FlyingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6468,7 +7099,10 @@ static void FlyingRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -6490,7 +7124,10 @@ static void FlyingRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -6519,7 +7156,10 @@ static void FlyingRCTrackBooster( { { 0, 6, height + 22 }, { 32, 20, 1 } }); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -6564,7 +7204,12 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -6604,7 +7249,11 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6633,7 +7282,13 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -6665,7 +7320,11 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6695,7 +7354,12 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -6747,7 +7411,12 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -6787,7 +7456,11 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6816,7 +7489,12 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -6848,7 +7526,11 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6878,7 +7560,12 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -6930,7 +7617,12 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -6970,7 +7662,11 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -6999,7 +7695,13 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -7031,7 +7733,11 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7061,7 +7767,12 @@ static void FlyingRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -7113,7 +7824,12 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 53, session.SupportColours); @@ -7153,7 +7869,11 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7182,7 +7902,12 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -7214,7 +7939,11 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7244,7 +7973,12 @@ static void FlyingRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, session.SupportColours); @@ -7307,7 +8041,10 @@ static void FlyingRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -7337,7 +8074,10 @@ static void FlyingRCTrack25DegUpLeftBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -7421,7 +8161,10 @@ static void FlyingRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -7451,7 +8194,10 @@ static void FlyingRCTrack25DegUpRightBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -7618,7 +8364,11 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7648,7 +8398,10 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7677,13 +8430,24 @@ static void FlyingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -7725,7 +8489,10 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7761,7 +8528,11 @@ static void FlyingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -7799,7 +8570,10 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7828,13 +8602,24 @@ static void FlyingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -7865,7 +8650,10 @@ static void FlyingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7937,7 +8725,11 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7967,7 +8759,10 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7996,13 +8791,24 @@ static void FlyingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8044,7 +8850,10 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8080,7 +8889,11 @@ static void FlyingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8118,7 +8931,10 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8147,13 +8963,24 @@ static void FlyingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8184,7 +9011,10 @@ static void FlyingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8274,7 +9104,11 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8304,7 +9138,10 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8333,13 +9170,24 @@ static void FlyingRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8381,7 +9229,10 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8417,7 +9268,13 @@ static void FlyingRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8455,7 +9312,10 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8484,13 +9344,24 @@ static void FlyingRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8521,7 +9392,11 @@ static void FlyingRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8593,7 +9468,11 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8623,7 +9502,10 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8652,13 +9534,24 @@ static void FlyingRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8700,7 +9593,10 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8736,7 +9632,13 @@ static void FlyingRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8774,7 +9676,10 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8803,13 +9708,24 @@ static void FlyingRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -8840,7 +9756,10 @@ static void FlyingRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8923,7 +9842,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8950,7 +9875,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8977,7 +9908,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9040,7 +9977,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9073,7 +10016,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9100,7 +10049,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9127,7 +10082,13 @@ static void FlyingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9155,7 +10116,13 @@ static void FlyingRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9263,7 +10230,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9290,7 +10263,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9317,7 +10296,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9380,7 +10365,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -9413,7 +10404,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9440,7 +10437,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9467,7 +10470,13 @@ static void FlyingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9495,7 +10504,13 @@ static void FlyingRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9559,7 +10574,13 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -9586,7 +10607,13 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -9613,7 +10640,13 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -9676,7 +10709,13 @@ static void FlyingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -9695,7 +10734,13 @@ static void FlyingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -9708,7 +10753,13 @@ static void FlyingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -9721,7 +10772,13 @@ static void FlyingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -9735,7 +10792,13 @@ static void FlyingRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9799,7 +10862,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9826,7 +10895,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9853,7 +10928,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -9916,7 +10997,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -9949,7 +11036,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9976,7 +11069,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10003,7 +11102,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10031,7 +11136,13 @@ static void FlyingRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -10095,7 +11206,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10122,7 +11239,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10149,7 +11272,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10212,7 +11341,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10231,7 +11366,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10244,7 +11385,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10257,7 +11404,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10271,7 +11424,13 @@ static void FlyingRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -10335,7 +11494,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10362,7 +11527,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10389,7 +11560,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10452,7 +11629,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -10471,7 +11654,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -10484,7 +11673,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10497,7 +11692,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -10511,7 +11712,13 @@ static void FlyingRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -10575,7 +11782,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10602,7 +11815,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10629,7 +11848,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10692,7 +11917,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10725,7 +11956,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10752,7 +11989,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10779,7 +12022,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10807,7 +12056,13 @@ static void FlyingRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -10871,7 +12126,13 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10898,7 +12159,13 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10925,7 +12192,13 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10988,7 +12261,13 @@ static void FlyingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -11007,7 +12286,13 @@ static void FlyingRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11020,7 +12305,13 @@ static void FlyingRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -11033,7 +12324,13 @@ static void FlyingRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11047,7 +12344,13 @@ static void FlyingRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11111,7 +12414,13 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -11138,7 +12447,13 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -11165,7 +12480,13 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -11228,7 +12549,13 @@ static void FlyingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -11247,7 +12574,13 @@ static void FlyingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -11260,7 +12593,13 @@ static void FlyingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -11273,7 +12612,13 @@ static void FlyingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -11287,7 +12632,13 @@ static void FlyingRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11351,7 +12702,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -11377,7 +12734,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -11403,7 +12766,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -11465,7 +12834,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } } @@ -11483,7 +12858,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -11495,7 +12876,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -11507,7 +12894,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -11520,7 +12913,13 @@ static void FlyingRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11584,7 +12983,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11611,7 +13016,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11638,7 +13049,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11701,7 +13118,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -11720,7 +13143,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11733,7 +13162,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11746,7 +13181,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11760,7 +13201,13 @@ static void FlyingRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11824,7 +13271,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11851,7 +13304,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11878,7 +13337,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -11941,7 +13406,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -11960,7 +13431,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -11973,7 +13450,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -11986,7 +13469,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -12000,7 +13489,13 @@ static void FlyingRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -12064,7 +13559,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12091,7 +13592,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12118,7 +13625,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12181,7 +13694,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12200,7 +13719,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12213,7 +13738,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12226,7 +13757,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -12240,7 +13777,13 @@ static void FlyingRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -12290,7 +13833,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12306,7 +13855,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12319,7 +13874,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12350,7 +13911,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12369,7 +13936,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12382,7 +13955,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12395,7 +13974,13 @@ static void FlyingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12409,7 +13994,12 @@ static void FlyingRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12460,7 +14050,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12473,7 +14069,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12489,7 +14091,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12520,7 +14128,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12539,7 +14153,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12552,7 +14172,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12565,7 +14191,13 @@ static void FlyingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12579,7 +14211,12 @@ static void FlyingRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12630,7 +14267,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12646,7 +14289,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12659,7 +14308,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12690,7 +14345,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12709,7 +14370,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12722,7 +14389,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12735,7 +14408,13 @@ static void FlyingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12749,7 +14428,12 @@ static void FlyingRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12800,7 +14484,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12813,7 +14503,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12829,7 +14525,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12860,7 +14562,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12879,7 +14587,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12892,7 +14606,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12905,7 +14625,13 @@ static void FlyingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12919,7 +14645,12 @@ static void FlyingRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12970,7 +14701,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12986,7 +14723,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -12999,7 +14742,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13030,7 +14779,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13049,7 +14804,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13062,7 +14823,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13075,7 +14842,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13089,7 +14862,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -13139,7 +14918,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13152,7 +14937,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13168,7 +14959,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13199,7 +14996,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13218,7 +15021,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13231,7 +15040,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13244,7 +15059,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13258,7 +15079,13 @@ static void FlyingRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -13308,7 +15135,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13324,7 +15157,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13337,7 +15176,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13368,7 +15213,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13387,7 +15238,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13400,7 +15257,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13413,7 +15276,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13427,7 +15296,13 @@ static void FlyingRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -13477,7 +15352,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13490,7 +15371,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13506,7 +15393,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13537,7 +15430,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -13556,7 +15455,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13569,7 +15474,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -13582,7 +15493,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13596,7 +15513,13 @@ static void FlyingRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -13646,7 +15569,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -13661,7 +15590,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -13673,7 +15608,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -13703,7 +15644,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } } @@ -13721,7 +15668,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -13733,7 +15686,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -13745,7 +15704,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -13758,7 +15723,13 @@ static void FlyingRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -13808,7 +15779,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -13820,7 +15797,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -13835,7 +15818,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -13865,7 +15854,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } } @@ -13883,7 +15878,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -13895,7 +15896,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -13907,7 +15914,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -13920,7 +15933,13 @@ static void FlyingRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -13970,7 +15989,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13986,7 +16011,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13999,7 +16030,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14030,7 +16067,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14049,7 +16092,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14062,7 +16111,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14075,7 +16130,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14089,7 +16150,13 @@ static void FlyingRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -14139,7 +16206,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14152,7 +16225,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14168,7 +16247,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14199,7 +16284,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14218,7 +16309,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14231,7 +16328,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14244,7 +16347,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14258,7 +16367,13 @@ static void FlyingRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -14308,7 +16423,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14321,7 +16442,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14334,7 +16461,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14365,7 +16498,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -14384,7 +16523,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14397,7 +16542,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14410,7 +16561,13 @@ static void FlyingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14424,7 +16581,12 @@ static void FlyingRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -14475,7 +16637,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14488,7 +16656,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14501,7 +16675,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14532,7 +16712,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -14551,7 +16737,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -14564,7 +16756,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -14577,7 +16775,13 @@ static void FlyingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -14591,7 +16795,12 @@ static void FlyingRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -14662,7 +16871,11 @@ static void FlyingRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14689,7 +16902,11 @@ static void FlyingRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14717,7 +16934,11 @@ static void FlyingRCTrackLeftFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -14775,7 +16996,11 @@ static void FlyingRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14801,7 +17026,11 @@ static void FlyingRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14828,7 +17057,11 @@ static void FlyingRCTrackRightFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -14878,7 +17111,11 @@ static void FlyingRCTrackLeftFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -14912,7 +17149,11 @@ static void FlyingRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14953,7 +17194,11 @@ static void FlyingRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -14990,7 +17235,11 @@ static void FlyingRCTrackRightFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -15023,7 +17272,11 @@ static void FlyingRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -15064,7 +17317,11 @@ static void FlyingRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -15105,7 +17362,10 @@ static void FlyingRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15170,7 +17430,11 @@ static void FlyingRCTrackFlyerHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -15199,7 +17463,10 @@ static void FlyingRCTrackFlyerHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15237,7 +17504,10 @@ static void FlyingRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15264,7 +17534,11 @@ static void FlyingRCTrackFlyerHalfLoopDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -15333,7 +17607,10 @@ static void FlyingRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15365,7 +17642,10 @@ static void FlyingRCTrackBlockBrakes( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } else @@ -15387,7 +17667,10 @@ static void FlyingRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -15436,7 +17719,13 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15479,7 +17768,13 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15510,7 +17805,12 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15550,7 +17850,12 @@ static void FlyingRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15608,7 +17913,13 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15661,7 +17972,13 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15692,7 +18009,12 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15732,7 +18054,12 @@ static void FlyingRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 47, @@ -15811,7 +18138,13 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15843,7 +18176,10 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15871,7 +18207,13 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -15904,7 +18246,10 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15944,7 +18289,13 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15975,7 +18326,12 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16013,7 +18369,10 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16038,7 +18397,13 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -16067,7 +18432,10 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16093,7 +18461,12 @@ static void FlyingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16154,7 +18527,13 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -16186,7 +18565,10 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16214,7 +18596,13 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -16247,7 +18635,10 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16287,7 +18678,13 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16318,7 +18715,12 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16356,7 +18758,10 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16381,7 +18786,13 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -16410,7 +18821,10 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -16436,7 +18850,12 @@ static void FlyingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 49, @@ -16522,7 +18941,10 @@ static void FlyingRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16552,7 +18974,10 @@ static void FlyingRCTrack25DegUpToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -16639,7 +19064,10 @@ static void FlyingRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16669,7 +19097,10 @@ static void FlyingRCTrack25DegUpToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -16756,7 +19187,10 @@ static void FlyingRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16786,7 +19220,10 @@ static void FlyingRCTrackLeftBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -16873,7 +19310,10 @@ static void FlyingRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } else @@ -16903,7 +19343,10 @@ static void FlyingRCTrackRightBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17019,7 +19462,10 @@ static void FlyingRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17049,7 +19495,10 @@ static void FlyingRCTrackLeftBankedFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17133,7 +19582,10 @@ static void FlyingRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17163,7 +19615,10 @@ static void FlyingRCTrackRightBankedFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17247,7 +19702,10 @@ static void FlyingRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17277,7 +19735,10 @@ static void FlyingRCTrackLeftBanked25DegUpToLeftBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17361,7 +19822,10 @@ static void FlyingRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17391,7 +19855,10 @@ static void FlyingRCTrackRightBanked25DegUpToRightBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17510,7 +19977,10 @@ static void FlyingRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17540,7 +20010,10 @@ static void FlyingRCTrackFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17627,7 +20100,10 @@ static void FlyingRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } else @@ -17657,7 +20133,10 @@ static void FlyingRCTrackFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17744,7 +20223,10 @@ static void FlyingRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17774,7 +20256,10 @@ static void FlyingRCTrackLeftBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17861,7 +20346,10 @@ static void FlyingRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } else @@ -17891,7 +20379,10 @@ static void FlyingRCTrackRightBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -17999,7 +20490,10 @@ static void FlyingRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -18052,7 +20546,10 @@ static void FlyingRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -18106,7 +20603,10 @@ static void FlyingRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -18147,7 +20647,10 @@ static void FlyingRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -18186,7 +20689,10 @@ static void FlyingRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -18214,7 +20720,10 @@ static void FlyingRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -18246,7 +20755,10 @@ static void FlyingRCTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -18330,7 +20842,10 @@ static void FlyingRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -18414,7 +20929,11 @@ static void FlyingRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -18447,7 +20966,10 @@ static void FlyingRCTrackHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -18495,7 +21017,10 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -18523,7 +21048,10 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -18552,7 +21080,11 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -18582,7 +21114,11 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18611,7 +21147,13 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -18640,7 +21182,11 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18686,7 +21232,11 @@ static void FlyingRCTrackLeftFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -18728,7 +21278,10 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -18756,7 +21309,10 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -18785,7 +21341,11 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -18815,7 +21375,11 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18844,7 +21408,13 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -18873,7 +21443,11 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -18919,7 +21493,11 @@ static void FlyingRCTrackRightFlyingLargeHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; diff --git a/src/openrct2/ride/coaster/GigaCoaster.cpp b/src/openrct2/ride/coaster/GigaCoaster.cpp index 9cc6770d2f..8b0779daef 100644 --- a/src/openrct2/ride/coaster/GigaCoaster.cpp +++ b/src/openrct2/ride/coaster/GigaCoaster.cpp @@ -164,7 +164,10 @@ static void GigaRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -309,7 +312,10 @@ static void GigaRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -389,7 +395,10 @@ static void GigaRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -500,7 +509,10 @@ static void GigaRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -592,7 +604,10 @@ static void GigaRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -684,7 +699,10 @@ static void GigaRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -795,7 +813,10 @@ static void GigaRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -885,7 +906,13 @@ static void GigaRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -917,7 +944,11 @@ static void GigaRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -946,7 +977,13 @@ static void GigaRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -978,7 +1015,11 @@ static void GigaRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1018,7 +1059,13 @@ static void GigaRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1074,7 +1121,10 @@ static void GigaRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1119,7 +1169,10 @@ static void GigaRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1164,7 +1217,10 @@ static void GigaRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1209,7 +1265,10 @@ static void GigaRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1254,7 +1313,13 @@ static void GigaRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1286,7 +1351,11 @@ static void GigaRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1315,7 +1384,13 @@ static void GigaRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1347,7 +1422,11 @@ static void GigaRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1390,7 +1469,13 @@ static void GigaRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1453,7 +1538,10 @@ static void GigaRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1505,7 +1593,10 @@ static void GigaRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1557,7 +1648,10 @@ static void GigaRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1609,7 +1703,10 @@ static void GigaRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1680,7 +1777,10 @@ static void GigaRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1730,7 +1830,13 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1760,7 +1866,11 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1788,7 +1898,13 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1818,7 +1934,11 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1858,7 +1978,13 @@ static void GigaRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1902,7 +2028,13 @@ static void GigaRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1932,7 +2064,11 @@ static void GigaRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1960,7 +2096,12 @@ static void GigaRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1990,7 +2131,11 @@ static void GigaRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2030,7 +2175,13 @@ static void GigaRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2092,7 +2243,13 @@ static void GigaRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2123,7 +2280,11 @@ static void GigaRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2155,7 +2316,11 @@ static void GigaRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2195,7 +2360,13 @@ static void GigaRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2239,7 +2410,13 @@ static void GigaRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2271,7 +2448,11 @@ static void GigaRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2304,7 +2485,11 @@ static void GigaRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2344,7 +2529,13 @@ static void GigaRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2388,7 +2579,13 @@ static void GigaRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2419,7 +2616,13 @@ static void GigaRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2458,7 +2661,13 @@ static void GigaRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2514,7 +2723,13 @@ static void GigaRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2545,7 +2760,13 @@ static void GigaRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2587,7 +2808,13 @@ static void GigaRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2636,7 +2863,13 @@ static void GigaRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2677,7 +2910,13 @@ static void GigaRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2717,7 +2956,13 @@ static void GigaRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2764,7 +3009,13 @@ static void GigaRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2829,7 +3080,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2861,7 +3117,13 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2903,7 +3165,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2946,7 +3213,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2978,7 +3250,13 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3015,7 +3293,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3063,7 +3346,12 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3095,7 +3383,13 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3137,7 +3431,12 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3180,7 +3479,12 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3212,7 +3516,13 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3249,7 +3559,12 @@ static void GigaRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3325,7 +3640,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3358,7 +3678,11 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3387,7 +3711,13 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3419,7 +3749,11 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3462,7 +3796,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3505,7 +3844,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3538,7 +3882,11 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3567,7 +3915,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3599,7 +3952,11 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3637,7 +3994,12 @@ static void GigaRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3685,7 +4047,12 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3718,7 +4085,11 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3747,7 +4118,12 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3779,7 +4155,11 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3828,7 +4208,12 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3871,7 +4256,12 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3904,7 +4294,11 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3933,7 +4327,13 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3965,7 +4365,11 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4009,7 +4413,12 @@ static void GigaRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4183,7 +4592,10 @@ static void GigaRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4229,7 +4641,10 @@ static void GigaRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4275,7 +4690,10 @@ static void GigaRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4406,7 +4824,10 @@ static void GigaRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4473,7 +4894,10 @@ static void GigaRCTrackFlatTo60DegUpLongBase( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4540,7 +4964,10 @@ static void GigaRCTrackFlatTo60DegUpLongBase( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -4616,7 +5043,10 @@ static void GigaRCTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -4663,7 +5093,10 @@ static void GigaRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -4696,7 +5129,10 @@ static void GigaRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 12, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -4729,7 +5165,10 @@ static void GigaRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4771,7 +5210,10 @@ static void GigaRCTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -4838,7 +5280,10 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -4879,7 +5324,10 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 2: @@ -4926,7 +5374,10 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -4967,7 +5418,10 @@ static void GigaRCTrackCableLiftHill( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5011,7 +5465,10 @@ static void GigaRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5040,7 +5497,11 @@ static void GigaRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5069,13 +5530,24 @@ static void GigaRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5112,7 +5584,11 @@ static void GigaRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5157,7 +5633,10 @@ static void GigaRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5186,7 +5665,11 @@ static void GigaRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5215,13 +5698,24 @@ static void GigaRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5258,7 +5752,11 @@ static void GigaRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5321,7 +5819,10 @@ static void GigaRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5350,7 +5851,11 @@ static void GigaRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5379,13 +5884,24 @@ static void GigaRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5422,7 +5938,11 @@ static void GigaRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5467,7 +5987,10 @@ static void GigaRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5496,7 +6019,11 @@ static void GigaRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5525,13 +6052,24 @@ static void GigaRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5568,7 +6106,11 @@ static void GigaRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5624,7 +6166,13 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5651,7 +6199,12 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5678,7 +6231,13 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5737,7 +6296,13 @@ static void GigaRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5774,7 +6339,13 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5801,7 +6372,12 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5828,7 +6404,13 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5887,7 +6469,13 @@ static void GigaRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5910,7 +6498,13 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5923,7 +6517,12 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5936,7 +6535,13 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5963,7 +6568,13 @@ static void GigaRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6000,7 +6611,13 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6027,7 +6644,12 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6054,7 +6676,13 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6113,7 +6741,13 @@ static void GigaRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6136,7 +6770,13 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6149,7 +6789,12 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6162,7 +6807,13 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6189,7 +6840,13 @@ static void GigaRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6212,7 +6869,13 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6225,7 +6888,12 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6238,7 +6906,13 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6265,7 +6939,13 @@ static void GigaRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6302,7 +6982,13 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6329,7 +7015,12 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6356,7 +7047,13 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6415,7 +7112,13 @@ static void GigaRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6452,7 +7155,13 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6479,7 +7188,12 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6506,7 +7220,13 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6565,7 +7285,13 @@ static void GigaRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6588,7 +7314,13 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6601,7 +7333,12 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6614,7 +7351,13 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6641,7 +7384,13 @@ static void GigaRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6678,7 +7427,13 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6704,7 +7459,12 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6730,7 +7490,13 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6788,7 +7554,13 @@ static void GigaRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -6812,7 +7584,13 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6825,7 +7603,12 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6838,7 +7621,13 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6865,7 +7654,13 @@ static void GigaRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6888,7 +7683,13 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6901,7 +7702,12 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6914,7 +7720,13 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6941,7 +7753,13 @@ static void GigaRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6978,7 +7796,13 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7005,7 +7829,12 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7032,7 +7861,13 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7091,7 +7926,13 @@ static void GigaRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7114,7 +7955,13 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7130,7 +7977,12 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7143,7 +7995,13 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7170,7 +8028,13 @@ static void GigaRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7193,7 +8057,13 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7206,7 +8076,12 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7222,7 +8097,13 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7249,7 +8130,13 @@ static void GigaRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7272,7 +8159,13 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7288,7 +8181,12 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7301,7 +8199,13 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7328,7 +8232,13 @@ static void GigaRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7351,7 +8261,13 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7364,7 +8280,12 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7380,7 +8301,13 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7407,7 +8334,13 @@ static void GigaRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7430,7 +8363,13 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7446,7 +8385,12 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7459,7 +8403,13 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7486,7 +8436,13 @@ static void GigaRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7509,7 +8465,13 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7522,7 +8484,12 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7538,7 +8505,13 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7565,7 +8538,13 @@ static void GigaRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7588,7 +8567,13 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7604,7 +8589,12 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7617,7 +8607,13 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7644,7 +8640,13 @@ static void GigaRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7667,7 +8669,13 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7680,7 +8688,12 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7696,7 +8709,13 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7723,7 +8742,13 @@ static void GigaRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7746,7 +8771,13 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -7761,7 +8792,12 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -7773,7 +8809,13 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -7799,7 +8841,13 @@ static void GigaRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -7823,7 +8871,13 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -7835,7 +8889,12 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -7850,7 +8909,13 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -7876,7 +8941,13 @@ static void GigaRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -7900,7 +8971,13 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7916,7 +8993,12 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7929,7 +9011,13 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7956,7 +9044,13 @@ static void GigaRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7979,7 +9073,13 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7992,7 +9092,12 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8008,7 +9113,13 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8035,7 +9146,13 @@ static void GigaRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8058,7 +9175,13 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8071,7 +9194,12 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8084,7 +9212,13 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8111,7 +9245,13 @@ static void GigaRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8134,7 +9274,13 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8147,7 +9293,12 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8160,7 +9311,13 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8187,7 +9344,13 @@ static void GigaRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8213,7 +9376,10 @@ static void GigaRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -8252,7 +9418,13 @@ static void GigaRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8295,7 +9467,13 @@ static void GigaRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8336,7 +9514,13 @@ static void GigaRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8385,7 +9569,13 @@ static void GigaRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8447,7 +9637,13 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8478,7 +9674,11 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8506,7 +9706,13 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8538,7 +9744,11 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8578,7 +9788,13 @@ static void GigaRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8622,7 +9838,13 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8653,7 +9875,11 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8681,7 +9907,12 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8713,7 +9944,11 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8753,7 +9988,13 @@ static void GigaRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8822,7 +10063,10 @@ static void GigaRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8871,7 +10115,10 @@ static void GigaRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8920,7 +10167,10 @@ static void GigaRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8969,7 +10219,10 @@ static void GigaRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9047,7 +10300,10 @@ static void GigaRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9093,7 +10349,10 @@ static void GigaRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9139,7 +10398,10 @@ static void GigaRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9185,7 +10447,10 @@ static void GigaRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9266,7 +10531,10 @@ static void GigaRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9315,7 +10583,10 @@ static void GigaRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9364,7 +10635,10 @@ static void GigaRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9413,7 +10687,10 @@ static void GigaRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9475,7 +10752,10 @@ static void GigaRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -9501,7 +10781,10 @@ static void GigaRCTrackPoweredLift( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9537,7 +10820,10 @@ static void GigaRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9593,7 +10879,10 @@ static void GigaRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -9645,7 +10934,10 @@ static void GigaRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -9684,7 +10976,10 @@ static void GigaRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -9730,7 +11025,10 @@ static void GigaRCTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -9776,7 +11074,10 @@ static void GigaRCTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -9855,7 +11156,12 @@ static void GigaRCTrackLeftBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9897,7 +11203,11 @@ static void GigaRCTrackLeftBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -9947,7 +11257,12 @@ static void GigaRCTrackLeftBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10011,7 +11326,12 @@ static void GigaRCTrackRightBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -10053,7 +11373,11 @@ static void GigaRCTrackRightBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10103,7 +11427,12 @@ static void GigaRCTrackRightBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10161,7 +11490,10 @@ static void GigaRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10225,7 +11557,11 @@ static void GigaRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -10258,7 +11594,10 @@ static void GigaRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10315,7 +11654,11 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -10353,7 +11696,11 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -10382,7 +11729,13 @@ static void GigaRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -10411,7 +11764,11 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10447,7 +11804,11 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10476,7 +11837,13 @@ static void GigaRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -10513,7 +11880,11 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -10560,7 +11931,11 @@ static void GigaRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -10868,7 +12243,12 @@ static void GigaRCTrackLeftCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10925,7 +12305,12 @@ static void GigaRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 40, session.SupportColours); @@ -10987,7 +12372,12 @@ static void GigaRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11044,7 +12434,12 @@ static void GigaRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 40, session.SupportColours); @@ -11115,7 +12510,12 @@ static void GigaRCTrackLeftLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11155,7 +12555,11 @@ static void GigaRCTrackLeftLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11184,7 +12588,13 @@ static void GigaRCTrackLeftLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11193,7 +12603,11 @@ static void GigaRCTrackLeftLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11260,7 +12674,11 @@ static void GigaRCTrackLeftLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11315,7 +12733,12 @@ static void GigaRCTrackRightLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::rightCorner, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11355,7 +12778,11 @@ static void GigaRCTrackRightLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomRightSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11384,7 +12811,13 @@ static void GigaRCTrackRightLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11393,7 +12826,11 @@ static void GigaRCTrackRightLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11459,7 +12896,11 @@ static void GigaRCTrackRightLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11528,7 +12969,10 @@ static void GigaRCTrackLeftMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11558,7 +13002,11 @@ static void GigaRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::topCorner), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11597,7 +13045,13 @@ static void GigaRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11625,7 +13079,13 @@ static void GigaRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11655,7 +13115,11 @@ static void GigaRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); if (direction == 0 || direction == 3) @@ -11706,7 +13170,10 @@ static void GigaRCTrackRightMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11736,7 +13203,11 @@ static void GigaRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11775,7 +13246,13 @@ static void GigaRCTrackRightMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11804,7 +13281,13 @@ static void GigaRCTrackRightMediumHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11834,7 +13317,11 @@ static void GigaRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::topCorner), + direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { @@ -11909,7 +13396,10 @@ static void GigaRCTrackLeftZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -11938,7 +13428,11 @@ static void GigaRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11983,7 +13477,11 @@ static void GigaRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -12041,7 +13539,10 @@ static void GigaRCTrackRightZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -12070,7 +13571,11 @@ static void GigaRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -12115,7 +13620,11 @@ static void GigaRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -12178,7 +13687,10 @@ static void GigaRCTrackLeftLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12209,7 +13721,10 @@ static void GigaRCTrackLeftLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12241,14 +13756,22 @@ static void GigaRCTrackLeftLargeZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12342,7 +13865,10 @@ static void GigaRCTrackRightLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12373,7 +13899,10 @@ static void GigaRCTrackRightLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12406,14 +13935,22 @@ static void GigaRCTrackRightLargeZeroGRollUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12512,7 +14049,10 @@ static void GigaRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12540,7 +14080,10 @@ static void GigaRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12572,7 +14115,10 @@ static void GigaRCTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12625,7 +14171,13 @@ static void GigaRCTrackLeftBankToLeftQuarterTurn3Tile25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12670,7 +14222,13 @@ static void GigaRCTrackLeftBankToLeftQuarterTurn3Tile25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12716,7 +14274,13 @@ static void GigaRCTrackRightBankToRightQuarterTurn3Tile25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12761,7 +14325,13 @@ static void GigaRCTrackRightBankToRightQuarterTurn3Tile25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12804,7 +14374,13 @@ static void GigaRCTrackLeftQuarterTurn3Tile25DegDownToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12852,7 +14428,13 @@ static void GigaRCTrackLeftQuarterTurn3Tile25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12895,7 +14477,13 @@ static void GigaRCTrackRightQuarterTurn3Tile25DegDownToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12943,7 +14531,13 @@ static void GigaRCTrackRightQuarterTurn3Tile25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12986,7 +14580,10 @@ static void GigaRCTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13022,7 +14619,10 @@ static void GigaRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13051,7 +14651,11 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13093,7 +14697,11 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13122,7 +14730,13 @@ static void GigaRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13151,7 +14765,11 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13185,7 +14803,11 @@ static void GigaRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13229,7 +14851,10 @@ static void GigaRCTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13265,7 +14890,10 @@ static void GigaRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13294,7 +14922,11 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13336,7 +14968,11 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13365,7 +15001,13 @@ static void GigaRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13394,7 +15036,11 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13428,7 +15074,11 @@ static void GigaRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13492,7 +15142,10 @@ static void GigaRCTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -13539,7 +15192,10 @@ static void GigaRCTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -13573,7 +15229,13 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13586,7 +15248,12 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13599,7 +15266,13 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -13626,7 +15299,13 @@ static void GigaRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13648,7 +15327,13 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13661,7 +15346,12 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13674,7 +15364,13 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -13701,7 +15397,13 @@ static void GigaRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13723,7 +15425,13 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13736,7 +15444,12 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13749,7 +15462,13 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -13776,7 +15495,13 @@ static void GigaRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13798,7 +15523,13 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13811,7 +15542,12 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13824,7 +15560,13 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -13851,7 +15593,13 @@ static void GigaRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13894,7 +15642,10 @@ static void GigaRCTrackLeftEighthToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13923,7 +15674,11 @@ static void GigaRCTrackLeftEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -13952,13 +15707,24 @@ static void GigaRCTrackLeftEighthToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -13995,7 +15761,11 @@ static void GigaRCTrackLeftEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14039,7 +15809,10 @@ static void GigaRCTrackRightEighthToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14068,7 +15841,11 @@ static void GigaRCTrackRightEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14097,13 +15874,24 @@ static void GigaRCTrackRightEighthToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14140,7 +15928,11 @@ static void GigaRCTrackRightEighthToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14187,7 +15979,11 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14216,13 +16012,23 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14251,7 +16057,11 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14288,7 +16098,10 @@ static void GigaRCTrackLeftEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14334,7 +16147,11 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14363,13 +16180,24 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14398,7 +16226,11 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14433,7 +16265,10 @@ static void GigaRCTrackRightEighthToOrthogonalUp25( PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14489,7 +16324,13 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14505,7 +16346,12 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14518,7 +16364,13 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14545,7 +16397,13 @@ static void GigaRCTrackDiagUp25ToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14567,7 +16425,13 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14580,7 +16444,12 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14596,7 +16465,13 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14623,7 +16498,13 @@ static void GigaRCTrackDiagUp25ToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14645,7 +16526,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -14661,7 +16548,12 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -14674,7 +16566,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -14701,7 +16599,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -14723,7 +16627,13 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -14736,7 +16646,12 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -14752,7 +16667,13 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -14779,7 +16700,13 @@ static void GigaRCTrackDiagRightBankedUp25ToUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -14829,7 +16756,13 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14842,7 +16775,12 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14855,7 +16793,13 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14882,7 +16826,13 @@ static void GigaRCTrackDiagLeftBankedFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14904,7 +16854,13 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -14917,7 +16873,12 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -14930,7 +16891,13 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -14957,7 +16924,13 @@ static void GigaRCTrackDiagRightBankedFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -14979,7 +16952,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -14992,7 +16971,12 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15005,7 +16989,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15032,7 +17022,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToLeftBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15054,7 +17050,13 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15067,7 +17069,12 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15080,7 +17087,13 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15107,7 +17120,13 @@ static void GigaRCTrackDiagRightBankedUp25ToRightBankedFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15159,7 +17178,13 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15172,7 +17197,12 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15185,7 +17215,13 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15212,7 +17248,13 @@ static void GigaRCTrackDiagUp25LeftBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15234,7 +17276,13 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15247,7 +17295,12 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15260,7 +17313,13 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15287,7 +17346,13 @@ static void GigaRCTrackDiagUp25RightBanked( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15323,7 +17388,13 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15339,7 +17410,12 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15352,7 +17428,13 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15379,7 +17461,13 @@ static void GigaRCTrackDiagFlatToLeftBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15401,7 +17489,13 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15414,7 +17508,12 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15430,7 +17529,13 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15457,7 +17562,13 @@ static void GigaRCTrackDiagFlatToRightBankedUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15479,7 +17590,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15495,7 +17612,12 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15508,7 +17630,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15535,7 +17663,13 @@ static void GigaRCTrackDiagLeftBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15557,7 +17691,13 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15570,7 +17710,12 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15586,7 +17731,13 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15613,7 +17764,13 @@ static void GigaRCTrackDiagRightBankedUp25ToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15690,7 +17847,10 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15719,7 +17879,11 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15748,13 +17912,24 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -15791,7 +17966,11 @@ static void GigaRCTrackLeftEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15841,7 +18020,10 @@ static void GigaRCTrackRightEighthBankToDiagUp25( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15870,7 +18052,11 @@ static void GigaRCTrackRightEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15899,13 +18085,24 @@ static void GigaRCTrackRightEighthBankToDiagUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -15942,7 +18139,11 @@ static void GigaRCTrackRightEighthBankToDiagUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -15989,7 +18190,11 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16018,13 +18223,23 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16053,7 +18268,11 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16094,7 +18313,10 @@ static void GigaRCTrackLeftEighthBankToOrthogonalUp25( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16140,7 +18362,11 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16169,13 +18395,24 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16204,7 +18441,11 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16245,7 +18486,10 @@ static void GigaRCTrackRightEighthBankToOrthogonalUp25( PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index 31e3d3c221..ec179003eb 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -710,7 +710,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -815,7 +821,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + (direction + 1) & 3), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -853,7 +863,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -892,14 +905,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + (direction + 1) & 3), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -937,7 +957,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1379,7 +1402,13 @@ namespace HybridRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1523,7 +1552,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1619,7 +1654,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4611,7 +4652,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4728,7 +4775,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + (direction + 1) & 3), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4766,7 +4817,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4808,14 +4862,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, (direction + 1) & 3), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + (direction + 1) & 3), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -4853,7 +4914,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 1) & 3), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + (direction + 1) & 3), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5370,7 +5434,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5497,7 +5567,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5618,7 +5694,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5656,7 +5736,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -5695,14 +5778,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -5740,7 +5830,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -5846,7 +5939,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5884,7 +5981,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -5923,14 +6023,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -5968,7 +6075,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7076,7 +7186,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7223,7 +7339,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7364,7 +7486,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7410,7 +7536,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7457,14 +7586,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -7510,7 +7646,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7636,7 +7775,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7682,7 +7825,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7729,14 +7875,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -7782,7 +7935,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7945,7 +8101,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7984,7 +8143,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8115,7 +8277,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8154,7 +8319,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8311,7 +8479,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8469,7 +8643,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8626,7 +8806,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8784,7 +8970,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8914,7 +9106,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8952,7 +9148,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8994,14 +9193,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide, PaintSegment::topCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -9039,7 +9245,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9145,7 +9354,11 @@ namespace HybridRC break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -9183,7 +9396,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9225,14 +9441,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -9270,7 +9493,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9375,7 +9601,11 @@ namespace HybridRC break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9413,7 +9643,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9455,14 +9688,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -9500,7 +9740,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9606,7 +9849,11 @@ namespace HybridRC break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -9644,7 +9891,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9686,14 +9936,21 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide, PaintSegment::topCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -9731,7 +9988,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -10157,7 +10417,11 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -10193,7 +10457,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); @@ -10249,7 +10516,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10299,7 +10569,11 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -10337,7 +10611,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10391,7 +10668,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10455,7 +10735,11 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -10494,7 +10778,11 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10538,7 +10826,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); @@ -10594,7 +10885,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10644,7 +10938,11 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -10683,7 +10981,11 @@ namespace HybridRC WoodenASupportsPaintSetupRotated( session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -10728,7 +11030,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -10782,7 +11087,10 @@ namespace HybridRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11395,7 +11703,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11521,7 +11835,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11648,7 +11968,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11774,7 +12100,13 @@ namespace HybridRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: diff --git a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp index 5e29b93588..dbda4f1368 100644 --- a/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedHairpinCoaster.cpp @@ -69,7 +69,10 @@ static void InvertedHairpinRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -167,7 +170,10 @@ static void InvertedHairpinRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -272,7 +278,10 @@ static void InvertedHairpinRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -335,7 +344,10 @@ static void InvertedHairpinRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -452,7 +464,10 @@ static void InvertedHairpinRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -527,7 +542,10 @@ static void InvertedHairpinRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -625,7 +643,10 @@ static void InvertedHairpinRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -745,7 +766,12 @@ static void InvertedHairpinRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); @@ -784,7 +810,13 @@ static void InvertedHairpinRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -813,7 +845,12 @@ static void InvertedHairpinRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); @@ -870,7 +907,12 @@ static void InvertedHairpinRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -909,7 +951,12 @@ static void InvertedHairpinRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -957,7 +1004,12 @@ static void InvertedHairpinRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -996,7 +1048,12 @@ static void InvertedHairpinRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -1063,7 +1120,12 @@ static void InvertedHairpinRCTrackLeftQuarterTurn1( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 30, session.SupportColours); @@ -1169,7 +1231,10 @@ static void InvertedHairpinRCTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -1244,7 +1309,10 @@ static void InvertedHairpinRCTrack60DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1318,7 +1386,10 @@ static void InvertedHairpinRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1351,7 +1422,10 @@ static void InvertedHairpinRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp index 4eb1307ffa..06a2040611 100644 --- a/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedImpulseCoaster.cpp @@ -40,7 +40,10 @@ static void InvertedImpulseRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -109,7 +112,10 @@ static void InvertedImpulseRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -185,7 +191,10 @@ static void InvertedImpulseRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -219,7 +228,10 @@ static void InvertedImpulseRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -298,7 +310,10 @@ static void InvertedImpulseRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -345,7 +360,10 @@ static void InvertedImpulseRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -379,7 +397,10 @@ static void InvertedImpulseRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -496,7 +517,10 @@ static void InvertedImpulseRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -549,7 +573,10 @@ static void InvertedImpulseRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -603,7 +630,10 @@ static void InvertedImpulseRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } @@ -643,7 +673,10 @@ static void InvertedImpulseRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -693,7 +726,10 @@ static void InvertedImpulseRCTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -743,7 +779,10 @@ static void InvertedImpulseRCTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: diff --git a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp index f426e4360f..e5b3f15601 100644 --- a/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/InvertedRollerCoaster.cpp @@ -68,7 +68,10 @@ static void InvertedRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -166,7 +169,10 @@ static void InvertedRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -240,7 +246,10 @@ static void InvertedRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -303,7 +312,10 @@ static void InvertedRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -383,7 +395,10 @@ static void InvertedRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -423,7 +438,10 @@ static void InvertedRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -519,7 +537,10 @@ static void InvertedRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -637,7 +658,12 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -675,7 +701,11 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -703,7 +733,13 @@ static void InvertedRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -733,7 +769,11 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -763,7 +803,12 @@ static void InvertedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -822,8 +867,12 @@ static void InvertedRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -865,8 +914,12 @@ static void InvertedRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -908,8 +961,12 @@ static void InvertedRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -951,8 +1008,12 @@ static void InvertedRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -996,7 +1057,12 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1034,7 +1100,11 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1062,7 +1132,13 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1092,7 +1168,11 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1122,7 +1202,12 @@ static void InvertedRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1181,8 +1266,12 @@ static void InvertedRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1250,8 +1339,12 @@ static void InvertedRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1319,8 +1412,12 @@ static void InvertedRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1388,8 +1485,12 @@ static void InvertedRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1489,8 +1590,12 @@ static void InvertedRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, - 0); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1538,7 +1643,12 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1574,7 +1684,11 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1599,7 +1713,13 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1627,7 +1747,11 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1653,7 +1777,12 @@ static void InvertedRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1701,7 +1830,12 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1737,7 +1871,11 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1762,7 +1900,12 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1790,7 +1933,11 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1816,7 +1963,12 @@ static void InvertedRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1886,7 +2038,13 @@ static void InvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1921,7 +2079,11 @@ static void InvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1964,7 +2126,11 @@ static void InvertedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2008,7 +2174,13 @@ static void InvertedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2059,7 +2231,13 @@ static void InvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2094,7 +2272,11 @@ static void InvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2137,7 +2319,11 @@ static void InvertedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2181,7 +2367,13 @@ static void InvertedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2234,7 +2426,10 @@ static void InvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2319,7 +2514,13 @@ static void InvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2348,7 +2549,11 @@ static void InvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2384,7 +2589,11 @@ static void InvertedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2413,7 +2622,13 @@ static void InvertedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2471,7 +2686,10 @@ static void InvertedRCTrackLeftVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2547,7 +2765,10 @@ static void InvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2632,7 +2853,13 @@ static void InvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2661,7 +2888,11 @@ static void InvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2697,7 +2928,11 @@ static void InvertedRCTrackRightVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -2726,7 +2961,12 @@ static void InvertedRCTrackRightVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2784,7 +3024,10 @@ static void InvertedRCTrackRightVerticalLoop( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); switch (direction) @@ -2858,7 +3101,12 @@ static void InvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2896,7 +3144,13 @@ static void InvertedRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2925,7 +3179,12 @@ static void InvertedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2986,7 +3245,12 @@ static void InvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3025,7 +3289,13 @@ static void InvertedRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3054,7 +3324,12 @@ static void InvertedRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3111,7 +3386,12 @@ static void InvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3150,7 +3430,12 @@ static void InvertedRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3198,7 +3483,12 @@ static void InvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3237,7 +3527,12 @@ static void InvertedRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -3304,7 +3599,11 @@ static void InvertedRCTrackLeftTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3337,7 +3636,11 @@ static void InvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3374,7 +3677,11 @@ static void InvertedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3411,7 +3718,11 @@ static void InvertedRCTrackRightTwistDownToUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3444,7 +3755,11 @@ static void InvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3481,7 +3796,11 @@ static void InvertedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3523,7 +3842,11 @@ static void InvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3549,7 +3872,11 @@ static void InvertedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3576,7 +3903,11 @@ static void InvertedRCTrackLeftTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3630,7 +3961,11 @@ static void InvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3656,7 +3991,11 @@ static void InvertedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3683,7 +4022,11 @@ static void InvertedRCTrackRightTwistUpToDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -3735,7 +4078,10 @@ static void InvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3819,7 +4165,11 @@ static void InvertedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3852,7 +4202,10 @@ static void InvertedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -3901,7 +4254,10 @@ static void InvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 50, session.SupportColours); @@ -3977,7 +4333,10 @@ static void InvertedRCTrackLeftCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4019,7 +4378,10 @@ static void InvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 50, session.SupportColours); @@ -4095,7 +4457,10 @@ static void InvertedRCTrackRightCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -4246,7 +4611,10 @@ static void InvertedRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -4290,7 +4658,12 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -4330,7 +4703,11 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4359,7 +4736,13 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4391,7 +4774,11 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4421,7 +4808,12 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4473,7 +4865,12 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -4513,7 +4910,11 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4542,7 +4943,12 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4574,7 +4980,11 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4604,7 +5014,12 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4656,7 +5071,12 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4696,7 +5116,11 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4725,7 +5149,13 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4757,7 +5187,11 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4787,7 +5221,12 @@ static void InvertedRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -4839,7 +5278,12 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -4879,7 +5323,11 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4908,7 +5356,12 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -4940,7 +5393,11 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -4970,7 +5427,12 @@ static void InvertedRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -5019,7 +5481,10 @@ static void InvertedRCTrack25DegUpLeftBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -5086,7 +5551,10 @@ static void InvertedRCTrack25DegUpRightBanked( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -5208,7 +5676,10 @@ static void InvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5244,7 +5715,11 @@ static void InvertedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5273,13 +5748,24 @@ static void InvertedRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5309,7 +5795,11 @@ static void InvertedRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5372,7 +5862,10 @@ static void InvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5408,7 +5901,11 @@ static void InvertedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5437,13 +5934,24 @@ static void InvertedRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5473,7 +5981,11 @@ static void InvertedRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5554,7 +6066,13 @@ static void InvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5590,7 +6108,11 @@ static void InvertedRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5619,13 +6141,24 @@ static void InvertedRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5656,7 +6189,10 @@ static void InvertedRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5719,7 +6255,13 @@ static void InvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -5755,7 +6297,11 @@ static void InvertedRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -5784,13 +6330,24 @@ static void InvertedRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -5821,7 +6378,10 @@ static void InvertedRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5900,7 +6460,13 @@ static void InvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5927,7 +6493,12 @@ static void InvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5954,7 +6525,13 @@ static void InvertedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5982,7 +6559,13 @@ static void InvertedRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6061,7 +6644,13 @@ static void InvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6088,7 +6677,12 @@ static void InvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6115,7 +6709,13 @@ static void InvertedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6143,7 +6743,13 @@ static void InvertedRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6189,7 +6795,13 @@ static void InvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -6202,7 +6814,12 @@ static void InvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -6215,7 +6832,13 @@ static void InvertedRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -6229,7 +6852,13 @@ static void InvertedRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6290,7 +6919,13 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -6317,7 +6952,12 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -6344,7 +6984,13 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -6372,7 +7018,13 @@ static void InvertedRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6418,7 +7070,13 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6431,7 +7089,12 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6444,7 +7107,13 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6458,7 +7127,13 @@ static void InvertedRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6505,7 +7180,13 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -6518,7 +7199,12 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -6531,7 +7217,13 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -6545,7 +7237,13 @@ static void InvertedRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6606,7 +7304,13 @@ static void InvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6633,7 +7337,12 @@ static void InvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6660,7 +7369,13 @@ static void InvertedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6688,7 +7403,13 @@ static void InvertedRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6748,7 +7469,13 @@ static void InvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6775,7 +7502,12 @@ static void InvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6802,7 +7534,13 @@ static void InvertedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6830,7 +7568,13 @@ static void InvertedRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6876,7 +7620,13 @@ static void InvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -6889,7 +7639,12 @@ static void InvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -6902,7 +7657,13 @@ static void InvertedRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -6916,7 +7677,13 @@ static void InvertedRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6977,7 +7744,13 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7003,7 +7776,12 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7029,7 +7807,13 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7056,7 +7840,13 @@ static void InvertedRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7102,7 +7892,13 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7115,7 +7911,12 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7128,7 +7929,13 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7142,7 +7949,13 @@ static void InvertedRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7189,7 +8002,13 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -7202,7 +8021,12 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -7215,7 +8039,13 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -7229,7 +8059,13 @@ static void InvertedRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7289,7 +8125,13 @@ static void InvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7316,7 +8158,12 @@ static void InvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7343,7 +8190,13 @@ static void InvertedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7371,7 +8224,13 @@ static void InvertedRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7417,7 +8276,13 @@ static void InvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7430,7 +8295,12 @@ static void InvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7443,7 +8313,13 @@ static void InvertedRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7457,7 +8333,12 @@ static void InvertedRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7504,7 +8385,13 @@ static void InvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7517,7 +8404,12 @@ static void InvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7530,7 +8422,13 @@ static void InvertedRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7544,7 +8442,12 @@ static void InvertedRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7591,7 +8494,13 @@ static void InvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7604,7 +8513,12 @@ static void InvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7617,7 +8531,13 @@ static void InvertedRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7631,7 +8551,12 @@ static void InvertedRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7678,7 +8603,13 @@ static void InvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7691,7 +8622,12 @@ static void InvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7704,7 +8640,13 @@ static void InvertedRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7718,7 +8660,12 @@ static void InvertedRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7765,7 +8712,13 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7778,7 +8731,12 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7791,7 +8749,13 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7805,7 +8769,13 @@ static void InvertedRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7851,7 +8821,13 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -7864,7 +8840,12 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -7877,7 +8858,13 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -7891,7 +8878,13 @@ static void InvertedRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7937,7 +8930,13 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7950,7 +8949,12 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7963,7 +8967,13 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7977,7 +8987,13 @@ static void InvertedRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8023,7 +9039,13 @@ static void InvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8036,7 +9058,12 @@ static void InvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8049,7 +9076,13 @@ static void InvertedRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8063,7 +9096,13 @@ static void InvertedRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8109,7 +9148,13 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8121,7 +9166,12 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8133,7 +9183,13 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8146,7 +9202,13 @@ static void InvertedRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8192,7 +9254,13 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8204,7 +9272,12 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8216,7 +9289,13 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8229,7 +9308,13 @@ static void InvertedRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8275,7 +9360,13 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8288,7 +9379,12 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8301,7 +9397,13 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8315,7 +9417,13 @@ static void InvertedRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8361,7 +9469,13 @@ static void InvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -8374,7 +9488,12 @@ static void InvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -8387,7 +9506,13 @@ static void InvertedRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -8401,7 +9526,13 @@ static void InvertedRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8447,7 +9578,13 @@ static void InvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8460,7 +9597,12 @@ static void InvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8473,7 +9615,13 @@ static void InvertedRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8487,7 +9635,12 @@ static void InvertedRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8534,7 +9687,13 @@ static void InvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8547,7 +9706,12 @@ static void InvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8560,7 +9724,13 @@ static void InvertedRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8574,7 +9744,12 @@ static void InvertedRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -8640,7 +9815,10 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8668,7 +9846,10 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8697,7 +9878,11 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -8727,7 +9912,11 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -8756,7 +9945,13 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -8785,7 +9980,11 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -8827,7 +10026,11 @@ static void InvertedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -8870,7 +10073,10 @@ static void InvertedRCTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_INVERTED_4); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8898,7 +10104,10 @@ static void InvertedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8927,7 +10136,11 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -8957,7 +10170,11 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -8986,7 +10203,13 @@ static void InvertedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -9015,7 +10238,11 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -9057,7 +10284,11 @@ static void InvertedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -9102,7 +10333,10 @@ static void InvertedRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -9142,7 +10376,12 @@ static void InvertedRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9181,7 +10420,12 @@ static void InvertedRCTrackLeftBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9229,7 +10473,12 @@ static void InvertedRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9268,7 +10517,12 @@ static void InvertedRCTrackRightBankedQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 52, session.SupportColours); @@ -9334,7 +10588,12 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9370,7 +10629,11 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9395,7 +10658,13 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -9423,7 +10692,11 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9449,7 +10722,12 @@ static void InvertedRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9497,7 +10775,12 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9533,7 +10816,11 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9558,7 +10845,12 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -9586,7 +10878,11 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -9612,7 +10908,12 @@ static void InvertedRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -9679,7 +10980,10 @@ static void InvertedRCTrack25DegUpToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9746,7 +11050,10 @@ static void InvertedRCTrack25DegUpToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9813,7 +11120,10 @@ static void InvertedRCTrackLeftBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9880,7 +11190,10 @@ static void InvertedRCTrackRightBanked25DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -9979,7 +11292,10 @@ static void InvertedRCTrackLeftBankedFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10046,7 +11362,10 @@ static void InvertedRCTrackRightBankedFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10113,7 +11432,10 @@ static void InvertedRCTrackLeftBanked25DegUpToLeftBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10180,7 +11502,10 @@ static void InvertedRCTrackRightBanked25DegUpToRightBankedFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10279,7 +11604,10 @@ static void InvertedRCTrackFlatToLeftBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10346,7 +11674,10 @@ static void InvertedRCTrackFlatToRightBanked25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10413,7 +11744,10 @@ static void InvertedRCTrackLeftBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10480,7 +11814,10 @@ static void InvertedRCTrackRightBanked25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -10561,7 +11898,10 @@ static void InvertedRCTrackBooster( { { 0, 6, height + 29 }, { 32, 20, 1 } }); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp index a198a4aaf0..ec3186b807 100644 --- a/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/JuniorRollerCoaster.cpp @@ -1867,7 +1867,10 @@ static void JuniorRCPaintTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1951,7 +1954,10 @@ static void JuniorRCPaintTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -1981,7 +1987,10 @@ static void JuniorRCPaintTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2023,7 +2032,10 @@ static void JuniorRCPaintTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2082,27 +2094,52 @@ static void JuniorRCRightQuarterTurn5TilesPaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; } @@ -2166,7 +2203,10 @@ static void JuniorRCFlatToLeftBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2214,7 +2254,10 @@ static void JuniorRCFlatToRightBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2359,27 +2402,52 @@ static void JuniorRCBankedRightQuarterTurn5TilesPaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; } @@ -2451,7 +2519,10 @@ static void JuniorRCLeftBankTo25DegUpPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2511,7 +2582,10 @@ static void JuniorRCRightBankTo25DegUpPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -2572,7 +2646,10 @@ static void JuniorRC25DegUpToLeftBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2633,7 +2710,10 @@ static void JuniorRC25DegUpToRightBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -2721,7 +2801,10 @@ static void JuniorRCLeftBankPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -2781,27 +2864,53 @@ static void JuniorRCPaintTrackLeftQuarterTurn5Tiles25DegUp( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::topCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopCorner | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topCorner, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentRightCorner | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::rightCorner, PaintSegment::topRightSide, + PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomCorner), + direction), + 0xFFFF, 0); break; } if (trackSequence == 3) @@ -2860,27 +2969,52 @@ static void JuniorRCPaintTrackRightQuarterTurn5Tiles25DegUp( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; } if (trackSequence == 3) @@ -3000,16 +3134,22 @@ static void JuniorRCSBendLeftPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topCorner); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, (direction & 1)), 0xFFFF, 0); @@ -3104,16 +3244,22 @@ static void JuniorRCSBendRightPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, (direction & 1)), 0xFFFF, 0); @@ -3149,13 +3295,16 @@ static void JuniorRCRightQuarterTurn3TilesPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3265,13 +3414,16 @@ static void JuniorRCRightQuarterTurn3TilesBankPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3348,10 +3500,12 @@ static void JuniorRCPaintTrackRightQuarterTurn3Tiles25DegUp( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3431,10 +3585,12 @@ static void JuniorRCPaintTrackRightQuarterTurn3Tiles25DegDown( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3534,13 +3690,18 @@ static void JuniorRCRightHalfBankedHelixUpSmallPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner, + PaintSegment::bottomRightSide); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3602,13 +3763,18 @@ static void JuniorRCRightHalfBankedHelixDownSmallPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner, + PaintSegment::bottomRightSide); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -3700,28 +3866,51 @@ static void JuniorRCRightHalfBankedHelixUpLargePaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::leftCorner), + direction), 0xFFFF, 0); break; } @@ -3784,28 +3973,51 @@ static void JuniorRCRightHalfBankedHelixDownLargePaintSetup( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::leftCorner), + direction), 0xFFFF, 0); break; } @@ -3873,7 +4085,10 @@ static void JuniorRCBrakePaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3909,7 +4124,10 @@ static void JuniorRCBlockBrakePaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3959,19 +4177,26 @@ static void JuniorRCLeftEighthToDiagPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 2: - blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide, + PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::leftCorner, PaintSegment::topLeftSide); break; case 4: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } @@ -4025,19 +4250,26 @@ static void JuniorRCRightEighthToDiagPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, PaintSegment::topLeftSide, + PaintSegment::topCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; case 4: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::bottomRightSide); break; } @@ -4192,19 +4424,26 @@ static void JuniorRCLeftEighthToDiagBankPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 2: - blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide, + PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::leftCorner, PaintSegment::topLeftSide); break; case 4: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } @@ -4339,19 +4578,26 @@ static void JuniorRCRightEighthToDiagBankPaintSetup( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, PaintSegment::topLeftSide, + PaintSegment::topCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; case 4: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::bottomRightSide); break; } @@ -5119,7 +5365,10 @@ static void JuniorRCPaintTrack60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -5202,7 +5451,10 @@ static void JuniorRCPaintTrack25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5263,7 +5515,10 @@ static void JuniorRCPaintTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5520,7 +5775,10 @@ static void JuniorRCFlatTo60DegUpPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5579,7 +5837,10 @@ static void JuniorRC60DegUpToFlatPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5643,7 +5904,10 @@ static void JuniorRCBoosterPaintSetup( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentBottomLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp index a669ca7bbd..47793932fe 100644 --- a/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LayDownRollerCoaster.cpp @@ -114,7 +114,10 @@ static void LayDownRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -230,7 +233,10 @@ static void LayDownRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -315,7 +321,10 @@ static void LayDownRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -387,7 +396,10 @@ static void LayDownRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -478,7 +490,10 @@ static void LayDownRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } @@ -527,7 +542,10 @@ static void LayDownRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -634,7 +652,10 @@ static void LayDownRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -763,7 +784,12 @@ static void LayDownRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -805,7 +831,10 @@ static void LayDownRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -834,7 +863,13 @@ static void LayDownRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -867,7 +902,10 @@ static void LayDownRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -897,7 +935,12 @@ static void LayDownRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -966,7 +1009,11 @@ static void LayDownRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1018,7 +1065,11 @@ static void LayDownRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1070,7 +1121,11 @@ static void LayDownRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1122,7 +1177,11 @@ static void LayDownRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1176,7 +1235,12 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -1216,7 +1280,10 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1244,7 +1311,13 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1275,7 +1348,10 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1305,7 +1381,12 @@ static void LayDownRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -1374,7 +1455,11 @@ static void LayDownRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1454,7 +1539,11 @@ static void LayDownRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1534,7 +1623,11 @@ static void LayDownRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1614,7 +1707,11 @@ static void LayDownRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1726,7 +1823,11 @@ static void LayDownRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1784,7 +1885,12 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -1822,7 +1928,10 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1847,7 +1956,13 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1876,7 +1991,10 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1902,7 +2020,12 @@ static void LayDownRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -1960,7 +2083,12 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -1998,7 +2126,10 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2023,7 +2154,13 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -2052,7 +2189,10 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2078,7 +2218,12 @@ static void LayDownRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 43, @@ -2158,7 +2303,13 @@ static void LayDownRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2197,7 +2348,10 @@ static void LayDownRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2243,7 +2397,10 @@ static void LayDownRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2287,7 +2444,13 @@ static void LayDownRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2348,7 +2511,13 @@ static void LayDownRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2387,7 +2556,10 @@ static void LayDownRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2433,7 +2605,10 @@ static void LayDownRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2477,7 +2652,13 @@ static void LayDownRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -2537,7 +2718,13 @@ static void LayDownRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2568,7 +2755,13 @@ static void LayDownRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2607,7 +2800,13 @@ static void LayDownRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2642,7 +2841,12 @@ static void LayDownRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -2682,7 +2886,13 @@ static void LayDownRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2711,7 +2921,12 @@ static void LayDownRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -2784,7 +2999,13 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2815,7 +3036,13 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2857,7 +3084,13 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2892,7 +3125,12 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -2932,7 +3170,13 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2961,7 +3205,12 @@ static void LayDownRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, @@ -3027,7 +3276,13 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3068,7 +3323,13 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3099,7 +3360,12 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3139,7 +3405,12 @@ static void LayDownRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3196,7 +3467,13 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3247,7 +3524,13 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3278,7 +3561,12 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3318,7 +3606,12 @@ static void LayDownRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 41, @@ -3513,7 +3806,10 @@ static void LayDownRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -3611,7 +3907,11 @@ static void LayDownRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -3649,7 +3949,10 @@ static void LayDownRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3678,13 +3981,24 @@ static void LayDownRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3715,7 +4029,10 @@ static void LayDownRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3788,7 +4105,11 @@ static void LayDownRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -3826,7 +4147,10 @@ static void LayDownRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3855,13 +4179,24 @@ static void LayDownRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3892,7 +4227,10 @@ static void LayDownRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3983,7 +4321,13 @@ static void LayDownRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -4021,7 +4365,10 @@ static void LayDownRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4050,13 +4397,24 @@ static void LayDownRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4087,7 +4445,11 @@ static void LayDownRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -4160,7 +4522,13 @@ static void LayDownRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -4198,7 +4566,10 @@ static void LayDownRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4227,13 +4598,24 @@ static void LayDownRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4264,7 +4646,10 @@ static void LayDownRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -4353,7 +4738,13 @@ static void LayDownRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4380,7 +4771,13 @@ static void LayDownRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4407,7 +4804,13 @@ static void LayDownRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4435,7 +4838,13 @@ static void LayDownRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4583,7 +4992,13 @@ static void LayDownRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4610,7 +5025,13 @@ static void LayDownRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4637,7 +5058,13 @@ static void LayDownRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4665,7 +5092,13 @@ static void LayDownRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4721,7 +5154,13 @@ static void LayDownRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -4734,7 +5173,13 @@ static void LayDownRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -4747,7 +5192,13 @@ static void LayDownRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -4761,7 +5212,13 @@ static void LayDownRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4831,7 +5288,13 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4858,7 +5321,13 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4885,7 +5354,13 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4913,7 +5388,13 @@ static void LayDownRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4969,7 +5450,13 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -4982,7 +5469,13 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -4995,7 +5488,13 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5009,7 +5508,13 @@ static void LayDownRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5065,7 +5570,13 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5078,7 +5589,13 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5091,7 +5608,13 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5105,7 +5628,13 @@ static void LayDownRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5175,7 +5704,13 @@ static void LayDownRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5202,7 +5737,13 @@ static void LayDownRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5229,7 +5770,13 @@ static void LayDownRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5257,7 +5804,13 @@ static void LayDownRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5313,7 +5866,13 @@ static void LayDownRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5326,7 +5885,13 @@ static void LayDownRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5339,7 +5904,13 @@ static void LayDownRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5353,7 +5924,13 @@ static void LayDownRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5409,7 +5986,13 @@ static void LayDownRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5422,7 +6005,13 @@ static void LayDownRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5435,7 +6024,13 @@ static void LayDownRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5449,7 +6044,13 @@ static void LayDownRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5505,7 +6106,13 @@ static void LayDownRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -5517,7 +6124,13 @@ static void LayDownRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -5529,7 +6142,13 @@ static void LayDownRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -5542,7 +6161,13 @@ static void LayDownRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5598,7 +6223,13 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5611,7 +6242,13 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5624,7 +6261,13 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5638,7 +6281,13 @@ static void LayDownRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5694,7 +6343,13 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5707,7 +6362,13 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5720,7 +6381,13 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5734,7 +6401,13 @@ static void LayDownRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5790,7 +6463,13 @@ static void LayDownRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5803,7 +6482,13 @@ static void LayDownRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5816,7 +6501,13 @@ static void LayDownRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5830,7 +6521,13 @@ static void LayDownRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -5886,7 +6583,13 @@ static void LayDownRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5899,7 +6602,13 @@ static void LayDownRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5912,7 +6621,13 @@ static void LayDownRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5926,7 +6641,12 @@ static void LayDownRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5983,7 +6703,13 @@ static void LayDownRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5996,7 +6722,13 @@ static void LayDownRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6009,7 +6741,13 @@ static void LayDownRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6023,7 +6761,12 @@ static void LayDownRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6080,7 +6823,13 @@ static void LayDownRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6093,7 +6842,13 @@ static void LayDownRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6106,7 +6861,13 @@ static void LayDownRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6120,7 +6881,12 @@ static void LayDownRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6177,7 +6943,13 @@ static void LayDownRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6190,7 +6962,13 @@ static void LayDownRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6203,7 +6981,13 @@ static void LayDownRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6217,7 +7001,12 @@ static void LayDownRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6274,7 +7063,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6287,7 +7082,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6300,7 +7101,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6314,7 +7121,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6370,7 +7183,13 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6383,7 +7202,13 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6396,7 +7221,13 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6410,7 +7241,13 @@ static void LayDownRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6466,7 +7303,13 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6479,7 +7322,13 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6492,7 +7341,13 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6506,7 +7361,13 @@ static void LayDownRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6562,7 +7423,13 @@ static void LayDownRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6575,7 +7442,13 @@ static void LayDownRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6588,7 +7461,13 @@ static void LayDownRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6602,7 +7481,13 @@ static void LayDownRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6658,7 +7543,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -6670,7 +7561,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -6682,7 +7579,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -6695,7 +7598,13 @@ static void LayDownRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6751,7 +7660,13 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -6763,7 +7678,13 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -6775,7 +7696,13 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -6788,7 +7715,13 @@ static void LayDownRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6844,7 +7777,13 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6857,7 +7796,13 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6870,7 +7815,13 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6884,7 +7835,13 @@ static void LayDownRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -6940,7 +7897,13 @@ static void LayDownRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6953,7 +7916,13 @@ static void LayDownRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6966,7 +7935,13 @@ static void LayDownRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6980,7 +7955,13 @@ static void LayDownRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7036,7 +8017,13 @@ static void LayDownRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7049,7 +8036,13 @@ static void LayDownRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7062,7 +8055,13 @@ static void LayDownRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7076,7 +8075,12 @@ static void LayDownRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7133,7 +8137,13 @@ static void LayDownRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7146,7 +8156,13 @@ static void LayDownRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7159,7 +8175,13 @@ static void LayDownRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7173,7 +8195,12 @@ static void LayDownRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -7236,7 +8263,11 @@ static void LayDownRCTrackLeftFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -7270,7 +8301,11 @@ static void LayDownRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7307,7 +8342,11 @@ static void LayDownRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7344,7 +8383,11 @@ static void LayDownRCTrackRightFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -7377,7 +8420,11 @@ static void LayDownRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7414,7 +8461,11 @@ static void LayDownRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7453,7 +8504,10 @@ static void LayDownRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7480,7 +8534,11 @@ static void LayDownRCTrackFlyerHalfLoopDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -7549,7 +8607,10 @@ static void LayDownRCTrackFlyerHalfLoopDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7588,7 +8649,12 @@ static void LayDownRCTrackLeftFlyerCorkscrewDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -7662,7 +8728,12 @@ static void LayDownRCTrackLeftFlyerCorkscrewDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7709,7 +8780,10 @@ static void LayDownRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -7753,7 +8827,12 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -7793,7 +8872,11 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7822,7 +8905,13 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -7854,7 +8943,11 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -7884,7 +8977,12 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -7935,7 +9033,12 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -7975,7 +9078,11 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8004,7 +9111,12 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8036,7 +9148,11 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8066,7 +9182,12 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -8117,7 +9238,12 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -8157,7 +9283,11 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8186,7 +9316,13 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8218,7 +9354,11 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8248,7 +9388,12 @@ static void LayDownRCTrackLeftQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8299,7 +9444,12 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 51, session.SupportColours); @@ -8339,7 +9489,11 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8368,7 +9522,12 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -8400,7 +9559,11 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -8430,7 +9593,12 @@ static void LayDownRCTrackRightQuarterBankedHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 39, session.SupportColours); @@ -8481,7 +9649,10 @@ static void LayDownRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8565,7 +9736,11 @@ static void LayDownRCTrackHalfLoopInvertedUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -8598,7 +9773,10 @@ static void LayDownRCTrackHalfLoopInvertedUp( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } diff --git a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp index 59aee5c018..90b1e98392 100644 --- a/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LimLaunchedRollerCoaster.cpp @@ -106,7 +106,11 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -132,7 +136,11 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -161,7 +169,13 @@ static void LimLaunchedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -186,7 +200,11 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -218,7 +236,11 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -247,7 +269,13 @@ static void LimLaunchedRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -272,7 +300,11 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -315,7 +347,11 @@ static void LimLaunchedRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -591,7 +627,12 @@ static void LimLaunchedRCTrackLeftTwistDownToUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -633,7 +674,11 @@ static void LimLaunchedRCTrackLeftTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -683,7 +728,12 @@ static void LimLaunchedRCTrackLeftTwistDownToUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; @@ -740,7 +790,12 @@ static void LimLaunchedRCTrackRightTwistDownToUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -782,7 +837,11 @@ static void LimLaunchedRCTrackRightTwistDownToUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -832,7 +891,12 @@ static void LimLaunchedRCTrackRightTwistDownToUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; @@ -887,7 +951,12 @@ static void LimLaunchedRCTrackLeftTwistUpToDown( PaintUtilPushTunnelRotated(session, direction, height - 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height, 0x20); break; @@ -929,7 +998,11 @@ static void LimLaunchedRCTrackLeftTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -981,7 +1054,12 @@ static void LimLaunchedRCTrackLeftTwistUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1036,7 +1114,12 @@ static void LimLaunchedRCTrackRightTwistUpToDown( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_INVERTED_3); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -1078,7 +1161,11 @@ static void LimLaunchedRCTrackRightTwistUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1130,7 +1217,12 @@ static void LimLaunchedRCTrackRightTwistUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1230,7 +1322,12 @@ static void LimLaunchedRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -1287,7 +1384,12 @@ static void LimLaunchedRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1344,7 +1446,12 @@ static void LimLaunchedRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -1406,7 +1513,10 @@ static void LimLaunchedRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1443,7 +1553,10 @@ static void LimLaunchedRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1496,7 +1609,10 @@ static void LimLaunchedRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1550,7 +1666,10 @@ static void LimLaunchedRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -1590,7 +1709,10 @@ static void LimLaunchedRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -1630,7 +1752,10 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -1658,7 +1783,10 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1690,7 +1818,10 @@ static void LimLaunchedRCTrack90DegToInvertedFlatQuarterLoopUp( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1721,7 +1852,10 @@ static void LimLaunchedRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1763,7 +1897,10 @@ static void LimLaunchedRCTrackLeftQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -1810,7 +1947,10 @@ static void LimLaunchedRCTrackRightQuarterTurn190DegUp( } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -1891,7 +2031,12 @@ static void LimLaunchedRCTrackLeftBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1933,7 +2078,11 @@ static void LimLaunchedRCTrackLeftBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1983,7 +2132,12 @@ static void LimLaunchedRCTrackLeftBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2047,7 +2201,12 @@ static void LimLaunchedRCTrackRightBarrelRollUpToDown( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2089,7 +2248,11 @@ static void LimLaunchedRCTrackRightBarrelRollUpToDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2139,7 +2302,12 @@ static void LimLaunchedRCTrackRightBarrelRollUpToDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2197,7 +2365,10 @@ static void LimLaunchedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2261,7 +2432,11 @@ static void LimLaunchedRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -2294,7 +2469,10 @@ static void LimLaunchedRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2347,7 +2525,10 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2380,7 +2561,10 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2413,7 +2597,10 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 10, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -2455,7 +2642,10 @@ static void LimLaunchedRCTrackFlatTo60DegUpLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -2500,7 +2690,10 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -2533,7 +2726,10 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 18, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -2566,7 +2762,10 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2608,7 +2807,10 @@ static void LimLaunchedRCTrack60DegUpToFlatLongBase( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -2667,7 +2869,12 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -2707,7 +2914,11 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2736,7 +2947,13 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2745,7 +2962,11 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2812,7 +3033,11 @@ static void LimLaunchedRCTrackLeftLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2867,7 +3092,12 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::rightCorner, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -2907,7 +3137,11 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomRightSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2936,7 +3170,13 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2945,7 +3185,11 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( case 4: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3011,7 +3255,11 @@ static void LimLaunchedRCTrackRightLargeCorkscrewUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3080,7 +3328,10 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3110,7 +3361,11 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::topCorner), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3149,7 +3404,13 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -3177,7 +3438,13 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -3207,7 +3474,11 @@ static void LimLaunchedRCTrackLeftMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); if (direction == 0 || direction == 3) @@ -3258,7 +3529,10 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -3288,7 +3562,11 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3327,7 +3605,13 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -3356,7 +3640,13 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -3386,7 +3676,11 @@ static void LimLaunchedRCTrackRightMediumHalfLoopUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::topCorner), + direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { @@ -3461,7 +3755,10 @@ static void LimLaunchedRCTrackLeftZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -3490,7 +3787,11 @@ static void LimLaunchedRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3535,7 +3836,11 @@ static void LimLaunchedRCTrackLeftZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3593,7 +3898,10 @@ static void LimLaunchedRCTrackRightZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -3622,7 +3930,11 @@ static void LimLaunchedRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3667,7 +3979,11 @@ static void LimLaunchedRCTrackRightZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -3730,7 +4046,10 @@ static void LimLaunchedRCTrackLeftLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3761,7 +4080,10 @@ static void LimLaunchedRCTrackLeftLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3793,14 +4115,22 @@ static void LimLaunchedRCTrackLeftLargeZeroGRollUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3894,7 +4224,10 @@ static void LimLaunchedRCTrackRightLargeZeroGRollUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3925,7 +4258,10 @@ static void LimLaunchedRCTrackRightLargeZeroGRollUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3958,14 +4294,22 @@ static void LimLaunchedRCTrackRightLargeZeroGRollUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -4073,7 +4417,13 @@ static void LimLaunchedRCTrackLeftBankToLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4118,7 +4468,13 @@ static void LimLaunchedRCTrackLeftBankToLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4164,7 +4520,13 @@ static void LimLaunchedRCTrackRightBankToRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4209,7 +4571,13 @@ static void LimLaunchedRCTrackRightBankToRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4252,7 +4620,13 @@ static void LimLaunchedRCTrackLeftQuarterTurn325DegDownToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4300,7 +4674,13 @@ static void LimLaunchedRCTrackLeftQuarterTurn325DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4343,7 +4723,13 @@ static void LimLaunchedRCTrackRightQuarterTurn325DegDownToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4391,7 +4777,13 @@ static void LimLaunchedRCTrackRightQuarterTurn325DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -4434,7 +4826,10 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4470,7 +4865,10 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -4499,7 +4897,11 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -4539,7 +4941,11 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4568,7 +4974,13 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -4597,7 +5009,11 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4631,7 +5047,11 @@ static void LimLaunchedRCTrackLeftLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -4675,7 +5095,10 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4711,7 +5134,10 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -4740,7 +5166,11 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -4780,7 +5210,11 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4809,7 +5243,13 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -4838,7 +5278,11 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -4872,7 +5316,11 @@ static void LimLaunchedRCTrackRightLargeHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -4943,7 +5391,10 @@ static void LimLaunchedRCTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -4990,7 +5441,10 @@ static void LimLaunchedRCTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -5024,7 +5478,13 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -5037,7 +5497,12 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -5050,7 +5515,13 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -5077,7 +5548,13 @@ static void LimLaunchedRCTrackDiagFlatTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -5099,7 +5576,13 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5112,7 +5595,12 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5125,7 +5613,13 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5152,7 +5646,13 @@ static void LimLaunchedRCTrackDiag60DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5174,7 +5674,13 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5187,7 +5693,12 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5200,7 +5711,13 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5227,7 +5744,13 @@ static void LimLaunchedRCTrackDiagFlatTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5249,7 +5772,13 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -5262,7 +5791,12 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -5275,7 +5809,13 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -5302,7 +5842,13 @@ static void LimLaunchedRCTrackDiag60DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -5340,7 +5886,10 @@ static void LimLaunchedRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp index 06b35b7487..671b679cd9 100644 --- a/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/LoopingRollerCoaster.cpp @@ -91,7 +91,10 @@ static void LoopingRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -202,7 +205,10 @@ static void LoopingRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -282,7 +288,10 @@ static void LoopingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -362,7 +371,10 @@ static void LoopingRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -454,7 +466,10 @@ static void LoopingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -546,7 +561,10 @@ static void LoopingRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -626,7 +644,10 @@ static void LoopingRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -716,7 +737,13 @@ static void LoopingRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -748,7 +775,11 @@ static void LoopingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -777,7 +808,13 @@ static void LoopingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -809,7 +846,11 @@ static void LoopingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -849,7 +890,13 @@ static void LoopingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -905,7 +952,10 @@ static void LoopingRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -950,7 +1000,10 @@ static void LoopingRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -995,7 +1048,10 @@ static void LoopingRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1040,7 +1096,10 @@ static void LoopingRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1085,7 +1144,13 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1117,7 +1182,11 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1146,7 +1215,13 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1178,7 +1253,11 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1221,7 +1300,13 @@ static void LoopingRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1284,7 +1369,10 @@ static void LoopingRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1336,7 +1424,10 @@ static void LoopingRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1388,7 +1479,10 @@ static void LoopingRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1440,7 +1534,10 @@ static void LoopingRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1511,7 +1608,10 @@ static void LoopingRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1561,7 +1661,13 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1591,7 +1697,11 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1619,7 +1729,13 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1649,7 +1765,11 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1689,7 +1809,13 @@ static void LoopingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1733,7 +1859,13 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1763,7 +1895,11 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1791,7 +1927,12 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1821,7 +1962,11 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1861,7 +2006,13 @@ static void LoopingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1923,7 +2074,13 @@ static void LoopingRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1954,7 +2111,11 @@ static void LoopingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1986,7 +2147,11 @@ static void LoopingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2026,7 +2191,13 @@ static void LoopingRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2070,7 +2241,13 @@ static void LoopingRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2102,7 +2279,11 @@ static void LoopingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2135,7 +2316,11 @@ static void LoopingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2175,7 +2360,13 @@ static void LoopingRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2214,7 +2405,11 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2240,7 +2435,11 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2292,7 +2491,13 @@ static void LoopingRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2317,7 +2522,11 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2349,7 +2558,11 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2401,7 +2614,13 @@ static void LoopingRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2426,7 +2645,11 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2461,7 +2684,11 @@ static void LoopingRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2767,7 +2994,13 @@ static void LoopingRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2798,7 +3031,13 @@ static void LoopingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2837,7 +3076,13 @@ static void LoopingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2893,7 +3138,13 @@ static void LoopingRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2924,7 +3175,13 @@ static void LoopingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2966,7 +3223,13 @@ static void LoopingRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3015,7 +3278,13 @@ static void LoopingRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3056,7 +3325,13 @@ static void LoopingRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3096,7 +3371,13 @@ static void LoopingRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3143,7 +3424,13 @@ static void LoopingRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3208,7 +3495,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3240,7 +3532,13 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3282,7 +3580,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3325,7 +3628,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3357,7 +3665,13 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3394,7 +3708,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3442,7 +3761,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3474,7 +3798,13 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3516,7 +3846,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3559,7 +3894,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3591,7 +3931,13 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3628,7 +3974,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3704,7 +4055,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3737,7 +4093,11 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3766,7 +4126,13 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3798,7 +4164,11 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3841,7 +4211,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3884,7 +4259,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3917,7 +4297,11 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3946,7 +4330,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3978,7 +4367,11 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4016,7 +4409,12 @@ static void LoopingRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4064,7 +4462,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4097,7 +4500,11 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4126,7 +4533,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4158,7 +4570,11 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4201,7 +4617,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4244,7 +4665,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4277,7 +4703,11 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4306,7 +4736,13 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4338,7 +4774,11 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4376,7 +4816,12 @@ static void LoopingRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4550,7 +4995,10 @@ static void LoopingRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4596,7 +5044,10 @@ static void LoopingRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4642,7 +5093,10 @@ static void LoopingRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4736,7 +5190,10 @@ static void LoopingRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4765,7 +5222,11 @@ static void LoopingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4794,13 +5255,24 @@ static void LoopingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4837,7 +5309,11 @@ static void LoopingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4882,7 +5358,10 @@ static void LoopingRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4911,7 +5390,11 @@ static void LoopingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4940,13 +5423,24 @@ static void LoopingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4983,7 +5477,11 @@ static void LoopingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5046,7 +5544,10 @@ static void LoopingRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5075,7 +5576,11 @@ static void LoopingRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5104,13 +5609,24 @@ static void LoopingRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5147,7 +5663,11 @@ static void LoopingRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5192,7 +5712,10 @@ static void LoopingRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5221,7 +5744,11 @@ static void LoopingRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5250,13 +5777,24 @@ static void LoopingRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5293,7 +5831,11 @@ static void LoopingRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5349,7 +5891,13 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5376,7 +5924,12 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5403,7 +5956,13 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5462,7 +6021,13 @@ static void LoopingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5528,7 +6093,13 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5555,7 +6126,12 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5582,7 +6158,13 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5641,7 +6223,13 @@ static void LoopingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5678,7 +6266,13 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5705,7 +6299,12 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5732,7 +6331,13 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5793,7 +6398,13 @@ static void LoopingRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5830,7 +6441,13 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5857,7 +6474,12 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5884,7 +6506,13 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5943,7 +6571,13 @@ static void LoopingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5980,7 +6614,13 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6007,7 +6647,12 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6034,7 +6679,13 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6095,7 +6746,13 @@ static void LoopingRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6132,7 +6789,13 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6159,7 +6822,12 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6186,7 +6854,13 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6247,7 +6921,13 @@ static void LoopingRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6284,7 +6964,13 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6311,7 +6997,12 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6338,7 +7029,13 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6397,7 +7094,13 @@ static void LoopingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6434,7 +7137,13 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6461,7 +7170,12 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6488,7 +7202,13 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6547,7 +7267,13 @@ static void LoopingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6584,7 +7310,13 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6611,7 +7343,12 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6638,7 +7375,13 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6699,7 +7442,13 @@ static void LoopingRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6736,7 +7485,13 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6762,7 +7517,12 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6788,7 +7548,13 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6846,7 +7612,13 @@ static void LoopingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -6884,7 +7656,13 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6911,7 +7689,12 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6938,7 +7721,13 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6999,7 +7788,13 @@ static void LoopingRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7036,7 +7831,13 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7063,7 +7864,12 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7090,7 +7896,13 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7149,7 +7961,13 @@ static void LoopingRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7186,7 +8004,13 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7213,7 +8037,12 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7240,7 +8069,13 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7299,7 +8134,13 @@ static void LoopingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7322,7 +8163,13 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7338,7 +8185,12 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7351,7 +8203,13 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7378,7 +8236,13 @@ static void LoopingRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7401,7 +8265,13 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7414,7 +8284,12 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7430,7 +8305,13 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7457,7 +8338,13 @@ static void LoopingRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7480,7 +8367,13 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7496,7 +8389,12 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7509,7 +8407,13 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7536,7 +8440,13 @@ static void LoopingRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7559,7 +8469,13 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7572,7 +8488,12 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7588,7 +8509,13 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7615,7 +8542,13 @@ static void LoopingRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7638,7 +8571,13 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7654,7 +8593,12 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7667,7 +8611,13 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7694,7 +8644,13 @@ static void LoopingRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7717,7 +8673,13 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7730,7 +8692,12 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7746,7 +8713,13 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7773,7 +8746,13 @@ static void LoopingRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7796,7 +8775,13 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7812,7 +8797,12 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7825,7 +8815,13 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7852,7 +8848,13 @@ static void LoopingRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7875,7 +8877,13 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7888,7 +8896,12 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7904,7 +8917,13 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7931,7 +8950,13 @@ static void LoopingRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7954,7 +8979,13 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -7969,7 +9000,12 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -7981,7 +9017,13 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8007,7 +9049,13 @@ static void LoopingRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8031,7 +9079,13 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8043,7 +9097,12 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8058,7 +9117,13 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8084,7 +9149,13 @@ static void LoopingRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8108,7 +9179,13 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8124,7 +9201,12 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8137,7 +9219,13 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8164,7 +9252,13 @@ static void LoopingRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8187,7 +9281,13 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8200,7 +9300,12 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8216,7 +9321,13 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8243,7 +9354,13 @@ static void LoopingRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8266,7 +9383,13 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8279,7 +9402,12 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8292,7 +9420,13 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8319,7 +9453,13 @@ static void LoopingRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8342,7 +9482,13 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8355,7 +9501,12 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8368,7 +9519,13 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8395,7 +9552,13 @@ static void LoopingRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8434,7 +9597,10 @@ static void LoopingRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -8473,7 +9639,13 @@ static void LoopingRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8516,7 +9688,13 @@ static void LoopingRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8557,7 +9735,13 @@ static void LoopingRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8606,7 +9790,13 @@ static void LoopingRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8668,7 +9858,13 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8699,7 +9895,11 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8727,7 +9927,13 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8759,7 +9965,11 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8799,7 +10009,13 @@ static void LoopingRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8843,7 +10059,13 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8874,7 +10096,11 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8902,7 +10128,12 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8934,7 +10165,11 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8974,7 +10209,13 @@ static void LoopingRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9043,7 +10284,10 @@ static void LoopingRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9092,7 +10336,10 @@ static void LoopingRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9141,7 +10388,10 @@ static void LoopingRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9190,7 +10440,10 @@ static void LoopingRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -9268,7 +10521,10 @@ static void LoopingRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9314,7 +10570,10 @@ static void LoopingRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9360,7 +10619,10 @@ static void LoopingRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9406,7 +10668,10 @@ static void LoopingRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9487,7 +10752,10 @@ static void LoopingRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9536,7 +10804,10 @@ static void LoopingRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9585,7 +10856,10 @@ static void LoopingRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9634,7 +10908,10 @@ static void LoopingRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9696,7 +10973,10 @@ static void LoopingRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/MineRide.cpp b/src/openrct2/ride/coaster/MineRide.cpp index 383c381c8d..0e496f6ae2 100644 --- a/src/openrct2/ride/coaster/MineRide.cpp +++ b/src/openrct2/ride/coaster/MineRide.cpp @@ -50,7 +50,10 @@ static void MineRideTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -135,7 +138,10 @@ static void MineRideTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -196,7 +202,10 @@ static void MineRideTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -257,7 +266,10 @@ static void MineRideTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -329,7 +341,13 @@ static void MineRideTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -361,7 +379,11 @@ static void MineRideTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -390,7 +412,13 @@ static void MineRideTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -422,7 +450,11 @@ static void MineRideTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -468,7 +500,13 @@ static void MineRideTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -539,7 +577,10 @@ static void MineRideTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -599,7 +640,10 @@ static void MineRideTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -659,7 +703,10 @@ static void MineRideTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -719,7 +766,10 @@ static void MineRideTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -770,7 +820,13 @@ static void MineRideTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -802,7 +858,11 @@ static void MineRideTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -831,7 +891,13 @@ static void MineRideTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -863,7 +929,11 @@ static void MineRideTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -912,7 +982,13 @@ static void MineRideTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -990,7 +1066,10 @@ static void MineRideTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1057,7 +1136,10 @@ static void MineRideTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1124,7 +1206,10 @@ static void MineRideTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1191,7 +1276,10 @@ static void MineRideTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1277,7 +1365,10 @@ static void MineRideTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1333,7 +1424,13 @@ static void MineRideTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1364,7 +1461,11 @@ static void MineRideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1396,7 +1497,11 @@ static void MineRideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1442,7 +1547,13 @@ static void MineRideTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1492,7 +1603,13 @@ static void MineRideTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1524,7 +1641,11 @@ static void MineRideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1557,7 +1678,11 @@ static void MineRideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1603,7 +1728,13 @@ static void MineRideTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1653,7 +1784,13 @@ static void MineRideTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1684,7 +1821,13 @@ static void MineRideTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1729,7 +1872,13 @@ static void MineRideTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1791,7 +1940,13 @@ static void MineRideTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1822,7 +1977,13 @@ static void MineRideTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1870,7 +2031,13 @@ static void MineRideTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1932,7 +2099,12 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1964,7 +2136,13 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2012,7 +2190,12 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2061,7 +2244,12 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2093,7 +2281,13 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2136,7 +2330,12 @@ static void MineRideTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2190,7 +2389,12 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2222,7 +2426,13 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2270,7 +2480,12 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2319,7 +2534,12 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2351,7 +2571,13 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -2394,7 +2620,12 @@ static void MineRideTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2476,7 +2707,12 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2509,7 +2745,11 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2538,7 +2778,13 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2570,7 +2816,11 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2619,7 +2869,12 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2668,7 +2923,12 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2701,7 +2961,11 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2730,7 +2994,12 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -2762,7 +3031,11 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2806,7 +3079,12 @@ static void MineRideTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2860,7 +3138,12 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2893,7 +3176,11 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2922,7 +3209,12 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2954,7 +3246,11 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3003,7 +3299,12 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3052,7 +3353,12 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3085,7 +3391,11 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3114,7 +3424,13 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3146,7 +3462,11 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3190,7 +3510,12 @@ static void MineRideTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3307,7 +3632,10 @@ static void MineRideTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3336,7 +3664,11 @@ static void MineRideTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3365,13 +3697,24 @@ static void MineRideTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3408,7 +3751,11 @@ static void MineRideTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3459,7 +3806,10 @@ static void MineRideTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3488,7 +3838,11 @@ static void MineRideTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3517,13 +3871,24 @@ static void MineRideTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3560,7 +3925,11 @@ static void MineRideTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3629,7 +3998,10 @@ static void MineRideTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3658,7 +4030,11 @@ static void MineRideTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3687,13 +4063,24 @@ static void MineRideTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3730,7 +4117,11 @@ static void MineRideTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3781,7 +4172,10 @@ static void MineRideTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3810,7 +4204,11 @@ static void MineRideTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3839,13 +4237,24 @@ static void MineRideTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3882,7 +4291,11 @@ static void MineRideTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3924,7 +4337,13 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -3937,7 +4356,12 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3950,7 +4374,13 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3977,7 +4407,13 @@ static void MineRideTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4000,7 +4436,13 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4013,7 +4455,12 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4026,7 +4473,13 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4054,7 +4507,13 @@ static void MineRideTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4077,7 +4536,13 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4090,7 +4555,12 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4103,7 +4573,13 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4130,7 +4606,13 @@ static void MineRideTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4153,7 +4635,13 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4166,7 +4654,12 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4179,7 +4672,13 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4207,7 +4706,13 @@ static void MineRideTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4230,7 +4735,13 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4243,7 +4754,12 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4256,7 +4772,13 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4284,7 +4806,13 @@ static void MineRideTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4307,7 +4835,13 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -4319,7 +4853,12 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -4331,7 +4870,13 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -4358,7 +4903,13 @@ static void MineRideTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -4382,7 +4933,13 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4395,7 +4952,12 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4408,7 +4970,13 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4435,7 +5003,13 @@ static void MineRideTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4458,7 +5032,13 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4474,7 +5054,12 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4487,7 +5072,13 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4514,7 +5105,13 @@ static void MineRideTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4537,7 +5134,13 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4550,7 +5153,12 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4566,7 +5174,13 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4593,7 +5207,13 @@ static void MineRideTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4616,7 +5236,13 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4632,7 +5258,12 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4645,7 +5276,13 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4672,7 +5309,13 @@ static void MineRideTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4695,7 +5338,13 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4708,7 +5357,12 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4724,7 +5378,13 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4751,7 +5411,13 @@ static void MineRideTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4774,7 +5440,13 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4790,7 +5462,12 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4803,7 +5480,13 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4830,7 +5513,13 @@ static void MineRideTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4853,7 +5542,13 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4866,7 +5561,12 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4882,7 +5582,13 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4909,7 +5615,13 @@ static void MineRideTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4932,7 +5644,13 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4948,7 +5666,12 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4961,7 +5684,13 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4989,7 +5718,13 @@ static void MineRideTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5012,7 +5747,13 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5025,7 +5766,12 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5041,7 +5787,13 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5069,7 +5821,13 @@ static void MineRideTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5092,7 +5850,13 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -5107,7 +5871,12 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -5119,7 +5888,13 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -5146,7 +5921,13 @@ static void MineRideTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -5170,7 +5951,13 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -5182,7 +5969,12 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -5197,7 +5989,13 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -5224,7 +6022,13 @@ static void MineRideTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -5248,7 +6052,13 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5264,7 +6074,12 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5277,7 +6092,13 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5304,7 +6125,13 @@ static void MineRideTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5327,7 +6154,13 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5340,7 +6173,12 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5356,7 +6194,13 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5383,7 +6227,13 @@ static void MineRideTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5406,7 +6256,13 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5419,7 +6275,12 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5432,7 +6293,13 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5459,7 +6326,13 @@ static void MineRideTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5482,7 +6355,13 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5495,7 +6374,12 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5508,7 +6392,13 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5535,7 +6425,13 @@ static void MineRideTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/MineTrainCoaster.cpp b/src/openrct2/ride/coaster/MineTrainCoaster.cpp index cd52cda9cb..c3f7c17f3c 100644 --- a/src/openrct2/ride/coaster/MineTrainCoaster.cpp +++ b/src/openrct2/ride/coaster/MineTrainCoaster.cpp @@ -628,7 +628,11 @@ static void MineTrainRCTrackLeftQuarterTurn5( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -663,7 +667,11 @@ static void MineTrainRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -701,14 +709,21 @@ static void MineTrainRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -743,7 +758,11 @@ static void MineTrainRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1042,7 +1061,11 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1078,7 +1101,11 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1119,14 +1146,21 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -1162,7 +1196,11 @@ static void MineTrainRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1555,7 +1593,11 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1592,7 +1634,11 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1631,14 +1677,21 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -1675,7 +1728,11 @@ static void MineTrainRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1775,7 +1832,10 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1812,7 +1872,11 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1851,14 +1915,20 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -1895,7 +1965,11 @@ static void MineTrainRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2046,7 +2120,11 @@ static void MineTrainRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2082,7 +2160,11 @@ static void MineTrainRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2211,7 +2293,11 @@ static void MineTrainRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2247,7 +2333,11 @@ static void MineTrainRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2374,7 +2464,13 @@ static void MineTrainRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2513,7 +2609,13 @@ static void MineTrainRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2625,7 +2727,13 @@ static void MineTrainRCTrackLeftQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2721,7 +2829,13 @@ static void MineTrainRCTrackRightQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2832,9 +2946,20 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2869,7 +2994,13 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2917,9 +3048,20 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2968,9 +3110,20 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3004,7 +3157,13 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3047,9 +3206,20 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3103,9 +3273,20 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3140,7 +3321,13 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3188,9 +3375,20 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3239,9 +3437,20 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3276,7 +3485,13 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3319,9 +3534,20 @@ static void MineTrainRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3403,15 +3629,30 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3448,7 +3689,11 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3488,14 +3733,30 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -3535,7 +3796,11 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3584,9 +3849,20 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3635,15 +3911,29 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -3680,7 +3970,11 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3720,14 +4014,28 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -3767,7 +4075,11 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3811,9 +4123,20 @@ static void MineTrainRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3867,15 +4190,29 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -3912,7 +4249,11 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3949,14 +4290,28 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -3993,7 +4348,11 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4042,9 +4401,20 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4093,15 +4463,30 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -4138,7 +4523,11 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4175,14 +4564,30 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -4219,7 +4624,11 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4263,9 +4672,20 @@ static void MineTrainRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6655,7 +7075,13 @@ static void MineTrainRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6670,7 +7096,12 @@ static void MineTrainRCTrackDiagLeftBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6685,7 +7116,13 @@ static void MineTrainRCTrackDiagLeftBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6697,7 +7134,13 @@ static void MineTrainRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6719,7 +7162,13 @@ static void MineTrainRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6734,7 +7183,12 @@ static void MineTrainRCTrackDiagRightBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner0, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6749,7 +7203,13 @@ static void MineTrainRCTrackDiagRightBank( session, WoodenSupportType::Mine, WoodenSupportSubType::Corner2, direction, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6761,7 +7221,13 @@ static void MineTrainRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp index 6e714205bf..650b0b2ca6 100644 --- a/src/openrct2/ride/coaster/MiniRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniRollerCoaster.cpp @@ -111,7 +111,10 @@ static void MiniRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -255,7 +258,10 @@ static void MiniRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -316,7 +322,10 @@ static void MiniRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -426,7 +435,10 @@ static void MiniRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -493,7 +505,10 @@ static void MiniRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -560,7 +575,10 @@ static void MiniRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -670,7 +688,10 @@ static void MiniRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -766,7 +787,13 @@ static void MiniRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -798,7 +825,11 @@ static void MiniRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -827,7 +858,13 @@ static void MiniRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -859,7 +896,11 @@ static void MiniRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -905,7 +946,13 @@ static void MiniRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -976,7 +1023,10 @@ static void MiniRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1036,7 +1086,10 @@ static void MiniRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1096,7 +1149,10 @@ static void MiniRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1156,7 +1212,10 @@ static void MiniRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1207,7 +1266,13 @@ static void MiniRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1239,7 +1304,11 @@ static void MiniRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1268,7 +1337,13 @@ static void MiniRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1300,7 +1375,11 @@ static void MiniRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1349,7 +1428,13 @@ static void MiniRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1427,7 +1512,10 @@ static void MiniRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1494,7 +1582,10 @@ static void MiniRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1561,7 +1652,10 @@ static void MiniRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1628,7 +1722,10 @@ static void MiniRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1714,7 +1811,10 @@ static void MiniRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1770,7 +1870,13 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1800,7 +1906,11 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1828,7 +1938,13 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1858,7 +1974,11 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1904,7 +2024,13 @@ static void MiniRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1954,7 +2080,13 @@ static void MiniRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1984,7 +2116,11 @@ static void MiniRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2012,7 +2148,12 @@ static void MiniRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -2042,7 +2183,11 @@ static void MiniRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2088,7 +2233,13 @@ static void MiniRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2156,7 +2307,13 @@ static void MiniRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2187,7 +2344,11 @@ static void MiniRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2219,7 +2380,11 @@ static void MiniRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2265,7 +2430,13 @@ static void MiniRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2315,7 +2486,13 @@ static void MiniRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2347,7 +2524,11 @@ static void MiniRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2380,7 +2561,11 @@ static void MiniRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2426,7 +2611,13 @@ static void MiniRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2476,7 +2667,13 @@ static void MiniRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2507,7 +2704,13 @@ static void MiniRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2552,7 +2755,13 @@ static void MiniRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2614,7 +2823,13 @@ static void MiniRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2645,7 +2860,13 @@ static void MiniRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2693,7 +2914,13 @@ static void MiniRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2748,7 +2975,13 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2795,7 +3028,13 @@ static void MiniRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2841,7 +3080,13 @@ static void MiniRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2888,7 +3133,13 @@ static void MiniRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2959,7 +3210,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2991,7 +3247,13 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3039,7 +3301,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3088,7 +3355,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3120,7 +3392,13 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3163,7 +3441,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3217,7 +3500,12 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3249,7 +3537,13 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3297,7 +3591,12 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3346,7 +3645,12 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3378,7 +3682,13 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3421,7 +3731,12 @@ static void MiniRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3503,7 +3818,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3536,7 +3856,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3565,7 +3889,13 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3597,7 +3927,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3646,7 +3980,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3695,7 +4034,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3728,7 +4072,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3757,7 +4105,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -3789,7 +4142,11 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3833,7 +4190,12 @@ static void MiniRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3887,7 +4249,12 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3920,7 +4287,11 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3949,7 +4320,12 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -3981,7 +4357,11 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4030,7 +4410,12 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4079,7 +4464,12 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4112,7 +4502,11 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4141,7 +4535,13 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4173,7 +4573,11 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4217,7 +4621,12 @@ static void MiniRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4390,7 +4799,10 @@ static void MiniRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4451,7 +4863,10 @@ static void MiniRCTrack25DegUpLeftBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4512,7 +4927,10 @@ static void MiniRCTrack25DegUpRightBanked( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -4614,7 +5032,10 @@ static void MiniRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4643,7 +5064,11 @@ static void MiniRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4672,13 +5097,24 @@ static void MiniRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4715,7 +5151,11 @@ static void MiniRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4766,7 +5206,10 @@ static void MiniRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4795,7 +5238,11 @@ static void MiniRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4824,13 +5271,24 @@ static void MiniRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4867,7 +5325,11 @@ static void MiniRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4936,7 +5398,10 @@ static void MiniRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4965,7 +5430,11 @@ static void MiniRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4994,13 +5463,24 @@ static void MiniRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5037,7 +5517,11 @@ static void MiniRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5088,7 +5572,10 @@ static void MiniRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5117,7 +5604,11 @@ static void MiniRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5146,13 +5637,24 @@ static void MiniRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5189,7 +5691,11 @@ static void MiniRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5245,7 +5751,13 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5272,7 +5784,12 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5299,7 +5816,13 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5358,7 +5881,13 @@ static void MiniRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5395,7 +5924,13 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5422,7 +5957,12 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5449,7 +5989,13 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5510,7 +6056,13 @@ static void MiniRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5533,7 +6085,13 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5546,7 +6104,12 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -5559,7 +6122,13 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -5587,7 +6156,13 @@ static void MiniRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -5624,7 +6199,13 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5651,7 +6232,12 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5678,7 +6264,13 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5737,7 +6329,13 @@ static void MiniRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5760,7 +6358,13 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5773,7 +6377,12 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5786,7 +6395,13 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5814,7 +6429,13 @@ static void MiniRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5837,7 +6458,13 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5850,7 +6477,12 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -5863,7 +6495,13 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -5891,7 +6529,13 @@ static void MiniRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -5928,7 +6572,13 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5955,7 +6605,12 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5982,7 +6637,13 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6043,7 +6704,13 @@ static void MiniRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6080,7 +6747,13 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6107,7 +6780,12 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6134,7 +6812,13 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6195,7 +6879,13 @@ static void MiniRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6218,7 +6908,13 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6231,7 +6927,12 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6244,7 +6945,13 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6272,7 +6979,13 @@ static void MiniRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6309,7 +7022,13 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -6335,7 +7054,12 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -6361,7 +7085,13 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -6421,7 +7151,13 @@ static void MiniRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -6445,7 +7181,13 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6458,7 +7200,12 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6471,7 +7218,13 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6499,7 +7252,13 @@ static void MiniRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6522,7 +7281,13 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6535,7 +7300,12 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6548,7 +7318,13 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6576,7 +7352,13 @@ static void MiniRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6613,7 +7395,13 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6640,7 +7428,12 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6667,7 +7460,13 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6726,7 +7525,13 @@ static void MiniRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6749,7 +7554,13 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6765,7 +7576,12 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6778,7 +7594,13 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6805,7 +7627,13 @@ static void MiniRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6828,7 +7656,13 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6841,7 +7675,12 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6857,7 +7696,13 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6884,7 +7729,13 @@ static void MiniRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6907,7 +7758,13 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6923,7 +7780,12 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6936,7 +7798,13 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -6963,7 +7831,13 @@ static void MiniRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -6986,7 +7860,13 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6999,7 +7879,12 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7015,7 +7900,13 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7042,7 +7933,13 @@ static void MiniRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7065,7 +7962,13 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7081,7 +7984,12 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7094,7 +8002,13 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7121,7 +8035,13 @@ static void MiniRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7144,7 +8064,13 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7157,7 +8083,12 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7173,7 +8104,13 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7200,7 +8137,13 @@ static void MiniRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7223,7 +8166,13 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7239,7 +8188,12 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7252,7 +8206,13 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7280,7 +8240,13 @@ static void MiniRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7303,7 +8269,13 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7316,7 +8288,12 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7332,7 +8309,13 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7360,7 +8343,13 @@ static void MiniRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7383,7 +8372,13 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -7398,7 +8393,12 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -7410,7 +8410,13 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -7437,7 +8443,13 @@ static void MiniRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -7461,7 +8473,13 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -7473,7 +8491,12 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -7488,7 +8511,13 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -7515,7 +8544,13 @@ static void MiniRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -7539,7 +8574,13 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7555,7 +8596,12 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7568,7 +8614,13 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7595,7 +8647,13 @@ static void MiniRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7618,7 +8676,13 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7631,7 +8695,12 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7647,7 +8716,13 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7674,7 +8749,13 @@ static void MiniRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7697,7 +8778,13 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7710,7 +8797,12 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7723,7 +8815,13 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7750,7 +8848,13 @@ static void MiniRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7773,7 +8877,13 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7786,7 +8896,12 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7799,7 +8914,13 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7826,7 +8947,13 @@ static void MiniRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7862,7 +8989,10 @@ static void MiniRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -7907,7 +9037,13 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7956,7 +9092,13 @@ static void MiniRCTrackLeftBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8003,7 +9145,13 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8052,7 +9200,13 @@ static void MiniRCTrackRightBankedQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8120,7 +9274,13 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8151,7 +9311,11 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8179,7 +9343,13 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8211,7 +9381,11 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8257,7 +9431,13 @@ static void MiniRCTrackLeftBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8307,7 +9487,13 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8338,7 +9524,11 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8366,7 +9556,12 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8398,7 +9593,11 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8444,7 +9643,13 @@ static void MiniRCTrackRightBankedQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8528,7 +9733,10 @@ static void MiniRCTrack25DegUpToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8592,7 +9800,10 @@ static void MiniRCTrack25DegUpToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8656,7 +9867,10 @@ static void MiniRCTrackLeftBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8720,7 +9934,10 @@ static void MiniRCTrackRightBanked25DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -8813,7 +10030,10 @@ static void MiniRCTrackLeftBankedFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -8874,7 +10094,10 @@ static void MiniRCTrackRightBankedFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -8935,7 +10158,10 @@ static void MiniRCTrackLeftBanked25DegUpToLeftBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -8996,7 +10222,10 @@ static void MiniRCTrackRightBanked25DegUpToRightBankedFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9092,7 +10321,10 @@ static void MiniRCTrackFlatToLeftBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9156,7 +10388,10 @@ static void MiniRCTrackFlatToRightBanked25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -9220,7 +10455,10 @@ static void MiniRCTrackLeftBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9284,7 +10522,10 @@ static void MiniRCTrackRightBanked25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -9359,7 +10600,13 @@ static void MiniRCTrackLeftCurvedLiftHill( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9406,7 +10653,13 @@ static void MiniRCTrackLeftCurvedLiftHill( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9451,7 +10704,13 @@ static void MiniRCTrackRightCurvedLiftHill( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9498,7 +10757,13 @@ static void MiniRCTrackRightCurvedLiftHill( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9535,7 +10800,10 @@ static void MiniRCTrackBooster( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp index fcce66bea3..76c5b93f6e 100644 --- a/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp +++ b/src/openrct2/ride/coaster/MiniSuspendedCoaster.cpp @@ -57,7 +57,10 @@ static void MiniSuspendedRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -165,7 +168,10 @@ static void MiniSuspendedRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -260,7 +266,10 @@ static void MiniSuspendedRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -355,7 +364,10 @@ static void MiniSuspendedRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -444,7 +456,12 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -491,7 +508,11 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -516,7 +537,13 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -544,7 +571,11 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -570,7 +601,12 @@ static void MiniSuspendedRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -638,7 +674,13 @@ static void MiniSuspendedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -682,7 +724,11 @@ static void MiniSuspendedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -723,7 +769,11 @@ static void MiniSuspendedRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -763,7 +813,13 @@ static void MiniSuspendedRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -821,7 +877,13 @@ static void MiniSuspendedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -865,7 +927,11 @@ static void MiniSuspendedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -906,7 +972,11 @@ static void MiniSuspendedRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -946,7 +1016,13 @@ static void MiniSuspendedRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1004,7 +1080,12 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1050,7 +1131,13 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1075,7 +1162,12 @@ static void MiniSuspendedRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1147,7 +1239,13 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1194,7 +1292,11 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1223,13 +1325,24 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1260,7 +1373,10 @@ static void MiniSuspendedRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1323,7 +1439,13 @@ static void MiniSuspendedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1370,7 +1492,11 @@ static void MiniSuspendedRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1399,13 +1525,24 @@ static void MiniSuspendedRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1436,7 +1573,10 @@ static void MiniSuspendedRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1515,7 +1655,13 @@ static void MiniSuspendedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1542,7 +1688,12 @@ static void MiniSuspendedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1569,7 +1720,13 @@ static void MiniSuspendedRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1597,7 +1754,13 @@ static void MiniSuspendedRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1657,7 +1820,13 @@ static void MiniSuspendedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1684,7 +1853,12 @@ static void MiniSuspendedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1711,7 +1885,13 @@ static void MiniSuspendedRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1739,7 +1919,13 @@ static void MiniSuspendedRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1799,7 +1985,13 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -1826,7 +2018,12 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1853,7 +2050,13 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -1881,7 +2084,13 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1941,7 +2150,13 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1968,7 +2183,12 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1995,7 +2215,13 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -2023,7 +2249,13 @@ static void MiniSuspendedRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -2083,7 +2315,13 @@ static void MiniSuspendedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2110,7 +2348,12 @@ static void MiniSuspendedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2137,7 +2380,13 @@ static void MiniSuspendedRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -2165,7 +2414,13 @@ static void MiniSuspendedRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -2225,7 +2480,13 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2251,7 +2512,12 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2277,7 +2543,13 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2304,7 +2576,13 @@ static void MiniSuspendedRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -2364,7 +2642,13 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -2391,7 +2675,12 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -2418,7 +2707,13 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -2446,7 +2741,13 @@ static void MiniSuspendedRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: diff --git a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp index 2e6ffc3c65..dc8fa18a2b 100644 --- a/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/MultiDimensionRollerCoaster.cpp @@ -155,7 +155,10 @@ static void MultiDimensionRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -332,7 +335,10 @@ static void MultiDimensionRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -452,7 +458,10 @@ static void MultiDimensionRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } } @@ -564,7 +573,10 @@ static void MultiDimensionRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -696,7 +708,10 @@ static void MultiDimensionRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } } @@ -786,7 +801,10 @@ static void MultiDimensionRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -933,7 +951,10 @@ static void MultiDimensionRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -1093,7 +1114,10 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1122,7 +1146,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1155,7 +1185,10 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1195,7 +1228,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1230,7 +1269,12 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -1272,7 +1316,10 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1301,7 +1348,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1334,7 +1387,10 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1364,7 +1420,12 @@ static void MultiDimensionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -1467,7 +1528,11 @@ static void MultiDimensionRCTrackFlatToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1553,7 +1618,11 @@ static void MultiDimensionRCTrackFlatToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1639,7 +1708,11 @@ static void MultiDimensionRCTrackLeftBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1725,7 +1798,11 @@ static void MultiDimensionRCTrackRightBankToFlat( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -1813,7 +1890,10 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1842,7 +1922,13 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1875,7 +1961,10 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1918,7 +2007,13 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1953,7 +2048,12 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -1993,7 +2093,10 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2021,7 +2124,13 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -2052,7 +2161,10 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2082,7 +2194,12 @@ static void MultiDimensionRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -2192,7 +2309,11 @@ static void MultiDimensionRCTrackLeftBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2313,7 +2434,11 @@ static void MultiDimensionRCTrackRightBankTo25DegUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2434,7 +2559,11 @@ static void MultiDimensionRCTrack25DegUpToLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2555,7 +2684,11 @@ static void MultiDimensionRCTrack25DegUpToRightBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2695,7 +2828,11 @@ static void MultiDimensionRCTrackLeftBank( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { @@ -2890,7 +3027,13 @@ static void MultiDimensionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -2929,7 +3072,10 @@ static void MultiDimensionRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2975,7 +3121,10 @@ static void MultiDimensionRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3019,7 +3168,13 @@ static void MultiDimensionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -3213,7 +3368,13 @@ static void MultiDimensionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -3252,7 +3413,10 @@ static void MultiDimensionRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3298,7 +3462,10 @@ static void MultiDimensionRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -3342,7 +3509,13 @@ static void MultiDimensionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -3432,7 +3605,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3471,7 +3650,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3506,7 +3691,12 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3546,7 +3736,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3575,7 +3771,12 @@ static void MultiDimensionRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3678,7 +3879,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3720,7 +3927,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3755,7 +3968,12 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3795,7 +4013,13 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3824,7 +4048,12 @@ static void MultiDimensionRCTrackLeftQuarterTurn3Bank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, @@ -3925,7 +4154,13 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3967,7 +4202,12 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4040,7 +4280,13 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4153,7 +4399,13 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4236,7 +4488,12 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4268,7 +4525,13 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4410,7 +4673,11 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4439,7 +4706,13 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4471,7 +4744,11 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4514,7 +4791,12 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4588,7 +4870,11 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4617,7 +4903,12 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4649,7 +4940,11 @@ static void MultiDimensionRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4764,7 +5059,11 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4793,7 +5092,12 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4825,7 +5129,11 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4909,7 +5217,12 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4942,7 +5255,11 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4971,7 +5288,13 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -5003,7 +5326,11 @@ static void MultiDimensionRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5124,7 +5451,10 @@ static void MultiDimensionRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -5272,7 +5602,11 @@ static void MultiDimensionRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5309,7 +5643,11 @@ static void MultiDimensionRCTrack90DegUp( } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5365,7 +5703,11 @@ static void MultiDimensionRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5406,7 +5748,11 @@ static void MultiDimensionRCTrack60DegUpTo90DegUp( } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -5463,7 +5809,10 @@ static void MultiDimensionRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } else @@ -5501,7 +5850,10 @@ static void MultiDimensionRCTrack90DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); } } @@ -5544,7 +5896,11 @@ static void MultiDimensionRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -5584,7 +5940,11 @@ static void MultiDimensionRCTrack60DegDownTo90DegDown( PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -5687,13 +6047,24 @@ static void MultiDimensionRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5767,7 +6138,11 @@ static void MultiDimensionRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -5805,7 +6180,10 @@ static void MultiDimensionRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5834,13 +6212,24 @@ static void MultiDimensionRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5871,7 +6260,10 @@ static void MultiDimensionRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -5997,13 +6389,24 @@ static void MultiDimensionRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6077,7 +6480,11 @@ static void MultiDimensionRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -6115,7 +6522,10 @@ static void MultiDimensionRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6144,13 +6554,24 @@ static void MultiDimensionRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6181,7 +6602,10 @@ static void MultiDimensionRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6325,13 +6749,24 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6405,7 +6840,13 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -6443,7 +6884,10 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6472,13 +6916,24 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6509,7 +6964,11 @@ static void MultiDimensionRCTrackLeftEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6635,13 +7094,24 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6715,7 +7185,13 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -6753,7 +7229,10 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6782,13 +7261,24 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -6819,7 +7309,10 @@ static void MultiDimensionRCTrackRightEighthBankToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -6902,7 +7395,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -6929,7 +7428,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6956,7 +7461,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7019,7 +7530,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7052,7 +7569,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7079,7 +7602,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7106,7 +7635,13 @@ static void MultiDimensionRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7134,7 +7669,13 @@ static void MultiDimensionRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7276,7 +7817,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7303,7 +7850,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7330,7 +7883,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7393,7 +7952,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -7426,7 +7991,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -7453,7 +8024,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -7480,7 +8057,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -7508,7 +8091,13 @@ static void MultiDimensionRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7558,7 +8147,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -7571,7 +8166,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -7584,7 +8185,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -7615,7 +8222,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -7634,7 +8247,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -7647,7 +8266,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -7660,7 +8285,13 @@ static void MultiDimensionRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -7674,7 +8305,13 @@ static void MultiDimensionRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -7738,7 +8375,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7765,7 +8408,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7792,7 +8441,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7855,7 +8510,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7888,7 +8549,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7915,7 +8582,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7942,7 +8615,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7970,7 +8649,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8020,7 +8705,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8033,7 +8724,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8046,7 +8743,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8077,7 +8780,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8096,7 +8805,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8109,7 +8824,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8122,7 +8843,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8136,7 +8863,13 @@ static void MultiDimensionRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8186,7 +8919,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8199,7 +8938,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8212,7 +8957,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8243,7 +8994,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8262,7 +9019,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8275,7 +9038,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -8288,7 +9057,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -8302,7 +9077,13 @@ static void MultiDimensionRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8366,7 +9147,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8393,7 +9180,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8420,7 +9213,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8483,7 +9282,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8516,7 +9321,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8543,7 +9354,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8570,7 +9387,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8598,7 +9421,13 @@ static void MultiDimensionRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8662,7 +9491,13 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8689,7 +9524,13 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8716,7 +9557,13 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8779,7 +9626,13 @@ static void MultiDimensionRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8798,7 +9651,13 @@ static void MultiDimensionRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8811,7 +9670,13 @@ static void MultiDimensionRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8824,7 +9689,13 @@ static void MultiDimensionRCTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8838,7 +9709,13 @@ static void MultiDimensionRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -8888,7 +9765,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -8901,7 +9784,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -8914,7 +9803,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -8945,7 +9840,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -8964,7 +9865,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -8977,7 +9884,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -8990,7 +9903,13 @@ static void MultiDimensionRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -9004,7 +9923,13 @@ static void MultiDimensionRCTrackDiag60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9068,7 +9993,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -9094,7 +10025,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -9120,7 +10057,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -9182,7 +10125,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } } @@ -9200,7 +10149,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9213,7 +10168,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -9226,7 +10187,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -9240,7 +10207,13 @@ static void MultiDimensionRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9290,7 +10263,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9303,7 +10282,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9316,7 +10301,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9347,7 +10338,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9366,7 +10363,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9379,7 +10382,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9392,7 +10401,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9406,7 +10421,13 @@ static void MultiDimensionRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9456,7 +10477,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9469,7 +10496,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9482,7 +10515,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9513,7 +10552,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -9532,7 +10577,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -9545,7 +10596,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -9558,7 +10615,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -9572,7 +10635,13 @@ static void MultiDimensionRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9636,7 +10705,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9663,7 +10738,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9690,7 +10771,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -9753,7 +10840,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -9772,7 +10865,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -9785,7 +10884,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -9798,7 +10903,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -9812,7 +10923,13 @@ static void MultiDimensionRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -9862,7 +10979,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9878,7 +11001,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9891,7 +11020,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9922,7 +11057,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -9941,7 +11082,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -9954,7 +11101,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -9967,7 +11120,13 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -9981,7 +11140,12 @@ static void MultiDimensionRCTrackDiagFlatToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -10032,7 +11196,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10045,7 +11215,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10061,7 +11237,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10092,7 +11274,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -10111,7 +11299,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10124,7 +11318,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10137,7 +11337,13 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10151,7 +11357,12 @@ static void MultiDimensionRCTrackDiagFlatToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -10202,7 +11413,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10218,7 +11435,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10231,7 +11454,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10262,7 +11491,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -10281,7 +11516,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10294,7 +11535,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10307,7 +11554,13 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10321,7 +11574,12 @@ static void MultiDimensionRCTrackDiagLeftBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -10372,7 +11630,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10385,7 +11649,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10401,7 +11671,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10432,7 +11708,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -10451,7 +11733,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -10464,7 +11752,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -10477,7 +11771,13 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -10491,7 +11791,12 @@ static void MultiDimensionRCTrackDiagRightBankToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -10542,7 +11847,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10558,7 +11869,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10571,7 +11888,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10602,7 +11925,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10621,7 +11950,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10634,7 +11969,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10647,7 +11988,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10661,7 +12008,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -10711,7 +12064,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10724,7 +12083,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10740,7 +12105,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10771,7 +12142,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10790,7 +12167,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10803,7 +12186,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10816,7 +12205,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -10830,7 +12225,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -10880,7 +12281,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10896,7 +12303,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10909,7 +12322,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10940,7 +12359,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -10959,7 +12384,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10972,7 +12403,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -10985,7 +12422,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10999,7 +12442,13 @@ static void MultiDimensionRCTrackDiag25DegUpToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11049,7 +12498,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11062,7 +12517,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -11078,7 +12539,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11109,7 +12576,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -11128,7 +12601,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -11141,7 +12620,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -11154,7 +12639,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -11168,7 +12659,13 @@ static void MultiDimensionRCTrackDiag25DegUpToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11218,7 +12715,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -11233,7 +12736,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -11245,7 +12754,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -11275,7 +12790,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } } @@ -11293,7 +12814,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -11305,7 +12832,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -11317,7 +12850,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -11330,7 +12869,13 @@ static void MultiDimensionRCTrackDiagLeftBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11380,7 +12925,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -11392,7 +12943,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -11407,7 +12964,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -11437,7 +13000,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } } @@ -11455,7 +13024,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -11467,7 +13042,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -11479,7 +13060,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -11492,7 +13079,13 @@ static void MultiDimensionRCTrackDiagRightBankTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11542,7 +13135,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11558,7 +13157,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11571,7 +13176,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11602,7 +13213,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11621,7 +13238,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11634,7 +13257,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11647,7 +13276,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11661,7 +13296,13 @@ static void MultiDimensionRCTrackDiag25DegDownToLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11711,7 +13352,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11724,7 +13371,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11740,7 +13393,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11771,7 +13430,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -11790,7 +13455,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11803,7 +13474,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -11816,7 +13493,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11830,7 +13513,13 @@ static void MultiDimensionRCTrackDiag25DegDownToRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -11880,7 +13569,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11893,7 +13588,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11906,7 +13607,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11937,7 +13644,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -11956,7 +13669,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -11969,7 +13688,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -11982,7 +13707,13 @@ static void MultiDimensionRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -11996,7 +13727,12 @@ static void MultiDimensionRCTrackDiagLeftBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12047,7 +13783,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12060,7 +13802,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12073,7 +13821,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12104,7 +13858,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -12123,7 +13883,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -12136,7 +13902,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -12149,7 +13921,13 @@ static void MultiDimensionRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -12163,7 +13941,12 @@ static void MultiDimensionRCTrackDiagRightBank( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12230,7 +14013,11 @@ static void MultiDimensionRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12257,7 +14044,11 @@ static void MultiDimensionRCTrackLeftFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12285,7 +14076,11 @@ static void MultiDimensionRCTrackLeftFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12339,7 +14134,11 @@ static void MultiDimensionRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12365,7 +14164,11 @@ static void MultiDimensionRCTrackRightFlyerTwistUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12392,7 +14195,11 @@ static void MultiDimensionRCTrackRightFlyerTwistUp( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12442,7 +14249,11 @@ static void MultiDimensionRCTrackLeftFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12476,7 +14287,11 @@ static void MultiDimensionRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12513,7 +14328,11 @@ static void MultiDimensionRCTrackLeftFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12550,7 +14369,11 @@ static void MultiDimensionRCTrackRightFlyerTwistDown( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::TubesInverted, MetalSupportPlace::Centre, 0, height + 36, session.SupportColours); @@ -12583,7 +14406,11 @@ static void MultiDimensionRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12620,7 +14447,11 @@ static void MultiDimensionRCTrackRightFlyerTwistDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -12665,7 +14496,11 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12693,7 +14528,11 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -12721,7 +14560,11 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -12761,7 +14604,11 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -12789,7 +14636,11 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12817,7 +14668,11 @@ static void MultiDimensionRCTrackMultidimInvertedFlatTo90DegQuarterLoopDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -12865,7 +14720,10 @@ static void MultiDimensionRCTrackBlockBrakes( { { 0, 6, height + 24 }, { 32, 20, 3 } }); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -12911,7 +14769,11 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12939,7 +14801,11 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12971,7 +14837,11 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13005,7 +14875,11 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13033,7 +14907,11 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13065,7 +14943,11 @@ static void MultiDimensionRCTrackMultidim90DegUpToInvertedFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -13110,7 +14992,11 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 32, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13138,7 +15024,11 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -13166,7 +15056,11 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -13206,7 +15100,11 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -13234,7 +15132,11 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13262,7 +15164,11 @@ static void MultiDimensionRCTrackMultidimFlatTo90DegDownQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -13305,7 +15211,11 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -13333,7 +15243,11 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13365,7 +15279,11 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height + 16, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -13399,7 +15317,11 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13427,7 +15349,11 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -13459,7 +15385,11 @@ static void MultiDimensionRCTrackMultidimInverted90DegUpToFlatQuarterLoop( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } diff --git a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp index b9e2c29017..2d6d65f8f5 100644 --- a/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ReverserRollerCoaster.cpp @@ -471,7 +471,11 @@ static void ReverserRCTrackLeftQuarterTurn5( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -504,7 +508,11 @@ static void ReverserRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -539,14 +547,21 @@ static void ReverserRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -579,7 +594,11 @@ static void ReverserRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -715,7 +734,11 @@ static void ReverserRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -753,7 +776,11 @@ static void ReverserRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -884,7 +911,11 @@ static void ReverserRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -922,7 +953,11 @@ static void ReverserRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1047,7 +1082,13 @@ static void ReverserRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: diff --git a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp index 085b907469..377e8a3501 100644 --- a/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SideFrictionRollerCoaster.cpp @@ -603,7 +603,11 @@ static void SideFrictionRCTrackLeftQuarterTurn5( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -648,7 +652,11 @@ static void SideFrictionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -695,14 +703,21 @@ static void SideFrictionRCTrackLeftQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -747,7 +762,11 @@ static void SideFrictionRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -919,7 +938,11 @@ static void SideFrictionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -969,7 +992,11 @@ static void SideFrictionRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1136,7 +1163,11 @@ static void SideFrictionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1186,7 +1217,11 @@ static void SideFrictionRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1347,7 +1382,13 @@ static void SideFrictionRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: diff --git a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp index 929677e950..58cbb86ee4 100644 --- a/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/SingleRailRollerCoaster.cpp @@ -86,7 +86,10 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -198,7 +201,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -277,7 +283,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -356,7 +365,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -447,7 +459,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -538,7 +553,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -617,7 +635,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -695,7 +716,11 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 32); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -751,7 +776,11 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 56); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -803,7 +832,10 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); } @@ -842,7 +874,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 48, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -887,7 +923,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -918,7 +960,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -957,7 +1005,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1008,7 +1062,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1041,7 +1101,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1070,7 +1133,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1103,7 +1172,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1143,7 +1215,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1194,7 +1272,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1224,7 +1306,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1253,13 +1338,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1299,7 +1395,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1343,7 +1442,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1373,7 +1476,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1402,13 +1508,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1448,7 +1565,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1503,7 +1623,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1532,7 +1658,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1561,7 +1693,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1626,7 +1764,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1648,7 +1792,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1661,7 +1811,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1674,7 +1830,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1703,7 +1865,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1726,7 +1894,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1740,7 +1914,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1754,7 +1934,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1784,7 +1970,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1822,7 +2014,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1851,7 +2049,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1880,7 +2084,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1945,7 +2155,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1983,7 +2199,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2012,7 +2234,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2041,7 +2269,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2106,7 +2340,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2144,7 +2384,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2173,7 +2419,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2202,7 +2454,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2267,7 +2525,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2305,7 +2569,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -2334,7 +2604,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2363,7 +2639,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2428,7 +2710,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2466,7 +2754,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2494,7 +2788,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2522,7 +2822,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2586,7 +2892,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -2625,7 +2937,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2654,7 +2972,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2683,7 +3007,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2748,7 +3078,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2786,7 +3122,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -2815,7 +3157,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -2844,7 +3192,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -2909,7 +3263,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -2947,7 +3307,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -2976,7 +3342,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3005,7 +3377,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3070,7 +3448,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3108,7 +3492,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3137,7 +3527,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3166,7 +3562,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3231,7 +3633,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3269,7 +3677,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -3298,7 +3712,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -3327,7 +3747,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -3392,7 +3818,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -3430,7 +3862,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3459,7 +3897,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3488,7 +3932,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3553,7 +4003,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3591,7 +4047,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3620,7 +4082,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3649,7 +4117,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3714,7 +4188,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3760,7 +4240,10 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3804,7 +4287,10 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -3869,7 +4355,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3920,7 +4409,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -3971,7 +4463,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -4022,7 +4517,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -4088,7 +4586,10 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -4116,7 +4617,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4134,7 +4641,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4148,7 +4661,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4178,7 +4697,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4201,7 +4726,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4215,7 +4746,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4233,7 +4770,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4263,7 +4806,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4286,7 +4835,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4304,7 +4859,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4318,7 +4879,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4348,7 +4915,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4371,7 +4944,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -4385,7 +4964,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -4403,7 +4988,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4433,7 +5024,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -4456,7 +5053,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4474,7 +5077,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4488,7 +5097,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4518,7 +5133,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4541,7 +5162,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4555,7 +5182,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4573,7 +5206,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -4603,7 +5242,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -4626,7 +5271,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4644,7 +5295,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4658,7 +5315,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4688,7 +5351,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4711,7 +5380,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -4725,7 +5400,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -4743,7 +5424,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4773,7 +5460,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -4796,7 +5489,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -4813,7 +5512,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -4826,7 +5531,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -4855,7 +5566,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -4879,7 +5596,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -4892,7 +5615,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -4909,7 +5638,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -4938,7 +5673,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -4962,7 +5703,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -4980,7 +5727,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -4994,7 +5747,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5024,7 +5783,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5047,7 +5812,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -5061,7 +5832,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -5079,7 +5856,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -5109,7 +5892,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -5132,7 +5921,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5146,7 +5941,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5160,7 +5961,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5190,7 +5997,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5213,7 +6026,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5227,7 +6046,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5241,7 +6066,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5271,7 +6102,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5322,7 +6159,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5357,7 +6200,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5404,7 +6253,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5463,7 +6318,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5500,7 +6361,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5533,7 +6397,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5570,7 +6440,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5618,7 +6491,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5673,7 +6552,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5707,7 +6590,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5740,13 +6626,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5790,7 +6687,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5838,7 +6738,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5872,7 +6776,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5905,13 +6812,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5955,7 +6873,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6019,7 +6940,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6068,7 +6995,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6115,7 +7048,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6170,7 +7109,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6233,7 +7178,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6270,7 +7221,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6303,7 +7257,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -6340,7 +7300,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6384,7 +7347,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6431,7 +7400,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6468,7 +7443,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6501,7 +7479,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -6538,7 +7522,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -6582,7 +7569,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6744,7 +7737,11 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -6790,7 +7787,11 @@ namespace SingleRailRC } PaintUtilSetVerticalTunnel(session, height + 96); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 96, 0x20); break; case 1: @@ -6856,7 +7857,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6904,7 +7908,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -6952,7 +7959,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7000,7 +8010,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7073,7 +8086,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7118,7 +8134,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7163,7 +8182,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7208,7 +8230,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7281,7 +8306,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7326,7 +8354,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -7388,7 +8419,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7436,7 +8470,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -7484,7 +8521,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7532,7 +8572,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_14); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -7605,7 +8648,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7654,7 +8703,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7701,7 +8756,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7756,7 +8817,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7819,7 +8886,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7856,7 +8929,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7889,7 +8965,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -7926,7 +9008,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -7970,7 +9055,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8017,7 +9108,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -8054,7 +9151,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8087,7 +9187,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -8124,7 +9230,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -8168,7 +9277,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -8227,7 +9342,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8263,7 +9384,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8300,7 +9424,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8340,7 +9467,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8383,7 +9516,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8419,7 +9558,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8456,7 +9598,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8496,7 +9641,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8542,7 +9693,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8574,7 +9730,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8616,7 +9778,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8659,7 +9826,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8691,7 +9863,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8728,7 +9906,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8775,7 +9958,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8807,7 +9995,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8849,7 +10043,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8892,7 +10091,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -8924,7 +10128,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -8961,7 +10171,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9034,7 +10249,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9068,7 +10288,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9097,7 +10320,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -9130,7 +10359,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9173,7 +10405,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9216,7 +10453,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9250,7 +10492,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9279,7 +10524,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -9312,7 +10563,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9350,7 +10604,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9396,7 +10655,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9430,7 +10694,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9459,7 +10726,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -9492,7 +10765,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9541,7 +10817,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9584,7 +10865,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9618,7 +10904,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9647,7 +10936,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -9680,7 +10975,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9724,7 +11022,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9815,7 +11118,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -9858,7 +11166,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -9908,7 +11219,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -9973,7 +11289,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -10016,7 +11337,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10066,7 +11390,12 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10124,7 +11453,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -10189,7 +11522,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -10222,7 +11558,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -10261,7 +11601,10 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -10340,7 +11683,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -10373,7 +11720,11 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 9, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -10406,7 +11757,11 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 10, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -10448,7 +11803,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; } @@ -10493,7 +11852,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 1: @@ -10526,7 +11889,11 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 18, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 2: @@ -10559,7 +11926,11 @@ namespace SingleRailRC session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 13, height, session.SupportColours); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -10601,7 +11972,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; } @@ -10647,7 +12022,10 @@ namespace SingleRailRC } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -10690,7 +12068,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10747,7 +12130,12 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -10803,7 +12191,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -10860,7 +12253,12 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 33, session.SupportColours); @@ -10932,7 +12330,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -10975,7 +12378,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11004,7 +12410,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11014,7 +12426,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11082,7 +12497,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11137,7 +12555,12 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::rightCorner, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -11180,7 +12603,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomRightSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -11209,7 +12635,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -11219,7 +12651,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11286,7 +12721,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -11357,7 +12795,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11390,7 +12832,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::topCorner), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11433,7 +12878,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11463,7 +12914,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11496,7 +12953,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); if (direction == 0 || direction == 3) @@ -11551,7 +13011,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -11586,7 +13050,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction), + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -11631,7 +13098,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::centre, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 3: @@ -11664,7 +13137,13 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 144, 0x20); break; case 4: @@ -11699,7 +13178,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentTopCorner, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::topCorner), + direction), 0xFFFF, 0); if (direction == 0 || direction == 3) { @@ -11774,7 +13256,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -11804,7 +13290,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11850,7 +13339,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -11908,7 +13400,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; case 1: @@ -11938,7 +13434,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -11984,7 +13483,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 38, session.SupportColours); @@ -12052,7 +13554,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12088,7 +13594,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12126,7 +13636,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -12134,7 +13647,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12238,7 +13754,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12274,7 +13794,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -12313,7 +13837,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; @@ -12321,7 +13848,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -12425,7 +13955,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -12453,7 +13987,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -12485,7 +14023,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -12543,7 +14085,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12592,7 +14140,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12643,7 +14197,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12692,7 +14252,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12739,7 +14305,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12792,7 +14364,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12839,7 +14417,13 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -12892,7 +14476,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -12935,7 +14525,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -12971,7 +14565,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13001,7 +14599,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13044,7 +14645,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13073,7 +14677,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13103,7 +14713,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13138,7 +14751,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13182,7 +14798,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -13218,7 +14838,11 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13248,7 +14872,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -13291,7 +14918,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13320,7 +14950,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 128, 0x20); break; case 5: @@ -13350,7 +14986,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 224, 0x20); break; @@ -13385,7 +15024,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); break; @@ -13505,7 +15147,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -13596,7 +15241,10 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -13646,7 +15294,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -13675,7 +15329,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -13704,7 +15364,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -13769,7 +15435,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } @@ -13807,7 +15479,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13836,7 +15514,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -13865,7 +15549,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -13930,7 +15620,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -13968,7 +15664,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -13997,7 +15699,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14026,7 +15734,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14091,7 +15805,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14129,7 +15849,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -14158,7 +15884,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -14187,7 +15919,13 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -14252,13 +15990,21 @@ namespace SingleRailRC } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; } } - // kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; + // EnumsToFlags(PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + // PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + // PaintSegment::bottomRightSide); // b4 // c8 cc // b8 c4 bc @@ -14315,7 +16061,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14349,7 +16099,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14382,13 +16135,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14432,7 +16196,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14480,7 +16247,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -14514,7 +16285,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14547,13 +16321,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -14597,7 +16382,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14651,7 +16439,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14684,13 +16475,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14724,7 +16526,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14765,7 +16570,11 @@ namespace SingleRailRC } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14818,7 +16627,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14851,13 +16663,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -14891,7 +16714,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14930,7 +16756,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -14987,7 +16817,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15005,7 +16841,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -15019,7 +16861,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -15049,7 +16897,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15072,7 +16926,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -15086,7 +16946,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -15104,7 +16970,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -15134,7 +17006,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -15157,7 +17035,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15175,7 +17059,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15189,7 +17079,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15219,7 +17115,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15242,7 +17144,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15256,7 +17164,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15274,7 +17188,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15304,7 +17224,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15355,7 +17281,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15369,7 +17301,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15383,7 +17321,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15413,7 +17357,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15436,7 +17386,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15450,7 +17406,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15464,7 +17426,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15494,7 +17462,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15517,7 +17491,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15531,7 +17511,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15545,7 +17531,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15575,7 +17567,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15598,7 +17596,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15612,7 +17616,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15626,7 +17636,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15656,7 +17672,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15707,7 +17729,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15721,7 +17749,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15735,7 +17769,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15766,7 +17806,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15789,7 +17835,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -15803,7 +17855,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -15817,7 +17875,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -15848,7 +17912,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -15885,7 +17955,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15903,7 +17979,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -15917,7 +17999,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -15947,7 +18035,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -15970,7 +18064,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -15984,7 +18084,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -16002,7 +18108,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -16032,7 +18144,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -16055,7 +18173,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -16073,7 +18197,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -16087,7 +18217,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -16117,7 +18253,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -16140,7 +18282,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -16154,7 +18302,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -16172,7 +18326,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -16202,7 +18362,13 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -16277,7 +18443,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -16311,7 +18481,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16344,13 +18517,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -16394,7 +18578,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16442,7 +18629,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -16476,7 +18667,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16509,13 +18703,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 4: @@ -16559,7 +18764,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16613,7 +18821,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16646,13 +18857,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16686,7 +18908,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16725,7 +18950,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -16778,7 +19007,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16811,13 +19043,24 @@ namespace SingleRailRC break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -16851,7 +19094,10 @@ namespace SingleRailRC PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -16890,7 +19136,11 @@ namespace SingleRailRC PaintUtilPushTunnelRotated(session, direction + 1, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } diff --git a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp index 14140d8283..8a82ebffe0 100644 --- a/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/StandUpRollerCoaster.cpp @@ -107,7 +107,10 @@ static void StandUpRCTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -214,7 +217,10 @@ static void StandUpRCTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -290,7 +296,10 @@ static void StandUpRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -362,7 +371,10 @@ static void StandUpRCTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -450,7 +462,10 @@ static void StandUpRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -538,7 +553,10 @@ static void StandUpRCTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -610,7 +628,10 @@ static void StandUpRCTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -696,7 +717,13 @@ static void StandUpRCTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -724,7 +751,11 @@ static void StandUpRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -749,7 +780,13 @@ static void StandUpRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -777,7 +814,11 @@ static void StandUpRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -813,7 +854,13 @@ static void StandUpRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -859,7 +906,10 @@ static void StandUpRCTrackFlatToLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -894,7 +944,10 @@ static void StandUpRCTrackFlatToRightBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -929,7 +982,10 @@ static void StandUpRCTrackLeftBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -964,7 +1020,10 @@ static void StandUpRCTrackRightBankToFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1009,7 +1068,13 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1041,7 +1106,11 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1070,7 +1139,13 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1102,7 +1177,11 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1145,7 +1224,13 @@ static void StandUpRCTrackBankedLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1198,7 +1283,10 @@ static void StandUpRCTrackLeftBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1240,7 +1328,10 @@ static void StandUpRCTrackRightBankTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1282,7 +1373,10 @@ static void StandUpRCTrack25DegUpToLeftBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1324,7 +1418,10 @@ static void StandUpRCTrack25DegUpToRightBank( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -1391,7 +1488,10 @@ static void StandUpRCTrackLeftBank( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1464,7 +1564,13 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1517,7 +1623,11 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1567,7 +1677,13 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1620,7 +1736,11 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1683,7 +1803,13 @@ static void StandUpRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -1750,7 +1876,13 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1803,7 +1935,11 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1853,7 +1989,12 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: @@ -1906,7 +2047,11 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -1969,7 +2114,13 @@ static void StandUpRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -2027,7 +2178,13 @@ static void StandUpRCTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2056,7 +2213,11 @@ static void StandUpRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2086,7 +2247,11 @@ static void StandUpRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2122,7 +2287,13 @@ static void StandUpRCTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2162,7 +2333,13 @@ static void StandUpRCTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2192,7 +2369,11 @@ static void StandUpRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2223,7 +2404,11 @@ static void StandUpRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -2259,7 +2444,13 @@ static void StandUpRCTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2300,7 +2491,11 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2334,7 +2529,11 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2359,7 +2558,13 @@ static void StandUpRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -2384,7 +2589,11 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2416,7 +2625,11 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2441,7 +2654,13 @@ static void StandUpRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -2474,7 +2693,11 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2511,7 +2734,11 @@ static void StandUpRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -2779,7 +3006,13 @@ static void StandUpRCTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2806,7 +3039,13 @@ static void StandUpRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2841,7 +3080,13 @@ static void StandUpRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -2897,7 +3142,13 @@ static void StandUpRCTrackLeftQuarterTurn3Bank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -2928,7 +3179,13 @@ static void StandUpRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -2970,7 +3227,13 @@ static void StandUpRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -3046,7 +3309,13 @@ static void StandUpRCTrackLeftQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3114,7 +3383,13 @@ static void StandUpRCTrackLeftQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3181,7 +3456,13 @@ static void StandUpRCTrackRightQuarterTurn325DegUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3261,7 +3542,13 @@ static void StandUpRCTrackRightQuarterTurn325DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -3319,7 +3606,10 @@ static void StandUpRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -3378,7 +3668,11 @@ static void StandUpRCTrackHalfLoopUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; @@ -3407,7 +3701,10 @@ static void StandUpRCTrackHalfLoopUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -3514,7 +3811,12 @@ static void StandUpRCTrackLeftCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3571,7 +3873,12 @@ static void StandUpRCTrackRightCorkscrewUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3628,7 +3935,12 @@ static void StandUpRCTrackRightCorkscrewUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 35, session.SupportColours); @@ -3704,7 +4016,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3736,7 +4053,13 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -3778,7 +4101,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3821,7 +4149,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3853,7 +4186,13 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -3890,7 +4229,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3938,7 +4282,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3970,7 +4319,13 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4012,7 +4367,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4055,7 +4415,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4087,7 +4452,13 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -4124,7 +4495,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4200,7 +4576,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4233,7 +4614,11 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4262,7 +4647,13 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4294,7 +4685,11 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4337,7 +4732,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4380,7 +4780,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4413,7 +4818,11 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4442,7 +4851,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4474,7 +4888,11 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4512,7 +4930,12 @@ static void StandUpRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4560,7 +4983,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4593,7 +5021,11 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4622,7 +5054,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -4654,7 +5091,11 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4697,7 +5138,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4740,7 +5186,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4773,7 +5224,11 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4802,7 +5257,13 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: @@ -4834,7 +5295,11 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4872,7 +5337,12 @@ static void StandUpRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4932,7 +5402,10 @@ static void StandUpRCTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -5010,7 +5483,10 @@ static void StandUpRCTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5039,7 +5515,11 @@ static void StandUpRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5068,13 +5548,24 @@ static void StandUpRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5111,7 +5602,11 @@ static void StandUpRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5156,7 +5651,10 @@ static void StandUpRCTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5185,7 +5683,11 @@ static void StandUpRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5214,13 +5716,24 @@ static void StandUpRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5257,7 +5770,11 @@ static void StandUpRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5320,7 +5837,10 @@ static void StandUpRCTrackLeftEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5349,7 +5869,11 @@ static void StandUpRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5378,13 +5902,24 @@ static void StandUpRCTrackLeftEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5421,7 +5956,11 @@ static void StandUpRCTrackLeftEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5466,7 +6005,10 @@ static void StandUpRCTrackRightEighthBankToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5495,7 +6037,11 @@ static void StandUpRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5524,13 +6070,24 @@ static void StandUpRCTrackRightEighthBankToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -5567,7 +6124,11 @@ static void StandUpRCTrackRightEighthBankToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5623,7 +6184,13 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -5650,7 +6217,12 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5677,7 +6249,13 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5736,7 +6314,13 @@ static void StandUpRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -5811,7 +6395,13 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -5838,7 +6428,12 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -5865,7 +6460,13 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -5924,7 +6525,13 @@ static void StandUpRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -5961,7 +6568,13 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -5988,7 +6601,12 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6015,7 +6633,13 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6076,7 +6700,13 @@ static void StandUpRCTrackDiag60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -6113,7 +6743,13 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -6140,7 +6776,12 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -6167,7 +6808,13 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -6226,7 +6873,13 @@ static void StandUpRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -6263,7 +6916,13 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6290,7 +6949,12 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6317,7 +6981,13 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6378,7 +7048,13 @@ static void StandUpRCTrackDiag25DegUpTo60DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6415,7 +7091,13 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -6442,7 +7124,12 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -6469,7 +7156,13 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -6530,7 +7223,13 @@ static void StandUpRCTrackDiag60DegUpTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -6567,7 +7266,13 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6594,7 +7299,12 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6621,7 +7331,13 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6680,7 +7396,13 @@ static void StandUpRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6717,7 +7439,13 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -6744,7 +7472,12 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -6771,7 +7504,13 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -6830,7 +7569,13 @@ static void StandUpRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -6867,7 +7612,13 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 1: @@ -6894,7 +7645,12 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 2: @@ -6921,7 +7677,13 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; case 3: @@ -6982,7 +7744,13 @@ static void StandUpRCTrackDiag60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); break; } @@ -7019,7 +7787,13 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -7045,7 +7819,12 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -7071,7 +7850,13 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -7129,7 +7914,13 @@ static void StandUpRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -7167,7 +7958,13 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7194,7 +7991,12 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7221,7 +8023,13 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7282,7 +8090,13 @@ static void StandUpRCTrackDiag25DegDownTo60DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7319,7 +8133,13 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -7346,7 +8166,12 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -7373,7 +8198,13 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -7432,7 +8263,13 @@ static void StandUpRCTrackDiag60DegDownTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; } @@ -7469,7 +8306,13 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7496,7 +8339,12 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7523,7 +8371,13 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7582,7 +8436,13 @@ static void StandUpRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -7605,7 +8465,13 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7621,7 +8487,12 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7634,7 +8505,13 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7661,7 +8538,13 @@ static void StandUpRCTrackDiagFlatToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7684,7 +8567,13 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7697,7 +8586,12 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7713,7 +8607,13 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7740,7 +8640,13 @@ static void StandUpRCTrackDiagFlatToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7763,7 +8669,13 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7779,7 +8691,12 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7792,7 +8709,13 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7819,7 +8742,13 @@ static void StandUpRCTrackDiagLeftBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7842,7 +8771,13 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -7855,7 +8790,12 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -7871,7 +8811,13 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -7898,7 +8844,13 @@ static void StandUpRCTrackDiagRightBankToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -7921,7 +8873,13 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -7937,7 +8895,12 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -7950,7 +8913,13 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -7977,7 +8946,13 @@ static void StandUpRCTrackDiagLeftBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8000,7 +8975,13 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8013,7 +8994,12 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8029,7 +9015,13 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8056,7 +9048,13 @@ static void StandUpRCTrackDiagRightBankTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8079,7 +9077,13 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8095,7 +9099,12 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8108,7 +9117,13 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8135,7 +9150,13 @@ static void StandUpRCTrackDiag25DegUpToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8158,7 +9179,13 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -8171,7 +9198,12 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -8187,7 +9219,13 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -8214,7 +9252,13 @@ static void StandUpRCTrackDiag25DegUpToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -8237,7 +9281,13 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8252,7 +9302,12 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8264,7 +9319,13 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8290,7 +9351,13 @@ static void StandUpRCTrackDiagLeftBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8314,7 +9381,13 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -8326,7 +9399,12 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -8341,7 +9419,13 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -8367,7 +9451,13 @@ static void StandUpRCTrackDiagRightBankTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -8391,7 +9481,13 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8407,7 +9503,12 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8420,7 +9521,13 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8447,7 +9554,13 @@ static void StandUpRCTrackDiag25DegDownToLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8470,7 +9583,13 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -8483,7 +9602,12 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -8499,7 +9623,13 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -8526,7 +9656,13 @@ static void StandUpRCTrackDiag25DegDownToRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -8549,7 +9685,13 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8562,7 +9704,12 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8575,7 +9722,13 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8602,7 +9755,13 @@ static void StandUpRCTrackDiagLeftBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8625,7 +9784,13 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -8638,7 +9803,12 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -8651,7 +9821,13 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -8678,7 +9854,13 @@ static void StandUpRCTrackDiagRightBank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -8701,7 +9883,10 @@ static void StandUpRCTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/Steeplechase.cpp b/src/openrct2/ride/coaster/Steeplechase.cpp index 927e25f993..5648ba1b18 100644 --- a/src/openrct2/ride/coaster/Steeplechase.cpp +++ b/src/openrct2/ride/coaster/Steeplechase.cpp @@ -72,7 +72,10 @@ static void SteeplechaseTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -174,7 +177,10 @@ static void SteeplechaseTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -252,7 +258,10 @@ static void SteeplechaseTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -330,7 +339,10 @@ static void SteeplechaseTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -398,7 +410,13 @@ static void SteeplechaseTrackLeftQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -426,7 +444,11 @@ static void SteeplechaseTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -451,7 +473,13 @@ static void SteeplechaseTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -479,7 +507,11 @@ static void SteeplechaseTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -521,7 +553,13 @@ static void SteeplechaseTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -576,7 +614,13 @@ static void SteeplechaseTrackSBendLeft( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -606,7 +650,11 @@ static void SteeplechaseTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -637,7 +685,11 @@ static void SteeplechaseTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -679,7 +731,13 @@ static void SteeplechaseTrackSBendLeft( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -725,7 +783,13 @@ static void SteeplechaseTrackSBendRight( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -756,7 +820,11 @@ static void SteeplechaseTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -788,7 +856,11 @@ static void SteeplechaseTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -830,7 +902,13 @@ static void SteeplechaseTrackSBendRight( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -876,7 +954,13 @@ static void SteeplechaseTrackLeftQuarterTurn3( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -903,7 +987,13 @@ static void SteeplechaseTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -944,7 +1034,13 @@ static void SteeplechaseTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -983,7 +1079,10 @@ static void SteeplechaseTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1031,7 +1130,10 @@ static void SteeplechaseTrackLeftEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1060,7 +1162,11 @@ static void SteeplechaseTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1089,13 +1195,24 @@ static void SteeplechaseTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1132,7 +1249,11 @@ static void SteeplechaseTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1183,7 +1304,10 @@ static void SteeplechaseTrackRightEighthToDiag( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1212,7 +1336,11 @@ static void SteeplechaseTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1241,13 +1369,24 @@ static void SteeplechaseTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: @@ -1285,7 +1424,11 @@ static void SteeplechaseTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -1341,7 +1484,13 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: @@ -1368,7 +1517,12 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -1395,7 +1549,13 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -1456,7 +1616,13 @@ static void SteeplechaseTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } @@ -1512,7 +1678,13 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1539,7 +1711,12 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1566,7 +1743,13 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1627,7 +1810,13 @@ static void SteeplechaseTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1664,7 +1853,13 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1691,7 +1886,12 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1718,7 +1918,13 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1779,7 +1985,13 @@ static void SteeplechaseTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -1816,7 +2028,13 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1843,7 +2061,12 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -1870,7 +2093,13 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -1931,7 +2160,13 @@ static void SteeplechaseTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -1968,7 +2203,13 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: @@ -1995,7 +2236,12 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: @@ -2022,7 +2268,13 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -2083,7 +2335,13 @@ static void SteeplechaseTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } @@ -2120,7 +2378,13 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -2146,7 +2410,12 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -2172,7 +2441,13 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -2232,7 +2507,13 @@ static void SteeplechaseTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -2270,7 +2551,13 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2297,7 +2584,12 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -2324,7 +2616,13 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -2385,7 +2683,13 @@ static void SteeplechaseTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } @@ -2415,7 +2719,10 @@ static void SteeplechaseTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp index 85558214c5..fe6a58c665 100644 --- a/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp +++ b/src/openrct2/ride/coaster/SuspendedSwingingCoaster.cpp @@ -61,7 +61,10 @@ static void SuspendedSwingingRCTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -159,7 +162,10 @@ static void SuspendedSwingingRCTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -233,7 +239,10 @@ static void SuspendedSwingingRCTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); } @@ -296,7 +305,10 @@ static void SuspendedSwingingRCTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -376,7 +388,10 @@ static void SuspendedSwingingRCTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_INVERTED_5); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); } @@ -451,7 +466,10 @@ static void SuspendedSwingingRCTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -547,7 +565,10 @@ static void SuspendedSwingingRCTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -665,7 +686,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -703,7 +729,11 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -731,7 +761,13 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -761,7 +797,11 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -791,7 +831,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -848,7 +893,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -884,7 +934,11 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -909,7 +963,13 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -938,7 +998,11 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -964,7 +1028,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1012,7 +1081,12 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1048,7 +1122,11 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1073,7 +1151,12 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 80, 0x20); break; case 4: @@ -1102,7 +1185,11 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; @@ -1128,7 +1215,12 @@ static void SuspendedSwingingRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1194,7 +1286,13 @@ static void SuspendedSwingingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1227,7 +1325,11 @@ static void SuspendedSwingingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1268,7 +1370,11 @@ static void SuspendedSwingingRCTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1308,7 +1414,13 @@ static void SuspendedSwingingRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1355,7 +1467,13 @@ static void SuspendedSwingingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1388,7 +1506,11 @@ static void SuspendedSwingingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1429,7 +1551,11 @@ static void SuspendedSwingingRCTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1469,7 +1595,13 @@ static void SuspendedSwingingRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1520,7 +1652,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1558,7 +1695,13 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1587,7 +1730,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -1644,7 +1792,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1683,7 +1836,12 @@ static void SuspendedSwingingRCTrackLeftQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1731,7 +1889,12 @@ static void SuspendedSwingingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1770,7 +1933,12 @@ static void SuspendedSwingingRCTrackRightQuarterTurn325DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 54, session.SupportColours); @@ -1829,7 +1997,10 @@ static void SuspendedSwingingRCTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -1873,7 +2044,12 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -1913,7 +2089,11 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1942,7 +2122,13 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1974,7 +2160,11 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2004,7 +2194,12 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2056,7 +2251,12 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -2096,7 +2296,11 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2125,7 +2329,12 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2157,7 +2366,11 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2187,7 +2400,12 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2239,7 +2457,12 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2279,7 +2502,11 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2308,7 +2535,13 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2340,7 +2573,11 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2370,7 +2607,12 @@ static void SuspendedSwingingRCTrackLeftQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -2422,7 +2664,12 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 58, session.SupportColours); @@ -2462,7 +2709,11 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2491,7 +2742,12 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2523,7 +2779,11 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2553,7 +2813,12 @@ static void SuspendedSwingingRCTrackRightQuarterHelixLargeDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 46, session.SupportColours); @@ -2605,7 +2870,13 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2641,7 +2912,11 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2670,13 +2945,24 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2707,7 +2993,10 @@ static void SuspendedSwingingRCTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2770,7 +3059,13 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height + 44, session.SupportColours); @@ -2806,7 +3101,11 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -2835,13 +3134,24 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -2872,7 +3182,10 @@ static void SuspendedSwingingRCTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -2951,7 +3264,13 @@ static void SuspendedSwingingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -2978,7 +3297,12 @@ static void SuspendedSwingingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -3005,7 +3329,13 @@ static void SuspendedSwingingRCTrackDiagFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -3033,7 +3363,13 @@ static void SuspendedSwingingRCTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3093,7 +3429,13 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3120,7 +3462,12 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3147,7 +3494,13 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3175,7 +3528,13 @@ static void SuspendedSwingingRCTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3221,7 +3580,13 @@ static void SuspendedSwingingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -3234,7 +3599,12 @@ static void SuspendedSwingingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -3247,7 +3617,13 @@ static void SuspendedSwingingRCTrackDiag60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -3261,7 +3637,13 @@ static void SuspendedSwingingRCTrackDiag60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3322,7 +3704,13 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -3349,7 +3737,12 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -3376,7 +3769,13 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -3404,7 +3803,13 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3450,7 +3855,13 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3463,7 +3874,12 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3476,7 +3892,13 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -3490,7 +3912,13 @@ static void SuspendedSwingingRCTrackDiag25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3537,7 +3965,13 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -3550,7 +3984,12 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -3563,7 +4002,13 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -3577,7 +4022,13 @@ static void SuspendedSwingingRCTrackDiag60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3638,7 +4089,13 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3665,7 +4122,12 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3692,7 +4154,13 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3720,7 +4188,13 @@ static void SuspendedSwingingRCTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3780,7 +4254,13 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -3807,7 +4287,12 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -3834,7 +4319,13 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -3862,7 +4353,13 @@ static void SuspendedSwingingRCTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -3908,7 +4405,13 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 1: @@ -3921,7 +4424,12 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 2: @@ -3934,7 +4442,13 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; case 3: @@ -3947,7 +4461,13 @@ static void SuspendedSwingingRCTrackDiag60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 120, 0x20); break; } @@ -3984,7 +4504,13 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: if (trackElement.HasChain()) @@ -4010,7 +4536,12 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: if (trackElement.HasChain()) @@ -4036,7 +4567,13 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: if (trackElement.HasChain()) @@ -4063,7 +4600,13 @@ static void SuspendedSwingingRCTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4109,7 +4652,13 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -4122,7 +4671,12 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4135,7 +4689,13 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -4149,7 +4709,13 @@ static void SuspendedSwingingRCTrackDiag25DegDownTo60DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4196,7 +4762,13 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 1: @@ -4209,7 +4781,12 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 2: @@ -4222,7 +4799,13 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 88, 0x20); break; case 3: @@ -4236,7 +4819,13 @@ static void SuspendedSwingingRCTrackDiag60DegDownTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4296,7 +4885,13 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -4323,7 +4918,12 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -4350,7 +4950,13 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -4378,7 +4984,13 @@ static void SuspendedSwingingRCTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -4429,7 +5041,10 @@ static void SuspendedSwingingRCTrackBlockBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( diff --git a/src/openrct2/ride/coaster/VirginiaReel.cpp b/src/openrct2/ride/coaster/VirginiaReel.cpp index 4e684ab78b..8150f29c92 100644 --- a/src/openrct2/ride/coaster/VirginiaReel.cpp +++ b/src/openrct2/ride/coaster/VirginiaReel.cpp @@ -498,7 +498,13 @@ static void PaintVirginiaReelTrackLeftQuarterTurn3Tiles( { case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; case 0: case 3: diff --git a/src/openrct2/ride/coaster/WildMouse.cpp b/src/openrct2/ride/coaster/WildMouse.cpp index cb127cd801..5c2ca3838e 100644 --- a/src/openrct2/ride/coaster/WildMouse.cpp +++ b/src/openrct2/ride/coaster/WildMouse.cpp @@ -185,7 +185,10 @@ static void WildMouseTrackFlat( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -253,7 +256,10 @@ static void WildMouseTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -301,7 +307,10 @@ static void WildMouseTrack60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -334,7 +343,10 @@ static void WildMouseTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -382,7 +394,10 @@ static void WildMouseTrack25DegUpTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -430,7 +445,10 @@ static void WildMouseTrack60DegUpTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -463,7 +481,10 @@ static void WildMouseTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -558,13 +579,16 @@ static void WildMouseTrackRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide); break; case 2: - blockedSegments = kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide); break; case 3: - blockedSegments = kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -619,10 +643,12 @@ static void WildMouseTrackRightQuarterTurn325DegDown( switch (trackSequence) { case 0: - blockedSegments = kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide); break; case 3: - blockedSegments = kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -697,10 +723,12 @@ static void WildMouseTrackRightQuarterTurn325DegUp( switch (trackSequence) { case 0: - blockedSegments = kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide); break; case 3: - blockedSegments = kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomRightSide); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -755,7 +783,12 @@ static void WildMouseTrackLeftQuarterTurn1( MetalASupportsPaintSetup(session, MetalSupportType::Tubes, MetalSupportPlace::Centre, -1, height, session.SupportColours); TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -811,7 +844,10 @@ static void WildMouseTrackFlatTo60DegUp( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); } @@ -867,7 +903,10 @@ static void WildMouseTrack60DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -901,7 +940,10 @@ static void WildMouseTrackBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -926,7 +968,10 @@ static void WildMouseTrackRotationControlToggle( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -945,7 +990,10 @@ static void WildMouseTrackBlockBrakes( } PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 78620cdce9..43df1b783e 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -1474,24 +1474,29 @@ static void WoodenRCTrackRightQuarterTurn5( blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 2: - blockedSegments = kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide - | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 5: - blockedSegments = kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide); break; case 6: - blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide - | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = kSegmentsAll; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -1944,24 +1949,29 @@ static void WoodenRCTrackBankedRightQuarterTurn5( blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 2: - blockedSegments = kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide - | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 5: - blockedSegments = kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide); break; case 6: - blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide - | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = kSegmentsAll; break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -2344,7 +2354,11 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2405,7 +2419,11 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2468,14 +2486,21 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -2542,7 +2567,11 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2702,7 +2731,10 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -2763,7 +2795,11 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -2826,14 +2862,20 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -2900,7 +2942,11 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3134,7 +3180,11 @@ static void WoodenRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3196,7 +3246,11 @@ static void WoodenRCTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3400,7 +3454,11 @@ static void WoodenRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3462,7 +3520,11 @@ static void WoodenRCTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -3573,7 +3635,11 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -3607,7 +3673,11 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3636,7 +3706,13 @@ static void WoodenRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 3: @@ -3665,7 +3741,11 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3701,7 +3781,11 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -3730,7 +3814,13 @@ static void WoodenRCTrackLeftVerticalLoop( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 168, 0x20); break; case 8: @@ -3763,7 +3853,11 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -3800,7 +3894,11 @@ static void WoodenRCTrackLeftVerticalLoop( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; @@ -4174,7 +4272,13 @@ static void WoodenRCTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4393,7 +4497,13 @@ static void WoodenRCTrackLeftQuarterTurn3Bank( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -4559,7 +4669,13 @@ static void WoodenRCTrackLeftQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4715,7 +4831,13 @@ static void WoodenRCTrackRightQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -4890,9 +5012,20 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -4973,7 +5106,13 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5048,9 +5187,20 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5126,9 +5276,20 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5209,7 +5370,13 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5279,9 +5446,20 @@ static void WoodenRCTrackLeftHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5363,9 +5541,20 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5446,7 +5635,13 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -5521,9 +5716,20 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5599,9 +5805,20 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5681,7 +5898,13 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 7: @@ -5751,9 +5974,20 @@ static void WoodenRCTrackRightHalfBankedHelixUpSmall( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5860,15 +6094,30 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -5929,7 +6178,11 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -5990,14 +6243,30 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -6058,7 +6327,11 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6128,9 +6401,20 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6200,15 +6484,29 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -6269,7 +6567,11 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6330,14 +6632,28 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -6398,7 +6714,11 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6463,9 +6783,20 @@ static void WoodenRCTrackLeftHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6541,15 +6872,29 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -6610,7 +6955,11 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6671,14 +7020,28 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -6739,7 +7102,11 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6809,9 +7176,20 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -6881,15 +7259,30 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentTopRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, + PaintSegment::topRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 8: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 9: @@ -6950,7 +7343,11 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7011,14 +7408,30 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 11: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 12: @@ -7079,7 +7492,11 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -7144,9 +7561,20 @@ static void WoodenRCTrackRightHalfBankedHelixUpLarge( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_SQUARE_FLAT); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentBottomRightSide, direction), 48, 0x20); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide), + direction), + 48, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -13021,7 +13449,13 @@ static void WoodenRCTrackLeftBankToLeftQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13177,7 +13611,13 @@ static void WoodenRCTrackRightBankToRightQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13339,7 +13779,13 @@ static void WoodenRCTrackLeftQuarterTurn325DegDownToLeftBank( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13495,7 +13941,13 @@ static void WoodenRCTrackRightQuarterTurn325DegDownToRightBank( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -13663,7 +14115,13 @@ static void WoodenRCTrackLeftBankedQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13819,7 +14277,13 @@ static void WoodenRCTrackRightBankedQuarterTurn325DegUp( break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: @@ -13992,7 +14456,11 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14053,7 +14521,11 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14116,14 +14588,21 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -14190,7 +14669,11 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14346,7 +14829,10 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -14407,7 +14893,11 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; @@ -14470,14 +14960,20 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 5: @@ -14544,7 +15040,11 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; diff --git a/src/openrct2/ride/coaster/WoodenWildMouse.cpp b/src/openrct2/ride/coaster/WoodenWildMouse.cpp index b318de3f43..bda02109a2 100644 --- a/src/openrct2/ride/coaster/WoodenWildMouse.cpp +++ b/src/openrct2/ride/coaster/WoodenWildMouse.cpp @@ -139,10 +139,17 @@ static void WoodenWildMouseTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), height, - 0x20); + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomCorner, + PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), + height, 0x20); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -542,7 +549,8 @@ static void WoodenWildMouseTrackRightQuarterTurn3( blockedSegments = kSegmentsAll; break; case 2: - blockedSegments = kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide); break; case 3: blockedSegments = kSegmentsAll; diff --git a/src/openrct2/ride/gentle/CarRide.cpp b/src/openrct2/ride/gentle/CarRide.cpp index 84142fe5f4..cc9a5e40d1 100644 --- a/src/openrct2/ride/gentle/CarRide.cpp +++ b/src/openrct2/ride/gentle/CarRide.cpp @@ -183,7 +183,10 @@ static void PaintCarRideTrackFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -221,7 +224,10 @@ static void PaintCarRideTrack25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -259,7 +265,10 @@ static void PaintCarRideTrackFlatTo25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 3, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -297,7 +306,10 @@ static void PaintCarRideTrack25DegUpToFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 6, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -393,13 +405,16 @@ static void PaintCarRideTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -539,7 +554,10 @@ static void PaintCarRideTrack60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -596,7 +614,10 @@ static void PaintCarRideTrack25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -653,7 +674,10 @@ static void PaintCarRideTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -708,7 +732,10 @@ static void PaintCarRideTrackLogBumps( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/gentle/Circus.cpp b/src/openrct2/ride/gentle/Circus.cpp index 9e786a5a84..f10145abb4 100644 --- a/src/openrct2/ride/gentle/Circus.cpp +++ b/src/openrct2/ride/gentle/Circus.cpp @@ -94,19 +94,20 @@ static void PaintCircus( { case 1: // Top - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: // Right - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: // Left - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: // Bottom - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/gentle/CrookedHouse.cpp b/src/openrct2/ride/gentle/CrookedHouse.cpp index c8a75a2a10..c1e18e5ced 100644 --- a/src/openrct2/ride/gentle/CrookedHouse.cpp +++ b/src/openrct2/ride/gentle/CrookedHouse.cpp @@ -118,19 +118,20 @@ static void PaintCrookedHouse( { case 1: // Top - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: // Right - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: // Left - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: // Bottom - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/gentle/GhostTrain.cpp b/src/openrct2/ride/gentle/GhostTrain.cpp index cc943de923..353e16aec4 100644 --- a/src/openrct2/ride/gentle/GhostTrain.cpp +++ b/src/openrct2/ride/gentle/GhostTrain.cpp @@ -195,7 +195,10 @@ static void PaintGhostTrainTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -233,7 +236,10 @@ static void PaintGhostTrainTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -282,7 +288,10 @@ static void PaintGhostTrainTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -303,7 +312,10 @@ static void PaintGhostTrainTrack25DegUpToFlatShared( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -428,13 +440,16 @@ static void PaintGhostTrainTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -527,7 +542,10 @@ static void PaintGhostTrainTrackBrakes( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/gentle/HauntedHouse.cpp b/src/openrct2/ride/gentle/HauntedHouse.cpp index da081b04bc..75de00cb64 100644 --- a/src/openrct2/ride/gentle/HauntedHouse.cpp +++ b/src/openrct2/ride/gentle/HauntedHouse.cpp @@ -99,19 +99,20 @@ static void PaintHauntedHouse( { case 1: // top - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: // right - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: // left - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: // bottom - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/gentle/Maze.cpp b/src/openrct2/ride/gentle/Maze.cpp index f628c58382..3ae4473084 100644 --- a/src/openrct2/ride/gentle/Maze.cpp +++ b/src/openrct2/ride/gentle/Maze.cpp @@ -68,7 +68,7 @@ static void MazePaintSetup( session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, rotation, height, GetShopSupportColourScheme(session, trackElement)); - PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~kSegmentCentre, 0xFFFF, 0); + PaintUtilSetSegmentSupportHeight(session, kSegmentsAll & ~EnumToFlag(PaintSegment::centre), 0xFFFF, 0); int32_t baseImageId = 0; switch (ride.track_colour[0].supports) @@ -178,7 +178,7 @@ static void MazePaintSetup( imageId = baseImage.WithIndexOffset(SprMazeOffsetColumnCentre); PaintAddImageAsParent(session, imageId, { 14, 14, height }, { { 15, 15, height + 2 }, { 2, 2, 8 } }); - PaintUtilSetSegmentSupportHeight(session, kSegmentCentre, height + 12, 0x20); + PaintUtilSetSegmentSupportHeight(session, EnumToFlag(PaintSegment::centre), height + 12, 0x20); } PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/MerryGoRound.cpp b/src/openrct2/ride/gentle/MerryGoRound.cpp index 8f9d30e249..881d3ad259 100644 --- a/src/openrct2/ride/gentle/MerryGoRound.cpp +++ b/src/openrct2/ride/gentle/MerryGoRound.cpp @@ -149,19 +149,20 @@ static void PaintMerryGoRound( { case 1: // top - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: // right - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: // left - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: // bottom - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/gentle/MiniGolf.cpp b/src/openrct2/ride/gentle/MiniGolf.cpp index f96d62c7a2..f9491cc8b4 100644 --- a/src/openrct2/ride/gentle/MiniGolf.cpp +++ b/src/openrct2/ride/gentle/MiniGolf.cpp @@ -489,7 +489,10 @@ static void PaintMiniGolfTrackFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); if (MiniGolfPaintUtilShouldDrawFence(session, trackElement)) { @@ -526,7 +529,10 @@ static void PaintMiniGolfTrack25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); imageId = GetStationColourScheme(session, trackElement).WithIndex(MiniGolfTrackSprites25DegUp[direction][1]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 0, 10, height + 2 }, { 32, 1, 15 } }); @@ -565,7 +571,10 @@ static void PaintMiniGolfTrackFlatTo25DegUp( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); imageId = GetStationColourScheme(session, trackElement).WithIndex(MiniGolfTrackSpritesFlatTo25DegUp[direction][1]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 0, 10, height + 2 }, { 32, 1, 11 } }); @@ -604,7 +613,10 @@ static void PaintMiniGolfTrack25DegUpToFlat( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); imageId = GetStationColourScheme(session, trackElement).WithIndex(MiniGolfTrackSprites25DegUpToFlat[direction][1]); PaintAddImageAsParentRotated(session, direction, imageId, { 0, 0, height }, { { 0, 10, height + 2 }, { 32, 1, 11 } }); @@ -733,7 +745,12 @@ static void PaintMiniGolfTrackLeftQuarterTurn1Tile( MetalASupportsPaintSetup(session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); const bool shouldDrawFence = MiniGolfPaintUtilShouldDrawFence(session, trackElement); diff --git a/src/openrct2/ride/gentle/MiniHelicopters.cpp b/src/openrct2/ride/gentle/MiniHelicopters.cpp index 5e127e3195..5a98c68c45 100644 --- a/src/openrct2/ride/gentle/MiniHelicopters.cpp +++ b/src/openrct2/ride/gentle/MiniHelicopters.cpp @@ -78,7 +78,10 @@ static void PaintMiniHelicoptersTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -120,7 +123,10 @@ static void PaintMiniHelicoptersTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -162,7 +168,10 @@ static void PaintMiniHelicoptersTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -204,7 +213,10 @@ static void PaintMiniHelicoptersTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -248,17 +260,35 @@ static void PaintMiniHelicoptersTrackLeftQuarterTurn3Tiles( MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::topCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; case 3: MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner), + direction), + 0xFFFF, 0); break; } @@ -291,7 +321,12 @@ static void PaintMiniHelicoptersTrackLeftQuarterTurn1Tile( TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height, 0, TUNNEL_0, 0, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } diff --git a/src/openrct2/ride/gentle/MonorailCycles.cpp b/src/openrct2/ride/gentle/MonorailCycles.cpp index c07416fae4..9f8f4efc3b 100644 --- a/src/openrct2/ride/gentle/MonorailCycles.cpp +++ b/src/openrct2/ride/gentle/MonorailCycles.cpp @@ -181,7 +181,10 @@ static void PaintMonorailCyclesTrackFlat( session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -233,17 +236,35 @@ static void PaintMonorailCyclesTrackLeftQuarterTurn3Tiles( MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::topCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; case 3: MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner), + direction), + 0xFFFF, 0); break; } @@ -365,27 +386,52 @@ static void PaintMonorailCyclesTrackRightQuarterTurn5Tiles( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; } @@ -479,25 +525,43 @@ static void PaintMonorailCyclesTrackSBendLeft( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction & 1), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::topCorner), + direction & 1), + 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner, direction & 1), + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner), + direction & 1), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction & 1), + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction & 1), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner, direction & 1), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomCorner), + direction & 1), + 0xFFFF, 0); break; } PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); @@ -582,25 +646,43 @@ static void PaintMonorailCyclesTrackSBendRight( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction & 1), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction & 1), + 0xFFFF, 0); break; case 1: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner, direction & 1), + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide, PaintSegment::rightCorner), + direction & 1), 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner, direction & 1), + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner), + direction & 1), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner, direction & 1), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::leftCorner), + direction & 1), + 0xFFFF, 0); break; } PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/gentle/ObservationTower.cpp b/src/openrct2/ride/gentle/ObservationTower.cpp index bd15e434f8..3efe30f862 100644 --- a/src/openrct2/ride/gentle/ObservationTower.cpp +++ b/src/openrct2/ride/gentle/ObservationTower.cpp @@ -123,28 +123,37 @@ static void PaintObservationTowerBase( switch (trackSequence) { case 1: - blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, PaintSegment::topRightSide, + PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; case 5: - blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 6: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner); break; case 7: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 8: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); diff --git a/src/openrct2/ride/gentle/SpaceRings.cpp b/src/openrct2/ride/gentle/SpaceRings.cpp index e7fcf7059f..e15c4822c5 100644 --- a/src/openrct2/ride/gentle/SpaceRings.cpp +++ b/src/openrct2/ride/gentle/SpaceRings.cpp @@ -145,28 +145,36 @@ static void PaintSpaceRings( cornerSegments = 0; break; case 1: - cornerSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + cornerSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, PaintSegment::topRightSide, + PaintSegment::rightCorner); break; case 2: - cornerSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - cornerSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + cornerSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner); break; case 4: - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; case 5: - cornerSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + cornerSegments = EnumsToFlags(PaintSegment::rightCorner, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 6: - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + cornerSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner); break; case 7: - cornerSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + cornerSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 8: - cornerSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + cornerSegments = EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); diff --git a/src/openrct2/ride/thrill/3dCinema.cpp b/src/openrct2/ride/thrill/3dCinema.cpp index 7e9a1f5833..ff0497831e 100644 --- a/src/openrct2/ride/thrill/3dCinema.cpp +++ b/src/openrct2/ride/thrill/3dCinema.cpp @@ -95,19 +95,20 @@ static void Paint3dCinema( { case 1: // top - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: // right - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: // left - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: // bottom - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/thrill/Enterprise.cpp b/src/openrct2/ride/thrill/Enterprise.cpp index 0ddf318e6b..a2dc273011 100644 --- a/src/openrct2/ride/thrill/Enterprise.cpp +++ b/src/openrct2/ride/thrill/Enterprise.cpp @@ -152,16 +152,17 @@ static void PaintEnterprise( switch (trackSequence) { case 0: - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 12: - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 15: - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } PaintUtilSetSegmentSupportHeight(session, cornerSegments, height + 2, 0x20); diff --git a/src/openrct2/ride/thrill/LaunchedFreefall.cpp b/src/openrct2/ride/thrill/LaunchedFreefall.cpp index 00554249fb..57b0517f53 100644 --- a/src/openrct2/ride/thrill/LaunchedFreefall.cpp +++ b/src/openrct2/ride/thrill/LaunchedFreefall.cpp @@ -132,28 +132,37 @@ static void PaintLaunchedFreefallBase( blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, PaintSegment::topRightSide, + PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; case 5: - blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 6: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner); break; case 7: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 8: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); diff --git a/src/openrct2/ride/thrill/RotoDrop.cpp b/src/openrct2/ride/thrill/RotoDrop.cpp index 5b1b202833..94cff1b347 100644 --- a/src/openrct2/ride/thrill/RotoDrop.cpp +++ b/src/openrct2/ride/thrill/RotoDrop.cpp @@ -145,28 +145,37 @@ static void PaintRotoDropBase( switch (trackSequence) { case 1: - blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, PaintSegment::topRightSide, + PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; case 5: - blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 6: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner); break; case 7: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 8: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); diff --git a/src/openrct2/ride/thrill/TopSpin.cpp b/src/openrct2/ride/thrill/TopSpin.cpp index 849360a302..9764b3b417 100644 --- a/src/openrct2/ride/thrill/TopSpin.cpp +++ b/src/openrct2/ride/thrill/TopSpin.cpp @@ -225,19 +225,20 @@ static void PaintTopSpin( { case 1: // top - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: // right - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: // left - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: // bottom - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/thrill/Twist.cpp b/src/openrct2/ride/thrill/Twist.cpp index 8c7384b549..53ab126904 100644 --- a/src/openrct2/ride/thrill/Twist.cpp +++ b/src/openrct2/ride/thrill/Twist.cpp @@ -145,16 +145,17 @@ static void PaintTwist( switch (trackSequence) { case 1: - cornerSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 3: - cornerSegments = kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags(PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide); break; case 6: - cornerSegments = kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide; + cornerSegments = EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide); break; case 7: - cornerSegments = kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + cornerSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/transport/Chairlift.cpp b/src/openrct2/ride/transport/Chairlift.cpp index 640f015bb7..acaa3affce 100644 --- a/src/openrct2/ride/transport/Chairlift.cpp +++ b/src/openrct2/ride/transport/Chairlift.cpp @@ -492,7 +492,7 @@ static void ChairliftPaintFlatTo25DegUp( break; } - ChairliftPaintUtilDrawSupports(session, kSegmentCentre, height); + ChairliftPaintUtilDrawSupports(session, EnumToFlag(PaintSegment::centre), height); PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -547,7 +547,7 @@ static void ChairliftPaint25DegUpToFlat( break; } - ChairliftPaintUtilDrawSupports(session, kSegmentCentre, height); + ChairliftPaintUtilDrawSupports(session, EnumToFlag(PaintSegment::centre), height); PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -637,7 +637,9 @@ static void ChairliftPaintLeftQuarterTurn1Tile( break; } - ChairliftPaintUtilDrawSupports(session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), height); + ChairliftPaintUtilDrawSupports( + session, PaintUtilRotateSegments(EnumsToFlags(PaintSegment::topLeftSide, PaintSegment::bottomLeftSide), direction), + height); PaintUtilSetSegmentSupportHeight(session, kSegmentsAll, 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); diff --git a/src/openrct2/ride/transport/Lift.cpp b/src/openrct2/ride/transport/Lift.cpp index 774eaa6d46..2c063be35a 100644 --- a/src/openrct2/ride/transport/Lift.cpp +++ b/src/openrct2/ride/transport/Lift.cpp @@ -81,28 +81,37 @@ static void PaintLiftBase( switch (trackSequence) { case 1: - blockedSegments = kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::topCorner, PaintSegment::topRightSide, + PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentTopRightSide | kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topRightSide, PaintSegment::rightCorner, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; case 5: - blockedSegments = kSegmentRightCorner | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 6: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::leftCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomCorner); break; case 7: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 8: - blockedSegments = kSegmentLeftCorner | kSegmentBottomLeftSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags(PaintSegment::leftCorner, PaintSegment::bottomLeftSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, blockedSegments, 0xFFFF, 0); diff --git a/src/openrct2/ride/transport/MiniatureRailway.cpp b/src/openrct2/ride/transport/MiniatureRailway.cpp index 138d734832..1a36221067 100644 --- a/src/openrct2/ride/transport/MiniatureRailway.cpp +++ b/src/openrct2/ride/transport/MiniatureRailway.cpp @@ -1051,20 +1051,26 @@ static void PaintMiniatureRailwayTrackRightQuarterTurn5Tiles( blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomCorner, PaintSegment::topRightSide); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentLeftCorner | kSegmentRightCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide - | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide); break; case 4: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide); break; case 5: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::leftCorner, + PaintSegment::bottomCorner, PaintSegment::topLeftSide); break; case 6: blockedSegments = kSegmentsAll; @@ -1178,10 +1184,14 @@ static void PaintMiniatureRailwayTrackSBendLeft( blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 3: blockedSegments = kSegmentsAll; @@ -1286,10 +1296,14 @@ static void PaintMiniatureRailwayTrackSBendRight( blockedSegments = kSegmentsAll; break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 3: blockedSegments = kSegmentsAll; @@ -1400,7 +1414,8 @@ static void PaintMiniatureRailwayTrackRightQuarterTurn3Tiles( blockedSegments = kSegmentsAll; break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: blockedSegments = kSegmentsAll; diff --git a/src/openrct2/ride/transport/Monorail.cpp b/src/openrct2/ride/transport/Monorail.cpp index 5870a3099b..856019b25d 100644 --- a/src/openrct2/ride/transport/Monorail.cpp +++ b/src/openrct2/ride/transport/Monorail.cpp @@ -415,7 +415,10 @@ static void PaintMonorailTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -509,7 +512,10 @@ static void PaintMonorailTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -552,7 +558,10 @@ static void PaintMonorailTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -595,7 +604,10 @@ static void PaintMonorailTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -665,19 +677,26 @@ static void PaintMonorailTrackRightQuarterTurn5Tiles( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::bottomCorner, PaintSegment::topRightSide); break; case 3: - blockedSegments = kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre; + blockedSegments = EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre); break; case 5: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, PaintSegment::leftCorner, + PaintSegment::bottomCorner, PaintSegment::topLeftSide); break; case 6: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } @@ -775,16 +794,22 @@ static void PaintMonorailTrackSBendLeft( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topCorner); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); @@ -869,16 +894,22 @@ static void PaintMonorailTrackSBendRight( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction & 1), 0xFFFF, 0); @@ -909,13 +940,16 @@ static void PaintMonorailTrackRightQuarterTurn3Tiles( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); @@ -986,19 +1020,26 @@ static void PaintMonorailTrackLeftEighthToDiag( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::topCorner); break; case 2: - blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, PaintSegment::bottomRightSide, + PaintSegment::rightCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentLeftCorner | kSegmentTopLeftSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::leftCorner, PaintSegment::topLeftSide); break; case 4: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopLeftSide | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topLeftSide, + PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; } @@ -1056,19 +1097,26 @@ static void PaintMonorailTrackRightEighthToDiag( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide; + blockedSegments = EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide); break; case 1: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomCorner | kSegmentBottomRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomCorner, + PaintSegment::bottomRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentTopCorner; + blockedSegments = EnumsToFlags( + PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, PaintSegment::topLeftSide, + PaintSegment::topCorner); break; case 3: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomCorner | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomCorner, PaintSegment::bottomRightSide); break; case 4: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentBottomRightSide; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::leftCorner, + PaintSegment::topLeftSide, PaintSegment::bottomRightSide); break; } diff --git a/src/openrct2/ride/transport/SuspendedMonorail.cpp b/src/openrct2/ride/transport/SuspendedMonorail.cpp index f9f2931321..1ad1713012 100644 --- a/src/openrct2/ride/transport/SuspendedMonorail.cpp +++ b/src/openrct2/ride/transport/SuspendedMonorail.cpp @@ -41,7 +41,10 @@ static void SuspendedMonorailTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( @@ -110,7 +113,10 @@ static void SuspendedMonorailTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -177,7 +183,10 @@ static void SuspendedMonorailTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -244,7 +253,10 @@ static void SuspendedMonorailTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { switch (direction) @@ -338,7 +350,12 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -376,7 +393,11 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -404,7 +425,13 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -434,7 +461,11 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -464,7 +495,12 @@ static void SuspendedMonorailTrackLeftQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -525,7 +561,13 @@ static void SuspendedMonorailTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -560,7 +602,11 @@ static void SuspendedMonorailTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -603,7 +649,11 @@ static void SuspendedMonorailTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -647,7 +697,13 @@ static void SuspendedMonorailTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -698,7 +754,13 @@ static void SuspendedMonorailTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -733,7 +795,11 @@ static void SuspendedMonorailTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -776,7 +842,11 @@ static void SuspendedMonorailTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); switch (direction) { @@ -820,7 +890,13 @@ static void SuspendedMonorailTrackSBendRight( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -871,7 +947,12 @@ static void SuspendedMonorailTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -909,7 +990,13 @@ static void SuspendedMonorailTrackLeftQuarterTurn3( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -938,7 +1025,12 @@ static void SuspendedMonorailTrackLeftQuarterTurn3( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -999,7 +1091,10 @@ static void SuspendedMonorailTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -1035,7 +1130,11 @@ static void SuspendedMonorailTrackLeftEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1064,13 +1163,24 @@ static void SuspendedMonorailTrackLeftEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1100,7 +1210,11 @@ static void SuspendedMonorailTrackLeftEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1163,7 +1277,10 @@ static void SuspendedMonorailTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height + 42, session.SupportColours); @@ -1199,7 +1316,11 @@ static void SuspendedMonorailTrackRightEighthToDiag( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; @@ -1228,13 +1349,24 @@ static void SuspendedMonorailTrackRightEighthToDiag( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 4: @@ -1264,7 +1396,11 @@ static void SuspendedMonorailTrackRightEighthToDiag( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); switch (direction) { @@ -1329,7 +1465,13 @@ static void SuspendedMonorailTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: @@ -1342,7 +1484,12 @@ static void SuspendedMonorailTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: @@ -1355,7 +1502,13 @@ static void SuspendedMonorailTrackDiagFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: @@ -1369,7 +1522,13 @@ static void SuspendedMonorailTrackDiagFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1415,7 +1574,13 @@ static void SuspendedMonorailTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1428,7 +1593,12 @@ static void SuspendedMonorailTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1441,7 +1611,13 @@ static void SuspendedMonorailTrackDiag25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1455,7 +1631,13 @@ static void SuspendedMonorailTrackDiag25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1501,7 +1683,13 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -1514,7 +1702,12 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1527,7 +1720,13 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -1541,7 +1740,13 @@ static void SuspendedMonorailTrackDiagFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1587,7 +1792,13 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1600,7 +1811,12 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1613,7 +1829,13 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1627,7 +1849,13 @@ static void SuspendedMonorailTrackDiag25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1673,7 +1901,13 @@ static void SuspendedMonorailTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 1: @@ -1686,7 +1920,12 @@ static void SuspendedMonorailTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: @@ -1699,7 +1938,13 @@ static void SuspendedMonorailTrackDiag25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 3: @@ -1713,7 +1958,13 @@ static void SuspendedMonorailTrackDiag25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1759,7 +2010,13 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 1: switch (direction) @@ -1771,7 +2028,12 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); break; case 2: switch (direction) @@ -1783,7 +2045,13 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: switch (direction) @@ -1796,7 +2064,13 @@ static void SuspendedMonorailTrackDiagFlatTo25DegDown( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: @@ -1842,7 +2116,13 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 1: @@ -1855,7 +2135,12 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 2: @@ -1868,7 +2153,13 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( break; } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 64, 0x20); break; case 3: @@ -1882,7 +2173,13 @@ static void SuspendedMonorailTrackDiag25DegDownToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); switch (direction) { case 0: diff --git a/src/openrct2/ride/water/BoatHire.cpp b/src/openrct2/ride/water/BoatHire.cpp index cc604c2c92..77afdc4587 100644 --- a/src/openrct2/ride/water/BoatHire.cpp +++ b/src/openrct2/ride/water/BoatHire.cpp @@ -57,7 +57,10 @@ static void PaintBoatHireTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } @@ -125,7 +128,10 @@ static void PaintBoatHireTrackLeftQuarterTurn1Tile( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } diff --git a/src/openrct2/ride/water/DinghySlide.cpp b/src/openrct2/ride/water/DinghySlide.cpp index 7947055858..b9c94ca63d 100644 --- a/src/openrct2/ride/water/DinghySlide.cpp +++ b/src/openrct2/ride/water/DinghySlide.cpp @@ -238,7 +238,10 @@ static void DinghySlideTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -312,7 +315,10 @@ static void DinghySlideTrack25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -349,7 +355,10 @@ static void DinghySlideTrack60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -395,7 +404,10 @@ static void DinghySlideTrackFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -432,7 +444,10 @@ static void DinghySlideTrack25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -469,7 +484,10 @@ static void DinghySlideTrack60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -515,7 +533,10 @@ static void DinghySlideTrack25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -652,27 +673,52 @@ static void DinghySlideTrackRightQuarterTurn5( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; } @@ -738,7 +784,13 @@ static void DinghySlideTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -753,7 +805,11 @@ static void DinghySlideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 2: @@ -769,7 +825,11 @@ static void DinghySlideTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 3: @@ -779,7 +839,13 @@ static void DinghySlideTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -845,7 +911,13 @@ static void DinghySlideTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -860,7 +932,11 @@ static void DinghySlideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 2: @@ -876,7 +952,11 @@ static void DinghySlideTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 3: @@ -886,7 +966,13 @@ static void DinghySlideTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -974,13 +1060,16 @@ static void DinghySlideTrackRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); diff --git a/src/openrct2/ride/water/DinghySlideCovered.cpp b/src/openrct2/ride/water/DinghySlideCovered.cpp index 25eb98dda3..84b51152ab 100644 --- a/src/openrct2/ride/water/DinghySlideCovered.cpp +++ b/src/openrct2/ride/water/DinghySlideCovered.cpp @@ -194,7 +194,10 @@ static void DinghySlideTrackCoveredFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -231,7 +234,10 @@ static void DinghySlideTrackCovered25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -268,7 +274,10 @@ static void DinghySlideTrackCovered60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 104, 0x20); } @@ -305,7 +314,10 @@ static void DinghySlideTrackCoveredFlatTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -342,7 +354,10 @@ static void DinghySlideTrackCovered25DegUpTo60DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -379,7 +394,10 @@ static void DinghySlideTrackCovered60DegUpTo25DegUp( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); } @@ -416,7 +434,10 @@ static void DinghySlideTrackCovered25DegUpToFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -553,27 +574,52 @@ static void DinghySlideTrackCoveredRightQuarterTurn5( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::rightCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; } @@ -632,7 +678,13 @@ static void DinghySlideTrackCoveredSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -647,7 +699,11 @@ static void DinghySlideTrackCoveredSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 2: @@ -663,7 +719,11 @@ static void DinghySlideTrackCoveredSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 3: @@ -673,7 +733,13 @@ static void DinghySlideTrackCoveredSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -739,7 +805,13 @@ static void DinghySlideTrackCoveredSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -754,7 +826,11 @@ static void DinghySlideTrackCoveredSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 2: @@ -770,7 +846,11 @@ static void DinghySlideTrackCoveredSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 3: @@ -780,7 +860,13 @@ static void DinghySlideTrackCoveredSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -868,13 +954,16 @@ static void DinghySlideTrackCoveredRightQuarterTurn3( switch (trackSequence) { case 0: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentRightCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::rightCorner); break; case 2: - blockedSegments = kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, PaintSegment::bottomCorner); break; case 3: - blockedSegments = kSegmentBottomRightSide | kSegmentCentre | kSegmentTopLeftSide | kSegmentLeftCorner; + blockedSegments = EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::leftCorner); break; } PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(blockedSegments, direction), 0xFFFF, 0); diff --git a/src/openrct2/ride/water/LogFlume.cpp b/src/openrct2/ride/water/LogFlume.cpp index 7211842e98..97dfd921c3 100644 --- a/src/openrct2/ride/water/LogFlume.cpp +++ b/src/openrct2/ride/water/LogFlume.cpp @@ -179,7 +179,10 @@ static void PaintLogFlumeTrackFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -243,7 +246,10 @@ static void PaintLogFlumeTrack25DegUp( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -279,7 +285,10 @@ static void PaintLogFlumeTrackFlatTo25DegUp( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -315,7 +324,10 @@ static void PaintLogFlumeTrack25DegUpToFlat( PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -351,7 +363,10 @@ static void PaintLogFlumeTrack25DegDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_1); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -387,7 +402,10 @@ static void PaintLogFlumeTrackFlatTo25DegDown( PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); } @@ -423,7 +441,10 @@ static void PaintLogFlumeTrack25DegDownToFlat( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -471,7 +492,13 @@ static void PaintLogFlumeTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 1: bboy = (direction == 0 || direction == 1) ? 0 : 6; @@ -486,7 +513,11 @@ static void PaintLogFlumeTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 2: @@ -502,7 +533,11 @@ static void PaintLogFlumeTrackSBendLeft( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 3: @@ -512,7 +547,13 @@ static void PaintLogFlumeTrackSBendLeft( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -578,7 +619,13 @@ static void PaintLogFlumeTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 1: bboy = (direction == 2 || direction == 3) ? 0 : 6; @@ -593,7 +640,11 @@ static void PaintLogFlumeTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 2: @@ -609,7 +660,11 @@ static void PaintLogFlumeTrackSBendRight( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 3: @@ -619,7 +674,13 @@ static void PaintLogFlumeTrackSBendRight( MetalASupportsPaintSetup( session, MetalSupportType::Boxed, MetalSupportPlace::Centre, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; } @@ -705,15 +766,33 @@ static void PaintLogFlumeTrackLeftQuarterTurn3Tiles( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; } @@ -784,15 +863,33 @@ static void PaintLogFlumeTrackRightQuarterTurn3Tiles( { case 0: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomCorner | kSegmentCentre | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; } @@ -839,7 +936,10 @@ static void PaintLogFlumeTrackReverser( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -883,7 +983,10 @@ static void LogFlumeTrack25Down60( PaintUtilPushTunnelRotated(session, direction, height + 24, TUNNEL_2); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -925,7 +1028,10 @@ static void LogFlumeTrack60Down( PaintUtilPushTunnelRotated(session, direction, height + 56, TUNNEL_SQUARE_8); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } @@ -967,7 +1073,10 @@ static void LogFlumeTrack60Down25( } } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } diff --git a/src/openrct2/ride/water/SplashBoats.cpp b/src/openrct2/ride/water/SplashBoats.cpp index 183668ce76..07b01abd73 100644 --- a/src/openrct2/ride/water/SplashBoats.cpp +++ b/src/openrct2/ride/water/SplashBoats.cpp @@ -874,30 +874,49 @@ static void PaintSplashBoatsTrackLeftQuarterTurn5Tiles( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner | kSegmentLeftCorner | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::topCorner, + PaintSegment::leftCorner, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopRightSide | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentCentre | kSegmentTopCorner | kSegmentBottomCorner | kSegmentTopLeftSide | kSegmentBottomLeftSide, + EnumsToFlags( + PaintSegment::topRightSide, PaintSegment::bottomRightSide, PaintSegment::rightCorner, + PaintSegment::centre, PaintSegment::topCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentTopRightSide | kSegmentBottomRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::rightCorner, PaintSegment::topRightSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomLeftSide | kSegmentBottomCorner | kSegmentLeftCorner, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomCorner, PaintSegment::leftCorner), + direction), 0xFFFF, 0); break; case 6: @@ -986,30 +1005,47 @@ static void PaintSplashBoatsTrackRightQuarterTurn5Tiles( break; case 1: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentRightCorner | kSegmentBottomCorner | kSegmentTopRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::topRightSide), + direction), 0xFFFF, 0); break; case 3: PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentCentre | kSegmentLeftCorner | kSegmentRightCorner | kSegmentBottomLeftSide | kSegmentBottomRightSide, + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide, PaintSegment::centre, + PaintSegment::leftCorner, PaintSegment::rightCorner, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), direction), 0xFFFF, 0); break; case 4: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentTopLeftSide | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::topCorner, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), + 0xFFFF, 0); break; case 5: PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentBottomRightSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner | kSegmentBottomCorner | kSegmentTopLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomRightSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::topLeftSide), + direction), 0xFFFF, 0); break; case 6: @@ -1093,7 +1129,11 @@ static void PaintSplashBoatsTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 2: @@ -1107,7 +1147,11 @@ static void PaintSplashBoatsTrackSBendLeft( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 3: @@ -1195,7 +1239,11 @@ static void PaintSplashBoatsTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentRightCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); break; case 2: @@ -1209,7 +1257,11 @@ static void PaintSplashBoatsTrackSBendRight( PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), 0xFFFF, 0); break; case 3: diff --git a/src/openrct2/ride/water/SubmarineRide.cpp b/src/openrct2/ride/water/SubmarineRide.cpp index 1fae87ba46..95f48f484a 100644 --- a/src/openrct2/ride/water/SubmarineRide.cpp +++ b/src/openrct2/ride/water/SubmarineRide.cpp @@ -123,7 +123,10 @@ static void SubmarineRidePaintTrackFlat( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } @@ -142,17 +145,35 @@ static void SubmarineRidePaintTrackLeftQuarterTurn3Tiles( MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height - 16, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentBottomLeftSide | kSegmentCentre | kSegmentTopRightSide | kSegmentTopCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomLeftSide, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::topCorner), + direction), + 0xFFFF, 0); break; case 2: PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide | kSegmentLeftCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::leftCorner), + direction), + 0xFFFF, 0); break; case 3: MetalASupportsPaintSetup( session, MetalSupportType::Stick, MetalSupportPlace::Centre, -1, height - 16, session.SupportColours); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomRightSide | kSegmentBottomCorner, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomRightSide, + PaintSegment::bottomCorner), + direction), + 0xFFFF, 0); break; } @@ -182,7 +203,12 @@ static void SubmarineRidePaintTrackLeftQuarterTurn1Tile( TrackPaintUtilLeftQuarterTurn1TileTunnel(session, direction, height - 16, 0, TUNNEL_0, 0, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentTopLeftSide | kSegmentCentre | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::topLeftSide, PaintSegment::centre, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 16, 0x20); } From 988162e12513246678c74a0221321d57fd024d50 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Mon, 11 Mar 2024 04:02:00 +0000 Subject: [PATCH 064/191] Merge Localisation/master into OpenRCT2/develop --- data/language/en-US.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/data/language/en-US.txt b/data/language/en-US.txt index e05f413892..3ca6731d87 100644 --- a/data/language/en-US.txt +++ b/data/language/en-US.txt @@ -13,7 +13,6 @@ STR_0038 :Restroom STR_0041 :3D Theater STR_0045 :Elevator STR_0047 :ATM -STR_0052 :Tunnel Of Horror STR_0517 :Passengers ride in miniature trains along a narrow-gauge railroad track STR_0529 :Mine train themed roller coaster trains career along steel roller coaster track made to look like old railroad track STR_0537 :Guests bump into each other in self-driven electric bumper cars From 1e51925968e08b3945c1981aa98d0d0839853edf Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Mon, 11 Mar 2024 04:42:54 -0700 Subject: [PATCH 065/191] Change "ternary" to "tertiary" (#21582) --- src/openrct2-ui/windows/Ride.cpp | 26 +++++++++---------- src/openrct2-ui/windows/Scenery.cpp | 2 +- .../actions/RideSetAppearanceAction.cpp | 4 +-- .../actions/RideSetAppearanceAction.h | 2 +- src/openrct2/localisation/StringIds.h | 2 +- src/openrct2/object/RideObject.cpp | 2 +- src/openrct2/ride/CarEntry.h | 2 +- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index 235dbcf2ca..a7c4a112f7 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -188,7 +188,7 @@ enum { WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN, WIDX_VEHICLE_BODY_COLOUR, WIDX_VEHICLE_TRIM_COLOUR, - WIDX_VEHICLE_TERNARY_COLOUR, + WIDX_VEHICLE_TERTIARY_COLOUR, WIDX_SELL_ITEM_RANDOM_COLOUR_CHECKBOX, WIDX_PLAY_MUSIC = 14, @@ -4277,7 +4277,7 @@ static_assert(std::size(RatingNames) == 6); vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Trim); break; - case WIDX_VEHICLE_TERNARY_COLOUR: + case WIDX_VEHICLE_TERTIARY_COLOUR: vehicleColour = RideGetVehicleColour(*ride, _vehicleIndex); WindowDropdownShowColour(this, &widgets[widgetIndex], colours[1], vehicleColour.Tertiary); break; @@ -4371,10 +4371,10 @@ static_assert(std::size(RatingNames) == 6); GameActions::Execute(&rideSetAppearanceAction); } break; - case WIDX_VEHICLE_TERNARY_COLOUR: + case WIDX_VEHICLE_TERTIARY_COLOUR: { auto rideSetAppearanceAction = RideSetAppearanceAction( - rideId, RideSetAppearanceType::VehicleColourTernary, ColourDropDownIndexToColour(dropdownIndex), + rideId, RideSetAppearanceType::VehicleColourTertiary, ColourDropDownIndexToColour(dropdownIndex), _vehicleIndex); GameActions::Execute(&rideSetAppearanceAction); } @@ -4557,7 +4557,7 @@ static_assert(std::size(RatingNames) == 6); widgets[WIDX_VEHICLE_BODY_COLOUR].image = GetColourButtonImage(vehicleColour.Body); bool allowChangingTrimColour = false; - bool allowChangingTernaryColour = false; + bool allowChangingTertiaryColour = false; for (int32_t i = 0; i < ride->num_cars_per_train; i++) { @@ -4567,9 +4567,9 @@ static_assert(std::size(RatingNames) == 6); { allowChangingTrimColour = true; } - if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TERNARY_COLOUR) + if (rideEntry->Cars[vehicleTypeIndex].flags & CAR_ENTRY_FLAG_ENABLE_TERTIARY_COLOUR) { - allowChangingTernaryColour = true; + allowChangingTertiaryColour = true; } } @@ -4578,20 +4578,20 @@ static_assert(std::size(RatingNames) == 6); { widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::ColourBtn; widgets[WIDX_VEHICLE_TRIM_COLOUR].image = GetColourButtonImage(vehicleColour.Trim); - if (allowChangingTernaryColour) + if (allowChangingTertiaryColour) { - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::ColourBtn; - widgets[WIDX_VEHICLE_TERNARY_COLOUR].image = GetColourButtonImage(vehicleColour.Tertiary); + widgets[WIDX_VEHICLE_TERTIARY_COLOUR].type = WindowWidgetType::ColourBtn; + widgets[WIDX_VEHICLE_TERTIARY_COLOUR].image = GetColourButtonImage(vehicleColour.Tertiary); } else { - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_TERTIARY_COLOUR].type = WindowWidgetType::Empty; } } else { widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_TERTIARY_COLOUR].type = WindowWidgetType::Empty; } // Vehicle colour scheme type @@ -4636,7 +4636,7 @@ static_assert(std::size(RatingNames) == 6); widgets[WIDX_VEHICLE_COLOUR_INDEX_DROPDOWN].type = WindowWidgetType::Empty; widgets[WIDX_VEHICLE_BODY_COLOUR].type = WindowWidgetType::Empty; widgets[WIDX_VEHICLE_TRIM_COLOUR].type = WindowWidgetType::Empty; - widgets[WIDX_VEHICLE_TERNARY_COLOUR].type = WindowWidgetType::Empty; + widgets[WIDX_VEHICLE_TERTIARY_COLOUR].type = WindowWidgetType::Empty; } ft.Rewind(); diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index d368131297..52591abaca 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -88,7 +88,7 @@ static Widget WindowSceneryBaseWidgets[] = { MakeWidget ({609, 83}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_PAINTBRUSH), STR_SCENERY_PAINTBRUSH_TIP ), // 4000000 0x009DE438 MakeWidget ({615, 108}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_COLOUR ), // 8000000 0x009DE448 MakeWidget ({615, 120}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_SECONDARY_COLOUR), // 10000000 0x009DE458 - MakeWidget ({615, 132}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_TERNARY_COLOUR ), // 20000000 0x009DE468 + MakeWidget ({615, 132}, { 12, 12}, WindowWidgetType::ColourBtn, WindowColour::Secondary, 0xFFFFFFFF, STR_SELECT_TERTIARY_COLOUR ), // 20000000 0x009DE468 MakeWidget ({609, 145}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_G2_EYEDROPPER), STR_SCENERY_EYEDROPPER_TIP ), // 40000000 0x009DE478 MakeWidget ({609, 169}, { 24, 24}, WindowWidgetType::FlatBtn, WindowColour::Secondary, ImageId(SPR_SCENERY_CLUSTER), STR_SCENERY_CLUSTER_TIP ), // 40000000 0x009DE478 MakeWidget ({ 4, 46}, {211, 14}, WindowWidgetType::TextBox, WindowColour::Secondary ), diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index a1405ed462..31ae303b03 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -71,7 +71,7 @@ GameActions::Result RideSetAppearanceAction::Query() const break; case RideSetAppearanceType::VehicleColourBody: case RideSetAppearanceType::VehicleColourTrim: - case RideSetAppearanceType::VehicleColourTernary: + case RideSetAppearanceType::VehicleColourTertiary: if (_index >= std::size(ride->vehicle_colours)) { LOG_WARNING("Invalid game command, index %d out of bounds", _index); @@ -123,7 +123,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const ride->vehicle_colours[_index].Trim = _value; RideUpdateVehicleColours(*ride); break; - case RideSetAppearanceType::VehicleColourTernary: + case RideSetAppearanceType::VehicleColourTertiary: ride->vehicle_colours[_index].Tertiary = _value; RideUpdateVehicleColours(*ride); break; diff --git a/src/openrct2/actions/RideSetAppearanceAction.h b/src/openrct2/actions/RideSetAppearanceAction.h index 6b0cb594ce..0b9fcbcef7 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.h +++ b/src/openrct2/actions/RideSetAppearanceAction.h @@ -19,7 +19,7 @@ enum class RideSetAppearanceType : uint8_t MazeStyle = TrackColourSupports, VehicleColourBody, VehicleColourTrim, - VehicleColourTernary, + VehicleColourTertiary, VehicleColourScheme, EntranceStyle, SellingItemColourIsRandom diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 53d6e6d344..248d4765a6 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -2286,7 +2286,7 @@ enum : uint16_t // STR_3098 :Can't change lift hill speed... STR_SELECT_COLOUR = 3099, STR_SELECT_SECONDARY_COLOUR = 3100, - STR_SELECT_TERNARY_COLOUR = 3101, + STR_SELECT_TERTIARY_COLOUR = 3101, STR_SCENERY_PAINTBRUSH_TIP = 3102, STR_CANT_REPAINT_THIS = 3103, STR_LIST_RIDES_TIP = 3104, diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index 152e3a3f55..f5ce445d68 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -818,7 +818,7 @@ CarEntry RideObject::ReadJsonCar([[maybe_unused]] IReadObjectContext* context, j { "isReverserPassengerCar", CAR_ENTRY_FLAG_REVERSER_PASSENGER_CAR }, { "hasInvertedSpriteSet", CAR_ENTRY_FLAG_HAS_INVERTED_SPRITE_SET }, { "hasDodgemInUseLights", CAR_ENTRY_FLAG_DODGEM_INUSE_LIGHTS }, - { "hasAdditionalColour2", CAR_ENTRY_FLAG_ENABLE_TERNARY_COLOUR }, + { "hasAdditionalColour2", CAR_ENTRY_FLAG_ENABLE_TERTIARY_COLOUR }, { "recalculateSpriteBounds", CAR_ENTRY_FLAG_RECALCULATE_SPRITE_BOUNDS }, { "overrideNumberOfVerticalFrames", CAR_ENTRY_FLAG_OVERRIDE_NUM_VERTICAL_FRAMES }, { "spriteBoundsIncludeInvertedSet", CAR_ENTRY_FLAG_SPRITE_BOUNDS_INCLUDE_INVERTED_SET }, diff --git a/src/openrct2/ride/CarEntry.h b/src/openrct2/ride/CarEntry.h index c64bf966d0..c6188e4dd3 100644 --- a/src/openrct2/ride/CarEntry.h +++ b/src/openrct2/ride/CarEntry.h @@ -50,7 +50,7 @@ enum : uint32_t CAR_ENTRY_FLAG_DODGEM_INUSE_LIGHTS = 1 << 7, // When set the vehicle has an additional frame for when in use. Used only by dodgems. CAR_ENTRY_FLAG_ALLOW_DOORS_DEPRECATED = 1 << 8, // Not used any more - every vehicle will now work with doors. - CAR_ENTRY_FLAG_ENABLE_TERNARY_COLOUR = 1 << 9, + CAR_ENTRY_FLAG_ENABLE_TERTIARY_COLOUR = 1 << 9, CAR_ENTRY_FLAG_RECALCULATE_SPRITE_BOUNDS = 1 << 10, // Only used during loading of the objects. CAR_ENTRY_FLAG_USE_16_ROTATION_FRAMES = 1 << 11, // Instead of the default 32 rotation frames. Only used for boat hire and works only for non sloped sprites. From 9524174d1399065071f052a428a5bfc17496a182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 11 Mar 2024 20:52:17 +0100 Subject: [PATCH 066/191] Use v14 images in CI Fixes #19409 --- .github/workflows/ci.yml | 18 +++++++++--------- .../app/src/main/CMakeLists.txt | 6 ++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 98bc007a5a..b639e83628 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,7 +156,7 @@ jobs: name: Windows (${{ matrix.platform_name }}) using mingw runs-on: ubuntu-latest needs: check-code-formatting - container: openrct2/openrct2-build:13-mingw + container: openrct2/openrct2-build:14-mingw strategy: fail-fast: false matrix: @@ -305,19 +305,19 @@ jobs: # For focal the debug information still takes too much space, so reduce amount of debug info to minimum using `-g1` (`-g` means `-g2`), which is enough for backtraces only. - platform: x86_64 distro: focal - image: openrct2/openrct2-build:13-focal + image: openrct2/openrct2-build:14-focal build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g1 -gz" -DWITH_TESTS=off - platform: x86_64 distro: jammy - image: openrct2/openrct2-build:13-jammy + image: openrct2/openrct2-build:14-jammy build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz -fno-var-tracking-assignments" - platform: x86_64 distro: bullseye - image: openrct2/openrct2-build:13-bullseye + image: openrct2/openrct2-build:14-bullseye build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz -fno-var-tracking-assignments" -DWITH_TESTS=off - platform: i686 distro: focal - image: openrct2/openrct2-build:13-focal32 + image: openrct2/openrct2-build:14-focal32 build_flags: -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -g1 -gz" -DWITH_TESTS=off steps: - name: Checkout @@ -356,7 +356,7 @@ jobs: name: Linux (x86_64, AppImage) runs-on: ubuntu-latest needs: check-code-formatting - container: openrct2/openrct2-build:13-focal + container: openrct2/openrct2-build:14-focal steps: - name: Checkout uses: actions/checkout@v4 @@ -414,7 +414,7 @@ jobs: name: Linux (Debug, [http, network, flac, vorbis OpenGL] disabled) using clang runs-on: ubuntu-latest needs: check-code-formatting - container: openrct2/openrct2-build:13-jammy + container: openrct2/openrct2-build:14-jammy steps: - name: Checkout uses: actions/checkout@v4 @@ -430,7 +430,7 @@ jobs: name: Linux (Debug) using clang, coverage enabled runs-on: ubuntu-latest needs: check-code-formatting - container: openrct2/openrct2-build:13-jammy + container: openrct2/openrct2-build:14-jammy steps: - name: Checkout uses: actions/checkout@v4 @@ -471,7 +471,7 @@ jobs: name: Android runs-on: ubuntu-latest needs: check-code-formatting - container: openrct2/openrct2-build:13-android + container: openrct2/openrct2-build:14-android steps: - name: Checkout uses: actions/checkout@v4 diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index 8c8327e36c..54b77f329c 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -198,7 +198,5 @@ target_include_directories(openrct2-ui PRIVATE "${ORCT2_ROOT}/src") target_include_directories(openrct2-ui SYSTEM PRIVATE "${ORCT2_ROOT}/src/thirdparty") target_include_directories(openrct2-cli PRIVATE "${ORCT2_ROOT}/src") -# Header-only nlohmann library is installed in CI images at /nlohmann. -# To be tiny bit more specific, use '/nlohmann/../' instead of just '/' -target_include_directories(openrct2 PRIVATE "/nlohmann/../") -target_include_directories(openrct2-ui PRIVATE "/nlohmann/../") +target_include_directories(openrct2 PRIVATE "/opt/openrct2/include/nlohmann/../") +target_include_directories(openrct2-ui PRIVATE "/opt/openrct2/include/nlohmann/../") From 5c00047bd15d14ff19853406972809c0ec6f50a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 11 Mar 2024 20:59:03 +0100 Subject: [PATCH 067/191] Sync android project with docker build image --- src/openrct2-android/app/build.gradle | 4 ++-- src/openrct2-android/build.gradle | 2 +- src/openrct2-android/gradle.properties | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/openrct2-android/app/build.gradle b/src/openrct2-android/app/build.gradle index 5e8073f5e1..fbd7d4b853 100644 --- a/src/openrct2-android/app/build.gradle +++ b/src/openrct2-android/app/build.gradle @@ -1,13 +1,13 @@ apply plugin: 'com.android.application' android { - compileSdkVersion 31 + compileSdk 34 buildToolsVersion "34.0.0" ndkVersion "26.2.11394342" // Latest r26c (LTS), to be synced with CI container image namespace "io.openrct2" defaultConfig { applicationId 'io.openrct2' - minSdkVersion 19 + minSdkVersion 21 targetSdkVersion 28 versionCode 2 diff --git a/src/openrct2-android/build.gradle b/src/openrct2-android/build.gradle index d748ef16df..01f316eecb 100644 --- a/src/openrct2-android/build.gradle +++ b/src/openrct2-android/build.gradle @@ -6,7 +6,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:8.3.0-alpha10' + classpath 'com.android.tools.build:gradle:8.3.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/src/openrct2-android/gradle.properties b/src/openrct2-android/gradle.properties index fa2c20f971..e37f08064c 100644 --- a/src/openrct2-android/gradle.properties +++ b/src/openrct2-android/gradle.properties @@ -16,6 +16,7 @@ # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects # org.gradle.parallel=true -android.enableJetifier=true +android.enableJetifier=false android.useAndroidX=true +org.gradle.configuration-cache=true org.gradle.jvmargs=-Xmx4096m From 470667ed281c1997697c1f72ad227c0ede49c87c Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Tue, 12 Mar 2024 04:01:51 +0000 Subject: [PATCH 068/191] Merge Localisation/master into OpenRCT2/develop --- data/language/fr-FR.txt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index 8dfbbccb13..d252cc5d4b 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -3691,6 +3691,15 @@ STR_6610 :Élément de chemin introuvable STR_6611 :Élément de mur introuvable STR_6612 :Élément de bannière introuvable STR_6613 :Recharger l’objet +STR_6614 :Impossible de changer le prix d’entrée du parc +STR_6615 :La voie a besoin d’eau sur cette case +STR_6616 :Action invalide pour ce type de personnel +STR_6617 :Impossible de permuter un élément de case avec lui-même +STR_6618 :Impossible de restreindre ou dé-restreindre l’objet… +STR_6619 :Ce type d’objet ne peut pas être restreint ! +STR_6620 :Objet introuvable ! +STR_6621 :Restreindre +STR_6622 :Restreint l’objet à l’éditeur de scénario et au mode bac à sable ############# # Scenarios # From 15650ad184b67aed455491d6ee8034026183371c Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Thu, 14 Mar 2024 04:01:42 +0000 Subject: [PATCH 069/191] Merge Localisation/master into OpenRCT2/develop --- data/language/en-US.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/data/language/en-US.txt b/data/language/en-US.txt index 3ca6731d87..719c210383 100644 --- a/data/language/en-US.txt +++ b/data/language/en-US.txt @@ -10,7 +10,6 @@ STR_0015 :Bobsled Coaster STR_0027 :Bumper Cars STR_0035 :Carousel STR_0038 :Restroom -STR_0041 :3D Theater STR_0045 :Elevator STR_0047 :ATM STR_0517 :Passengers ride in miniature trains along a narrow-gauge railroad track @@ -203,7 +202,7 @@ STR_3102 :Re-paint colored scenery on landscape STR_3122 :{WINDOW_COLOUR_2}Favorite ride of: {BLACK}{COMMA32} guest STR_3123 :{WINDOW_COLOUR_2}Favorite ride of: {BLACK}{COMMA32} guests -STR_3372 :{BLACK}= A.T.M. +STR_3372 :{BLACK}= ATM STR_3373 :{BLACK}= Restroom # Strings added by OpenRCT2. Only add strings that differ from UK English! From b69db13de3014a66881ec235d3a21e65bf53ee03 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Thu, 14 Mar 2024 17:39:11 +0000 Subject: [PATCH 070/191] Move gPeepWarningThrottle to GameState_t --- src/openrct2/GameState.h | 1 + src/openrct2/entity/Peep.cpp | 7 +++---- src/openrct2/entity/Peep.h | 2 -- src/openrct2/management/NewsItem.cpp | 2 +- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- 6 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index b6b3a70e35..f69913c9a3 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -102,6 +102,7 @@ namespace OpenRCT2 std::vector RestrictedScenery; std::vector PeepSpawns; + uint8_t PeepWarningThrottle[16]; News::ItemQueues NewsItems; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 9584f4f9af..59c4a9bd78 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -66,8 +66,6 @@ using namespace OpenRCT2; using namespace OpenRCT2::Audio; -uint8_t gPeepWarningThrottle[16]; - static uint8_t _unk_F1AEF0; static TileElement* _peepRideEntranceExitElement; @@ -1037,10 +1035,12 @@ void Peep::Update() */ void PeepProblemWarningsUpdate() { + auto& gameState = GetGameState(); + Ride* ride; uint32_t hungerCounter = 0, lostCounter = 0, noexitCounter = 0, thirstCounter = 0, litterCounter = 0, disgustCounter = 0, toiletCounter = 0, vandalismCounter = 0; - uint8_t* warningThrottle = gPeepWarningThrottle; + uint8_t* warningThrottle = gameState.PeepWarningThrottle; int32_t inQueueCounter = 0; int32_t tooLongQueueCounter = 0; @@ -1116,7 +1116,6 @@ void PeepProblemWarningsUpdate() break; } } - auto& gameState = GetGameState(); // could maybe be packed into a loop, would lose a lot of clarity though if (warningThrottle[0]) diff --git a/src/openrct2/entity/Peep.h b/src/openrct2/entity/Peep.h index 0586d41408..794103dac7 100644 --- a/src/openrct2/entity/Peep.h +++ b/src/openrct2/entity/Peep.h @@ -459,8 +459,6 @@ enum extern const PeepAnimationEntry g_peep_animation_entries[EnumValue(PeepSpriteType::Count)]; extern const bool gSpriteTypeToSlowWalkMap[48]; -extern uint8_t gPeepWarningThrottle[16]; - int32_t PeepGetStaffCount(); void PeepUpdateAll(); void PeepProblemWarningsUpdate(); diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index e3ee26bc9f..62c0d281bc 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -112,7 +112,7 @@ void News::InitQueue() assert(gameState.NewsItems.IsEmpty()); // Throttles for warning types (PEEP_*_WARNING) - for (auto& warningThrottle : gPeepWarningThrottle) + for (auto& warningThrottle : gameState.PeepWarningThrottle) { warningThrottle = 0; } diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 2ca2cb402e..27e09b9a13 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -912,7 +912,7 @@ namespace OpenRCT2 cs.ReadWrite(gameState.GuestGenerationProbability); cs.ReadWrite(gameState.SuggestedGuestMaximum); - cs.ReadWriteArray(gPeepWarningThrottle, [&cs](uint8_t& value) { + cs.ReadWriteArray(gameState.PeepWarningThrottle, [&cs](uint8_t& value) { cs.ReadWrite(value); return true; }); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 802308716f..10631bb15a 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -375,7 +375,7 @@ namespace RCT2 gameState.TotalAdmissions = _s6.TotalAdmissions; gameState.TotalIncomeFromAdmissions = ToMoney64(_s6.IncomeFromAdmissions); gameState.CompanyValue = ToMoney64(_s6.CompanyValue); - std::memcpy(gPeepWarningThrottle, _s6.PeepWarningThrottle, sizeof(_s6.PeepWarningThrottle)); + std::memcpy(gameState.PeepWarningThrottle, _s6.PeepWarningThrottle, sizeof(_s6.PeepWarningThrottle)); // Awards auto& awards = GetAwards(); From 9bb678688e99b4bbcc385dde1c6e8a5316fcdfa5 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Thu, 14 Mar 2024 19:49:57 +0100 Subject: [PATCH 071/191] Fix #21434: Number of guests overflows in objective text --- data/language/en-GB.txt | 6 +++--- distribution/changelog.txt | 1 + .../windows/EditorObjectiveOptions.cpp | 4 ++-- src/openrct2-ui/windows/Options.cpp | 2 +- src/openrct2-ui/windows/Park.cpp | 15 ++++++++++++++- src/openrct2/localisation/StringIds.h | 2 +- 6 files changed, 22 insertions(+), 8 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index d5664e614e..59d3c6ffa9 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -1737,12 +1737,12 @@ STR_2382 :Land STR_2383 :Water STR_2384 :{WINDOW_COLOUR_2}Your objective: STR_2385 :{BLACK}None -STR_2386 :{BLACK}To have at least {COMMA16} guests in your park at the end of {MONTHYEAR}, with a park rating of at least 600 +STR_2386 :{BLACK}To have at least {COMMA32} guests in your park at the end of {MONTHYEAR}, with a park rating of at least 600 STR_2387 :{BLACK}To achieve a park value of at least {POP16}{POP16}{CURRENCY} at the end of {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Have Fun! STR_2389 :{BLACK}Build the best {STRINGID} you can! STR_2390 :{BLACK}To have 10 different types of roller coasters operating in your park, each with an excitement value of at least 6.00 -STR_2391 :{BLACK}To have at least {COMMA16} guests in your park. You must not let the park rating drop below 700 at any time! +STR_2391 :{BLACK}To have at least {COMMA32} guests in your park. You must not let the park rating drop below 700 at any time! STR_2392 :{BLACK}To achieve a monthly income from ride tickets of at least {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}To have 10 different types of roller coasters operating in your park, each with a minimum length of {LENGTH}, and an excitement rating of at least 7.00 STR_2394 :{BLACK}To finish building all 5 of the partially built roller coasters in this park, designing them to achieve excitement ratings of at least {POP16}{POP16}{COMMA2DP32} each @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Monthly income: STR_3306 :{WINDOW_COLOUR_2}Monthly profit: STR_3307 :{WINDOW_COLOUR_2}Minimum length: STR_3308 :{WINDOW_COLOUR_2}Excitement rating: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Rides/attractions under a preservation order: diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 6262964752..83ccc8b54b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -3,6 +3,7 @@ - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. 0.4.9 (2024-03-02) diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 48703f40f0..c71eaced17 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -927,8 +927,8 @@ static uint64_t window_editor_objective_options_page_hold_down_widgets[] = { { case OBJECTIVE_GUESTS_BY: case OBJECTIVE_GUESTS_AND_RATING: - stringId = STR_WINDOW_COLOUR_2_COMMA16; - ft.Add(gameState.ScenarioObjective.NumGuests); + stringId = STR_WINDOW_COLOUR_2_COMMA32; + ft.Add(gameState.ScenarioObjective.NumGuests); break; case OBJECTIVE_PARK_VALUE_BY: case OBJECTIVE_REPAY_LOAN_AND_PARK_VALUE: diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index d7917b4c98..5cea541b8e 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2015,7 +2015,7 @@ static Widget *window_options_page_widgets[] = { DrawTextBasic( dpi, windowPos + ScreenCoordsXY{ widgets[WIDX_AUTOSAVE_AMOUNT].left + 1, widgets[WIDX_AUTOSAVE_AMOUNT].top + 1 }, - STR_WINDOW_COLOUR_2_COMMA16, ft, { colours[1] }); + STR_WINDOW_COLOUR_2_COMMA32, ft, { colours[1] }); const auto normalisedPath = Platform::StrDecompToPrecomp(gConfigGeneral.RCT1Path); ft = Formatter(); diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 9b2b894dee..d69c631a25 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1102,9 +1102,22 @@ static constexpr WindowParkAward _parkAwards[] = { } ft.Add(rideTypeString); } + else if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_BY) + { + ft.Add(gameState.ScenarioObjective.NumGuests); + ft.Add(DateGetTotalMonths(MONTH_OCTOBER, gameState.ScenarioObjective.Year)); + } + else if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) + { + ft.Add(gameState.ScenarioObjective.NumGuests); + } + else if (gameState.ScenarioObjective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH) + { + ft.Add(gameState.ScenarioObjective.MinimumLength); + } else { - ft.Add(gameState.ScenarioObjective.NumGuests); + ft.Add(0); // Unused value by other objective messages ft.Add(DateGetTotalMonths(MONTH_OCTOBER, gameState.ScenarioObjective.Year)); if (gameState.ScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) ft.Add(gameState.ScenarioObjective.MinimumExcitement); diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 248d4765a6..48f94f0f16 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -2478,7 +2478,7 @@ enum : uint16_t STR_WINDOW_OBJECTIVE_MONTHLY_PROFIT = 3306, STR_WINDOW_OBJECTIVE_MINIMUM_LENGTH = 3307, STR_WINDOW_OBJECTIVE_EXCITEMENT_RATING = 3308, - STR_WINDOW_COLOUR_2_COMMA16 = 3309, + STR_WINDOW_COLOUR_2_COMMA32 = 3309, STR_WINDOW_COLOUR_2_LENGTH = 3310, STR_WINDOW_COLOUR_2_COMMA2DP32 = 3311, STR_WINDOW_PRESERVATION_ORDER = 3312, From 8a6de886be7a92984f1461068660ed408e0682d0 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Thu, 14 Mar 2024 21:16:33 +0000 Subject: [PATCH 072/191] Move awards to GameState_t (#21601) --- src/openrct2-ui/windows/Park.cpp | 6 ++++-- src/openrct2/GameState.h | 3 +++ src/openrct2/management/Award.cpp | 24 +++++++++--------------- src/openrct2/management/Award.h | 2 -- src/openrct2/park/ParkFile.cpp | 7 ++++--- src/openrct2/rct1/S4Importer.cpp | 4 ++-- src/openrct2/rct2/S6Importer.cpp | 4 ++-- src/openrct2/world/Park.cpp | 2 +- 8 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index d69c631a25..28392fbac8 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1183,7 +1183,9 @@ static constexpr WindowParkAward _parkAwards[] = { auto screenCoords = windowPos + ScreenCoordsXY{ widgets[WIDX_PAGE_BACKGROUND].left + 4, widgets[WIDX_PAGE_BACKGROUND].top + 4 }; - for (const auto& award : GetAwards()) + auto& currentAwards = OpenRCT2::GetGameState().CurrentAwards; + + for (const auto& award : currentAwards) { GfxDrawSprite(dpi, ImageId(_parkAwards[EnumValue(award.Type)].sprite), screenCoords); DrawTextWrapped(dpi, screenCoords + ScreenCoordsXY{ 34, 6 }, 180, _parkAwards[EnumValue(award.Type)].text); @@ -1191,7 +1193,7 @@ static constexpr WindowParkAward _parkAwards[] = { screenCoords.y += 32; } - if (GetAwards().empty()) + if (currentAwards.empty()) DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ 6, 6 }, STR_NO_RECENT_AWARDS); } #pragma endregion diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index f69913c9a3..ee9a81fb7c 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -14,6 +14,7 @@ #include "Editor.h" #include "Limits.h" #include "interface/ZoomLevel.h" +#include "management/Award.h" #include "management/Finance.h" #include "management/NewsItem.h" #include "ride/Ride.h" @@ -130,6 +131,8 @@ namespace OpenRCT2 ObjectEntryIndex LastEntranceStyle; + std::vector CurrentAwards; + /** * Probability out of 65535, of gaining a new guest per game tick. * new guests per second = 40 * (probability / 65535) diff --git a/src/openrct2/management/Award.cpp b/src/openrct2/management/Award.cpp index 47053fd241..146fe49403 100644 --- a/src/openrct2/management/Award.cpp +++ b/src/openrct2/management/Award.cpp @@ -69,13 +69,6 @@ static constexpr StringId AwardNewsStrings[] = { STR_NEWS_ITEM_BEST_GENTLE_RIDES, }; -static std::vector _currentAwards; - -std::vector& GetAwards() -{ - return _currentAwards; -} - bool AwardIsPositive(AwardType type) { return AwardPositiveMap[EnumValue(type)]; @@ -602,7 +595,7 @@ static bool AwardIsDeserved(AwardType awardType, int32_t activeAwardTypes) void AwardReset() { - _currentAwards.clear(); + GetGameState().CurrentAwards.clear(); } /** @@ -613,17 +606,18 @@ void AwardUpdateAll() { PROFILED_FUNCTION(); + auto& currentAwards = GetGameState().CurrentAwards; // Decrease award times - for (auto& award : _currentAwards) + for (auto& award : currentAwards) { --award.Time; } // Remove any 0 time awards auto res = std::remove_if( - std::begin(_currentAwards), std::end(_currentAwards), [](const Award& award) { return award.Time == 0; }); - if (res != std::end(_currentAwards)) + std::begin(currentAwards), std::end(currentAwards), [](const Award& award) { return award.Time == 0; }); + if (res != std::end(currentAwards)) { - _currentAwards.erase(res, std::end(_currentAwards)); + currentAwards.erase(res, std::end(currentAwards)); WindowInvalidateByClass(WindowClass::ParkInformation); } @@ -632,13 +626,13 @@ void AwardUpdateAll() { // Set active award types as flags int32_t activeAwardTypes = 0; - for (auto& award : _currentAwards) + for (auto& award : currentAwards) { activeAwardTypes |= (1 << EnumValue(award.Type)); } // Check if there was a free award entry - if (_currentAwards.size() < OpenRCT2::Limits::MaxAwards) + if (currentAwards.size() < OpenRCT2::Limits::MaxAwards) { // Get a random award type not already active AwardType awardType; @@ -651,7 +645,7 @@ void AwardUpdateAll() if (AwardIsDeserved(awardType, activeAwardTypes)) { // Add award - _currentAwards.push_back(Award{ 5u, awardType }); + currentAwards.push_back(Award{ 5u, awardType }); if (gConfigNotifications.ParkAward) { News::AddItemToQueue(News::ItemType::Award, AwardNewsStrings[EnumValue(awardType)], 0, {}); diff --git a/src/openrct2/management/Award.h b/src/openrct2/management/Award.h index 0700cb8804..e73e3de6d9 100644 --- a/src/openrct2/management/Award.h +++ b/src/openrct2/management/Award.h @@ -42,8 +42,6 @@ struct Award AwardType Type; }; -std::vector& GetAwards(); - bool AwardIsPositive(AwardType type); void AwardReset(); void AwardUpdateAll(); diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 27e09b9a13..89e7e0c500 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -862,15 +862,16 @@ namespace OpenRCT2 }); // Awards + auto& currentAwards = gameState.CurrentAwards; if (version <= 6) { Award awards[RCT2::Limits::MaxAwards]{}; - cs.ReadWriteArray(awards, [&cs](Award& award) { + cs.ReadWriteArray(awards, [&cs, ¤tAwards](Award& award) { if (award.Time != 0) { cs.ReadWrite(award.Time); cs.ReadWrite(award.Type); - GetAwards().push_back(award); + currentAwards.push_back(award); return true; } @@ -879,7 +880,7 @@ namespace OpenRCT2 } else { - cs.ReadWriteVector(GetAwards(), [&cs](Award& award) { + cs.ReadWriteVector(currentAwards, [&cs](Award& award) { cs.ReadWrite(award.Time); cs.ReadWrite(award.Type); }); diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index ac2758f4f5..be2f25b2f5 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2162,12 +2162,12 @@ namespace RCT1 } // Awards - auto& awards = GetAwards(); + auto& currentAwards = gameState.CurrentAwards; for (auto& src : _s4.Awards) { if (src.Time != 0) { - awards.push_back(Award{ src.Time, static_cast(src.Type) }); + currentAwards.push_back(Award{ src.Time, static_cast(src.Type) }); } } diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 10631bb15a..72a5ce98f1 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -378,12 +378,12 @@ namespace RCT2 std::memcpy(gameState.PeepWarningThrottle, _s6.PeepWarningThrottle, sizeof(_s6.PeepWarningThrottle)); // Awards - auto& awards = GetAwards(); + auto& currentAwards = gameState.CurrentAwards; for (auto& src : _s6.Awards) { if (src.Time != 0) { - awards.push_back(Award{ src.Time, static_cast(src.Type) }); + currentAwards.push_back(Award{ src.Time, static_cast(src.Type) }); } } diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 5ed5f11495..540b8b7705 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -617,7 +617,7 @@ uint32_t Park::CalculateGuestGenerationProbability() const } // Reward or penalties for park awards - for (const auto& award : GetAwards()) + for (const auto& award : GetGameState().CurrentAwards) { // +/- 0.25% of the probability if (AwardIsPositive(award.Type)) From d2e7d57104f506d4066afe111fee969d4b081199 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 14 Mar 2024 22:34:54 +0100 Subject: [PATCH 073/191] Close #21536: Replace ATOMIC_VAR_INIT() macro with constructor --- src/openrct2/core/FileIndex.hpp | 2 +- src/openrct2/network/Socket.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/core/FileIndex.hpp b/src/openrct2/core/FileIndex.hpp index 61acb843d4..18c9256a8d 100644 --- a/src/openrct2/core/FileIndex.hpp +++ b/src/openrct2/core/FileIndex.hpp @@ -206,7 +206,7 @@ private: size_t stepSize = 100; // Handpicked, seems to work well with 4/8 cores. - std::atomic processed = ATOMIC_VAR_INIT(0); + std::atomic processed{ 0 }; auto reportProgress = [&]() { const size_t completed = processed; diff --git a/src/openrct2/network/Socket.cpp b/src/openrct2/network/Socket.cpp index 55fb2cc8fd..38e53ea275 100644 --- a/src/openrct2/network/Socket.cpp +++ b/src/openrct2/network/Socket.cpp @@ -248,7 +248,7 @@ private: class TcpSocket final : public ITcpSocket, protected Socket { private: - std::atomic _status = ATOMIC_VAR_INIT(SocketStatus::Closed); + std::atomic _status{ SocketStatus::Closed }; uint16_t _listeningPort = 0; SOCKET _socket = INVALID_SOCKET; From 0968d876688f45d32c9460b34fc0b1448fd687e7 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Thu, 14 Mar 2024 22:43:51 +0100 Subject: [PATCH 074/191] Use non-breaking spaces around currency units --- distribution/changelog.txt | 1 + src/openrct2/localisation/Currency.cpp | 36 +++++++++++++------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 83ccc8b54b..15f587b757 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.10 (in development) ------------------------------------------------------------------------ - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. +- Improved: [#21599] Currency signs now use non-breaking spaces. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#21434] Number of guests overflows in objective text. diff --git a/src/openrct2/localisation/Currency.cpp b/src/openrct2/localisation/Currency.cpp index 9d3d725a55..88d0560d9b 100644 --- a/src/openrct2/localisation/Currency.cpp +++ b/src/openrct2/localisation/Currency.cpp @@ -15,24 +15,24 @@ // clang-format off CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)] = { - { "GBP", 10, CurrencyAffix::Prefix, "\xC2\xA3", CurrencyAffix::Suffix, "GBP", STR_POUNDS }, // British Pound - { "USD", 10, CurrencyAffix::Prefix, "$", CurrencyAffix::Prefix, "$", STR_DOLLARS }, // US Dollar - { "FRF", 10, CurrencyAffix::Suffix, "F", CurrencyAffix::Suffix, "F", STR_FRANC }, // French Franc - { "DEM", 10, CurrencyAffix::Prefix, "DM", CurrencyAffix::Prefix, "DM", STR_DEUTSCHE_MARK }, // Deutsche Mark - { "JPY", 1000, CurrencyAffix::Prefix, "\xC2\xA5", CurrencyAffix::Suffix, "YEN", STR_YEN }, // Japanese Yen - { "ESP", 10, CurrencyAffix::Suffix, "Pts", CurrencyAffix::Suffix, "Pts", STR_PESETA }, // Spanish Peseta - { "ITL", 1000, CurrencyAffix::Prefix, "L", CurrencyAffix::Prefix, "L", STR_LIRA }, // Italian Lira - { "NLG", 10, CurrencyAffix::Prefix, "\xC6\x92 ", CurrencyAffix::Prefix, "fl.", STR_GUILDERS }, // Dutch Guilder - { "SEK", 100, CurrencyAffix::Suffix, " kr", CurrencyAffix::Suffix, " kr", STR_KRONA }, // Swedish Krona - { "EUR", 10, CurrencyAffix::Prefix, "\xE2\x82\xAC", CurrencyAffix::Suffix, "EUR", STR_EUROS }, // Euro - { "KRW", 10000, CurrencyAffix::Prefix, "\xE2\x82\xA9", CurrencyAffix::Prefix, "W", STR_WON }, // South Korean Won - { "RUB", 1000, CurrencyAffix::Suffix, "\xE2\x82\xBD", CurrencyAffix::Prefix, "R ", STR_ROUBLE }, // Russian Rouble - { "CZK", 100, CurrencyAffix::Suffix, " K\xC4\x8D", CurrencyAffix::Suffix, " Kc", STR_CZECH_KORUNA }, // Czech koruna - { "HKD", 100, CurrencyAffix::Prefix, "$", CurrencyAffix::Prefix, "HKD", STR_HONG_KONG_DOLLAR}, // Hong Kong Dollar - { "TWD", 1000, CurrencyAffix::Prefix, "NT$", CurrencyAffix::Prefix, "NT$", STR_NEW_TAIWAN_DOLLAR}, // New Taiwan Dollar - { "CNY", 100, CurrencyAffix::Prefix, "CN\xC2\xA5", CurrencyAffix::Prefix, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan - { "HUF", 1000, CurrencyAffix::Suffix, " Ft", CurrencyAffix::Suffix, " Ft", STR_HUNGARIAN_FORINT}, // Hungarian Forint - { "CTM", 10, CurrencyAffix::Prefix, "Ctm", CurrencyAffix::Prefix, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency + { "GBP", 10, CurrencyAffix::Prefix, u8"£", CurrencyAffix::Suffix, "GBP", STR_POUNDS }, // British Pound + { "USD", 10, CurrencyAffix::Prefix, u8"$", CurrencyAffix::Prefix, "$", STR_DOLLARS }, // US Dollar + { "FRF", 10, CurrencyAffix::Suffix, u8"F", CurrencyAffix::Suffix, "F", STR_FRANC }, // French Franc + { "DEM", 10, CurrencyAffix::Prefix, u8"DM", CurrencyAffix::Prefix, "DM", STR_DEUTSCHE_MARK }, // Deutsche Mark + { "JPY", 1000, CurrencyAffix::Prefix, u8"¥", CurrencyAffix::Suffix, "YEN", STR_YEN }, // Japanese Yen + { "ESP", 10, CurrencyAffix::Suffix, u8"Pts", CurrencyAffix::Suffix, "Pts", STR_PESETA }, // Spanish Peseta + { "ITL", 1000, CurrencyAffix::Prefix, u8"L", CurrencyAffix::Prefix, "L", STR_LIRA }, // Italian Lira + { "NLG", 10, CurrencyAffix::Prefix, u8"ƒ ", CurrencyAffix::Prefix, "fl.", STR_GUILDERS }, // Dutch Guilder + { "SEK", 100, CurrencyAffix::Suffix, u8" kr", CurrencyAffix::Suffix, " kr", STR_KRONA }, // Swedish Krona + { "EUR", 10, CurrencyAffix::Prefix, u8"€", CurrencyAffix::Suffix, "EUR", STR_EUROS }, // Euro + { "KRW", 10000, CurrencyAffix::Prefix, u8"₩", CurrencyAffix::Prefix, "W", STR_WON }, // South Korean Won + { "RUB", 1000, CurrencyAffix::Suffix, u8"₽", CurrencyAffix::Prefix, "R ", STR_ROUBLE }, // Russian Rouble + { "CZK", 100, CurrencyAffix::Suffix, u8" Kč", CurrencyAffix::Suffix, " Kc", STR_CZECH_KORUNA }, // Czech koruna + { "HKD", 100, CurrencyAffix::Prefix, u8"$", CurrencyAffix::Prefix, "HKD", STR_HONG_KONG_DOLLAR}, // Hong Kong Dollar + { "TWD", 1000, CurrencyAffix::Prefix, u8"NT$", CurrencyAffix::Prefix, "NT$", STR_NEW_TAIWAN_DOLLAR}, // New Taiwan Dollar + { "CNY", 100, CurrencyAffix::Prefix, u8"CN¥", CurrencyAffix::Prefix, "CNY", STR_CHINESE_YUAN }, // Chinese Yuan + { "HUF", 1000, CurrencyAffix::Suffix, u8" Ft", CurrencyAffix::Suffix, " Ft", STR_HUNGARIAN_FORINT}, // Hungarian Forint + { "CTM", 10, CurrencyAffix::Prefix, u8"Ctm", CurrencyAffix::Prefix, "Ctm", STR_CUSTOM_CURRENCY }, // Customizable currency }; // clang-format on From 2181f1b09ebc2b211fb3ff824573242a8804ce8a Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 15 Mar 2024 00:22:18 +0100 Subject: [PATCH 075/191] Part of #21193: move entities to GameState_t --- src/openrct2/GameState.h | 1 + src/openrct2/entity/EntityRegistry.cpp | 22 ++++++++-------------- src/openrct2/entity/EntityRegistry.h | 13 +++++++++++++ 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index ee9a81fb7c..eeda3497c0 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -95,6 +95,7 @@ namespace OpenRCT2 std::string ScenarioCompletedBy; std::vector Banners; + Entity_t Entities[MAX_ENTITIES]{}; // Ride storage for all the rides in the park, rides with RideId::Null are considered free. std::array Rides{}; ::RideRatingUpdateStates RideRatingUpdateStates; diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 9737faef72..47f50f8afe 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -10,6 +10,7 @@ #include "EntityRegistry.h" #include "../Game.h" +#include "../GameState.h" #include "../core/Algorithm.hpp" #include "../core/ChecksumStream.h" #include "../core/Crypt.h" @@ -36,17 +37,8 @@ #include #include -union Entity -{ - uint8_t Pad00[0x200]; - EntityBase base; - Entity() - : Pad00() - { - } -}; +using namespace OpenRCT2; -static Entity _entities[MAX_ENTITIES]{}; static std::array, EnumValue(EntityType::Count)> gEntityLists; static std::vector _freeIdList; @@ -120,8 +112,9 @@ std::string EntitiesChecksum::ToString() const EntityBase* TryGetEntity(EntityId entityIndex) { + auto& gameState = GetGameState(); const auto idx = entityIndex.ToUnderlying(); - return idx >= MAX_ENTITIES ? nullptr : &_entities[idx].base; + return idx >= MAX_ENTITIES ? nullptr : &gameState.Entities[idx].base; } EntityBase* GetEntity(EntityId entityIndex) @@ -182,7 +175,8 @@ void ResetAllEntities() FreeEntity(*spr); } - std::fill(std::begin(_entities), std::end(_entities), Entity()); + auto& gameState = GetGameState(); + 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) @@ -266,8 +260,8 @@ static void EntityReset(EntityBase* entity) auto entityIndex = entity->Id; _entityFlashingList[entityIndex.ToUnderlying()] = false; - Entity* spr = reinterpret_cast(entity); - *spr = Entity(); + Entity_t* tempEntity = reinterpret_cast(entity); + *tempEntity = Entity_t(); entity->Id = entityIndex; entity->Type = EntityType::Null; diff --git a/src/openrct2/entity/EntityRegistry.h b/src/openrct2/entity/EntityRegistry.h index af5477c334..e17c08be8f 100644 --- a/src/openrct2/entity/EntityRegistry.h +++ b/src/openrct2/entity/EntityRegistry.h @@ -14,6 +14,19 @@ #include +namespace OpenRCT2 +{ + union Entity_t + { + uint8_t Pad00[0x200]; + EntityBase base; + Entity_t() + : Pad00() + { + } + }; +} // namespace OpenRCT2 + constexpr uint16_t MAX_ENTITIES = 65535; EntityBase* GetEntity(EntityId sprite_idx); From c858b3a8c1917e0624daf2128d5591555c189903 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Fri, 15 Mar 2024 04:02:01 +0000 Subject: [PATCH 076/191] Merge Localisation/master into OpenRCT2/develop --- data/language/ar-EG.txt | 6 +++--- data/language/ca-ES.txt | 6 +++--- data/language/cs-CZ.txt | 6 +++--- data/language/da-DK.txt | 6 +++--- data/language/de-DE.txt | 6 +++--- data/language/eo-ZZ.txt | 6 +++--- data/language/es-ES.txt | 6 +++--- data/language/fi-FI.txt | 6 +++--- data/language/fr-FR.txt | 6 +++--- data/language/hu-HU.txt | 6 +++--- data/language/it-IT.txt | 6 +++--- data/language/ja-JP.txt | 6 +++--- data/language/ko-KR.txt | 6 +++--- data/language/nb-NO.txt | 6 +++--- data/language/nl-NL.txt | 6 +++--- data/language/pl-PL.txt | 6 +++--- data/language/pt-BR.txt | 6 +++--- data/language/ru-RU.txt | 6 +++--- data/language/sv-SE.txt | 6 +++--- data/language/tr-TR.txt | 6 +++--- data/language/uk-UA.txt | 38 ++++++++++++++++++++++++++++++++++---- data/language/vi-VN.txt | 6 +++--- data/language/zh-CN.txt | 6 +++--- data/language/zh-TW.txt | 6 +++--- 24 files changed, 103 insertions(+), 73 deletions(-) diff --git a/data/language/ar-EG.txt b/data/language/ar-EG.txt index bf23259e13..44c718effe 100644 --- a/data/language/ar-EG.txt +++ b/data/language/ar-EG.txt @@ -1740,12 +1740,12 @@ STR_2382 :Land STR_2383 :Water STR_2384 :{WINDOW_COLOUR_2}Your objective: STR_2385 :{BLACK}None -STR_2386 :{BLACK}To have at least {COMMA16} guests in your park at the end of {MONTHYEAR}, with a park rating of at least 600 +STR_2386 :{BLACK}To have at least {COMMA32} guests in your park at the end of {MONTHYEAR}, with a park rating of at least 600 STR_2387 :{BLACK}To achieve a park value of at least {POP16}{POP16}{CURRENCY} at the end of {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Have Fun! STR_2389 :{BLACK}Build the best {STRINGID} you can! STR_2390 :{BLACK}To have 10 different types of roller coasters operating in your park, each with an excitement value of at least 6.00 -STR_2391 :{BLACK}To have at least {COMMA16} guests in your park. You must not let the park rating drop below 700 at any time! +STR_2391 :{BLACK}To have at least {COMMA32} guests in your park. You must not let the park rating drop below 700 at any time! STR_2392 :{BLACK}To achieve a monthly income from ride tickets of at least {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}To have 10 different types of roller coasters operating in your park, each with a minimum length of {LENGTH}, and an excitement rating of at least 7.00 STR_2394 :{BLACK}To finish building all 5 of the partially built roller coasters in this park, designing them to achieve excitement ratings of at least {POP16}{POP16}{COMMA2DP32} each @@ -2326,7 +2326,7 @@ STR_3305 :{WINDOW_COLOUR_2}Monthly income: STR_3306 :{WINDOW_COLOUR_2}Monthly profit: STR_3307 :{WINDOW_COLOUR_2}Minimum length: STR_3308 :{WINDOW_COLOUR_2}Excitement rating: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Rides/attractions under a preservation order: diff --git a/data/language/ca-ES.txt b/data/language/ca-ES.txt index df413d0cc0..8aec349c7e 100644 --- a/data/language/ca-ES.txt +++ b/data/language/ca-ES.txt @@ -1740,12 +1740,12 @@ STR_2382 :Terra STR_2383 :Aigua STR_2384 :{WINDOW_COLOUR_2}El vostre objectiu: STR_2385 :{BLACK}Cap -STR_2386 :{BLACK}Tenir almenys {COMMA16} visitants al parc al final de {MONTHYEAR}, amb una valoració del parc d’almenys 600. +STR_2386 :{BLACK}Tenir almenys {COMMA32} visitants al parc al final de {MONTHYEAR}, amb una valoració del parc d’almenys 600. STR_2387 :{BLACK}Aconseguir una valoració del parc d’almenys {POP16}{POP16}{CURRENCY} al final de {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR}. STR_2388 :{BLACK}Divertiu-vos! STR_2389 :{BLACK}Construïu el millor {STRINGID} que pugueu! STR_2390 :{BLACK}Tenir 10 tipus diferents de muntanyes russes operant al parc, cadascuna d’elles amb un valor d’emoció d’almenys 6,00. -STR_2391 :{BLACK}Tenir almenys {COMMA16} visitants al parc. No podeu deixar que la valoració del parc caigui per sota de 700 en cap moment! +STR_2391 :{BLACK}Tenir almenys {COMMA32} visitants al parc. No podeu deixar que la valoració del parc caigui per sota de 700 en cap moment! STR_2392 :{BLACK}Aconseguir uns ingressos mensuals amb les entrades d’atraccions d’almenys {POP16}{POP16}{CURRENCY}. STR_2393 :{BLACK}Tenir 10 tipus diferents de muntanyes russes operant al parc, cadascuna amb una longitud mínima de {LENGTH} i un valor d’emoció d’almenys 7,00. STR_2394 :{BLACK}Acabar de construir les cinc muntanyes russes que s’havien començat a construir al parc, dissenyant-les per a aconseguir un nivell d’emoció d’almenys {POP16}{POP16}{COMMA2DP32} per cada una d’elles. @@ -2326,7 +2326,7 @@ STR_3305 :{WINDOW_COLOUR_2}Ingressos mensuals: STR_3306 :{WINDOW_COLOUR_2}Beneficis mensuals: STR_3307 :{WINDOW_COLOUR_2}Longitud mínima: STR_3308 :{WINDOW_COLOUR_2}Nivell d’emoció: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Atraccions protegides: diff --git a/data/language/cs-CZ.txt b/data/language/cs-CZ.txt index b85810866e..6028999ee5 100644 --- a/data/language/cs-CZ.txt +++ b/data/language/cs-CZ.txt @@ -1742,12 +1742,12 @@ STR_2382 :Země STR_2383 :Vodní plochy STR_2384 :{WINDOW_COLOUR_2}Cíl scénáře: STR_2385 :{BLACK}žádný -STR_2386 :{BLACK}Mít v parku alespoň {COMMA16} návštěvníků na konci {MONTHYEAR}, s hodnocením parku alespoň 600 +STR_2386 :{BLACK}Mít v parku alespoň {COMMA32} návštěvníků na konci {MONTHYEAR}, s hodnocením parku alespoň 600 STR_2387 :{BLACK}Dosáhnout hodnoty parku alespoň {POP16}{POP16}{CURRENCY} na konci {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Příjemnou zábavu! STR_2389 :{BLACK}Postav ten nejlepší {STRINGID}! STR_2390 :{BLACK}Mít v parku 10 druhů kolotočů v provozu, každý s hodnotou zábavnosti alespoň 6.00 -STR_2391 :{BLACK}Mít v parku alespoň {COMMA16} návštěvníků a zároveň nikdy nenechat hodnocení parku spadnout pod 700! +STR_2391 :{BLACK}Mít v parku alespoň {COMMA32} návštěvníků a zároveň nikdy nenechat hodnocení parku spadnout pod 700! STR_2392 :{BLACK}Dosáhnout měsíčního příjmu z lístků na atrakce alespoň {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}{BLACK}Mít v parku 10 druhů kolotočů v provozu, každý s hodnotou zábavnosti alespoň 7.00 a délkou alespoň {LENGHT} STR_2394 :{BLACK}Dokončit všech 5 rozestavěných horských drah tak, aby každá dosahovala hodnocení vzrušení alespoň {POP16}{POP16}{COMMA2DP32} @@ -2328,7 +2328,7 @@ STR_3305 :{WINDOW_COLOUR_2}Měsíční příjem: STR_3306 :{WINDOW_COLOUR_2}Měsíční zisk: STR_3307 :{WINDOW_COLOUR_2}Minimální délka: STR_3308 :{WINDOW_COLOUR_2}Nadšení: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Atrakce, které je nutno zachovat: diff --git a/data/language/da-DK.txt b/data/language/da-DK.txt index ad640a48f3..77bf3f5baf 100644 --- a/data/language/da-DK.txt +++ b/data/language/da-DK.txt @@ -1737,12 +1737,12 @@ STR_2382 :Land STR_2383 :Vand STR_2384 :{WINDOW_COLOUR_2}Dit mål: STR_2385 :{BLACK}Ingen -STR_2386 :{BLACK}At have mindst {COMMA16} gæster i parken, ved udgangen af {MONTHYEAR}, og med en park vurdering på mindst 600 +STR_2386 :{BLACK}At have mindst {COMMA32} gæster i parken, ved udgangen af {MONTHYEAR}, og med en park vurdering på mindst 600 STR_2387 :{BLACK}At opnå en Parkværdi på mindst {POP16}{POP16}{CURRENCY} ved udgangen af {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Hav det sjovt! STR_2389 :{BLACK}Byg den bedste {STRINGID} du kan! STR_2390 :{BLACK}At have 10 forskellige typer rutschebaner i gang i parken på samme tid, Hver med en spændings vurdering over 6.00 -STR_2391 :{BLACK}At have mindst {COMMA16} gæster i parken. Du må ikke lade park vurderingen flade under 700 på noget tidspunkt! +STR_2391 :{BLACK}At have mindst {COMMA32} gæster i parken. Du må ikke lade park vurderingen flade under 700 på noget tidspunkt! STR_2392 :{BLACK}At opnå en månedlig indkomst fra forlystelser på mindst {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}At have 10 forskellige typer rutschebaner i gang i parken på samme tid, hver med en minimums længde på {LENGTH}, og en spændings vurdering på mindst 7.00 STR_2394 :{BLACK}At færdiggøre alle 5 af de delvist færdige byggede rutschebaner i denne park, design dem til at have at opnå en spændings vurdering på mindst {POP16}{POP16}{COMMA2DP32} hver @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Månedsinkomst: STR_3306 :{WINDOW_COLOUR_2}Månedsprofit: STR_3307 :{WINDOW_COLOUR_2}Minimum længde: STR_3308 :{WINDOW_COLOUR_2}Spændings vurdering: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}forlystelser/attraktioner under bevaringsordre: diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index dd66892156..5a2359882c 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -1738,12 +1738,12 @@ STR_2382 :Land STR_2383 :Wasser STR_2384 :{WINDOW_COLOUR_2}Ihr Ziel: STR_2385 :{BLACK}Keins -STR_2386 :{BLACK}Mindestens {COMMA16} Parkbesucher bis {MONTHYEAR} und eine Parkbewertung von mindestens 600 zu haben +STR_2386 :{BLACK}Mindestens {COMMA32} Parkbesucher bis {MONTHYEAR} und eine Parkbewertung von mindestens 600 zu haben STR_2387 :{BLACK}Einen Verkehrswert von mindestens {POP16}{POP16}{CURRENCY} zu erreichen bis {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Viel Spaß! STR_2389 :{BLACK}Bauen Sie Ihre(n) beste(n) {STRINGID}! STR_2390 :{BLACK}Mindestens 10 verschiedene Achterbahntypen in Ihrem Park zu betreiben, wobei jeder einen Nervenkitzelwert von mindestens 6,00 aufweisen muss -STR_2391 :{BLACK}Mindestens {COMMA16} Parkbesucher zu erreichen. Die Parkbewertung darf zu keinem Zeitpunkt unter 700 fallen! +STR_2391 :{BLACK}Mindestens {COMMA32} Parkbesucher zu erreichen. Die Parkbewertung darf zu keinem Zeitpunkt unter 700 fallen! STR_2392 :{BLACK}Monatliche Einkünfte durch Fahrttickets von mindestens {POP16}{POP16}{CURRENCY} zu erreichen STR_2393 :{BLACK}Mindestens 10 verschiedene Achterbahntypen in Ihrem Park zu betreiben, wobei jeder eine Mindestlänge von {LENGTH} und einen Nervenkitzelwert von mindestens 7,00 aufweisen muss STR_2394 :{BLACK}Alle 5 bereits teilweise gebauten Achterbahnen fertigzustellen, damit sie jeweils einen Nervenkitzelwert von {POP16}{POP16}{COMMA2DP32} erzielen @@ -2325,7 +2325,7 @@ STR_3305 :{WINDOW_COLOUR_2}Monatliche Einkünfte: STR_3306 :{WINDOW_COLOUR_2}Monatlicher Gewinn: STR_3307 :{WINDOW_COLOUR_2}Mindestlänge: STR_3308 :{WINDOW_COLOUR_2}Nervenkitzelwert: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Attraktionen unter Beibehaltungsauftrag: diff --git a/data/language/eo-ZZ.txt b/data/language/eo-ZZ.txt index 1ca70355c8..6aafd0d779 100644 --- a/data/language/eo-ZZ.txt +++ b/data/language/eo-ZZ.txt @@ -1737,12 +1737,12 @@ STR_2382 :Tero STR_2383 :Akvo STR_2384 :{WINDOW_COLOUR_2}Via celo: STR_2385 :{BLACK}Neniu -STR_2386 :{BLACK}Havi almenaŭ {COMMA16} gastojn en via parko al la fino de {MONTHYEAR}, kun pritakso de parko ne malpli ol 600 +STR_2386 :{BLACK}Havi almenaŭ {COMMA32} gastojn en via parko al la fino de {MONTHYEAR}, kun pritakso de parko ne malpli ol 600 STR_2387 :{BLACK}Atingi parkvaloron ne malpli ol {POP16}{POP16}{CURRENCY} al la fino de {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Amuzi Vin! STR_2389 :{BLACK}Konstrui je la plej bona {STRINGID}, kiun vi povas konstrui! STR_2390 :{BLACK}Havi 10 malsamajn tipojn de ondaj fervojoj funkciantajn en via parko, kiuj havas po pritakson de eksciteco ne malpli ol 6.00 -STR_2391 :{BLACK}Havi almenaŭ {COMMA16} gastojn en via parko. Ankaŭ, necesas ke la pritakso de la parko neniam falu sub 700! +STR_2391 :{BLACK}Havi almenaŭ {COMMA32} gastojn en via parko. Ankaŭ, necesas ke la pritakso de la parko neniam falu sub 700! STR_2392 :{BLACK}Atingi enspezon monatan ne malpli ol {POP16}{POP16}{CURRENCY}, pro la vendado de biletoj de atrakcioj STR_2393 :{BLACK}Havi 10 malsamajn tipojn de ondaj fervojoj funkciantajn en via parko, kiuj havas po mimimuman longecon de {LENGTH} kaj pritakson de eksciteco ne malpli ol 7.00 STR_2394 :{BLACK}Fini la konstruadon de la tutaj 5 ondaj fervojoj konstruitaj parte. Desegni ilin, por atingi po pritakson de eksciteco ne malpli ol {POP16}{POP16}{COMMA2DP32} @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Enspezo monata: STR_3306 :{WINDOW_COLOUR_2}Profito monata: STR_3307 :{WINDOW_COLOUR_2}Minimuma longeco: STR_3308 :{WINDOW_COLOUR_2}Pritakso de eksciteco: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Atrakcioj, kiujn oni ne eblas ŝanĝi dum la scenaro: diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 4c55911e29..789053d6cc 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -1738,12 +1738,12 @@ STR_2382 :Tierra STR_2383 :Agua STR_2384 :{WINDOW_COLOUR_2}Tu objetivo: STR_2385 :{BLACK}Ninguno -STR_2386 :{BLACK}Tener al menos {COMMA16} visitantes en tu parque a finales de {MONTHYEAR}, con una valoración del parque de al menos 600 +STR_2386 :{BLACK}Tener al menos {COMMA32} visitantes en tu parque a finales de {MONTHYEAR}, con una valoración del parque de al menos 600 STR_2387 :{BLACK}Conseguir un valor del parque {POP16}{POP16}{CURRENCY} a final de {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}¡Diviértete! STR_2389 :{BLACK}¡Construye el mejor {STRINGID} que puedas! STR_2390 :{BLACK}Tener al menos 10 tipos de montañas rusas distintas operando en el parque, cada una con un valor de emoción de al menos 6.00 -STR_2391 :{BLACK}Tener al menos {COMMA16} visitantes en tu parque. ¡No dejes que la valoración baje de 700 en ningún momento! +STR_2391 :{BLACK}Tener al menos {COMMA32} visitantes en tu parque. ¡No dejes que la valoración baje de 700 en ningún momento! STR_2392 :{BLACK}Conseguir unos ingresos mensuales por venta de entradas a atracciones de al menos {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Tener al menos 10 tipos de montañas rusas distintas operando en el parque, cada una con una longitud mínima de {LENGTH}, y un valor de emoción de al menos 7.00 STR_2394 :{BLACK}Terminar de construir 5 de las montañas rusas no terminadas en este parque, diseñándolas de modo que tengan un valor de emoción de al menos {POP16}{POP16}{COMMA2DP32} cada una @@ -2324,7 +2324,7 @@ STR_3305 :{WINDOW_COLOUR_2}Ingreso mensual: STR_3306 :{WINDOW_COLOUR_2}Ganancia mensual: STR_3307 :{WINDOW_COLOUR_2}Longitud mínima: STR_3308 :{WINDOW_COLOUR_2}Rango Satisfacción: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Atracciones/Juegos con orden de preservación: diff --git a/data/language/fi-FI.txt b/data/language/fi-FI.txt index edcbdc6224..2d3fee1693 100644 --- a/data/language/fi-FI.txt +++ b/data/language/fi-FI.txt @@ -1743,12 +1743,12 @@ STR_2382 :Maa STR_2383 :Vesi STR_2384 :{WINDOW_COLOUR_2}Tavoitteesi: STR_2385 :{BLACK}Ei mitään -STR_2386 :{BLACK}Puistossasi tulee olla vähintään {COMMA16} kävijää {MONTHYEAR} loppuun mennessä, ja puiston tason tulee olla vähintään 600 +STR_2386 :{BLACK}Puistossasi tulee olla vähintään {COMMA32} kävijää {MONTHYEAR} loppuun mennessä, ja puiston tason tulee olla vähintään 600 STR_2387 :{BLACK}Saavuta puiston arvoksi vähintään {POP16}{POP16}{CURRENCY} {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} loppuun mennessä STR_2388 :{BLACK}Pidä hauskaa! STR_2389 :{BLACK}Rakenna niin hyvä {STRINGID} kuin voit! STR_2390 :{BLACK}Puistossasi tulee olla 10 eri tyyppistä toiminnassa olevaa vuoristorataa joiden huvitustaso on vähintään 6.00 -STR_2391 :{BLACK}Puistossasi tulee olla vähintään {COMMA16} kävijää, eikä puiston taso saa pudota hetkeksikään alle 700:n! +STR_2391 :{BLACK}Puistossasi tulee olla vähintään {COMMA32} kävijää, eikä puiston taso saa pudota hetkeksikään alle 700:n! STR_2392 :{BLACK}Sinun tulee ansaita {POP16}{POP16}{CURRENCY} kuukausituloja laitteiden lipputuloista STR_2393 :{BLACK}Puistossasi tulee olla 10 eri tyyppistä toiminnassa olevaa vuoristorataa, joiden pitää olla vähintään {LENGTH} pitkiä ja joiden huvitustaso on vähintään 7.00 STR_2394 :{BLACK}Viimeistele puiston 5 osittain rakennettua vuoristorataa niin, että jokaisen huvitustaso on vähintään {POP16}{POP16}{COMMA2DP32} @@ -2329,7 +2329,7 @@ STR_3305 :{WINDOW_COLOUR_2}Kuukausittainen tulo: STR_3306 :{WINDOW_COLOUR_2}Kuukausittainen tuotto: STR_3307 :{WINDOW_COLOUR_2}Vähimmäispituus: STR_3308 :{WINDOW_COLOUR_2}Huvitustaso: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Laitteet suojelumääräyksen alla: diff --git a/data/language/fr-FR.txt b/data/language/fr-FR.txt index d252cc5d4b..d207faa6c4 100644 --- a/data/language/fr-FR.txt +++ b/data/language/fr-FR.txt @@ -1744,12 +1744,12 @@ STR_2382 :Terrain STR_2383 :Eau STR_2384 :{WINDOW_COLOUR_2}Votre objectif : STR_2385 :{BLACK}Aucun -STR_2386 :{BLACK}Avoir au moins {COMMA16} visiteurs dans votre parc à la fin {MONTHYEAR}, avec une évaluation de parc d’au moins 600 +STR_2386 :{BLACK}Avoir au moins {COMMA32} visiteurs dans votre parc à la fin {MONTHYEAR}, avec une évaluation de parc d’au moins 600 STR_2387 :{BLACK}Atteindre une valeur de parc d’au moins {POP16}{POP16}{CURRENCY} à la fin {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Amusez-vous ! STR_2389 :{BLACK}Construisez la meilleure attraction {STRINGID} possible ! STR_2390 :{BLACK}Avoir construit au moins 10 montagnes russes différentes dans votre parc, chacune d’entre elles atteignant un indice d’engouement d’au moins 6.00 -STR_2391 :{BLACK}Avoir reçu au moins {COMMA16} visiteurs dans votre parc. L’évaluation du parc ne doit jamais descendre en dessous des 700 ! +STR_2391 :{BLACK}Avoir reçu au moins {COMMA32} visiteurs dans votre parc. L’évaluation du parc ne doit jamais descendre en dessous des 700 ! STR_2392 :{BLACK}Obtenir un revenu mensuel avec les tickets d’attraction d’au moins {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Avoir construit au moins 10 montagnes russes différentes dans votre parc, chacune d’entre elles atteignant une longueur d’au moins {LENGTH}, avec un indice d’engouement d’au moins 7.00 STR_2394 :{BLACK}Terminer la construction des 5 montagnes russes entamées dans ce parc, avec une conception leur permettant d’atteindre un indice d’engouement d’au moins {POP16}{POP16}{COMMA2DP32} chacune @@ -2330,7 +2330,7 @@ STR_3305 :{WINDOW_COLOUR_2}Revenu mensuel : STR_3306 :{WINDOW_COLOUR_2}Bénéfice mensuel : STR_3307 :{WINDOW_COLOUR_2}Longueur minimum : STR_3308 :{WINDOW_COLOUR_2}Indice d’engouement : -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Attractions protégées : diff --git a/data/language/hu-HU.txt b/data/language/hu-HU.txt index c912d8a2b4..073180f41c 100644 --- a/data/language/hu-HU.txt +++ b/data/language/hu-HU.txt @@ -1737,12 +1737,12 @@ STR_2382 :Föld STR_2383 :Víz STR_2384 :{WINDOW_COLOUR_2}A célod: STR_2385 :{BLACK}Nincs -STR_2386 :{BLACK}Legyen legalább {COMMA16} vendég a parkodban {MONTHYEAR}végére, a parkod értékelése pedig legyen legalább 600 +STR_2386 :{BLACK}Legyen legalább {COMMA32} vendég a parkodban {MONTHYEAR}végére, a parkod értékelése pedig legyen legalább 600 STR_2387 :{BLACK}Legyen legalább {POP16}{POP16}{CURRENCY} a parkod értéke {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR}végére STR_2388 :{BLACK}Érezd jól magad! STR_2389 :{BLACK}A lehető legjobb {STRINGID} építése! STR_2390 :{BLACK}Építs 10 különböző, egyenként legalább 6,00 izgalmi értékű hullámvasutat a parkodban -STR_2391 :{BLACK}Legyen legalább {COMMA16} vendég a parkodban. A park értékelése soha nem eshet 700 alá! +STR_2391 :{BLACK}Legyen legalább {COMMA32} vendég a parkodban. A park értékelése soha nem eshet 700 alá! STR_2392 :{BLACK}A játékok belépési díja utáni havi bevételed legyen legalább {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Működjön 10 különböző, egyenként legalább {LENGTH} hosszú hullámvasút a parkodban, amelyek izgalmi értéke legalább 7,00 STR_2394 :{BLACK}Fejezd be az 5 félkész hullámvasút építését, úgy, hogy mindegyik izgalmi értéke legalább {POP16}{POP16}{COMMA2DP32} legyen @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Havi bevétel: STR_3306 :{WINDOW_COLOUR_2}Havi nyereség: STR_3307 :{WINDOW_COLOUR_2}Minimum hosszúság: STR_3308 :{WINDOW_COLOUR_2}Izgalmi érték: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Műemlékvédelmi játékok/épületek: diff --git a/data/language/it-IT.txt b/data/language/it-IT.txt index fffc50513a..42d434a58e 100644 --- a/data/language/it-IT.txt +++ b/data/language/it-IT.txt @@ -1740,12 +1740,12 @@ STR_2382 :Terreno STR_2383 :Acqua STR_2384 :{WINDOW_COLOUR_2}Il tuo obiettivo: STR_2385 :{BLACK}Nessuno -STR_2386 :{BLACK}Avere almeno {COMMA16} visitatori nel parco entro la fine di {MONTHYEAR}, con una valutazione del parco di almeno 600 +STR_2386 :{BLACK}Avere almeno {COMMA32} visitatori nel parco entro la fine di {MONTHYEAR}, con una valutazione del parco di almeno 600 STR_2387 :{BLACK}Far raggiungere al parco un valore di almeno {POP16}{POP16}{CURRENCY} entro la fine di {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Divertirsi! STR_2389 :{BLACK}Costruire il migliore {STRINGID} si possa! STR_2390 :{BLACK}Avere 10 tipi diversi di ottovolante nel parco, ognuno con un livello di divertimento di almeno 6.00 -STR_2391 :{BLACK}Avere almeno {COMMA16} visitatori nel parco. E non devi mai avere una valutazione del parco inferiore a 700! +STR_2391 :{BLACK}Avere almeno {COMMA32} visitatori nel parco. E non devi mai avere una valutazione del parco inferiore a 700! STR_2392 :{BLACK}Incassare mensilmente tramite i biglietti delle attrazioni almeno {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Avere 10 tipi diversi di ottovolante nel parco, ognuno della lunghezza minima di {LENGTH} e un livello di divertimento di almeno 7.00 STR_2394 :{BLACK}Finire di costruire tutti e cinque gli ottovolanti parzialmente costruiti in questo parco, facendo loro raggiungere un livello di divertimento di almeno {POP16}{POP16}{COMMA2DP32} ciascuno @@ -2325,7 +2325,7 @@ STR_3305 :{WINDOW_COLOUR_2}Entrate mensili: STR_3306 :{WINDOW_COLOUR_2}Profitto mensile: STR_3307 :{WINDOW_COLOUR_2}Lunghezza minima: STR_3308 :{WINDOW_COLOUR_2}Liv. divertimento: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Attrazioni sotto ordine di protezione: diff --git a/data/language/ja-JP.txt b/data/language/ja-JP.txt index 89e0647747..ee841f3986 100644 --- a/data/language/ja-JP.txt +++ b/data/language/ja-JP.txt @@ -1729,12 +1729,12 @@ STR_2382 :地形 STR_2383 :水 STR_2384 :{WINDOW_COLOUR_2}あなたの目標: STR_2385 :{BLACK}なし -STR_2386 :{BLACK}{POP16}{MONTHYEAR}の終わりに、 パークの内に{PUSH16}{PUSH16}{COMMA16}以上人の来客し、600以上のパーク評価値を取得する必要があります。 +STR_2386 :{BLACK}{POP16}{MONTHYEAR}の終わりに、 パークの内に{PUSH16}{PUSH16}{COMMA32}以上人の来客し、600以上のパーク評価値を取得する必要があります。 STR_2387 :{BLACK}{POP16}{MONTHYEAR}の終わりに、 {CURRENCY}以上のパーク評価額を取得する必要があります。 STR_2388 :{BLACK}楽しんで下さい! STR_2389 :{BLACK}最高の{STRINGID}を建設してください! STR_2390 :{BLACK}パークで10タイプのジェットコースターを稼働させるには、それぞれ少なくとも6.00以上の興奮度が必要です。 -STR_2391 :{BLACK}パークに少なくとも{COMMA16}ゲストを入れてを取得する必要があります。パークの評価額がいつでも700以下にならないようにしてはいけません! +STR_2391 :{BLACK}パークに少なくとも{COMMA32}ゲストを入れてを取得する必要があります。パークの評価額がいつでも700以下にならないようにしてはいけません! STR_2392 :{BLACK}ライドの月次総収入の{POP16}{POP16}{CURRENCY}を取得する必要があります。 STR_2393 :{BLACK}パークで10タイプのジェットコースターを操作しますし、それぞれ所定の長さの{LENGTH}し, 7.00以上の興奮度が必要です。 STR_2394 :{BLACK}パークであるの5ジェットコースターの建設を仕上げますし、 それぞれ{POP16}{POP16}{COMMA2DP32}以上の興奮度が必要です。 @@ -2315,7 +2315,7 @@ STR_3305 :{WINDOW_COLOUR_2}月売上: STR_3306 :{WINDOW_COLOUR_2}月利益: STR_3307 :{WINDOW_COLOUR_2}最小長: STR_3308 :{WINDOW_COLOUR_2}興奮度: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}保全命令のライド: diff --git a/data/language/ko-KR.txt b/data/language/ko-KR.txt index 6d13e60581..97562400e1 100644 --- a/data/language/ko-KR.txt +++ b/data/language/ko-KR.txt @@ -1741,12 +1741,12 @@ STR_2382 :땅 STR_2383 :물 STR_2384 :{WINDOW_COLOUR_2}목표: STR_2385 :{BLACK}없음 -STR_2386 :{BLACK}공원에 최소 {COMMA16}명 이상의 손님을 {MONTHYEAR}까지 유치하고, 공원 등급을 600 이상으로 유지하세요 +STR_2386 :{BLACK}공원에 최소 {COMMA32}명 이상의 손님을 {MONTHYEAR}까지 유치하고, 공원 등급을 600 이상으로 유지하세요 STR_2387 :{BLACK}최소 {POP16}{POP16}{CURRENCY} 이상의 공원 가치를 {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR}까지 달성하세요 STR_2388 :{BLACK}즐기세요! STR_2389 :{BLACK}최고의 {STRINGID}(을)를 건설하세요! STR_2390 :{BLACK}흥미도가 최소 6.00을 넘는 10종의 다른 롤러코스터를 공원에 운용하세요 -STR_2391 :{BLACK}공원에 최소 {COMMA16}명 이상의 손님을 유치하세요. 단 한 순간이라도 공원 등급을 700 아래로 떨어뜨려서는 안 됩니다! +STR_2391 :{BLACK}공원에 최소 {COMMA32}명 이상의 손님을 유치하세요. 단 한 순간이라도 공원 등급을 700 아래로 떨어뜨려서는 안 됩니다! STR_2392 :{BLACK}놀이기구 탑승 수익만으로 월 수익을 최소 {POP16}{POP16}{CURRENCY} 이상 달성하세요 STR_2393 :{BLACK}최소 길이가 {LENGTH} 이상이고 흥미도가 최소 7.00을 넘는 10개의 다른 종류의 롤러코스터를 공원에 운용하세요 STR_2394 :{BLACK}이 공원에 미완성된 5대의 롤러코스터를 각각의 흥미도가 최소 {POP16}{POP16}{COMMA2DP32} 이상이 되도록 완성하세요 @@ -2327,7 +2327,7 @@ STR_3305 :{WINDOW_COLOUR_2}월 수익: STR_3306 :{WINDOW_COLOUR_2}월 순이익: STR_3307 :{WINDOW_COLOUR_2}최소 길이: STR_3308 :{WINDOW_COLOUR_2}흥미도: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}수정·파괴할 수 없는 놀이기구/시설: diff --git a/data/language/nb-NO.txt b/data/language/nb-NO.txt index da94496576..8190171007 100644 --- a/data/language/nb-NO.txt +++ b/data/language/nb-NO.txt @@ -1737,12 +1737,12 @@ STR_2382 :Land STR_2383 :Vann STR_2384 :{WINDOW_COLOUR_2}Ditt oppdrag: STR_2385 :{BLACK}Ingen -STR_2386 :{BLACK}Å ha minst {COMMA16} gjester i din park ved slutten av {MONTHYEAR}, med en parkvurdering på minst 600 +STR_2386 :{BLACK}Å ha minst {COMMA32} gjester i din park ved slutten av {MONTHYEAR}, med en parkvurdering på minst 600 STR_2387 :{BLACK}Å oppnå en parkverdi på minst {POP16}{POP16}{CURRENCY} ved slutten av {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Ha det Gøy! STR_2389 :{BLACK}Bygg den beste {STRINGID} du kan! STR_2390 :{BLACK}Å ha 10 forskjellige typer berg-og-dal-baner i drift i din park, hver med et spenningsnivå på minst 6.00 -STR_2391 :{BLACK}Å ha minst {COMMA16} gjester i din park. Du må ikke la parkvurderingen falle under 700 på noe tidspunkt! +STR_2391 :{BLACK}Å ha minst {COMMA32} gjester i din park. Du må ikke la parkvurderingen falle under 700 på noe tidspunkt! STR_2392 :{BLACK}Å oppnå en månedlig inntekt fra attraksjons-billetter på minst {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Å ha 10 forskjellige typer berg-og-dal-baner i drift i din park, hver med en minimumslengde på {LENGTH}, og med spenningsnivå på minst 7.00 STR_2394 :{BLACK}Å bygge ferdig alle 5 halvferdige berg-og-dal-baner i denne parken og designe hver av de for å oppnå spenningsnivå på minst {POP16}{POP16}{COMMA2DP32} @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Månedlig inntekt: STR_3306 :{WINDOW_COLOUR_2}Månedlig profitt: STR_3307 :{WINDOW_COLOUR_2}Minimum lengde: STR_3308 :{WINDOW_COLOUR_2}Spenningsnivå: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Attraksjoner som blir bevart: diff --git a/data/language/nl-NL.txt b/data/language/nl-NL.txt index 0e6433134c..b73fa5899a 100644 --- a/data/language/nl-NL.txt +++ b/data/language/nl-NL.txt @@ -1738,12 +1738,12 @@ STR_2382 :Land STR_2383 :Water STR_2384 :{WINDOW_COLOUR_2}Je doelstelling: STR_2385 :{BLACK}Geen -STR_2386 :{BLACK}Om ten minste {COMMA16} bezoekers in je park te hebben aan het einde van {MONTHYEAR}, met een parkwaardering van ten minste 600 +STR_2386 :{BLACK}Om ten minste {COMMA32} bezoekers in je park te hebben aan het einde van {MONTHYEAR}, met een parkwaardering van ten minste 600 STR_2387 :{BLACK}Om een parkwaarde van ten minste {POP16}{POP16}{CURRENCY} te hebben aan het einde van {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Om plezier te hebben! STR_2389 :{BLACK}Om de beste {STRINGID} te bouwen! STR_2390 :{BLACK}Om 10 verschillende typen achtbanen in je park te hebben, elk met een plezierwaarde van ten minste 6,00 -STR_2391 :{BLACK}Om ten minste {COMMA16} bezoekers in je park te hebben. Je parkwaardering mag geen moment onder de 700 komen! +STR_2391 :{BLACK}Om ten minste {COMMA32} bezoekers in je park te hebben. Je parkwaardering mag geen moment onder de 700 komen! STR_2392 :{BLACK}Om in één maand ten minste {POP16}{POP16}{CURRENCY} aan attractiekaartjes te verdienen STR_2393 :{BLACK}Om 10 verschillende typen achtbanen in je park te hebben, elk met een lengte van ten minste {LENGTH} en een plezierwaarde van ten minste 7,00 STR_2394 :{BLACK}Om alle 5 deels gebouwde achtbanen in je park af te maken, elk met een plezierwaarde van ten minste {POP16}{POP16}{COMMA2DP32} @@ -2322,7 +2322,7 @@ STR_3305 :{WINDOW_COLOUR_2}Maandelijkse inkomsten: STR_3306 :{WINDOW_COLOUR_2}Maandelijkse winst: STR_3307 :{WINDOW_COLOUR_2}Minimumlengte: STR_3308 :{WINDOW_COLOUR_2}Plezierwaarde: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Attracties met een monumentenstatus: diff --git a/data/language/pl-PL.txt b/data/language/pl-PL.txt index f412e273a8..31cd82bfce 100644 --- a/data/language/pl-PL.txt +++ b/data/language/pl-PL.txt @@ -1735,12 +1735,12 @@ STR_2382 :Teren STR_2383 :Woda STR_2384 :{WINDOW_COLOUR_2}Twój cel: STR_2385 :{BLACK}Brak -STR_2386 :{BLACK}Miej przynajmniej {COMMA16} gości w parku na koniec roku {MONTHYEAR} przy ocenie parku wynoszącej przynajmniej 600 +STR_2386 :{BLACK}Miej przynajmniej {COMMA32} gości w parku na koniec roku {MONTHYEAR} przy ocenie parku wynoszącej przynajmniej 600 STR_2387 :{BLACK}Uzyskaj wartość parku nie mniejszą niż {POP16}{POP16}{CURRENCY} na koniec {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Baw się dobrze! STR_2389 :{BLACK}Wybuduj tę atrakcję ({STRINGID}) najlepiej jak potrafisz! STR_2390 :{BLACK}Zbuduj w parku 10 różnych działających kolejek górskich, każda o współczynniku emocji wynoszącym przynajmniej 6.00 -STR_2391 :{BLACK}Miej przynajmniej {COMMA16} gości w swoim parku. Nie pozwól aby ocena parku spadła poniżej 700 nawet na chwilę! +STR_2391 :{BLACK}Miej przynajmniej {COMMA32} gości w swoim parku. Nie pozwól aby ocena parku spadła poniżej 700 nawet na chwilę! STR_2392 :{BLACK}Uzyskaj miesięczny przychód ze sprzedaży biletów na atrakcje w wysokości przynajmniej {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Zbuduj w parku 10 różnych działających kolejek górskich, każda o współczynniku emocji wynoszącym przynajmniej 7.00 i nie krótsza niż {LENGTH} STR_2394 :{BLACK}Dokończ budowę 5 częściowo już wybudowanych kolejek górskich, projektując je tak aby współczynnik emocji każdej z nich nie był mniejszy niż {POP16}{POP16}{COMMA2DP32} @@ -2321,7 +2321,7 @@ STR_3305 :{WINDOW_COLOUR_2}Miesięczny przychód: STR_3306 :{WINDOW_COLOUR_2}Miesięczny zysk: STR_3307 :{WINDOW_COLOUR_2}Minimalna długość: STR_3308 :{WINDOW_COLOUR_2}Wskaźnik emocji: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Przejażdżki/atrakcje według następującej kolejności: diff --git a/data/language/pt-BR.txt b/data/language/pt-BR.txt index a98e04eda5..e191ed56d9 100644 --- a/data/language/pt-BR.txt +++ b/data/language/pt-BR.txt @@ -1737,12 +1737,12 @@ STR_2382 :Terreno STR_2383 :Água STR_2384 :{WINDOW_COLOUR_2}Seu objetivo: STR_2385 :{BLACK}Nenhum -STR_2386 :{BLACK}Ter pelo menos {COMMA16} visitantes em seu parque até o fim de {MONTHYEAR}, com classificação de parque de pelo menos 600 +STR_2386 :{BLACK}Ter pelo menos {COMMA32} visitantes em seu parque até o fim de {MONTHYEAR}, com classificação de parque de pelo menos 600 STR_2387 :{BLACK}Alcançar um valor do parque de pelo menos {POP16}{POP16}{CURRENCY} até o fim de {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Divirta-se! STR_2389 :{BLACK}Construir o melhor {STRINGID} que puder! STR_2390 :{BLACK}Ter 10 tipos de montanha-russa diferentes operando em seu parque, cada uma com um valor de emoção de pelo menos 6.00 -STR_2391 :{BLACK}Ter pelo menos {COMMA16} visitantes em seu parque. Você não pode deixar a classificação de parque abaixo de 700 em momento algum! +STR_2391 :{BLACK}Ter pelo menos {COMMA32} visitantes em seu parque. Você não pode deixar a classificação de parque abaixo de 700 em momento algum! STR_2392 :{BLACK}Alcançar uma receita mensal de ingressos de atrações de pelo menos {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Ter 10 tipos de montanha-russa diferentes operando em seu parque, cada uma com um comprimento mínimo de {LENGTH}, e um valor de emoção de no mínimo 7.00 STR_2394 :{BLACK}Terminar de construir todas as 5 montanhas-russas parcialmente construídas neste parque, projetando-as para alcançar um valor de emoção de pelo menos {POP16}{POP16}{COMMA2DP32} cada @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Receita Mensal: STR_3306 :{WINDOW_COLOUR_2}Lucro Mensal: STR_3307 :{WINDOW_COLOUR_2}Comprimento Mínimo: STR_3308 :{WINDOW_COLOUR_2}Classificação de emoção: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Atrações em ordem de preservação: diff --git a/data/language/ru-RU.txt b/data/language/ru-RU.txt index d89d47dddd..513605995b 100644 --- a/data/language/ru-RU.txt +++ b/data/language/ru-RU.txt @@ -1737,12 +1737,12 @@ STR_2382 :Земля STR_2383 :Вода STR_2384 :{WINDOW_COLOUR_2}Ваша задача: STR_2385 :{BLACK}Нет -STR_2386 :{BLACK}Иметь не менее {COMMA16} гостей в парке к концу {MONTHYEAR}, и рейтинг парка не менее 600 +STR_2386 :{BLACK}Иметь не менее {COMMA32} гостей в парке к концу {MONTHYEAR}, и рейтинг парка не менее 600 STR_2387 :{BLACK}Поднять стоимость парка до {POP16}{POP16}{CURRENCY} к концу {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Удачи! STR_2389 :{BLACK}Постройте самый лучший {STRINGID} что сможете! STR_2390 :{BLACK}Завести 10 различных типов американских горок, каждую с рейтингом волнения не менее 6.00 -STR_2391 :{BLACK}Иметь не менее {COMMA16} гостей в парке. Нельзя допустить падения рейтинга ниже 700! +STR_2391 :{BLACK}Иметь не менее {COMMA32} гостей в парке. Нельзя допустить падения рейтинга ниже 700! STR_2392 :{BLACK}Довести ежемесячный доход от продажи билетов на аттракционы до {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Завести 10 различных типов Американских горок, каждая не короче {LENGTH}, и рейтингом волнения не менее 7.00 STR_2394 :{BLACK}Закончить строительство всех 5 недостроенных горок, разработав тематику и добившись рейтинга волнения не ниже {POP16}{POP16}{COMMA2DP32} на каждой @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}Месячный доход: STR_3306 :{WINDOW_COLOUR_2}Месячная прибыль: STR_3307 :{WINDOW_COLOUR_2}Миним. длина: STR_3308 :{WINDOW_COLOUR_2}Рейтинг волнения: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Аттракционы в зарезервированном порядке: diff --git a/data/language/sv-SE.txt b/data/language/sv-SE.txt index 62ab02f321..d0771b89d3 100644 --- a/data/language/sv-SE.txt +++ b/data/language/sv-SE.txt @@ -1738,12 +1738,12 @@ STR_2382 :Land STR_2383 :Vatten STR_2384 :{WINDOW_COLOUR_2}Ditt uppdrag: STR_2385 :{BLACK}Inget -STR_2386 :{BLACK}Att ha minst {COMMA16} besökare i parken tills {MONTHYEAR}, med ett parkomdöme över 600 +STR_2386 :{BLACK}Att ha minst {COMMA32} besökare i parken tills {MONTHYEAR}, med ett parkomdöme över 600 STR_2387 :{BLACK}Att uppnå ett parkvärde över {POP16}{POP16}{CURRENCY} tills {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Ha kul! STR_2389 :{BLACK}Bygg den bästa {STRINGID} du kan! STR_2390 :{BLACK}Att ha tio olika sorters berg- och dalbanor i din park, alla med en glädjenivå över 6.00 -STR_2391 :{BLACK}Att ha minst {COMMA16} besökare i din park. Du får aldrig låta parkomdömet gå under 700! +STR_2391 :{BLACK}Att ha minst {COMMA32} besökare i din park. Du får aldrig låta parkomdömet gå under 700! STR_2392 :{BLACK}Att få en månadsinkomst från åktursbiljetter på minst {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}Att ha tio olika sorters berg- och dalbanor i din park, alla ska vara längre än {LENGTH}, och med en glädjenivå över 7.00 STR_2394 :{BLACK}Att bygga klart alla fem delvis byggda berg- och dalbanor i parken, designade så att de alla får en glädjenivå över {POP16}{POP16}{COMMA2DP32} @@ -2326,7 +2326,7 @@ STR_3305 :{WINDOW_COLOUR_2}Månadsinkomst: STR_3306 :{WINDOW_COLOUR_2}Månadsvinst: STR_3307 :{WINDOW_COLOUR_2}Minimilängd: STR_3308 :{WINDOW_COLOUR_2}Glädjenivå: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Åkturer och attraktioner som måste bevaras: diff --git a/data/language/tr-TR.txt b/data/language/tr-TR.txt index 8c6a9947c2..9f2280f67d 100644 --- a/data/language/tr-TR.txt +++ b/data/language/tr-TR.txt @@ -1731,12 +1731,12 @@ STR_2382 :Arazi/Zemin STR_2383 :Su STR_2384 :{WINDOW_COLOUR_2}Hedefiniz: STR_2385 :{BLACK}Yok -STR_2386 :{BLACK}Parkınızda en az {COMMA16} müşteri {MONTHYEAR} sonuna kadar bulunması ve park değerlendirmesinin en az 600 olması gerekli +STR_2386 :{BLACK}Parkınızda en az {COMMA32} müşteri {MONTHYEAR} sonuna kadar bulunması ve park değerlendirmesinin en az 600 olması gerekli STR_2387 :{BLACK}Park değeri en az {POP16}{POP16}{CURRENCY} {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} kadar olmalı STR_2388 :{BLACK}Iyi eğlenceler! STR_2389 :{BLACK}Kendinize göre en iyi {STRINGID} inşa ediniz! STR_2390 :{BLACK}Parkınızda heyecan oranı en az 6.00 olan, 10 çesitli hız treni inşa edilmeli -STR_2391 :{BLACK}Parkınızda en az {COMMA16} müşteri bulunması ve park değerlendirmesinin hiç bir zaman 700’den aşağı düşmemesi gerekli +STR_2391 :{BLACK}Parkınızda en az {COMMA32} müşteri bulunması ve park değerlendirmesinin hiç bir zaman 700’den aşağı düşmemesi gerekli STR_2392 :{BLACK}Alet bileti satışlarından aylık en az {POP16}{POP16}{CURRENCY} geliriniz olmalı STR_2393 :{BLACK}Parkınızda heyecan oranı en az 7.00 ve uzunluğu en az {LENGTH} olan 10 çeşitli hız treni inşa edilmeli STR_2394 :{BLACK}Parkınızda bulunan 5 kısmen inşa edilmiş hız trenlerinin inşasını en az {POP16}{POP16}{COMMA2DP32} heyecan oranı ile tamamlayınız @@ -2317,7 +2317,7 @@ STR_3305 :{WINDOW_COLOUR_2}Aylık gelir: STR_3306 :{WINDOW_COLOUR_2}Aylık kâr: STR_3307 :{WINDOW_COLOUR_2}En az uzunluk: STR_3308 :{WINDOW_COLOUR_2}Heyecan oranı: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Koruma altına almak istediğiniz aletleri seçiniz diff --git a/data/language/uk-UA.txt b/data/language/uk-UA.txt index 4bbe57b9d0..815bb807be 100644 --- a/data/language/uk-UA.txt +++ b/data/language/uk-UA.txt @@ -1737,12 +1737,12 @@ STR_2382 :Ділянка STR_2383 :Вода STR_2384 :{WINDOW_COLOUR_2}Ваша мета: STR_2385 :{BLACK}Немає -STR_2386 :{BLACK}Мати щонайменше {COMMA16} гостей у парку наприкінці {MONTHYEAR}, з рейтингом парку не менше 600 +STR_2386 :{BLACK}Мати щонайменше {COMMA32} гостей у парку наприкінці {MONTHYEAR}, з рейтингом парку не менше 600 STR_2387 :{BLACK}Досягти вартості парку щонайменше {POP16}{POP16}{CURRENCY} наприкінці {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Розважатися! STR_2389 :{BLACK}Збудувати найкращий {STRINGID}, який можете! STR_2390 :{BLACK}Мати 10 різних типів американських гірок, що працюють у парку, кожна з яких має коефіцієнт захоплення не менше 6.00 -STR_2391 :{BLACK}Мати щонайменше {COMMA16} гостей у парку. Ви не повинні допустити, щоб рейтинг парку опустився нижче 700 в будь-який час! +STR_2391 :{BLACK}Мати щонайменше {COMMA32} гостей у парку. Ви не повинні допустити, щоб рейтинг парку опустився нижче 700 в будь-який час! STR_2392 :{BLACK}Досягти щомісячного доходу від продажу квитків на атракціон у розмірі щонайменше {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}To have 10 different types of roller coasters operating in your park, each with a minimum length of {LENGTH}, and an excitement rating of at least 7.00 STR_2394 :{BLACK}Завершити будівництво всіх 5 частково побудованих американських гірок у цьому парку, спланувавши їх так, щоб досягти оцінки захоплення не менше {POP16}{POP16}{COMMA2DP32} для кожної з них @@ -2356,7 +2356,7 @@ STR_3305 :{WINDOW_COLOUR_2}Щомісячний дохід: STR_3306 :{WINDOW_COLOUR_2}Щомісячний прибуток: STR_3307 :{WINDOW_COLOUR_2}Мінімальна довжина: STR_3308 :{WINDOW_COLOUR_2}Оцінка захоплення: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Rides/attractions under a preservation order: @@ -3695,6 +3695,36 @@ STR_6589 :Показати кнопки вікна зліва STR_6590 :Показати кнопки вікна (напр. для закриття вікна) ліворуч від рядка заголовка. STR_6591 :Не можна звільнити поки працівник лагодить атракціон. STR_6592 :Не можна звільнити поки працівник тестує атракціон. +STR_6593 :Прибрати паркани +STR_6594 :Інспектор тайлів: Увімк./Вимк. нахили стін +STR_6595 :{WINDOW_COLOUR_2}Автор: {BLACK}{STRING} +STR_6596 :{WINDOW_COLOUR_2}Автори: {BLACK}{STRING} +STR_6597 :Невірний параметр +STR_6598 :Значення поза діапазону +STR_6599 :Примарний елемент не знайдено +STR_6600 :Кулю не знайдено +STR_6601 :Персонал не знайдено +STR_6602 :Атракціон не знайдено +STR_6603 :Ride object entry not found +STR_6604 :Гравця не знайдено +STR_6605 :Елемент входу не знайдено +STR_6606 :Елемент поверхні не знайдено +STR_6607 :Елемент тайлу не знайдено +STR_6608 :Елемент рейки не знайдено +STR_6609 :Блок рейки не знайдено +STR_6610 :Елемент стежки не знайдено +STR_6611 :Елемент стіни не знайдено +STR_6612 :Елемент воріт не знайдено +STR_6613 :Перезавантажити об'єкт +STR_6614 :Не можна змінити ціну на вхід +STR_6615 :Доріжка на цьому тайлі потребує води +STR_6616 :Цьому типу персоналу дія недопустима +STR_6617 :Неможливо замінити елемент тайлу тим же елементом +STR_6618 :Не вдається обмежити/зняти обмеження об'єкту... +STR_6619 :Тип об'єкту неможливо обмежити! +STR_6620 :Об'єкт не знайдено! +STR_6621 :Обмежити +STR_6622 :Обмежити використання об'єкта лише в Редакторі Сценаріїв та в режимі пісочниці. ############# # Scenarios # @@ -4527,4 +4557,4 @@ STR_DTLS :Привіт, дітки! Нумо розважатися!{NEWLINE} STR_SCNR :Піщана дюна STR_PARK :Піщана дюна -STR_DTLS :Як власник невеликого парку, ви купили велику ділянку землі вздовж пляжу, щоб розширити його і привабити більше гостей до прекрасних піщаних дюн, але будьте обережні: ви не можете порушувати ці екологічно крихкі піщані дюни.{NEWLINE}Автор: rbarclay \ No newline at end of file +STR_DTLS :Як власник невеликого парку, ви купили велику ділянку землі вздовж пляжу, щоб розширити його і привабити більше гостей до прекрасних піщаних дюн, але будьте обережні: ви не можете порушувати ці екологічно крихкі піщані дюни.{NEWLINE}Автор: rbarclay diff --git a/data/language/vi-VN.txt b/data/language/vi-VN.txt index dbfd941711..acf1caf529 100644 --- a/data/language/vi-VN.txt +++ b/data/language/vi-VN.txt @@ -1734,12 +1734,12 @@ STR_2382 :Land STR_2383 :Water STR_2384 :{WINDOW_COLOUR_2}Mục tiêu: STR_2385 :{BLACK}Không -STR_2386 :{BLACK}Có ít nhất {COMMA16} khách vào cuối tháng {MONTHYEAR}, với đánh giá công viên từ 600 trở lên +STR_2386 :{BLACK}Có ít nhất {COMMA32} khách vào cuối tháng {MONTHYEAR}, với đánh giá công viên từ 600 trở lên STR_2387 :{BLACK}Đạt giá trị công viên ít nhất {POP16}{POP16}{CURRENCY} vào cuối {PUSH16}{PUSH16}{PUSH16}{PUSH16}{PUSH16}{MONTHYEAR} STR_2388 :{BLACK}Have Fun! STR_2389 :{BLACK}Build the best {STRINGID} you can! STR_2390 :{BLACK}Có 10 loại tàu lượn khác nhau trong công viên, mỗi cái có chỉ số phấn khích ít nhất 6.00 -STR_2391 :{BLACK}Có ít nhất {COMMA16} khách. Không được để đánh giá công viên thấp hơn 700 ở bất kỳ thời điểm nào! +STR_2391 :{BLACK}Có ít nhất {COMMA32} khách. Không được để đánh giá công viên thấp hơn 700 ở bất kỳ thời điểm nào! STR_2392 :{BLACK}To achieve a monthly income from ride tickets of at least {POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}To have 10 different types of roller coasters operating in your park, each with a minimum length of {LENGTH}, and an excitement rating of at least 7.00 STR_2394 :{BLACK}To finish building all 5 of the partially built roller coasters in this park, designing them to achieve excitement ratings of at least {POP16}{POP16}{COMMA2DP32} each @@ -2321,7 +2321,7 @@ STR_3305 :{WINDOW_COLOUR_2}Monthly income: STR_3306 :{WINDOW_COLOUR_2}Monthly profit: STR_3307 :{WINDOW_COLOUR_2}Minimum length: STR_3308 :{WINDOW_COLOUR_2}Độ phấn khích: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}Rides/attractions under a preservation order: diff --git a/data/language/zh-CN.txt b/data/language/zh-CN.txt index 41064f4c98..7d36ed4f6e 100644 --- a/data/language/zh-CN.txt +++ b/data/language/zh-CN.txt @@ -1737,12 +1737,12 @@ STR_2382 :土地 STR_2383 :水面 STR_2384 :{WINDOW_COLOUR_2}你的目标: STR_2385 :{BLACK}无 -STR_2386 :{BLACK}在{POP16}{MONTHYEAR}末乐园内至少有{NEWLINE}{PUSH16}{PUSH16}{COMMA16}游客,并且乐园评分不低于600 +STR_2386 :{BLACK}在{POP16}{MONTHYEAR}末乐园内至少有{NEWLINE}{PUSH16}{PUSH16}{COMMA32}游客,并且乐园评分不低于600 STR_2387 :{BLACK}在{POP16}{MONTHYEAR}末乐园价值不低于{CURRENCY} STR_2388 :{BLACK}尽情玩吧! STR_2389 :{BLACK}建造你的最佳{STRINGID}吧! STR_2390 :{BLACK}在你的乐园中运营10种类型的过山车,并且每一个的兴奋度不低于6.00 -STR_2391 :{BLACK}乐园内至少有{COMMA16}游客,并且在任何时候你都不能让公园评分低于700! +STR_2391 :{BLACK}乐园内至少有{COMMA32}游客,并且在任何时候你都不能让公园评分低于700! STR_2392 :{BLACK}每个月的门票收入至少{NEWLINE}{POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}在你的乐园中运营10种类型的过山车,每一个的长度至少{LENGTH},并且每一个的兴奋度不低于7.00 STR_2394 :{BLACK}建造好五座未完成的过山车,将他们每座设计成兴奋度至少达到{POP16}{POP16}{COMMA2DP32} @@ -2323,7 +2323,7 @@ STR_3305 :{WINDOW_COLOUR_2}每月收入: STR_3306 :{WINDOW_COLOUR_2}每月利润: STR_3307 :{WINDOW_COLOUR_2}最少长度: STR_3308 :{WINDOW_COLOUR_2}兴奋度: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}请选取要保留的游乐设施/店铺: diff --git a/data/language/zh-TW.txt b/data/language/zh-TW.txt index 95f355fdb1..a26004c2dc 100644 --- a/data/language/zh-TW.txt +++ b/data/language/zh-TW.txt @@ -1741,12 +1741,12 @@ STR_2382 :土地 STR_2383 :水塘 STR_2384 :{WINDOW_COLOUR_2}你的目標: STR_2385 :{BLACK}無 -STR_2386 :{BLACK}在{POP16}{MONTHYEAR}尾之前, 樂園裡至少有{PUSH16}{PUSH16}{COMMA16}個遊客, 而且樂園評價並不低於600 +STR_2386 :{BLACK}在{POP16}{MONTHYEAR}尾之前, 樂園裡至少有{PUSH16}{PUSH16}{COMMA32}個遊客, 而且樂園評價並不低於600 STR_2387 :{BLACK}在{POP16}{MONTHYEAR}尾之前, 樂園價值必需達到{CURRENCY} STR_2388 :{BLACK}盡情玩吧! STR_2389 :{BLACK}建造你的最佳{STRINGID}吧! STR_2390 :{BLACK}樂園必需建造十種不同種類的雲霄飛車, 而且每座的興奮度不低於6.00 -STR_2391 :{BLACK}樂園裡至少有{COMMA16}個遊客. 任何時間下, 你並不可以令樂園評價跌至700以下! +STR_2391 :{BLACK}樂園裡至少有{COMMA32}個遊客. 任何時間下, 你並不可以令樂園評價跌至700以下! STR_2392 :{BLACK}遊樂設施的門票收入至少要達到每月{POP16}{POP16}{CURRENCY} STR_2393 :{BLACK}樂園必需建造十種不同種類的雲霄飛車, 每座的長度至少需要{LENGTH}, 而且興奮度都不低於7.00 STR_2394 :{BLACK}建造好五座未完成的雲霄飛車, 將他們每座設計成興奮度至少達到{POP16}{POP16}{COMMA2DP32} @@ -2327,7 +2327,7 @@ STR_3305 :{WINDOW_COLOUR_2}每月收入: STR_3306 :{WINDOW_COLOUR_2}每月利潤: STR_3307 :{WINDOW_COLOUR_2}最少長度: STR_3308 :{WINDOW_COLOUR_2}興奮度: -STR_3309 :{WINDOW_COLOUR_2}{COMMA16} +STR_3309 :{WINDOW_COLOUR_2}{COMMA32} STR_3310 :{WINDOW_COLOUR_2}{LENGTH} STR_3311 :{WINDOW_COLOUR_2}{COMMA2DP32} STR_3312 :{WINDOW_COLOUR_2}請選取要保留的遊樂設施/店鋪: From 25d3db0f1f920c0fd43a46cd94599092c2aa5c22 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sat, 16 Mar 2024 09:24:50 +0000 Subject: [PATCH 077/191] Move gParkRatingCasualtyPenalty to GameState_t (#21610) --- src/openrct2/GameState.h | 1 + src/openrct2/entity/Peep.cpp | 3 ++- src/openrct2/park/ParkFile.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 5 +++-- src/openrct2/scenario/Scenario.cpp | 6 +++--- src/openrct2/scripting/bindings/world/ScPark.cpp | 4 ++-- src/openrct2/world/Park.cpp | 4 +--- src/openrct2/world/Park.h | 2 -- 9 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index eeda3497c0..15f6e127b4 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -43,6 +43,7 @@ namespace OpenRCT2 money64 ParkEntranceFee; std::vector ParkEntrances; uint32_t ParkSize; + int16_t ParkRatingCasualtyPenalty; money64 ParkValue; money64 ParkValueHistory[FINANCE_GRAPH_SIZE]; money64 CompanyValue; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 59c4a9bd78..79d28246b0 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -745,7 +745,8 @@ void Peep::UpdateFalling() News::AddItemToQueue(News::ItemType::Blank, STR_NEWS_ITEM_GUEST_DROWNED, x | (y << 16), ft); } - gParkRatingCasualtyPenalty = std::min(gParkRatingCasualtyPenalty + 25, 1000); + auto& gameState = GetGameState(); + gameState.ParkRatingCasualtyPenalty = std::min(gameState.ParkRatingCasualtyPenalty + 25, 1000); Remove(); return; } diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 89e7e0c500..4fcb146030 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -891,7 +891,7 @@ namespace OpenRCT2 cs.ReadWrite(gameState.NumGuestsInPark); cs.ReadWrite(gameState.NumGuestsHeadingForPark); cs.ReadWrite(gameState.ParkRating); - cs.ReadWrite(gParkRatingCasualtyPenalty); + cs.ReadWrite(gameState.ParkRatingCasualtyPenalty); cs.ReadWrite(gameState.CurrentExpenditure); cs.ReadWrite(gameState.CurrentProfit); cs.ReadWrite(gameState.WeeklyProfitAverageDividend); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 72a5ce98f1..d41c191381 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -401,7 +401,7 @@ namespace RCT2 gameState.ScenarioCompletedBy = std::string_view(_s6.ScenarioCompletedName, sizeof(_s6.ScenarioCompletedName)); gameState.Cash = ToMoney64(DECRYPT_MONEY(_s6.Cash)); // Pad013587FC - gParkRatingCasualtyPenalty = _s6.ParkRatingCasualtyPenalty; + gameState.ParkRatingCasualtyPenalty = _s6.ParkRatingCasualtyPenalty; gameState.MapSize = { _s6.MapSize, _s6.MapSize }; gameState.SamePriceThroughoutPark = _s6.SamePriceThroughout | (static_cast(_s6.SamePriceThroughoutExtended) << 32); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index ab92586cab..4b319427b9 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5113,9 +5113,10 @@ static void ride_train_crash(Ride& ride, uint16_t numFatalities) ride.id.ToUnderlying(), ft); } - if (gParkRatingCasualtyPenalty < 500) + auto& gameState = GetGameState(); + if (gameState.ParkRatingCasualtyPenalty < 500) { - gParkRatingCasualtyPenalty += 200; + gameState.ParkRatingCasualtyPenalty += 200; } } } diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index b2d2db843c..024663555f 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -164,7 +164,7 @@ void ScenarioReset(GameState_t& gameState) } gMarketingCampaigns.clear(); - gParkRatingCasualtyPenalty = 0; + gameState.ParkRatingCasualtyPenalty = 0; // Open park with free entry when there is no money if (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) @@ -309,8 +309,8 @@ static void ScenarioDayUpdate(GameState_t& gameState) } // Lower the casualty penalty - uint16_t casualtyPenaltyModifier = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) ? 40 : 7; - gParkRatingCasualtyPenalty = std::max(0, gParkRatingCasualtyPenalty - casualtyPenaltyModifier); + uint16_t casualtyPenaltyModifier = (gameState.ParkFlags & PARK_FLAGS_NO_MONEY) ? 40 : 7; + gameState.ParkRatingCasualtyPenalty = std::max(0, gameState.ParkRatingCasualtyPenalty - casualtyPenaltyModifier); auto intent = Intent(INTENT_ACTION_UPDATE_DATE); ContextBroadcastIntent(&intent); diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index d7bc857dcd..ae849cb189 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -263,12 +263,12 @@ namespace OpenRCT2::Scripting int16_t ScPark::casualtyPenalty_get() const { - return gParkRatingCasualtyPenalty; + return GetGameState().ParkRatingCasualtyPenalty; } void ScPark::casualtyPenalty_set(int16_t value) { ThrowIfGameStateNotMutable(); - gParkRatingCasualtyPenalty = value; + GetGameState().ParkRatingCasualtyPenalty = value; } uint16_t ScPark::parkSize_get() const diff --git a/src/openrct2/world/Park.cpp b/src/openrct2/world/Park.cpp index 540b8b7705..3263a2f4b8 100644 --- a/src/openrct2/world/Park.cpp +++ b/src/openrct2/world/Park.cpp @@ -47,8 +47,6 @@ using namespace OpenRCT2; -int16_t gParkRatingCasualtyPenalty; - // If this value is more than or equal to 0, the park rating is forced to this value. Used for cheat static int32_t _forcedParkRating = -1; @@ -458,7 +456,7 @@ int32_t Park::CalculateParkRating() const result -= 600 - (4 * (150 - std::min(150, litterCount))); } - result -= gParkRatingCasualtyPenalty; + result -= gameState.ParkRatingCasualtyPenalty; result = std::clamp(result, 0, 999); return result; } diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index 0337793c50..ce5a53d8be 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -92,8 +92,6 @@ namespace OpenRCT2 }; } // namespace OpenRCT2 -extern int16_t gParkRatingCasualtyPenalty; - void ParkSetForcedRating(int32_t rating); int32_t ParkGetForcedRating(); From 59958a6b8fea5d2f527ae1fdd383c9947a76ec02 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sat, 16 Mar 2024 10:34:01 +0100 Subject: [PATCH 078/191] Part of #21421: replace define with constexpr in Ride.h (#21602) --- src/openrct2/ride/Ride.cpp | 46 +++++++++++++++++------------------ src/openrct2/ride/Ride.h | 15 ++++++------ src/openrct2/ride/Vehicle.cpp | 12 ++++----- 3 files changed, 37 insertions(+), 36 deletions(-) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 72e301d234..0280f6a545 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2138,12 +2138,12 @@ static void RideFreeOldMeasurements() numRideMeasurements++; } } - if (numRideMeasurements > MAX_RIDE_MEASUREMENTS && lruRide != nullptr) + if (numRideMeasurements > kMaxRideMeasurements && lruRide != nullptr) { lruRide->measurement = {}; numRideMeasurements--; } - } while (numRideMeasurements > MAX_RIDE_MEASUREMENTS); + } while (numRideMeasurements > kMaxRideMeasurements); } std::pair Ride::GetMeasurement() @@ -4396,11 +4396,11 @@ void IncrementTurnCount1Element(Ride& ride, uint8_t type) default: return; } - uint16_t value = (*turn_count & TURN_MASK_1_ELEMENT) + 1; - *turn_count &= ~TURN_MASK_1_ELEMENT; + uint16_t value = (*turn_count & kTurnMask1Element) + 1; + *turn_count &= ~kTurnMask1Element; - if (value > TURN_MASK_1_ELEMENT) - value = TURN_MASK_1_ELEMENT; + if (value > kTurnMask1Element) + value = kTurnMask1Element; *turn_count |= value; } @@ -4421,11 +4421,11 @@ void IncrementTurnCount2Elements(Ride& ride, uint8_t type) default: return; } - uint16_t value = (*turn_count & TURN_MASK_2_ELEMENTS) + 0x20; - *turn_count &= ~TURN_MASK_2_ELEMENTS; + uint16_t value = (*turn_count & kTurnMask2Elements) + 0x20; + *turn_count &= ~kTurnMask2Elements; - if (value > TURN_MASK_2_ELEMENTS) - value = TURN_MASK_2_ELEMENTS; + if (value > kTurnMask2Elements) + value = kTurnMask2Elements; *turn_count |= value; } @@ -4446,11 +4446,11 @@ void IncrementTurnCount3Elements(Ride& ride, uint8_t type) default: return; } - uint16_t value = (*turn_count & TURN_MASK_3_ELEMENTS) + 0x100; - *turn_count &= ~TURN_MASK_3_ELEMENTS; + uint16_t value = (*turn_count & kTurnMask3Elements) + 0x100; + *turn_count &= ~kTurnMask3Elements; - if (value > TURN_MASK_3_ELEMENTS) - value = TURN_MASK_3_ELEMENTS; + if (value > kTurnMask3Elements) + value = kTurnMask3Elements; *turn_count |= value; } @@ -4470,11 +4470,11 @@ void IncrementTurnCount4PlusElements(Ride& ride, uint8_t type) default: return; } - uint16_t value = (*turn_count & TURN_MASK_4_PLUS_ELEMENTS) + 0x800; - *turn_count &= ~TURN_MASK_4_PLUS_ELEMENTS; + uint16_t value = (*turn_count & kTurnMask4PlusElements) + 0x800; + *turn_count &= ~kTurnMask4PlusElements; - if (value > TURN_MASK_4_PLUS_ELEMENTS) - value = TURN_MASK_4_PLUS_ELEMENTS; + if (value > kTurnMask4PlusElements) + value = kTurnMask4PlusElements; *turn_count |= value; } @@ -4496,7 +4496,7 @@ int32_t GetTurnCount1Element(const Ride& ride, uint8_t type) return 0; } - return (*turn_count) & TURN_MASK_1_ELEMENT; + return (*turn_count) & kTurnMask1Element; } int32_t GetTurnCount2Elements(const Ride& ride, uint8_t type) @@ -4517,7 +4517,7 @@ int32_t GetTurnCount2Elements(const Ride& ride, uint8_t type) return 0; } - return ((*turn_count) & TURN_MASK_2_ELEMENTS) >> 5; + return ((*turn_count) & kTurnMask2Elements) >> 5; } int32_t GetTurnCount3Elements(const Ride& ride, uint8_t type) @@ -4538,7 +4538,7 @@ int32_t GetTurnCount3Elements(const Ride& ride, uint8_t type) return 0; } - return ((*turn_count) & TURN_MASK_3_ELEMENTS) >> 8; + return ((*turn_count) & kTurnMask3Elements) >> 8; } int32_t GetTurnCount4PlusElements(const Ride& ride, uint8_t type) @@ -4556,7 +4556,7 @@ int32_t GetTurnCount4PlusElements(const Ride& ride, uint8_t type) return 0; } - return ((*turn_count) & TURN_MASK_4_PLUS_ELEMENTS) >> 11; + return ((*turn_count) & kTurnMask4PlusElements) >> 11; } bool Ride::HasSpinningTunnel() const @@ -5372,7 +5372,7 @@ static bool CheckForAdjacentStation(const CoordsXYZ& stationCoords, uint8_t dire bool found = false; int32_t adjX = stationCoords.x; int32_t adjY = stationCoords.y; - for (uint32_t i = 0; i <= RIDE_ADJACENCY_CHECK_DISTANCE; i++) + for (uint32_t i = 0; i <= kRideAdjacencyCheckDistance; i++) { adjX += CoordsDirectionDelta[direction].x; adjY += CoordsDirectionDelta[direction].y; diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 902fce5e98..417754f84c 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -40,7 +40,8 @@ struct Vehicle; struct RideObjectEntry; struct ResultWithMessage; -#define RIDE_ADJACENCY_CHECK_DISTANCE 5 +constexpr uint8_t kRideAdjacencyCheckDistance = 5; + constexpr uint8_t TUNE_ID_NULL = 0xFF; constexpr uint16_t const MAX_STATION_LOCATIONS = OpenRCT2::Limits::MaxStationsPerRide * 2; // Entrance and exit per station @@ -902,18 +903,18 @@ enum TRACK_ELEMENT_SET_BRAKE_BOOSTER_SPEED = (1 << 7) }; -#define MAX_RIDE_MEASUREMENTS 8 +constexpr uint8_t kMaxRideMeasurements = 8; constexpr money64 RIDE_VALUE_UNDEFINED = kMoney64Undefined; #define RIDE_INITIAL_RELIABILITY ((100 << 8) | 0xFF) // Upper byte is percentage, lower byte is "decimal". #define STATION_DEPART_FLAG (1 << 7) #define STATION_DEPART_MASK (~STATION_DEPART_FLAG) -#define CURRENT_TURN_COUNT_MASK 0xF800 -#define TURN_MASK_1_ELEMENT 0x001F -#define TURN_MASK_2_ELEMENTS 0x00E0 -#define TURN_MASK_3_ELEMENTS 0x0700 -#define TURN_MASK_4_PLUS_ELEMENTS 0xF800 +constexpr uint16_t kCurrentTurnCountMask = 0xF800; +constexpr uint16_t kTurnMask1Element = 0x001F; +constexpr uint16_t kTurnMask2Elements = 0x00E0; +constexpr uint16_t kTurnMask3Elements = 0x0700; +constexpr uint16_t kTurnMask4PlusElements = 0xF800; constexpr uint32_t CONSTRUCTION_LIFT_HILL_SELECTED = 1 << 0; constexpr uint32_t CONSTRUCTION_INVERTED_TRACK_SELECTED = 1 << 1; diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 4b319427b9..06a6a5442b 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1521,12 +1521,12 @@ void Vehicle::UpdateMeasurements() uint32_t testingFlags = curRide->testing_flags; if (testingFlags & RIDE_TESTING_TURN_LEFT && trackFlags & TRACK_ELEM_FLAG_TURN_LEFT) { - // 0x800 as this is masked to CURRENT_TURN_COUNT_MASK + // 0x800 as this is masked to kCurrentTurnCountMask curRide->turn_count_default += 0x800; } else if (testingFlags & RIDE_TESTING_TURN_RIGHT && trackFlags & TRACK_ELEM_FLAG_TURN_RIGHT) { - // 0x800 as this is masked to CURRENT_TURN_COUNT_MASK + // 0x800 as this is masked to kCurrentTurnCountMask curRide->turn_count_default += 0x800; } else if (testingFlags & RIDE_TESTING_TURN_RIGHT || testingFlags & RIDE_TESTING_TURN_LEFT) @@ -1564,7 +1564,7 @@ void Vehicle::UpdateMeasurements() if (trackFlags & TRACK_ELEM_FLAG_TURN_LEFT) { curRide->testing_flags |= RIDE_TESTING_TURN_LEFT; - curRide->turn_count_default &= ~CURRENT_TURN_COUNT_MASK; + curRide->turn_count_default &= ~kCurrentTurnCountMask; if (trackFlags & TRACK_ELEM_FLAG_TURN_BANKED) { @@ -1579,7 +1579,7 @@ void Vehicle::UpdateMeasurements() if (trackFlags & TRACK_ELEM_FLAG_TURN_RIGHT) { curRide->testing_flags |= RIDE_TESTING_TURN_RIGHT; - curRide->turn_count_default &= ~CURRENT_TURN_COUNT_MASK; + curRide->turn_count_default &= ~kCurrentTurnCountMask; if (trackFlags & TRACK_ELEM_FLAG_TURN_BANKED) { @@ -2671,8 +2671,8 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex */ int32_t direction = tileElement->GetDirectionWithOffset(1); - int32_t maxCheckDistance = RIDE_ADJACENCY_CHECK_DISTANCE; - int32_t spaceBetween = maxCheckDistance; + constexpr uint8_t maxCheckDistance = kRideAdjacencyCheckDistance; + uint8_t spaceBetween = maxCheckDistance; while (_lastSynchronisedVehicle < &_synchronisedVehicles[SYNCHRONISED_VEHICLE_COUNT - 1]) { From 6633509af6e8f611310c994cbaaa1627548cc225 Mon Sep 17 00:00:00 2001 From: Matt <5415177+ZehMatt@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:35:55 +0200 Subject: [PATCH 079/191] Refactor peep update (#21605) --- src/openrct2/entity/Guest.cpp | 6 +-- src/openrct2/entity/Guest.h | 2 +- src/openrct2/entity/Peep.cpp | 70 +++++++++++------------------------ 3 files changed, 25 insertions(+), 53 deletions(-) diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 0c993b9e45..f36b2f24b5 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -898,11 +898,11 @@ void Guest::Loc68FA89() } } -void Guest::Tick128UpdateGuest(int32_t index) +void Guest::Tick128UpdateGuest(uint32_t index) { const auto currentTicks = GetGameState().CurrentTicks; - if (static_cast(index & 0x1FF) == (currentTicks & 0x1FF)) + if ((index & 0x1FF) == (currentTicks & 0x1FF)) { /* Effect of masking with 0x1FF here vs mask 0x7F, * which is the condition for calling this function, is @@ -1036,7 +1036,7 @@ void Guest::Tick128UpdateGuest(int32_t index) PickRideToGoOn(); } - if (static_cast(index & 0x3FF) == (currentTicks & 0x3FF)) + if ((index & 0x3FF) == (currentTicks & 0x3FF)) { /* Effect of masking with 0x3FF here vs mask 0x1FF, * which is used in the encompassing conditional, is diff --git a/src/openrct2/entity/Guest.h b/src/openrct2/entity/Guest.h index 6f379cbb68..636dd8e66f 100644 --- a/src/openrct2/entity/Guest.h +++ b/src/openrct2/entity/Guest.h @@ -321,7 +321,7 @@ public: uint64_t ItemFlags; void UpdateGuest(); - void Tick128UpdateGuest(int32_t index); + void Tick128UpdateGuest(uint32_t index); int64_t GetFoodOrDrinkFlags() const; int64_t GetEmptyContainerFlags() const; bool HasDrink() const; diff --git a/src/openrct2/entity/Peep.cpp b/src/openrct2/entity/Peep.cpp index 79d28246b0..9b91f94ca8 100644 --- a/src/openrct2/entity/Peep.cpp +++ b/src/openrct2/entity/Peep.cpp @@ -71,7 +71,6 @@ static TileElement* _peepRideEntranceExitElement; static std::shared_ptr _crowdSoundChannel = nullptr; -static void Peep128TickUpdate(Peep* peep, int32_t index); static void GuestReleaseBalloon(Guest* peep, int16_t spawn_height); static PeepActionSpriteType PeepSpecialSpriteToSpriteTypeMap[] = { @@ -199,68 +198,41 @@ void PeepUpdateAll() const auto currentTicks = OpenRCT2::GetGameState().CurrentTicks; - int32_t i = 0; + constexpr auto kTicks128Mask = 128U - 1U; + const auto currentTicksMasked = currentTicks & kTicks128Mask; + + uint32_t index = 0; // Warning this loop can delete peeps for (auto peep : EntityList()) { - if (static_cast(i & 0x7F) != (currentTicks & 0x7F)) + if ((index & kTicks128Mask) == currentTicksMasked) + { + peep->Tick128UpdateGuest(index); + } + + // 128 tick can delete so double check its not deleted + if (peep->Type == EntityType::Guest) { peep->Update(); } - else - { - Peep128TickUpdate(peep, i); - // 128 tick can delete so double check its not deleted - if (peep->Type == EntityType::Guest) - { - peep->Update(); - } - } - i++; + index++; } for (auto staff : EntityList()) { - if (static_cast(i & 0x7F) != (currentTicks & 0x7F)) - { - staff->Update(); - } - else - { - Peep128TickUpdate(staff, i); - // 128 tick can delete so double check its not deleted - if (staff->Type == EntityType::Staff) - { - staff->Update(); - } - } - - i++; - } -} - -/** - * - * rct2: 0x0068F41A - * Called every 128 ticks - */ -static void Peep128TickUpdate(Peep* peep, int32_t index) -{ - PROFILED_FUNCTION(); - - auto* guest = peep->As(); - if (guest != nullptr) - { - guest->Tick128UpdateGuest(index); - } - else - { - auto* staff = peep->As(); - if (staff != nullptr) + if ((index & kTicks128Mask) == currentTicksMasked) { staff->Tick128UpdateStaff(); } + + // 128 tick can delete so double check its not deleted + if (staff->Type == EntityType::Staff) + { + staff->Update(); + } + + index++; } } From 8963234eacca5a2428914bd62afe2764db9484af Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sat, 16 Mar 2024 15:45:04 +0100 Subject: [PATCH 080/191] Use same parameter names in g2/sprites.json and object json --- resources/g2/sprites.json | 16034 +++++++++++++-------------- src/openrct2/CommandLineSprite.cpp | 4 +- 2 files changed, 8019 insertions(+), 8019 deletions(-) diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index 297c9b520f..f7aa6dd278 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -136,13 +136,13 @@ }, { "path": "icons/eyedropper.png", - "x_offset": 5, - "y_offset": 5 + "x": 5, + "y": 5 }, { "path": "icons/chat.png", - "x_offset": 2, - "y_offset": 1 + "x": 2, + "y": 1 }, { "path": "icons/map_north.png" @@ -182,8 +182,8 @@ }, { "path": "icons/simulate.png", - "x_offset": 2, - "y_offset": 2 + "x": 2, + "y": 2 }, { "path": "icons/rct1_simulate_off.png" @@ -203,18 +203,18 @@ }, { "path": "tool/normal_selection_6x6.png", - "x_offset": 1, - "y_offset": 4 + "x": 1, + "y": 4 }, { "path": "tool/mountain_tool_even.png", - "x_offset": 1, - "y_offset": 4 + "x": 1, + "y": 4 }, { "path": "tool/mountain_tool_odd.png", - "x_offset": 1, - "y_offset": 5 + "x": 1, + "y": 5 }, { "path": "tool/scenery_scatter_low.png" @@ -230,38 +230,38 @@ }, { "path": "icons/path_railings.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "icons/legacy_paths.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "icons/path_surfaces.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "icons/ride_stations.png", - "x_offset": 5, - "y_offset": 1 + "x": 5, + "y": 1 }, { "path": "icons/terrain_edges.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "icons/hide_vegetation.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "icons/hide_scenery.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "icons/hide_vehicles.png" @@ -271,18 +271,18 @@ }, { "path": "icons/hide_partial.png", - "x_offset": 4, - "y_offset": 2 + "x": 4, + "y": 2 }, { "path": "icons/hide_full.png", - "x_offset": 4, - "y_offset": 2 + "x": 4, + "y": 2 }, { "path": "icons/link_chain.png", - "x_offset": 2, - "y_offset": 2 + "x": 2, + "y": 2 }, { "path": "sideways-tab.png" @@ -292,18 +292,18 @@ }, { "path": "icons/arrow_up.png", - "x_offset": 5, - "y_offset": 5 + "x": 5, + "y": 5 }, { "path": "icons/arrow_down.png", - "x_offset": 5, - "y_offset": 5 + "x": 5, + "y": 5 }, { "path": "icons/reload.png", - "x_offset": 2, - "y_offset": 2 + "x": 2, + "y": 2 }, { "path": "icons/colour_invisible.png" @@ -553,52 +553,52 @@ }, { "path": "surface/glassy_recolourable.png", - "x_offset": -32, - "y_offset": -1, + "x": -32, + "y": -1, "palette": "keep" }, { "path": "surface/selection_edge_nw.png", - "x_offset": -32, - "y_offset": -1 + "x": -32, + "y": -1 }, { "path": "surface/selection_edge_ne.png", - "x_offset": 0, - "y_offset": -1 + "x": 0, + "y": -1 }, { "path": "surface/selection_edge_sw.png", - "x_offset": -32, - "y_offset": 15 + "x": -32, + "y": 15 }, { "path": "surface/selection_edge_se.png", - "x_offset": 0, - "y_offset": 15 + "x": 0, + "y": 15 }, { "path": "font/latin/ae-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/ae-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-stroke-uc-small.png", - "x_offset": -1, - "y_offset": 0, + "x": -1, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-stroke-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -734,13 +734,13 @@ }, { "path": "font/cyrillic/U1078-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1079-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -836,7 +836,7 @@ }, { "path": "font/cyrillic/U1108-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -847,277 +847,277 @@ }, { "path": "font/cyrillic/U1169-small.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/german-openquotes-small.png", - "y_offset": 6, + "y": 6, "palette": "keep", "forceBmp": true }, { "path": "font/guilder-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-breve-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/i-with-dot-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-cedilla-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-breve-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/i-without-dot-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-cedilla-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/interpunct-small.png", - "y_offset": 3, + "y": 3, "palette": "keep", "forceBmp": true }, { "path": "font/latin/a-breve-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-comma-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-comma-small.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/ellipsis-small.png", - "y_offset": 6, + "y": 6, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-caron-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-acute-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-acute-small.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-double-acute-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-double-acute-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/oe-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/oe-small.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-double-acute-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-double-acute-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/d-caron-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/d-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/e-caron-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/e-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/n-caron-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/n-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/r-caron-uc-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/r-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-caron-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-caron-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-caron-small.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-ring-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-ring-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/w-circumflex-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/w-circumflex-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-circumflex-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-circumflex-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/z-caron-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/z-caron-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/rouble-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-small.png", - "x_offset": -1, + "x": -1, "palette": "keep", "forceBmp": true }, @@ -1128,74 +1128,74 @@ }, { "path": "font/latin/c-circumflex-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-circumflex-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-circumflex-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-circumflex-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/h-circumflex-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/h-circumflex-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-circumflex-uc-small.png", - "x_offset": -1, - "y_offset": -1, + "x": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-circumflex-small.png", - "x_offset": -1, + "x": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-circumflex-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-circumflex-small.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-breve-uc-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-breve-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, @@ -1206,7 +1206,7 @@ }, { "path": "font/vertical-bar-small.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, @@ -1217,39 +1217,39 @@ }, { "path": "font/tilde-small.png", - "y_offset": 3, + "y": 3, "palette": "keep", "forceBmp": true }, { "path": "font/eye.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/ae-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/ae-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-stroke-uc-bold.png", - "x_offset": -1, - "y_offset": -1, + "x": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-stroke-bold.png", - "x_offset": 0, - "y_offset": 2, + "x": 0, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -1385,13 +1385,13 @@ }, { "path": "font/cyrillic/U1078-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1079-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -1487,7 +1487,7 @@ }, { "path": "font/cyrillic/U1108-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -1498,277 +1498,277 @@ }, { "path": "font/cyrillic/U1169-bold.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/german-openquotes-bold.png", - "y_offset": 5, + "y": 5, "palette": "keep", "forceBmp": true }, { "path": "font/guilder-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-breve-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/i-with-dot-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-cedilla-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-breve-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/i-without-dot-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-cedilla-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/interpunct-bold.png", - "y_offset": 3, + "y": 3, "palette": "keep", "forceBmp": true }, { "path": "font/latin/a-breve-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-comma-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-comma-bold.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/ellipsis-bold.png", - "y_offset": 6, + "y": 6, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-acute-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-acute-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-double-acute-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-double-acute-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/oe-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/oe-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-double-acute-uc-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-double-acute-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/d-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/d-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/e-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/e-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/n-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/n-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/r-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/r-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-ring-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-ring-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/w-circumflex-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/w-circumflex-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-circumflex-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-circumflex-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/z-caron-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/z-caron-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/rouble-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-bold.png", - "x_offset": -1, + "x": -1, "palette": "keep", "forceBmp": true }, @@ -1779,74 +1779,74 @@ }, { "path": "font/latin/c-circumflex-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-circumflex-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-circumflex-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-circumflex-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/h-circumflex-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/h-circumflex-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-circumflex-uc-bold.png", - "x_offset": -1, - "y_offset": -1, + "x": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-circumflex-bold.png", - "x_offset": -1, + "x": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-circumflex-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-circumflex-bold.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-breve-uc-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-breve-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, @@ -1857,7 +1857,7 @@ }, { "path": "font/vertical-bar-bold.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, @@ -1868,37 +1868,37 @@ }, { "path": "font/tilde-bold.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/eye.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/ae-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/ae-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-stroke-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-stroke-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, @@ -2024,7 +2024,7 @@ }, { "path": "font/cyrillic/U1075-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, @@ -2045,7 +2045,7 @@ }, { "path": "font/cyrillic/U1080-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, @@ -2056,25 +2056,25 @@ }, { "path": "font/cyrillic/U1082-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1083-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1084-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1085-tiny.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, @@ -2085,7 +2085,7 @@ }, { "path": "font/cyrillic/U1090-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, @@ -2106,25 +2106,25 @@ }, { "path": "font/cyrillic/U1096-tiny.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1097-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1099-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1100-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, @@ -2135,19 +2135,19 @@ }, { "path": "font/cyrillic/U1102-tiny.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1103-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/cyrillic/U1108-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, @@ -2158,277 +2158,277 @@ }, { "path": "font/cyrillic/U1169-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/german-openquotes-tiny.png", - "y_offset": 4, + "y": 4, "palette": "keep", "forceBmp": true }, { "path": "font/guilder-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-breve-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/i-with-dot-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-cedilla-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-breve-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/i-without-dot-tiny.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-cedilla-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/interpunct-tiny.png", - "y_offset": 2, + "y": 2, "palette": "keep", "forceBmp": true }, { "path": "font/latin/a-breve-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-comma-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-comma-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/ellipsis-tiny.png", - "y_offset": 4, + "y": 4, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-caron-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-caron-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-acute-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-acute-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-double-acute-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/o-double-acute-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/oe-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/oe-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-double-acute-uc-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-double-acute-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/d-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/d-caron-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/e-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/e-caron-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/n-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/n-caron-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/r-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/r-caron-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-caron-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/t-caron-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-ring-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-ring-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/w-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/w-circumflex-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/y-circumflex-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/z-caron-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/z-caron-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/rouble-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-tiny.png", - "x_offset": 0, + "x": 0, "palette": "keep", "forceBmp": true }, @@ -2439,73 +2439,73 @@ }, { "path": "font/latin/c-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/c-circumflex-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/g-circumflex-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/h-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/h-circumflex-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/j-circumflex-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-circumflex-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/s-circumflex-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-breve-uc-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, { "path": "font/latin/u-breve-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, @@ -2516,7 +2516,7 @@ }, { "path": "font/vertical-bar-tiny.png", - "y_offset": -1, + "y": -1, "palette": "keep", "forceBmp": true }, @@ -2527,13 +2527,13 @@ }, { "path": "font/tilde-tiny.png", - "y_offset": 1, + "y": 1, "palette": "keep", "forceBmp": true }, { "path": "font/eye-tiny.png", - "y_offset": 0, + "y": 0, "palette": "keep", "forceBmp": true }, @@ -2611,22314 +2611,22314 @@ }, { "path": "track/junior/booster_1.png", - "x_offset": -21, - "y_offset": 0 + "x": -21, + "y": 0 }, { "path": "track/junior/booster_2.png", - "x_offset": -22, - "y_offset": 1 + "x": -22, + "y": 1 }, { "path": "track/junior/brake_horizontal.png", - "x_offset": -32, - "y_offset": 7, + "x": -32, + "y": 7, "palette": "keep" }, { "path": "track/junior/brake_vertical.png", - "x_offset": -9, - "y_offset": -4, + "x": -9, + "y": -4, "palette": "keep" }, { "path": "track/junior/blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": 7, + "x": -32, + "y": 7, "palette": "keep" }, { "path": "track/junior/blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": 7, + "x": -32, + "y": 7, "palette": "keep" }, { "path": "track/junior/blockbrake_vertical_closed.png", - "x_offset": -9, - "y_offset": -4, + "x": -9, + "y": -4, "palette": "keep" }, { "path": "track/junior/blockbrake_vertical_open.png", - "x_offset": -9, - "y_offset": -4, + "x": -9, + "y": -4, "palette": "keep" }, { "path": "track/intamin/booster_1.png", - "x_offset": -22, - "y_offset": -4 + "x": -22, + "y": -4 }, { "path": "track/intamin/booster_2.png", - "x_offset": -22, - "y_offset": -4 + "x": -22, + "y": -4 }, { "path": "track/intamin/brake_horizontal_background_open.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/brake_horizontal_background_closed.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/brake_horizontal_foreground.png", - "x_offset": -30, - "y_offset": 8, + "x": -30, + "y": 8, "palette": "keep" }, { "path": "track/intamin/brake_vertical_background.png", - "x_offset": -14, - "y_offset": -10, + "x": -14, + "y": -10, "palette": "keep" }, { "path": "track/intamin/brake_vertical_foreground_open.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/intamin/brake_vertical_foreground_closed.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/intamin/liftbooster_0.png", - "x_offset": -21, - "y_offset": -20, + "x": -21, + "y": -20, "palette": "keep" }, { "path": "track/intamin/liftbooster_1.png", - "x_offset": -21, - "y_offset": -4, + "x": -21, + "y": -4, "palette": "keep" }, { "path": "track/intamin/liftbooster_2.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/liftbooster_3.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/intamin/steep_to_vertical_up_1.png", - "x_offset": -21, - "y_offset": -54, + "x": -21, + "y": -54, "palette": "keep" }, { "path": "track/intamin/steep_to_vertical_up_2.png", - "x_offset": -21, - "y_offset": -53, + "x": -21, + "y": -53, "palette": "keep" }, { "path": "track/intamin/steep_to_vertical_up_3.png", - "x_offset": -10, - "y_offset": -53, + "x": -10, + "y": -53, "palette": "keep" }, { "path": "track/intamin/steep_to_vertical_up_4.png", - "x_offset": -10, - "y_offset": -54, + "x": -10, + "y": -54, "palette": "keep" }, { "path": "track/intamin/vertical_to_steep_up_1.png", - "x_offset": -6, - "y_offset": -60, + "x": -6, + "y": -60, "palette": "keep" }, { "path": "track/intamin/vertical_to_steep_up_2.png", - "x_offset": -6, - "y_offset": -44, + "x": -6, + "y": -44, "palette": "keep" }, { "path": "track/intamin/vertical_to_steep_up_3.png", - "x_offset": -25, - "y_offset": -44, + "x": -25, + "y": -44, "palette": "keep" }, { "path": "track/intamin/vertical_to_steep_up_4.png", - "x_offset": -25, - "y_offset": -61, + "x": -25, + "y": -61, "palette": "keep" }, { "path": "track/intamin/vertical_1.png", - "x_offset": -6, - "y_offset": -30, + "x": -6, + "y": -30, "palette": "keep" }, { "path": "track/intamin/vertical_2.png", - "x_offset": -6, - "y_offset": -29, + "x": -6, + "y": -29, "palette": "keep" }, { "path": "track/intamin/vertical_3.png", - "x_offset": -10, - "y_offset": -29, + "x": -10, + "y": -29, "palette": "keep" }, { "path": "track/intamin/vertical_4.png", - "x_offset": -10, - "y_offset": -30, + "x": -10, + "y": -30, "palette": "keep" }, { "path": "track/intamin/vertical_twist_left_up_1.png", - "x_offset": -10, - "y_offset": -95, + "x": -10, + "y": -95, "palette": "keep" }, { "path": "track/intamin/vertical_twist_left_up_2_1.png", - "x_offset": -6, - "y_offset": -94, + "x": -6, + "y": -94, "palette": "keep" }, { "path": "track/intamin/vertical_twist_left_up_2_2.png", - "x_offset": -6, - "y_offset": -45, + "x": -6, + "y": -45, "palette": "keep" }, { "path": "track/intamin/vertical_twist_left_up_3.png", - "x_offset": -10, - "y_offset": -93, + "x": -10, + "y": -93, "palette": "keep" }, { "path": "track/intamin/vertical_twist_left_up_4_1.png", - "x_offset": -13, - "y_offset": -44, + "x": -13, + "y": -44, "palette": "keep" }, { "path": "track/intamin/vertical_twist_left_up_4_2.png", - "x_offset": -13, - "y_offset": -93, + "x": -13, + "y": -93, "palette": "keep" }, { "path": "track/intamin/vertical_twist_right_up_1_1.png", - "x_offset": -6, - "y_offset": -45, + "x": -6, + "y": -45, "palette": "keep" }, { "path": "track/intamin/vertical_twist_right_up_1_2.png", - "x_offset": -6, - "y_offset": -93, + "x": -6, + "y": -93, "palette": "keep" }, { "path": "track/intamin/vertical_twist_right_up_2.png", - "x_offset": -10, - "y_offset": -93, + "x": -10, + "y": -93, "palette": "keep" }, { "path": "track/intamin/vertical_twist_right_up_3_1.png", - "x_offset": -13, - "y_offset": -94, + "x": -13, + "y": -94, "palette": "keep" }, { "path": "track/intamin/vertical_twist_right_up_3_2.png", - "x_offset": -13, - "y_offset": -45, + "x": -13, + "y": -45, "palette": "keep" }, { "path": "track/intamin/vertical_twist_right_up_4.png", - "x_offset": -10, - "y_offset": -94, + "x": -10, + "y": -94, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_1_1.png", - "x_offset": -22, - "y_offset": 4, + "x": -22, + "y": 4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_1_2.png", - "x_offset": -17, - "y_offset": 4, + "x": -17, + "y": 4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_1_3.png", - "x_offset": -22, - "y_offset": 3, + "x": -22, + "y": 3, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_1_4.png", - "x_offset": -20, - "y_offset": -21, + "x": -20, + "y": -21, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_1_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_1_6.png", - "x_offset": -11, - "y_offset": -31, + "x": -11, + "y": -31, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_2_1.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_2_2.png", - "x_offset": -20, - "y_offset": 4, + "x": -20, + "y": 4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_2_3.png", - "x_offset": -28, - "y_offset": -5, + "x": -28, + "y": -5, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_2_4.png", - "x_offset": -28, - "y_offset": -8, + "x": -28, + "y": -8, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_2_5.png", - "x_offset": 10, - "y_offset": -1, + "x": 10, + "y": -1, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_2_6.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_3_1.png", - "x_offset": -29, - "y_offset": -4, + "x": -29, + "y": -4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_3_2.png", - "x_offset": 10, - "y_offset": 8, + "x": 10, + "y": 8, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_3_3.png", - "x_offset": -26, - "y_offset": -16, + "x": -26, + "y": -16, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_3_4.png", - "x_offset": -28, - "y_offset": -13, + "x": -28, + "y": -13, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_3_5.png", - "x_offset": -1, - "y_offset": -16, + "x": -1, + "y": -16, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_3_6.png", - "x_offset": -22, - "y_offset": -29, + "x": -22, + "y": -29, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -15, + "x": -15, + "y": -15, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_4_2.png", - "x_offset": 13, - "y_offset": 23, + "x": 13, + "y": 23, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_4_3.png", - "x_offset": -12, - "y_offset": -23, + "x": -12, + "y": -23, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_4_4.png", - "x_offset": -10, - "y_offset": -31, + "x": -10, + "y": -31, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_4_5.png", - "x_offset": -12, - "y_offset": -16, + "x": -12, + "y": -16, "palette": "keep" }, { "path": "track/intamin/barrel_roll_left_4_6.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_1_1.png", - "x_offset": -22, - "y_offset": -15, + "x": -22, + "y": -15, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_1_2.png", - "x_offset": -17, - "y_offset": 22, + "x": -17, + "y": 22, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_1_3.png", - "x_offset": -26, - "y_offset": -23, + "x": -26, + "y": -23, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_1_4.png", - "x_offset": -15, - "y_offset": -31, + "x": -15, + "y": -31, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_1_5.png", - "x_offset": -22, - "y_offset": -12, + "x": -22, + "y": -12, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_1_6.png", - "x_offset": -26, - "y_offset": -31, + "x": -26, + "y": -31, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_2_1.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_2_2.png", - "x_offset": -17, - "y_offset": 9, + "x": -17, + "y": 9, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_2_3.png", - "x_offset": -7, - "y_offset": -15, + "x": -7, + "y": -15, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_2_4.png", - "x_offset": 14, - "y_offset": -12, + "x": 14, + "y": -12, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_2_5.png", - "x_offset": -7, - "y_offset": -16, + "x": -7, + "y": -16, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_2_6.png", - "x_offset": -6, - "y_offset": -28, + "x": -6, + "y": -28, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_3_1.png", - "x_offset": -2, - "y_offset": -4, + "x": -2, + "y": -4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_3_2.png", - "x_offset": -4, - "y_offset": 4, + "x": -4, + "y": 4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_3_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_3_4.png", - "x_offset": 0, - "y_offset": -8, + "x": 0, + "y": -8, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_3_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_3_6.png", - "x_offset": -22, - "y_offset": -21, + "x": -22, + "y": -21, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_4_1.png", - "x_offset": -12, - "y_offset": 4, + "x": -12, + "y": 4, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_4_2.png", - "x_offset": -25, - "y_offset": 5, + "x": -25, + "y": 5, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_4_3.png", - "x_offset": 8, - "y_offset": 14, + "x": 8, + "y": 14, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_4_4.png", - "x_offset": -28, - "y_offset": -21, + "x": -28, + "y": -21, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_4_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/barrel_roll_right_4_6.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/half_loop_1_1.png", - "x_offset": -28, - "y_offset": -22, + "x": -28, + "y": -22, "palette": "keep" }, { "path": "track/intamin/half_loop_1_2.png", - "x_offset": -23, - "y_offset": -40, + "x": -23, + "y": -40, "palette": "keep" }, { "path": "track/intamin/half_loop_1_3.png", - "x_offset": -13, - "y_offset": -92, + "x": -13, + "y": -92, "palette": "keep" }, { "path": "track/intamin/half_loop_1_4.png", - "x_offset": -22, - "y_offset": 13, + "x": -22, + "y": 13, "palette": "keep" }, { "path": "track/intamin/half_loop_2_1.png", - "x_offset": -16, - "y_offset": -18, + "x": -16, + "y": -18, "palette": "keep" }, { "path": "track/intamin/half_loop_2_2.png", - "x_offset": 1, - "y_offset": -37, + "x": 1, + "y": -37, "palette": "keep" }, { "path": "track/intamin/half_loop_2_3.png", - "x_offset": -38, - "y_offset": -114, + "x": -38, + "y": -114, "palette": "keep" }, { "path": "track/intamin/half_loop_2_4.png", - "x_offset": -22, - "y_offset": 1, + "x": -22, + "y": 1, "palette": "keep" }, { "path": "track/intamin/half_loop_3_1.png", - "x_offset": -29, - "y_offset": -9, + "x": -29, + "y": -9, "palette": "keep" }, { "path": "track/intamin/half_loop_3_2.png", - "x_offset": -30, - "y_offset": -33, + "x": -30, + "y": -33, "palette": "keep" }, { "path": "track/intamin/half_loop_3_3.png", - "x_offset": -2, - "y_offset": -121, + "x": -2, + "y": -121, "palette": "keep" }, { "path": "track/intamin/half_loop_3_4.png", - "x_offset": -29, - "y_offset": -7, + "x": -29, + "y": -7, "palette": "keep" }, { "path": "track/intamin/half_loop_4_1.png", - "x_offset": -13, - "y_offset": -22, + "x": -13, + "y": -22, "palette": "keep" }, { "path": "track/intamin/half_loop_4_2.png", - "x_offset": -14, - "y_offset": -44, + "x": -14, + "y": -44, "palette": "keep" }, { "path": "track/intamin/half_loop_4_3.png", - "x_offset": 4, - "y_offset": -101, + "x": 4, + "y": -101, "palette": "keep" }, { "path": "track/intamin/half_loop_4_4.png", - "x_offset": 1, - "y_offset": 4, + "x": 1, + "y": 4, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_1_1.png", - "x_offset": -28, - "y_offset": -25, + "x": -28, + "y": -25, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_1_2.png", - "x_offset": -26, - "y_offset": -111, + "x": -26, + "y": -111, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_1_3.png", - "x_offset": -22, - "y_offset": -84, + "x": -22, + "y": -84, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_1_4.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_2_1.png", - "x_offset": -15, - "y_offset": -26, + "x": -15, + "y": -26, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_2_2.png", - "x_offset": 1, - "y_offset": -32, + "x": 1, + "y": -32, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_2_3.png", - "x_offset": -34, - "y_offset": -114, + "x": -34, + "y": -114, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_2_4.png", - "x_offset": -6, - "y_offset": -3, + "x": -6, + "y": -3, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_3_1.png", - "x_offset": -25, - "y_offset": -110, + "x": -25, + "y": -110, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_3_2.png", - "x_offset": -19, - "y_offset": -51, + "x": -19, + "y": -51, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_3_3.png", - "x_offset": 11, - "y_offset": -94, + "x": 11, + "y": -94, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_3_4.png", - "x_offset": -22, - "y_offset": 3, + "x": -22, + "y": 3, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_4_1.png", - "x_offset": -15, - "y_offset": -20, + "x": -15, + "y": -20, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_4_2.png", - "x_offset": -20, - "y_offset": -41, + "x": -20, + "y": -41, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_4_3.png", - "x_offset": -4, - "y_offset": -87, + "x": -4, + "y": -87, "palette": "keep" }, { "path": "track/intamin/left_vertical_loop_4_4.png", - "x_offset": -13, - "y_offset": 17, + "x": -13, + "y": 17, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_1_1.png", - "x_offset": -27, - "y_offset": -20, + "x": -27, + "y": -20, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_1_2.png", - "x_offset": -27, - "y_offset": -41, + "x": -27, + "y": -41, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_1_3.png", - "x_offset": -20, - "y_offset": -86, + "x": -20, + "y": -86, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_1_4.png", - "x_offset": -21, - "y_offset": 16, + "x": -21, + "y": 16, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_2_1.png", - "x_offset": -16, - "y_offset": -9, + "x": -16, + "y": -9, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_2_2.png", - "x_offset": -7, - "y_offset": -51, + "x": -7, + "y": -51, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_2_3.png", - "x_offset": -23, - "y_offset": -100, + "x": -23, + "y": -100, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_2_4.png", - "x_offset": -16, - "y_offset": 5, + "x": -16, + "y": 5, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_3_1.png", - "x_offset": -46, - "y_offset": -26, + "x": -46, + "y": -26, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_3_2.png", - "x_offset": -41, - "y_offset": -32, + "x": -41, + "y": -32, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_3_3.png", - "x_offset": 8, - "y_offset": -114, + "x": 8, + "y": -114, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_3_4.png", - "x_offset": -27, - "y_offset": 0, + "x": -27, + "y": 0, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_4_1.png", - "x_offset": -10, - "y_offset": -25, + "x": -10, + "y": -25, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_4_2.png", - "x_offset": -11, - "y_offset": -111, + "x": -11, + "y": -111, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_4_3.png", - "x_offset": 1, - "y_offset": -83, + "x": 1, + "y": -83, "palette": "keep" }, { "path": "track/intamin/right_vertical_loop_4_4.png", - "x_offset": -9, - "y_offset": 9, + "x": -9, + "y": 9, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_1_1.png", - "x_offset": -18, - "y_offset": -55, + "x": -18, + "y": -55, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_1_2.png", - "x_offset": 0, - "y_offset": -43, + "x": 0, + "y": -43, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_1_3.png", - "x_offset": -22, - "y_offset": -23, + "x": -22, + "y": -23, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_2_1.png", - "x_offset": -24, - "y_offset": -79, + "x": -24, + "y": -79, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_2_2.png", - "x_offset": -32, - "y_offset": -66, + "x": -32, + "y": -66, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_2_3.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_3_1.png", - "x_offset": -10, - "y_offset": -78, + "x": -10, + "y": -78, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_3_2.png", - "x_offset": -21, - "y_offset": -68, + "x": -21, + "y": -68, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_3_3.png", - "x_offset": -11, - "y_offset": -31, + "x": -11, + "y": -31, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_4_1.png", - "x_offset": -10, - "y_offset": -56, + "x": -10, + "y": -56, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_4_2.png", - "x_offset": -28, - "y_offset": -43, + "x": -28, + "y": -43, "palette": "keep" }, { "path": "track/intamin/quarter_loop_up_4_3.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_1_1.png", - "x_offset": -22, - "y_offset": -71, + "x": -22, + "y": -71, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_1_2.png", - "x_offset": -20, - "y_offset": -36, + "x": -20, + "y": -36, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_1_3.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_2_1.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_2_2.png", - "x_offset": -32, - "y_offset": -36, + "x": -32, + "y": -36, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_2_3.png", - "x_offset": -21, - "y_offset": -31, + "x": -21, + "y": -31, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_3_1.png", - "x_offset": -31, - "y_offset": -9, + "x": -31, + "y": -9, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_3_2.png", - "x_offset": -3, - "y_offset": -24, + "x": -3, + "y": -24, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_3_3.png", - "x_offset": -19, - "y_offset": -19, + "x": -19, + "y": -19, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_4_1.png", - "x_offset": -32, - "y_offset": -39, + "x": -32, + "y": -39, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_4_2.png", - "x_offset": -34, - "y_offset": -21, + "x": -34, + "y": -21, "palette": "keep" }, { "path": "track/intamin/corkscrew_left_4_3.png", - "x_offset": -22, - "y_offset": -22, + "x": -22, + "y": -22, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_1_1.png", - "x_offset": -22, - "y_offset": -39, + "x": -22, + "y": -39, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_1_2.png", - "x_offset": -8, - "y_offset": -22, + "x": -8, + "y": -22, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_1_3.png", - "x_offset": -20, - "y_offset": -22, + "x": -20, + "y": -22, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_2_1.png", - "x_offset": -22, - "y_offset": -9, + "x": -22, + "y": -9, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_2_2.png", - "x_offset": -13, - "y_offset": -24, + "x": -13, + "y": -24, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_2_3.png", - "x_offset": -22, - "y_offset": -19, + "x": -22, + "y": -19, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_3_1.png", - "x_offset": -7, - "y_offset": -4, + "x": -7, + "y": -4, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_3_2.png", - "x_offset": -22, - "y_offset": -36, + "x": -22, + "y": -36, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_3_3.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_4_1.png", - "x_offset": -27, - "y_offset": -65, + "x": -27, + "y": -65, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_4_2.png", - "x_offset": -3, - "y_offset": -36, + "x": -3, + "y": -36, "palette": "keep" }, { "path": "track/intamin/corkscrew_right_4_3.png", - "x_offset": -26, - "y_offset": -31, + "x": -26, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_1_1.png", - "x_offset": -22, - "y_offset": -12, + "x": -22, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_1_2.png", - "x_offset": -21, - "y_offset": -72, + "x": -21, + "y": -72, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_1_3.png", - "x_offset": -28, - "y_offset": -40, + "x": -28, + "y": -40, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_1_4.png", - "x_offset": -23, - "y_offset": -52, + "x": -23, + "y": -52, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_1_5.png", - "x_offset": -22, - "y_offset": -39, + "x": -22, + "y": -39, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_2_1.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_2_2.png", - "x_offset": -32, - "y_offset": -15, + "x": -32, + "y": -15, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_2_3.png", - "x_offset": -23, - "y_offset": -50, + "x": -23, + "y": -50, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_2_4.png", - "x_offset": -18, - "y_offset": -56, + "x": -18, + "y": -56, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_2_5.png", - "x_offset": -14, - "y_offset": -39, + "x": -14, + "y": -39, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_3_1.png", - "x_offset": -16, - "y_offset": -4, + "x": -16, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_3_2.png", - "x_offset": -19, - "y_offset": -17, + "x": -19, + "y": -17, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_3_3.png", - "x_offset": 10, - "y_offset": -33, + "x": 10, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_3_4.png", - "x_offset": -8, - "y_offset": -38, + "x": -8, + "y": -38, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_3_5.png", - "x_offset": -16, - "y_offset": -30, + "x": -16, + "y": -30, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_4_1.png", - "x_offset": -24, - "y_offset": -11, + "x": -24, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_4_2.png", - "x_offset": -23, - "y_offset": -27, + "x": -23, + "y": -27, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_4_3.png", - "x_offset": -14, - "y_offset": -13, + "x": -14, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_4_4.png", - "x_offset": -29, - "y_offset": -36, + "x": -29, + "y": -36, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_left_4_5.png", - "x_offset": -22, - "y_offset": -33, + "x": -22, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_1_1.png", - "x_offset": -22, - "y_offset": -11, + "x": -22, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_1_2.png", - "x_offset": -22, - "y_offset": -27, + "x": -22, + "y": -27, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_1_3.png", - "x_offset": -20, - "y_offset": -13, + "x": -20, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_1_4.png", - "x_offset": -28, - "y_offset": -37, + "x": -28, + "y": -37, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_1_5.png", - "x_offset": -32, - "y_offset": -33, + "x": -32, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_2_1.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_2_2.png", - "x_offset": -16, - "y_offset": -17, + "x": -16, + "y": -17, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_2_3.png", - "x_offset": -24, - "y_offset": -32, + "x": -24, + "y": -32, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_2_4.png", - "x_offset": -16, - "y_offset": -38, + "x": -16, + "y": -38, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_2_5.png", - "x_offset": -22, - "y_offset": -30, + "x": -22, + "y": -30, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_3_1.png", - "x_offset": -29, - "y_offset": -4, + "x": -29, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_3_2.png", - "x_offset": -16, - "y_offset": -15, + "x": -16, + "y": -15, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_3_3.png", - "x_offset": -25, - "y_offset": -50, + "x": -25, + "y": -50, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_3_4.png", - "x_offset": -28, - "y_offset": -56, + "x": -28, + "y": -56, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_3_5.png", - "x_offset": -22, - "y_offset": -39, + "x": -22, + "y": -39, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_4_1.png", - "x_offset": -26, - "y_offset": -12, + "x": -26, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_4_2.png", - "x_offset": -11, - "y_offset": -68, + "x": -11, + "y": -68, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_4_3.png", - "x_offset": 10, - "y_offset": -40, + "x": 10, + "y": -40, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_4_4.png", - "x_offset": -17, - "y_offset": -52, + "x": -17, + "y": -52, "palette": "keep" }, { "path": "track/intamin/large_corkscrew_right_4_5.png", - "x_offset": -24, - "y_offset": -39, + "x": -24, + "y": -39, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_1_1.png", - "x_offset": -26, - "y_offset": -20, + "x": -26, + "y": -20, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_1_2.png", - "x_offset": -16, - "y_offset": -15, + "x": -16, + "y": -15, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_2_1.png", - "x_offset": 3, - "y_offset": -5, + "x": 3, + "y": -5, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_2_2.png", - "x_offset": -17, - "y_offset": -7, + "x": -17, + "y": -7, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_2_3.png", - "x_offset": -38, - "y_offset": -15, + "x": -38, + "y": -15, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_3_1.png", - "x_offset": -18, - "y_offset": -11, + "x": -18, + "y": -11, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_3_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -12, + "x": -26, + "y": -12, "palette": "keep" }, { "path": "track/intamin/small_turn_left_bank_to_gentle_up_4_2.png", - "x_offset": -28, - "y_offset": 1, + "x": -28, + "y": 1, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_1_1.png", - "x_offset": -29, - "y_offset": -12, + "x": -29, + "y": -12, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": 1, + "x": -26, + "y": 1, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_2_1.png", - "x_offset": -13, - "y_offset": -11, + "x": -13, + "y": -11, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_2_2.png", - "x_offset": -28, - "y_offset": -4, + "x": -28, + "y": -4, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": -6, + "x": -38, + "y": -6, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_3_2.png", - "x_offset": -38, - "y_offset": -6, + "x": -38, + "y": -6, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_3_3.png", - "x_offset": -16, - "y_offset": -15, + "x": -16, + "y": -15, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_4_1.png", - "x_offset": -6, - "y_offset": -20, + "x": -6, + "y": -20, "palette": "keep" }, { "path": "track/intamin/small_turn_right_bank_to_gentle_up_4_2.png", - "x_offset": -18, - "y_offset": -15, + "x": -18, + "y": -15, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_1_1.png", - "x_offset": -22, - "y_offset": -34, + "x": -22, + "y": -34, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_1_2.png", - "x_offset": -21, - "y_offset": -51, + "x": -21, + "y": -51, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_1_3.png", - "x_offset": -29, - "y_offset": -100, + "x": -29, + "y": -100, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_1_4.png", - "x_offset": -44, - "y_offset": -128, + "x": -44, + "y": -128, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_1_5.png", - "x_offset": -21, - "y_offset": -37, + "x": -21, + "y": -37, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_2_1.png", - "x_offset": -22, - "y_offset": -12, + "x": -22, + "y": -12, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_2_2.png", - "x_offset": 0, - "y_offset": -34, + "x": 0, + "y": -34, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_2_3.png", - "x_offset": 0, - "y_offset": -87, + "x": 0, + "y": -87, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_2_4.png", - "x_offset": -30, - "y_offset": -148, + "x": -30, + "y": -148, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_2_5.png", - "x_offset": -22, - "y_offset": -47, + "x": -22, + "y": -47, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_3_1.png", - "x_offset": -23, - "y_offset": -7, + "x": -23, + "y": -7, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_3_2.png", - "x_offset": 0, - "y_offset": -13, + "x": 0, + "y": -13, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_3_3.png", - "x_offset": -3, - "y_offset": -59, + "x": -3, + "y": -59, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_3_4.png", - "x_offset": -32, - "y_offset": -154, + "x": -32, + "y": -154, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_3_5.png", - "x_offset": -17, - "y_offset": -47, + "x": -17, + "y": -47, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_4_1.png", - "x_offset": -23, - "y_offset": -19, + "x": -23, + "y": -19, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_4_2.png", - "x_offset": -25, - "y_offset": -26, + "x": -25, + "y": -26, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_4_3.png", - "x_offset": -30, - "y_offset": -31, + "x": -30, + "y": -31, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_4_4.png", - "x_offset": -10, - "y_offset": -129, + "x": -10, + "y": -129, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_left_4_5.png", - "x_offset": -28, - "y_offset": -40, + "x": -28, + "y": -40, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_1_1.png", - "x_offset": -22, - "y_offset": -19, + "x": -22, + "y": -19, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_1_2.png", - "x_offset": -19, - "y_offset": -26, + "x": -19, + "y": -26, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_1_3.png", - "x_offset": -17, - "y_offset": -31, + "x": -17, + "y": -31, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_1_4.png", - "x_offset": -26, - "y_offset": -129, + "x": -26, + "y": -129, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_1_5.png", - "x_offset": -22, - "y_offset": -40, + "x": -22, + "y": -40, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_2_1.png", - "x_offset": -22, - "y_offset": -7, + "x": -22, + "y": -7, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_2_2.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_2_3.png", - "x_offset": -32, - "y_offset": -59, + "x": -32, + "y": -59, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_2_4.png", - "x_offset": -25, - "y_offset": -154, + "x": -25, + "y": -154, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_2_5.png", - "x_offset": -21, - "y_offset": -47, + "x": -21, + "y": -47, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_3_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_3_2.png", - "x_offset": -32, - "y_offset": -34, + "x": -32, + "y": -34, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_3_3.png", - "x_offset": -32, - "y_offset": -87, + "x": -32, + "y": -87, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_3_4.png", - "x_offset": -10, - "y_offset": -148, + "x": -10, + "y": -148, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_3_5.png", - "x_offset": -12, - "y_offset": -47, + "x": -12, + "y": -47, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_4_1.png", - "x_offset": -23, - "y_offset": -34, + "x": -23, + "y": -34, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_4_2.png", - "x_offset": -16, - "y_offset": -51, + "x": -16, + "y": -51, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_4_3.png", - "x_offset": -3, - "y_offset": -100, + "x": -3, + "y": -100, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_4_4.png", - "x_offset": -32, - "y_offset": -128, + "x": -32, + "y": -128, "palette": "keep" }, { "path": "track/intamin/medium_half_loop_right_4_5.png", - "x_offset": -32, - "y_offset": -37, + "x": -32, + "y": -37, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_1.png", - "x_offset": -22, - "y_offset": -29, + "x": -22, + "y": -29, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_2.png", - "x_offset": -18, - "y_offset": -42, + "x": -18, + "y": -42, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_3.png", - "x_offset": -19, - "y_offset": -70, + "x": -19, + "y": -70, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_4.png", - "x_offset": -24, - "y_offset": -85, + "x": -24, + "y": -85, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_5.png", - "x_offset": -16, - "y_offset": -70, + "x": -16, + "y": -70, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_6.png", - "x_offset": -9, - "y_offset": -183, + "x": -9, + "y": -183, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_1_7.png", - "x_offset": -21, - "y_offset": -20, + "x": -21, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_1.png", - "x_offset": -22, - "y_offset": -5, + "x": -22, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_2.png", - "x_offset": -6, - "y_offset": -9, + "x": -6, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_3.png", - "x_offset": -9, - "y_offset": -27, + "x": -9, + "y": -27, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_4.png", - "x_offset": -8, - "y_offset": -94, + "x": -8, + "y": -94, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_5.png", - "x_offset": -32, - "y_offset": -130, + "x": -32, + "y": -130, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_6.png", - "x_offset": -25, - "y_offset": -197, + "x": -25, + "y": -197, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_2_7.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_1.png", - "x_offset": -24, - "y_offset": -3, + "x": -24, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_2.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_3.png", - "x_offset": -29, - "y_offset": -38, + "x": -29, + "y": -38, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_4.png", - "x_offset": -7, - "y_offset": -61, + "x": -7, + "y": -61, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_5.png", - "x_offset": -7, - "y_offset": -117, + "x": -7, + "y": -117, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_6.png", - "x_offset": -22, - "y_offset": -197, + "x": -22, + "y": -197, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_3_7.png", - "x_offset": -28, - "y_offset": -32, + "x": -28, + "y": -32, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_1.png", - "x_offset": -24, - "y_offset": -18, + "x": -24, + "y": -18, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_2.png", - "x_offset": -30, - "y_offset": -21, + "x": -30, + "y": -21, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_3.png", - "x_offset": -32, - "y_offset": -52, + "x": -32, + "y": -52, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_4.png", - "x_offset": -32, - "y_offset": -84, + "x": -32, + "y": -84, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_5.png", - "x_offset": 16, - "y_offset": -62, + "x": 16, + "y": -62, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_6.png", - "x_offset": -16, - "y_offset": -186, + "x": -16, + "y": -186, "palette": "keep" }, { "path": "track/intamin/large_half_loop_left_4_7.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_1.png", - "x_offset": -22, - "y_offset": -18, + "x": -22, + "y": -18, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_2.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_3.png", - "x_offset": -13, - "y_offset": -52, + "x": -13, + "y": -52, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_4.png", - "x_offset": 0, - "y_offset": -84, + "x": 0, + "y": -84, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_5.png", - "x_offset": -32, - "y_offset": -62, + "x": -32, + "y": -62, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_6.png", - "x_offset": -19, - "y_offset": -186, + "x": -19, + "y": -186, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_1_7.png", - "x_offset": -22, - "y_offset": -22, + "x": -22, + "y": -22, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_1.png", - "x_offset": -22, - "y_offset": -3, + "x": -22, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_2.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_3.png", - "x_offset": -6, - "y_offset": -38, + "x": -6, + "y": -38, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_4.png", - "x_offset": -16, - "y_offset": -61, + "x": -16, + "y": -61, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_5.png", - "x_offset": -23, - "y_offset": -117, + "x": -23, + "y": -117, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_6.png", - "x_offset": -17, - "y_offset": -197, + "x": -17, + "y": -197, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_2_7.png", - "x_offset": -21, - "y_offset": -32, + "x": -21, + "y": -32, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_1.png", - "x_offset": -26, - "y_offset": -5, + "x": -26, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_2.png", - "x_offset": -30, - "y_offset": -9, + "x": -30, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_3.png", - "x_offset": -29, - "y_offset": -27, + "x": -29, + "y": -27, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_4.png", - "x_offset": -32, - "y_offset": -94, + "x": -32, + "y": -94, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_5.png", - "x_offset": 16, - "y_offset": -130, + "x": 16, + "y": -130, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_6.png", - "x_offset": 0, - "y_offset": -197, + "x": 0, + "y": -197, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_3_7.png", - "x_offset": -17, - "y_offset": -31, + "x": -17, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_1.png", - "x_offset": -24, - "y_offset": -29, + "x": -24, + "y": -29, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_2.png", - "x_offset": -25, - "y_offset": -42, + "x": -25, + "y": -42, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_3.png", - "x_offset": -21, - "y_offset": -70, + "x": -21, + "y": -70, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_4.png", - "x_offset": -5, - "y_offset": -85, + "x": -5, + "y": -85, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_5.png", - "x_offset": -7, - "y_offset": -70, + "x": -7, + "y": -70, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_6.png", - "x_offset": -32, - "y_offset": -183, + "x": -32, + "y": -183, "palette": "keep" }, { "path": "track/intamin/large_half_loop_right_4_7.png", - "x_offset": -31, - "y_offset": -20, + "x": -31, + "y": -20, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_1_1.png", - "x_offset": -22, - "y_offset": -15, + "x": -22, + "y": -15, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_1_2.png", - "x_offset": -10, - "y_offset": -16, + "x": -10, + "y": -16, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_1_3.png", - "x_offset": -11, - "y_offset": -26, + "x": -11, + "y": -26, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_1_4.png", - "x_offset": -19, - "y_offset": -31, + "x": -19, + "y": -31, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_2_1.png", - "x_offset": -22, - "y_offset": -3, + "x": -22, + "y": -3, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_2_2.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_2_3.png", - "x_offset": -23, - "y_offset": -18, + "x": -23, + "y": -18, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_2_4.png", - "x_offset": -21, - "y_offset": -18, + "x": -21, + "y": -18, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_3_1.png", - "x_offset": -20, - "y_offset": -11, + "x": -20, + "y": -11, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_3_2.png", - "x_offset": -22, - "y_offset": -25, + "x": -22, + "y": -25, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_3_3.png", - "x_offset": -11, - "y_offset": -18, + "x": -11, + "y": -18, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_3_4.png", - "x_offset": -23, - "y_offset": -27, + "x": -23, + "y": -27, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -27, + "x": -15, + "y": -27, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_4_2.png", - "x_offset": -11, - "y_offset": -45, + "x": -11, + "y": -45, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_4_3.png", - "x_offset": -3, - "y_offset": -12, + "x": -3, + "y": -12, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_left_4_4.png", - "x_offset": -21, - "y_offset": -31, + "x": -21, + "y": -31, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_1_1.png", - "x_offset": -22, - "y_offset": -27, + "x": -22, + "y": -27, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_1_2.png", - "x_offset": -27, - "y_offset": -45, + "x": -27, + "y": -45, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_1_3.png", - "x_offset": -22, - "y_offset": -16, + "x": -22, + "y": -16, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_1_4.png", - "x_offset": -27, - "y_offset": -31, + "x": -27, + "y": -31, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_2_1.png", - "x_offset": -22, - "y_offset": -11, + "x": -22, + "y": -11, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_2_2.png", - "x_offset": -17, - "y_offset": -25, + "x": -17, + "y": -25, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_2_3.png", - "x_offset": -13, - "y_offset": -18, + "x": -13, + "y": -18, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_2_4.png", - "x_offset": -11, - "y_offset": -27, + "x": -11, + "y": -27, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_3_1.png", - "x_offset": 3, - "y_offset": -3, + "x": 3, + "y": -3, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_3_2.png", - "x_offset": -9, - "y_offset": -4, + "x": -9, + "y": -4, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_3_3.png", - "x_offset": -11, - "y_offset": -18, + "x": -11, + "y": -18, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_3_4.png", - "x_offset": -21, - "y_offset": -18, + "x": -21, + "y": -18, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_4_1.png", - "x_offset": -20, - "y_offset": -15, + "x": -20, + "y": -15, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_4_2.png", - "x_offset": -35, - "y_offset": -16, + "x": -35, + "y": -16, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_4_3.png", - "x_offset": -24, - "y_offset": -26, + "x": -24, + "y": -26, "palette": "keep" }, { "path": "track/intamin/zero_g_roll_right_4_4.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_1_1.png", - "x_offset": -21, - "y_offset": -47, + "x": -21, + "y": -47, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_1_2.png", - "x_offset": -23, - "y_offset": -36, + "x": -23, + "y": -36, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_1_3.png", - "x_offset": -15, - "y_offset": -52, + "x": -15, + "y": -52, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_1_4.png", - "x_offset": -13, - "y_offset": -40, + "x": -13, + "y": -40, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_1_5.png", - "x_offset": -17, - "y_offset": -31, + "x": -17, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_2_1.png", - "x_offset": -21, - "y_offset": -42, + "x": -21, + "y": -42, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_2_2.png", - "x_offset": -25, - "y_offset": -30, + "x": -25, + "y": -30, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_2_3.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_2_4.png", - "x_offset": -29, - "y_offset": -19, + "x": -29, + "y": -19, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_3_1.png", - "x_offset": -10, - "y_offset": -33, + "x": -10, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_3_2.png", - "x_offset": -18, - "y_offset": -31, + "x": -18, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_3_3.png", - "x_offset": -27, - "y_offset": -40, + "x": -27, + "y": -40, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_3_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_3_5.png", - "x_offset": 1, - "y_offset": -12, + "x": 1, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_3_6.png", - "x_offset": -22, - "y_offset": -25, + "x": -22, + "y": -25, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -48, + "x": -15, + "y": -48, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_4_2.png", - "x_offset": -14, - "y_offset": -48, + "x": -14, + "y": -48, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_4_3.png", - "x_offset": -10, - "y_offset": -33, + "x": -10, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_4_4.png", - "x_offset": -9, - "y_offset": -42, + "x": -9, + "y": -42, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_left_4_5.png", - "x_offset": -21, - "y_offset": -31, + "x": -21, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_1_1.png", - "x_offset": -21, - "y_offset": -48, + "x": -21, + "y": -48, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_1_2.png", - "x_offset": -31, - "y_offset": -48, + "x": -31, + "y": -48, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_1_3.png", - "x_offset": -31, - "y_offset": -33, + "x": -31, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_1_4.png", - "x_offset": -30, - "y_offset": -42, + "x": -30, + "y": -42, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_1_5.png", - "x_offset": -32, - "y_offset": -31, + "x": -32, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_2_1.png", - "x_offset": -21, - "y_offset": -33, + "x": -21, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_2_2.png", - "x_offset": -21, - "y_offset": -31, + "x": -21, + "y": -31, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_2_3.png", - "x_offset": -24, - "y_offset": -40, + "x": -24, + "y": -40, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_2_4.png", - "x_offset": -15, - "y_offset": -33, + "x": -15, + "y": -33, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_2_5.png", - "x_offset": -8, - "y_offset": -11, + "x": -8, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_2_6.png", - "x_offset": -8, - "y_offset": -25, + "x": -8, + "y": -25, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_3_1.png", - "x_offset": -17, - "y_offset": -42, + "x": -17, + "y": -42, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_3_2.png", - "x_offset": -11, - "y_offset": -30, + "x": -11, + "y": -30, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_3_3.png", - "x_offset": -5, - "y_offset": -24, + "x": -5, + "y": -24, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_3_4.png", - "x_offset": -21, - "y_offset": -19, + "x": -21, + "y": -19, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_4_1.png", - "x_offset": -23, - "y_offset": -47, + "x": -23, + "y": -47, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_4_2.png", - "x_offset": -6, - "y_offset": -26, + "x": -6, + "y": -26, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_4_3.png", - "x_offset": -32, - "y_offset": -52, + "x": -32, + "y": -52, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_4_4.png", - "x_offset": -26, - "y_offset": -40, + "x": -26, + "y": -40, "palette": "keep" }, { "path": "track/intamin/large_zero_g_roll_right_4_5.png", - "x_offset": -22, - "y_offset": -31, + "x": -22, + "y": -31, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_1.png", - "x_offset": -22, - "y_offset": -28, + "x": -22, + "y": -28, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_2_1.png", - "x_offset": -22, - "y_offset": -10, + "x": -22, + "y": -10, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_2_2.png", - "x_offset": -18, - "y_offset": -12, + "x": -18, + "y": -12, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_3_1.png", - "x_offset": -6, - "y_offset": -4, + "x": -6, + "y": -4, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_3_2.png", - "x_offset": -25, - "y_offset": -12, + "x": -25, + "y": -12, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_4.png", - "x_offset": -25, - "y_offset": -29, + "x": -25, + "y": -29, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_1.png", - "x_offset": -21, - "y_offset": -28, + "x": -21, + "y": -28, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_2_1.png", - "x_offset": -12, - "y_offset": -15, + "x": -12, + "y": -15, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_2_2.png", - "x_offset": -21, - "y_offset": -7, + "x": -21, + "y": -7, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_3_1.png", - "x_offset": -22, - "y_offset": -15, + "x": -22, + "y": -15, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_3_2.png", - "x_offset": -17, - "y_offset": -8, + "x": -17, + "y": -8, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_4.png", - "x_offset": -22, - "y_offset": -28, + "x": -22, + "y": -28, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_diag_1.png", - "x_offset": -32, - "y_offset": -22, + "x": -32, + "y": -22, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_diag_2.png", - "x_offset": -8, - "y_offset": -10, + "x": -8, + "y": -10, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_diag_3.png", - "x_offset": -32, - "y_offset": -22, + "x": -32, + "y": -22, "palette": "keep" }, { "path": "track/intamin/small_flat_to_steep_up_diag_4.png", - "x_offset": -8, - "y_offset": -34, + "x": -8, + "y": -34, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_diag_1.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_diag_2.png", - "x_offset": -8, - "y_offset": -15, + "x": -8, + "y": -15, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_diag_3.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/intamin/small_steep_to_flat_up_diag_4.png", - "x_offset": -8, - "y_offset": -34, + "x": -8, + "y": -34, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_1_1.png", - "x_offset": -22, - "y_offset": -16, + "x": -22, + "y": -16, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_1_2.png", - "x_offset": -31, - "y_offset": -24, + "x": -31, + "y": -24, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_1_3.png", - "x_offset": 13, - "y_offset": 8, + "x": 13, + "y": 8, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_1_4.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_2_1.png", - "x_offset": -22, - "y_offset": -5, + "x": -22, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_2_2.png", - "x_offset": -32, - "y_offset": -11, + "x": -32, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_2_3.png", - "x_offset": -24, - "y_offset": 14, + "x": -24, + "y": 14, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_3_1.png", - "x_offset": -5, - "y_offset": -3, + "x": -5, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_3_2.png", - "x_offset": 8, - "y_offset": -3, + "x": 8, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_3_3.png", - "x_offset": -31, - "y_offset": -1, + "x": -31, + "y": -1, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_3_4.png", - "x_offset": -8, - "y_offset": -15, + "x": -8, + "y": -15, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_4_1.png", - "x_offset": -25, - "y_offset": -17, + "x": -25, + "y": -17, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_4_2.png", - "x_offset": -26, - "y_offset": -9, + "x": -26, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": -15, + "x": 0, + "y": -15, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_diag_gentle_up_4_4.png", - "x_offset": 0, - "y_offset": -13, + "x": 0, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_1_1.png", - "x_offset": -22, - "y_offset": -17, + "x": -22, + "y": -17, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_1_2.png", - "x_offset": -18, - "y_offset": -9, + "x": -18, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_1_3.png", - "x_offset": -12, - "y_offset": -15, + "x": -12, + "y": -15, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_2_1.png", - "x_offset": -22, - "y_offset": -3, + "x": -22, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -3, + "x": -34, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_2_3.png", - "x_offset": -2, - "y_offset": -1, + "x": -2, + "y": -1, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_2_4.png", - "x_offset": -13, - "y_offset": -15, + "x": -13, + "y": -15, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_3_1.png", - "x_offset": -6, - "y_offset": -5, + "x": -6, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_3_2.png", - "x_offset": -8, - "y_offset": -11, + "x": -8, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 14, + "x": 0, + "y": 14, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": -13, + "x": 0, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_4_1.png", - "x_offset": -13, - "y_offset": -16, + "x": -13, + "y": -16, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_4_2.png", - "x_offset": -3, - "y_offset": -24, + "x": -3, + "y": -24, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_4_3.png", - "x_offset": -32, - "y_offset": 8, + "x": -32, + "y": 8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_diag_gentle_up_4_4.png", - "x_offset": -8, - "y_offset": -9, + "x": -8, + "y": -9, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -12, + "x": 0, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_1_4.png", - "x_offset": -31, - "y_offset": -20, + "x": -31, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_2_1.png", - "x_offset": -8, - "y_offset": 6, + "x": -8, + "y": 6, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_2_3.png", - "x_offset": -7, - "y_offset": -10, + "x": -7, + "y": -10, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_2_4.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_3_3.png", - "x_offset": -17, - "y_offset": -1, + "x": -17, + "y": -1, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_3_4.png", - "x_offset": -22, - "y_offset": -3, + "x": -22, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_4_1.png", - "x_offset": -9, - "y_offset": -8, + "x": -9, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_4_3.png", - "x_offset": -21, - "y_offset": -4, + "x": -21, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_turn_left_to_orthogonal_gentle_up_4_4.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -6, + "x": 0, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -1, + "x": -32, + "y": -1, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -3, + "x": -32, + "y": -3, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_2_1.png", - "x_offset": 0, - "y_offset": 6, + "x": 0, + "y": 6, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_2_3.png", - "x_offset": -16, - "y_offset": -10, + "x": -16, + "y": -10, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_2_4.png", - "x_offset": -22, - "y_offset": -5, + "x": -22, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_3_3.png", - "x_offset": -11, - "y_offset": -16, + "x": -11, + "y": -16, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_3_4.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_4_1.png", - "x_offset": -8, - "y_offset": -8, + "x": -8, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_4_3.png", - "x_offset": -6, - "y_offset": -4, + "x": -6, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_turn_right_to_orthogonal_gentle_up_4_4.png", - "x_offset": -24, - "y_offset": -20, + "x": -24, + "y": -20, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_left_bank_diag_2.png", - "x_offset": -10, - "y_offset": -10, + "x": -10, + "y": -10, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_left_bank_diag_4.png", - "x_offset": -8, - "y_offset": -30, + "x": -8, + "y": -30, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_right_bank_diag_2.png", - "x_offset": -8, - "y_offset": -10, + "x": -8, + "y": -10, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -31, - "y_offset": -13, + "x": -31, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_to_gentle_up_right_bank_diag_4.png", - "x_offset": -10, - "y_offset": -30, + "x": -10, + "y": -30, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_gentle_up_diag_1_1.png", - "x_offset": -21, - "y_offset": -13, + "x": -21, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_gentle_up_diag_1_2.png", - "x_offset": -32, - "y_offset": -2, + "x": -32, + "y": -2, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_gentle_up_diag_2.png", - "x_offset": -10, - "y_offset": -15, + "x": -10, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_gentle_up_diag_3.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_gentle_up_diag_4.png", - "x_offset": -8, - "y_offset": -25, + "x": -8, + "y": -25, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_gentle_up_diag_2.png", - "x_offset": -8, - "y_offset": -15, + "x": -8, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_gentle_up_diag_3_1.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_gentle_up_diag_3_2.png", - "x_offset": -32, - "y_offset": -2, + "x": -32, + "y": -2, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_gentle_up_diag_4.png", - "x_offset": -10, - "y_offset": -25, + "x": -10, + "y": -25, "palette": "keep" }, { "path": "track/intamin/left_bank_to_gentle_up_left_bank_diag_1.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/left_bank_to_gentle_up_left_bank_diag_2.png", - "x_offset": -11, - "y_offset": -14, + "x": -11, + "y": -14, "palette": "keep" }, { "path": "track/intamin/left_bank_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/left_bank_to_gentle_up_left_bank_diag_4.png", - "x_offset": -6, - "y_offset": -22, + "x": -6, + "y": -22, "palette": "keep" }, { "path": "track/intamin/right_bank_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/right_bank_to_gentle_up_right_bank_diag_2.png", - "x_offset": -6, - "y_offset": -13, + "x": -6, + "y": -13, "palette": "keep" }, { "path": "track/intamin/right_bank_to_gentle_up_right_bank_diag_3.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/right_bank_to_gentle_up_right_bank_diag_4.png", - "x_offset": -11, - "y_offset": -22, + "x": -11, + "y": -22, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_left_bank_diag_1.png", - "x_offset": -32, - "y_offset": -3, + "x": -32, + "y": -3, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_left_bank_diag_2.png", - "x_offset": -11, - "y_offset": -15, + "x": -11, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_left_bank_diag_4.png", - "x_offset": -6, - "y_offset": -21, + "x": -6, + "y": -21, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_right_bank_diag_2.png", - "x_offset": -6, - "y_offset": -15, + "x": -6, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_right_bank_diag_3.png", - "x_offset": -32, - "y_offset": -3, + "x": -32, + "y": -3, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_right_bank_diag_4.png", - "x_offset": -11, - "y_offset": -22, + "x": -11, + "y": -22, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_diag_1.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_diag_2.png", - "x_offset": -10, - "y_offset": -15, + "x": -10, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_diag_4.png", - "x_offset": -6, - "y_offset": -30, + "x": -6, + "y": -30, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_diag_2.png", - "x_offset": -6, - "y_offset": -15, + "x": -6, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_diag_3.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_diag_4.png", - "x_offset": -10, - "y_offset": -30, + "x": -10, + "y": -30, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_left_bank_diag_2.png", - "x_offset": -10, - "y_offset": -10, + "x": -10, + "y": -10, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_left_bank_diag_4.png", - "x_offset": -8, - "y_offset": -22, + "x": -8, + "y": -22, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_right_bank_diag_2.png", - "x_offset": -8, - "y_offset": -10, + "x": -8, + "y": -10, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -31, - "y_offset": -5, + "x": -31, + "y": -5, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/flat_to_gentle_up_right_bank_diag_4.png", - "x_offset": -10, - "y_offset": -22, + "x": -10, + "y": -22, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_flat_diag_1_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_flat_diag_1_2.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_flat_diag_2.png", - "x_offset": -10, - "y_offset": -15, + "x": -10, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_flat_diag_3.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/intamin/gentle_up_left_bank_to_flat_diag_4.png", - "x_offset": -8, - "y_offset": -18, + "x": -8, + "y": -18, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_flat_diag_1.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_flat_diag_2.png", - "x_offset": -8, - "y_offset": -15, + "x": -8, + "y": -15, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_flat_diag_3_1.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_flat_diag_3_2.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/intamin/gentle_up_right_bank_to_flat_diag_4.png", - "x_offset": -9, - "y_offset": -18, + "x": -9, + "y": -18, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_1_1.png", - "x_offset": -18, - "y_offset": -14, + "x": -18, + "y": -14, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_1_2.png", - "x_offset": -27, - "y_offset": -24, + "x": -27, + "y": -24, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_1_3.png", - "x_offset": 17, - "y_offset": 8, + "x": 17, + "y": 8, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_1_4.png", - "x_offset": -10, - "y_offset": -14, + "x": -10, + "y": -14, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_2_1.png", - "x_offset": -22, - "y_offset": -6, + "x": -22, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_2_2.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_2_3.png", - "x_offset": -24, - "y_offset": 13, + "x": -24, + "y": 13, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_3_1.png", - "x_offset": -7, - "y_offset": -8, + "x": -7, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_3_2.png", - "x_offset": 1, - "y_offset": -7, + "x": 1, + "y": -7, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_3_3.png", - "x_offset": -32, - "y_offset": -4, + "x": -32, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_3_4.png", - "x_offset": -10, - "y_offset": -20, + "x": -10, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_4_1.png", - "x_offset": -23, - "y_offset": -19, + "x": -23, + "y": -19, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_4_2.png", - "x_offset": -24, - "y_offset": -12, + "x": -24, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": -20, + "x": 0, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_diag_gentle_up_4_4.png", - "x_offset": 0, - "y_offset": -17, + "x": 0, + "y": -17, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_1_1.png", - "x_offset": -23, - "y_offset": -19, + "x": -23, + "y": -19, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_1_2.png", - "x_offset": -20, - "y_offset": -12, + "x": -20, + "y": -12, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_1_3.png", - "x_offset": -14, - "y_offset": -20, + "x": -14, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_2_1.png", - "x_offset": -19, - "y_offset": -8, + "x": -19, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_2_2.png", - "x_offset": -31, - "y_offset": -8, + "x": -31, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_2_3.png", - "x_offset": 10, - "y_offset": -4, + "x": 10, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_2_4.png", - "x_offset": -8, - "y_offset": -20, + "x": -8, + "y": -20, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_3_1.png", - "x_offset": -7, - "y_offset": -6, + "x": -7, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_3_2.png", - "x_offset": -8, - "y_offset": -13, + "x": -8, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 13, + "x": 0, + "y": 13, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": -13, + "x": 0, + "y": -13, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_4_1.png", - "x_offset": -18, - "y_offset": -14, + "x": -18, + "y": -14, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_4_2.png", - "x_offset": -6, - "y_offset": -24, + "x": -6, + "y": -24, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_4_3.png", - "x_offset": -32, - "y_offset": 8, + "x": -32, + "y": 8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_diag_gentle_up_4_4.png", - "x_offset": -10, - "y_offset": -14, + "x": -10, + "y": -14, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -10, + "x": 0, + "y": -10, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -14, + "x": -32, + "y": -14, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_1_4.png", - "x_offset": -29, - "y_offset": -18, + "x": -29, + "y": -18, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_2_1.png", - "x_offset": -8, - "y_offset": 1, + "x": -8, + "y": 1, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_2_3.png", - "x_offset": -10, - "y_offset": -10, + "x": -10, + "y": -10, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_2_4.png", - "x_offset": -17, - "y_offset": -6, + "x": -17, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -11, + "x": -32, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_3_3.png", - "x_offset": -22, - "y_offset": -6, + "x": -22, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_3_4.png", - "x_offset": -26, - "y_offset": -8, + "x": -26, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_4_1.png", - "x_offset": -8, - "y_offset": -8, + "x": -8, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_4_3.png", - "x_offset": -21, - "y_offset": -4, + "x": -21, + "y": -4, "palette": "keep" }, { "path": "track/intamin/large_turn_left_bank_to_orthogonal_gentle_up_4_4.png", - "x_offset": -22, - "y_offset": -23, + "x": -22, + "y": -23, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -11, + "x": 0, + "y": -11, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_1_4.png", - "x_offset": -26, - "y_offset": -8, + "x": -26, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_2_1.png", - "x_offset": 0, - "y_offset": 1, + "x": 0, + "y": 1, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_2_3.png", - "x_offset": -16, - "y_offset": -10, + "x": -16, + "y": -10, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_2_4.png", - "x_offset": -21, - "y_offset": -6, + "x": -21, + "y": -6, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -10, + "x": -32, + "y": -10, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_3_3.png", - "x_offset": -13, - "y_offset": -14, + "x": -13, + "y": -14, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_3_4.png", - "x_offset": -26, - "y_offset": -18, + "x": -26, + "y": -18, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_4_1.png", - "x_offset": -10, - "y_offset": -8, + "x": -10, + "y": -8, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_4_3.png", - "x_offset": -7, - "y_offset": -5, + "x": -7, + "y": -5, "palette": "keep" }, { "path": "track/intamin/large_turn_right_bank_to_orthogonal_gentle_up_4_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/mini/booster_1.png", - "x_offset": -22, - "y_offset": -4 + "x": -22, + "y": -4 }, { "path": "track/mini/booster_2.png", - "x_offset": -22, - "y_offset": -4 + "x": -22, + "y": -4 }, { "path": "track/bm/brake_horizontal.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/bm/brake_vertical.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/bm/blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/bm/blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/bm/blockbrake_vertical_closed.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/bm/blockbrake_vertical_open.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/bm/booster_1.png", - "x_offset": -25, - "y_offset": -5 + "x": -25, + "y": -5 }, { "path": "track/bm/booster_2.png", - "x_offset": -25, - "y_offset": -5 + "x": -25, + "y": -5 }, { "path": "track/railway/quarter_turn_3_tiles_sw_se_part_3.png", - "x_offset": -8, - "y_offset": 1 + "x": -8, + "y": 1 }, { "path": "track/railway/gravel_sw_ne.png", - "x_offset": -33, - "y_offset": -2 + "x": -33, + "y": -2 }, { "path": "track/railway/gravel_nw_se.png", - "x_offset": -21, - "y_offset": -2 + "x": -21, + "y": -2 }, { "path": "track/railway/grooved_sw_ne.png", - "x_offset": -28, - "y_offset": -1 + "x": -28, + "y": -1 }, { "path": "track/railway/grooved_nw_se.png", - "x_offset": -14, - "y_offset": -2 + "x": -14, + "y": -2 }, { "path": "track/railway/grooved_sw_ne_trans.png", - "x_offset": -28, - "y_offset": -1, + "x": -28, + "y": -1, "palette": "keep" }, { "path": "track/railway/grooved_nw_se_trans.png", - "x_offset": -14, - "y_offset": -2, + "x": -14, + "y": -2, "palette": "keep" }, { "path": "track/railway/grooved_end_ne_trans.png", - "x_offset": -28, - "y_offset": -1, + "x": -28, + "y": -1, "palette": "keep" }, { "path": "track/railway/grooved_end_se_trans.png", - "x_offset": -14, - "y_offset": -2, + "x": -14, + "y": -2, "palette": "keep" }, { "path": "track/railway/grooved_end_nw_trans.png", - "x_offset": -14, - "y_offset": -2, + "x": -14, + "y": -2, "palette": "keep" }, { "path": "track/railway/grooved_end_sw_trans.png", - "x_offset": -26, - "y_offset": -2, + "x": -26, + "y": -2, "palette": "keep" }, { "path": "track/railway/grooved_end_sw_ne_trans.png", - "x_offset": -28, - "y_offset": -1, + "x": -28, + "y": -1, "palette": "keep" }, { "path": "track/railway/grooved_end_nw_se_trans.png", - "x_offset": -14, - "y_offset": -2, + "x": -14, + "y": -2, "palette": "keep" }, { "path": "track/wooden/booster_1.png", - "x_offset": -34, - "y_offset": -15 + "x": -34, + "y": -15 }, { "path": "track/wooden/booster_2.png", - "x_offset": -30, - "y_offset": -15 + "x": -30, + "y": -15 }, { "path": "track/wooden/brake_horizontal.png", - "x_offset": -32, - "y_offset": -10, + "x": -32, + "y": -10, "palette": "keep" }, { "path": "track/wooden/brake_vertical.png", - "x_offset": -25, - "y_offset": -14, + "x": -25, + "y": -14, "palette": "keep" }, { "path": "track/wooden/blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": -10, + "x": -32, + "y": -10, "palette": "keep" }, { "path": "track/wooden/blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": -10, + "x": -32, + "y": -10, "palette": "keep" }, { "path": "track/wooden/blockbrake_vertical_closed.png", - "x_offset": -25, - "y_offset": -14, + "x": -25, + "y": -14, "palette": "keep" }, { "path": "track/wooden/blockbrake_vertical_open.png", - "x_offset": -25, - "y_offset": -14, + "x": -25, + "y": -14, "palette": "keep" }, { "path": "track/wooden/station_block_brake_open_sw_ne.png", - "x_offset": -34, - "y_offset": -8 + "x": -34, + "y": -8 }, { "path": "track/wooden/station_block_brake_open_nw_se.png", - "x_offset": -30, - "y_offset": -8 + "x": -30, + "y": -8 }, { "path": "track/wooden/station_block_brake_closed_sw_ne.png", - "x_offset": -34, - "y_offset": -8 + "x": -34, + "y": -8 }, { "path": "track/wooden/station_block_brake_closed_nw_se.png", - "x_offset": -30, - "y_offset": -8 + "x": -30, + "y": -8 }, { "path": "track/wooden/classic_wooden_preview_track.png", - "x_offset": 1, - "y_offset": 1 + "x": 1, + "y": 1 }, { "path": "track/wooden/classic_wooden_preview_supports.png", - "x_offset": 2, - "y_offset": 1 + "x": 2, + "y": 1 }, { "path": "track/wooden/25_60_swne_chained.png", - "x_offset": -32, - "y_offset": -49, + "x": -32, + "y": -49, "palette": "keep" }, { "path": "track/wooden/25_60_senw_chained.png", - "x_offset": -32, - "y_offset": -49, + "x": -32, + "y": -49, "palette": "keep" }, { "path": "track/wooden/25_60_swne_chained_back.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/wooden/25_60_senw_chained_back.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/wooden/60_swne_chained.png", - "x_offset": -32, - "y_offset": -80, + "x": -32, + "y": -80, "palette": "keep" }, { "path": "track/wooden/60_senw_chained.png", - "x_offset": -32, - "y_offset": -80, + "x": -32, + "y": -80, "palette": "keep" }, { "path": "track/wooden/60_swne_chained_back.png", - "x_offset": -32, - "y_offset": -60, + "x": -32, + "y": -60, "palette": "keep" }, { "path": "track/wooden/60_senw_chained_back.png", - "x_offset": -32, - "y_offset": -59, + "x": -32, + "y": -59, "palette": "keep" }, { "path": "track/wooden/60_25_swne_chained.png", - "x_offset": -32, - "y_offset": -47, + "x": -32, + "y": -47, "palette": "keep" }, { "path": "track/wooden/60_25_senw_chained.png", - "x_offset": -32, - "y_offset": -47, + "x": -32, + "y": -47, "palette": "keep" }, { "path": "track/wooden/60_25_swne_chained_back.png", - "x_offset": 0, - "y_offset": -30, + "x": 0, + "y": -30, "palette": "keep" }, { "path": "track/wooden/60_25_senw_chained_back.png", - "x_offset": -32, - "y_offset": -30, + "x": -32, + "y": -30, "palette": "keep" }, { "path": "track/bm_invert/booster_1.png", - "x_offset": -25, - "y_offset": -5 + "x": -25, + "y": -5 }, { "path": "track/bm_invert/booster_2.png", - "x_offset": -25, - "y_offset": -5 + "x": -25, + "y": -5 }, { "path": "track/bm_invert/brake_horizontal.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/bm_invert/brake_vertical.png", - "x_offset": -13, - "y_offset": -13, + "x": -13, + "y": -13, "palette": "keep" }, { "path": "track/looping/brake_horizontal_1.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/looping/brake_horizontal_2.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/looping/brake_vertical_1.png", - "x_offset": -15, - "y_offset": -8, + "x": -15, + "y": -8, "palette": "keep" }, { "path": "track/looping/brake_vertical_2.png", - "x_offset": -15, - "y_offset": -8, + "x": -15, + "y": -8, "palette": "keep" }, { "path": "track/minetrain/brake_horizontal.png", - "x_offset": -32, - "y_offset": 6, + "x": -32, + "y": 6, "palette": "keep" }, { "path": "track/minetrain/brake_vertical.png", - "x_offset": -17, - "y_offset": -3, + "x": -17, + "y": -3, "palette": "keep" }, { "path": "track/minetrain/blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": 6, + "x": -32, + "y": 6, "palette": "keep" }, { "path": "track/minetrain/blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": 6, + "x": -32, + "y": 6, "palette": "keep" }, { "path": "track/minetrain/blockbrake_vertical_closed.png", - "x_offset": -17, - "y_offset": -3, + "x": -17, + "y": -3, "palette": "keep" }, { "path": "track/minetrain/blockbrake_vertical_open.png", - "x_offset": -17, - "y_offset": -3, + "x": -17, + "y": -3, "palette": "keep" }, { "path": "track/standup/brake_horizontal.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/standup/brake_vertical.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/standup/blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/standup/blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/standup/blockbrake_vertical_closed.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/standup/blockbrake_vertical_open.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/steeplechase/brake_horizontal.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/steeplechase/brake_vertical.png", - "x_offset": -4, - "y_offset": -6, + "x": -4, + "y": -6, "palette": "keep" }, { "path": "track/multidim/upright_brake_horizontal.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/multidim/upright_brake_vertical.png", - "x_offset": -11, - "y_offset": -8, + "x": -11, + "y": -8, "palette": "keep" }, { "path": "track/multidim/upright_blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/multidim/upright_blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/multidim/upright_blockbrake_vertical_closed.png", - "x_offset": -11, - "y_offset": -8, + "x": -11, + "y": -8, "palette": "keep" }, { "path": "track/multidim/upright_blockbrake_vertical_open.png", - "x_offset": -11, - "y_offset": -8, + "x": -11, + "y": -8, "palette": "keep" }, { "path": "track/multidim/inverted_brake_horizontal.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/multidim/inverted_brake_vertical.png", - "x_offset": -11, - "y_offset": -12, + "x": -11, + "y": -12, "palette": "keep" }, { "path": "track/multidim/inverted_blockbrake_horizontal.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/multidim/inverted_blockbrake_vertical_open.png", - "x_offset": -11, - "y_offset": -12, + "x": -11, + "y": -12, "palette": "keep" }, { "path": "track/multidim/inverted_blockbrake_vertical_closed.png", - "x_offset": -11, - "y_offset": -12, + "x": -11, + "y": -12, "palette": "keep" }, { "path": "track/slc/brake_horizontal.png", - "x_offset": -32, - "y_offset": 4, + "x": -32, + "y": 4, "palette": "keep" }, { "path": "track/slc/brake_vertical.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/slc/blockbrake_vertical_open.png", - "x_offset": -13, - "y_offset": -9, + "x": -13, + "y": -9, "palette": "keep" }, { "path": "track/corkscrew/brake_horizontal.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/corkscrew/brake_vertical.png", - "x_offset": -13, - "y_offset": -8, + "x": -13, + "y": -8, "palette": "keep" }, { "path": "track/corkscrew/blockbrake_horizontal_closed.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/corkscrew/blockbrake_horizontal_open.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/corkscrew/blockbrake_vertical_closed.png", - "x_offset": -13, - "y_offset": -8, + "x": -13, + "y": -8, "palette": "keep" }, { "path": "track/corkscrew/blockbrake_vertical_open.png", - "x_offset": -13, - "y_offset": -8, + "x": -13, + "y": -8, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_1_1.png", - "x_offset": -22, - "y_offset": 9, + "x": -22, + "y": 9, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_1_2.png", - "x_offset": -11, - "y_offset": 7, + "x": -11, + "y": 7, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_1_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_1_4.png", - "x_offset": -22, - "y_offset": -16, + "x": -22, + "y": -16, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_1_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_1_6.png", - "x_offset": -12, - "y_offset": -20, + "x": -12, + "y": -20, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_2_1.png", - "x_offset": -19, - "y_offset": 1, + "x": -19, + "y": 1, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_2_2.png", - "x_offset": -22, - "y_offset": 6, + "x": -22, + "y": 6, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_2_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_2_4.png", - "x_offset": -28, - "y_offset": -4, + "x": -28, + "y": -4, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_2_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_2_6.png", - "x_offset": -32, - "y_offset": -18, + "x": -32, + "y": -18, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_3_1.png", - "x_offset": -29, - "y_offset": -1, + "x": -29, + "y": -1, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_3_2.png", - "x_offset": -2, - "y_offset": 6, + "x": -2, + "y": 6, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_3_3.png", - "x_offset": -25, - "y_offset": -13, + "x": -25, + "y": -13, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_3_4.png", - "x_offset": -27, - "y_offset": -12, + "x": -27, + "y": -12, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_3_5.png", - "x_offset": 2, - "y_offset": -11, + "x": 2, + "y": -11, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_3_6.png", - "x_offset": -22, - "y_offset": -17, + "x": -22, + "y": -17, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -12, + "x": -15, + "y": -12, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_4_2.png", - "x_offset": 1, - "y_offset": 18, + "x": 1, + "y": 18, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_4_3.png", - "x_offset": -12, - "y_offset": -17, + "x": -12, + "y": -17, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_4_4.png", - "x_offset": -10, - "y_offset": -20, + "x": -10, + "y": -20, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_4_5.png", - "x_offset": 11, - "y_offset": -4, + "x": 11, + "y": -4, "palette": "keep" }, { "path": "track/lim/barrel_roll_left_4_6.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_1_1.png", - "x_offset": -23, - "y_offset": -12, + "x": -23, + "y": -12, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_1_2.png", - "x_offset": -11, - "y_offset": 16, + "x": -11, + "y": 16, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_1_3.png", - "x_offset": -28, - "y_offset": -17, + "x": -28, + "y": -17, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_1_4.png", - "x_offset": -23, - "y_offset": -19, + "x": -23, + "y": -19, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_1_5.png", - "x_offset": -21, - "y_offset": -4, + "x": -21, + "y": -4, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_1_6.png", - "x_offset": -23, - "y_offset": -20, + "x": -23, + "y": -20, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_2_1.png", - "x_offset": -22, - "y_offset": 0, + "x": -22, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_2_2.png", - "x_offset": -22, - "y_offset": 7, + "x": -22, + "y": 7, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_2_3.png", - "x_offset": -10, - "y_offset": -13, + "x": -10, + "y": -13, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_2_4.png", - "x_offset": 3, - "y_offset": -12, + "x": 3, + "y": -12, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_2_5.png", - "x_offset": -7, - "y_offset": -11, + "x": -7, + "y": -11, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_2_6.png", - "x_offset": -6, - "y_offset": -18, + "x": -6, + "y": -18, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_3_1.png", - "x_offset": -1, - "y_offset": 0, + "x": -1, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_3_2.png", - "x_offset": -4, - "y_offset": 6, + "x": -4, + "y": 6, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_3_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_3_4.png", - "x_offset": 0, - "y_offset": -4, + "x": 0, + "y": -4, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_3_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_3_6.png", - "x_offset": -22, - "y_offset": -18, + "x": -22, + "y": -18, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_4_1.png", - "x_offset": -9, - "y_offset": 9, + "x": -9, + "y": 9, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_4_2.png", - "x_offset": -20, - "y_offset": 7, + "x": -20, + "y": 7, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_4_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_4_4.png", - "x_offset": -28, - "y_offset": -16, + "x": -28, + "y": -16, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_4_5.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/lim/barrel_roll_right_4_6.png", - "x_offset": -23, - "y_offset": -20, + "x": -23, + "y": -20, "palette": "keep" }, { "path": "track/lim/half_loop_1_1.png", - "x_offset": -28, - "y_offset": -21, + "x": -28, + "y": -21, "palette": "keep" }, { "path": "track/lim/half_loop_1_2.png", - "x_offset": -22, - "y_offset": -40, + "x": -22, + "y": -40, "palette": "keep" }, { "path": "track/lim/half_loop_1_3.png", - "x_offset": -15, - "y_offset": -82, + "x": -15, + "y": -82, "palette": "keep" }, { "path": "track/lim/half_loop_1_4.png", - "x_offset": -22, - "y_offset": 24, + "x": -22, + "y": 24, "palette": "keep" }, { "path": "track/lim/half_loop_2_1.png", - "x_offset": -16, - "y_offset": -4, + "x": -16, + "y": -4, "palette": "keep" }, { "path": "track/lim/half_loop_2_2.png", - "x_offset": 1, - "y_offset": -32, + "x": 1, + "y": -32, "palette": "keep" }, { "path": "track/lim/half_loop_2_3.png", - "x_offset": -38, - "y_offset": -114, + "x": -38, + "y": -114, "palette": "keep" }, { "path": "track/lim/half_loop_2_4.png", - "x_offset": -22, - "y_offset": 12, + "x": -22, + "y": 12, "palette": "keep" }, { "path": "track/lim/half_loop_3_1.png", - "x_offset": -25, - "y_offset": -4, + "x": -25, + "y": -4, "palette": "keep" }, { "path": "track/lim/half_loop_3_2.png", - "x_offset": -27, - "y_offset": -28, + "x": -27, + "y": -28, "palette": "keep" }, { "path": "track/lim/half_loop_3_3.png", - "x_offset": -1, - "y_offset": -121, + "x": -1, + "y": -121, "palette": "keep" }, { "path": "track/lim/half_loop_3_4.png", - "x_offset": -24, - "y_offset": 4, + "x": -24, + "y": 4, "palette": "keep" }, { "path": "track/lim/half_loop_4_1.png", - "x_offset": -14, - "y_offset": -20, + "x": -14, + "y": -20, "palette": "keep" }, { "path": "track/lim/half_loop_4_2.png", - "x_offset": -16, - "y_offset": -43, + "x": -16, + "y": -43, "palette": "keep" }, { "path": "track/lim/half_loop_4_3.png", - "x_offset": 5, - "y_offset": -91, + "x": 5, + "y": -91, "palette": "keep" }, { "path": "track/lim/half_loop_4_4.png", - "x_offset": 6, - "y_offset": 16, + "x": 6, + "y": 16, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_1_1.png", - "x_offset": -22, - "y_offset": -4, + "x": -22, + "y": -4, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_1_2.png", - "x_offset": -22, - "y_offset": -19, + "x": -22, + "y": -19, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_1_3.png", - "x_offset": -21, - "y_offset": -27, + "x": -21, + "y": -27, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_1_4.png", - "x_offset": -23, - "y_offset": -46, + "x": -23, + "y": -46, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_2_1.png", - "x_offset": -22, - "y_offset": 1, + "x": -22, + "y": 1, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_2_2.png", - "x_offset": -25, - "y_offset": -5, + "x": -25, + "y": -5, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_2_3.png", - "x_offset": -25, - "y_offset": -7, + "x": -25, + "y": -7, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_2_4.png", - "x_offset": -20, - "y_offset": -32, + "x": -20, + "y": -32, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_3_1.png", - "x_offset": -23, - "y_offset": 0, + "x": -23, + "y": 0, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_3_2.png", - "x_offset": -24, - "y_offset": -4, + "x": -24, + "y": -4, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_3_3.png", - "x_offset": -23, - "y_offset": -13, + "x": -23, + "y": -13, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_3_4.png", - "x_offset": -23, - "y_offset": -32, + "x": -23, + "y": -32, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_4_1.png", - "x_offset": -21, - "y_offset": -4, + "x": -21, + "y": -4, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_4_2.png", - "x_offset": -23, - "y_offset": -19, + "x": -23, + "y": -19, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_4_3.png", - "x_offset": -23, - "y_offset": -27, + "x": -23, + "y": -27, "palette": "keep" }, { "path": "track/lim/flat_to_steep_up_4_4.png", - "x_offset": -22, - "y_offset": -46, + "x": -22, + "y": -46, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_1_1.png", - "x_offset": -24, - "y_offset": -43, + "x": -24, + "y": -43, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_1_2.png", - "x_offset": -24, - "y_offset": -28, + "x": -24, + "y": -28, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_1_3.png", - "x_offset": -24, - "y_offset": -19, + "x": -24, + "y": -19, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_1_4.png", - "x_offset": -23, - "y_offset": -8, + "x": -23, + "y": -8, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_2_1.png", - "x_offset": -24, - "y_offset": -26, + "x": -24, + "y": -26, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_2_2.png", - "x_offset": -19, - "y_offset": -14, + "x": -19, + "y": -14, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_2_3.png", - "x_offset": -12, - "y_offset": -7, + "x": -12, + "y": -7, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_2_4.png", - "x_offset": -15, - "y_offset": -2, + "x": -15, + "y": -2, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_3_1.png", - "x_offset": -14, - "y_offset": -25, + "x": -14, + "y": -25, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_3_2.png", - "x_offset": -13, - "y_offset": -13, + "x": -13, + "y": -13, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_3_3.png", - "x_offset": -18, - "y_offset": -7, + "x": -18, + "y": -7, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_3_4.png", - "x_offset": -22, - "y_offset": -5, + "x": -22, + "y": -5, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_4_1.png", - "x_offset": -21, - "y_offset": -41, + "x": -21, + "y": -41, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_4_2.png", - "x_offset": -20, - "y_offset": -28, + "x": -20, + "y": -28, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_4_3.png", - "x_offset": -19, - "y_offset": -18, + "x": -19, + "y": -18, "palette": "keep" }, { "path": "track/lim/steep_to_flat_up_4_4.png", - "x_offset": -22, - "y_offset": -7, + "x": -22, + "y": -7, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_1_1.png", - "x_offset": -22, - "y_offset": -7, + "x": -22, + "y": -7, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_1_2.png", - "x_offset": -21, - "y_offset": -43, + "x": -21, + "y": -43, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_1_3.png", - "x_offset": -29, - "y_offset": -32, + "x": -29, + "y": -32, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_1_4.png", - "x_offset": -22, - "y_offset": -44, + "x": -22, + "y": -44, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_1_5.png", - "x_offset": -22, - "y_offset": -28, + "x": -22, + "y": -28, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_2_1.png", - "x_offset": -22, - "y_offset": 1, + "x": -22, + "y": 1, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_2_2.png", - "x_offset": -32, - "y_offset": -10, + "x": -32, + "y": -10, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_2_3.png", - "x_offset": -23, - "y_offset": -46, + "x": -23, + "y": -46, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_2_4.png", - "x_offset": -19, - "y_offset": -52, + "x": -19, + "y": -52, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_2_5.png", - "x_offset": -15, - "y_offset": -28, + "x": -15, + "y": -28, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_3_1.png", - "x_offset": -16, - "y_offset": 0, + "x": -16, + "y": 0, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_3_2.png", - "x_offset": -13, - "y_offset": -11, + "x": -13, + "y": -11, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_3_3.png", - "x_offset": 17, - "y_offset": -21, + "x": 17, + "y": -21, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_3_4.png", - "x_offset": -8, - "y_offset": -32, + "x": -8, + "y": -32, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_3_5.png", - "x_offset": -16, - "y_offset": -24, + "x": -16, + "y": -24, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_4_1.png", - "x_offset": -24, - "y_offset": -7, + "x": -24, + "y": -7, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_4_2.png", - "x_offset": -24, - "y_offset": -23, + "x": -24, + "y": -23, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_4_3.png", - "x_offset": -14, - "y_offset": -9, + "x": -14, + "y": -9, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_4_4.png", - "x_offset": -14, - "y_offset": -25, + "x": -14, + "y": -25, "palette": "keep" }, { "path": "track/lim/large_corkscrew_left_4_5.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_1_1.png", - "x_offset": -22, - "y_offset": -7, + "x": -22, + "y": -7, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_1_2.png", - "x_offset": -23, - "y_offset": -24, + "x": -23, + "y": -24, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_1_3.png", - "x_offset": -21, - "y_offset": -9, + "x": -21, + "y": -9, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_1_4.png", - "x_offset": -30, - "y_offset": -25, + "x": -30, + "y": -25, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_1_5.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_2_1.png", - "x_offset": -22, - "y_offset": 1, + "x": -22, + "y": 1, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_2_2.png", - "x_offset": -16, - "y_offset": -11, + "x": -16, + "y": -11, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_2_3.png", - "x_offset": -24, - "y_offset": -21, + "x": -24, + "y": -21, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_2_4.png", - "x_offset": -16, - "y_offset": -31, + "x": -16, + "y": -31, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_2_5.png", - "x_offset": -22, - "y_offset": -23, + "x": -22, + "y": -23, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_3_1.png", - "x_offset": -18, - "y_offset": 0, + "x": -18, + "y": 0, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_3_2.png", - "x_offset": -16, - "y_offset": -11, + "x": -16, + "y": -11, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_3_3.png", - "x_offset": -26, - "y_offset": -47, + "x": -26, + "y": -47, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_3_4.png", - "x_offset": -29, - "y_offset": -53, + "x": -29, + "y": -53, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_3_5.png", - "x_offset": -23, - "y_offset": -28, + "x": -23, + "y": -28, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_4_1.png", - "x_offset": -22, - "y_offset": -7, + "x": -22, + "y": -7, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_4_2.png", - "x_offset": -10, - "y_offset": -43, + "x": -10, + "y": -43, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_4_3.png", - "x_offset": 17, - "y_offset": -32, + "x": 17, + "y": -32, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_4_4.png", - "x_offset": -11, - "y_offset": -44, + "x": -11, + "y": -44, "palette": "keep" }, { "path": "track/lim/large_corkscrew_right_4_5.png", - "x_offset": -18, - "y_offset": -28, + "x": -18, + "y": -28, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_1_1.png", - "x_offset": -26, - "y_offset": -15, + "x": -26, + "y": -15, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_1_2.png", - "x_offset": -18, - "y_offset": -10, + "x": -18, + "y": -10, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_2_1.png", - "x_offset": 37, - "y_offset": 0, + "x": 37, + "y": 0, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_2_2.png", - "x_offset": -16, - "y_offset": -4, + "x": -16, + "y": -4, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_2_3.png", - "x_offset": -38, - "y_offset": -11, + "x": -38, + "y": -11, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_3_1.png", - "x_offset": -19, - "y_offset": -8, + "x": -19, + "y": -8, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_3_2.png", - "x_offset": -6, - "y_offset": 1, + "x": -6, + "y": 1, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -9, + "x": -26, + "y": -9, "palette": "keep" }, { "path": "track/lim/small_turn_left_bank_to_gentle_up_4_2.png", - "x_offset": -29, - "y_offset": 4, + "x": -29, + "y": 4, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_1_1.png", - "x_offset": -28, - "y_offset": -10, + "x": -28, + "y": -10, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": 4, + "x": -26, + "y": 4, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_2_1.png", - "x_offset": -14, - "y_offset": -8, + "x": -14, + "y": -8, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_2_2.png", - "x_offset": -29, - "y_offset": 1, + "x": -29, + "y": 1, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": 0, + "x": -38, + "y": 0, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_3_2.png", - "x_offset": -38, - "y_offset": -4, + "x": -38, + "y": -4, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_3_3.png", - "x_offset": -17, - "y_offset": -10, + "x": -17, + "y": -10, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_4_1.png", - "x_offset": -7, - "y_offset": -15, + "x": -7, + "y": -15, "palette": "keep" }, { "path": "track/lim/small_turn_right_bank_to_gentle_up_4_2.png", - "x_offset": -19, - "y_offset": -11, + "x": -19, + "y": -11, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_1_1.png", - "x_offset": -23, - "y_offset": -29, + "x": -23, + "y": -29, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_1_2.png", - "x_offset": -23, - "y_offset": -46, + "x": -23, + "y": -46, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_1_3.png", - "x_offset": -30, - "y_offset": -80, + "x": -30, + "y": -80, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_1_4.png", - "x_offset": 0, - "y_offset": -114, + "x": 0, + "y": -114, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_1_5.png", - "x_offset": -22, - "y_offset": -25, + "x": -22, + "y": -25, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_2_1.png", - "x_offset": -22, - "y_offset": -7, + "x": -22, + "y": -7, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_2_2.png", - "x_offset": 0, - "y_offset": -28, + "x": 0, + "y": -28, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_2_3.png", - "x_offset": 0, - "y_offset": -82, + "x": 0, + "y": -82, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_2_4.png", - "x_offset": -31, - "y_offset": -143, + "x": -31, + "y": -143, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_2_5.png", - "x_offset": -23, - "y_offset": -36, + "x": -23, + "y": -36, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_3_1.png", - "x_offset": -17, - "y_offset": -1, + "x": -17, + "y": -1, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_3_2.png", - "x_offset": 0, - "y_offset": -8, + "x": 0, + "y": -8, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_3_3.png", - "x_offset": -2, - "y_offset": -52, + "x": -2, + "y": -52, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_3_4.png", - "x_offset": -32, - "y_offset": -148, + "x": -32, + "y": -148, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_3_5.png", - "x_offset": -16, - "y_offset": -36, + "x": -16, + "y": -36, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_4_1.png", - "x_offset": -22, - "y_offset": -14, + "x": -22, + "y": -14, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_4_2.png", - "x_offset": -24, - "y_offset": -21, + "x": -24, + "y": -21, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_4_3.png", - "x_offset": -30, - "y_offset": -26, + "x": -30, + "y": -26, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_4_4.png", - "x_offset": -9, - "y_offset": -118, + "x": -9, + "y": -118, "palette": "keep" }, { "path": "track/lim/medium_half_loop_left_4_5.png", - "x_offset": -23, - "y_offset": -28, + "x": -23, + "y": -28, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_1_1.png", - "x_offset": -22, - "y_offset": -15, + "x": -22, + "y": -15, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_1_2.png", - "x_offset": -20, - "y_offset": -22, + "x": -20, + "y": -22, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_1_3.png", - "x_offset": -18, - "y_offset": -27, + "x": -18, + "y": -27, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_1_4.png", - "x_offset": -15, - "y_offset": -118, + "x": -15, + "y": -118, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_1_5.png", - "x_offset": -23, - "y_offset": -28, + "x": -23, + "y": -28, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_2_1.png", - "x_offset": -22, - "y_offset": -1, + "x": -22, + "y": -1, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_2_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_2_3.png", - "x_offset": -32, - "y_offset": -52, + "x": -32, + "y": -52, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_2_4.png", - "x_offset": -25, - "y_offset": -148, + "x": -25, + "y": -148, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_2_5.png", - "x_offset": -22, - "y_offset": -36, + "x": -22, + "y": -36, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_3_1.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_3_2.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_3_3.png", - "x_offset": -32, - "y_offset": -82, + "x": -32, + "y": -82, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_3_4.png", - "x_offset": -9, - "y_offset": -143, + "x": -9, + "y": -143, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_3_5.png", - "x_offset": -12, - "y_offset": -35, + "x": -12, + "y": -35, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_4_1.png", - "x_offset": -22, - "y_offset": -29, + "x": -22, + "y": -29, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_4_2.png", - "x_offset": -16, - "y_offset": -46, + "x": -16, + "y": -46, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_4_3.png", - "x_offset": -2, - "y_offset": -80, + "x": -2, + "y": -80, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_4_4.png", - "x_offset": -32, - "y_offset": -115, + "x": -32, + "y": -115, "palette": "keep" }, { "path": "track/lim/medium_half_loop_right_4_5.png", - "x_offset": -32, - "y_offset": -25, + "x": -32, + "y": -25, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_1.png", - "x_offset": -23, - "y_offset": -25, + "x": -23, + "y": -25, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_2.png", - "x_offset": -20, - "y_offset": -38, + "x": -20, + "y": -38, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_3.png", - "x_offset": -20, - "y_offset": -65, + "x": -20, + "y": -65, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_4.png", - "x_offset": -24, - "y_offset": -80, + "x": -24, + "y": -80, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_5.png", - "x_offset": -15, - "y_offset": -64, + "x": -15, + "y": -64, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_6.png", - "x_offset": -9, - "y_offset": -171, + "x": -9, + "y": -171, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_1_7.png", - "x_offset": -21, - "y_offset": -8, + "x": -21, + "y": -8, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_1.png", - "x_offset": -22, - "y_offset": -1, + "x": -22, + "y": -1, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_2.png", - "x_offset": -6, - "y_offset": -4, + "x": -6, + "y": -4, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_3.png", - "x_offset": -9, - "y_offset": -22, + "x": -9, + "y": -22, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_4.png", - "x_offset": -8, - "y_offset": -90, + "x": -8, + "y": -90, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_5.png", - "x_offset": -32, - "y_offset": -126, + "x": -32, + "y": -126, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_6.png", - "x_offset": -26, - "y_offset": -192, + "x": -26, + "y": -192, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_2_7.png", - "x_offset": -23, - "y_offset": -20, + "x": -23, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_1.png", - "x_offset": -24, - "y_offset": 0, + "x": -24, + "y": 0, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_2.png", - "x_offset": -29, - "y_offset": -4, + "x": -29, + "y": -4, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_3.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_4.png", - "x_offset": -5, - "y_offset": -56, + "x": -5, + "y": -56, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_5.png", - "x_offset": -6, - "y_offset": -112, + "x": -6, + "y": -112, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_6.png", - "x_offset": -21, - "y_offset": -192, + "x": -21, + "y": -192, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_3_7.png", - "x_offset": -26, - "y_offset": -20, + "x": -26, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_1.png", - "x_offset": -23, - "y_offset": -13, + "x": -23, + "y": -13, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_2.png", - "x_offset": -29, - "y_offset": -17, + "x": -29, + "y": -17, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_3.png", - "x_offset": -32, - "y_offset": -48, + "x": -32, + "y": -48, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_4.png", - "x_offset": -32, - "y_offset": -79, + "x": -32, + "y": -79, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_5.png", - "x_offset": 17, - "y_offset": -57, + "x": 17, + "y": -57, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_6.png", - "x_offset": -14, - "y_offset": -176, + "x": -14, + "y": -176, "palette": "keep" }, { "path": "track/lim/large_half_loop_left_4_7.png", - "x_offset": -19, - "y_offset": -10, + "x": -19, + "y": -10, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_1.png", - "x_offset": -22, - "y_offset": -14, + "x": -22, + "y": -14, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_2.png", - "x_offset": -19, - "y_offset": -17, + "x": -19, + "y": -17, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_3.png", - "x_offset": -14, - "y_offset": -49, + "x": -14, + "y": -49, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_4.png", - "x_offset": 0, - "y_offset": -79, + "x": 0, + "y": -79, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_5.png", - "x_offset": -32, - "y_offset": -57, + "x": -32, + "y": -57, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_6.png", - "x_offset": -19, - "y_offset": -175, + "x": -19, + "y": -175, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_1_7.png", - "x_offset": -23, - "y_offset": -10, + "x": -23, + "y": -10, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_1.png", - "x_offset": -22, - "y_offset": 0, + "x": -22, + "y": 0, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_2.png", - "x_offset": -10, - "y_offset": -4, + "x": -10, + "y": -4, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_3.png", - "x_offset": -6, - "y_offset": -33, + "x": -6, + "y": -33, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_4.png", - "x_offset": -16, - "y_offset": -56, + "x": -16, + "y": -56, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_5.png", - "x_offset": -24, - "y_offset": -112, + "x": -24, + "y": -112, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_6.png", - "x_offset": -17, - "y_offset": -192, + "x": -17, + "y": -192, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_2_7.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_1.png", - "x_offset": -26, - "y_offset": -1, + "x": -26, + "y": -1, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_2.png", - "x_offset": -26, - "y_offset": -4, + "x": -26, + "y": -4, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_3.png", - "x_offset": -28, - "y_offset": -22, + "x": -28, + "y": -22, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_4.png", - "x_offset": -32, - "y_offset": -89, + "x": -32, + "y": -89, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_5.png", - "x_offset": 17, - "y_offset": -125, + "x": 17, + "y": -125, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_6.png", - "x_offset": 0, - "y_offset": -192, + "x": 0, + "y": -192, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_3_7.png", - "x_offset": -17, - "y_offset": -19, + "x": -17, + "y": -19, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_1.png", - "x_offset": -23, - "y_offset": -25, + "x": -23, + "y": -25, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_2.png", - "x_offset": -24, - "y_offset": -38, + "x": -24, + "y": -38, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_3.png", - "x_offset": -21, - "y_offset": -65, + "x": -21, + "y": -65, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_4.png", - "x_offset": -4, - "y_offset": -80, + "x": -4, + "y": -80, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_5.png", - "x_offset": -6, - "y_offset": -64, + "x": -6, + "y": -64, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_6.png", - "x_offset": -28, - "y_offset": -172, + "x": -28, + "y": -172, "palette": "keep" }, { "path": "track/lim/large_half_loop_right_4_7.png", - "x_offset": -27, - "y_offset": -8, + "x": -27, + "y": -8, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_1_1.png", - "x_offset": -22, - "y_offset": -6, + "x": -22, + "y": -6, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_1_2.png", - "x_offset": -12, - "y_offset": -11, + "x": -12, + "y": -11, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_1_3.png", - "x_offset": -11, - "y_offset": -21, + "x": -11, + "y": -21, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_1_4.png", - "x_offset": -20, - "y_offset": -19, + "x": -20, + "y": -19, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_2_1.png", - "x_offset": -16, - "y_offset": 1, + "x": -16, + "y": 1, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_2_2.png", - "x_offset": -22, - "y_offset": -1, + "x": -22, + "y": -1, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_2_3.png", - "x_offset": -23, - "y_offset": -15, + "x": -23, + "y": -15, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_2_4.png", - "x_offset": -21, - "y_offset": -15, + "x": -21, + "y": -15, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_3_1.png", - "x_offset": -20, - "y_offset": -8, + "x": -20, + "y": -8, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_3_2.png", - "x_offset": -21, - "y_offset": -21, + "x": -21, + "y": -21, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_3_3.png", - "x_offset": -1, - "y_offset": -13, + "x": -1, + "y": -13, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_3_4.png", - "x_offset": -23, - "y_offset": -17, + "x": -23, + "y": -17, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_4_1.png", - "x_offset": -16, - "y_offset": -24, + "x": -16, + "y": -24, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_4_2.png", - "x_offset": -11, - "y_offset": -33, + "x": -11, + "y": -33, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_4_3.png", - "x_offset": 16, - "y_offset": 0, + "x": 16, + "y": 0, "palette": "keep" }, { "path": "track/lim/zero_g_roll_left_4_4.png", - "x_offset": -21, - "y_offset": -20, + "x": -21, + "y": -20, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_1_1.png", - "x_offset": -22, - "y_offset": -24, + "x": -22, + "y": -24, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_1_2.png", - "x_offset": -28, - "y_offset": -33, + "x": -28, + "y": -33, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_1_3.png", - "x_offset": -21, - "y_offset": 1, + "x": -21, + "y": 1, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_1_4.png", - "x_offset": -24, - "y_offset": -20, + "x": -24, + "y": -20, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_2_1.png", - "x_offset": -22, - "y_offset": -8, + "x": -22, + "y": -8, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_2_2.png", - "x_offset": -16, - "y_offset": -21, + "x": -16, + "y": -21, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_2_3.png", - "x_offset": -13, - "y_offset": -13, + "x": -13, + "y": -13, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_2_4.png", - "x_offset": -11, - "y_offset": -17, + "x": -11, + "y": -17, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_3_1.png", - "x_offset": 3, - "y_offset": 1, + "x": 3, + "y": 1, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_3_2.png", - "x_offset": -9, - "y_offset": -1, + "x": -9, + "y": -1, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_3_3.png", - "x_offset": -11, - "y_offset": -15, + "x": -11, + "y": -15, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_3_4.png", - "x_offset": -21, - "y_offset": -15, + "x": -21, + "y": -15, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_4_1.png", - "x_offset": -16, - "y_offset": -6, + "x": -16, + "y": -6, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_4_2.png", - "x_offset": -27, - "y_offset": -11, + "x": -27, + "y": -11, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_4_3.png", - "x_offset": -24, - "y_offset": -21, + "x": -24, + "y": -21, "palette": "keep" }, { "path": "track/lim/zero_g_roll_right_4_4.png", - "x_offset": -23, - "y_offset": -20, + "x": -23, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_1_1.png", - "x_offset": -24, - "y_offset": -43, + "x": -24, + "y": -43, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_1_2.png", - "x_offset": -24, - "y_offset": 2, + "x": -24, + "y": 2, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_1_3.png", - "x_offset": -18, - "y_offset": -47, + "x": -18, + "y": -47, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_1_4.png", - "x_offset": -14, - "y_offset": -36, + "x": -14, + "y": -36, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_1_5.png", - "x_offset": -18, - "y_offset": -19, + "x": -18, + "y": -19, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_2_1.png", - "x_offset": -24, - "y_offset": -39, + "x": -24, + "y": -39, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_2_2.png", - "x_offset": -27, - "y_offset": -28, + "x": -27, + "y": -28, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_2_3.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_2_4.png", - "x_offset": -29, - "y_offset": -14, + "x": -29, + "y": -14, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_3_1.png", - "x_offset": -8, - "y_offset": -29, + "x": -8, + "y": -29, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_3_2.png", - "x_offset": -11, - "y_offset": -28, + "x": -11, + "y": -28, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_3_3.png", - "x_offset": -28, - "y_offset": -36, + "x": -28, + "y": -36, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_3_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_3_5.png", - "x_offset": 3, - "y_offset": -6, + "x": 3, + "y": -6, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_3_6.png", - "x_offset": -23, - "y_offset": -13, + "x": -23, + "y": -13, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_4_1.png", - "x_offset": -15, - "y_offset": -46, + "x": -15, + "y": -46, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_4_2.png", - "x_offset": -14, - "y_offset": -43, + "x": -14, + "y": -43, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_4_3.png", - "x_offset": -6, - "y_offset": -25, + "x": -6, + "y": -25, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_4_4.png", - "x_offset": -9, - "y_offset": -32, + "x": -9, + "y": -32, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_left_4_5.png", - "x_offset": -22, - "y_offset": -20, + "x": -22, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_1_1.png", - "x_offset": -24, - "y_offset": -48, + "x": -24, + "y": -48, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_1_2.png", - "x_offset": -32, - "y_offset": -43, + "x": -32, + "y": -43, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_1_3.png", - "x_offset": -30, - "y_offset": -24, + "x": -30, + "y": -24, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_1_4.png", - "x_offset": -31, - "y_offset": -32, + "x": -31, + "y": -32, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_1_5.png", - "x_offset": -26, - "y_offset": -20, + "x": -26, + "y": -20, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_2_1.png", - "x_offset": 5, - "y_offset": -30, + "x": 5, + "y": -30, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_2_2.png", - "x_offset": -24, - "y_offset": -29, + "x": -24, + "y": -29, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_2_3.png", - "x_offset": -25, - "y_offset": -37, + "x": -25, + "y": -37, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_2_4.png", - "x_offset": -17, - "y_offset": -22, + "x": -17, + "y": -22, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_2_5.png", - "x_offset": -8, - "y_offset": -7, + "x": -8, + "y": -7, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_2_6.png", - "x_offset": -8, - "y_offset": -13, + "x": -8, + "y": -13, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_3_1.png", - "x_offset": -16, - "y_offset": -39, + "x": -16, + "y": -39, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_3_2.png", - "x_offset": -12, - "y_offset": -28, + "x": -12, + "y": -28, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_3_3.png", - "x_offset": -5, - "y_offset": -21, + "x": -5, + "y": -21, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_3_4.png", - "x_offset": -22, - "y_offset": -14, + "x": -22, + "y": -14, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_4_1.png", - "x_offset": -16, - "y_offset": -42, + "x": -16, + "y": -42, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_4_2.png", - "x_offset": 5, - "y_offset": 1, + "x": 5, + "y": 1, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_4_3.png", - "x_offset": -29, - "y_offset": -47, + "x": -29, + "y": -47, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_4_4.png", - "x_offset": -27, - "y_offset": -36, + "x": -27, + "y": -36, "palette": "keep" }, { "path": "track/lim/large_zero_g_roll_right_4_5.png", - "x_offset": -23, - "y_offset": -20, + "x": -23, + "y": -20, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_1.png", - "x_offset": -22, - "y_offset": -22, + "x": -22, + "y": -22, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_2_1.png", - "x_offset": -19, - "y_offset": 1, + "x": -19, + "y": 1, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_2_2.png", - "x_offset": -22, - "y_offset": -8, + "x": -22, + "y": -8, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_3_1.png", - "x_offset": -3, - "y_offset": 0, + "x": -3, + "y": 0, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_3_2.png", - "x_offset": -23, - "y_offset": -8, + "x": -23, + "y": -8, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_4.png", - "x_offset": -22, - "y_offset": -22, + "x": -22, + "y": -22, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_1.png", - "x_offset": -24, - "y_offset": -24, + "x": -24, + "y": -24, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_2_1.png", - "x_offset": -10, - "y_offset": -11, + "x": -10, + "y": -11, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_2_2.png", - "x_offset": -24, - "y_offset": -6, + "x": -24, + "y": -6, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_3_1.png", - "x_offset": -22, - "y_offset": -11, + "x": -22, + "y": -11, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_3_2.png", - "x_offset": -11, - "y_offset": -6, + "x": -11, + "y": -6, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_4.png", - "x_offset": -22, - "y_offset": -23, + "x": -22, + "y": -23, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_diag_1.png", - "x_offset": -32, - "y_offset": -18, + "x": -32, + "y": -18, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_diag_2.png", - "x_offset": -10, - "y_offset": -5, + "x": -10, + "y": -5, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_diag_3.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/lim/small_flat_to_steep_up_diag_4.png", - "x_offset": -10, - "y_offset": -29, + "x": -10, + "y": -29, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_diag_1.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_diag_2.png", - "x_offset": -10, - "y_offset": -9, + "x": -10, + "y": -9, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_diag_3.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/lim/small_steep_to_flat_up_diag_4.png", - "x_offset": -10, - "y_offset": -29, + "x": -10, + "y": -29, "palette": "keep" }, { "path": "track/flume/25-60-down-nesw.png", - "x_offset": -26, - "y_offset": -39, + "x": -26, + "y": -39, "palette": "keep" }, { "path": "track/flume/25-60-down-nwse.png", - "x_offset": -28, - "y_offset": -39, + "x": -28, + "y": -39, "palette": "keep" }, { "path": "track/flume/25-60-down-nesw-back-water.png", - "y_offset": -23, + "y": -23, "palette": "keep" }, { "path": "track/flume/25-60-down-nesw-back.png", - "x_offset": -26, - "y_offset": -12, + "x": -26, + "y": -12, "palette": "keep" }, { "path": "track/flume/25-60-down-nwse-back-water.png", - "x_offset": -25, - "y_offset": -22, + "x": -25, + "y": -22, "palette": "keep" }, { "path": "track/flume/25-60-down-nwse-back.png", - "x_offset": -10, - "y_offset": -12, + "x": -10, + "y": -12, "palette": "keep" }, { "path": "track/flume/60-down-nesw.png", - "x_offset": -27, - "y_offset": -71, + "x": -27, + "y": -71, "palette": "keep" }, { "path": "track/flume/60-down-nwse.png", - "x_offset": -28, - "y_offset": -70, + "x": -28, + "y": -70, "palette": "keep" }, { "path": "track/flume/60-down-nesw-back.png", - "x_offset": -26, - "y_offset": -53, + "x": -26, + "y": -53, "palette": "keep" }, { "path": "track/flume/60-down-nwse-back.png", - "x_offset": -27, - "y_offset": -55, + "x": -27, + "y": -55, "palette": "keep" }, { "path": "track/flume/60-25-down-nesw.png", - "x_offset": -27, - "y_offset": -39, + "x": -27, + "y": -39, "palette": "keep" }, { "path": "track/flume/60-25-down-nwse.png", - "x_offset": -28, - "y_offset": -39, + "x": -28, + "y": -39, "palette": "keep" }, { "path": "track/flume/60-25-down-nesw-back-water.png", - "x_offset": -20, - "y_offset": -6, + "x": -20, + "y": -6, "palette": "keep" }, { "path": "track/flume/60-25-down-nesw-back.png", - "x_offset": -27, - "y_offset": -22, + "x": -27, + "y": -22, "palette": "keep" }, { "path": "track/flume/60-25-down-nwse-back-water.png", - "x_offset": 2, - "y_offset": -6, + "x": 2, + "y": -6, "palette": "keep" }, { "path": "track/flume/60-25-down-nwse-back.png", - "x_offset": -26, - "y_offset": -22, + "x": -26, + "y": -22, "palette": "keep" }, { "path": "support/flat_to_steep_1_1.png", - "x_offset": -32, - "y_offset": -5 + "x": -32, + "y": -5 }, { "path": "support/flat_to_steep_1_2.png", - "x_offset": -32, - "y_offset": -1 + "x": -32, + "y": -1 }, { "path": "support/flat_to_steep_1_3.png", - "x_offset": -32, - "y_offset": -1 + "x": -32, + "y": -1 }, { "path": "support/flat_to_steep_1_4.png", - "x_offset": -32, - "y_offset": -5 + "x": -32, + "y": -5 }, { "path": "support/flat_to_steep_2_1.png", - "x_offset": -32, - "y_offset": -18 + "x": -32, + "y": -18 }, { "path": "support/flat_to_steep_2_2.png", - "x_offset": -32, - "y_offset": -5 + "x": -32, + "y": -5 }, { "path": "support/flat_to_steep_2_3.png", - "x_offset": -32, - "y_offset": -5 + "x": -32, + "y": -5 }, { "path": "support/flat_to_steep_2_4.png", - "x_offset": -32, - "y_offset": -18 + "x": -32, + "y": -18 }, { "path": "support/flat_to_steep_3_1.png", - "x_offset": -32, - "y_offset": -27 + "x": -32, + "y": -27 }, { "path": "support/flat_to_steep_3_2.png", - "x_offset": -32, - "y_offset": -11 + "x": -32, + "y": -11 }, { "path": "support/flat_to_steep_3_3.png", - "x_offset": -32, - "y_offset": -11 + "x": -32, + "y": -11 }, { "path": "support/flat_to_steep_3_4.png", - "x_offset": -32, - "y_offset": -27 + "x": -32, + "y": -27 }, { "path": "support/flat_to_steep_4_1.png", - "x_offset": -32, - "y_offset": -57 + "x": -32, + "y": -57 }, { "path": "support/flat_to_steep_4_2.png", - "x_offset": -32, - "y_offset": -41 + "x": -32, + "y": -41 }, { "path": "support/flat_to_steep_4_3.png", - "x_offset": -32, - "y_offset": -41 + "x": -32, + "y": -41 }, { "path": "support/flat_to_steep_4_4.png", - "x_offset": -32, - "y_offset": -57 + "x": -32, + "y": -57 }, { "path": "support/steep_to_flat_1_1.png", - "x_offset": -32, - "y_offset": -54 + "x": -32, + "y": -54 }, { "path": "support/steep_to_flat_1_2.png", - "x_offset": -32, - "y_offset": -38 + "x": -32, + "y": -38 }, { "path": "support/steep_to_flat_1_3.png", - "x_offset": -32, - "y_offset": -38 + "x": -32, + "y": -38 }, { "path": "support/steep_to_flat_1_4.png", - "x_offset": -32, - "y_offset": -54 + "x": -32, + "y": -54 }, { "path": "support/steep_to_flat_2_1.png", - "x_offset": -32, - "y_offset": -31 + "x": -32, + "y": -31 }, { "path": "support/steep_to_flat_2_2.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "support/steep_to_flat_2_3.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "support/steep_to_flat_2_4.png", - "x_offset": -32, - "y_offset": -31 + "x": -32, + "y": -31 }, { "path": "support/steep_to_flat_3_1.png", - "x_offset": -32, - "y_offset": -28 + "x": -32, + "y": -28 }, { "path": "support/steep_to_flat_3_2.png", - "x_offset": -32, - "y_offset": -16 + "x": -32, + "y": -16 }, { "path": "support/steep_to_flat_3_3.png", - "x_offset": -32, - "y_offset": -16 + "x": -32, + "y": -16 }, { "path": "support/steep_to_flat_3_4.png", - "x_offset": -32, - "y_offset": -28 + "x": -32, + "y": -28 }, { "path": "support/steep_to_flat_4_1.png", - "x_offset": -32, - "y_offset": -17 + "x": -32, + "y": -17 }, { "path": "support/steep_to_flat_4_2.png", - "x_offset": -32, - "y_offset": -12 + "x": -32, + "y": -12 }, { "path": "support/steep_to_flat_4_3.png", - "x_offset": -32, - "y_offset": -12 + "x": -32, + "y": -12 }, { "path": "support/steep_to_flat_4_4.png", - "x_offset": -32, - "y_offset": -17 + "x": -32, + "y": -17 }, { "path": "track/rmc/preview_track.png", - "x_offset": 1, - "y_offset": 1, + "x": 1, + "y": 1, "palette": "keep" }, { "path": "track/rmc/preview_support.png", - "x_offset": 1, - "y_offset": 1, + "x": 1, + "y": 1, "palette": "keep" }, { "path": "track/rmc/flat_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/brake_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/brake_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/block_brake_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/block_brake_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/booster_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/booster_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_1.png", - "x_offset": -34, - "y_offset": -41, + "x": -34, + "y": -41, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_2_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_2_2.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_3_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_3_2.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_4.png", - "x_offset": -34, - "y_offset": -41, + "x": -34, + "y": -41, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_1.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_3_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_3_2.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_4.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/steep_1.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/steep_2.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/steep_3.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/steep_4.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/steep_to_vertical_up_1.png", - "x_offset": -34, - "y_offset": -70, + "x": -34, + "y": -70, "palette": "keep" }, { "path": "track/rmc/steep_to_vertical_up_2.png", - "x_offset": -34, - "y_offset": -59, + "x": -34, + "y": -59, "palette": "keep" }, { "path": "track/rmc/steep_to_vertical_up_3.png", - "x_offset": -32, - "y_offset": -59, + "x": -32, + "y": -59, "palette": "keep" }, { "path": "track/rmc/steep_to_vertical_up_4.png", - "x_offset": -32, - "y_offset": -70, + "x": -32, + "y": -70, "palette": "keep" }, { "path": "track/rmc/vertical_to_steep_up_1.png", - "x_offset": -15, - "y_offset": -65, + "x": -15, + "y": -65, "palette": "keep" }, { "path": "track/rmc/vertical_to_steep_up_2.png", - "x_offset": -14, - "y_offset": -49, + "x": -14, + "y": -49, "palette": "keep" }, { "path": "track/rmc/vertical_to_steep_up_3.png", - "x_offset": -34, - "y_offset": -49, + "x": -34, + "y": -49, "palette": "keep" }, { "path": "track/rmc/vertical_to_steep_up_4.png", - "x_offset": -34, - "y_offset": -65, + "x": -34, + "y": -65, "palette": "keep" }, { "path": "track/rmc/vertical_1.png", - "x_offset": -15, - "y_offset": -46, + "x": -15, + "y": -46, "palette": "keep" }, { "path": "track/rmc/vertical_2.png", - "x_offset": -15, - "y_offset": -35, + "x": -15, + "y": -35, "palette": "keep" }, { "path": "track/rmc/vertical_3.png", - "x_offset": -32, - "y_offset": -35, + "x": -32, + "y": -35, "palette": "keep" }, { "path": "track/rmc/vertical_4.png", - "x_offset": -32, - "y_offset": -46, + "x": -32, + "y": -46, "palette": "keep" }, { "path": "track/rmc/small_turn_left_1_1.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_left_1_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_left_1_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/small_turn_left_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/small_turn_left_2_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_left_2_3.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/small_turn_left_3_1.png", - "x_offset": -27, - "y_offset": -12, + "x": -27, + "y": -12, "palette": "keep" }, { "path": "track/rmc/small_turn_left_3_2.png", - "x_offset": 5, - "y_offset": -28, + "x": 5, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_left_3_3.png", - "x_offset": -27, - "y_offset": -44, + "x": -27, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_left_4_1.png", - "x_offset": -98, - "y_offset": -8, + "x": -98, + "y": -8, "palette": "keep" }, { "path": "track/rmc/small_turn_left_4_2.png", - "x_offset": -66, - "y_offset": 8, + "x": -66, + "y": 8, "palette": "keep" }, { "path": "track/rmc/small_turn_left_4_3.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_1_1.png", - "x_offset": -34, - "y_offset": -76, + "x": -34, + "y": -76, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_1_2.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_1_3.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_1_4.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_1_5.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_2_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_2_3.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_2_4.png", - "x_offset": -130, - "y_offset": -28, + "x": -130, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_2_5.png", - "x_offset": -162, - "y_offset": -12, + "x": -162, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_3_1.png", - "x_offset": -40, - "y_offset": -12, + "x": -40, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_3_2.png", - "x_offset": -8, - "y_offset": -28, + "x": -8, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_3_3.png", - "x_offset": -40, - "y_offset": -44, + "x": -40, + "y": -44, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_3_4.png", - "x_offset": -8, - "y_offset": -60, + "x": -8, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_3_5.png", - "x_offset": -40, - "y_offset": -76, + "x": -40, + "y": -76, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_4_1.png", - "x_offset": -162, - "y_offset": -15, + "x": -162, + "y": -15, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_4_2.png", - "x_offset": -130, - "y_offset": 1, + "x": -130, + "y": 1, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_4_3.png", - "x_offset": -98, - "y_offset": -15, + "x": -98, + "y": -15, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_4_4.png", - "x_offset": -66, - "y_offset": 1, + "x": -66, + "y": 1, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_4_5.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_1_1.png", - "x_offset": -34, - "y_offset": -46, + "x": -34, + "y": -46, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_1_2.png", - "x_offset": -66, - "y_offset": -30, + "x": -66, + "y": -30, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_1_3.png", - "x_offset": -34, - "y_offset": -14, + "x": -34, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_1_4.png", - "x_offset": -66, - "y_offset": 2, + "x": -66, + "y": 2, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_2_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_2_3.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_2_4.png", - "x_offset": -130, - "y_offset": -28, + "x": -130, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_3_1.png", - "x_offset": -56, - "y_offset": -12, + "x": -56, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_3_2.png", - "x_offset": -24, - "y_offset": -28, + "x": -24, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_3_3.png", - "x_offset": -56, - "y_offset": -44, + "x": -56, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_3_4.png", - "x_offset": -24, - "y_offset": -60, + "x": -24, + "y": -60, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_4_1.png", - "x_offset": -98, - "y_offset": -24, + "x": -98, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_4_2.png", - "x_offset": -66, - "y_offset": -8, + "x": -66, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_4_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_4_4.png", - "x_offset": -2, - "y_offset": -8, + "x": -2, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_1_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_1_2.png", - "x_offset": -66, - "y_offset": -8, + "x": -66, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_1_3.png", - "x_offset": -98, - "y_offset": -24, + "x": -98, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_1_4.png", - "x_offset": -130, - "y_offset": -8, + "x": -130, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_2_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_2_3.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_2_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_3_1.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_3_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_3_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_3_4.png", - "x_offset": -2, - "y_offset": -28, + "x": -2, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_4_1.png", - "x_offset": -56, - "y_offset": -46, + "x": -56, + "y": -46, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_4_2.png", - "x_offset": -24, - "y_offset": -30, + "x": -24, + "y": -30, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_4_3.png", - "x_offset": -56, - "y_offset": -14, + "x": -56, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_4_4.png", - "x_offset": -24, - "y_offset": 2, + "x": -24, + "y": 2, "palette": "keep" }, { "path": "track/rmc/flat_diag_1.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/brake_diag_1.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/brake_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/block_brake_diag_1.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/block_brake_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_1.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_3.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_1.png", - "x_offset": -53, - "y_offset": -16, + "x": -53, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_3.png", - "x_offset": -34, - "y_offset": -16, + "x": -34, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/rmc/gentle_diag_1.png", - "x_offset": -54, - "y_offset": -23, + "x": -54, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_diag_3.png", - "x_offset": -34, - "y_offset": -23, + "x": -34, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_diag_4.png", - "x_offset": -24, - "y_offset": -30, + "x": -24, + "y": -30, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_1.png", - "x_offset": -56, - "y_offset": -37, + "x": -56, + "y": -37, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_3.png", - "x_offset": -35, - "y_offset": -37, + "x": -35, + "y": -37, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_4.png", - "x_offset": -24, - "y_offset": -46, + "x": -24, + "y": -46, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_1.png", - "x_offset": -49, - "y_offset": -39, + "x": -49, + "y": -39, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_2.png", - "x_offset": -24, - "y_offset": -19, + "x": -24, + "y": -19, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_3.png", - "x_offset": -34, - "y_offset": -39, + "x": -34, + "y": -39, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_4.png", - "x_offset": -24, - "y_offset": -46, + "x": -24, + "y": -46, "palette": "keep" }, { "path": "track/rmc/steep_diag_1.png", - "x_offset": -48, - "y_offset": -69, + "x": -48, + "y": -69, "palette": "keep" }, { "path": "track/rmc/steep_diag_2.png", - "x_offset": -24, - "y_offset": -46, + "x": -24, + "y": -46, "palette": "keep" }, { "path": "track/rmc/steep_diag_3.png", - "x_offset": -35, - "y_offset": -69, + "x": -35, + "y": -69, "palette": "keep" }, { "path": "track/rmc/steep_diag_4.png", - "x_offset": -24, - "y_offset": -78, + "x": -24, + "y": -78, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_1_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_1_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_4.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_3_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_3_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_4_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_4_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_1_2.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_3_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_3_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_4_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_4_2.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_1_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_1_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_3.png", - "x_offset": -34, - "y_offset": -16, + "x": -34, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_4.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_1.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_2.png", - "x_offset": -34, - "y_offset": -16, + "x": -34, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_3_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_3_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_4_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_4_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/left_bank_1_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_1_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_2_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_2_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/left_bank_4.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_diag_1_1.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_diag_1_2.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_diag_2.png", - "x_offset": -26, - "y_offset": -14, + "x": -26, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_diag_3.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/flat_to_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_diag_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_diag_3_1.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_diag_3_2.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_to_right_bank_diag_4.png", - "x_offset": -26, - "y_offset": -25, + "x": -26, + "y": -25, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_diag_1_1.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_diag_1_2.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_diag_2.png", - "x_offset": -26, - "y_offset": -25, + "x": -26, + "y": -25, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_diag_3.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_diag_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_diag_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_diag_3_1.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_diag_3_2.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_diag_4.png", - "x_offset": -26, - "y_offset": -22, + "x": -26, + "y": -22, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_diag_1_1.png", - "x_offset": -53, - "y_offset": -12, + "x": -53, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_diag_1_2.png", - "x_offset": -53, - "y_offset": -12, + "x": -53, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_diag_2.png", - "x_offset": -26, - "y_offset": -14, + "x": -26, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_diag_3.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_diag_1.png", - "x_offset": -53, - "y_offset": -28, + "x": -53, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_diag_3_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_diag_3_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_right_bank_diag_4.png", - "x_offset": -25, - "y_offset": -33, + "x": -25, + "y": -33, "palette": "keep" }, { "path": "track/rmc/left_bank_diag_1_1.png", - "x_offset": -34, - "y_offset": -4, + "x": -34, + "y": -4, "palette": "keep" }, { "path": "track/rmc/left_bank_diag_1_2.png", - "x_offset": -34, - "y_offset": -4, + "x": -34, + "y": -4, "palette": "keep" }, { "path": "track/rmc/left_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/left_bank_diag_3.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_1_1.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_1_2.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_1_3.png", - "x_offset": -66, - "y_offset": -40, + "x": -66, + "y": -40, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_1_4.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_2_3.png", - "x_offset": -66, - "y_offset": -25, + "x": -66, + "y": -25, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_2_4.png", - "x_offset": -98, - "y_offset": -9, + "x": -98, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_2_5.png", - "x_offset": -98, - "y_offset": -9, + "x": -98, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_3_1.png", - "x_offset": -27, - "y_offset": -24, + "x": -27, + "y": -24, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_3_2.png", - "x_offset": 5, - "y_offset": -40, + "x": 5, + "y": -40, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_3_3.png", - "x_offset": -27, - "y_offset": -56, + "x": -27, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_3_4.png", - "x_offset": -27, - "y_offset": -56, + "x": -27, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_4_1.png", - "x_offset": -98, - "y_offset": -20, + "x": -98, + "y": -20, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_4_2.png", - "x_offset": -66, - "y_offset": -4, + "x": -66, + "y": -4, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_4_3.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_1_1.png", - "x_offset": -34, - "y_offset": -88, + "x": -34, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_1_2.png", - "x_offset": -34, - "y_offset": -88, + "x": -34, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_1_3.png", - "x_offset": -66, - "y_offset": -72, + "x": -66, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_1_4.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_1_5.png", - "x_offset": -66, - "y_offset": -40, + "x": -66, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_1_6.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_3.png", - "x_offset": -66, - "y_offset": -25, + "x": -66, + "y": -25, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_4.png", - "x_offset": -98, - "y_offset": -9, + "x": -98, + "y": -9, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_5.png", - "x_offset": -98, - "y_offset": -9, + "x": -98, + "y": -9, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_6.png", - "x_offset": -130, - "y_offset": -25, + "x": -130, + "y": -25, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_7.png", - "x_offset": -162, - "y_offset": -9, + "x": -162, + "y": -9, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_2_8.png", - "x_offset": -162, - "y_offset": -9, + "x": -162, + "y": -9, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_3_1.png", - "x_offset": -40, - "y_offset": -24, + "x": -40, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_3_2.png", - "x_offset": -8, - "y_offset": -40, + "x": -8, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_3_3.png", - "x_offset": -40, - "y_offset": -56, + "x": -40, + "y": -56, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_3_4.png", - "x_offset": -8, - "y_offset": -72, + "x": -8, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_3_5.png", - "x_offset": -40, - "y_offset": -88, + "x": -40, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_3_6.png", - "x_offset": -40, - "y_offset": -88, + "x": -40, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_4_1.png", - "x_offset": -162, - "y_offset": -27, + "x": -162, + "y": -27, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_4_2.png", - "x_offset": -130, - "y_offset": -11, + "x": -130, + "y": -11, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_4_3.png", - "x_offset": -98, - "y_offset": -27, + "x": -98, + "y": -27, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_4_4.png", - "x_offset": -66, - "y_offset": -11, + "x": -66, + "y": -11, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_4_5.png", - "x_offset": -34, - "y_offset": -27, + "x": -34, + "y": -27, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_1_1.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_1_2.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_1_3.png", - "x_offset": -66, - "y_offset": -41, + "x": -66, + "y": -41, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_1_4.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_1_5.png", - "x_offset": -66, - "y_offset": -9, + "x": -66, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_3.png", - "x_offset": -66, - "y_offset": -25, + "x": -66, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_4.png", - "x_offset": -66, - "y_offset": -25, + "x": -66, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_5.png", - "x_offset": -98, - "y_offset": -9, + "x": -98, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_6.png", - "x_offset": -130, - "y_offset": -25, + "x": -130, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_2_7.png", - "x_offset": -130, - "y_offset": -25, + "x": -130, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_3_1.png", - "x_offset": -56, - "y_offset": -24, + "x": -56, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_3_2.png", - "x_offset": -24, - "y_offset": -40, + "x": -24, + "y": -40, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_3_3.png", - "x_offset": -56, - "y_offset": -56, + "x": -56, + "y": -56, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_3_4.png", - "x_offset": -24, - "y_offset": -72, + "x": -24, + "y": -72, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_4_1.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_4_2.png", - "x_offset": -66, - "y_offset": -20, + "x": -66, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_4_3.png", - "x_offset": -34, - "y_offset": -36, + "x": -34, + "y": -36, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_bank_4_4.png", - "x_offset": -2, - "y_offset": -20, + "x": -2, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_1_1.png", - "x_offset": -34, - "y_offset": -36, + "x": -34, + "y": -36, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_1_2.png", - "x_offset": -66, - "y_offset": -20, + "x": -66, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_1_3.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_1_4.png", - "x_offset": -130, - "y_offset": -20, + "x": -130, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_2_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_2_2.png", - "x_offset": -66, - "y_offset": -40, + "x": -66, + "y": -40, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_2_3.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_2_4.png", - "x_offset": -66, - "y_offset": -72, + "x": -66, + "y": -72, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_1.png", - "x_offset": -97, - "y_offset": -9, + "x": -97, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_2.png", - "x_offset": -97, - "y_offset": -9, + "x": -97, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_3.png", - "x_offset": -65, - "y_offset": -25, + "x": -65, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_4.png", - "x_offset": -65, - "y_offset": -25, + "x": -65, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_5.png", - "x_offset": -33, - "y_offset": -9, + "x": -33, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_6.png", - "x_offset": -1, - "y_offset": -25, + "x": -1, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_3_7.png", - "x_offset": -1, - "y_offset": -25, + "x": -1, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_4_1.png", - "x_offset": -56, - "y_offset": -57, + "x": -56, + "y": -57, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_4_2.png", - "x_offset": -56, - "y_offset": -57, + "x": -56, + "y": -57, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_4_3.png", - "x_offset": -24, - "y_offset": -41, + "x": -24, + "y": -41, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_4_4.png", - "x_offset": -56, - "y_offset": -25, + "x": -56, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_bank_4_5.png", - "x_offset": -24, - "y_offset": -9, + "x": -24, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_1_1.png", - "x_offset": -40, - "y_offset": -79, + "x": -40, + "y": -79, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_1_2.png", - "x_offset": -28, - "y_offset": -31, + "x": -28, + "y": -31, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_2_1.png", - "x_offset": -28, - "y_offset": -47, + "x": -28, + "y": -47, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_2_2.png", - "x_offset": -104, - "y_offset": -31, + "x": -104, + "y": -31, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_3_1.png", - "x_offset": -33, - "y_offset": -15, + "x": -33, + "y": -15, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_3_2.png", - "x_offset": -21, - "y_offset": -31, + "x": -21, + "y": -31, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_4_1.png", - "x_offset": -92, - "y_offset": -32, + "x": -92, + "y": -32, "palette": "keep" }, { "path": "track/rmc/small_turn_left_gentle_up_4_2.png", - "x_offset": -40, - "y_offset": -16, + "x": -40, + "y": -16, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_1_1.png", - "x_offset": -40, - "y_offset": -32, + "x": -40, + "y": -32, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_1_2.png", - "x_offset": -92, - "y_offset": -16, + "x": -92, + "y": -16, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_2_1.png", - "x_offset": -28, - "y_offset": -15, + "x": -28, + "y": -15, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_2_2.png", - "x_offset": -40, - "y_offset": -31, + "x": -40, + "y": -31, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_3_1.png", - "x_offset": -104, - "y_offset": -47, + "x": -104, + "y": -47, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_3_2.png", - "x_offset": -28, - "y_offset": -31, + "x": -28, + "y": -31, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_4_1.png", - "x_offset": -21, - "y_offset": -79, + "x": -21, + "y": -79, "palette": "keep" }, { "path": "track/rmc/small_turn_right_gentle_up_4_2.png", - "x_offset": -33, - "y_offset": -31, + "x": -33, + "y": -31, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -140, + "x": -34, + "y": -140, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_1_2.png", - "x_offset": -66, - "y_offset": -108, + "x": -66, + "y": -108, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_1_3.png", - "x_offset": -34, - "y_offset": -140, + "x": -34, + "y": -140, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_1_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_1_5.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -76, + "x": -34, + "y": -76, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_2_2.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_2_3.png", - "x_offset": -98, - "y_offset": -52, + "x": -98, + "y": -52, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_2_4.png", - "x_offset": -130, - "y_offset": -60, + "x": -130, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_2_5.png", - "x_offset": -162, - "y_offset": -28, + "x": -162, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_3_1.png", - "x_offset": -40, - "y_offset": -12, + "x": -40, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_3_2.png", - "x_offset": -40, - "y_offset": -12, + "x": -40, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_3_3.png", - "x_offset": -40, - "y_offset": -20, + "x": -40, + "y": -20, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_3_4.png", - "x_offset": -40, - "y_offset": -12, + "x": -40, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_3_5.png", - "x_offset": -40, - "y_offset": -28, + "x": -40, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_4_1.png", - "x_offset": -162, - "y_offset": -60, + "x": -162, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_4_2.png", - "x_offset": -130, - "y_offset": -28, + "x": -130, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_4_3.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_4_4.png", - "x_offset": -66, - "y_offset": -12, + "x": -66, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_gentle_up_4_5.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -60, + "x": -34, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_1_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_1_3.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_1_4.png", - "x_offset": -130, - "y_offset": -12, + "x": -130, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_1_5.png", - "x_offset": -162, - "y_offset": -12, + "x": -162, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_2_2.png", - "x_offset": -66, - "y_offset": -12, + "x": -66, + "y": -12, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_2_3.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_2_4.png", - "x_offset": -66, - "y_offset": -20, + "x": -66, + "y": -20, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_2_5.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_3_1.png", - "x_offset": -162, - "y_offset": -76, + "x": -162, + "y": -76, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_3_2.png", - "x_offset": -130, - "y_offset": -76, + "x": -130, + "y": -76, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_3_3.png", - "x_offset": -98, - "y_offset": -52, + "x": -98, + "y": -52, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_3_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_3_5.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_4_1.png", - "x_offset": -40, - "y_offset": -140, + "x": -40, + "y": -140, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_4_2.png", - "x_offset": -8, - "y_offset": -108, + "x": -8, + "y": -108, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_4_3.png", - "x_offset": -40, - "y_offset": -84, + "x": -40, + "y": -84, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_4_4.png", - "x_offset": -8, - "y_offset": -60, + "x": -8, + "y": -60, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_gentle_up_4_5.png", - "x_offset": -40, - "y_offset": -28, + "x": -40, + "y": -28, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_1_1.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_1_2.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_2_1.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_2_2.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_3_1.png", - "x_offset": -15, - "y_offset": -57, + "x": -15, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_3_2.png", - "x_offset": -15, - "y_offset": -57, + "x": -15, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_4_1.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_left_steep_up_4_2.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_1_1.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_1_2.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_2_1.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_2_2.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_3_1.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_3_2.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_4_1.png", - "x_offset": -15, - "y_offset": -73, + "x": -15, + "y": -73, "palette": "keep" }, { "path": "track/rmc/very_small_turn_right_steep_up_4_2.png", - "x_offset": -15, - "y_offset": -73, + "x": -15, + "y": -73, "palette": "keep" }, { "path": "track/rmc/vertical_twist_left_up_1.png", - "x_offset": -32, - "y_offset": -110, + "x": -32, + "y": -110, "palette": "keep" }, { "path": "track/rmc/vertical_twist_left_up_2_1.png", - "x_offset": -15, - "y_offset": -110, + "x": -15, + "y": -110, "palette": "keep" }, { "path": "track/rmc/vertical_twist_left_up_2_2.png", - "x_offset": -15, - "y_offset": -110, + "x": -15, + "y": -110, "palette": "keep" }, { "path": "track/rmc/vertical_twist_left_up_3.png", - "x_offset": -32, - "y_offset": -99, + "x": -32, + "y": -99, "palette": "keep" }, { "path": "track/rmc/vertical_twist_left_up_4_1.png", - "x_offset": -32, - "y_offset": -99, + "x": -32, + "y": -99, "palette": "keep" }, { "path": "track/rmc/vertical_twist_left_up_4_2.png", - "x_offset": -32, - "y_offset": -99, + "x": -32, + "y": -99, "palette": "keep" }, { "path": "track/rmc/vertical_twist_right_up_1_1.png", - "x_offset": -15, - "y_offset": -99, + "x": -15, + "y": -99, "palette": "keep" }, { "path": "track/rmc/vertical_twist_right_up_1_2.png", - "x_offset": -15, - "y_offset": -99, + "x": -15, + "y": -99, "palette": "keep" }, { "path": "track/rmc/vertical_twist_right_up_2.png", - "x_offset": -32, - "y_offset": -99, + "x": -32, + "y": -99, "palette": "keep" }, { "path": "track/rmc/vertical_twist_right_up_3_1.png", - "x_offset": -32, - "y_offset": -110, + "x": -32, + "y": -110, "palette": "keep" }, { "path": "track/rmc/vertical_twist_right_up_3_2.png", - "x_offset": -32, - "y_offset": -110, + "x": -32, + "y": -110, "palette": "keep" }, { "path": "track/rmc/vertical_twist_right_up_4.png", - "x_offset": -32, - "y_offset": -110, + "x": -32, + "y": -110, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_4.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_1.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_3_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_3_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_4.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_3_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_3_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_1_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_1_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_4.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_1.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_3_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_3_2.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_4_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_4_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_1_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_1_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_4.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_1.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_3_1.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_3_2.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_4_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_4_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_2.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_4.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_1.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_3.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_4.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_2_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_3.png", - "x_offset": -34, - "y_offset": -16, + "x": -34, + "y": -16, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_4.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_1.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_2.png", - "x_offset": -34, - "y_offset": -16, + "x": -34, + "y": -16, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_3_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_3_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_4.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_2_1.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_2_2.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_3.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_2.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_3_1.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_3_2.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_1_1.png", - "x_offset": -40, - "y_offset": -91, + "x": -40, + "y": -91, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_1_2.png", - "x_offset": -28, - "y_offset": -43, + "x": -28, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_2_1.png", - "x_offset": -28, - "y_offset": -44, + "x": -28, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_2_2.png", - "x_offset": -28, - "y_offset": -44, + "x": -28, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_2_3.png", - "x_offset": -104, - "y_offset": -28, + "x": -104, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_2_4.png", - "x_offset": -104, - "y_offset": -28, + "x": -104, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_3_1.png", - "x_offset": -33, - "y_offset": -27, + "x": -33, + "y": -27, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_3_2.png", - "x_offset": -21, - "y_offset": -43, + "x": -21, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_3_3.png", - "x_offset": -21, - "y_offset": -43, + "x": -21, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_4_1.png", - "x_offset": -92, - "y_offset": -44, + "x": -92, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_gentle_up_4_2.png", - "x_offset": -40, - "y_offset": -28, + "x": -40, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_1_1.png", - "x_offset": -40, - "y_offset": -44, + "x": -40, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_1_2.png", - "x_offset": -92, - "y_offset": -28, + "x": -92, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_2_1.png", - "x_offset": -28, - "y_offset": -27, + "x": -28, + "y": -27, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_2_2.png", - "x_offset": -40, - "y_offset": -43, + "x": -40, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_2_3.png", - "x_offset": -40, - "y_offset": -43, + "x": -40, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_3_1.png", - "x_offset": -104, - "y_offset": -44, + "x": -104, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_3_2.png", - "x_offset": -104, - "y_offset": -44, + "x": -104, + "y": -44, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_3_3.png", - "x_offset": -28, - "y_offset": -28, + "x": -28, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_3_4.png", - "x_offset": -28, - "y_offset": -28, + "x": -28, + "y": -28, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_4_1.png", - "x_offset": -21, - "y_offset": -91, + "x": -21, + "y": -91, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_gentle_up_4_2.png", - "x_offset": -33, - "y_offset": -43, + "x": -33, + "y": -43, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -152, + "x": -34, + "y": -152, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_1_2.png", - "x_offset": -66, - "y_offset": -120, + "x": -66, + "y": -120, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_1_3.png", - "x_offset": -34, - "y_offset": -152, + "x": -34, + "y": -152, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_1_4.png", - "x_offset": -66, - "y_offset": -72, + "x": -66, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_1_5.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_3.png", - "x_offset": -66, - "y_offset": -73, + "x": -66, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_4.png", - "x_offset": -66, - "y_offset": -73, + "x": -66, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_5.png", - "x_offset": -98, - "y_offset": -49, + "x": -98, + "y": -49, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_6.png", - "x_offset": -98, - "y_offset": -49, + "x": -98, + "y": -49, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_7.png", - "x_offset": -130, - "y_offset": -57, + "x": -130, + "y": -57, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_8.png", - "x_offset": -130, - "y_offset": -57, + "x": -130, + "y": -57, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_9.png", - "x_offset": -162, - "y_offset": -25, + "x": -162, + "y": -25, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_2_10.png", - "x_offset": -162, - "y_offset": -25, + "x": -162, + "y": -25, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_3_1.png", - "x_offset": -40, - "y_offset": -24, + "x": -40, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_3_2.png", - "x_offset": -40, - "y_offset": -24, + "x": -40, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_3_3.png", - "x_offset": -40, - "y_offset": -32, + "x": -40, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_3_4.png", - "x_offset": -40, - "y_offset": -24, + "x": -40, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_3_5.png", - "x_offset": -40, - "y_offset": -40, + "x": -40, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_3_6.png", - "x_offset": -40, - "y_offset": -40, + "x": -40, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_4_1.png", - "x_offset": -162, - "y_offset": -72, + "x": -162, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_4_2.png", - "x_offset": -130, - "y_offset": -40, + "x": -130, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_4_3.png", - "x_offset": -98, - "y_offset": -48, + "x": -98, + "y": -48, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_4_4.png", - "x_offset": -66, - "y_offset": -24, + "x": -66, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_left_bank_gentle_up_4_5.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -72, + "x": -34, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_1_2.png", - "x_offset": -66, - "y_offset": -40, + "x": -66, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_1_3.png", - "x_offset": -98, - "y_offset": -48, + "x": -98, + "y": -48, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_1_4.png", - "x_offset": -130, - "y_offset": -24, + "x": -130, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_1_5.png", - "x_offset": -162, - "y_offset": -24, + "x": -162, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_2_2.png", - "x_offset": -66, - "y_offset": -24, + "x": -66, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_2_3.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_2_4.png", - "x_offset": -66, - "y_offset": -32, + "x": -66, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_2_5.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_2_6.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_1.png", - "x_offset": -162, - "y_offset": -73, + "x": -162, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_2.png", - "x_offset": -162, - "y_offset": -73, + "x": -162, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_3.png", - "x_offset": -130, - "y_offset": -73, + "x": -130, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_4.png", - "x_offset": -130, - "y_offset": -73, + "x": -130, + "y": -73, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_5.png", - "x_offset": -98, - "y_offset": -49, + "x": -98, + "y": -49, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_6.png", - "x_offset": -98, - "y_offset": -49, + "x": -98, + "y": -49, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_7.png", - "x_offset": -66, - "y_offset": -57, + "x": -66, + "y": -57, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_8.png", - "x_offset": -66, - "y_offset": -57, + "x": -66, + "y": -57, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_9.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_3_10.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_4_1.png", - "x_offset": -40, - "y_offset": -152, + "x": -40, + "y": -152, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_4_2.png", - "x_offset": -8, - "y_offset": -120, + "x": -8, + "y": -120, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_4_3.png", - "x_offset": -40, - "y_offset": -96, + "x": -40, + "y": -96, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_4_4.png", - "x_offset": -8, - "y_offset": -72, + "x": -8, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_turn_right_bank_gentle_up_4_5.png", - "x_offset": -40, - "y_offset": -40, + "x": -40, + "y": -40, "palette": "keep" }, { "path": "track/rmc/s_bend_left_1_1.png", - "x_offset": -34, - "y_offset": -60, + "x": -34, + "y": -60, "palette": "keep" }, { "path": "track/rmc/s_bend_left_1_2.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/s_bend_left_1_3.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/s_bend_left_1_4.png", - "x_offset": -66, - "y_offset": -12, + "x": -66, + "y": -12, "palette": "keep" }, { "path": "track/rmc/s_bend_left_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/s_bend_left_2_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/s_bend_left_2_3.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/s_bend_left_2_4.png", - "x_offset": -130, - "y_offset": -28, + "x": -130, + "y": -28, "palette": "keep" }, { "path": "track/rmc/s_bend_right_1_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/s_bend_right_1_2.png", - "x_offset": -66, - "y_offset": -12, + "x": -66, + "y": -12, "palette": "keep" }, { "path": "track/rmc/s_bend_right_1_3.png", - "x_offset": -98, - "y_offset": -28, + "x": -98, + "y": -28, "palette": "keep" }, { "path": "track/rmc/s_bend_right_1_4.png", - "x_offset": -130, - "y_offset": -12, + "x": -130, + "y": -12, "palette": "keep" }, { "path": "track/rmc/s_bend_right_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/s_bend_right_2_2.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/s_bend_right_2_3.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/s_bend_right_2_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_1_1.png", - "x_offset": -34, - "y_offset": -64, + "x": -34, + "y": -64, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_1_2.png", - "x_offset": -34, - "y_offset": -64, + "x": -34, + "y": -64, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_1_3.png", - "x_offset": -66, - "y_offset": -48, + "x": -66, + "y": -48, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_1_4.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_2_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_2_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_2_3.png", - "x_offset": -66, - "y_offset": -33, + "x": -66, + "y": -33, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_2_4.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_2_5.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_3_1.png", - "x_offset": -27, - "y_offset": -24, + "x": -27, + "y": -24, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_3_2.png", - "x_offset": 5, - "y_offset": -40, + "x": 5, + "y": -40, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_3_3.png", - "x_offset": -27, - "y_offset": -56, + "x": -27, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_3_4.png", - "x_offset": -27, - "y_offset": -56, + "x": -27, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_4_1.png", - "x_offset": -98, - "y_offset": -25, + "x": -98, + "y": -25, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_4_2.png", - "x_offset": -66, - "y_offset": -9, + "x": -66, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_helix_left_up_4_3.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_1_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_1_2.png", - "x_offset": -66, - "y_offset": -9, + "x": -66, + "y": -9, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_1_3.png", - "x_offset": -98, - "y_offset": -25, + "x": -98, + "y": -25, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_2_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_2_2.png", - "x_offset": -66, - "y_offset": -40, + "x": -66, + "y": -40, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_2_3.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_2_4.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_3_1.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_3_2.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_3_3.png", - "x_offset": -66, - "y_offset": -33, + "x": -66, + "y": -33, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_3_4.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_3_5.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_4_1.png", - "x_offset": -27, - "y_offset": -64, + "x": -27, + "y": -64, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_4_2.png", - "x_offset": -27, - "y_offset": -64, + "x": -27, + "y": -64, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_4_3.png", - "x_offset": 5, - "y_offset": -48, + "x": 5, + "y": -48, "palette": "keep" }, { "path": "track/rmc/small_helix_right_up_4_4.png", - "x_offset": -27, - "y_offset": -32, + "x": -27, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_1_1.png", - "x_offset": -34, - "y_offset": -96, + "x": -34, + "y": -96, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_1_2.png", - "x_offset": -34, - "y_offset": -96, + "x": -34, + "y": -96, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_1_3.png", - "x_offset": -66, - "y_offset": -80, + "x": -66, + "y": -80, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_1_4.png", - "x_offset": -34, - "y_offset": -64, + "x": -34, + "y": -64, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_1_5.png", - "x_offset": -66, - "y_offset": -48, + "x": -66, + "y": -48, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_1_6.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_1.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_2.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_3.png", - "x_offset": -66, - "y_offset": -33, + "x": -66, + "y": -33, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_4.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_5.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_6.png", - "x_offset": -130, - "y_offset": -33, + "x": -130, + "y": -33, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_7.png", - "x_offset": -162, - "y_offset": -17, + "x": -162, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_2_8.png", - "x_offset": -162, - "y_offset": -17, + "x": -162, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_3_1.png", - "x_offset": -40, - "y_offset": -24, + "x": -40, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_3_2.png", - "x_offset": -8, - "y_offset": -40, + "x": -8, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_3_3.png", - "x_offset": -40, - "y_offset": -56, + "x": -40, + "y": -56, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_3_4.png", - "x_offset": -8, - "y_offset": -72, + "x": -8, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_3_5.png", - "x_offset": -40, - "y_offset": -88, + "x": -40, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_3_6.png", - "x_offset": -40, - "y_offset": -88, + "x": -40, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_4_1.png", - "x_offset": -162, - "y_offset": -32, + "x": -162, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_4_2.png", - "x_offset": -130, - "y_offset": -16, + "x": -130, + "y": -16, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_4_3.png", - "x_offset": -98, - "y_offset": -32, + "x": -98, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_4_4.png", - "x_offset": -66, - "y_offset": -16, + "x": -66, + "y": -16, "palette": "keep" }, { "path": "track/rmc/medium_helix_left_up_4_5.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_1_1.png", - "x_offset": -34, - "y_offset": -32, + "x": -34, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_1_2.png", - "x_offset": -66, - "y_offset": -16, + "x": -66, + "y": -16, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_1_3.png", - "x_offset": -98, - "y_offset": -32, + "x": -98, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_1_4.png", - "x_offset": -130, - "y_offset": -16, + "x": -130, + "y": -16, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_1_5.png", - "x_offset": -162, - "y_offset": -32, + "x": -162, + "y": -32, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_2_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_2_2.png", - "x_offset": -66, - "y_offset": -40, + "x": -66, + "y": -40, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_2_3.png", - "x_offset": -34, - "y_offset": -56, + "x": -34, + "y": -56, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_2_4.png", - "x_offset": -66, - "y_offset": -72, + "x": -66, + "y": -72, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_2_5.png", - "x_offset": -34, - "y_offset": -88, + "x": -34, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_2_6.png", - "x_offset": -34, - "y_offset": -88, + "x": -34, + "y": -88, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_1.png", - "x_offset": -162, - "y_offset": -17, + "x": -162, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_2.png", - "x_offset": -162, - "y_offset": -17, + "x": -162, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_3.png", - "x_offset": -130, - "y_offset": -33, + "x": -130, + "y": -33, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_4.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_5.png", - "x_offset": -98, - "y_offset": -17, + "x": -98, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_6.png", - "x_offset": -66, - "y_offset": -33, + "x": -66, + "y": -33, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_7.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_3_8.png", - "x_offset": -34, - "y_offset": -17, + "x": -34, + "y": -17, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_4_1.png", - "x_offset": -40, - "y_offset": -96, + "x": -40, + "y": -96, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_4_2.png", - "x_offset": -40, - "y_offset": -96, + "x": -40, + "y": -96, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_4_3.png", - "x_offset": -8, - "y_offset": -80, + "x": -8, + "y": -80, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_4_4.png", - "x_offset": -40, - "y_offset": -64, + "x": -40, + "y": -64, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_4_5.png", - "x_offset": -8, - "y_offset": -48, + "x": -8, + "y": -48, "palette": "keep" }, { "path": "track/rmc/medium_helix_right_up_4_6.png", - "x_offset": -40, - "y_offset": -32, + "x": -40, + "y": -32, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_1_1.png", - "x_offset": -34, - "y_offset": -76, + "x": -34, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_1_2.png", - "x_offset": -34, - "y_offset": -76, + "x": -34, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_1_3.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_1_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_1_5.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_1_6.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_2_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_2_3.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_2_4.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_2_5.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_2_6.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_3_1.png", - "x_offset": -98, - "y_offset": -15, + "x": -98, + "y": -15, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_3_2.png", - "x_offset": -98, - "y_offset": -15, + "x": -98, + "y": -15, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_3_3.png", - "x_offset": -66, - "y_offset": -31, + "x": -66, + "y": -31, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_3_4.png", - "x_offset": -66, - "y_offset": -31, + "x": -66, + "y": -31, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_3_5.png", - "x_offset": -34, - "y_offset": -47, + "x": -34, + "y": -47, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_3_6.png", - "x_offset": -34, - "y_offset": -47, + "x": -34, + "y": -47, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_4_1.png", - "x_offset": -98, - "y_offset": -76, + "x": -98, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_4_2.png", - "x_offset": -98, - "y_offset": -76, + "x": -98, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_4_3.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_4_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_4_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_left_4_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_1_1.png", - "x_offset": -34, - "y_offset": -76, + "x": -34, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_1_2.png", - "x_offset": -34, - "y_offset": -76, + "x": -34, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_1_3.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_1_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_1_5.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_1_6.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_2_1.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_2_2.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_2_3.png", - "x_offset": -66, - "y_offset": -31, + "x": -66, + "y": -31, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_2_4.png", - "x_offset": -66, - "y_offset": -31, + "x": -66, + "y": -31, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_2_5.png", - "x_offset": -98, - "y_offset": -47, + "x": -98, + "y": -47, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_2_6.png", - "x_offset": -98, - "y_offset": -47, + "x": -98, + "y": -47, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_3_1.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_3_2.png", - "x_offset": -98, - "y_offset": -12, + "x": -98, + "y": -12, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_3_3.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_3_4.png", - "x_offset": -66, - "y_offset": -28, + "x": -66, + "y": -28, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_3_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_3_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_4_1.png", - "x_offset": -98, - "y_offset": -76, + "x": -98, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_4_2.png", - "x_offset": -98, - "y_offset": -76, + "x": -98, + "y": -76, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_4_3.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_4_4.png", - "x_offset": -66, - "y_offset": -60, + "x": -66, + "y": -60, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_4_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/barrel_roll_right_4_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_1_1.png", - "x_offset": -34, - "y_offset": -145, + "x": -34, + "y": -145, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_1_2.png", - "x_offset": -66, - "y_offset": -129, + "x": -66, + "y": -129, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_1_3.png", - "x_offset": -98, - "y_offset": -97, + "x": -98, + "y": -97, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_1_4.png", - "x_offset": -130, - "y_offset": -57, + "x": -130, + "y": -57, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_2_1.png", - "x_offset": -34, - "y_offset": -33, + "x": -34, + "y": -33, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_2_2.png", - "x_offset": -66, - "y_offset": -49, + "x": -66, + "y": -49, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_2_3.png", - "x_offset": -98, - "y_offset": -49, + "x": -98, + "y": -49, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_2_4.png", - "x_offset": -130, - "y_offset": -41, + "x": -130, + "y": -41, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_3_1.png", - "x_offset": -130, - "y_offset": -33, + "x": -130, + "y": -33, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_3_2.png", - "x_offset": -98, - "y_offset": -49, + "x": -98, + "y": -49, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_3_3.png", - "x_offset": -66, - "y_offset": -49, + "x": -66, + "y": -49, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_3_4.png", - "x_offset": -34, - "y_offset": -41, + "x": -34, + "y": -41, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_4_1.png", - "x_offset": -130, - "y_offset": -145, + "x": -130, + "y": -145, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_4_2.png", - "x_offset": -98, - "y_offset": -129, + "x": -98, + "y": -129, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_4_3.png", - "x_offset": -66, - "y_offset": -97, + "x": -66, + "y": -97, "palette": "keep" }, { "path": "track/rmc/flat_to_steep_up_4_4.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_1_1.png", - "x_offset": -34, - "y_offset": -148, + "x": -34, + "y": -148, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_1_2.png", - "x_offset": -66, - "y_offset": -92, + "x": -66, + "y": -92, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_1_3.png", - "x_offset": -98, - "y_offset": -52, + "x": -98, + "y": -52, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_1_4.png", - "x_offset": -130, - "y_offset": -20, + "x": -130, + "y": -20, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_2_1.png", - "x_offset": -34, - "y_offset": -51, + "x": -34, + "y": -51, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_2_2.png", - "x_offset": -66, - "y_offset": -27, + "x": -66, + "y": -27, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_2_3.png", - "x_offset": -98, - "y_offset": -19, + "x": -98, + "y": -19, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_2_4.png", - "x_offset": -130, - "y_offset": -19, + "x": -130, + "y": -19, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_3_1.png", - "x_offset": -130, - "y_offset": -51, + "x": -130, + "y": -51, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_3_2.png", - "x_offset": -98, - "y_offset": -27, + "x": -98, + "y": -27, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_3_3.png", - "x_offset": -66, - "y_offset": -19, + "x": -66, + "y": -19, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_3_4.png", - "x_offset": -34, - "y_offset": -19, + "x": -34, + "y": -19, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_4_1.png", - "x_offset": -130, - "y_offset": -148, + "x": -130, + "y": -148, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_4_2.png", - "x_offset": -98, - "y_offset": -92, + "x": -98, + "y": -92, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_4_3.png", - "x_offset": -66, - "y_offset": -52, + "x": -66, + "y": -52, "palette": "keep" }, { "path": "track/rmc/steep_to_flat_up_4_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_1_1.png", - "x_offset": -98, - "y_offset": -99, + "x": -98, + "y": -99, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_1_2.png", - "x_offset": -98, - "y_offset": -99, + "x": -98, + "y": -99, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_1_3.png", - "x_offset": -66, - "y_offset": -59, + "x": -66, + "y": -59, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_1_4.png", - "x_offset": -66, - "y_offset": -59, + "x": -66, + "y": -59, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_1_5.png", - "x_offset": -34, - "y_offset": -35, + "x": -34, + "y": -35, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_1_6.png", - "x_offset": -34, - "y_offset": -35, + "x": -34, + "y": -35, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_2_1.png", - "x_offset": -98, - "y_offset": -172, + "x": -98, + "y": -172, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_2_2.png", - "x_offset": -98, - "y_offset": -172, + "x": -98, + "y": -172, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_2_3.png", - "x_offset": -66, - "y_offset": -100, + "x": -66, + "y": -100, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_2_4.png", - "x_offset": -66, - "y_offset": -100, + "x": -66, + "y": -100, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_2_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_2_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_3_1.png", - "x_offset": -32, - "y_offset": -172, + "x": -32, + "y": -172, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_3_2.png", - "x_offset": -32, - "y_offset": -172, + "x": -32, + "y": -172, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_3_3.png", - "x_offset": -64, - "y_offset": -100, + "x": -64, + "y": -100, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_3_4.png", - "x_offset": -64, - "y_offset": -100, + "x": -64, + "y": -100, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_3_5.png", - "x_offset": -96, - "y_offset": -44, + "x": -96, + "y": -44, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_3_6.png", - "x_offset": -96, - "y_offset": -44, + "x": -96, + "y": -44, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_4_1.png", - "x_offset": -32, - "y_offset": -99, + "x": -32, + "y": -99, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_4_2.png", - "x_offset": -32, - "y_offset": -99, + "x": -32, + "y": -99, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_4_3.png", - "x_offset": -64, - "y_offset": -59, + "x": -64, + "y": -59, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_4_4.png", - "x_offset": -64, - "y_offset": -59, + "x": -64, + "y": -59, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_4_5.png", - "x_offset": -96, - "y_offset": -35, + "x": -96, + "y": -35, "palette": "keep" }, { "path": "track/rmc/quarter_loop_up_4_6.png", - "x_offset": -96, - "y_offset": -35, + "x": -96, + "y": -35, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_1_1.png", - "x_offset": -40, - "y_offset": -71, + "x": -40, + "y": -71, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_1_2.png", - "x_offset": -28, - "y_offset": -23, + "x": -28, + "y": -23, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_2_1.png", - "x_offset": -28, - "y_offset": -39, + "x": -28, + "y": -39, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_2_2.png", - "x_offset": -28, - "y_offset": -39, + "x": -28, + "y": -39, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_2_3.png", - "x_offset": -104, - "y_offset": -23, + "x": -104, + "y": -23, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_3_1.png", - "x_offset": -33, - "y_offset": -27, + "x": -33, + "y": -27, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_3_2.png", - "x_offset": -21, - "y_offset": -43, + "x": -21, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_4_1.png", - "x_offset": -92, - "y_offset": -29, + "x": -92, + "y": -29, "palette": "keep" }, { "path": "track/rmc/small_turn_left_bank_to_gentle_up_4_2.png", - "x_offset": -40, - "y_offset": -13, + "x": -40, + "y": -13, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_1_1.png", - "x_offset": -40, - "y_offset": -29, + "x": -40, + "y": -29, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_1_2.png", - "x_offset": -92, - "y_offset": -13, + "x": -92, + "y": -13, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_2_1.png", - "x_offset": -28, - "y_offset": -27, + "x": -28, + "y": -27, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_2_2.png", - "x_offset": -40, - "y_offset": -43, + "x": -40, + "y": -43, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_3_1.png", - "x_offset": -104, - "y_offset": -39, + "x": -104, + "y": -39, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_3_2.png", - "x_offset": -104, - "y_offset": -39, + "x": -104, + "y": -39, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_3_3.png", - "x_offset": -28, - "y_offset": -23, + "x": -28, + "y": -23, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_4_1.png", - "x_offset": -21, - "y_offset": -71, + "x": -21, + "y": -71, "palette": "keep" }, { "path": "track/rmc/small_turn_right_bank_to_gentle_up_4_2.png", - "x_offset": -33, - "y_offset": -23, + "x": -33, + "y": -23, "palette": "keep" }, { "path": "track/rmc/powered_lift_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/powered_lift_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/powered_lift_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/powered_lift_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_1_1.png", - "x_offset": -34, - "y_offset": -100, + "x": -34, + "y": -100, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_1_2.png", - "x_offset": -34, - "y_offset": -100, + "x": -34, + "y": -100, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_1_3.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_1_4.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_1_5.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_1_6.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_2_1.png", - "x_offset": -34, - "y_offset": -36, + "x": -34, + "y": -36, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_2_2.png", - "x_offset": -34, - "y_offset": -36, + "x": -34, + "y": -36, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_2_3.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_2_4.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_2_5.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_2_6.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_3_1.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_3_2.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_3_3.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_3_4.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_4_1.png", - "x_offset": -98, - "y_offset": -100, + "x": -98, + "y": -100, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_4_2.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_4_3.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_left_4_4.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_1_1.png", - "x_offset": -34, - "y_offset": -100, + "x": -34, + "y": -100, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_1_2.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_1_3.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_1_4.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_2_1.png", - "x_offset": -34, - "y_offset": -36, + "x": -34, + "y": -36, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_2_2.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_2_3.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_2_4.png", - "x_offset": -98, - "y_offset": -44, + "x": -98, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_3_1.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_3_2.png", - "x_offset": -98, - "y_offset": -36, + "x": -98, + "y": -36, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_3_3.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_3_4.png", - "x_offset": -66, - "y_offset": -44, + "x": -66, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_3_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_3_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_4_1.png", - "x_offset": -98, - "y_offset": -100, + "x": -98, + "y": -100, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_4_2.png", - "x_offset": -98, - "y_offset": -100, + "x": -98, + "y": -100, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_4_3.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_4_4.png", - "x_offset": -66, - "y_offset": -76, + "x": -66, + "y": -76, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_4_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/zero_g_roll_right_4_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_1.png", - "x_offset": -34, - "y_offset": -212, + "x": -34, + "y": -212, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_2.png", - "x_offset": -66, - "y_offset": -140, + "x": -66, + "y": -140, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_3.png", - "x_offset": -66, - "y_offset": -140, + "x": -66, + "y": -140, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_4.png", - "x_offset": -98, - "y_offset": -84, + "x": -98, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_5.png", - "x_offset": -98, - "y_offset": -84, + "x": -98, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_6.png", - "x_offset": -130, - "y_offset": -44, + "x": -130, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_1_7.png", - "x_offset": -130, - "y_offset": -44, + "x": -130, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_1.png", - "x_offset": -34, - "y_offset": -117, + "x": -34, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_2.png", - "x_offset": -34, - "y_offset": -117, + "x": -34, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_3.png", - "x_offset": -66, - "y_offset": -77, + "x": -66, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_4.png", - "x_offset": -66, - "y_offset": -77, + "x": -66, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_5.png", - "x_offset": -98, - "y_offset": -53, + "x": -98, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_6.png", - "x_offset": -98, - "y_offset": -53, + "x": -98, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_7.png", - "x_offset": -130, - "y_offset": -45, + "x": -130, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_2_8.png", - "x_offset": -130, - "y_offset": -45, + "x": -130, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_1.png", - "x_offset": -130, - "y_offset": -117, + "x": -130, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_2.png", - "x_offset": -130, - "y_offset": -117, + "x": -130, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_3.png", - "x_offset": -98, - "y_offset": -77, + "x": -98, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_4.png", - "x_offset": -98, - "y_offset": -77, + "x": -98, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_5.png", - "x_offset": -66, - "y_offset": -53, + "x": -66, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_6.png", - "x_offset": -66, - "y_offset": -53, + "x": -66, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_7.png", - "x_offset": -34, - "y_offset": -45, + "x": -34, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_3_8.png", - "x_offset": -34, - "y_offset": -45, + "x": -34, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_4_1.png", - "x_offset": -130, - "y_offset": -212, + "x": -130, + "y": -212, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_4_2.png", - "x_offset": -98, - "y_offset": -140, + "x": -98, + "y": -140, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_4_3.png", - "x_offset": -66, - "y_offset": -84, + "x": -66, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_4_4.png", - "x_offset": -66, - "y_offset": -84, + "x": -66, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_4_5.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_left_4_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_1_1.png", - "x_offset": -34, - "y_offset": -212, + "x": -34, + "y": -212, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_1_2.png", - "x_offset": -66, - "y_offset": -140, + "x": -66, + "y": -140, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_1_3.png", - "x_offset": -98, - "y_offset": -84, + "x": -98, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_1_4.png", - "x_offset": -98, - "y_offset": -84, + "x": -98, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_1_5.png", - "x_offset": -130, - "y_offset": -44, + "x": -130, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_1_6.png", - "x_offset": -130, - "y_offset": -44, + "x": -130, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_1.png", - "x_offset": -34, - "y_offset": -117, + "x": -34, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_2.png", - "x_offset": -34, - "y_offset": -117, + "x": -34, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_3.png", - "x_offset": -66, - "y_offset": -77, + "x": -66, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_4.png", - "x_offset": -66, - "y_offset": -77, + "x": -66, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_5.png", - "x_offset": -98, - "y_offset": -53, + "x": -98, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_6.png", - "x_offset": -98, - "y_offset": -53, + "x": -98, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_7.png", - "x_offset": -130, - "y_offset": -45, + "x": -130, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_2_8.png", - "x_offset": -130, - "y_offset": -45, + "x": -130, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_1.png", - "x_offset": -130, - "y_offset": -117, + "x": -130, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_2.png", - "x_offset": -130, - "y_offset": -117, + "x": -130, + "y": -117, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_3.png", - "x_offset": -98, - "y_offset": -77, + "x": -98, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_4.png", - "x_offset": -98, - "y_offset": -77, + "x": -98, + "y": -77, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_5.png", - "x_offset": -66, - "y_offset": -53, + "x": -66, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_6.png", - "x_offset": -66, - "y_offset": -53, + "x": -66, + "y": -53, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_7.png", - "x_offset": -34, - "y_offset": -45, + "x": -34, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_3_8.png", - "x_offset": -34, - "y_offset": -45, + "x": -34, + "y": -45, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_1.png", - "x_offset": -130, - "y_offset": -212, + "x": -130, + "y": -212, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_2.png", - "x_offset": -98, - "y_offset": -140, + "x": -98, + "y": -140, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_3.png", - "x_offset": -98, - "y_offset": -140, + "x": -98, + "y": -140, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_4.png", - "x_offset": -66, - "y_offset": -84, + "x": -66, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_5.png", - "x_offset": -66, - "y_offset": -84, + "x": -66, + "y": -84, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_6.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_zero_g_roll_right_4_7.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_1_2.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_1_3.png", - "x_offset": -3, - "y_offset": 8, + "x": -3, + "y": 8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_1_4.png", - "x_offset": -28, - "y_offset": -14, + "x": -28, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_2_2.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_2_3.png", - "x_offset": -24, - "y_offset": 8, + "x": -24, + "y": 8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_3_1.png", - "x_offset": -8, - "y_offset": -12, + "x": -8, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": -10, + "x": 0, + "y": -10, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_3_3.png", - "x_offset": -32, - "y_offset": -4, + "x": -32, + "y": -4, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_3_4.png", - "x_offset": -24, - "y_offset": -23, + "x": -24, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_4_1.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_4_2.png", - "x_offset": -31, - "y_offset": -14, + "x": -31, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": -25, + "x": 0, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_diag_gentle_up_4_4.png", - "x_offset": 0, - "y_offset": -23, + "x": 0, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -21, + "x": -34, + "y": -21, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_1_2.png", - "x_offset": -21, - "y_offset": -14, + "x": -21, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_1_3.png", - "x_offset": -15, - "y_offset": -25, + "x": -15, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -10, + "x": -34, + "y": -10, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_2_3.png", - "x_offset": -2, - "y_offset": -4, + "x": -2, + "y": -4, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_2_4.png", - "x_offset": -11, - "y_offset": -23, + "x": -11, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_3_1.png", - "x_offset": -13, - "y_offset": -12, + "x": -13, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_3_2.png", - "x_offset": -8, - "y_offset": -17, + "x": -8, + "y": -17, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 8, + "x": 0, + "y": 8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": -23, + "x": 0, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_4_1.png", - "x_offset": -30, - "y_offset": -40, + "x": -30, + "y": -40, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_4_2.png", - "x_offset": -20, - "y_offset": -24, + "x": -20, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_4_3.png", - "x_offset": -32, - "y_offset": 8, + "x": -32, + "y": 8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_diag_gentle_up_4_4.png", - "x_offset": -24, - "y_offset": -13, + "x": -24, + "y": -13, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -18, + "x": 0, + "y": -18, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -22, + "x": -32, + "y": -22, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_2_1.png", - "x_offset": -24, - "y_offset": -2, + "x": -24, + "y": -2, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_2_3.png", - "x_offset": -23, - "y_offset": -18, + "x": -23, + "y": -18, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_2_4.png", - "x_offset": -27, - "y_offset": -13, + "x": -27, + "y": -13, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -15, + "x": -32, + "y": -15, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_3_3.png", - "x_offset": -23, - "y_offset": -7, + "x": -23, + "y": -7, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_3_4.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -8, + "x": -26, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_4_3.png", - "x_offset": -31, - "y_offset": -8, + "x": -31, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_to_orthogonal_gentle_up_4_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -15, + "x": 0, + "y": -15, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_2_1.png", - "x_offset": 0, - "y_offset": -2, + "x": 0, + "y": -2, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_2_3.png", - "x_offset": -16, - "y_offset": -18, + "x": -16, + "y": -18, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_2_4.png", - "x_offset": -34, - "y_offset": -13, + "x": -34, + "y": -13, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -18, + "x": -32, + "y": -18, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_3_3.png", - "x_offset": -16, - "y_offset": -22, + "x": -16, + "y": -22, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_3_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_4_1.png", - "x_offset": -24, - "y_offset": -8, + "x": -24, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_4_3.png", - "x_offset": -22, - "y_offset": -8, + "x": -22, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_to_orthogonal_gentle_up_4_4.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -20, + "x": -32, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_diag_2.png", - "x_offset": -26, - "y_offset": -19, + "x": -26, + "y": -19, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -35, + "x": -32, + "y": -35, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -41, + "x": -24, + "y": -41, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -35, + "x": -32, + "y": -35, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -19, + "x": -24, + "y": -19, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": -20, + "x": -32, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_gentle_up_right_bank_diag_4.png", - "x_offset": -26, - "y_offset": -41, + "x": -26, + "y": -41, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_diag_1_1.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_diag_1_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_diag_2.png", - "x_offset": -26, - "y_offset": -25, + "x": -26, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_diag_3.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_gentle_up_diag_4.png", - "x_offset": -24, - "y_offset": -30, + "x": -24, + "y": -30, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_diag_3_1.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_diag_3_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_gentle_up_diag_4.png", - "x_offset": -26, - "y_offset": -30, + "x": -26, + "y": -30, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -27, + "x": -32, + "y": -27, "palette": "keep" }, { "path": "track/rmc/left_bank_to_gentle_up_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -27, + "x": -32, + "y": -27, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/right_bank_to_gentle_up_right_bank_diag_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_right_bank_diag_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -20, + "x": -32, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -35, + "x": -32, + "y": -35, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -41, + "x": -24, + "y": -41, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -35, + "x": -32, + "y": -35, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": -20, + "x": -32, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_diag_4.png", - "x_offset": -24, - "y_offset": -41, + "x": -24, + "y": -41, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_diag_2.png", - "x_offset": -26, - "y_offset": -14, + "x": -26, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -27, + "x": -32, + "y": -27, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_left_bank_diag_4.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -27, + "x": -32, + "y": -27, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_diag_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_right_bank_diag_4.png", - "x_offset": -26, - "y_offset": -33, + "x": -26, + "y": -33, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_diag_1_1.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_diag_1_2.png", - "x_offset": -32, - "y_offset": -3, + "x": -32, + "y": -3, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_diag_2.png", - "x_offset": -26, - "y_offset": -25, + "x": -26, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_diag_3.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/rmc/gentle_up_left_bank_to_flat_diag_4.png", - "x_offset": -24, - "y_offset": -21, + "x": -24, + "y": -21, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_diag_1.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_diag_2.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_diag_3_1.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_diag_3_2.png", - "x_offset": -32, - "y_offset": -3, + "x": -32, + "y": -3, "palette": "keep" }, { "path": "track/rmc/gentle_up_right_bank_to_flat_diag_4.png", - "x_offset": -25, - "y_offset": -21, + "x": -25, + "y": -21, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -39, + "x": -34, + "y": -39, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_1_2.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_1_3.png", - "x_offset": 1, - "y_offset": 8, + "x": 1, + "y": 8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_1_4.png", - "x_offset": -28, - "y_offset": -25, + "x": -28, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_2_2.png", - "x_offset": -32, - "y_offset": -17, + "x": -32, + "y": -17, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_2_3.png", - "x_offset": -24, - "y_offset": 9, + "x": -24, + "y": 9, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -20, + "x": -32, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_3_1.png", - "x_offset": -11, - "y_offset": -24, + "x": -11, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": -22, + "x": 0, + "y": -22, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_3_3.png", - "x_offset": -31, - "y_offset": -4, + "x": -31, + "y": -4, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_3_4.png", - "x_offset": -24, - "y_offset": -35, + "x": -24, + "y": -35, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_4_1.png", - "x_offset": -32, - "y_offset": -31, + "x": -32, + "y": -31, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_4_2.png", - "x_offset": -31, - "y_offset": -20, + "x": -31, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": -37, + "x": 0, + "y": -37, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_diag_gentle_up_4_4.png", - "x_offset": 0, - "y_offset": -35, + "x": 0, + "y": -35, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_1_1.png", - "x_offset": -34, - "y_offset": -31, + "x": -34, + "y": -31, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_1_2.png", - "x_offset": -24, - "y_offset": -20, + "x": -24, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_1_3.png", - "x_offset": -16, - "y_offset": -37, + "x": -16, + "y": -37, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -35, + "x": -32, + "y": -35, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_2_1.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_2_2.png", - "x_offset": -34, - "y_offset": -22, + "x": -34, + "y": -22, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_2_3.png", - "x_offset": -2, - "y_offset": -4, + "x": -2, + "y": -4, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_2_4.png", - "x_offset": -15, - "y_offset": -35, + "x": -15, + "y": -35, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_3_1.png", - "x_offset": -13, - "y_offset": -12, + "x": -13, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_3_2.png", - "x_offset": -8, - "y_offset": -17, + "x": -8, + "y": -17, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 9, + "x": 0, + "y": 9, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": -20, + "x": 0, + "y": -20, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_4_1.png", - "x_offset": -30, - "y_offset": -39, + "x": -30, + "y": -39, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_4_2.png", - "x_offset": -20, - "y_offset": -24, + "x": -20, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_4_3.png", - "x_offset": -32, - "y_offset": 8, + "x": -32, + "y": 8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_diag_gentle_up_4_4.png", - "x_offset": -24, - "y_offset": -25, + "x": -24, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -14, + "x": 0, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": -14, + "x": 0, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_4.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_5.png", - "x_offset": -20, - "y_offset": -19, + "x": -20, + "y": -19, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_6.png", - "x_offset": -32, - "y_offset": -16, + "x": -32, + "y": -16, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_7.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_1_8.png", - "x_offset": -32, - "y_offset": -25, + "x": -32, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_2_1.png", - "x_offset": -24, - "y_offset": -9, + "x": -24, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_2_3.png", - "x_offset": -23, - "y_offset": -14, + "x": -23, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_2_4.png", - "x_offset": -27, - "y_offset": -11, + "x": -27, + "y": -11, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -27, + "x": -32, + "y": -27, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_3_3.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_3_4.png", - "x_offset": -34, - "y_offset": -24, + "x": -34, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_4_1.png", - "x_offset": -27, - "y_offset": -8, + "x": -27, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_4_3.png", - "x_offset": -31, - "y_offset": -12, + "x": -31, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_left_bank_to_orthogonal_gentle_up_4_4.png", - "x_offset": -34, - "y_offset": -40, + "x": -34, + "y": -40, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -27, + "x": 0, + "y": -27, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -23, + "x": -32, + "y": -23, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -24, + "x": -32, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_2_1.png", - "x_offset": 0, - "y_offset": -9, + "x": 0, + "y": -9, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_2_3.png", - "x_offset": -16, - "y_offset": -14, + "x": -16, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_2_4.png", - "x_offset": -34, - "y_offset": -11, + "x": -34, + "y": -11, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_1.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_2.png", - "x_offset": -32, - "y_offset": -14, + "x": -32, + "y": -14, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_5.png", - "x_offset": 0, - "y_offset": -19, + "x": 0, + "y": -19, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_6.png", - "x_offset": -16, - "y_offset": -16, + "x": -16, + "y": -16, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_7.png", - "x_offset": -9, - "y_offset": -24, + "x": -9, + "y": -24, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_3_8.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_4_1.png", - "x_offset": -24, - "y_offset": -8, + "x": -24, + "y": -8, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_4_3.png", - "x_offset": -22, - "y_offset": -12, + "x": -22, + "y": -12, "palette": "keep" }, { "path": "track/rmc/large_turn_right_bank_to_orthogonal_gentle_up_4_4.png", - "x_offset": -32, - "y_offset": -40, + "x": -32, + "y": -40, "palette": "keep" }, { "path": "track/rmc/flat_lift_1.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_lift_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_lift_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_lift_4.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_lift_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_lift_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_lift_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_lift_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_lift_1.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_lift_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_lift_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_up_to_flat_lift_4.png", - "x_offset": -34, - "y_offset": -20, + "x": -34, + "y": -20, "palette": "keep" }, { "path": "track/rmc/gentle_lift_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_lift_2.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_lift_3.png", - "x_offset": -34, - "y_offset": -12, + "x": -34, + "y": -12, "palette": "keep" }, { "path": "track/rmc/gentle_lift_4.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_lift_1.png", - "x_offset": -34, - "y_offset": -41, + "x": -34, + "y": -41, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_lift_2_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_lift_2_2.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_lift_3_1.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_lift_3_2.png", - "x_offset": -34, - "y_offset": -25, + "x": -34, + "y": -25, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_lift_4.png", - "x_offset": -34, - "y_offset": -41, + "x": -34, + "y": -41, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_lift_1.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_lift_2_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_lift_2_2.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_lift_3_1.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_lift_3_2.png", - "x_offset": -34, - "y_offset": -28, + "x": -34, + "y": -28, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_lift_4.png", - "x_offset": -34, - "y_offset": -44, + "x": -34, + "y": -44, "palette": "keep" }, { "path": "track/rmc/steep_lift_1.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/steep_lift_2.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/steep_lift_3.png", - "x_offset": -34, - "y_offset": -57, + "x": -34, + "y": -57, "palette": "keep" }, { "path": "track/rmc/steep_lift_4.png", - "x_offset": -34, - "y_offset": -73, + "x": -34, + "y": -73, "palette": "keep" }, { "path": "track/rmc/flat_diag_lift_1.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_diag_lift_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_diag_lift_3.png", - "x_offset": -34, - "y_offset": -8, + "x": -34, + "y": -8, "palette": "keep" }, { "path": "track/rmc/flat_diag_lift_4.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_lift_1.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_lift_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_lift_3.png", - "x_offset": -34, - "y_offset": -15, + "x": -34, + "y": -15, "palette": "keep" }, { "path": "track/rmc/flat_to_gentle_up_diag_lift_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_lift_1.png", - "x_offset": -53, - "y_offset": -16, + "x": -53, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_lift_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_lift_3.png", - "x_offset": -34, - "y_offset": -16, + "x": -34, + "y": -16, "palette": "keep" }, { "path": "track/rmc/gentle_to_flat_up_diag_lift_4.png", - "x_offset": -24, - "y_offset": -22, + "x": -24, + "y": -22, "palette": "keep" }, { "path": "track/rmc/gentle_diag_lift_1.png", - "x_offset": -54, - "y_offset": -23, + "x": -54, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_diag_lift_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_diag_lift_3.png", - "x_offset": -34, - "y_offset": -23, + "x": -34, + "y": -23, "palette": "keep" }, { "path": "track/rmc/gentle_diag_lift_4.png", - "x_offset": -24, - "y_offset": -30, + "x": -24, + "y": -30, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_lift_1.png", - "x_offset": -56, - "y_offset": -37, + "x": -56, + "y": -37, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_lift_2.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_lift_3.png", - "x_offset": -35, - "y_offset": -37, + "x": -35, + "y": -37, "palette": "keep" }, { "path": "track/rmc/gentle_to_steep_up_diag_lift_4.png", - "x_offset": -24, - "y_offset": -46, + "x": -24, + "y": -46, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_lift_1.png", - "x_offset": -49, - "y_offset": -39, + "x": -49, + "y": -39, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_lift_2.png", - "x_offset": -24, - "y_offset": -19, + "x": -24, + "y": -19, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_lift_3.png", - "x_offset": -34, - "y_offset": -39, + "x": -34, + "y": -39, "palette": "keep" }, { "path": "track/rmc/steep_to_gentle_up_diag_lift_4.png", - "x_offset": -24, - "y_offset": -46, + "x": -24, + "y": -46, "palette": "keep" }, { "path": "track/rmc/steep_diag_lift_1.png", - "x_offset": -48, - "y_offset": -69, + "x": -48, + "y": -69, "palette": "keep" }, { "path": "track/rmc/steep_diag_lift_2.png", - "x_offset": -24, - "y_offset": -46, + "x": -24, + "y": -46, "palette": "keep" }, { "path": "track/rmc/steep_diag_lift_3.png", - "x_offset": -35, - "y_offset": -69, + "x": -35, + "y": -69, "palette": "keep" }, { "path": "track/rmc/steep_diag_lift_4.png", - "x_offset": -24, - "y_offset": -78, + "x": -24, + "y": -78, "palette": "keep" }, { "path": "track/raptor/preview_track.png", - "x_offset": 9, - "y_offset": 3 + "x": 9, + "y": 3 }, { "path": "track/raptor/preview_support.png", - "x_offset": 24, - "y_offset": 13 + "x": 24, + "y": 13 }, { "path": "track/raptor/flat_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/brake_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/brake_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/block_brake_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/block_brake_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_1.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/flat_to_gentle_up_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_3.png", - "x_offset": -19, - "y_offset": 2 + "x": -19, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -6 + "x": -19, + "y": -6 }, { "path": "track/raptor/gentle_up_to_flat_1.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/gentle_up_to_flat_2.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_flat_3.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_flat_4.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/gentle_1.png", - "x_offset": -18, - "y_offset": -14 + "x": -18, + "y": -14 }, { "path": "track/raptor/gentle_2.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_3.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_4.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/gentle_to_steep_up_1.png", - "x_offset": -18, - "y_offset": -30 + "x": -18, + "y": -30 }, { "path": "track/raptor/gentle_to_steep_up_2_1.png", - "x_offset": -18, - "y_offset": 0 + "x": -18, + "y": 0 }, { "path": "track/raptor/gentle_to_steep_up_2_2.png", - "x_offset": -17, - "y_offset": -14 + "x": -17, + "y": -14 }, { "path": "track/raptor/gentle_to_steep_up_3_1.png", - "x_offset": 2, - "y_offset": 0 + "x": 2, + "y": 0 }, { "path": "track/raptor/gentle_to_steep_up_3_2.png", - "x_offset": -21, - "y_offset": -14 + "x": -21, + "y": -14 }, { "path": "track/raptor/gentle_to_steep_up_4.png", - "x_offset": -21, - "y_offset": -30 + "x": -21, + "y": -30 }, { "path": "track/raptor/steep_to_gentle_up_1.png", - "x_offset": -18, - "y_offset": -30 + "x": -18, + "y": -30 }, { "path": "track/raptor/steep_to_gentle_up_2_1.png", - "x_offset": -5, - "y_offset": -15 + "x": -5, + "y": -15 }, { "path": "track/raptor/steep_to_gentle_up_2_2.png", - "x_offset": -18, - "y_offset": -10 + "x": -18, + "y": -10 }, { "path": "track/raptor/steep_to_gentle_up_3_1.png", - "x_offset": -19, - "y_offset": -15 + "x": -19, + "y": -15 }, { "path": "track/raptor/steep_to_gentle_up_3_2.png", - "x_offset": -12, - "y_offset": -10 + "x": -12, + "y": -10 }, { "path": "track/raptor/steep_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -30 + "x": -19, + "y": -30 }, { "path": "track/raptor/steep_1.png", - "x_offset": -18, - "y_offset": -62 + "x": -18, + "y": -62 }, { "path": "track/raptor/steep_2.png", - "x_offset": -18, - "y_offset": -46 + "x": -18, + "y": -46 }, { "path": "track/raptor/steep_3.png", - "x_offset": -21, - "y_offset": -46 + "x": -21, + "y": -46 }, { "path": "track/raptor/steep_4.png", - "x_offset": -21, - "y_offset": -62 + "x": -21, + "y": -62 }, { "path": "track/raptor/steep_to_vertical_up_1.png", - "x_offset": -18, - "y_offset": -48 + "x": -18, + "y": -48 }, { "path": "track/raptor/steep_to_vertical_up_2.png", - "x_offset": -18, - "y_offset": -46 + "x": -18, + "y": -46 }, { "path": "track/raptor/steep_to_vertical_up_3.png", - "x_offset": -6, - "y_offset": -46 + "x": -6, + "y": -46 }, { "path": "track/raptor/steep_to_vertical_up_4.png", - "x_offset": -6, - "y_offset": -48 + "x": -6, + "y": -48 }, { "path": "track/raptor/vertical_to_steep_up_1.png", - "x_offset": -2, - "y_offset": -54 + "x": -2, + "y": -54 }, { "path": "track/raptor/vertical_to_steep_up_2.png", - "x_offset": -2, - "y_offset": -38 + "x": -2, + "y": -38 }, { "path": "track/raptor/vertical_to_steep_up_3.png", - "x_offset": -21, - "y_offset": -38 + "x": -21, + "y": -38 }, { "path": "track/raptor/vertical_to_steep_up_4.png", - "x_offset": -21, - "y_offset": -54 + "x": -21, + "y": -54 }, { "path": "track/raptor/vertical_1.png", - "x_offset": -2, - "y_offset": -24 + "x": -2, + "y": -24 }, { "path": "track/raptor/vertical_2.png", - "x_offset": -2, - "y_offset": -22 + "x": -2, + "y": -22 }, { "path": "track/raptor/vertical_3.png", - "x_offset": -6, - "y_offset": -22 + "x": -6, + "y": -22 }, { "path": "track/raptor/vertical_4.png", - "x_offset": -6, - "y_offset": -24 + "x": -6, + "y": -24 }, { "path": "track/raptor/small_turn_left_1_1.png", - "x_offset": -18, - "y_offset": -1 + "x": -18, + "y": -1 }, { "path": "track/raptor/small_turn_left_1_2.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/small_turn_left_1_3.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/small_turn_left_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/small_turn_left_2_2.png", - "x_offset": -4, - "y_offset": 0 + "x": -4, + "y": 0 }, { "path": "track/raptor/small_turn_left_2_3.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/small_turn_left_3_1.png", - "x_offset": -4, - "y_offset": 2 + "x": -4, + "y": 2 }, { "path": "track/raptor/small_turn_left_3_2.png", - "x_offset": 25, - "y_offset": 1 + "x": 25, + "y": 1 }, { "path": "track/raptor/small_turn_left_3_3.png", - "x_offset": -7, - "y_offset": -1 + "x": -7, + "y": -1 }, { "path": "track/raptor/small_turn_left_4_1.png", - "x_offset": -28, - "y_offset": 7 + "x": -28, + "y": 7 }, { "path": "track/raptor/small_turn_left_4_2.png", - "x_offset": -8, - "y_offset": 23 + "x": -8, + "y": 23 }, { "path": "track/raptor/small_turn_left_4_3.png", - "x_offset": -18, - "y_offset": 7 + "x": -18, + "y": 7 }, { "path": "track/raptor/medium_turn_left_1_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/medium_turn_left_1_2.png", - "x_offset": -28, - "y_offset": 6 + "x": -28, + "y": 6 }, { "path": "track/raptor/medium_turn_left_1_3.png", - "x_offset": 9, - "y_offset": 6 + "x": 9, + "y": 6 }, { "path": "track/raptor/medium_turn_left_1_4.png", - "x_offset": -24, - "y_offset": 9 + "x": -24, + "y": 9 }, { "path": "track/raptor/medium_turn_left_1_5.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/medium_turn_left_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/medium_turn_left_2_2.png", - "x_offset": -10, - "y_offset": 0 + "x": -10, + "y": 0 }, { "path": "track/raptor/medium_turn_left_2_3.png", - "x_offset": -32, - "y_offset": 15 + "x": -32, + "y": 15 }, { "path": "track/raptor/medium_turn_left_2_4.png", - "x_offset": -16, - "y_offset": 0 + "x": -16, + "y": 0 }, { "path": "track/raptor/medium_turn_left_2_5.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/medium_turn_left_3_1.png", - "x_offset": -14, - "y_offset": 2 + "x": -14, + "y": 2 }, { "path": "track/raptor/medium_turn_left_3_2.png", - "x_offset": 12, - "y_offset": 9 + "x": 12, + "y": 9 }, { "path": "track/raptor/medium_turn_left_3_3.png", - "x_offset": -20, - "y_offset": 6 + "x": -20, + "y": 6 }, { "path": "track/raptor/medium_turn_left_3_4.png", - "x_offset": 13, - "y_offset": 6 + "x": 13, + "y": 6 }, { "path": "track/raptor/medium_turn_left_3_5.png", - "x_offset": -11, - "y_offset": 2 + "x": -11, + "y": 2 }, { "path": "track/raptor/medium_turn_left_4_1.png", - "x_offset": -23, - "y_offset": 6 + "x": -23, + "y": 6 }, { "path": "track/raptor/medium_turn_left_4_2.png", - "x_offset": -30, - "y_offset": 16 + "x": -30, + "y": 16 }, { "path": "track/raptor/medium_turn_left_4_3.png", - "x_offset": -16, - "y_offset": 0 + "x": -16, + "y": 0 }, { "path": "track/raptor/medium_turn_left_4_4.png", - "x_offset": -18, - "y_offset": 16 + "x": -18, + "y": 16 }, { "path": "track/raptor/medium_turn_left_4_5.png", - "x_offset": -18, - "y_offset": 6 + "x": -18, + "y": 6 }, { "path": "track/raptor/large_turn_left_to_diag_1_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/large_turn_left_to_diag_1_2.png", - "x_offset": -26, - "y_offset": 1 + "x": -26, + "y": 1 }, { "path": "track/raptor/large_turn_left_to_diag_1_3.png", - "x_offset": 17, - "y_offset": 12 + "x": 17, + "y": 12 }, { "path": "track/raptor/large_turn_left_to_diag_1_4.png", - "x_offset": -8, - "y_offset": 10 + "x": -8, + "y": 10 }, { "path": "track/raptor/large_turn_left_to_diag_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/large_turn_left_to_diag_2_2.png", - "x_offset": -12, - "y_offset": 1 + "x": -12, + "y": 1 }, { "path": "track/raptor/large_turn_left_to_diag_2_3.png", - "x_offset": -24, - "y_offset": 19 + "x": -24, + "y": 19 }, { "path": "track/raptor/large_turn_left_to_diag_2_4.png", - "x_offset": -30, - "y_offset": 8 + "x": -30, + "y": 8 }, { "path": "track/raptor/large_turn_left_to_diag_3_1.png", - "x_offset": -16, - "y_offset": 2 + "x": -16, + "y": 2 }, { "path": "track/raptor/large_turn_left_to_diag_3_2.png", - "x_offset": -1, - "y_offset": 7 + "x": -1, + "y": 7 }, { "path": "track/raptor/large_turn_left_to_diag_3_3.png", - "x_offset": -32, - "y_offset": 11 + "x": -32, + "y": 11 }, { "path": "track/raptor/large_turn_left_to_diag_3_4.png", - "x_offset": -3, - "y_offset": -1 + "x": -3, + "y": -1 }, { "path": "track/raptor/large_turn_left_to_diag_4_1.png", - "x_offset": -21, - "y_offset": 6 + "x": -21, + "y": 6 }, { "path": "track/raptor/large_turn_left_to_diag_4_2.png", - "x_offset": -32, - "y_offset": 11 + "x": -32, + "y": 11 }, { "path": "track/raptor/large_turn_left_to_diag_4_3.png", - "x_offset": -4, - "y_offset": 0 + "x": -4, + "y": 0 }, { "path": "track/raptor/large_turn_left_to_diag_4_4.png", - "x_offset": 0, - "y_offset": 9 + "x": 0, + "y": 9 }, { "path": "track/raptor/large_turn_right_to_diag_1_1.png", - "x_offset": -18, - "y_offset": 6 + "x": -18, + "y": 6 }, { "path": "track/raptor/large_turn_right_to_diag_1_2.png", - "x_offset": -20, - "y_offset": 11 + "x": -20, + "y": 11 }, { "path": "track/raptor/large_turn_right_to_diag_1_3.png", - "x_offset": -6, - "y_offset": 0 + "x": -6, + "y": 0 }, { "path": "track/raptor/large_turn_right_to_diag_1_4.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/large_turn_right_to_diag_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/large_turn_right_to_diag_2_2.png", - "x_offset": -22, - "y_offset": 7 + "x": -22, + "y": 7 }, { "path": "track/raptor/large_turn_right_to_diag_2_3.png", - "x_offset": 23, - "y_offset": 11 + "x": 23, + "y": 11 }, { "path": "track/raptor/large_turn_right_to_diag_2_4.png", - "x_offset": -5, - "y_offset": -1 + "x": -5, + "y": -1 }, { "path": "track/raptor/large_turn_right_to_diag_3_1.png", - "x_offset": -29, - "y_offset": 2 + "x": -29, + "y": 2 }, { "path": "track/raptor/large_turn_right_to_diag_3_2.png", - "x_offset": -28, - "y_offset": 1 + "x": -28, + "y": 1 }, { "path": "track/raptor/large_turn_right_to_diag_3_3.png", - "x_offset": -14, - "y_offset": 19 + "x": -14, + "y": 19 }, { "path": "track/raptor/large_turn_right_to_diag_3_4.png", - "x_offset": 0, - "y_offset": 8 + "x": 0, + "y": 8 }, { "path": "track/raptor/large_turn_right_to_diag_4_1.png", - "x_offset": -12, - "y_offset": 2 + "x": -12, + "y": 2 }, { "path": "track/raptor/large_turn_right_to_diag_4_2.png", - "x_offset": 2, - "y_offset": 1 + "x": 2, + "y": 1 }, { "path": "track/raptor/large_turn_right_to_diag_4_3.png", - "x_offset": -31, - "y_offset": 12 + "x": -31, + "y": 12 }, { "path": "track/raptor/large_turn_right_to_diag_4_4.png", - "x_offset": -3, - "y_offset": 10 + "x": -3, + "y": 10 }, { "path": "track/raptor/flat_diag_1.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/flat_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/brake_diag_1.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/raptor/brake_diag_2.png", - "x_offset": -3, - "y_offset": -6, + "x": -3, + "y": -6, "palette": "keep" }, { "path": "track/raptor/block_brake_diag_1.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/raptor/block_brake_diag_2.png", - "x_offset": -3, - "y_offset": -6, + "x": -3, + "y": -6, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/flat_to_gentle_up_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/flat_to_gentle_up_diag_3.png", - "x_offset": -33, - "y_offset": 1 + "x": -33, + "y": 1 }, { "path": "track/raptor/flat_to_gentle_up_diag_4.png", - "x_offset": -3, - "y_offset": -14 + "x": -3, + "y": -14 }, { "path": "track/raptor/gentle_to_flat_up_diag_1.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/gentle_to_flat_up_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_to_flat_up_diag_3.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/gentle_to_flat_up_diag_4.png", - "x_offset": -3, - "y_offset": -14 + "x": -3, + "y": -14 }, { "path": "track/raptor/gentle_diag_1.png", - "x_offset": -32, - "y_offset": -7 + "x": -32, + "y": -7 }, { "path": "track/raptor/gentle_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_diag_3.png", - "x_offset": -32, - "y_offset": -7 + "x": -32, + "y": -7 }, { "path": "track/raptor/gentle_diag_4.png", - "x_offset": -3, - "y_offset": -22 + "x": -3, + "y": -22 }, { "path": "track/raptor/gentle_to_steep_up_diag_1.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/gentle_to_steep_up_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_to_steep_up_diag_3.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/gentle_to_steep_up_diag_4.png", - "x_offset": -3, - "y_offset": -38 + "x": -3, + "y": -38 }, { "path": "track/raptor/steep_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/steep_to_gentle_up_diag_2.png", - "x_offset": -3, - "y_offset": -11 + "x": -3, + "y": -11 }, { "path": "track/raptor/steep_to_gentle_up_diag_3.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/steep_to_gentle_up_diag_4.png", - "x_offset": -3, - "y_offset": -38 + "x": -3, + "y": -38 }, { "path": "track/raptor/steep_diag_1.png", - "x_offset": -32, - "y_offset": -55 + "x": -32, + "y": -55 }, { "path": "track/raptor/steep_diag_2.png", - "x_offset": -3, - "y_offset": -38 + "x": -3, + "y": -38 }, { "path": "track/raptor/steep_diag_3.png", - "x_offset": -32, - "y_offset": -55 + "x": -32, + "y": -55 }, { "path": "track/raptor/steep_diag_4.png", - "x_offset": -3, - "y_offset": -70 + "x": -3, + "y": -70 }, { "path": "track/raptor/flat_to_left_bank_1_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_left_bank_1_2.png", - "x_offset": 1, - "y_offset": 2 + "x": 1, + "y": 2 }, { "path": "track/raptor/flat_to_left_bank_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_left_bank_2_2.png", - "x_offset": -17, - "y_offset": 8 + "x": -17, + "y": 8 }, { "path": "track/raptor/flat_to_left_bank_3.png", - "x_offset": -19, - "y_offset": 2 + "x": -19, + "y": 2 }, { "path": "track/raptor/flat_to_left_bank_4.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/flat_to_right_bank_1.png", - "x_offset": -18, - "y_offset": 0 + "x": -18, + "y": 0 }, { "path": "track/raptor/flat_to_right_bank_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_right_bank_3_1.png", - "x_offset": -13, - "y_offset": 2 + "x": -13, + "y": 2 }, { "path": "track/raptor/flat_to_right_bank_3_2.png", - "x_offset": -17, - "y_offset": 8 + "x": -17, + "y": 8 }, { "path": "track/raptor/flat_to_right_bank_4_1.png", - "x_offset": -16, - "y_offset": 2 + "x": -16, + "y": 2 }, { "path": "track/raptor/flat_to_right_bank_4_2.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/left_bank_to_gentle_up_1_1.png", - "x_offset": -13, - "y_offset": -6 + "x": -13, + "y": -6 }, { "path": "track/raptor/left_bank_to_gentle_up_1_2.png", - "x_offset": -17, - "y_offset": 7 + "x": -17, + "y": 7 }, { "path": "track/raptor/left_bank_to_gentle_up_2_1.png", - "x_offset": -16, - "y_offset": 2 + "x": -16, + "y": 2 }, { "path": "track/raptor/left_bank_to_gentle_up_2_2.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/left_bank_to_gentle_up_3.png", - "x_offset": -19, - "y_offset": 0 + "x": -19, + "y": 0 }, { "path": "track/raptor/left_bank_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -6 + "x": -19, + "y": -6 }, { "path": "track/raptor/right_bank_to_gentle_up_1.png", - "x_offset": -19, - "y_offset": -6 + "x": -19, + "y": -6 }, { "path": "track/raptor/right_bank_to_gentle_up_2.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/right_bank_to_gentle_up_3_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/right_bank_to_gentle_up_3_2.png", - "x_offset": -5, - "y_offset": 2 + "x": -5, + "y": 2 }, { "path": "track/raptor/right_bank_to_gentle_up_4_1.png", - "x_offset": -19, - "y_offset": -6 + "x": -19, + "y": -6 }, { "path": "track/raptor/right_bank_to_gentle_up_4_2.png", - "x_offset": -10, - "y_offset": 7 + "x": -10, + "y": 7 }, { "path": "track/raptor/gentle_up_to_left_bank_1_1.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/gentle_up_to_left_bank_1_2.png", - "x_offset": 3, - "y_offset": -6 + "x": 3, + "y": -6 }, { "path": "track/raptor/gentle_up_to_left_bank_2_1.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_left_bank_2_2.png", - "x_offset": -16, - "y_offset": 4 + "x": -16, + "y": 4 }, { "path": "track/raptor/gentle_up_to_left_bank_3.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_up_to_left_bank_4.png", - "x_offset": -17, - "y_offset": -8 + "x": -17, + "y": -8 }, { "path": "track/raptor/gentle_up_to_right_bank_1.png", - "x_offset": -18, - "y_offset": -8 + "x": -18, + "y": -8 }, { "path": "track/raptor/gentle_up_to_right_bank_2.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_right_bank_3_1.png", - "x_offset": -13, - "y_offset": 1 + "x": -13, + "y": 1 }, { "path": "track/raptor/gentle_up_to_right_bank_3_2.png", - "x_offset": -17, - "y_offset": 4 + "x": -17, + "y": 4 }, { "path": "track/raptor/gentle_up_to_right_bank_4_1.png", - "x_offset": -17, - "y_offset": -6 + "x": -17, + "y": -6 }, { "path": "track/raptor/gentle_up_to_right_bank_4_2.png", - "x_offset": -20, - "y_offset": -6 + "x": -20, + "y": -6 }, { "path": "track/raptor/left_bank_1.png", - "x_offset": -17, - "y_offset": 2 + "x": -17, + "y": 2 }, { "path": "track/raptor/left_bank_2.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/left_bank_3.png", - "x_offset": -19, - "y_offset": 0 + "x": -19, + "y": 0 }, { "path": "track/raptor/left_bank_4.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/flat_to_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/flat_to_left_bank_diag_1_2.png", - "x_offset": -30, - "y_offset": 9 + "x": -30, + "y": 9 }, { "path": "track/raptor/flat_to_left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -6 + "x": -5, + "y": -6 }, { "path": "track/raptor/flat_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 8 + "x": -32, + "y": 8 }, { "path": "track/raptor/flat_to_left_bank_diag_4.png", - "x_offset": -3, - "y_offset": -7 + "x": -3, + "y": -7 }, { "path": "track/raptor/flat_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 8 + "x": -32, + "y": 8 }, { "path": "track/raptor/flat_to_right_bank_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/flat_to_right_bank_diag_3_1.png", - "x_offset": -31, - "y_offset": 9 + "x": -31, + "y": 9 }, { "path": "track/raptor/flat_to_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/flat_to_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -7 + "x": -6, + "y": -7 }, { "path": "track/raptor/left_bank_to_gentle_up_diag_1_1.png", - "x_offset": -31, - "y_offset": 1 + "x": -31, + "y": 1 }, { "path": "track/raptor/left_bank_to_gentle_up_diag_1_2.png", - "x_offset": -32, - "y_offset": 8 + "x": -32, + "y": 8 }, { "path": "track/raptor/left_bank_to_gentle_up_diag_2.png", - "x_offset": -6, - "y_offset": -7 + "x": -6, + "y": -7 }, { "path": "track/raptor/left_bank_to_gentle_up_diag_3.png", - "x_offset": -33, - "y_offset": 1 + "x": -33, + "y": 1 }, { "path": "track/raptor/left_bank_to_gentle_up_diag_4.png", - "x_offset": -3, - "y_offset": -14 + "x": -3, + "y": -14 }, { "path": "track/raptor/right_bank_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/right_bank_to_gentle_up_diag_2.png", - "x_offset": -3, - "y_offset": -7 + "x": -3, + "y": -7 }, { "path": "track/raptor/right_bank_to_gentle_up_diag_3_1.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/right_bank_to_gentle_up_diag_3_2.png", - "x_offset": -31, - "y_offset": 8 + "x": -31, + "y": 8 }, { "path": "track/raptor/right_bank_to_gentle_up_diag_4.png", - "x_offset": -5, - "y_offset": -14 + "x": -5, + "y": -14 }, { "path": "track/raptor/gentle_up_to_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": 3 + "x": -32, + "y": 3 }, { "path": "track/raptor/gentle_up_to_left_bank_diag_1_2.png", - "x_offset": -31, - "y_offset": 1 + "x": -31, + "y": 1 }, { "path": "track/raptor/gentle_up_to_left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -6 + "x": -5, + "y": -6 }, { "path": "track/raptor/gentle_up_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 0 + "x": -32, + "y": 0 }, { "path": "track/raptor/gentle_up_to_left_bank_diag_4.png", - "x_offset": -3, - "y_offset": -15 + "x": -3, + "y": -15 }, { "path": "track/raptor/gentle_up_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 0 + "x": -32, + "y": 0 }, { "path": "track/raptor/gentle_up_to_right_bank_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_up_to_right_bank_diag_3_1.png", - "x_offset": -31, - "y_offset": 1 + "x": -31, + "y": 1 }, { "path": "track/raptor/gentle_up_to_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/gentle_up_to_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -15 + "x": -6, + "y": -15 }, { "path": "track/raptor/left_bank_diag_1.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/left_bank_diag_2.png", - "x_offset": -6, - "y_offset": -7 + "x": -6, + "y": -7 }, { "path": "track/raptor/left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 8 + "x": -32, + "y": 8 }, { "path": "track/raptor/left_bank_diag_4.png", - "x_offset": -2, - "y_offset": -7 + "x": -2, + "y": -7 }, { "path": "track/raptor/small_turn_left_bank_1_1.png", - "x_offset": -5, - "y_offset": -1 + "x": -5, + "y": -1 }, { "path": "track/raptor/small_turn_left_bank_1_2.png", - "x_offset": -17, - "y_offset": -1 + "x": -17, + "y": -1 }, { "path": "track/raptor/small_turn_left_bank_1_3.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/small_turn_left_bank_1_4.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/small_turn_left_bank_2_1.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/small_turn_left_bank_2_2.png", - "x_offset": -4, - "y_offset": 0 + "x": -4, + "y": 0 }, { "path": "track/raptor/small_turn_left_bank_2_3.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/small_turn_left_bank_3_1.png", - "x_offset": -6, - "y_offset": 0 + "x": -6, + "y": 0 }, { "path": "track/raptor/small_turn_left_bank_3_2.png", - "x_offset": 23, - "y_offset": 1 + "x": 23, + "y": 1 }, { "path": "track/raptor/small_turn_left_bank_3_3.png", - "x_offset": -8, - "y_offset": -1 + "x": -8, + "y": -1 }, { "path": "track/raptor/small_turn_left_bank_3_4.png", - "x_offset": -9, - "y_offset": -1 + "x": -9, + "y": -1 }, { "path": "track/raptor/small_turn_left_bank_4_1.png", - "x_offset": -26, - "y_offset": 6 + "x": -26, + "y": 6 }, { "path": "track/raptor/small_turn_left_bank_4_2.png", - "x_offset": -8, - "y_offset": 22 + "x": -8, + "y": 22 }, { "path": "track/raptor/small_turn_left_bank_4_3.png", - "x_offset": -19, - "y_offset": 6 + "x": -19, + "y": 6 }, { "path": "track/raptor/medium_turn_left_bank_1_1.png", - "x_offset": 3, - "y_offset": 3 + "x": 3, + "y": 3 }, { "path": "track/raptor/medium_turn_left_bank_1_2.png", - "x_offset": -17, - "y_offset": 3 + "x": -17, + "y": 3 }, { "path": "track/raptor/medium_turn_left_bank_1_3.png", - "x_offset": -26, - "y_offset": 5 + "x": -26, + "y": 5 }, { "path": "track/raptor/medium_turn_left_bank_1_4.png", - "x_offset": 12, - "y_offset": 7 + "x": 12, + "y": 7 }, { "path": "track/raptor/medium_turn_left_bank_1_5.png", - "x_offset": -22, - "y_offset": 8 + "x": -22, + "y": 8 }, { "path": "track/raptor/medium_turn_left_bank_1_6.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_2_1.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/medium_turn_left_bank_2_2.png", - "x_offset": -10, - "y_offset": 0 + "x": -10, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_2_3.png", - "x_offset": -30, - "y_offset": 16 + "x": -30, + "y": 16 }, { "path": "track/raptor/medium_turn_left_bank_2_4.png", - "x_offset": -16, - "y_offset": 0 + "x": -16, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_2_5.png", - "x_offset": -30, - "y_offset": 2 + "x": -30, + "y": 2 }, { "path": "track/raptor/medium_turn_left_bank_3_1.png", - "x_offset": -15, - "y_offset": 0 + "x": -15, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_3_2.png", - "x_offset": 9, - "y_offset": 8 + "x": 9, + "y": 8 }, { "path": "track/raptor/medium_turn_left_bank_3_3.png", - "x_offset": -23, - "y_offset": 7 + "x": -23, + "y": 7 }, { "path": "track/raptor/medium_turn_left_bank_3_4.png", - "x_offset": 11, - "y_offset": 5 + "x": 11, + "y": 5 }, { "path": "track/raptor/medium_turn_left_bank_3_5.png", - "x_offset": -6, - "y_offset": 3 + "x": -6, + "y": 3 }, { "path": "track/raptor/medium_turn_left_bank_3_6.png", - "x_offset": -11, - "y_offset": 3 + "x": -11, + "y": 3 }, { "path": "track/raptor/medium_turn_left_bank_4_1.png", - "x_offset": -20, - "y_offset": 5 + "x": -20, + "y": 5 }, { "path": "track/raptor/medium_turn_left_bank_4_2.png", - "x_offset": -32, - "y_offset": 15 + "x": -32, + "y": 15 }, { "path": "track/raptor/medium_turn_left_bank_4_3.png", - "x_offset": -12, - "y_offset": 0 + "x": -12, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_4_4.png", - "x_offset": -20, - "y_offset": 15 + "x": -20, + "y": 15 }, { "path": "track/raptor/medium_turn_left_bank_4_5.png", - "x_offset": -19, - "y_offset": 5 + "x": -19, + "y": 5 }, { "path": "track/raptor/large_turn_left_to_diag_bank_1_1.png", - "x_offset": -17, - "y_offset": 3 + "x": -17, + "y": 3 }, { "path": "track/raptor/large_turn_left_to_diag_bank_1_2.png", - "x_offset": -24, - "y_offset": 0 + "x": -24, + "y": 0 }, { "path": "track/raptor/large_turn_left_to_diag_bank_1_3.png", - "x_offset": 21, - "y_offset": 13 + "x": 21, + "y": 13 }, { "path": "track/raptor/large_turn_left_to_diag_bank_1_4.png", - "x_offset": -11, - "y_offset": 9 + "x": -11, + "y": 9 }, { "path": "track/raptor/large_turn_left_to_diag_bank_2_1.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/large_turn_left_to_diag_bank_2_2.png", - "x_offset": -32, - "y_offset": -7 + "x": -32, + "y": -7 }, { "path": "track/raptor/large_turn_left_to_diag_bank_2_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/large_turn_left_to_diag_bank_2_4.png", - "x_offset": -32, - "y_offset": 8 + "x": -32, + "y": 8 }, { "path": "track/raptor/large_turn_left_to_diag_bank_3_1.png", - "x_offset": -18, - "y_offset": 0 + "x": -18, + "y": 0 }, { "path": "track/raptor/large_turn_left_to_diag_bank_3_2.png", - "x_offset": -2, - "y_offset": 7 + "x": -2, + "y": 7 }, { "path": "track/raptor/large_turn_left_to_diag_bank_3_3.png", - "x_offset": -32, - "y_offset": 13 + "x": -32, + "y": 13 }, { "path": "track/raptor/large_turn_left_to_diag_bank_3_4.png", - "x_offset": -5, - "y_offset": -2 + "x": -5, + "y": -2 }, { "path": "track/raptor/large_turn_left_to_diag_bank_4_1.png", - "x_offset": -18, - "y_offset": 5 + "x": -18, + "y": 5 }, { "path": "track/raptor/large_turn_left_to_diag_bank_4_2.png", - "x_offset": -32, - "y_offset": 10 + "x": -32, + "y": 10 }, { "path": "track/raptor/large_turn_left_to_diag_bank_4_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/large_turn_left_to_diag_bank_4_4.png", - "x_offset": 0, - "y_offset": 8 + "x": 0, + "y": 8 }, { "path": "track/raptor/large_turn_right_to_diag_bank_1_1.png", - "x_offset": -19, - "y_offset": 5 + "x": -19, + "y": 5 }, { "path": "track/raptor/large_turn_right_to_diag_bank_1_2.png", - "x_offset": -20, - "y_offset": 10 + "x": -20, + "y": 10 }, { "path": "track/raptor/large_turn_right_to_diag_bank_1_3.png", - "x_offset": -2, - "y_offset": 0 + "x": -2, + "y": 0 }, { "path": "track/raptor/large_turn_right_to_diag_bank_1_4.png", - "x_offset": -32, - "y_offset": 8 + "x": -32, + "y": 8 }, { "path": "track/raptor/large_turn_right_to_diag_bank_2_1.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/large_turn_right_to_diag_bank_2_2.png", - "x_offset": -20, - "y_offset": 7 + "x": -20, + "y": 7 }, { "path": "track/raptor/large_turn_right_to_diag_bank_2_3.png", - "x_offset": 26, - "y_offset": 13 + "x": 26, + "y": 13 }, { "path": "track/raptor/large_turn_right_to_diag_bank_2_4.png", - "x_offset": -4, - "y_offset": -2 + "x": -4, + "y": -2 }, { "path": "track/raptor/large_turn_right_to_diag_bank_3_1.png", - "x_offset": -28, - "y_offset": 2 + "x": -28, + "y": 2 }, { "path": "track/raptor/large_turn_right_to_diag_bank_3_2.png", - "x_offset": -32, - "y_offset": -7 + "x": -32, + "y": -7 }, { "path": "track/raptor/large_turn_right_to_diag_bank_3_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/large_turn_right_to_diag_bank_3_4.png", - "x_offset": 0, - "y_offset": 8 + "x": 0, + "y": 8 }, { "path": "track/raptor/large_turn_right_to_diag_bank_4_1.png", - "x_offset": -27, - "y_offset": -10 + "x": -27, + "y": -10 }, { "path": "track/raptor/large_turn_right_to_diag_bank_4_2.png", - "x_offset": 1, - "y_offset": 0 + "x": 1, + "y": 0 }, { "path": "track/raptor/large_turn_right_to_diag_bank_4_3.png", - "x_offset": -32, - "y_offset": 13 + "x": -32, + "y": 13 }, { "path": "track/raptor/large_turn_right_to_diag_bank_4_4.png", - "x_offset": -6, - "y_offset": 9 + "x": -6, + "y": 9 }, { "path": "track/raptor/small_turn_left_gentle_up_1_1.png", - "x_offset": -24, - "y_offset": -32 + "x": -24, + "y": -32 }, { "path": "track/raptor/small_turn_left_gentle_up_1_2.png", - "x_offset": -13, - "y_offset": -17 + "x": -13, + "y": -17 }, { "path": "track/raptor/small_turn_left_gentle_up_2_1.png", - "x_offset": -12, - "y_offset": -8 + "x": -12, + "y": -8 }, { "path": "track/raptor/small_turn_left_gentle_up_2_2.png", - "x_offset": -38, - "y_offset": -17 + "x": -38, + "y": -17 }, { "path": "track/raptor/small_turn_left_gentle_up_3_1.png", - "x_offset": -13, - "y_offset": -2 + "x": -13, + "y": -2 }, { "path": "track/raptor/small_turn_left_gentle_up_3_2.png", - "x_offset": -1, - "y_offset": -7 + "x": -1, + "y": -7 }, { "path": "track/raptor/small_turn_left_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -12 + "x": -26, + "y": -12 }, { "path": "track/raptor/small_turn_left_gentle_up_4_2.png", - "x_offset": -25, - "y_offset": -2 + "x": -25, + "y": -2 }, { "path": "track/raptor/small_turn_right_gentle_up_1_1.png", - "x_offset": -24, - "y_offset": -12 + "x": -24, + "y": -12 }, { "path": "track/raptor/small_turn_right_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": -2 + "x": -26, + "y": -2 }, { "path": "track/raptor/small_turn_right_gentle_up_2_1.png", - "x_offset": -12, - "y_offset": -2 + "x": -12, + "y": -2 }, { "path": "track/raptor/small_turn_right_gentle_up_2_2.png", - "x_offset": -25, - "y_offset": -7 + "x": -25, + "y": -7 }, { "path": "track/raptor/small_turn_right_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": -8 + "x": -38, + "y": -8 }, { "path": "track/raptor/small_turn_right_gentle_up_3_2.png", - "x_offset": -13, - "y_offset": -17 + "x": -13, + "y": -17 }, { "path": "track/raptor/small_turn_right_gentle_up_4_1.png", - "x_offset": -1, - "y_offset": -25 + "x": -1, + "y": -25 }, { "path": "track/raptor/small_turn_right_gentle_up_4_2.png", - "x_offset": -13, - "y_offset": -17 + "x": -13, + "y": -17 }, { "path": "track/raptor/medium_turn_left_gentle_up_1_1.png", - "x_offset": -18, - "y_offset": -15 + "x": -18, + "y": -15 }, { "path": "track/raptor/medium_turn_left_gentle_up_1_2.png", - "x_offset": -27, - "y_offset": -11 + "x": -27, + "y": -11 }, { "path": "track/raptor/medium_turn_left_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_left_gentle_up_1_4.png", - "x_offset": -27, - "y_offset": -8 + "x": -27, + "y": -8 }, { "path": "track/raptor/medium_turn_left_gentle_up_1_5.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/medium_turn_left_gentle_up_2_1.png", - "x_offset": -18, - "y_offset": -5 + "x": -18, + "y": -5 }, { "path": "track/raptor/medium_turn_left_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": -14 + "x": 0, + "y": -14 }, { "path": "track/raptor/medium_turn_left_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": 1 + "x": 0, + "y": 1 }, { "path": "track/raptor/medium_turn_left_gentle_up_2_4.png", - "x_offset": -12, - "y_offset": -21 + "x": -12, + "y": -21 }, { "path": "track/raptor/medium_turn_left_gentle_up_2_5.png", - "x_offset": -17, - "y_offset": -14 + "x": -17, + "y": -14 }, { "path": "track/raptor/medium_turn_left_gentle_up_3_1.png", - "x_offset": -20, - "y_offset": 1 + "x": -20, + "y": 1 }, { "path": "track/raptor/medium_turn_left_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_left_gentle_up_3_3.png", - "x_offset": -20, - "y_offset": 6 + "x": -20, + "y": 6 }, { "path": "track/raptor/medium_turn_left_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_left_gentle_up_3_5.png", - "x_offset": -16, - "y_offset": 0 + "x": -16, + "y": 0 }, { "path": "track/raptor/medium_turn_left_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -12 + "x": -26, + "y": -12 }, { "path": "track/raptor/medium_turn_left_gentle_up_4_2.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/medium_turn_left_gentle_up_4_3.png", - "x_offset": -18, - "y_offset": -13 + "x": -18, + "y": -13 }, { "path": "track/raptor/medium_turn_left_gentle_up_4_4.png", - "x_offset": -16, - "y_offset": 4 + "x": -16, + "y": 4 }, { "path": "track/raptor/medium_turn_left_gentle_up_4_5.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/medium_turn_right_gentle_up_1_1.png", - "x_offset": -18, - "y_offset": -12 + "x": -18, + "y": -12 }, { "path": "track/raptor/medium_turn_right_gentle_up_1_2.png", - "x_offset": -10, - "y_offset": 1 + "x": -10, + "y": 1 }, { "path": "track/raptor/medium_turn_right_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": -13 + "x": 0, + "y": -13 }, { "path": "track/raptor/medium_turn_right_gentle_up_1_4.png", - "x_offset": -16, - "y_offset": 4 + "x": -16, + "y": 4 }, { "path": "track/raptor/medium_turn_right_gentle_up_1_5.png", - "x_offset": -21, - "y_offset": 1 + "x": -21, + "y": 1 }, { "path": "track/raptor/medium_turn_right_gentle_up_2_1.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/medium_turn_right_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_right_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": 6 + "x": 0, + "y": 6 }, { "path": "track/raptor/medium_turn_right_gentle_up_2_4.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_right_gentle_up_2_5.png", - "x_offset": -19, - "y_offset": 0 + "x": -19, + "y": 0 }, { "path": "track/raptor/medium_turn_right_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -5 + "x": -32, + "y": -5 }, { "path": "track/raptor/medium_turn_right_gentle_up_3_2.png", - "x_offset": -32, - "y_offset": -14 + "x": -32, + "y": -14 }, { "path": "track/raptor/medium_turn_right_gentle_up_3_3.png", - "x_offset": -26, - "y_offset": -1 + "x": -26, + "y": -1 }, { "path": "track/raptor/medium_turn_right_gentle_up_3_4.png", - "x_offset": -22, - "y_offset": -24 + "x": -22, + "y": -24 }, { "path": "track/raptor/medium_turn_right_gentle_up_3_5.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/medium_turn_right_gentle_up_4_1.png", - "x_offset": -12, - "y_offset": -13 + "x": -12, + "y": -13 }, { "path": "track/raptor/medium_turn_right_gentle_up_4_2.png", - "x_offset": 12, - "y_offset": -11 + "x": 12, + "y": -11 }, { "path": "track/raptor/medium_turn_right_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_right_gentle_up_4_4.png", - "x_offset": 12, - "y_offset": -7 + "x": 12, + "y": -7 }, { "path": "track/raptor/medium_turn_right_gentle_up_4_5.png", - "x_offset": -13, - "y_offset": -14 + "x": -13, + "y": -14 }, { "path": "track/raptor/very_small_turn_left_steep_up_1_1.png", - "x_offset": -21, - "y_offset": -62 + "x": -21, + "y": -62 }, { "path": "track/raptor/very_small_turn_left_steep_up_1_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/very_small_turn_left_steep_up_2_1.png", - "x_offset": -10, - "y_offset": -62 + "x": -10, + "y": -62 }, { "path": "track/raptor/very_small_turn_left_steep_up_2_2.png", - "x_offset": -18, - "y_offset": -31 + "x": -18, + "y": -31 }, { "path": "track/raptor/very_small_turn_left_steep_up_3_1.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/very_small_turn_left_steep_up_3_2.png", - "x_offset": 6, - "y_offset": -46 + "x": 6, + "y": -46 }, { "path": "track/raptor/very_small_turn_left_steep_up_4_1.png", - "x_offset": -9, - "y_offset": -33 + "x": -9, + "y": -33 }, { "path": "track/raptor/very_small_turn_left_steep_up_4_2.png", - "x_offset": -21, - "y_offset": -46 + "x": -21, + "y": -46 }, { "path": "track/raptor/very_small_turn_right_steep_up_1_1.png", - "x_offset": -18, - "y_offset": -24 + "x": -18, + "y": -24 }, { "path": "track/raptor/very_small_turn_right_steep_up_1_2.png", - "x_offset": 0, - "y_offset": -46 + "x": 0, + "y": -46 }, { "path": "track/raptor/very_small_turn_right_steep_up_2_1.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/very_small_turn_right_steep_up_2_2.png", - "x_offset": -21, - "y_offset": -46 + "x": -21, + "y": -46 }, { "path": "track/raptor/very_small_turn_right_steep_up_3_1.png", - "x_offset": -21, - "y_offset": -62 + "x": -21, + "y": -62 }, { "path": "track/raptor/very_small_turn_right_steep_up_3_2.png", - "x_offset": -10, - "y_offset": -33 + "x": -10, + "y": -33 }, { "path": "track/raptor/very_small_turn_right_steep_up_4_1.png", - "x_offset": 6, - "y_offset": -62 + "x": 6, + "y": -62 }, { "path": "track/raptor/very_small_turn_right_steep_up_4_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/vertical_twist_left_up_1.png", - "x_offset": -6, - "y_offset": -88 + "x": -6, + "y": -88 }, { "path": "track/raptor/vertical_twist_left_up_2_1.png", - "x_offset": -2, - "y_offset": -88 + "x": -2, + "y": -88 }, { "path": "track/raptor/vertical_twist_left_up_2_2.png", - "x_offset": -2, - "y_offset": -41 + "x": -2, + "y": -41 }, { "path": "track/raptor/vertical_twist_left_up_3.png", - "x_offset": -6, - "y_offset": -86 + "x": -6, + "y": -86 }, { "path": "track/raptor/vertical_twist_left_up_4_1.png", - "x_offset": -6, - "y_offset": -40 + "x": -6, + "y": -40 }, { "path": "track/raptor/vertical_twist_left_up_4_2.png", - "x_offset": -6, - "y_offset": -86 + "x": -6, + "y": -86 }, { "path": "track/raptor/vertical_twist_right_up_1_1.png", - "x_offset": -2, - "y_offset": -41 + "x": -2, + "y": -41 }, { "path": "track/raptor/vertical_twist_right_up_1_2.png", - "x_offset": -2, - "y_offset": -86 + "x": -2, + "y": -86 }, { "path": "track/raptor/vertical_twist_right_up_2.png", - "x_offset": -6, - "y_offset": -86 + "x": -6, + "y": -86 }, { "path": "track/raptor/vertical_twist_right_up_3_1.png", - "x_offset": -6, - "y_offset": -88 + "x": -6, + "y": -88 }, { "path": "track/raptor/vertical_twist_right_up_3_2.png", - "x_offset": -6, - "y_offset": -41 + "x": -6, + "y": -41 }, { "path": "track/raptor/vertical_twist_right_up_4.png", - "x_offset": -6, - "y_offset": -88 + "x": -6, + "y": -88 }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_1.png", - "x_offset": -18, - "y_offset": -14 + "x": -18, + "y": -14 }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_2_1.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_2_2.png", - "x_offset": -17, - "y_offset": 1 + "x": -17, + "y": 1 }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_3.png", - "x_offset": -20, - "y_offset": 0 + "x": -20, + "y": 0 }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_4.png", - "x_offset": -18, - "y_offset": -15 + "x": -18, + "y": -15 }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_1.png", - "x_offset": -18, - "y_offset": -15 + "x": -18, + "y": -15 }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_2.png", - "x_offset": -18, - "y_offset": 0 + "x": -18, + "y": 0 }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_3_1.png", - "x_offset": -9, - "y_offset": 1 + "x": -9, + "y": 1 }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_3_2.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_4.png", - "x_offset": -20, - "y_offset": -14 + "x": -20, + "y": -14 }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_1.png", - "x_offset": -17, - "y_offset": -14 + "x": -17, + "y": -14 }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_2_1.png", - "x_offset": -16, - "y_offset": 1 + "x": -16, + "y": 1 }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_2_2.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_3.png", - "x_offset": -19, - "y_offset": 0 + "x": -19, + "y": 0 }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_1.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_2.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_3_1.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 1 + "x": 0, + "y": 1 }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_1.png", - "x_offset": -17, - "y_offset": -6 + "x": -17, + "y": -6 }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_2.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_3.png", - "x_offset": -20, - "y_offset": 0 + "x": -20, + "y": 0 }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_4.png", - "x_offset": -18, - "y_offset": -7 + "x": -18, + "y": -7 }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_1.png", - "x_offset": -19, - "y_offset": -7 + "x": -19, + "y": -7 }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_2.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_3.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_4.png", - "x_offset": -20, - "y_offset": -6 + "x": -20, + "y": -6 }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_1.png", - "x_offset": -16, - "y_offset": -6 + "x": -16, + "y": -6 }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_2.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_3.png", - "x_offset": -19, - "y_offset": 0 + "x": -19, + "y": 0 }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_4.png", - "x_offset": -17, - "y_offset": -8 + "x": -17, + "y": -8 }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_1.png", - "x_offset": -19, - "y_offset": -8 + "x": -19, + "y": -8 }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_2.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_3.png", - "x_offset": -17, - "y_offset": 1 + "x": -17, + "y": 1 }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_4.png", - "x_offset": -20, - "y_offset": -6 + "x": -20, + "y": -6 }, { "path": "track/raptor/gentle_up_left_bank_1.png", - "x_offset": -16, - "y_offset": -14 + "x": -16, + "y": -14 }, { "path": "track/raptor/gentle_up_left_bank_2.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_up_left_bank_3.png", - "x_offset": -20, - "y_offset": 0 + "x": -20, + "y": 0 }, { "path": "track/raptor/gentle_up_left_bank_4.png", - "x_offset": -18, - "y_offset": -15 + "x": -18, + "y": -15 }, { "path": "track/raptor/gentle_up_right_bank_1.png", - "x_offset": -19, - "y_offset": -15 + "x": -19, + "y": -15 }, { "path": "track/raptor/gentle_up_right_bank_2.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/gentle_up_right_bank_3.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_right_bank_4.png", - "x_offset": -20, - "y_offset": -14 + "x": -20, + "y": -14 }, { "path": "track/raptor/flat_to_gentle_up_left_bank_1.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/flat_to_gentle_up_left_bank_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_left_bank_2_2.png", - "x_offset": -17, - "y_offset": 7 + "x": -17, + "y": 7 }, { "path": "track/raptor/flat_to_gentle_up_left_bank_3.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_left_bank_4.png", - "x_offset": -18, - "y_offset": -7 + "x": -18, + "y": -7 }, { "path": "track/raptor/flat_to_gentle_up_right_bank_1.png", - "x_offset": -18, - "y_offset": -7 + "x": -18, + "y": -7 }, { "path": "track/raptor/flat_to_gentle_up_right_bank_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_right_bank_3_1.png", - "x_offset": -3, - "y_offset": 2 + "x": -3, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_right_bank_3_2.png", - "x_offset": -18, - "y_offset": 7 + "x": -18, + "y": 7 }, { "path": "track/raptor/flat_to_gentle_up_right_bank_4.png", - "x_offset": -20, - "y_offset": -6 + "x": -20, + "y": -6 }, { "path": "track/raptor/gentle_up_left_bank_to_flat_1.png", - "x_offset": -17, - "y_offset": -6 + "x": -17, + "y": -6 }, { "path": "track/raptor/gentle_up_left_bank_to_flat_2_1.png", - "x_offset": -16, - "y_offset": 1 + "x": -16, + "y": 1 }, { "path": "track/raptor/gentle_up_left_bank_to_flat_2_2.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_up_left_bank_to_flat_3.png", - "x_offset": -18, - "y_offset": 0 + "x": -18, + "y": 0 }, { "path": "track/raptor/gentle_up_left_bank_to_flat_4.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/gentle_up_right_bank_to_flat_1.png", - "x_offset": -19, - "y_offset": -6 + "x": -19, + "y": -6 }, { "path": "track/raptor/gentle_up_right_bank_to_flat_2.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/gentle_up_right_bank_to_flat_3_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/gentle_up_right_bank_to_flat_3_2.png", - "x_offset": -3, - "y_offset": 1 + "x": -3, + "y": 1 }, { "path": "track/raptor/gentle_up_right_bank_to_flat_4.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_1_1.png", - "x_offset": -23, - "y_offset": -32 + "x": -23, + "y": -32 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_1_2.png", - "x_offset": -12, - "y_offset": -18 + "x": -12, + "y": -18 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_2_1.png", - "x_offset": -13, - "y_offset": -7 + "x": -13, + "y": -7 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_2_2.png", - "x_offset": -38, - "y_offset": -17 + "x": -38, + "y": -17 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_3_1.png", - "x_offset": -15, - "y_offset": -3 + "x": -15, + "y": -3 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_3_2.png", - "x_offset": -3, - "y_offset": -7 + "x": -3, + "y": -7 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -13 + "x": -26, + "y": -13 }, { "path": "track/raptor/small_turn_left_bank_gentle_up_4_2.png", - "x_offset": -26, - "y_offset": -4 + "x": -26, + "y": -4 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_1_1.png", - "x_offset": -25, - "y_offset": -13 + "x": -25, + "y": -13 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": -4 + "x": -26, + "y": -4 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_2_1.png", - "x_offset": -11, - "y_offset": -3 + "x": -11, + "y": -3 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_2_2.png", - "x_offset": -24, - "y_offset": -7 + "x": -24, + "y": -7 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": -7 + "x": -38, + "y": -7 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_3_2.png", - "x_offset": -14, - "y_offset": -17 + "x": -14, + "y": -17 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_4_1.png", - "x_offset": -3, - "y_offset": -25 + "x": -3, + "y": -25 }, { "path": "track/raptor/small_turn_right_bank_gentle_up_4_2.png", - "x_offset": -15, - "y_offset": -18 + "x": -15, + "y": -18 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_1_1.png", - "x_offset": -17, - "y_offset": -15 + "x": -17, + "y": -15 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_1_2.png", - "x_offset": -25, - "y_offset": -11 + "x": -25, + "y": -11 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_1_4.png", - "x_offset": -25, - "y_offset": -8 + "x": -25, + "y": -8 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_1_5.png", - "x_offset": -18, - "y_offset": -15 + "x": -18, + "y": -15 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_2_1.png", - "x_offset": -19, - "y_offset": -5 + "x": -19, + "y": -5 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": -14 + "x": 0, + "y": -14 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": 2 + "x": 0, + "y": 2 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_2_4.png", - "x_offset": -11, - "y_offset": -21 + "x": -11, + "y": -21 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_2_5.png", - "x_offset": -16, - "y_offset": -14 + "x": -16, + "y": -14 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_3_1.png", - "x_offset": -22, - "y_offset": 0 + "x": -22, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_3_4.png", - "x_offset": 11, - "y_offset": -2 + "x": 11, + "y": -2 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_3_5.png", - "x_offset": -15, - "y_offset": 0 + "x": -15, + "y": 0 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_4_1.png", - "x_offset": -24, - "y_offset": -13 + "x": -24, + "y": -13 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_4_2.png", - "x_offset": -32, - "y_offset": -1 + "x": -32, + "y": -1 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_4_3.png", - "x_offset": -18, - "y_offset": -14 + "x": -18, + "y": -14 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_4_4.png", - "x_offset": -16, - "y_offset": 3 + "x": -16, + "y": 3 }, { "path": "track/raptor/medium_turn_left_bank_gentle_up_4_5.png", - "x_offset": -20, - "y_offset": 0 + "x": -20, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_1_1.png", - "x_offset": -19, - "y_offset": -13 + "x": -19, + "y": -13 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_1_2.png", - "x_offset": -11, - "y_offset": -1 + "x": -11, + "y": -1 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": -14 + "x": 0, + "y": -14 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_1_4.png", - "x_offset": -16, - "y_offset": 3 + "x": -16, + "y": 3 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_1_5.png", - "x_offset": -20, - "y_offset": 0 + "x": -20, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_2_1.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -2 + "x": -32, + "y": -2 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_2_5.png", - "x_offset": -18, - "y_offset": 0 + "x": -18, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -5 + "x": -32, + "y": -5 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_3_2.png", - "x_offset": -32, - "y_offset": -14 + "x": -32, + "y": -14 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_3_3.png", - "x_offset": -26, - "y_offset": 0 + "x": -26, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_3_4.png", - "x_offset": -22, - "y_offset": -22 + "x": -22, + "y": -22 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_3_5.png", - "x_offset": -20, - "y_offset": -14 + "x": -20, + "y": -14 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_4_1.png", - "x_offset": -13, - "y_offset": -13 + "x": -13, + "y": -13 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_4_2.png", - "x_offset": 10, - "y_offset": -11 + "x": 10, + "y": -11 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_4_4.png", - "x_offset": 9, - "y_offset": -7 + "x": 9, + "y": -7 }, { "path": "track/raptor/medium_turn_right_bank_gentle_up_4_5.png", - "x_offset": -15, - "y_offset": -15 + "x": -15, + "y": -15 }, { "path": "track/raptor/s_bend_left_1_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/s_bend_left_1_2.png", - "x_offset": -26, - "y_offset": 6 + "x": -26, + "y": 6 }, { "path": "track/raptor/s_bend_left_1_3.png", - "x_offset": 11, - "y_offset": 8 + "x": 11, + "y": 8 }, { "path": "track/raptor/s_bend_left_1_4.png", - "x_offset": -15, - "y_offset": 2 + "x": -15, + "y": 2 }, { "path": "track/raptor/s_bend_left_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/s_bend_left_2_2.png", - "x_offset": -10, - "y_offset": 0 + "x": -10, + "y": 0 }, { "path": "track/raptor/s_bend_left_2_3.png", - "x_offset": -30, - "y_offset": 16 + "x": -30, + "y": 16 }, { "path": "track/raptor/s_bend_left_2_4.png", - "x_offset": -22, - "y_offset": 6 + "x": -22, + "y": 6 }, { "path": "track/raptor/s_bend_right_1_1.png", - "x_offset": -18, - "y_offset": 6 + "x": -18, + "y": 6 }, { "path": "track/raptor/s_bend_right_1_2.png", - "x_offset": -19, - "y_offset": 16 + "x": -19, + "y": 16 }, { "path": "track/raptor/s_bend_right_1_3.png", - "x_offset": -16, - "y_offset": 0 + "x": -16, + "y": 0 }, { "path": "track/raptor/s_bend_right_1_4.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/s_bend_right_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/s_bend_right_2_2.png", - "x_offset": -23, - "y_offset": 8 + "x": -23, + "y": 8 }, { "path": "track/raptor/s_bend_right_2_3.png", - "x_offset": 13, - "y_offset": 6 + "x": 13, + "y": 6 }, { "path": "track/raptor/s_bend_right_2_4.png", - "x_offset": -12, - "y_offset": 2 + "x": -12, + "y": 2 }, { "path": "track/raptor/small_helix_left_up_1_1.png", - "x_offset": -6, - "y_offset": -1 + "x": -6, + "y": -1 }, { "path": "track/raptor/small_helix_left_up_1_2.png", - "x_offset": -17, - "y_offset": -1 + "x": -17, + "y": -1 }, { "path": "track/raptor/small_helix_left_up_1_3.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/small_helix_left_up_1_4.png", - "x_offset": -17, - "y_offset": -8 + "x": -17, + "y": -8 }, { "path": "track/raptor/small_helix_left_up_2_1.png", - "x_offset": -19, - "y_offset": 2 + "x": -19, + "y": 2 }, { "path": "track/raptor/small_helix_left_up_2_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/small_helix_left_up_2_3.png", - "x_offset": -32, - "y_offset": -6 + "x": -32, + "y": -6 }, { "path": "track/raptor/small_helix_left_up_3_1.png", - "x_offset": -7, - "y_offset": 0 + "x": -7, + "y": 0 }, { "path": "track/raptor/small_helix_left_up_3_2.png", - "x_offset": 23, - "y_offset": 0 + "x": 23, + "y": 0 }, { "path": "track/raptor/small_helix_left_up_3_3.png", - "x_offset": -2, - "y_offset": -1 + "x": -2, + "y": -1 }, { "path": "track/raptor/small_helix_left_up_3_4.png", - "x_offset": -7, - "y_offset": -1 + "x": -7, + "y": -1 }, { "path": "track/raptor/small_helix_left_up_4_1.png", - "x_offset": -26, - "y_offset": 2 + "x": -26, + "y": 2 }, { "path": "track/raptor/small_helix_left_up_4_2.png", - "x_offset": -8, - "y_offset": 17 + "x": -8, + "y": 17 }, { "path": "track/raptor/small_helix_left_up_4_3.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/small_helix_right_up_1_1.png", - "x_offset": -19, - "y_offset": 2 + "x": -19, + "y": 2 }, { "path": "track/raptor/small_helix_right_up_1_2.png", - "x_offset": -6, - "y_offset": 17 + "x": -6, + "y": 17 }, { "path": "track/raptor/small_helix_right_up_1_3.png", - "x_offset": -26, - "y_offset": 1 + "x": -26, + "y": 1 }, { "path": "track/raptor/small_helix_right_up_2_1.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/small_helix_right_up_2_2.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/small_helix_right_up_2_3.png", - "x_offset": -2, - "y_offset": -1 + "x": -2, + "y": -1 }, { "path": "track/raptor/small_helix_right_up_2_4.png", - "x_offset": -17, - "y_offset": -1 + "x": -17, + "y": -1 }, { "path": "track/raptor/small_helix_right_up_3_1.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/small_helix_right_up_3_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/small_helix_right_up_3_3.png", - "x_offset": -20, - "y_offset": -6 + "x": -20, + "y": -6 }, { "path": "track/raptor/small_helix_right_up_4_1.png", - "x_offset": -6, - "y_offset": -1 + "x": -6, + "y": -1 }, { "path": "track/raptor/small_helix_right_up_4_2.png", - "x_offset": -8, - "y_offset": -1 + "x": -8, + "y": -1 }, { "path": "track/raptor/small_helix_right_up_4_3.png", - "x_offset": 23, - "y_offset": 0 + "x": 23, + "y": 0 }, { "path": "track/raptor/small_helix_right_up_4_4.png", - "x_offset": -8, - "y_offset": -8 + "x": -8, + "y": -8 }, { "path": "track/raptor/medium_helix_left_up_1_1.png", - "x_offset": -1, - "y_offset": 2 + "x": -1, + "y": 2 }, { "path": "track/raptor/medium_helix_left_up_1_2.png", - "x_offset": -17, - "y_offset": 3 + "x": -17, + "y": 3 }, { "path": "track/raptor/medium_helix_left_up_1_3.png", - "x_offset": -27, - "y_offset": 6 + "x": -27, + "y": 6 }, { "path": "track/raptor/medium_helix_left_up_1_4.png", - "x_offset": 10, - "y_offset": 7 + "x": 10, + "y": 7 }, { "path": "track/raptor/medium_helix_left_up_1_5.png", - "x_offset": -20, - "y_offset": 7 + "x": -20, + "y": 7 }, { "path": "track/raptor/medium_helix_left_up_1_6.png", - "x_offset": -17, - "y_offset": -8 + "x": -17, + "y": -8 }, { "path": "track/raptor/medium_helix_left_up_2_1.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/medium_helix_left_up_2_2.png", - "x_offset": -6, - "y_offset": 0 + "x": -6, + "y": 0 }, { "path": "track/raptor/medium_helix_left_up_2_3.png", - "x_offset": -32, - "y_offset": 10 + "x": -32, + "y": 10 }, { "path": "track/raptor/medium_helix_left_up_2_4.png", - "x_offset": -4, - "y_offset": 0 + "x": -4, + "y": 0 }, { "path": "track/raptor/medium_helix_left_up_2_5.png", - "x_offset": -32, - "y_offset": -6 + "x": -32, + "y": -6 }, { "path": "track/raptor/medium_helix_left_up_3_1.png", - "x_offset": -16, - "y_offset": 0 + "x": -16, + "y": 0 }, { "path": "track/raptor/medium_helix_left_up_3_2.png", - "x_offset": 9, - "y_offset": 7 + "x": 9, + "y": 7 }, { "path": "track/raptor/medium_helix_left_up_3_3.png", - "x_offset": -22, - "y_offset": 7 + "x": -22, + "y": 7 }, { "path": "track/raptor/medium_helix_left_up_3_4.png", - "x_offset": 15, - "y_offset": 7 + "x": 15, + "y": 7 }, { "path": "track/raptor/medium_helix_left_up_3_5.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_helix_left_up_3_6.png", - "x_offset": -6, - "y_offset": 0 + "x": -6, + "y": 0 }, { "path": "track/raptor/medium_helix_left_up_4_1.png", - "x_offset": -18, - "y_offset": 4 + "x": -18, + "y": 4 }, { "path": "track/raptor/medium_helix_left_up_4_2.png", - "x_offset": -32, - "y_offset": 12 + "x": -32, + "y": 12 }, { "path": "track/raptor/medium_helix_left_up_4_3.png", - "x_offset": -8, - "y_offset": -5 + "x": -8, + "y": -5 }, { "path": "track/raptor/medium_helix_left_up_4_4.png", - "x_offset": -28, - "y_offset": 11 + "x": -28, + "y": 11 }, { "path": "track/raptor/medium_helix_left_up_4_5.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/medium_helix_right_up_1_1.png", - "x_offset": -19, - "y_offset": 4 + "x": -19, + "y": 4 }, { "path": "track/raptor/medium_helix_right_up_1_2.png", - "x_offset": -22, - "y_offset": 12 + "x": -22, + "y": 12 }, { "path": "track/raptor/medium_helix_right_up_1_3.png", - "x_offset": -8, - "y_offset": -5 + "x": -8, + "y": -5 }, { "path": "track/raptor/medium_helix_right_up_1_4.png", - "x_offset": -32, - "y_offset": 11 + "x": -32, + "y": 11 }, { "path": "track/raptor/medium_helix_right_up_1_5.png", - "x_offset": -12, - "y_offset": 1 + "x": -12, + "y": 1 }, { "path": "track/raptor/medium_helix_right_up_2_1.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/medium_helix_right_up_2_2.png", - "x_offset": -21, - "y_offset": 7 + "x": -21, + "y": 7 }, { "path": "track/raptor/medium_helix_right_up_2_3.png", - "x_offset": 7, - "y_offset": 7 + "x": 7, + "y": 7 }, { "path": "track/raptor/medium_helix_right_up_2_4.png", - "x_offset": -30, - "y_offset": 7 + "x": -30, + "y": 7 }, { "path": "track/raptor/medium_helix_right_up_2_5.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/medium_helix_right_up_2_6.png", - "x_offset": -17, - "y_offset": 0 + "x": -17, + "y": 0 }, { "path": "track/raptor/medium_helix_right_up_3_1.png", - "x_offset": -32, - "y_offset": 2 + "x": -32, + "y": 2 }, { "path": "track/raptor/medium_helix_right_up_3_2.png", - "x_offset": -10, - "y_offset": 0 + "x": -10, + "y": 0 }, { "path": "track/raptor/medium_helix_right_up_3_3.png", - "x_offset": -32, - "y_offset": 10 + "x": -32, + "y": 10 }, { "path": "track/raptor/medium_helix_right_up_3_4.png", - "x_offset": -2, - "y_offset": 0 + "x": -2, + "y": 0 }, { "path": "track/raptor/medium_helix_right_up_3_5.png", - "x_offset": -20, - "y_offset": -6 + "x": -20, + "y": -6 }, { "path": "track/raptor/medium_helix_right_up_4_1.png", - "x_offset": -6, - "y_offset": 2 + "x": -6, + "y": 2 }, { "path": "track/raptor/medium_helix_right_up_4_2.png", - "x_offset": -10, - "y_offset": 3 + "x": -10, + "y": 3 }, { "path": "track/raptor/medium_helix_right_up_4_3.png", - "x_offset": 13, - "y_offset": 6 + "x": 13, + "y": 6 }, { "path": "track/raptor/medium_helix_right_up_4_4.png", - "x_offset": -22, - "y_offset": 7 + "x": -22, + "y": 7 }, { "path": "track/raptor/medium_helix_right_up_4_5.png", - "x_offset": 9, - "y_offset": 7 + "x": 9, + "y": 7 }, { "path": "track/raptor/medium_helix_right_up_4_6.png", - "x_offset": -18, - "y_offset": -8 + "x": -18, + "y": -8 }, { "path": "track/raptor/barrel_roll_left_1_1.png", - "x_offset": -18, - "y_offset": 8 + "x": -18, + "y": 8 }, { "path": "track/raptor/barrel_roll_left_1_2.png", - "x_offset": -5, - "y_offset": 6 + "x": -5, + "y": 6 }, { "path": "track/raptor/barrel_roll_left_1_3.png", - "x_offset": -21, - "y_offset": 22 + "x": -21, + "y": 22 }, { "path": "track/raptor/barrel_roll_left_1_4.png", - "x_offset": -20, - "y_offset": -12 + "x": -20, + "y": -12 }, { "path": "track/raptor/barrel_roll_left_1_5.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_left_1_6.png", - "x_offset": -9, - "y_offset": -21 + "x": -9, + "y": -21 }, { "path": "track/raptor/barrel_roll_left_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/barrel_roll_left_2_2.png", - "x_offset": -17, - "y_offset": 8 + "x": -17, + "y": 8 }, { "path": "track/raptor/barrel_roll_left_2_3.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_left_2_4.png", - "x_offset": -28, - "y_offset": -2 + "x": -28, + "y": -2 }, { "path": "track/raptor/barrel_roll_left_2_5.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_left_2_6.png", - "x_offset": -32, - "y_offset": -13 + "x": -32, + "y": -13 }, { "path": "track/raptor/barrel_roll_left_3_1.png", - "x_offset": -28, - "y_offset": 1 + "x": -28, + "y": 1 }, { "path": "track/raptor/barrel_roll_left_3_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_left_3_3.png", - "x_offset": -26, - "y_offset": -8 + "x": -26, + "y": -8 }, { "path": "track/raptor/barrel_roll_left_3_4.png", - "x_offset": -27, - "y_offset": -6 + "x": -27, + "y": -6 }, { "path": "track/raptor/barrel_roll_left_3_5.png", - "x_offset": 2, - "y_offset": -14 + "x": 2, + "y": -14 }, { "path": "track/raptor/barrel_roll_left_3_6.png", - "x_offset": -18, - "y_offset": -19 + "x": -18, + "y": -19 }, { "path": "track/raptor/barrel_roll_left_4_1.png", - "x_offset": -11, - "y_offset": -9 + "x": -11, + "y": -9 }, { "path": "track/raptor/barrel_roll_left_4_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_left_4_3.png", - "x_offset": -11, - "y_offset": -19 + "x": -11, + "y": -19 }, { "path": "track/raptor/barrel_roll_left_4_4.png", - "x_offset": -10, - "y_offset": -21 + "x": -10, + "y": -21 }, { "path": "track/raptor/barrel_roll_left_4_5.png", - "x_offset": 8, - "y_offset": -7 + "x": 8, + "y": -7 }, { "path": "track/raptor/barrel_roll_left_4_6.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/barrel_roll_right_1_1.png", - "x_offset": -18, - "y_offset": -9 + "x": -18, + "y": -9 }, { "path": "track/raptor/barrel_roll_right_1_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_right_1_3.png", - "x_offset": -25, - "y_offset": -19 + "x": -25, + "y": -19 }, { "path": "track/raptor/barrel_roll_right_1_4.png", - "x_offset": 3, - "y_offset": -21 + "x": 3, + "y": -21 }, { "path": "track/raptor/barrel_roll_right_1_5.png", - "x_offset": -22, - "y_offset": -14 + "x": -22, + "y": -14 }, { "path": "track/raptor/barrel_roll_right_1_6.png", - "x_offset": -23, - "y_offset": -21 + "x": -23, + "y": -21 }, { "path": "track/raptor/barrel_roll_right_2_1.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/barrel_roll_right_2_2.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_right_2_3.png", - "x_offset": -6, - "y_offset": -8 + "x": -6, + "y": -8 }, { "path": "track/raptor/barrel_roll_right_2_4.png", - "x_offset": 17, - "y_offset": -6 + "x": 17, + "y": -6 }, { "path": "track/raptor/barrel_roll_right_2_5.png", - "x_offset": -6, - "y_offset": -14 + "x": -6, + "y": -14 }, { "path": "track/raptor/barrel_roll_right_2_6.png", - "x_offset": -6, - "y_offset": -19 + "x": -6, + "y": -19 }, { "path": "track/raptor/barrel_roll_right_3_1.png", - "x_offset": -2, - "y_offset": 2 + "x": -2, + "y": 2 }, { "path": "track/raptor/barrel_roll_right_3_2.png", - "x_offset": -4, - "y_offset": 8 + "x": -4, + "y": 8 }, { "path": "track/raptor/barrel_roll_right_3_3.png", - "x_offset": 6, - "y_offset": -2 + "x": 6, + "y": -2 }, { "path": "track/raptor/barrel_roll_right_3_4.png", - "x_offset": 0, - "y_offset": -2 + "x": 0, + "y": -2 }, { "path": "track/raptor/barrel_roll_right_3_5.png", - "x_offset": -12, - "y_offset": -2 + "x": -12, + "y": -2 }, { "path": "track/raptor/barrel_roll_right_3_6.png", - "x_offset": -18, - "y_offset": -13 + "x": -18, + "y": -13 }, { "path": "track/raptor/barrel_roll_right_4_1.png", - "x_offset": -11, - "y_offset": 8 + "x": -11, + "y": 8 }, { "path": "track/raptor/barrel_roll_right_4_2.png", - "x_offset": -19, - "y_offset": 6 + "x": -19, + "y": 6 }, { "path": "track/raptor/barrel_roll_right_4_3.png", - "x_offset": -9, - "y_offset": 1 + "x": -9, + "y": 1 }, { "path": "track/raptor/barrel_roll_right_4_4.png", - "x_offset": -26, - "y_offset": -12 + "x": -26, + "y": -12 }, { "path": "track/raptor/barrel_roll_right_4_5.png", - "x_offset": 0, - "y_offset": 0 + "x": 0, + "y": 0 }, { "path": "track/raptor/barrel_roll_right_4_6.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/half_loop_1_1.png", - "x_offset": -24, - "y_offset": -18 + "x": -24, + "y": -18 }, { "path": "track/raptor/half_loop_1_2.png", - "x_offset": -19, - "y_offset": -38 + "x": -19, + "y": -38 }, { "path": "track/raptor/half_loop_1_3.png", - "x_offset": -12, - "y_offset": -82 + "x": -12, + "y": -82 }, { "path": "track/raptor/half_loop_1_4.png", - "x_offset": -18, - "y_offset": 23 + "x": -18, + "y": 23 }, { "path": "track/raptor/half_loop_2_1.png", - "x_offset": -12, - "y_offset": -4 + "x": -12, + "y": -4 }, { "path": "track/raptor/half_loop_2_2.png", - "x_offset": 1, - "y_offset": -31 + "x": 1, + "y": -31 }, { "path": "track/raptor/half_loop_2_3.png", - "x_offset": -38, - "y_offset": -113 + "x": -38, + "y": -113 }, { "path": "track/raptor/half_loop_2_4.png", - "x_offset": -18, - "y_offset": 11 + "x": -18, + "y": 11 }, { "path": "track/raptor/half_loop_3_1.png", - "x_offset": -26, - "y_offset": -4 + "x": -26, + "y": -4 }, { "path": "track/raptor/half_loop_3_2.png", - "x_offset": -25, - "y_offset": -27 + "x": -25, + "y": -27 }, { "path": "track/raptor/half_loop_3_3.png", - "x_offset": 2, - "y_offset": -120 + "x": 2, + "y": -120 }, { "path": "track/raptor/half_loop_3_4.png", - "x_offset": -22, - "y_offset": 3 + "x": -22, + "y": 3 }, { "path": "track/raptor/half_loop_4_1.png", - "x_offset": -12, - "y_offset": -18 + "x": -12, + "y": -18 }, { "path": "track/raptor/half_loop_4_2.png", - "x_offset": -12, - "y_offset": -42 + "x": -12, + "y": -42 }, { "path": "track/raptor/half_loop_4_3.png", - "x_offset": 8, - "y_offset": -91 + "x": 8, + "y": -91 }, { "path": "track/raptor/half_loop_4_4.png", - "x_offset": 5, - "y_offset": 15 + "x": 5, + "y": 15 }, { "path": "track/raptor/flat_to_steep_up_1_1.png", - "x_offset": -18, - "y_offset": -2 + "x": -18, + "y": -2 }, { "path": "track/raptor/flat_to_steep_up_1_2.png", - "x_offset": -19, - "y_offset": -17 + "x": -19, + "y": -17 }, { "path": "track/raptor/flat_to_steep_up_1_3.png", - "x_offset": -17, - "y_offset": -25 + "x": -17, + "y": -25 }, { "path": "track/raptor/flat_to_steep_up_1_4.png", - "x_offset": -18, - "y_offset": -46 + "x": -18, + "y": -46 }, { "path": "track/raptor/flat_to_steep_up_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_steep_up_2_2.png", - "x_offset": -24, - "y_offset": -4 + "x": -24, + "y": -4 }, { "path": "track/raptor/flat_to_steep_up_2_3.png", - "x_offset": -25, - "y_offset": -6 + "x": -25, + "y": -6 }, { "path": "track/raptor/flat_to_steep_up_2_4.png", - "x_offset": -20, - "y_offset": -30 + "x": -20, + "y": -30 }, { "path": "track/raptor/flat_to_steep_up_3_1.png", - "x_offset": -20, - "y_offset": 2 + "x": -20, + "y": 2 }, { "path": "track/raptor/flat_to_steep_up_3_2.png", - "x_offset": -22, - "y_offset": -2 + "x": -22, + "y": -2 }, { "path": "track/raptor/flat_to_steep_up_3_3.png", - "x_offset": -23, - "y_offset": -13 + "x": -23, + "y": -13 }, { "path": "track/raptor/flat_to_steep_up_3_4.png", - "x_offset": -21, - "y_offset": -30 + "x": -21, + "y": -30 }, { "path": "track/raptor/flat_to_steep_up_4_1.png", - "x_offset": -19, - "y_offset": -2 + "x": -19, + "y": -2 }, { "path": "track/raptor/flat_to_steep_up_4_2.png", - "x_offset": -21, - "y_offset": -17 + "x": -21, + "y": -17 }, { "path": "track/raptor/flat_to_steep_up_4_3.png", - "x_offset": -20, - "y_offset": -25 + "x": -20, + "y": -25 }, { "path": "track/raptor/flat_to_steep_up_4_4.png", - "x_offset": -21, - "y_offset": -46 + "x": -21, + "y": -46 }, { "path": "track/raptor/steep_to_flat_up_1_1.png", - "x_offset": -18, - "y_offset": -41 + "x": -18, + "y": -41 }, { "path": "track/raptor/steep_to_flat_up_1_2.png", - "x_offset": -20, - "y_offset": -26 + "x": -20, + "y": -26 }, { "path": "track/raptor/steep_to_flat_up_1_3.png", - "x_offset": -20, - "y_offset": -18 + "x": -20, + "y": -18 }, { "path": "track/raptor/steep_to_flat_up_1_4.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/steep_to_flat_up_2_1.png", - "x_offset": -18, - "y_offset": -26 + "x": -18, + "y": -26 }, { "path": "track/raptor/steep_to_flat_up_2_2.png", - "x_offset": -18, - "y_offset": -13 + "x": -18, + "y": -13 }, { "path": "track/raptor/steep_to_flat_up_2_3.png", - "x_offset": -13, - "y_offset": -5 + "x": -13, + "y": -5 }, { "path": "track/raptor/steep_to_flat_up_2_4.png", - "x_offset": -14, - "y_offset": -1 + "x": -14, + "y": -1 }, { "path": "track/raptor/steep_to_flat_up_3_1.png", - "x_offset": -14, - "y_offset": -25 + "x": -14, + "y": -25 }, { "path": "track/raptor/steep_to_flat_up_3_2.png", - "x_offset": -13, - "y_offset": -13 + "x": -13, + "y": -13 }, { "path": "track/raptor/steep_to_flat_up_3_3.png", - "x_offset": -16, - "y_offset": -5 + "x": -16, + "y": -5 }, { "path": "track/raptor/steep_to_flat_up_3_4.png", - "x_offset": -18, - "y_offset": -3 + "x": -18, + "y": -3 }, { "path": "track/raptor/steep_to_flat_up_4_1.png", - "x_offset": -18, - "y_offset": -40 + "x": -18, + "y": -40 }, { "path": "track/raptor/steep_to_flat_up_4_2.png", - "x_offset": -18, - "y_offset": -26 + "x": -18, + "y": -26 }, { "path": "track/raptor/steep_to_flat_up_4_3.png", - "x_offset": -17, - "y_offset": -16 + "x": -17, + "y": -16 }, { "path": "track/raptor/steep_to_flat_up_4_4.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/quarter_loop_up_1_1.png", - "x_offset": -17, - "y_offset": -52 + "x": -17, + "y": -52 }, { "path": "track/raptor/quarter_loop_up_1_2.png", - "x_offset": 0, - "y_offset": -30 + "x": 0, + "y": -30 }, { "path": "track/raptor/quarter_loop_up_1_3.png", - "x_offset": -18, - "y_offset": -12 + "x": -18, + "y": -12 }, { "path": "track/raptor/quarter_loop_up_2_1.png", - "x_offset": -22, - "y_offset": -77 + "x": -22, + "y": -77 }, { "path": "track/raptor/quarter_loop_up_2_2.png", - "x_offset": -32, - "y_offset": -66 + "x": -32, + "y": -66 }, { "path": "track/raptor/quarter_loop_up_2_3.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/quarter_loop_up_3_1.png", - "x_offset": -6, - "y_offset": -76 + "x": -6, + "y": -76 }, { "path": "track/raptor/quarter_loop_up_3_2.png", - "x_offset": -17, - "y_offset": -68 + "x": -17, + "y": -68 }, { "path": "track/raptor/quarter_loop_up_3_3.png", - "x_offset": 0, - "y_offset": -21 + "x": 0, + "y": -21 }, { "path": "track/raptor/quarter_loop_up_4_1.png", - "x_offset": -6, - "y_offset": -52 + "x": -6, + "y": -52 }, { "path": "track/raptor/quarter_loop_up_4_2.png", - "x_offset": -20, - "y_offset": -30 + "x": -20, + "y": -30 }, { "path": "track/raptor/quarter_loop_up_4_3.png", - "x_offset": -32, - "y_offset": -12 + "x": -32, + "y": -12 }, { "path": "track/raptor/corkscrew_left_1_1.png", - "x_offset": -18, - "y_offset": -32 + "x": -18, + "y": -32 }, { "path": "track/raptor/corkscrew_left_1_2.png", - "x_offset": -17, - "y_offset": -29 + "x": -17, + "y": -29 }, { "path": "track/raptor/corkscrew_left_1_3.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/corkscrew_left_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/corkscrew_left_2_2.png", - "x_offset": -32, - "y_offset": -28 + "x": -32, + "y": -28 }, { "path": "track/raptor/corkscrew_left_2_3.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/corkscrew_left_3_1.png", - "x_offset": -26, - "y_offset": -4 + "x": -26, + "y": -4 }, { "path": "track/raptor/corkscrew_left_3_2.png", - "x_offset": 5, - "y_offset": -14 + "x": 5, + "y": -14 }, { "path": "track/raptor/corkscrew_left_3_3.png", - "x_offset": -19, - "y_offset": -11 + "x": -19, + "y": -11 }, { "path": "track/raptor/corkscrew_left_4_1.png", - "x_offset": -29, - "y_offset": -32 + "x": -29, + "y": -32 }, { "path": "track/raptor/corkscrew_left_4_2.png", - "x_offset": -27, - "y_offset": -14 + "x": -27, + "y": -14 }, { "path": "track/raptor/corkscrew_left_4_3.png", - "x_offset": -18, - "y_offset": -11 + "x": -18, + "y": -11 }, { "path": "track/raptor/corkscrew_right_1_1.png", - "x_offset": -18, - "y_offset": -32 + "x": -18, + "y": -32 }, { "path": "track/raptor/corkscrew_right_1_2.png", - "x_offset": -6, - "y_offset": -14 + "x": -6, + "y": -14 }, { "path": "track/raptor/corkscrew_right_1_3.png", - "x_offset": -19, - "y_offset": -11 + "x": -19, + "y": -11 }, { "path": "track/raptor/corkscrew_right_2_1.png", - "x_offset": -18, - "y_offset": -4 + "x": -18, + "y": -4 }, { "path": "track/raptor/corkscrew_right_2_2.png", - "x_offset": -13, - "y_offset": -14 + "x": -13, + "y": -14 }, { "path": "track/raptor/corkscrew_right_2_3.png", - "x_offset": -18, - "y_offset": -11 + "x": -18, + "y": -11 }, { "path": "track/raptor/corkscrew_right_3_1.png", - "x_offset": -20, - "y_offset": -2 + "x": -20, + "y": -2 }, { "path": "track/raptor/corkscrew_right_3_2.png", - "x_offset": -18, - "y_offset": -28 + "x": -18, + "y": -28 }, { "path": "track/raptor/corkscrew_right_3_3.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/corkscrew_right_4_1.png", - "x_offset": -22, - "y_offset": -32 + "x": -22, + "y": -32 }, { "path": "track/raptor/corkscrew_right_4_2.png", - "x_offset": 5, - "y_offset": -29 + "x": 5, + "y": -29 }, { "path": "track/raptor/corkscrew_right_4_3.png", - "x_offset": -20, - "y_offset": -21 + "x": -20, + "y": -21 }, { "path": "track/raptor/large_corkscrew_left_1_1.png", - "x_offset": -18, - "y_offset": -6, + "x": -18, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_1_2.png", - "x_offset": -18, - "y_offset": -52, + "x": -18, + "y": -52, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_1_3.png", - "x_offset": -26, - "y_offset": -33, + "x": -26, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_1_4.png", - "x_offset": -20, - "y_offset": -45, + "x": -20, + "y": -45, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_1_5.png", - "x_offset": -18, - "y_offset": -29, + "x": -18, + "y": -29, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_2_1.png", - "x_offset": -18, - "y_offset": 2, + "x": -18, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_2_2.png", - "x_offset": -32, - "y_offset": -9, + "x": -32, + "y": -9, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_2_3.png", - "x_offset": -20, - "y_offset": -43, + "x": -20, + "y": -43, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_2_4.png", - "x_offset": -15, - "y_offset": -50, + "x": -15, + "y": -50, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_2_5.png", - "x_offset": -12, - "y_offset": -29, + "x": -12, + "y": -29, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_3_1.png", - "x_offset": -16, - "y_offset": 2, + "x": -16, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_3_2.png", - "x_offset": -13, - "y_offset": -12, + "x": -13, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_3_3.png", - "x_offset": 17, - "y_offset": -21, + "x": 17, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_3_4.png", - "x_offset": -8, - "y_offset": -30, + "x": -8, + "y": -30, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_3_5.png", - "x_offset": -16, - "y_offset": -22, + "x": -16, + "y": -22, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_4_1.png", - "x_offset": -20, - "y_offset": -5, + "x": -20, + "y": -5, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_4_2.png", - "x_offset": -19, - "y_offset": -20, + "x": -19, + "y": -20, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_4_3.png", - "x_offset": -10, - "y_offset": -7, + "x": -10, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_4_4.png", - "x_offset": -16, - "y_offset": -27, + "x": -16, + "y": -27, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_left_4_5.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_1_1.png", - "x_offset": -18, - "y_offset": -5, + "x": -18, + "y": -5, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_1_2.png", - "x_offset": -18, - "y_offset": -20, + "x": -18, + "y": -20, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_1_3.png", - "x_offset": -16, - "y_offset": -7, + "x": -16, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_1_4.png", - "x_offset": -27, - "y_offset": -27, + "x": -27, + "y": -27, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_1_5.png", - "x_offset": -32, - "y_offset": -21, + "x": -32, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_2_1.png", - "x_offset": -18, - "y_offset": 2, + "x": -18, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_2_2.png", - "x_offset": -16, - "y_offset": -18, + "x": -16, + "y": -18, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_2_3.png", - "x_offset": -24, - "y_offset": -21, + "x": -24, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_2_4.png", - "x_offset": -16, - "y_offset": -30, + "x": -16, + "y": -30, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_2_5.png", - "x_offset": -18, - "y_offset": -22, + "x": -18, + "y": -22, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_3_1.png", - "x_offset": -40, - "y_offset": 1, + "x": -40, + "y": 1, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_3_2.png", - "x_offset": -16, - "y_offset": -9, + "x": -16, + "y": -9, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_3_3.png", - "x_offset": -21, - "y_offset": -43, + "x": -21, + "y": -43, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_3_4.png", - "x_offset": -25, - "y_offset": -50, + "x": -25, + "y": -50, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_3_5.png", - "x_offset": -18, - "y_offset": -29, + "x": -18, + "y": -29, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_4_1.png", - "x_offset": -20, - "y_offset": -6, + "x": -20, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_4_2.png", - "x_offset": -11, - "y_offset": -52, + "x": -11, + "y": -52, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_4_3.png", - "x_offset": 17, - "y_offset": -33, + "x": 17, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_4_4.png", - "x_offset": -11, - "y_offset": -45, + "x": -11, + "y": -45, "palette": "keep" }, { "path": "track/raptor/large_corkscrew_right_4_5.png", - "x_offset": -18, - "y_offset": -29, + "x": -18, + "y": -29, "palette": "keep" }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_1_1.png", - "x_offset": -23, - "y_offset": -16 + "x": -23, + "y": -16 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_1_2.png", - "x_offset": -13, - "y_offset": -9 + "x": -13, + "y": -9 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_2_1.png", - "x_offset": 26, - "y_offset": 0 + "x": 26, + "y": 0 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_2_2.png", - "x_offset": -13, - "y_offset": -2 + "x": -13, + "y": -2 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_2_3.png", - "x_offset": -38, - "y_offset": -9 + "x": -38, + "y": -9 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_3_1.png", - "x_offset": -14, - "y_offset": -3 + "x": -14, + "y": -3 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_3_2.png", - "x_offset": -2, - "y_offset": 0 + "x": -2, + "y": 0 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -5 + "x": -26, + "y": -5 }, { "path": "track/raptor/small_turn_left_bank_to_gentle_up_4_2.png", - "x_offset": -25, - "y_offset": 6 + "x": -25, + "y": 6 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_1_1.png", - "x_offset": -25, - "y_offset": -5 + "x": -25, + "y": -5 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": 6 + "x": -26, + "y": 6 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_2_1.png", - "x_offset": -11, - "y_offset": -3 + "x": -11, + "y": -3 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_2_2.png", - "x_offset": -24, - "y_offset": 0 + "x": -24, + "y": 0 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": 0 + "x": -38, + "y": 0 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_3_2.png", - "x_offset": -38, - "y_offset": -2 + "x": -38, + "y": -2 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_3_3.png", - "x_offset": -13, - "y_offset": -9 + "x": -13, + "y": -9 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_4_1.png", - "x_offset": -2, - "y_offset": -16 + "x": -2, + "y": -16 }, { "path": "track/raptor/small_turn_right_bank_to_gentle_up_4_2.png", - "x_offset": -14, - "y_offset": -9 + "x": -14, + "y": -9 }, { "path": "track/raptor/medium_half_loop_left_1_1.png", - "x_offset": -18, - "y_offset": -28, + "x": -18, + "y": -28, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_1_2.png", - "x_offset": -18, - "y_offset": -45, + "x": -18, + "y": -45, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_1_3.png", - "x_offset": -26, - "y_offset": -70, + "x": -26, + "y": -70, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_1_4.png", - "x_offset": -1, - "y_offset": -115, + "x": -1, + "y": -115, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_1_5.png", - "x_offset": -18, - "y_offset": -26, + "x": -18, + "y": -26, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_2_1.png", - "x_offset": -18, - "y_offset": -9, + "x": -18, + "y": -9, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_2_2.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_2_3.png", - "x_offset": 0, - "y_offset": -83, + "x": 0, + "y": -83, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_2_4.png", - "x_offset": -27, - "y_offset": -142, + "x": -27, + "y": -142, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_2_5.png", - "x_offset": -18, - "y_offset": -37, + "x": -18, + "y": -37, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_3_1.png", - "x_offset": -20, - "y_offset": -2, + "x": -20, + "y": -2, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_3_2.png", - "x_offset": 0, - "y_offset": -8, + "x": 0, + "y": -8, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_3_3.png", - "x_offset": 1, - "y_offset": -52, + "x": 1, + "y": -52, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_3_4.png", - "x_offset": -30, - "y_offset": -147, + "x": -30, + "y": -147, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_3_5.png", - "x_offset": -15, - "y_offset": -37, + "x": -15, + "y": -37, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_4_1.png", - "x_offset": -20, - "y_offset": -12, + "x": -20, + "y": -12, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_4_2.png", - "x_offset": -22, - "y_offset": -19, + "x": -22, + "y": -19, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_4_3.png", - "x_offset": -28, - "y_offset": -25, + "x": -28, + "y": -25, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_4_4.png", - "x_offset": -6, - "y_offset": -119, + "x": -6, + "y": -119, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_left_4_5.png", - "x_offset": -23, - "y_offset": -29, + "x": -23, + "y": -29, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_1_1.png", - "x_offset": -18, - "y_offset": -12, + "x": -18, + "y": -12, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_1_2.png", - "x_offset": -17, - "y_offset": -19, + "x": -17, + "y": -19, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_1_3.png", - "x_offset": -15, - "y_offset": -25, + "x": -15, + "y": -25, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_1_4.png", - "x_offset": -13, - "y_offset": -119, + "x": -13, + "y": -119, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_1_5.png", - "x_offset": -18, - "y_offset": -29, + "x": -18, + "y": -29, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_2_1.png", - "x_offset": -18, - "y_offset": -2, + "x": -18, + "y": -2, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_2_2.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_2_3.png", - "x_offset": -32, - "y_offset": -52, + "x": -32, + "y": -52, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_2_4.png", - "x_offset": -22, - "y_offset": -147, + "x": -22, + "y": -147, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_2_5.png", - "x_offset": -18, - "y_offset": -37, + "x": -18, + "y": -37, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_3_1.png", - "x_offset": -34, - "y_offset": -9, + "x": -34, + "y": -9, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_3_2.png", - "x_offset": -32, - "y_offset": -28, + "x": -32, + "y": -28, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_3_3.png", - "x_offset": -32, - "y_offset": -83, + "x": -32, + "y": -83, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_3_4.png", - "x_offset": -6, - "y_offset": -142, + "x": -6, + "y": -142, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_3_5.png", - "x_offset": -10, - "y_offset": -37, + "x": -10, + "y": -37, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_4_1.png", - "x_offset": -20, - "y_offset": -28, + "x": -20, + "y": -28, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_4_2.png", - "x_offset": -13, - "y_offset": -45, + "x": -13, + "y": -45, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_4_3.png", - "x_offset": 1, - "y_offset": -70, + "x": 1, + "y": -70, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_4_4.png", - "x_offset": -31, - "y_offset": -115, + "x": -31, + "y": -115, "palette": "keep" }, { "path": "track/raptor/medium_half_loop_right_4_5.png", - "x_offset": -32, - "y_offset": -26, + "x": -32, + "y": -26, "palette": "keep" }, { "path": "track/raptor/large_half_loop_left_1_1.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/large_half_loop_left_1_2.png", - "x_offset": -16, - "y_offset": -36 + "x": -16, + "y": -36 }, { "path": "track/raptor/large_half_loop_left_1_3.png", - "x_offset": -16, - "y_offset": -64 + "x": -16, + "y": -64 }, { "path": "track/raptor/large_half_loop_left_1_4.png", - "x_offset": -20, - "y_offset": -80 + "x": -20, + "y": -80 }, { "path": "track/raptor/large_half_loop_left_1_5.png", - "x_offset": -12, - "y_offset": -65 + "x": -12, + "y": -65 }, { "path": "track/raptor/large_half_loop_left_1_6.png", - "x_offset": -8, - "y_offset": -172 + "x": -8, + "y": -172 }, { "path": "track/raptor/large_half_loop_left_1_7.png", - "x_offset": -18, - "y_offset": -9 + "x": -18, + "y": -9 }, { "path": "track/raptor/large_half_loop_left_2_1.png", - "x_offset": -18, - "y_offset": -1 + "x": -18, + "y": -1 }, { "path": "track/raptor/large_half_loop_left_2_2.png", - "x_offset": -6, - "y_offset": -4 + "x": -6, + "y": -4 }, { "path": "track/raptor/large_half_loop_left_2_3.png", - "x_offset": -9, - "y_offset": -22 + "x": -9, + "y": -22 }, { "path": "track/raptor/large_half_loop_left_2_4.png", - "x_offset": -8, - "y_offset": -69 + "x": -8, + "y": -69 }, { "path": "track/raptor/large_half_loop_left_2_5.png", - "x_offset": -32, - "y_offset": -118 + "x": -32, + "y": -118 }, { "path": "track/raptor/large_half_loop_left_2_6.png", - "x_offset": -22, - "y_offset": -191 + "x": -22, + "y": -191 }, { "path": "track/raptor/large_half_loop_left_2_7.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/large_half_loop_left_3_1.png", - "x_offset": -24, - "y_offset": 1 + "x": -24, + "y": 1 }, { "path": "track/raptor/large_half_loop_left_3_2.png", - "x_offset": -29, - "y_offset": -5 + "x": -29, + "y": -5 }, { "path": "track/raptor/large_half_loop_left_3_3.png", - "x_offset": -24, - "y_offset": -32 + "x": -24, + "y": -32 }, { "path": "track/raptor/large_half_loop_left_3_4.png", - "x_offset": -3, - "y_offset": -56 + "x": -3, + "y": -56 }, { "path": "track/raptor/large_half_loop_left_3_5.png", - "x_offset": -3, - "y_offset": -111 + "x": -3, + "y": -111 }, { "path": "track/raptor/large_half_loop_left_3_6.png", - "x_offset": -19, - "y_offset": -191 + "x": -19, + "y": -191 }, { "path": "track/raptor/large_half_loop_left_3_7.png", - "x_offset": -25, - "y_offset": -21 + "x": -25, + "y": -21 }, { "path": "track/raptor/large_half_loop_left_4_1.png", - "x_offset": -21, - "y_offset": -11 + "x": -21, + "y": -11 }, { "path": "track/raptor/large_half_loop_left_4_2.png", - "x_offset": -27, - "y_offset": -15 + "x": -27, + "y": -15 }, { "path": "track/raptor/large_half_loop_left_4_3.png", - "x_offset": -32, - "y_offset": -40 + "x": -32, + "y": -40 }, { "path": "track/raptor/large_half_loop_left_4_4.png", - "x_offset": -32, - "y_offset": -69 + "x": -32, + "y": -69 }, { "path": "track/raptor/large_half_loop_left_4_5.png", - "x_offset": 20, - "y_offset": -58 + "x": 20, + "y": -58 }, { "path": "track/raptor/large_half_loop_left_4_6.png", - "x_offset": -12, - "y_offset": -176 + "x": -12, + "y": -176 }, { "path": "track/raptor/large_half_loop_left_4_7.png", - "x_offset": -18, - "y_offset": -12 + "x": -18, + "y": -12 }, { "path": "track/raptor/large_half_loop_right_1_1.png", - "x_offset": -18, - "y_offset": -11 + "x": -18, + "y": -11 }, { "path": "track/raptor/large_half_loop_right_1_2.png", - "x_offset": -16, - "y_offset": -15 + "x": -16, + "y": -15 }, { "path": "track/raptor/large_half_loop_right_1_3.png", - "x_offset": -10, - "y_offset": -40 + "x": -10, + "y": -40 }, { "path": "track/raptor/large_half_loop_right_1_4.png", - "x_offset": 0, - "y_offset": -69 + "x": 0, + "y": -69 }, { "path": "track/raptor/large_half_loop_right_1_5.png", - "x_offset": -32, - "y_offset": -58 + "x": -32, + "y": -58 }, { "path": "track/raptor/large_half_loop_right_1_6.png", - "x_offset": -17, - "y_offset": -176 + "x": -17, + "y": -176 }, { "path": "track/raptor/large_half_loop_right_1_7.png", - "x_offset": -18, - "y_offset": -12 + "x": -18, + "y": -12 }, { "path": "track/raptor/large_half_loop_right_2_1.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/large_half_loop_right_2_2.png", - "x_offset": -10, - "y_offset": -5 + "x": -10, + "y": -5 }, { "path": "track/raptor/large_half_loop_right_2_3.png", - "x_offset": -5, - "y_offset": -32 + "x": -5, + "y": -32 }, { "path": "track/raptor/large_half_loop_right_2_4.png", - "x_offset": -14, - "y_offset": -56 + "x": -14, + "y": -56 }, { "path": "track/raptor/large_half_loop_right_2_5.png", - "x_offset": -19, - "y_offset": -111 + "x": -19, + "y": -111 }, { "path": "track/raptor/large_half_loop_right_2_6.png", - "x_offset": -13, - "y_offset": -191 + "x": -13, + "y": -191 }, { "path": "track/raptor/large_half_loop_right_2_7.png", - "x_offset": -18, - "y_offset": -21 + "x": -18, + "y": -21 }, { "path": "track/raptor/large_half_loop_right_3_1.png", - "x_offset": -26, - "y_offset": -1 + "x": -26, + "y": -1 }, { "path": "track/raptor/large_half_loop_right_3_2.png", - "x_offset": -26, - "y_offset": -4 + "x": -26, + "y": -4 }, { "path": "track/raptor/large_half_loop_right_3_3.png", - "x_offset": -28, - "y_offset": -22 + "x": -28, + "y": -22 }, { "path": "track/raptor/large_half_loop_right_3_4.png", - "x_offset": -32, - "y_offset": -69 + "x": -32, + "y": -69 }, { "path": "track/raptor/large_half_loop_right_3_5.png", - "x_offset": 20, - "y_offset": -118 + "x": 20, + "y": -118 }, { "path": "track/raptor/large_half_loop_right_3_6.png", - "x_offset": 0, - "y_offset": -191 + "x": 0, + "y": -191 }, { "path": "track/raptor/large_half_loop_right_3_7.png", - "x_offset": -15, - "y_offset": -21 + "x": -15, + "y": -21 }, { "path": "track/raptor/large_half_loop_right_4_1.png", - "x_offset": -21, - "y_offset": -22 + "x": -21, + "y": -22 }, { "path": "track/raptor/large_half_loop_right_4_2.png", - "x_offset": -22, - "y_offset": -36 + "x": -22, + "y": -36 }, { "path": "track/raptor/large_half_loop_right_4_3.png", - "x_offset": -18, - "y_offset": -64 + "x": -18, + "y": -64 }, { "path": "track/raptor/large_half_loop_right_4_4.png", - "x_offset": -2, - "y_offset": -80 + "x": -2, + "y": -80 }, { "path": "track/raptor/large_half_loop_right_4_5.png", - "x_offset": -3, - "y_offset": -65 + "x": -3, + "y": -65 }, { "path": "track/raptor/large_half_loop_right_4_6.png", - "x_offset": -27, - "y_offset": -172 + "x": -27, + "y": -172 }, { "path": "track/raptor/large_half_loop_right_4_7.png", - "x_offset": -27, - "y_offset": -9 + "x": -27, + "y": -9 }, { "path": "track/raptor/zero_g_roll_left_1_1.png", - "x_offset": -18, - "y_offset": -9, + "x": -18, + "y": -9, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_1_2.png", - "x_offset": 4, - "y_offset": -12, + "x": 4, + "y": -12, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_1_3.png", - "x_offset": -10, - "y_offset": -19, + "x": -10, + "y": -19, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_1_4.png", - "x_offset": -16, - "y_offset": -21, + "x": -16, + "y": -21, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_2_1.png", - "x_offset": -18, - "y_offset": 1, + "x": -18, + "y": 1, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_2_2.png", - "x_offset": -17, - "y_offset": 2, + "x": -17, + "y": 2, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_2_3.png", - "x_offset": -23, - "y_offset": -11, + "x": -23, + "y": -11, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_2_4.png", - "x_offset": -21, - "y_offset": -11, + "x": -21, + "y": -11, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_3_1.png", - "x_offset": -19, - "y_offset": -4, + "x": -19, + "y": -4, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_3_2.png", - "x_offset": -21, - "y_offset": -19, + "x": -21, + "y": -19, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_3_3.png", - "x_offset": 4, - "y_offset": -15, + "x": 4, + "y": -15, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_3_4.png", - "x_offset": -18, - "y_offset": -19, + "x": -18, + "y": -19, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_4_1.png", - "x_offset": -12, - "y_offset": -21, + "x": -12, + "y": -21, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_4_2.png", - "x_offset": -11, - "y_offset": -34, + "x": -11, + "y": -34, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_4_3.png", - "x_offset": 12, - "y_offset": -4, + "x": 12, + "y": -4, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_left_4_4.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_1_1.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_1_2.png", - "x_offset": -25, - "y_offset": -34, + "x": -25, + "y": -34, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_1_3.png", - "x_offset": -22, - "y_offset": -13, + "x": -22, + "y": -13, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_1_4.png", - "x_offset": -24, - "y_offset": -21, + "x": -24, + "y": -21, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_2_1.png", - "x_offset": -18, - "y_offset": -4, + "x": -18, + "y": -4, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_2_2.png", - "x_offset": -15, - "y_offset": -19, + "x": -15, + "y": -19, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_2_3.png", - "x_offset": -12, - "y_offset": -15, + "x": -12, + "y": -15, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_2_4.png", - "x_offset": -11, - "y_offset": -19, + "x": -11, + "y": -19, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_3_1.png", - "x_offset": -9, - "y_offset": 1, + "x": -9, + "y": 1, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_3_2.png", - "x_offset": -9, - "y_offset": 3, + "x": -9, + "y": 3, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_3_3.png", - "x_offset": -11, - "y_offset": -11, + "x": -11, + "y": -11, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_3_4.png", - "x_offset": -18, - "y_offset": -11, + "x": -18, + "y": -11, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_4_1.png", - "x_offset": -20, - "y_offset": -10, + "x": -20, + "y": -10, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_4_2.png", - "x_offset": -27, - "y_offset": -12, + "x": -27, + "y": -12, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_4_3.png", - "x_offset": -22, - "y_offset": -19, + "x": -22, + "y": -19, "palette": "keep" }, { "path": "track/raptor/zero_g_roll_right_4_4.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_1_1.png", - "x_offset": -18, - "y_offset": -42, + "x": -18, + "y": -42, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_1_2.png", - "x_offset": -21, - "y_offset": 0, + "x": -21, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_1_3.png", - "x_offset": -16, - "y_offset": -47, + "x": -16, + "y": -47, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_1_4.png", - "x_offset": -11, - "y_offset": -33, + "x": -11, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_1_5.png", - "x_offset": -14, - "y_offset": -21, + "x": -14, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_2_1.png", - "x_offset": -18, - "y_offset": -36, + "x": -18, + "y": -36, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_2_2.png", - "x_offset": -23, - "y_offset": -24, + "x": -23, + "y": -24, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_2_3.png", - "x_offset": -29, - "y_offset": -18, + "x": -29, + "y": -18, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_2_4.png", - "x_offset": -28, - "y_offset": -12, + "x": -28, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_3_1.png", - "x_offset": -9, - "y_offset": -29, + "x": -9, + "y": -29, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_3_2.png", - "x_offset": -12, - "y_offset": -28, + "x": -12, + "y": -28, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_3_3.png", - "x_offset": -23, - "y_offset": -33, + "x": -23, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_3_4.png", - "x_offset": -24, - "y_offset": -23, + "x": -24, + "y": -23, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_3_5.png", - "x_offset": 7, - "y_offset": -9, + "x": 7, + "y": -9, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_3_6.png", - "x_offset": -18, - "y_offset": -14, + "x": -18, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_4_1.png", - "x_offset": -10, - "y_offset": -42, + "x": -10, + "y": -42, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_4_2.png", - "x_offset": -10, - "y_offset": -43, + "x": -10, + "y": -43, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_4_3.png", - "x_offset": -8, - "y_offset": -28, + "x": -8, + "y": -28, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_4_4.png", - "x_offset": -9, - "y_offset": -33, + "x": -9, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_left_4_5.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_1_1.png", - "x_offset": -18, - "y_offset": -42, + "x": -18, + "y": -42, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_1_2.png", - "x_offset": -28, - "y_offset": -43, + "x": -28, + "y": -43, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_1_3.png", - "x_offset": -29, - "y_offset": -28, + "x": -29, + "y": -28, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_1_4.png", - "x_offset": -18, - "y_offset": -33, + "x": -18, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_1_5.png", - "x_offset": -26, - "y_offset": -21, + "x": -26, + "y": -21, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_2_1.png", - "x_offset": 2, - "y_offset": -29, + "x": 2, + "y": -29, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_2_2.png", - "x_offset": -18, - "y_offset": -28, + "x": -18, + "y": -28, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_2_3.png", - "x_offset": -24, - "y_offset": -33, + "x": -24, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_2_4.png", - "x_offset": -13, - "y_offset": -23, + "x": -13, + "y": -23, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_2_5.png", - "x_offset": -8, - "y_offset": -9, + "x": -8, + "y": -9, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_2_6.png", - "x_offset": -8, - "y_offset": -14, + "x": -8, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_3_1.png", - "x_offset": -14, - "y_offset": -36, + "x": -14, + "y": -36, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_3_2.png", - "x_offset": -6, - "y_offset": -24, + "x": -6, + "y": -24, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_3_3.png", - "x_offset": -4, - "y_offset": -18, + "x": -4, + "y": -18, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_3_4.png", - "x_offset": -18, - "y_offset": -12, + "x": -18, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_4_1.png", - "x_offset": -17, - "y_offset": -42, + "x": -17, + "y": -42, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_4_2.png", - "x_offset": -21, - "y_offset": -47, + "x": -21, + "y": -47, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_4_3.png", - "x_offset": -27, - "y_offset": -47, + "x": -27, + "y": -47, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_4_4.png", - "x_offset": -22, - "y_offset": -33, + "x": -22, + "y": -33, "palette": "keep" }, { "path": "track/raptor/large_zero_g_roll_right_4_5.png", - "x_offset": -18, - "y_offset": -21, + "x": -18, + "y": -21, "palette": "keep" }, { "path": "track/raptor/small_flat_to_steep_up_1.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/small_flat_to_steep_up_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/small_flat_to_steep_up_2_2.png", - "x_offset": -13, - "y_offset": -6 + "x": -13, + "y": -6 }, { "path": "track/raptor/small_flat_to_steep_up_3_1.png", - "x_offset": -3, - "y_offset": 2 + "x": -3, + "y": 2 }, { "path": "track/raptor/small_flat_to_steep_up_3_2.png", - "x_offset": -21, - "y_offset": -6 + "x": -21, + "y": -6 }, { "path": "track/raptor/small_flat_to_steep_up_4.png", - "x_offset": -21, - "y_offset": -22 + "x": -21, + "y": -22 }, { "path": "track/raptor/small_steep_to_flat_up_1.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/small_steep_to_flat_up_2_1.png", - "x_offset": -10, - "y_offset": -10 + "x": -10, + "y": -10 }, { "path": "track/raptor/small_steep_to_flat_up_2_2.png", - "x_offset": -18, - "y_offset": -5 + "x": -18, + "y": -5 }, { "path": "track/raptor/small_steep_to_flat_up_3_1.png", - "x_offset": -18, - "y_offset": -10 + "x": -18, + "y": -10 }, { "path": "track/raptor/small_steep_to_flat_up_3_2.png", - "x_offset": -4, - "y_offset": -5 + "x": -4, + "y": -5 }, { "path": "track/raptor/small_steep_to_flat_up_4.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/small_flat_to_steep_up_diag_1.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_flat_to_steep_up_diag_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/small_flat_to_steep_up_diag_3.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_flat_to_steep_up_diag_4.png", - "x_offset": -3, - "y_offset": -30 + "x": -3, + "y": -30 }, { "path": "track/raptor/small_steep_to_flat_up_diag_1.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_steep_to_flat_up_diag_2.png", - "x_offset": -3, - "y_offset": -10 + "x": -3, + "y": -10 }, { "path": "track/raptor/small_steep_to_flat_up_diag_3.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_steep_to_flat_up_diag_4.png", - "x_offset": -3, - "y_offset": -30 + "x": -3, + "y": -30 }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_1_1.png", - "x_offset": -18, - "y_offset": -13, + "x": -18, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": -8, + "x": -26, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_1_3.png", - "x_offset": 19, - "y_offset": 8, + "x": 19, + "y": 8, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_1_4.png", - "x_offset": -7, - "y_offset": -6, + "x": -7, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_2_1.png", - "x_offset": -18, - "y_offset": -2, + "x": -18, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_2_2.png", - "x_offset": -16, - "y_offset": -6, + "x": -16, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_2_3.png", - "x_offset": -24, - "y_offset": 19, + "x": -24, + "y": 19, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_3_1.png", - "x_offset": -6, - "y_offset": 1, + "x": -6, + "y": 1, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_3_2.png", - "x_offset": 10, - "y_offset": 2, + "x": 10, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_3_3.png", - "x_offset": -27, - "y_offset": 4, + "x": -27, + "y": 4, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_3_4.png", - "x_offset": -3, - "y_offset": -11, + "x": -3, + "y": -11, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_4_1.png", - "x_offset": -23, - "y_offset": -13, + "x": -23, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_4_2.png", - "x_offset": -25, - "y_offset": -4, + "x": -25, + "y": -4, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": -9, + "x": 0, + "y": -9, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_diag_gentle_up_4_4.png", - "x_offset": 0, - "y_offset": -7, + "x": 0, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_1_1.png", - "x_offset": -18, - "y_offset": -13, + "x": -18, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_1_2.png", - "x_offset": -13, - "y_offset": -4, + "x": -13, + "y": -4, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_1_3.png", - "x_offset": -10, - "y_offset": -9, + "x": -10, + "y": -9, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_2_1.png", - "x_offset": -18, - "y_offset": 1, + "x": -18, + "y": 1, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_2_2.png", - "x_offset": -29, - "y_offset": 2, + "x": -29, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_2_3.png", - "x_offset": 19, - "y_offset": 4, + "x": 19, + "y": 4, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_2_4.png", - "x_offset": -10, - "y_offset": -11, + "x": -10, + "y": -11, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_3_1.png", - "x_offset": -16, - "y_offset": -2, + "x": -16, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_3_2.png", - "x_offset": -8, - "y_offset": -6, + "x": -8, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 19, + "x": 0, + "y": 19, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": -7, + "x": 0, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_4_1.png", - "x_offset": -12, - "y_offset": -13, + "x": -12, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_4_2.png", - "x_offset": 5, - "y_offset": -8, + "x": 5, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_4_3.png", - "x_offset": -32, - "y_offset": 8, + "x": -32, + "y": 8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_diag_gentle_up_4_4.png", - "x_offset": -3, - "y_offset": -6, + "x": -3, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -5, + "x": 0, + "y": -5, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -12, + "x": -32, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_1_4.png", - "x_offset": -27, - "y_offset": -14, + "x": -27, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_2_1.png", - "x_offset": -3, - "y_offset": 10, + "x": -3, + "y": 10, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": -4, + "x": 0, + "y": -4, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_2_4.png", - "x_offset": -16, - "y_offset": 0, + "x": -16, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -1, + "x": -32, + "y": -1, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_3_3.png", - "x_offset": -22, - "y_offset": 3, + "x": -22, + "y": 3, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_3_4.png", - "x_offset": -19, - "y_offset": 1, + "x": -19, + "y": 1, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_4_1.png", - "x_offset": -6, - "y_offset": -8, + "x": -6, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_4_3.png", - "x_offset": -19, - "y_offset": -1, + "x": -19, + "y": -1, "palette": "keep" }, { "path": "track/raptor/large_turn_left_to_orthogonal_gentle_up_4_4.png", - "x_offset": -19, - "y_offset": -14, + "x": -19, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -1, + "x": 0, + "y": -1, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_1_4.png", - "x_offset": -14, - "y_offset": 1, + "x": -14, + "y": 1, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_2_1.png", - "x_offset": -3, - "y_offset": 10, + "x": -3, + "y": 10, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_2_3.png", - "x_offset": -16, - "y_offset": -4, + "x": -16, + "y": -4, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_2_4.png", - "x_offset": -19, - "y_offset": 0, + "x": -19, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -5, + "x": -32, + "y": -5, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_3_3.png", - "x_offset": -10, - "y_offset": -12, + "x": -10, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_3_4.png", - "x_offset": -19, - "y_offset": -14, + "x": -19, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_4_1.png", - "x_offset": -3, - "y_offset": -8, + "x": -3, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_4_3.png", - "x_offset": -1, - "y_offset": -1, + "x": -1, + "y": -1, "palette": "keep" }, { "path": "track/raptor/large_turn_right_to_orthogonal_gentle_up_4_4.png", - "x_offset": -19, - "y_offset": -14, + "x": -19, + "y": -14, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -31, - "y_offset": -6, + "x": -31, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -6, + "x": -5, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_left_bank_diag_4.png", - "x_offset": -3, - "y_offset": -23, + "x": -3, + "y": -23, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_diag_2.png", - "x_offset": -3, - "y_offset": -6, + "x": -3, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -29, - "y_offset": -6, + "x": -29, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_to_gentle_up_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -23, + "x": -6, + "y": -23, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_diag_1_1.png", - "x_offset": -14, - "y_offset": -7, + "x": -14, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_diag_1_2.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_diag_2.png", - "x_offset": -5, - "y_offset": -7, + "x": -5, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_diag_3.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_gentle_up_diag_4.png", - "x_offset": -3, - "y_offset": -22, + "x": -3, + "y": -22, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_diag_2.png", - "x_offset": -3, - "y_offset": -7, + "x": -3, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_diag_3_1.png", - "x_offset": -32, - "y_offset": -7, + "x": -32, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_diag_3_2.png", - "x_offset": -31, - "y_offset": 0, + "x": -31, + "y": 0, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_gentle_up_diag_4.png", - "x_offset": -6, - "y_offset": -22, + "x": -6, + "y": -22, "palette": "keep" }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_diag_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_diag_2.png", - "x_offset": -6, - "y_offset": -7, + "x": -6, + "y": -7, "palette": "keep" }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/left_bank_to_gentle_up_left_bank_diag_4.png", - "x_offset": -2, - "y_offset": -15, + "x": -2, + "y": -15, "palette": "keep" }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_diag_2.png", - "x_offset": -2, - "y_offset": -7, + "x": -2, + "y": -7, "palette": "keep" }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_diag_3.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/raptor/right_bank_to_gentle_up_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -15, + "x": -6, + "y": -15, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_diag_1.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_diag_2.png", - "x_offset": -6, - "y_offset": -7, + "x": -6, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_left_bank_diag_4.png", - "x_offset": -2, - "y_offset": -15, + "x": -2, + "y": -15, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_diag_2.png", - "x_offset": -2, - "y_offset": -7, + "x": -2, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_diag_3.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -15, + "x": -6, + "y": -15, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_diag_1.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_diag_2.png", - "x_offset": -6, - "y_offset": -7, + "x": -6, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_diag_4.png", - "x_offset": -2, - "y_offset": -23, + "x": -2, + "y": -23, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_diag_2.png", - "x_offset": -2, - "y_offset": -7, + "x": -2, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_diag_3.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -23, + "x": -6, + "y": -23, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": 7, + "x": -32, + "y": 7, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_left_bank_diag_1_2.png", - "x_offset": -29, - "y_offset": 2, + "x": -29, + "y": 2, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -6, + "x": -5, + "y": -6, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_left_bank_diag_4.png", - "x_offset": -3, - "y_offset": -15, + "x": -3, + "y": -15, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 0, + "x": -32, + "y": 0, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_right_bank_diag_2.png", - "x_offset": -3, - "y_offset": -6, + "x": -3, + "y": -6, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_right_bank_diag_3_1.png", - "x_offset": -29, - "y_offset": 2, + "x": -29, + "y": 2, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/raptor/flat_to_gentle_up_right_bank_diag_4.png", - "x_offset": -6, - "y_offset": -15, + "x": -6, + "y": -15, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_flat_diag_1_1.png", - "x_offset": -9, - "y_offset": 1, + "x": -9, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_flat_diag_1_2.png", - "x_offset": -32, - "y_offset": 6, + "x": -32, + "y": 6, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_flat_diag_2.png", - "x_offset": -5, - "y_offset": -7, + "x": -5, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_flat_diag_3.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_left_bank_to_flat_diag_4.png", - "x_offset": -3, - "y_offset": -14, + "x": -3, + "y": -14, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_flat_diag_1.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_flat_diag_2.png", - "x_offset": -3, - "y_offset": -7, + "x": -3, + "y": -7, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_flat_diag_3_1.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_flat_diag_3_2.png", - "x_offset": -30, - "y_offset": 6, + "x": -30, + "y": 6, "palette": "keep" }, { "path": "track/raptor/gentle_up_right_bank_to_flat_diag_4.png", - "x_offset": -6, - "y_offset": -13, + "x": -6, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_1_1.png", - "x_offset": -17, - "y_offset": -13, + "x": -17, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_1_2.png", - "x_offset": -24, - "y_offset": -24, + "x": -24, + "y": -24, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_1_3.png", - "x_offset": 21, - "y_offset": 8, + "x": 21, + "y": 8, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_1_4.png", - "x_offset": -6, - "y_offset": -6, + "x": -6, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_2_1.png", - "x_offset": -19, - "y_offset": -2, + "x": -19, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_2_2.png", - "x_offset": -16, - "y_offset": -7, + "x": -16, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_2_3.png", - "x_offset": -24, - "y_offset": 19, + "x": -24, + "y": 19, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_2_4.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_3_1.png", - "x_offset": -7, - "y_offset": 0, + "x": -7, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_3_2.png", - "x_offset": 10, - "y_offset": 0, + "x": 10, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_3_3.png", - "x_offset": -28, - "y_offset": 2, + "x": -28, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_3_4.png", - "x_offset": -5, - "y_offset": -12, + "x": -5, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_4_1.png", - "x_offset": -22, - "y_offset": -14, + "x": -22, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_4_2.png", - "x_offset": -24, - "y_offset": -5, + "x": -24, + "y": -5, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": -11, + "x": 0, + "y": -11, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_diag_gentle_up_4_4.png", - "x_offset": 0, - "y_offset": -8, + "x": 0, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_1_1.png", - "x_offset": -19, - "y_offset": -14, + "x": -19, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_1_2.png", - "x_offset": -14, - "y_offset": -5, + "x": -14, + "y": -5, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_1_3.png", - "x_offset": -10, - "y_offset": -11, + "x": -10, + "y": -11, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_1_4.png", - "x_offset": -32, - "y_offset": -8, + "x": -32, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_2_1.png", - "x_offset": -17, - "y_offset": 0, + "x": -17, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_2_2.png", - "x_offset": -28, - "y_offset": 0, + "x": -28, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_2_3.png", - "x_offset": 19, - "y_offset": 2, + "x": 19, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_2_4.png", - "x_offset": -9, - "y_offset": -12, + "x": -9, + "y": -12, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_3_1.png", - "x_offset": -16, - "y_offset": -2, + "x": -16, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_3_2.png", - "x_offset": -8, - "y_offset": -7, + "x": -8, + "y": -7, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_3_3.png", - "x_offset": 0, - "y_offset": 19, + "x": 0, + "y": 19, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": -6, + "x": 0, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_4_1.png", - "x_offset": -13, - "y_offset": -13, + "x": -13, + "y": -13, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_4_2.png", - "x_offset": -1, - "y_offset": -24, + "x": -1, + "y": -24, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_4_3.png", - "x_offset": -32, - "y_offset": 8, + "x": -32, + "y": 8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_diag_gentle_up_4_4.png", - "x_offset": -6, - "y_offset": -6, + "x": -6, + "y": -6, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -4, + "x": 0, + "y": -4, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": -11, + "x": -32, + "y": -11, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_1_4.png", - "x_offset": -26, - "y_offset": -14, + "x": -26, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_2_1.png", - "x_offset": -5, - "y_offset": 9, + "x": -5, + "y": 9, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": -3, + "x": 0, + "y": -3, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_2_4.png", - "x_offset": -16, - "y_offset": 0, + "x": -16, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -2, + "x": -32, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_3_3.png", - "x_offset": -22, - "y_offset": 2, + "x": -22, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_3_4.png", - "x_offset": -20, - "y_offset": 0, + "x": -20, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_4_1.png", - "x_offset": -4, - "y_offset": -8, + "x": -4, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_4_3.png", - "x_offset": -18, - "y_offset": -2, + "x": -18, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_left_bank_to_orthogonal_gentle_up_4_4.png", - "x_offset": -18, - "y_offset": -15, + "x": -18, + "y": -15, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_1_1.png", - "x_offset": 0, - "y_offset": -2, + "x": 0, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_1_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_1_3.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_1_4.png", - "x_offset": -13, - "y_offset": 0, + "x": -13, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_2_1.png", - "x_offset": -2, - "y_offset": 9, + "x": -2, + "y": 9, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_2_3.png", - "x_offset": -16, - "y_offset": -3, + "x": -16, + "y": -3, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_2_4.png", - "x_offset": -18, - "y_offset": 0, + "x": -18, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -4, + "x": -32, + "y": -4, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_3_3.png", - "x_offset": -9, - "y_offset": -11, + "x": -9, + "y": -11, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_3_4.png", - "x_offset": -20, - "y_offset": -14, + "x": -20, + "y": -14, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_4_1.png", - "x_offset": -6, - "y_offset": -8, + "x": -6, + "y": -8, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_4_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_4_3.png", - "x_offset": -3, - "y_offset": -2, + "x": -3, + "y": -2, "palette": "keep" }, { "path": "track/raptor/large_turn_right_bank_to_orthogonal_gentle_up_4_4.png", - "x_offset": -20, - "y_offset": -15, + "x": -20, + "y": -15, "palette": "keep" }, { "path": "track/raptor/flat_lift_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_lift_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_lift_3.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_lift_4.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_lift_1.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/flat_to_gentle_up_lift_2.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_lift_3.png", - "x_offset": -19, - "y_offset": 2 + "x": -19, + "y": 2 }, { "path": "track/raptor/flat_to_gentle_up_lift_4.png", - "x_offset": -19, - "y_offset": -6 + "x": -19, + "y": -6 }, { "path": "track/raptor/gentle_up_to_flat_lift_1.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/gentle_up_to_flat_lift_2.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_flat_lift_3.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_up_to_flat_lift_4.png", - "x_offset": -18, - "y_offset": -6 + "x": -18, + "y": -6 }, { "path": "track/raptor/gentle_lift_1.png", - "x_offset": -18, - "y_offset": -14 + "x": -18, + "y": -14 }, { "path": "track/raptor/gentle_lift_2.png", - "x_offset": -18, - "y_offset": 1 + "x": -18, + "y": 1 }, { "path": "track/raptor/gentle_lift_3.png", - "x_offset": -19, - "y_offset": 1 + "x": -19, + "y": 1 }, { "path": "track/raptor/gentle_lift_4.png", - "x_offset": -19, - "y_offset": -14 + "x": -19, + "y": -14 }, { "path": "track/raptor/gentle_to_steep_up_lift_1.png", - "x_offset": -18, - "y_offset": -30 + "x": -18, + "y": -30 }, { "path": "track/raptor/gentle_to_steep_up_lift_2_1.png", - "x_offset": -18, - "y_offset": -1 + "x": -18, + "y": -1 }, { "path": "track/raptor/gentle_to_steep_up_lift_2_2.png", - "x_offset": -17, - "y_offset": -14 + "x": -17, + "y": -14 }, { "path": "track/raptor/gentle_to_steep_up_lift_3_1.png", - "x_offset": 0, - "y_offset": -1 + "x": 0, + "y": -1 }, { "path": "track/raptor/gentle_to_steep_up_lift_3_2.png", - "x_offset": -21, - "y_offset": -14 + "x": -21, + "y": -14 }, { "path": "track/raptor/gentle_to_steep_up_lift_4.png", - "x_offset": -21, - "y_offset": -30 + "x": -21, + "y": -30 }, { "path": "track/raptor/steep_to_gentle_up_lift_1.png", - "x_offset": -18, - "y_offset": -30 + "x": -18, + "y": -30 }, { "path": "track/raptor/steep_to_gentle_up_lift_2_1.png", - "x_offset": -5, - "y_offset": -15 + "x": -5, + "y": -15 }, { "path": "track/raptor/steep_to_gentle_up_lift_2_2.png", - "x_offset": -18, - "y_offset": -10 + "x": -18, + "y": -10 }, { "path": "track/raptor/steep_to_gentle_up_lift_3_1.png", - "x_offset": -19, - "y_offset": -15 + "x": -19, + "y": -15 }, { "path": "track/raptor/steep_to_gentle_up_lift_3_2.png", - "x_offset": -12, - "y_offset": -10 + "x": -12, + "y": -10 }, { "path": "track/raptor/steep_to_gentle_up_lift_4.png", - "x_offset": -19, - "y_offset": -30 + "x": -19, + "y": -30 }, { "path": "track/raptor/steep_lift_1.png", - "x_offset": -18, - "y_offset": -62 + "x": -18, + "y": -62 }, { "path": "track/raptor/steep_lift_2.png", - "x_offset": -18, - "y_offset": -46 + "x": -18, + "y": -46 }, { "path": "track/raptor/steep_lift_3.png", - "x_offset": -21, - "y_offset": -46 + "x": -21, + "y": -46 }, { "path": "track/raptor/steep_lift_4.png", - "x_offset": -21, - "y_offset": -62 + "x": -21, + "y": -62 }, { "path": "track/raptor/flat_diag_lift_1.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/flat_diag_lift_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/flat_diag_lift_3.png", - "x_offset": -32, - "y_offset": 9 + "x": -32, + "y": 9 }, { "path": "track/raptor/flat_diag_lift_4.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/flat_to_gentle_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/flat_to_gentle_up_diag_lift_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/flat_to_gentle_up_diag_lift_3.png", - "x_offset": -33, - "y_offset": 1 + "x": -33, + "y": 1 }, { "path": "track/raptor/flat_to_gentle_up_diag_lift_4.png", - "x_offset": -3, - "y_offset": -14 + "x": -3, + "y": -14 }, { "path": "track/raptor/gentle_to_flat_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/gentle_to_flat_up_diag_lift_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_to_flat_up_diag_lift_3.png", - "x_offset": -32, - "y_offset": 1 + "x": -32, + "y": 1 }, { "path": "track/raptor/gentle_to_flat_up_diag_lift_4.png", - "x_offset": -3, - "y_offset": -14 + "x": -3, + "y": -14 }, { "path": "track/raptor/gentle_diag_lift_1.png", - "x_offset": -32, - "y_offset": -7 + "x": -32, + "y": -7 }, { "path": "track/raptor/gentle_diag_lift_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_diag_lift_3.png", - "x_offset": -32, - "y_offset": -7 + "x": -32, + "y": -7 }, { "path": "track/raptor/gentle_diag_lift_4.png", - "x_offset": -3, - "y_offset": -22 + "x": -3, + "y": -22 }, { "path": "track/raptor/gentle_to_steep_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/gentle_to_steep_up_diag_lift_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/gentle_to_steep_up_diag_lift_3.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/gentle_to_steep_up_diag_lift_4.png", - "x_offset": -3, - "y_offset": -38 + "x": -3, + "y": -38 }, { "path": "track/raptor/steep_to_gentle_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/steep_to_gentle_up_diag_lift_2.png", - "x_offset": -3, - "y_offset": -11 + "x": -3, + "y": -11 }, { "path": "track/raptor/steep_to_gentle_up_diag_lift_3.png", - "x_offset": -32, - "y_offset": -23 + "x": -32, + "y": -23 }, { "path": "track/raptor/steep_to_gentle_up_diag_lift_4.png", - "x_offset": -3, - "y_offset": -38 + "x": -3, + "y": -38 }, { "path": "track/raptor/steep_diag_lift_1.png", - "x_offset": -32, - "y_offset": -55 + "x": -32, + "y": -55 }, { "path": "track/raptor/steep_diag_lift_2.png", - "x_offset": -3, - "y_offset": -38 + "x": -3, + "y": -38 }, { "path": "track/raptor/steep_diag_lift_3.png", - "x_offset": -32, - "y_offset": -55 + "x": -32, + "y": -55 }, { "path": "track/raptor/steep_diag_lift_4.png", - "x_offset": -3, - "y_offset": -70 + "x": -3, + "y": -70 }, { "path": "track/raptor/small_flat_to_steep_up_lift_1.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/small_flat_to_steep_up_lift_2_1.png", - "x_offset": -18, - "y_offset": 2 + "x": -18, + "y": 2 }, { "path": "track/raptor/small_flat_to_steep_up_lift_2_2.png", - "x_offset": -13, - "y_offset": -6 + "x": -13, + "y": -6 }, { "path": "track/raptor/small_flat_to_steep_up_lift_3_1.png", - "x_offset": -5, - "y_offset": 2 + "x": -5, + "y": 2 }, { "path": "track/raptor/small_flat_to_steep_up_lift_3_2.png", - "x_offset": -21, - "y_offset": -6 + "x": -21, + "y": -6 }, { "path": "track/raptor/small_flat_to_steep_up_lift_4.png", - "x_offset": -21, - "y_offset": -22 + "x": -21, + "y": -22 }, { "path": "track/raptor/small_steep_to_flat_up_lift_1.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/small_steep_to_flat_up_lift_2_1.png", - "x_offset": -10, - "y_offset": -10 + "x": -10, + "y": -10 }, { "path": "track/raptor/small_steep_to_flat_up_lift_2_2.png", - "x_offset": -18, - "y_offset": -5 + "x": -18, + "y": -5 }, { "path": "track/raptor/small_steep_to_flat_up_lift_3_1.png", - "x_offset": -18, - "y_offset": -10 + "x": -18, + "y": -10 }, { "path": "track/raptor/small_steep_to_flat_up_lift_3_2.png", - "x_offset": -4, - "y_offset": -5 + "x": -4, + "y": -5 }, { "path": "track/raptor/small_steep_to_flat_up_lift_4.png", - "x_offset": -18, - "y_offset": -22 + "x": -18, + "y": -22 }, { "path": "track/raptor/small_flat_to_steep_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_flat_to_steep_up_diag_lift_2.png", - "x_offset": -3, - "y_offset": -6 + "x": -3, + "y": -6 }, { "path": "track/raptor/small_flat_to_steep_up_diag_lift_3.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_flat_to_steep_up_diag_lift_4.png", - "x_offset": -3, - "y_offset": -30 + "x": -3, + "y": -30 }, { "path": "track/raptor/small_steep_to_flat_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_steep_to_flat_up_diag_lift_2.png", - "x_offset": -3, - "y_offset": -10 + "x": -3, + "y": -10 }, { "path": "track/raptor/small_steep_to_flat_up_diag_lift_3.png", - "x_offset": -32, - "y_offset": -15 + "x": -32, + "y": -15 }, { "path": "track/raptor/small_steep_to_flat_up_diag_lift_4.png", - "x_offset": -3, - "y_offset": -30 + "x": -3, + "y": -30 }, { "path": "track/alpine/preview_track.png", - "x_offset": 8, - "y_offset": 1 + "x": 8, + "y": 1 }, { "path": "track/alpine/preview_support.png", - "x_offset": 25, - "y_offset": 11 + "x": 25, + "y": 11 }, { "path": "track/alpine/flat_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_4.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/gentle_1.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/gentle_2.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_3.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_4.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/small_turn_left_1_1.png", - "x_offset": -19, - "y_offset": -1, + "x": -19, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_turn_left_1_2.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_turn_left_1_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/small_turn_left_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/small_turn_left_2_2.png", - "x_offset": -2, - "y_offset": 0, + "x": -2, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_left_2_3.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/alpine/small_turn_left_3_1.png", - "x_offset": -4, - "y_offset": 3, + "x": -4, + "y": 3, "palette": "keep" }, { "path": "track/alpine/small_turn_left_3_2.png", - "x_offset": 24, - "y_offset": 1, + "x": 24, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_turn_left_3_3.png", - "x_offset": -8, - "y_offset": -1, + "x": -8, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_turn_left_4_1.png", - "x_offset": -26, - "y_offset": 8, + "x": -26, + "y": 8, "palette": "keep" }, { "path": "track/alpine/small_turn_left_4_2.png", - "x_offset": -8, - "y_offset": 24, + "x": -8, + "y": 24, "palette": "keep" }, { "path": "track/alpine/small_turn_left_4_3.png", - "x_offset": -19, - "y_offset": 8, + "x": -19, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_1_1.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_1_2.png", - "x_offset": -28, - "y_offset": 6, + "x": -28, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_1_3.png", - "x_offset": 9, - "y_offset": 6, + "x": 9, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_1_4.png", - "x_offset": -24, - "y_offset": 9, + "x": -24, + "y": 9, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_1_5.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_2_2.png", - "x_offset": -8, - "y_offset": 0, + "x": -8, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_2_3.png", - "x_offset": -28, - "y_offset": 17, + "x": -28, + "y": 17, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_2_4.png", - "x_offset": -14, - "y_offset": 0, + "x": -14, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_2_5.png", - "x_offset": -30, - "y_offset": 3, + "x": -30, + "y": 3, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_3_1.png", - "x_offset": -14, - "y_offset": 3, + "x": -14, + "y": 3, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_3_2.png", - "x_offset": 11, - "y_offset": 9, + "x": 11, + "y": 9, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_3_3.png", - "x_offset": -22, - "y_offset": 6, + "x": -22, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_3_4.png", - "x_offset": 12, - "y_offset": 6, + "x": 12, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_3_5.png", - "x_offset": -10, - "y_offset": 2, + "x": -10, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_4_1.png", - "x_offset": -22, - "y_offset": 7, + "x": -22, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_4_2.png", - "x_offset": -28, - "y_offset": 17, + "x": -28, + "y": 17, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_4_3.png", - "x_offset": -14, - "y_offset": 1, + "x": -14, + "y": 1, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_4_4.png", - "x_offset": -16, - "y_offset": 17, + "x": -16, + "y": 17, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_4_5.png", - "x_offset": -19, - "y_offset": 7, + "x": -19, + "y": 7, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_1_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_1_2.png", - "x_offset": -26, - "y_offset": 0, + "x": -26, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_1_3.png", - "x_offset": 17, - "y_offset": 12, + "x": 17, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_1_4.png", - "x_offset": -8, - "y_offset": 12, + "x": -8, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_2_2.png", - "x_offset": -10, - "y_offset": 2, + "x": -10, + "y": 2, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_2_3.png", - "x_offset": -20, - "y_offset": 21, + "x": -20, + "y": 21, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_2_4.png", - "x_offset": -28, - "y_offset": 9, + "x": -28, + "y": 9, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_3_1.png", - "x_offset": -16, - "y_offset": 3, + "x": -16, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_3_2.png", - "x_offset": -1, - "y_offset": 7, + "x": -1, + "y": 7, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_3_3.png", - "x_offset": -32, - "y_offset": 11, + "x": -32, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_3_4.png", - "x_offset": -4, - "y_offset": -1, + "x": -4, + "y": -1, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_4_1.png", - "x_offset": -20, - "y_offset": 6, + "x": -20, + "y": 6, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_4_2.png", - "x_offset": -32, - "y_offset": 12, + "x": -32, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_4_3.png", - "x_offset": -3, - "y_offset": 0, + "x": -3, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_4_4.png", - "x_offset": 0, - "y_offset": 10, + "x": 0, + "y": 10, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_1_1.png", - "x_offset": -19, - "y_offset": 6, + "x": -19, + "y": 6, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_1_2.png", - "x_offset": -18, - "y_offset": 12, + "x": -18, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_1_3.png", - "x_offset": -4, - "y_offset": 0, + "x": -4, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_1_4.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_2_2.png", - "x_offset": -22, - "y_offset": 7, + "x": -22, + "y": 7, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_2_3.png", - "x_offset": 23, - "y_offset": 11, + "x": 23, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_2_4.png", - "x_offset": -6, - "y_offset": -1, + "x": -6, + "y": -1, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_3_1.png", - "x_offset": -28, - "y_offset": 3, + "x": -28, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_3_2.png", - "x_offset": -24, - "y_offset": 2, + "x": -24, + "y": 2, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_3_3.png", - "x_offset": -12, - "y_offset": 21, + "x": -12, + "y": 21, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_3_4.png", - "x_offset": 0, - "y_offset": 9, + "x": 0, + "y": 9, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_4_1.png", - "x_offset": -12, - "y_offset": 3, + "x": -12, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_4_2.png", - "x_offset": 1, - "y_offset": 0, + "x": 1, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_4_3.png", - "x_offset": -31, - "y_offset": 12, + "x": -31, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_4_4.png", - "x_offset": -4, - "y_offset": 12, + "x": -4, + "y": 12, "palette": "keep" }, { "path": "track/alpine/flat_diag_1.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/flat_diag_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_diag_3.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/flat_diag_4.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_3.png", - "x_offset": -33, - "y_offset": 2, + "x": -33, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_4.png", - "x_offset": -5, - "y_offset": -12, + "x": -5, + "y": -12, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_3.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_4.png", - "x_offset": -5, - "y_offset": -12, + "x": -5, + "y": -12, "palette": "keep" }, { "path": "track/alpine/gentle_diag_1.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/alpine/gentle_diag_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_diag_3.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/alpine/gentle_diag_4.png", - "x_offset": -5, - "y_offset": -20, + "x": -5, + "y": -20, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_1_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_1_2.png", - "x_offset": -1, - "y_offset": 4, + "x": -1, + "y": 4, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_2_2.png", - "x_offset": -19, - "y_offset": 6, + "x": -19, + "y": 6, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_4.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_1.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_3_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_3_2.png", - "x_offset": -15, - "y_offset": 6, + "x": -15, + "y": 6, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_4_1.png", - "x_offset": -18, - "y_offset": 4, + "x": -18, + "y": 4, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_4_2.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_1_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_1_2.png", - "x_offset": -15, - "y_offset": -1, + "x": -15, + "y": -1, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_2_1.png", - "x_offset": -18, - "y_offset": 4, + "x": -18, + "y": 4, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_2_2.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_3.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_4.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_2.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_3_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_3_2.png", - "x_offset": -5, - "y_offset": 4, + "x": -5, + "y": 4, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_4_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_4_2.png", - "x_offset": -18, - "y_offset": -1, + "x": -18, + "y": -1, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_1_1.png", - "x_offset": -19, - "y_offset": -4, + "x": -19, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_1_2.png", - "x_offset": -1, - "y_offset": -4, + "x": -1, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_2_2.png", - "x_offset": -16, - "y_offset": 6, + "x": -16, + "y": 6, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_3.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_4.png", - "x_offset": -19, - "y_offset": -6, + "x": -19, + "y": -6, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_1.png", - "x_offset": -19, - "y_offset": -6, + "x": -19, + "y": -6, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_2.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_3_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_3_2.png", - "x_offset": -15, - "y_offset": 6, + "x": -15, + "y": 6, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_4_1.png", - "x_offset": -18, - "y_offset": -4, + "x": -18, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_4_2.png", - "x_offset": -19, - "y_offset": -4, + "x": -19, + "y": -4, "palette": "keep" }, { "path": "track/alpine/left_bank_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/left_bank_2.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/left_bank_3.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/left_bank_4.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": 12, + "x": -32, + "y": 12, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/alpine/flat_to_left_bank_diag_4.png", - "x_offset": -4, - "y_offset": -5, + "x": -4, + "y": -5, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_diag_2.png", - "x_offset": -4, - "y_offset": -4, + "x": -4, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": 12, + "x": -32, + "y": 12, "palette": "keep" }, { "path": "track/alpine/flat_to_right_bank_diag_4.png", - "x_offset": -5, - "y_offset": -5, + "x": -5, + "y": -5, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_diag_1_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_diag_1_2.png", - "x_offset": -32, - "y_offset": 7, + "x": -32, + "y": 7, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_diag_2.png", - "x_offset": -5, - "y_offset": -5, + "x": -5, + "y": -5, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_diag_3.png", - "x_offset": -33, - "y_offset": 2, + "x": -33, + "y": 2, "palette": "keep" }, { "path": "track/alpine/left_bank_to_gentle_up_diag_4.png", - "x_offset": -4, - "y_offset": -12, + "x": -4, + "y": -12, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_diag_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_diag_2.png", - "x_offset": -4, - "y_offset": -5, + "x": -4, + "y": -5, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_diag_3_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_diag_3_2.png", - "x_offset": -31, - "y_offset": 7, + "x": -31, + "y": 7, "palette": "keep" }, { "path": "track/alpine/right_bank_to_gentle_up_diag_4.png", - "x_offset": -5, - "y_offset": -12, + "x": -5, + "y": -12, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_diag_1_1.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_diag_1_2.png", - "x_offset": -32, - "y_offset": 4, + "x": -32, + "y": 4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_left_bank_diag_4.png", - "x_offset": -4, - "y_offset": -13, + "x": -4, + "y": -13, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_diag_1.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_diag_2.png", - "x_offset": -4, - "y_offset": -4, + "x": -4, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_diag_3_1.png", - "x_offset": -32, - "y_offset": 3, + "x": -32, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_diag_3_2.png", - "x_offset": -32, - "y_offset": 4, + "x": -32, + "y": 4, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_right_bank_diag_4.png", - "x_offset": -5, - "y_offset": -13, + "x": -5, + "y": -13, "palette": "keep" }, { "path": "track/alpine/left_bank_diag_1.png", - "x_offset": -32, - "y_offset": 11, + "x": -32, + "y": 11, "palette": "keep" }, { "path": "track/alpine/left_bank_diag_2.png", - "x_offset": -5, - "y_offset": -5, + "x": -5, + "y": -5, "palette": "keep" }, { "path": "track/alpine/left_bank_diag_3.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/alpine/left_bank_diag_4.png", - "x_offset": -4, - "y_offset": -5, + "x": -4, + "y": -5, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_1_1.png", - "x_offset": -19, - "y_offset": -1, + "x": -19, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_1_2.png", - "x_offset": -15, - "y_offset": 4, + "x": -15, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_1_3.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_1_4.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_2_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_2_2.png", - "x_offset": -2, - "y_offset": 0, + "x": -2, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_2_3.png", - "x_offset": -32, - "y_offset": 4, + "x": -32, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_3_1.png", - "x_offset": -5, - "y_offset": 2, + "x": -5, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_3_2.png", - "x_offset": 23, - "y_offset": 1, + "x": 23, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_3_3.png", - "x_offset": -7, - "y_offset": -1, + "x": -7, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_3_4.png", - "x_offset": -6, - "y_offset": 4, + "x": -6, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_4_1.png", - "x_offset": -28, - "y_offset": 7, + "x": -28, + "y": 7, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_4_2.png", - "x_offset": -8, - "y_offset": 23, + "x": -8, + "y": 23, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_4_3.png", - "x_offset": -19, - "y_offset": 7, + "x": -19, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_1_1.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_1_2.png", - "x_offset": -15, - "y_offset": 4, + "x": -15, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_1_3.png", - "x_offset": -26, - "y_offset": 6, + "x": -26, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_1_4.png", - "x_offset": 11, - "y_offset": 6, + "x": 11, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_1_5.png", - "x_offset": -25, - "y_offset": 8, + "x": -25, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_1_6.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_2_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_2_2.png", - "x_offset": -8, - "y_offset": 1, + "x": -8, + "y": 1, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_2_3.png", - "x_offset": -24, - "y_offset": 19, + "x": -24, + "y": 19, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_2_4.png", - "x_offset": -14, - "y_offset": 1, + "x": -14, + "y": 1, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_2_5.png", - "x_offset": -28, - "y_offset": 4, + "x": -28, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_3_1.png", - "x_offset": -14, - "y_offset": 2, + "x": -14, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_3_2.png", - "x_offset": 11, - "y_offset": 8, + "x": 11, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_3_3.png", - "x_offset": -22, - "y_offset": 6, + "x": -22, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_3_4.png", - "x_offset": 13, - "y_offset": 6, + "x": 13, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_3_5.png", - "x_offset": -9, - "y_offset": 2, + "x": -9, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_3_6.png", - "x_offset": -10, - "y_offset": 4, + "x": -10, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_4_1.png", - "x_offset": -24, - "y_offset": 6, + "x": -24, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_4_2.png", - "x_offset": -30, - "y_offset": 16, + "x": -30, + "y": 16, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_4_3.png", - "x_offset": -16, - "y_offset": 0, + "x": -16, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_4_4.png", - "x_offset": -18, - "y_offset": 16, + "x": -18, + "y": 16, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_bank_4_5.png", - "x_offset": -19, - "y_offset": 6, + "x": -19, + "y": 6, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_1_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_1_2.png", - "x_offset": -24, - "y_offset": 0, + "x": -24, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_1_3.png", - "x_offset": 19, - "y_offset": 12, + "x": 19, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_1_4.png", - "x_offset": -13, - "y_offset": 11, + "x": -13, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_2_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_2_2.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_2_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_2_4.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_3_1.png", - "x_offset": -17, - "y_offset": 2, + "x": -17, + "y": 2, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_3_2.png", - "x_offset": -2, - "y_offset": 7, + "x": -2, + "y": 7, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_3_3.png", - "x_offset": -32, - "y_offset": 11, + "x": -32, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_3_4.png", - "x_offset": -4, - "y_offset": -1, + "x": -4, + "y": -1, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_4_1.png", - "x_offset": -22, - "y_offset": 6, + "x": -22, + "y": 6, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_4_2.png", - "x_offset": -32, - "y_offset": 11, + "x": -32, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_4_3.png", - "x_offset": -4, - "y_offset": 0, + "x": -4, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_left_to_diag_bank_4_4.png", - "x_offset": 0, - "y_offset": 9, + "x": 0, + "y": 9, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_1_1.png", - "x_offset": -19, - "y_offset": 6, + "x": -19, + "y": 6, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_1_2.png", - "x_offset": -20, - "y_offset": 11, + "x": -20, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_1_3.png", - "x_offset": -6, - "y_offset": 0, + "x": -6, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_1_4.png", - "x_offset": -32, - "y_offset": 9, + "x": -32, + "y": 9, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_2_1.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_2_2.png", - "x_offset": -22, - "y_offset": 7, + "x": -22, + "y": 7, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_2_3.png", - "x_offset": 23, - "y_offset": 11, + "x": 23, + "y": 11, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_2_4.png", - "x_offset": -6, - "y_offset": -1, + "x": -6, + "y": -1, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_3_1.png", - "x_offset": -26, - "y_offset": 4, + "x": -26, + "y": 4, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_3_2.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_3_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_3_4.png", - "x_offset": 0, - "y_offset": 10, + "x": 0, + "y": 10, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_4_1.png", - "x_offset": -25, - "y_offset": -10, + "x": -25, + "y": -10, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_4_2.png", - "x_offset": 1, - "y_offset": 0, + "x": 1, + "y": 0, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_4_3.png", - "x_offset": -31, - "y_offset": 12, + "x": -31, + "y": 12, "palette": "keep" }, { "path": "track/alpine/large_turn_right_to_diag_bank_4_4.png", - "x_offset": -4, - "y_offset": 11, + "x": -4, + "y": 11, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_1_1.png", - "x_offset": -25, - "y_offset": -30, + "x": -25, + "y": -30, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_1_2.png", - "x_offset": -13, - "y_offset": -16, + "x": -13, + "y": -16, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_2_1.png", - "x_offset": -13, - "y_offset": -7, + "x": -13, + "y": -7, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_2_2.png", - "x_offset": -38, - "y_offset": -16, + "x": -38, + "y": -16, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_3_1.png", - "x_offset": -14, - "y_offset": 0, + "x": -14, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_3_2.png", - "x_offset": -2, - "y_offset": -5, + "x": -2, + "y": -5, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -11, + "x": -26, + "y": -11, "palette": "keep" }, { "path": "track/alpine/small_turn_left_gentle_up_4_2.png", - "x_offset": -25, - "y_offset": -1, + "x": -25, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_1_1.png", - "x_offset": -25, - "y_offset": -11, + "x": -25, + "y": -11, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": -1, + "x": -26, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_2_1.png", - "x_offset": -13, - "y_offset": 0, + "x": -13, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_2_2.png", - "x_offset": -25, - "y_offset": -5, + "x": -25, + "y": -5, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": -7, + "x": -38, + "y": -7, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_3_2.png", - "x_offset": -13, - "y_offset": -16, + "x": -13, + "y": -16, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_4_1.png", - "x_offset": -2, - "y_offset": -23, + "x": -2, + "y": -23, "palette": "keep" }, { "path": "track/alpine/small_turn_right_gentle_up_4_2.png", - "x_offset": -14, - "y_offset": -16, + "x": -14, + "y": -16, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_1_1.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_1_2.png", - "x_offset": -28, - "y_offset": -9, + "x": -28, + "y": -9, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_1_4.png", - "x_offset": -26, - "y_offset": -6, + "x": -26, + "y": -6, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_1_5.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_2_1.png", - "x_offset": -19, - "y_offset": -4, + "x": -19, + "y": -4, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": -13, + "x": 0, + "y": -13, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": 2, + "x": 0, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_2_4.png", - "x_offset": -12, - "y_offset": -20, + "x": -12, + "y": -20, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_2_5.png", - "x_offset": -17, - "y_offset": -13, + "x": -17, + "y": -13, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_3_1.png", - "x_offset": -22, - "y_offset": 3, + "x": -22, + "y": 3, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_3_3.png", - "x_offset": -20, - "y_offset": 8, + "x": -20, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_3_4.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_3_5.png", - "x_offset": -13, - "y_offset": 2, + "x": -13, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_4_1.png", - "x_offset": -24, - "y_offset": -11, + "x": -24, + "y": -11, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_4_2.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_4_3.png", - "x_offset": -17, - "y_offset": -11, + "x": -17, + "y": -11, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_4_4.png", - "x_offset": -16, - "y_offset": 5, + "x": -16, + "y": 5, "palette": "keep" }, { "path": "track/alpine/medium_turn_left_gentle_up_4_5.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_1_1.png", - "x_offset": -19, - "y_offset": -11, + "x": -19, + "y": -11, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_1_2.png", - "x_offset": -11, - "y_offset": 2, + "x": -11, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_1_3.png", - "x_offset": 0, - "y_offset": -11, + "x": 0, + "y": -11, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_1_4.png", - "x_offset": -16, - "y_offset": 5, + "x": -16, + "y": 5, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_1_5.png", - "x_offset": -18, - "y_offset": 2, + "x": -18, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_2_3.png", - "x_offset": 0, - "y_offset": 8, + "x": 0, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_2_4.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_2_5.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_3_1.png", - "x_offset": -32, - "y_offset": -4, + "x": -32, + "y": -4, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_3_2.png", - "x_offset": -32, - "y_offset": -13, + "x": -32, + "y": -13, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_3_3.png", - "x_offset": -25, - "y_offset": 1, + "x": -25, + "y": 1, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_3_4.png", - "x_offset": -21, - "y_offset": -22, + "x": -21, + "y": -22, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_3_5.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_4_1.png", - "x_offset": -11, - "y_offset": -11, + "x": -11, + "y": -11, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_4_2.png", - "x_offset": 11, - "y_offset": -9, + "x": 11, + "y": -9, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_4_3.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_4_4.png", - "x_offset": 10, - "y_offset": -5, + "x": 10, + "y": -5, "palette": "keep" }, { "path": "track/alpine/medium_turn_right_gentle_up_4_5.png", - "x_offset": -14, - "y_offset": -13, + "x": -14, + "y": -13, "palette": "keep" }, { "path": "track/alpine/s_bend_left_1_1.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/s_bend_left_1_2.png", - "x_offset": -26, - "y_offset": 6, + "x": -26, + "y": 6, "palette": "keep" }, { "path": "track/alpine/s_bend_left_1_3.png", - "x_offset": 10, - "y_offset": 8, + "x": 10, + "y": 8, "palette": "keep" }, { "path": "track/alpine/s_bend_left_1_4.png", - "x_offset": -15, - "y_offset": 3, + "x": -15, + "y": 3, "palette": "keep" }, { "path": "track/alpine/s_bend_left_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/s_bend_left_2_2.png", - "x_offset": -10, - "y_offset": 1, + "x": -10, + "y": 1, "palette": "keep" }, { "path": "track/alpine/s_bend_left_2_3.png", - "x_offset": -28, - "y_offset": 17, + "x": -28, + "y": 17, "palette": "keep" }, { "path": "track/alpine/s_bend_left_2_4.png", - "x_offset": -20, - "y_offset": 6, + "x": -20, + "y": 6, "palette": "keep" }, { "path": "track/alpine/s_bend_right_1_1.png", - "x_offset": -19, - "y_offset": 6, + "x": -19, + "y": 6, "palette": "keep" }, { "path": "track/alpine/s_bend_right_1_2.png", - "x_offset": -18, - "y_offset": 17, + "x": -18, + "y": 17, "palette": "keep" }, { "path": "track/alpine/s_bend_right_1_3.png", - "x_offset": -14, - "y_offset": 1, + "x": -14, + "y": 1, "palette": "keep" }, { "path": "track/alpine/s_bend_right_1_4.png", - "x_offset": -30, - "y_offset": 3, + "x": -30, + "y": 3, "palette": "keep" }, { "path": "track/alpine/s_bend_right_2_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/s_bend_right_2_2.png", - "x_offset": -24, - "y_offset": 8, + "x": -24, + "y": 8, "palette": "keep" }, { "path": "track/alpine/s_bend_right_2_3.png", - "x_offset": 12, - "y_offset": 6, + "x": 12, + "y": 6, "palette": "keep" }, { "path": "track/alpine/s_bend_right_2_4.png", - "x_offset": -12, - "y_offset": 2, + "x": -12, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_1_1.png", - "x_offset": -18, - "y_offset": -1, + "x": -18, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_1_2.png", - "x_offset": -15, - "y_offset": 1, + "x": -15, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_1_3.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_1_4.png", - "x_offset": -19, - "y_offset": -6, + "x": -19, + "y": -6, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_2_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_2_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_2_3.png", - "x_offset": -32, - "y_offset": -4, + "x": -32, + "y": -4, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_3_1.png", - "x_offset": -6, - "y_offset": 1, + "x": -6, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_3_2.png", - "x_offset": 23, - "y_offset": 1, + "x": 23, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_3_3.png", - "x_offset": -5, - "y_offset": -1, + "x": -5, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_3_4.png", - "x_offset": -5, - "y_offset": 0, + "x": -5, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_4_1.png", - "x_offset": -26, - "y_offset": 4, + "x": -26, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_4_2.png", - "x_offset": -8, - "y_offset": 19, + "x": -8, + "y": 19, "palette": "keep" }, { "path": "track/alpine/small_helix_left_up_4_3.png", - "x_offset": -18, - "y_offset": 3, + "x": -18, + "y": 3, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_1_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_1_2.png", - "x_offset": -6, - "y_offset": 19, + "x": -6, + "y": 19, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_1_3.png", - "x_offset": -26, - "y_offset": 3, + "x": -26, + "y": 3, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_2_1.png", - "x_offset": -19, - "y_offset": 1, + "x": -19, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_2_2.png", - "x_offset": -32, - "y_offset": 1, + "x": -32, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_2_3.png", - "x_offset": -19, - "y_offset": -1, + "x": -19, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_2_4.png", - "x_offset": -16, - "y_offset": 0, + "x": -16, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_3_1.png", - "x_offset": -32, - "y_offset": 4, + "x": -32, + "y": 4, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_3_2.png", - "x_offset": 0, - "y_offset": 0, + "x": 0, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_3_3.png", - "x_offset": -19, - "y_offset": -4, + "x": -19, + "y": -4, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_4_1.png", - "x_offset": -6, - "y_offset": -1, + "x": -6, + "y": -1, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_4_2.png", - "x_offset": -6, - "y_offset": 1, + "x": -6, + "y": 1, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_4_3.png", - "x_offset": 23, - "y_offset": 0, + "x": 23, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_helix_right_up_4_4.png", - "x_offset": -7, - "y_offset": -6, + "x": -7, + "y": -6, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_1_1.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_1_2.png", - "x_offset": -15, - "y_offset": 4, + "x": -15, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_1_3.png", - "x_offset": -28, - "y_offset": 7, + "x": -28, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_1_4.png", - "x_offset": 9, - "y_offset": 6, + "x": 9, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_1_5.png", - "x_offset": -22, - "y_offset": 7, + "x": -22, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_1_6.png", - "x_offset": -19, - "y_offset": -6, + "x": -19, + "y": -6, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_2_1.png", - "x_offset": -19, - "y_offset": 4, + "x": -19, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_2_2.png", - "x_offset": -4, - "y_offset": 0, + "x": -4, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_2_3.png", - "x_offset": -32, - "y_offset": 12, + "x": -32, + "y": 12, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_2_4.png", - "x_offset": 1, - "y_offset": 0, + "x": 1, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_2_5.png", - "x_offset": -32, - "y_offset": -4, + "x": -32, + "y": -4, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_3_1.png", - "x_offset": -16, - "y_offset": 1, + "x": -16, + "y": 1, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_3_2.png", - "x_offset": 10, - "y_offset": 8, + "x": 10, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_3_3.png", - "x_offset": -21, - "y_offset": 6, + "x": -21, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_3_4.png", - "x_offset": 15, - "y_offset": 7, + "x": 15, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_3_5.png", - "x_offset": -3, - "y_offset": 0, + "x": -3, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_3_6.png", - "x_offset": -7, - "y_offset": 2, + "x": -7, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_4_1.png", - "x_offset": -20, - "y_offset": 5, + "x": -20, + "y": 5, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_4_2.png", - "x_offset": -30, - "y_offset": 13, + "x": -30, + "y": 13, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_4_3.png", - "x_offset": -8, - "y_offset": -4, + "x": -8, + "y": -4, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_4_4.png", - "x_offset": -26, - "y_offset": 12, + "x": -26, + "y": 12, "palette": "keep" }, { "path": "track/alpine/medium_helix_left_up_4_5.png", - "x_offset": -18, - "y_offset": 2, + "x": -18, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_1_1.png", - "x_offset": -19, - "y_offset": 5, + "x": -19, + "y": 5, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_1_2.png", - "x_offset": -20, - "y_offset": 13, + "x": -20, + "y": 13, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_1_3.png", - "x_offset": -8, - "y_offset": -4, + "x": -8, + "y": -4, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_1_4.png", - "x_offset": -30, - "y_offset": 12, + "x": -30, + "y": 12, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_1_5.png", - "x_offset": -14, - "y_offset": 2, + "x": -14, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_2_1.png", - "x_offset": -19, - "y_offset": 1, + "x": -19, + "y": 1, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_2_2.png", - "x_offset": -24, - "y_offset": 8, + "x": -24, + "y": 8, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_2_3.png", - "x_offset": 5, - "y_offset": 6, + "x": 5, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_2_4.png", - "x_offset": -30, - "y_offset": 7, + "x": -30, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_2_5.png", - "x_offset": -19, - "y_offset": 0, + "x": -19, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_2_6.png", - "x_offset": -15, - "y_offset": 2, + "x": -15, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_3_1.png", - "x_offset": -32, - "y_offset": 4, + "x": -32, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_3_2.png", - "x_offset": -6, - "y_offset": 0, + "x": -6, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_3_3.png", - "x_offset": -32, - "y_offset": 12, + "x": -32, + "y": 12, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_3_4.png", - "x_offset": -2, - "y_offset": 0, + "x": -2, + "y": 0, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_3_5.png", - "x_offset": -19, - "y_offset": -4, + "x": -19, + "y": -4, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_4_1.png", - "x_offset": -8, - "y_offset": 2, + "x": -8, + "y": 2, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_4_2.png", - "x_offset": -8, - "y_offset": 4, + "x": -8, + "y": 4, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_4_3.png", - "x_offset": 15, - "y_offset": 7, + "x": 15, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_4_4.png", - "x_offset": -21, - "y_offset": 6, + "x": -21, + "y": 6, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_4_5.png", - "x_offset": 10, - "y_offset": 7, + "x": 10, + "y": 7, "palette": "keep" }, { "path": "track/alpine/medium_helix_right_up_4_6.png", - "x_offset": -17, - "y_offset": -6, + "x": -17, + "y": -6, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_1_1.png", - "x_offset": -24, - "y_offset": -14, + "x": -24, + "y": -14, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_1_2.png", - "x_offset": -13, - "y_offset": -8, + "x": -13, + "y": -8, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_2_1.png", - "x_offset": -10, - "y_offset": 0, + "x": -10, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_2_2.png", - "x_offset": -12, - "y_offset": 0, + "x": -12, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_2_3.png", - "x_offset": -38, - "y_offset": -8, + "x": -38, + "y": -8, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_3_1.png", - "x_offset": -15, - "y_offset": -2, + "x": -15, + "y": -2, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_3_2.png", - "x_offset": -3, - "y_offset": 2, + "x": -3, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_4_1.png", - "x_offset": -26, - "y_offset": -4, + "x": -26, + "y": -4, "palette": "keep" }, { "path": "track/alpine/small_turn_left_bank_to_gentle_up_4_2.png", - "x_offset": -25, - "y_offset": 7, + "x": -25, + "y": 7, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_1_1.png", - "x_offset": -24, - "y_offset": -4, + "x": -24, + "y": -4, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_1_2.png", - "x_offset": -26, - "y_offset": 7, + "x": -26, + "y": 7, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_2_1.png", - "x_offset": -12, - "y_offset": -2, + "x": -12, + "y": -2, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_2_2.png", - "x_offset": -25, - "y_offset": 2, + "x": -25, + "y": 2, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_3_1.png", - "x_offset": -38, - "y_offset": 0, + "x": -38, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_3_2.png", - "x_offset": -38, - "y_offset": 0, + "x": -38, + "y": 0, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_3_3.png", - "x_offset": -13, - "y_offset": -8, + "x": -13, + "y": -8, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_4_1.png", - "x_offset": -2, - "y_offset": -14, + "x": -2, + "y": -14, "palette": "keep" }, { "path": "track/alpine/small_turn_right_bank_to_gentle_up_4_2.png", - "x_offset": -15, - "y_offset": -8, + "x": -15, + "y": -8, "palette": "keep" }, { "path": "track/alpine/flat_lift_1.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_lift_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_lift_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_lift_4.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_lift_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_lift_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_lift_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_lift_4.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_lift_1.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_lift_2.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_lift_3.png", - "x_offset": -19, - "y_offset": 3, + "x": -19, + "y": 3, "palette": "keep" }, { "path": "track/alpine/gentle_up_to_flat_lift_4.png", - "x_offset": -19, - "y_offset": -5, + "x": -19, + "y": -5, "palette": "keep" }, { "path": "track/alpine/gentle_lift_1.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/gentle_lift_2.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_lift_3.png", - "x_offset": -19, - "y_offset": 2, + "x": -19, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_lift_4.png", - "x_offset": -19, - "y_offset": -13, + "x": -19, + "y": -13, "palette": "keep" }, { "path": "track/alpine/flat_diag_lift_1.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/flat_diag_lift_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_diag_lift_3.png", - "x_offset": -32, - "y_offset": 10, + "x": -32, + "y": 10, "palette": "keep" }, { "path": "track/alpine/flat_diag_lift_4.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_lift_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_lift_3.png", - "x_offset": -33, - "y_offset": 2, + "x": -33, + "y": 2, "palette": "keep" }, { "path": "track/alpine/flat_to_gentle_up_diag_lift_4.png", - "x_offset": -5, - "y_offset": -12, + "x": -5, + "y": -12, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_lift_1.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_lift_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_lift_3.png", - "x_offset": -32, - "y_offset": 2, + "x": -32, + "y": 2, "palette": "keep" }, { "path": "track/alpine/gentle_to_flat_up_diag_lift_4.png", - "x_offset": -5, - "y_offset": -12, + "x": -5, + "y": -12, "palette": "keep" }, { "path": "track/alpine/gentle_diag_lift_1.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/alpine/gentle_diag_lift_2.png", - "x_offset": -5, - "y_offset": -4, + "x": -5, + "y": -4, "palette": "keep" }, { "path": "track/alpine/gentle_diag_lift_3.png", - "x_offset": -32, - "y_offset": -6, + "x": -32, + "y": -6, "palette": "keep" }, { "path": "track/alpine/gentle_diag_lift_4.png", - "x_offset": -5, - "y_offset": -20, + "x": -5, + "y": -20, "palette": "keep" }, { "path": "icons/medium-curve-left.png", - "x_offset": 2, - "y_offset": 6 + "x": 2, + "y": 6 }, { "path": "icons/medium-curve-right.png", - "x_offset": 1, - "y_offset": 6 + "x": 1, + "y": 6 } ] diff --git a/src/openrct2/CommandLineSprite.cpp b/src/openrct2/CommandLineSprite.cpp index 6e7780f97f..fa8d1c2138 100644 --- a/src/openrct2/CommandLineSprite.cpp +++ b/src/openrct2/CommandLineSprite.cpp @@ -579,8 +579,8 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) } std::string strPath = Json::GetString(path); - json_t x_offset = jsonSprite["x_offset"]; - json_t y_offset = jsonSprite["y_offset"]; + json_t x_offset = jsonSprite["x"]; + json_t y_offset = jsonSprite["y"]; auto palette = (Json::GetString(jsonSprite["palette"]) == "keep") ? ImageImporter::Palette::KeepIndices : ImageImporter::Palette::OpenRCT2; From 3f81a491b0ac9cc45730ae42fbd3194abe51aa2d Mon Sep 17 00:00:00 2001 From: CoryY <39840572+CoryfY@users.noreply.github.com> Date: Sun, 17 Mar 2024 02:37:46 -0400 Subject: [PATCH 081/191] Close #21569: Remove 'Window' from Window Open function names (#21613) * Close #21569: Remove 'Window' from Window Open function names Windows are all under the OpenRCT2::Ui::Windows namespace. As such, "Window" is removed from the Open functions names. * Update Contributors.md * Fix formatting TrackMangeOpen Co-authored-by: Tulio Leao * Fix formatting TrackPlaceOpen Co-authored-by: Tulio Leao --------- Co-authored-by: Tulio Leao --- contributors.md | 1 + src/openrct2-ui/WindowManager.cpp | 170 +++++++++--------- src/openrct2-ui/input/Shortcuts.cpp | 2 +- src/openrct2-ui/scripting/ScUi.hpp | 6 +- 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/EditorScenarioOptions.cpp | 2 +- src/openrct2-ui/windows/Error.cpp | 6 +- src/openrct2-ui/windows/Finances.cpp | 6 +- src/openrct2-ui/windows/Footpath.cpp | 2 +- src/openrct2-ui/windows/GameBottomToolbar.cpp | 2 +- src/openrct2-ui/windows/Guest.cpp | 4 +- src/openrct2-ui/windows/GuestList.cpp | 8 +- 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 | 4 +- src/openrct2-ui/windows/MazeConstruction.cpp | 2 +- src/openrct2-ui/windows/Multiplayer.cpp | 4 +- src/openrct2-ui/windows/NetworkStatus.cpp | 4 +- src/openrct2-ui/windows/NewCampaign.cpp | 2 +- src/openrct2-ui/windows/NewRide.cpp | 6 +- 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 | 10 +- src/openrct2-ui/windows/PatrolArea.cpp | 2 +- src/openrct2-ui/windows/Player.cpp | 2 +- .../windows/RefurbishRidePrompt.cpp | 2 +- src/openrct2-ui/windows/Research.cpp | 2 +- src/openrct2-ui/windows/Ride.cpp | 10 +- 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 | 6 +- src/openrct2-ui/windows/Scenery.cpp | 4 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- src/openrct2-ui/windows/ServerList.cpp | 2 +- src/openrct2-ui/windows/ServerStart.cpp | 4 +- src/openrct2-ui/windows/ShortcutKeys.cpp | 2 +- src/openrct2-ui/windows/Sign.cpp | 4 +- src/openrct2-ui/windows/Staff.cpp | 4 +- src/openrct2-ui/windows/StaffFirePrompt.cpp | 2 +- src/openrct2-ui/windows/StaffList.cpp | 4 +- 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 | 4 +- src/openrct2-ui/windows/TitleMenu.cpp | 4 +- src/openrct2-ui/windows/TitleOptions.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 | 4 +- src/openrct2-ui/windows/Water.cpp | 2 +- src/openrct2-ui/windows/Window.h | 168 ++++++++--------- src/openrct2/network/NetworkBase.cpp | 2 +- 75 files changed, 274 insertions(+), 275 deletions(-) diff --git a/contributors.md b/contributors.md index e83a06460b..a85cd73001 100644 --- a/contributors.md +++ b/contributors.md @@ -235,6 +235,7 @@ Appreciation for contributors who have provided substantial work, but are no lon * Aram Kazorian (aramk-hub) * Harry Hopkinson (Harry-Hopkinson) * Jan Kelemen (jan-kelemen) +* Cory Ye (CoryfY) ## Toolchain * (Balletie) - macOS diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 5d47c35b3f..7c98b8b031 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -44,101 +44,101 @@ public: switch (wc) { case WindowClass::About: - return WindowAboutOpen(); + return AboutOpen(); case WindowClass::BottomToolbar: - return WindowGameBottomToolbarOpen(); + return GameBottomToolbarOpen(); case WindowClass::Changelog: return OpenView(WV_CHANGELOG); case WindowClass::Cheats: - return WindowCheatsOpen(); + return CheatsOpen(); case WindowClass::ClearScenery: - return WindowClearSceneryOpen(); + return ClearSceneryOpen(); case WindowClass::CustomCurrencyConfig: - return CustomCurrencyWindowOpen(); + return CustomCurrencyOpen(); case WindowClass::DebugPaint: - return WindowDebugPaintOpen(); + return DebugPaintOpen(); case WindowClass::EditorInventionList: - return WindowEditorInventionsListOpen(); + return EditorInventionsListOpen(); case WindowClass::EditorObjectSelection: - return WindowEditorObjectSelectionOpen(); + return EditorObjectSelectionOpen(); case WindowClass::EditorObjectiveOptions: - return WindowEditorObjectiveOptionsOpen(); + return EditorObjectiveOptionsOpen(); case WindowClass::EditorScenarioOptions: - return WindowEditorScenarioOptionsOpen(); + return EditorScenarioOptionsOpen(); case WindowClass::Finances: - return WindowFinancesOpen(); + return FinancesOpen(); case WindowClass::Footpath: - return WindowFootpathOpen(); + return FootpathOpen(); case WindowClass::GuestList: - return WindowGuestListOpen(); + return GuestListOpen(); case WindowClass::Land: - return WindowLandOpen(); + return LandOpen(); case WindowClass::LandRights: - return WindowLandRightsOpen(); + return LandRightsOpen(); case WindowClass::MainWindow: - return WindowMainOpen(); + return MainOpen(); case WindowClass::Map: - return WindowMapOpen(); + return MapOpen(); case WindowClass::Mapgen: - return WindowMapgenOpen(); + return MapgenOpen(); case WindowClass::Multiplayer: - return WindowMultiplayerOpen(); + return MultiplayerOpen(); case WindowClass::ConstructRide: - return WindowNewRideOpen(); + return NewRideOpen(); case WindowClass::ParkInformation: - return WindowParkEntranceOpen(); + return ParkEntranceOpen(); case WindowClass::RecentNews: - return WindowNewsOpen(); + return NewsOpen(); case WindowClass::RideConstruction: - return WindowRideConstructionOpen(); + return RideConstructionOpen(); case WindowClass::Research: - return WindowResearchOpen(); + return ResearchOpen(); case WindowClass::RideList: - return WindowRideListOpen(); + return RideListOpen(); case WindowClass::NotificationOptions: - return WindowNewsOptionsOpen(); + return NewsOptionsOpen(); case WindowClass::Options: - return WindowOptionsOpen(); + return OptionsOpen(); case WindowClass::SavePrompt: - return WindowSavePromptOpen(); + return SavePromptOpen(); case WindowClass::Scenery: - return WindowSceneryOpen(); + return SceneryOpen(); case WindowClass::SceneryScatter: - return WindowSceneryScatterOpen(); + return SceneryScatterOpen(); #ifndef DISABLE_NETWORK case WindowClass::ServerList: - return WindowServerListOpen(); + return ServerListOpen(); case WindowClass::ServerStart: - return WindowServerStartOpen(); + return ServerStartOpen(); #endif case WindowClass::KeyboardShortcutList: - return WindowShortcutKeysOpen(); + return ShortcutKeysOpen(); case WindowClass::StaffList: - return WindowStaffListOpen(); + return StaffListOpen(); case WindowClass::Themes: - return WindowThemesOpen(); + return ThemesOpen(); case WindowClass::TileInspector: - return WindowTileInspectorOpen(); + return TileInspectorOpen(); case WindowClass::TitleExit: - return WindowTitleExitOpen(); + return TitleExitOpen(); case WindowClass::TitleLogo: - return WindowTitleLogoOpen(); + return TitleLogoOpen(); case WindowClass::TitleMenu: - return WindowTitleMenuOpen(); + return TitleMenuOpen(); case WindowClass::TitleOptions: - return WindowTitleOptionsOpen(); + return TitleOptionsOpen(); case WindowClass::TopToolbar: - return WindowTopToolbarOpen(); + return TopToolbarOpen(); case WindowClass::ViewClipping: - return WindowViewClippingOpen(); + return ViewClippingOpen(); case WindowClass::Viewport: - return WindowViewportOpen(); + return ViewportOpen(); case WindowClass::Water: - return WindowWaterOpen(); + return WaterOpen(); case WindowClass::Transparency: - return WindowTransparencyOpen(); + return TransparencyOpen(); case WindowClass::AssetPacks: - return WindowAssetPacksOpen(); + return AssetPacksOpen(); default: Console::Error::WriteLine("Unhandled window class (%d)", wc); return nullptr; @@ -150,35 +150,35 @@ public: switch (view) { case WV_PARK_AWARDS: - return WindowParkAwardsOpen(); + return ParkAwardsOpen(); case WV_PARK_RATING: - return WindowParkRatingOpen(); + return ParkRatingOpen(); case WV_PARK_OBJECTIVE: - return WindowParkObjectiveOpen(); + return ParkObjectiveOpen(); case WV_PARK_GUESTS: - return WindowParkGuestsOpen(); + return ParkGuestsOpen(); case WV_FINANCES_RESEARCH: - return WindowFinancesResearchOpen(); + return FinancesResearchOpen(); case WV_RIDE_RESEARCH: if (gConfigInterface.ToolbarShowResearch) { return this->OpenWindow(WindowClass::Research); } - return WindowNewRideOpenResearch(); + return NewRideOpenResearch(); case WV_MAZE_CONSTRUCTION: - return WindowMazeConstructionOpen(); + return MazeConstructionOpen(); case WV_NETWORK_PASSWORD: - return WindowNetworkStatusOpenPassword(); + return NetworkStatusOpenPassword(); case WV_EDITOR_BOTTOM_TOOLBAR: - return WindowEditorBottomToolbarOpen(); + return EditorBottomToolbarOpen(); case WV_CHANGELOG: - return WindowChangelogOpen(WV_CHANGELOG); + return ChangelogOpen(WV_CHANGELOG); case WV_NEW_VERSION_INFO: - return WindowChangelogOpen(WV_NEW_VERSION_INFO); + return ChangelogOpen(WV_NEW_VERSION_INFO); case WV_CONTRIBUTORS: - return WindowChangelogOpen(WV_CONTRIBUTORS); + return ChangelogOpen(WV_CONTRIBUTORS); case WV_FINANCE_MARKETING: - return WindowFinancesMarketingOpen(); + return FinancesMarketingOpen(); default: return nullptr; } @@ -189,19 +189,19 @@ public: switch (type) { case WD_BANNER: - return WindowBannerOpen(id); + return BannerOpen(id); case WD_NEW_CAMPAIGN: - return WindowNewCampaignOpen(id); + return NewCampaignOpen(id); case WD_DEMOLISH_RIDE: - return WindowRideDemolishPromptOpen(*GetRide(RideId::FromUnderlying(id))); + return RideDemolishPromptOpen(*GetRide(RideId::FromUnderlying(id))); case WD_REFURBISH_RIDE: - return WindowRideRefurbishPromptOpen(*GetRide(RideId::FromUnderlying(id))); + return RideRefurbishPromptOpen(*GetRide(RideId::FromUnderlying(id))); case WD_SIGN: - return WindowSignOpen(id); + return SignOpen(id); case WD_SIGN_SMALL: - return WindowSignSmallOpen(id); + return SignSmallOpen(id); case WD_PLAYER: - return WindowPlayerOpen(id); + return PlayerOpen(id); default: return nullptr; @@ -210,12 +210,12 @@ public: WindowBase* ShowError(StringId title, StringId message, const Formatter& args) override { - return WindowErrorOpen(title, message, args); + return ErrorOpen(title, message, args); } WindowBase* ShowError(std::string_view title, std::string_view message) override { - return WindowErrorOpen(title, message); + return ErrorOpen(title, message); } WindowBase* OpenIntent(Intent* intent) override @@ -223,13 +223,13 @@ public: switch (intent->GetWindowClass()) { case WindowClass::Peep: - return WindowGuestOpen(static_cast(intent->GetPointerExtra(INTENT_EXTRA_PEEP))); + return GuestOpen(static_cast(intent->GetPointerExtra(INTENT_EXTRA_PEEP))); case WindowClass::FirePrompt: - return WindowStaffFirePromptOpen(static_cast(intent->GetPointerExtra(INTENT_EXTRA_PEEP))); + return StaffFirePromptOpen(static_cast(intent->GetPointerExtra(INTENT_EXTRA_PEEP))); case WindowClass::InstallTrack: - return WindowInstallTrackOpen(intent->GetStringExtra(INTENT_EXTRA_PATH).c_str()); + return InstallTrackOpen(intent->GetStringExtra(INTENT_EXTRA_PATH).c_str()); case WindowClass::GuestList: - return WindowGuestListOpenWithFilter( + return GuestListOpenWithFilter( static_cast(intent->GetSIntExtra(INTENT_EXTRA_GUEST_LIST_FILTER)), intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); case WindowClass::Loadsave: @@ -239,7 +239,7 @@ public: loadsave_callback callback = reinterpret_cast( intent->GetPointerExtra(INTENT_EXTRA_CALLBACK)); TrackDesign* trackDesign = static_cast(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN)); - auto* w = WindowLoadsaveOpen( + auto* w = LoadsaveOpen( type, defaultName, [callback](int32_t result, std::string_view path) { if (callback != nullptr) @@ -251,20 +251,19 @@ public: return w; } case WindowClass::ManageTrackDesign: - return WindowTrackManageOpen( - static_cast(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN))); + return TrackManageOpen(static_cast(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN))); case WindowClass::NetworkStatus: { std::string message = intent->GetStringExtra(INTENT_EXTRA_MESSAGE); close_callback callback = intent->GetCloseCallbackExtra(INTENT_EXTRA_CALLBACK); - return WindowNetworkStatusOpen(message, callback); + return NetworkStatusOpen(message, callback); } case WindowClass::ObjectLoadError: { std::string path = intent->GetStringExtra(INTENT_EXTRA_PATH); auto objects = static_cast(intent->GetPointerExtra(INTENT_EXTRA_LIST)); size_t count = intent->GetUIntExtra(INTENT_EXTRA_LIST_COUNT); - WindowObjectLoadErrorOpen(const_cast(path.c_str()), count, objects); + ObjectLoadErrorOpen(const_cast(path.c_str()), count, objects); return nullptr; } @@ -272,20 +271,19 @@ public: { const auto rideId = RideId::FromUnderlying(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID)); auto ride = GetRide(rideId); - return ride == nullptr ? nullptr : WindowRideMainOpen(*ride); + return ride == nullptr ? nullptr : RideMainOpen(*ride); } case WindowClass::TrackDesignPlace: - return WindowTrackPlaceOpen( - static_cast(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN))); + return TrackPlaceOpen(static_cast(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN))); case WindowClass::TrackDesignList: { RideSelection rideItem; rideItem.Type = intent->GetUIntExtra(INTENT_EXTRA_RIDE_TYPE); rideItem.EntryIndex = intent->GetUIntExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX); - return WindowTrackListOpen(rideItem); + return TrackListOpen(rideItem); } case WindowClass::ScenarioSelect: - return WindowScenarioselectOpen( + return ScenarioselectOpen( reinterpret_cast(intent->GetPointerExtra(INTENT_EXTRA_CALLBACK))); case WindowClass::Null: @@ -302,7 +300,7 @@ public: case INTENT_ACTION_NEW_RIDE_OF_TYPE: { // Open ride list window - auto w = WindowNewRideOpen(); + auto w = NewRideOpen(); // Switch to right tab and scroll to ride location RideSelection rideItem; @@ -325,7 +323,7 @@ public: if (!ToolSet(*tlbrWindow, WC_TOP_TOOLBAR__WIDX_SCENERY, Tool::Arrow)) { InputSetFlag(INPUT_FLAG_6, true); - window = WindowSceneryOpen(); + window = SceneryOpen(); } } } @@ -347,9 +345,9 @@ public: switch (intent->GetWindowDetail()) { case WD_VEHICLE: - return WindowRideOpenVehicle(static_cast(intent->GetPointerExtra(INTENT_EXTRA_VEHICLE))); + return RideOpenVehicle(static_cast(intent->GetPointerExtra(INTENT_EXTRA_VEHICLE))); case WD_TRACK: - return WindowRideOpenTrack(static_cast(intent->GetPointerExtra(INTENT_EXTRA_TILE_ELEMENT))); + return RideOpenTrack(static_cast(intent->GetPointerExtra(INTENT_EXTRA_TILE_ELEMENT))); case WD_NULL: // Intent does not hold an window detail diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 1f457247e7..d589537f58 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -390,7 +390,7 @@ static void ShortcutOpenCheatWindow() static void ShortcutOpenKeyboardShortcutsWindow() { - WindowShortcutKeysOpen(); + ShortcutKeysOpen(); } static void ShortcutOpenTransparencyWindow() diff --git a/src/openrct2-ui/scripting/ScUi.hpp b/src/openrct2-ui/scripting/ScUi.hpp index 05c4b508f6..f77003dfab 100644 --- a/src/openrct2-ui/scripting/ScUi.hpp +++ b/src/openrct2-ui/scripting/ScUi.hpp @@ -231,7 +231,7 @@ namespace OpenRCT2::Scripting void showError(const std::string& title, const std::string& message) { - WindowErrorOpen(title, message); + ErrorOpen(title, message); } void showTextInput(const DukValue& desc) @@ -282,7 +282,7 @@ namespace OpenRCT2::Scripting else throw DukException(); - WindowLoadsaveOpen( + LoadsaveOpen( loadSaveType, defaultPath, [this, plugin, callback](int32_t result, std::string_view path) { if (result == MODAL_RESULT_OK) @@ -304,7 +304,7 @@ namespace OpenRCT2::Scripting auto plugin = _scriptEngine.GetExecInfo().GetCurrentPlugin(); auto callback = desc["callback"]; - WindowScenarioselectOpen([this, plugin, callback](std::string_view path) { + ScenarioselectOpen([this, plugin, callback](std::string_view path) { auto dukValue = GetScenarioFile(path); _scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false); }); diff --git a/src/openrct2-ui/windows/About.cpp b/src/openrct2-ui/windows/About.cpp index d5b358aaa2..aa6f6ec439 100644 --- a/src/openrct2-ui/windows/About.cpp +++ b/src/openrct2-ui/windows/About.cpp @@ -282,7 +282,7 @@ static Widget *_windowAboutPageWidgets[] = { * * rct2: 0x0066D2AC */ - WindowBase* WindowAboutOpen() + WindowBase* AboutOpen() { return WindowFocusOrCreate(WindowClass::About, WW, WH, WF_CENTRE_SCREEN); } diff --git a/src/openrct2-ui/windows/AssetPacks.cpp b/src/openrct2-ui/windows/AssetPacks.cpp index 812c87c31c..2c425e8172 100644 --- a/src/openrct2-ui/windows/AssetPacks.cpp +++ b/src/openrct2-ui/windows/AssetPacks.cpp @@ -339,7 +339,7 @@ static Widget WindowAssetPacksWidgets[] = { } }; - WindowBase* WindowAssetPacksOpen() + WindowBase* AssetPacksOpen() { auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN; return WindowFocusOrCreate(WindowClass::AssetPacks, WW, WH, flags); diff --git a/src/openrct2-ui/windows/Banner.cpp b/src/openrct2-ui/windows/Banner.cpp index 948d39b76f..c454f7c4d6 100644 --- a/src/openrct2-ui/windows/Banner.cpp +++ b/src/openrct2-ui/windows/Banner.cpp @@ -308,7 +308,7 @@ static Widget window_banner_widgets[] = { * * rct2: 0x006BA305 */ - WindowBase* WindowBannerOpen(rct_windownumber number) + WindowBase* BannerOpen(rct_windownumber number) { auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 79dbd31113..4c227c27bc 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -319,7 +319,7 @@ static Widget _windowChangelogWidgets[] = { } }; - WindowBase* WindowChangelogOpen(int personality) + WindowBase* ChangelogOpen(int personality) { auto* window = WindowBringToFrontByClass(WindowClass::Changelog); if (window == nullptr) diff --git a/src/openrct2-ui/windows/Cheats.cpp b/src/openrct2-ui/windows/Cheats.cpp index 80d4c536bf..3291f90931 100644 --- a/src/openrct2-ui/windows/Cheats.cpp +++ b/src/openrct2-ui/windows/Cheats.cpp @@ -1149,7 +1149,7 @@ static StringId window_cheats_page_titles[] = { } }; - WindowBase* WindowCheatsOpen() + WindowBase* CheatsOpen() { auto* window = WindowBringToFrontByClass(WindowClass::Cheats); if (window == nullptr) diff --git a/src/openrct2-ui/windows/ClearScenery.cpp b/src/openrct2-ui/windows/ClearScenery.cpp index 9909bda483..7efe3ae5a7 100644 --- a/src/openrct2-ui/windows/ClearScenery.cpp +++ b/src/openrct2-ui/windows/ClearScenery.cpp @@ -208,7 +208,7 @@ namespace OpenRCT2::Ui::Windows } }; - WindowBase* WindowClearSceneryOpen() + WindowBase* ClearSceneryOpen() { auto* w = static_cast(WindowBringToFrontByClass(WindowClass::ClearScenery)); diff --git a/src/openrct2-ui/windows/CustomCurrency.cpp b/src/openrct2-ui/windows/CustomCurrency.cpp index 6f58f25074..25960fc494 100644 --- a/src/openrct2-ui/windows/CustomCurrency.cpp +++ b/src/openrct2-ui/windows/CustomCurrency.cpp @@ -228,7 +228,7 @@ static Widget window_custom_currency_widgets[] = { } }; - WindowBase* CustomCurrencyWindowOpen() + WindowBase* CustomCurrencyOpen() { return WindowFocusOrCreate(WindowClass::CustomCurrencyConfig, WW, WH, WF_CENTRE_SCREEN); } diff --git a/src/openrct2-ui/windows/DebugPaint.cpp b/src/openrct2-ui/windows/DebugPaint.cpp index 383df00ee1..42627d6003 100644 --- a/src/openrct2-ui/windows/DebugPaint.cpp +++ b/src/openrct2-ui/windows/DebugPaint.cpp @@ -146,7 +146,7 @@ static Widget window_debug_paint_widgets[] = { } }; - WindowBase* WindowDebugPaintOpen() + WindowBase* DebugPaintOpen() { auto* window = WindowFocusOrCreate( WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT, diff --git a/src/openrct2-ui/windows/DemolishRidePrompt.cpp b/src/openrct2-ui/windows/DemolishRidePrompt.cpp index 8d8dc2d0d1..e9ab8914f4 100644 --- a/src/openrct2-ui/windows/DemolishRidePrompt.cpp +++ b/src/openrct2-ui/windows/DemolishRidePrompt.cpp @@ -101,7 +101,7 @@ static Widget window_ride_demolish_widgets[] = } }; - WindowBase* WindowRideDemolishPromptOpen(const Ride& ride) + WindowBase* RideDemolishPromptOpen(const Ride& ride) { WindowBase* w; DemolishRidePromptWindow* newWindow; diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 238ed308e8..4e8308eddb 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -399,7 +399,7 @@ static Widget _editorBottomToolbarWidgets[] = { * Creates the main editor top toolbar window. * rct2: 0x0066F052 (part of 0x0066EF38) */ - WindowBase* WindowEditorBottomToolbarOpen() + WindowBase* EditorBottomToolbarOpen() { auto* window = WindowCreate( WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32, diff --git a/src/openrct2-ui/windows/EditorInventionsList.cpp b/src/openrct2-ui/windows/EditorInventionsList.cpp index a64b1035ff..bc81650b1b 100644 --- a/src/openrct2-ui/windows/EditorInventionsList.cpp +++ b/src/openrct2-ui/windows/EditorInventionsList.cpp @@ -588,7 +588,7 @@ static Widget _inventionListDragWidgets[] = { * * rct2: 0x00684E04 */ - WindowBase* WindowEditorInventionsListOpen() + WindowBase* EditorInventionsListOpen() { return WindowFocusOrCreate( WindowClass::EditorInventionList, WW, WH, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN); diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index d0c5eef8f0..d460443d17 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1568,7 +1568,7 @@ static std::vector _window_editor_object_selection_widgets = { * * rct2: 0x006AA64E */ - WindowBase* WindowEditorObjectSelectionOpen() + WindowBase* EditorObjectSelectionOpen() { return WindowFocusOrCreate( WindowClass::EditorObjectSelection, 755, 400, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN); diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index c71eaced17..3cea51f898 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -1193,7 +1193,7 @@ static uint64_t window_editor_objective_options_page_hold_down_widgets[] = { * * rct2: 0x0067137D */ - WindowBase* WindowEditorObjectiveOptionsOpen() + WindowBase* EditorObjectiveOptionsOpen() { auto window = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions); if (window != nullptr) diff --git a/src/openrct2-ui/windows/EditorScenarioOptions.cpp b/src/openrct2-ui/windows/EditorScenarioOptions.cpp index dc4101f236..bd98594969 100644 --- a/src/openrct2-ui/windows/EditorScenarioOptions.cpp +++ b/src/openrct2-ui/windows/EditorScenarioOptions.cpp @@ -1282,7 +1282,7 @@ static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = { #pragma endregion }; - WindowBase* WindowEditorScenarioOptionsOpen() + WindowBase* EditorScenarioOptionsOpen() { return WindowFocusOrCreate(WindowClass::EditorScenarioOptions, 280, 148, WF_NO_SCROLLING); } diff --git a/src/openrct2-ui/windows/Error.cpp b/src/openrct2-ui/windows/Error.cpp index 1ba83e1758..192492711f 100644 --- a/src/openrct2-ui/windows/Error.cpp +++ b/src/openrct2-ui/windows/Error.cpp @@ -111,7 +111,7 @@ static Widget window_error_widgets[] = { } }; - WindowBase* WindowErrorOpen(std::string_view title, std::string_view message) + WindowBase* ErrorOpen(std::string_view title, std::string_view message) { std::string buffer = "{BLACK}"; buffer.append(title); @@ -166,10 +166,10 @@ static Widget window_error_widgets[] = { WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_RESIZABLE); } - WindowBase* WindowErrorOpen(StringId title, StringId message, const Formatter& args) + WindowBase* ErrorOpen(StringId title, StringId message, const Formatter& args) { auto titlez = FormatStringIDLegacy(title, args.Data()); auto messagez = FormatStringIDLegacy(message, args.Data()); - return WindowErrorOpen(titlez, messagez); + return ErrorOpen(titlez, messagez); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Finances.cpp b/src/openrct2-ui/windows/Finances.cpp index 5a192397cb..f1fa47c280 100644 --- a/src/openrct2-ui/windows/Finances.cpp +++ b/src/openrct2-ui/windows/Finances.cpp @@ -968,17 +968,17 @@ static Widget _windowFinancesResearchWidgets[] = return window; } - WindowBase* WindowFinancesOpen() + WindowBase* FinancesOpen() { return WindowFocusOrCreate(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10); } - WindowBase* WindowFinancesResearchOpen() + WindowBase* FinancesResearchOpen() { return FinancesWindowOpen(WINDOW_FINANCES_PAGE_RESEARCH); } - WindowBase* WindowFinancesMarketingOpen() + WindowBase* FinancesMarketingOpen() { return FinancesWindowOpen(WINDOW_FINANCES_PAGE_MARKETING); } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 1f744ea857..627e41c1cd 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -1426,7 +1426,7 @@ static constexpr uint8_t ConstructionPreviewImages[][4] = { * * rct2: 0x006A7C43 */ - WindowBase* WindowFootpathOpen() + WindowBase* FootpathOpen() { if (!FootpathSelectDefault()) { diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index e78c49cfe3..ee2e5461d1 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -672,7 +672,7 @@ static Widget window_game_bottom_toolbar_widgets[] = /** * Creates the main game bottom toolbar window. */ - WindowBase* WindowGameBottomToolbarOpen() + WindowBase* GameBottomToolbarOpen() { int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); diff --git a/src/openrct2-ui/windows/Guest.cpp b/src/openrct2-ui/windows/Guest.cpp index 8f2aaac172..fadc34476a 100644 --- a/src/openrct2-ui/windows/Guest.cpp +++ b/src/openrct2-ui/windows/Guest.cpp @@ -1906,7 +1906,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); * rct2: 0x006989E9 * */ - WindowBase* WindowGuestOpen(Peep* peep) + WindowBase* GuestOpen(Peep* peep) { if (peep == nullptr) { @@ -1914,7 +1914,7 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT); } if (peep->Is()) { - return WindowStaffOpen(peep); + return StaffOpen(peep); } auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); diff --git a/src/openrct2-ui/windows/GuestList.cpp b/src/openrct2-ui/windows/GuestList.cpp index 6ab7db86c1..423f0161c1 100644 --- a/src/openrct2-ui/windows/GuestList.cpp +++ b/src/openrct2-ui/windows/GuestList.cpp @@ -565,7 +565,7 @@ static Widget window_guest_list_widgets[] = { auto guest = GetEntity(guestItem.Id); if (guest != nullptr) { - WindowGuestOpen(guest); + GuestOpen(guest); } break; } @@ -965,7 +965,7 @@ static Widget window_guest_list_widgets[] = { } }; - WindowBase* WindowGuestListOpen() + WindowBase* GuestListOpen() { auto* window = WindowBringToFrontByClass(WindowClass::GuestList); if (window == nullptr) @@ -978,9 +978,9 @@ static Widget window_guest_list_widgets[] = { /** * @param index The number of the ride or index of the thought */ - WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index) + WindowBase* GuestListOpenWithFilter(GuestListFilterType type, int32_t index) { - auto* w = static_cast(WindowGuestListOpen()); + auto* w = static_cast(GuestListOpen()); if (w != nullptr) { w->SetFilter(type, index); diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 3ee93e8253..0ea2d19d33 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -406,7 +406,7 @@ static Widget window_install_track_widgets[] = { } }; - WindowBase* WindowInstallTrackOpen(const utf8* path) + WindowBase* InstallTrackOpen(const utf8* path) { auto trackDesign = TrackDesignImport(path); if (trackDesign == nullptr) diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index f3c8cc3098..d019d2c3df 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -348,7 +348,7 @@ static Widget window_land_widgets[] = { } }; - WindowBase* WindowLandOpen() + WindowBase* LandOpen() { return WindowFocusOrCreate(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 a0415bb3ab..9bdc0fb49e 100644 --- a/src/openrct2-ui/windows/LandRights.cpp +++ b/src/openrct2-ui/windows/LandRights.cpp @@ -410,7 +410,7 @@ static Widget window_land_rights_widgets[] = { } }; - WindowBase* WindowLandRightsOpen() + WindowBase* LandRightsOpen() { return WindowFocusOrCreate( WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index ca1f80dc80..81bb0eadef 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -1014,7 +1014,7 @@ static Widget window_loadsave_widgets[] = #pragma endregion }; - WindowBase* WindowLoadsaveOpen( + WindowBase* LoadsaveOpen( int32_t type, std::string_view defaultPath, std::function callback, TrackDesign* trackDesign) { diff --git a/src/openrct2-ui/windows/Main.cpp b/src/openrct2-ui/windows/Main.cpp index 29fd68f364..ad1a749eee 100644 --- a/src/openrct2-ui/windows/Main.cpp +++ b/src/openrct2-ui/windows/Main.cpp @@ -73,7 +73,7 @@ static Widget _mainWidgets[] = { * Creates the main window that holds the main viewport. * rct2: 0x0066B3E8 */ - WindowBase* WindowMainOpen() + WindowBase* MainOpen() { return WindowCreate( WindowClass::MainWindow, { 0, 0 }, ContextGetWidth(), ContextGetHeight(), WF_STICK_TO_BACK); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b6aa56a318..554c4a8e4e 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1495,7 +1495,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { } }; - WindowBase* WindowMapOpen() + WindowBase* MapOpen() { try { diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index d421df45d1..89e7943a85 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -1390,14 +1390,14 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { } }; - WindowBase* WindowMapgenOpen() + WindowBase* MapgenOpen() { return WindowFocusOrCreate(WindowClass::Mapgen, WW, WH, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN); } static void HeightmapLoadsaveCallback(int32_t result, const utf8* path) { - auto* w = static_cast(WindowMapgenOpen()); + auto* w = static_cast(MapgenOpen()); w->AfterLoadingHeightMap(result, path); } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/MazeConstruction.cpp b/src/openrct2-ui/windows/MazeConstruction.cpp index 34cde8c77c..8e230d3d74 100644 --- a/src/openrct2-ui/windows/MazeConstruction.cpp +++ b/src/openrct2-ui/windows/MazeConstruction.cpp @@ -429,7 +429,7 @@ static Widget window_maze_construction_widgets[] = { } }; - WindowBase* WindowMazeConstructionOpen() + WindowBase* MazeConstructionOpen() { return WindowFocusOrCreate( WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE); diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index 08eccaece4..6978e8fc9f 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -183,7 +183,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override; }; - WindowBase* WindowMultiplayerOpen() + WindowBase* MultiplayerOpen() { // Check if window is already open WindowBase* window = WindowBringToFrontByClass(WindowClass::Multiplayer); @@ -620,7 +620,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = { Invalidate(); int32_t player = (IsServerPlayerInvisible() ? index + 1 : index); - WindowPlayerOpen(NetworkGetPlayerID(player)); + PlayerOpen(NetworkGetPlayerID(player)); break; } diff --git a/src/openrct2-ui/windows/NetworkStatus.cpp b/src/openrct2-ui/windows/NetworkStatus.cpp index 6dafc0c5ad..248371af3c 100644 --- a/src/openrct2-ui/windows/NetworkStatus.cpp +++ b/src/openrct2-ui/windows/NetworkStatus.cpp @@ -130,7 +130,7 @@ static Widget window_network_status_widgets[] = { std::string _password; }; - WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose) + WindowBase* NetworkStatusOpen(const std::string& text, close_callback onClose) { auto window = WindowFocusOrCreate( WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); @@ -152,7 +152,7 @@ static Widget window_network_status_widgets[] = { networkWindow->Close(); } - WindowBase* WindowNetworkStatusOpenPassword() + WindowBase* NetworkStatusOpenPassword() { auto window = WindowFocusOrCreate( WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN); diff --git a/src/openrct2-ui/windows/NewCampaign.cpp b/src/openrct2-ui/windows/NewCampaign.cpp index 218c7cd41f..7fe8428455 100644 --- a/src/openrct2-ui/windows/NewCampaign.cpp +++ b/src/openrct2-ui/windows/NewCampaign.cpp @@ -392,7 +392,7 @@ static Widget window_new_campaign_widgets[] = { } }; - WindowBase* WindowNewCampaignOpen(int16_t campaignType) + WindowBase* NewCampaignOpen(int16_t campaignType) { auto w = static_cast(WindowBringToFrontByClass(WindowClass::NewCampaign)); if (w != nullptr) diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index 805f254de6..a3422995f2 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -1041,7 +1041,7 @@ static Widget window_new_ride_widgets[] = { * * rct2: 0x006B3CFF */ - WindowBase* WindowNewRideOpen() + WindowBase* NewRideOpen() { WindowBase* window; @@ -1058,9 +1058,9 @@ static Widget window_new_ride_widgets[] = { return window; } - WindowBase* WindowNewRideOpenResearch() + WindowBase* NewRideOpenResearch() { - auto w = static_cast(WindowNewRideOpen()); + auto w = static_cast(NewRideOpen()); w->SetPage(RESEARCH_TAB); return w; } diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index c23bbf25d3..de5368749a 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -317,7 +317,7 @@ static Widget window_news_widgets[] = { } }; - WindowBase* WindowNewsOpen() + WindowBase* NewsOpen() { return WindowFocusOrCreate(WindowClass::RecentNews, WW, WH, 0); } diff --git a/src/openrct2-ui/windows/NewsOptions.cpp b/src/openrct2-ui/windows/NewsOptions.cpp index 69c387405a..90613b6cd6 100644 --- a/src/openrct2-ui/windows/NewsOptions.cpp +++ b/src/openrct2-ui/windows/NewsOptions.cpp @@ -278,7 +278,7 @@ static Widget WindowNewsOptionsWidgets[] = { }; }; - WindowBase* WindowNewsOptionsOpen() + WindowBase* NewsOptionsOpen() { return WindowFocusOrCreate(WindowClass::NotificationOptions, WW, WH, WF_CENTRE_SCREEN); } diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index c5100c7277..ad141cf333 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -570,7 +570,7 @@ static Widget window_object_load_error_widgets[] = { } }; - WindowBase* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) + WindowBase* ObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects) { // Check if window is already open auto* window = WindowBringToFrontByClass(WindowClass::ObjectLoadError); diff --git a/src/openrct2-ui/windows/Options.cpp b/src/openrct2-ui/windows/Options.cpp index 5cea541b8e..325f915ff5 100644 --- a/src/openrct2-ui/windows/Options.cpp +++ b/src/openrct2-ui/windows/Options.cpp @@ -2201,7 +2201,7 @@ static Widget *window_options_page_widgets[] = { * * rct2: 0x006BAC5B */ - WindowBase* WindowOptionsOpen() + WindowBase* OptionsOpen() { return WindowFocusOrCreate(WindowClass::Options, WW, WH, WF_CENTRE_SCREEN); } diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 28392fbac8..17d79524db 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -1331,7 +1331,7 @@ static constexpr WindowParkAward _parkAwards[] = { * * rct2: 0x00667C48 */ - WindowBase* WindowParkEntranceOpen() + WindowBase* ParkEntranceOpen() { return ParkWindowOpen(WINDOW_PARK_PAGE_ENTRANCE); } @@ -1340,7 +1340,7 @@ static constexpr WindowParkAward _parkAwards[] = { * * rct2: 0x00667CA4 */ - WindowBase* WindowParkRatingOpen() + WindowBase* ParkRatingOpen() { return ParkWindowOpen(WINDOW_PARK_PAGE_RATING); } @@ -1349,7 +1349,7 @@ static constexpr WindowParkAward _parkAwards[] = { * * rct2: 0x00667D35 */ - WindowBase* WindowParkGuestsOpen() + WindowBase* ParkGuestsOpen() { return ParkWindowOpen(WINDOW_PARK_PAGE_GUESTS); } @@ -1358,7 +1358,7 @@ static constexpr WindowParkAward _parkAwards[] = { * * rct2: 0x00667E57 */ - WindowBase* WindowParkObjectiveOpen() + WindowBase* ParkObjectiveOpen() { auto* wnd = ParkWindowOpen(WINDOW_PARK_PAGE_OBJECTIVE); if (wnd != nullptr) @@ -1375,7 +1375,7 @@ static constexpr WindowParkAward _parkAwards[] = { * * rct2: 0x00667DC6 */ - WindowBase* WindowParkAwardsOpen() + WindowBase* ParkAwardsOpen() { return ParkWindowOpen(WINDOW_PARK_PAGE_AWARDS); } diff --git a/src/openrct2-ui/windows/PatrolArea.cpp b/src/openrct2-ui/windows/PatrolArea.cpp index 388d74f4c4..4b6d01b0ce 100644 --- a/src/openrct2-ui/windows/PatrolArea.cpp +++ b/src/openrct2-ui/windows/PatrolArea.cpp @@ -293,7 +293,7 @@ static Widget PatrolAreaWidgets[] = { } }; - WindowBase* WindowPatrolAreaOpen(EntityId staffId) + WindowBase* PatrolAreaOpen(EntityId staffId) { auto w = WindowFocusOrCreate( WindowClass::PatrolArea, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); diff --git a/src/openrct2-ui/windows/Player.cpp b/src/openrct2-ui/windows/Player.cpp index 3a76fc9eac..14d722d22b 100644 --- a/src/openrct2-ui/windows/Player.cpp +++ b/src/openrct2-ui/windows/Player.cpp @@ -640,7 +640,7 @@ static Widget *window_player_page_widgets[] = { #pragma endregion }; - WindowBase* WindowPlayerOpen(uint8_t id) + WindowBase* PlayerOpen(uint8_t id) { auto* window = static_cast(WindowBringToFrontByNumber(WindowClass::Player, id)); if (window == nullptr) diff --git a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp index a25a3edb70..1afb893d01 100644 --- a/src/openrct2-ui/windows/RefurbishRidePrompt.cpp +++ b/src/openrct2-ui/windows/RefurbishRidePrompt.cpp @@ -100,7 +100,7 @@ static Widget window_ride_refurbish_widgets[] = } }; - WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride) + WindowBase* RideRefurbishPromptOpen(const Ride& ride) { WindowBase* w; RefurbishRidePromptWindow* newWindow; diff --git a/src/openrct2-ui/windows/Research.cpp b/src/openrct2-ui/windows/Research.cpp index 02a254bb8d..73a0e23a68 100644 --- a/src/openrct2-ui/windows/Research.cpp +++ b/src/openrct2-ui/windows/Research.cpp @@ -311,7 +311,7 @@ static Widget *window_research_page_widgets[] = { } }; - WindowBase* WindowResearchOpen() + WindowBase* ResearchOpen() { ResearchWindow* window = WindowFocusOrCreate(WindowClass::Research, WW_FUNDING, WH_FUNDING, WF_10); window->SetPage(WINDOW_RESEARCH_PAGE_DEVELOPMENT); diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index a7c4a112f7..b5b1b73b64 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -6667,7 +6667,7 @@ static_assert(std::size(RatingNames) == 6); * * rct2: 0x006ACC28 */ - WindowBase* WindowRideMainOpen(const Ride& ride) + WindowBase* RideMainOpen(const Ride& ride) { if (ride.type >= RIDE_TYPE_COUNT) { @@ -6712,7 +6712,7 @@ static_assert(std::size(RatingNames) == 6); return nullptr; if (ride.GetRideTypeDescriptor().HasFlag(RIDE_TYPE_FLAG_NO_VEHICLES)) - return WindowRideMainOpen(ride); + return RideMainOpen(ride); auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Ride, ride.id.ToUnderlying())); if (w == nullptr) @@ -6740,7 +6740,7 @@ static_assert(std::size(RatingNames) == 6); return w; } - WindowBase* WindowRideOpenTrack(TileElement* tileElement) + WindowBase* RideOpenTrack(TileElement* tileElement) { assert(tileElement != nullptr); auto rideIndex = tileElement->GetRideIndex(); @@ -6771,7 +6771,7 @@ static_assert(std::size(RatingNames) == 6); } // Open ride window in overview mode - return WindowRideMainOpen(*ride); + return RideMainOpen(*ride); } } return nullptr; @@ -6781,7 +6781,7 @@ static_assert(std::size(RatingNames) == 6); * * rct2: 0x006ACAC2 */ - WindowBase* WindowRideOpenVehicle(Vehicle* vehicle) + WindowBase* RideOpenVehicle(Vehicle* vehicle) { if (vehicle == nullptr) return nullptr; diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index 0149e5580e..f3ce047542 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2748,7 +2748,7 @@ static Widget _rideConstructionWidgets[] = { * * rct2: 0x006CB481 */ - WindowBase* WindowRideConstructionOpen() + WindowBase* RideConstructionOpen() { RideId rideIndex = _currentRideIndex; CloseRideWindowForConstruction(rideIndex); diff --git a/src/openrct2-ui/windows/RideList.cpp b/src/openrct2-ui/windows/RideList.cpp index 3a4426c6f0..23604fcce9 100644 --- a/src/openrct2-ui/windows/RideList.cpp +++ b/src/openrct2-ui/windows/RideList.cpp @@ -961,7 +961,7 @@ static Widget _rideListWidgets[] = { * * rct2: 0x006B30BC */ - WindowBase* WindowRideListOpen() + WindowBase* RideListOpen() { // Check if window is already open auto* window = WindowBringToFrontByClass(WindowClass::RideList); diff --git a/src/openrct2-ui/windows/SavePrompt.cpp b/src/openrct2-ui/windows/SavePrompt.cpp index 6171ca20c7..d4c80757e2 100644 --- a/src/openrct2-ui/windows/SavePrompt.cpp +++ b/src/openrct2-ui/windows/SavePrompt.cpp @@ -194,7 +194,7 @@ static constexpr StringId window_save_prompt_labels[][2] = { } }; - WindowBase* WindowSavePromptOpen() + WindowBase* SavePromptOpen() { PromptMode prompt_mode = gSavePromptMode; if (prompt_mode == PromptMode::Quit) diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index c545df6ec6..8996b3faf2 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -762,12 +762,12 @@ static Widget _scenarioSelectWidgets[] = { } }; - WindowBase* WindowScenarioselectOpen(scenarioselect_callback callback) + WindowBase* ScenarioselectOpen(scenarioselect_callback callback) { - return WindowScenarioselectOpen([callback](std::string_view scenario) { callback(std::string(scenario).c_str()); }); + return ScenarioselectOpen([callback](std::string_view scenario) { callback(std::string(scenario).c_str()); }); } - WindowBase* WindowScenarioselectOpen(std::function callback) + WindowBase* ScenarioselectOpen(std::function callback) { auto* window = static_cast(WindowBringToFrontByClass(WindowClass::ScenarioSelect)); if (window != nullptr) diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 52591abaca..5730eee5ee 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -267,7 +267,7 @@ static Widget WindowSceneryBaseWidgets[] = { NetworkGetMode() != NETWORK_MODE_CLIENT || NetworkCanPerformCommand(NetworkGetCurrentPlayerGroupIndex(), -2)) { - WindowSceneryScatterOpen(); + SceneryScatterOpen(); } else { @@ -1693,7 +1693,7 @@ static Widget WindowSceneryBaseWidgets[] = { } }; - WindowBase* WindowSceneryOpen() + WindowBase* SceneryOpen() { auto* w = static_cast(WindowBringToFrontByClass(WindowClass::Scenery)); if (w == nullptr) diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index cf1014d16b..2293b5810d 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -201,7 +201,7 @@ static Widget _sceneryScatterWidgets[] = { } }; - WindowBase* WindowSceneryScatterOpen() + WindowBase* SceneryScatterOpen() { // Check if window is already open auto* window = WindowFindByClass(WindowClass::SceneryScatter); diff --git a/src/openrct2-ui/windows/ServerList.cpp b/src/openrct2-ui/windows/ServerList.cpp index 40ddebecae..29bb122642 100644 --- a/src/openrct2-ui/windows/ServerList.cpp +++ b/src/openrct2-ui/windows/ServerList.cpp @@ -542,7 +542,7 @@ static Widget _serverListWidgets[] = { } }; - WindowBase* WindowServerListOpen() + WindowBase* ServerListOpen() { // Check if window is already open auto* window = WindowBringToFrontByClass(WindowClass::ServerList); diff --git a/src/openrct2-ui/windows/ServerStart.cpp b/src/openrct2-ui/windows/ServerStart.cpp index 619bff5db9..24dbb0081c 100644 --- a/src/openrct2-ui/windows/ServerStart.cpp +++ b/src/openrct2-ui/windows/ServerStart.cpp @@ -132,7 +132,7 @@ static Widget _windowServerStartWidgets[] = { break; case WIDX_START_SERVER: NetworkSetPassword(_password); - WindowScenarioselectOpen(ScenarioSelectCallback); + ScenarioselectOpen(ScenarioSelectCallback); break; case WIDX_LOAD_SERVER: NetworkSetPassword(_password); @@ -281,7 +281,7 @@ static Widget _windowServerStartWidgets[] = { } }; - WindowBase* WindowServerStartOpen() + WindowBase* ServerStartOpen() { return WindowFocusOrCreate(WindowClass::ServerStart, WW, WH, WF_CENTRE_SCREEN); } diff --git a/src/openrct2-ui/windows/ShortcutKeys.cpp b/src/openrct2-ui/windows/ShortcutKeys.cpp index 99a3a8b781..cc9f3d7339 100644 --- a/src/openrct2-ui/windows/ShortcutKeys.cpp +++ b/src/openrct2-ui/windows/ShortcutKeys.cpp @@ -552,7 +552,7 @@ static Widget window_shortcut_change_widgets[] = { } } - WindowBase* WindowShortcutKeysOpen() + WindowBase* ShortcutKeysOpen() { auto w = WindowBringToFrontByClass(WindowClass::KeyboardShortcutList); if (w == nullptr) diff --git a/src/openrct2-ui/windows/Sign.cpp b/src/openrct2-ui/windows/Sign.cpp index 0584cea2e2..5e21545df7 100644 --- a/src/openrct2-ui/windows/Sign.cpp +++ b/src/openrct2-ui/windows/Sign.cpp @@ -331,7 +331,7 @@ static Widget _signWidgets[] = { * * rct2: 0x006BA305 */ - WindowBase* WindowSignOpen(rct_windownumber number) + WindowBase* SignOpen(rct_windownumber number) { auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); @@ -354,7 +354,7 @@ static Widget _signWidgets[] = { * * rct2: 0x6E5F52 */ - WindowBase* WindowSignSmallOpen(rct_windownumber number) + WindowBase* SignSmallOpen(rct_windownumber number) { auto* w = static_cast(WindowBringToFrontByNumber(WindowClass::Banner, number)); diff --git a/src/openrct2-ui/windows/Staff.cpp b/src/openrct2-ui/windows/Staff.cpp index e98a3d52b0..b743ae7090 100644 --- a/src/openrct2-ui/windows/Staff.cpp +++ b/src/openrct2-ui/windows/Staff.cpp @@ -477,7 +477,7 @@ static Widget _staffOptionsWidgets[] = { } else { - WindowPatrolAreaOpen(staffId); + PatrolAreaOpen(staffId); } } break; @@ -1241,7 +1241,7 @@ static Widget _staffOptionsWidgets[] = { static constexpr int32_t TabAnimationFrames = 7; }; - WindowBase* WindowStaffOpen(Peep* peep) + WindowBase* StaffOpen(Peep* peep) { auto w = static_cast(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying())); diff --git a/src/openrct2-ui/windows/StaffFirePrompt.cpp b/src/openrct2-ui/windows/StaffFirePrompt.cpp index 637c9f7b71..0839cbb8a4 100644 --- a/src/openrct2-ui/windows/StaffFirePrompt.cpp +++ b/src/openrct2-ui/windows/StaffFirePrompt.cpp @@ -92,7 +92,7 @@ static Widget _staffFireWidgets[] = { } }; - WindowBase* WindowStaffFirePromptOpen(Peep* peep) + WindowBase* StaffFirePromptOpen(Peep* peep) { // Check if the confirm window already exists auto* window = WindowFocusOrCreate( diff --git a/src/openrct2-ui/windows/StaffList.cpp b/src/openrct2-ui/windows/StaffList.cpp index 0ddf7019c4..6493660c19 100644 --- a/src/openrct2-ui/windows/StaffList.cpp +++ b/src/openrct2-ui/windows/StaffList.cpp @@ -464,7 +464,7 @@ static Widget _staffListWidgets[] = { if (closestStaffMember != nullptr) { ToolCancel(); - auto* staffWindow = WindowStaffOpen(closestStaffMember); + auto* staffWindow = StaffOpen(closestStaffMember); staffWindow->OnDropdown(WC_PEEP__WIDX_PATROL, 0); } else @@ -750,7 +750,7 @@ static Widget _staffListWidgets[] = { } }; - WindowBase* WindowStaffListOpen() + WindowBase* StaffListOpen() { return WindowFocusOrCreate(WindowClass::StaffList, WW, WH, WF_10 | WF_RESIZABLE); } diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 168291d695..52958a812c 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -873,7 +873,7 @@ static WindowClass window_themes_tab_7_classes[] = { } }; - WindowBase* WindowThemesOpen() + WindowBase* ThemesOpen() { WindowBase* window; diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 56831298ba..ced4d1c53f 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -2390,7 +2390,7 @@ static uint64_t PageDisabledWidgets[] = { } }; - WindowBase* WindowTileInspectorOpen() + WindowBase* TileInspectorOpen() { WindowBase* window = WindowBringToFrontByClass(WindowClass::TileInspector); if (window == nullptr) diff --git a/src/openrct2-ui/windows/TitleExit.cpp b/src/openrct2-ui/windows/TitleExit.cpp index 2afad31f02..0c56d4ab6e 100644 --- a/src/openrct2-ui/windows/TitleExit.cpp +++ b/src/openrct2-ui/windows/TitleExit.cpp @@ -60,7 +60,7 @@ static Widget _titleExitWidgets[] = { * Creates the window containing the exit button on the title screen. * rct2: 0x0066B624 (part of 0x0066B3E8) */ - WindowBase* WindowTitleExitOpen() + WindowBase* TitleExitOpen() { return WindowCreate( WindowClass::TitleExit, ScreenCoordsXY(ContextGetWidth() - 40, ContextGetHeight() - 64), 40, 64, diff --git a/src/openrct2-ui/windows/TitleLogo.cpp b/src/openrct2-ui/windows/TitleLogo.cpp index 8b68d437ca..16bd5bb8cd 100644 --- a/src/openrct2-ui/windows/TitleLogo.cpp +++ b/src/openrct2-ui/windows/TitleLogo.cpp @@ -50,7 +50,7 @@ namespace OpenRCT2::Ui::Windows switch (widgetIndex) { case WIDX_LOGO: - WindowAboutOpen(); + AboutOpen(); break; } } @@ -67,7 +67,7 @@ namespace OpenRCT2::Ui::Windows } }; - WindowBase* WindowTitleLogoOpen() + WindowBase* TitleLogoOpen() { auto* window = WindowBringToFrontByClass(WindowClass::TitleLogo); if (window == nullptr) diff --git a/src/openrct2-ui/windows/TitleMenu.cpp b/src/openrct2-ui/windows/TitleMenu.cpp index 06fec7320f..e506ac4cf1 100644 --- a/src/openrct2-ui/windows/TitleMenu.cpp +++ b/src/openrct2-ui/windows/TitleMenu.cpp @@ -134,7 +134,7 @@ static Widget _titleMenuWidgets[] = { { WindowCloseByClass(WindowClass::Loadsave); WindowCloseByClass(WindowClass::ServerList); - WindowScenarioselectOpen(WindowTitleMenuScenarioselectCallback); + ScenarioselectOpen(WindowTitleMenuScenarioselectCallback); } break; case WIDX_CONTINUE_SAVED_GAME: @@ -283,7 +283,7 @@ static Widget _titleMenuWidgets[] = { /** * Creates the window containing the menu buttons on the title screen. */ - WindowBase* WindowTitleMenuOpen() + WindowBase* TitleMenuOpen() { const uint16_t windowHeight = MenuButtonDims.height + UpdateButtonDims.height; return WindowCreate( diff --git a/src/openrct2-ui/windows/TitleOptions.cpp b/src/openrct2-ui/windows/TitleOptions.cpp index 639b960a17..07a359e3e7 100644 --- a/src/openrct2-ui/windows/TitleOptions.cpp +++ b/src/openrct2-ui/windows/TitleOptions.cpp @@ -55,7 +55,7 @@ static Widget _windowTitleOptionsWidgets[] = { /** * Creates the window containing the options button on the title screen. */ - WindowBase* WindowTitleOptionsOpen() + WindowBase* TitleOptionsOpen() { auto* window = WindowBringToFrontByClass(WindowClass::TitleOptions); if (window == nullptr) diff --git a/src/openrct2-ui/windows/TopToolbar.cpp b/src/openrct2-ui/windows/TopToolbar.cpp index b349881355..28cc31f993 100644 --- a/src/openrct2-ui/windows/TopToolbar.cpp +++ b/src/openrct2-ui/windows/TopToolbar.cpp @@ -3320,7 +3320,7 @@ static Widget _topToolbarWidgets[] = { * Creates the main game top toolbar window. * rct2: 0x0066B485 (part of 0x0066B3E8) */ - WindowBase* WindowTopToolbarOpen() + WindowBase* TopToolbarOpen() { TopToolbar* window = WindowCreate( WindowClass::TopToolbar, ScreenCoordsXY(0, 0), ContextGetWidth(), TOP_TOOLBAR_HEIGHT + 1, diff --git a/src/openrct2-ui/windows/TrackDesignManage.cpp b/src/openrct2-ui/windows/TrackDesignManage.cpp index 57e1650753..7283d4e41d 100644 --- a/src/openrct2-ui/windows/TrackDesignManage.cpp +++ b/src/openrct2-ui/windows/TrackDesignManage.cpp @@ -106,7 +106,7 @@ static Widget _trackDeletePromptWidgets[] = { * * rct2: 0x006D348F */ - WindowBase* WindowTrackManageOpen(TrackDesignFileRef* tdFileRef) + WindowBase* TrackManageOpen(TrackDesignFileRef* tdFileRef) { WindowCloseByClass(WindowClass::ManageTrackDesign); auto trackDesignManageWindow = std::make_unique(tdFileRef); diff --git a/src/openrct2-ui/windows/TrackDesignPlace.cpp b/src/openrct2-ui/windows/TrackDesignPlace.cpp index 75156eb9ca..83b47a8ce3 100644 --- a/src/openrct2-ui/windows/TrackDesignPlace.cpp +++ b/src/openrct2-ui/windows/TrackDesignPlace.cpp @@ -615,7 +615,7 @@ static Widget _trackPlaceWidgets[] = { } }; - WindowBase* WindowTrackPlaceOpen(const TrackDesignFileRef* tdFileRef) + WindowBase* TrackPlaceOpen(const TrackDesignFileRef* tdFileRef) { std::unique_ptr openTrackDesign = TrackDesignImport(tdFileRef->path.c_str()); diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 440abd0cc3..9623bc6435 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -760,7 +760,7 @@ static Widget _trackListWidgets[] = { } }; - WindowBase* WindowTrackListOpen(const RideSelection item) + WindowBase* TrackListOpen(const RideSelection item) { WindowCloseConstructionWindows(); ScreenCoordsXY screenPos{}; diff --git a/src/openrct2-ui/windows/Transparency.cpp b/src/openrct2-ui/windows/Transparency.cpp index 823e53ddb3..5d8c50fd76 100644 --- a/src/openrct2-ui/windows/Transparency.cpp +++ b/src/openrct2-ui/windows/Transparency.cpp @@ -252,7 +252,7 @@ static Widget _transparancyWidgets[] = } }; - WindowBase* WindowTransparencyOpen() + WindowBase* TransparencyOpen() { auto* window = WindowBringToFrontByClass(WindowClass::Transparency); if (window == nullptr) diff --git a/src/openrct2-ui/windows/ViewClipping.cpp b/src/openrct2-ui/windows/ViewClipping.cpp index cf4815ba61..4c653da6d3 100644 --- a/src/openrct2-ui/windows/ViewClipping.cpp +++ b/src/openrct2-ui/windows/ViewClipping.cpp @@ -403,7 +403,7 @@ static Widget _viewClippingWidgets[] = { } }; - WindowBase* WindowViewClippingOpen() + WindowBase* ViewClippingOpen() { auto* window = WindowBringToFrontByClass(WindowClass::ViewClipping); if (window == nullptr) diff --git a/src/openrct2-ui/windows/Viewport.cpp b/src/openrct2-ui/windows/Viewport.cpp index 22091cec83..0653182632 100644 --- a/src/openrct2-ui/windows/Viewport.cpp +++ b/src/openrct2-ui/windows/Viewport.cpp @@ -84,7 +84,7 @@ static Widget _viewportWidgets[] = if (viewport == nullptr) { Close(); - WindowErrorOpen("Unexpected Error", "Failed to create viewport window."); + ErrorOpen("Unexpected Error", "Failed to create viewport window."); return; } @@ -226,7 +226,7 @@ static Widget _viewportWidgets[] = } }; - WindowBase* WindowViewportOpen() + WindowBase* ViewportOpen() { int32_t screenWidth = ContextGetWidth(); int32_t screenHeight = ContextGetHeight(); diff --git a/src/openrct2-ui/windows/Water.cpp b/src/openrct2-ui/windows/Water.cpp index fe82ebe890..838e74a087 100644 --- a/src/openrct2-ui/windows/Water.cpp +++ b/src/openrct2-ui/windows/Water.cpp @@ -193,7 +193,7 @@ static Widget _waterWidgets[] = { } }; - WindowBase* WindowWaterOpen() + WindowBase* WaterOpen() { return WindowFocusOrCreate(WindowClass::Water, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0); } diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index 5c484af922..c750d60d1d 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -37,92 +37,92 @@ namespace OpenRCT2::Ui::Windows extern colour_t gWindowSceneryTertiaryColour; extern bool gWindowSceneryEyedropperEnabled; - WindowBase* WindowAboutOpen(); + WindowBase* AboutOpen(); void WindowCampaignRefreshRides(); - WindowBase* WindowChangelogOpen(int personality); - WindowBase* WindowCheatsOpen(); - WindowBase* WindowClearSceneryOpen(); - WindowBase* CustomCurrencyWindowOpen(); - WindowBase* WindowDebugPaintOpen(); - WindowBase* WindowEditorInventionsListOpen(); - WindowBase* WindowEditorMainOpen(); - WindowBase* WindowEditorObjectiveOptionsOpen(); - WindowBase* WindowEditorScenarioOptionsOpen(); - WindowBase* WindowFootpathOpen(); + WindowBase* ChangelogOpen(int personality); + WindowBase* CheatsOpen(); + WindowBase* ClearSceneryOpen(); + WindowBase* CustomCurrencyOpen(); + WindowBase* DebugPaintOpen(); + WindowBase* EditorInventionsListOpen(); + WindowBase* EditorMainOpen(); + WindowBase* EditorObjectiveOptionsOpen(); + WindowBase* EditorScenarioOptionsOpen(); + WindowBase* FootpathOpen(); void WindowFootpathResetSelectedPath(); - WindowBase* WindowGuestOpen(Peep* peep); - WindowBase* WindowLandOpen(); - WindowBase* WindowLandRightsOpen(); - WindowBase* WindowMainOpen(); - WindowBase* WindowMapgenOpen(); - WindowBase* WindowMultiplayerOpen(); - WindowBase* WindowNewsOpen(); - WindowBase* WindowNewsOptionsOpen(); - WindowBase* WindowOptionsOpen(); - WindowBase* WindowSavePromptOpen(); + WindowBase* GuestOpen(Peep* peep); + WindowBase* LandOpen(); + WindowBase* LandRightsOpen(); + WindowBase* MainOpen(); + WindowBase* MapgenOpen(); + WindowBase* MultiplayerOpen(); + WindowBase* NewsOpen(); + WindowBase* NewsOptionsOpen(); + WindowBase* OptionsOpen(); + WindowBase* SavePromptOpen(); #ifndef DISABLE_NETWORK - WindowBase* WindowServerListOpen(); - WindowBase* WindowServerStartOpen(); + WindowBase* ServerListOpen(); + WindowBase* ServerStartOpen(); #endif - WindowBase* WindowShortcutKeysOpen(); - WindowBase* WindowStaffListOpen(); - WindowBase* WindowStaffOpen(Peep* peep); + WindowBase* ShortcutKeysOpen(); + WindowBase* StaffListOpen(); + WindowBase* StaffOpen(Peep* peep); void WindowStaffListRefresh(); - WindowBase* WindowThemesOpen(); - WindowBase* WindowTitleExitOpen(); - WindowBase* WindowTitleLogoOpen(); - WindowBase* WindowTitleMenuOpen(); - WindowBase* WindowTitleOptionsOpen(); - WindowBase* WindowViewportOpen(); - WindowBase* WindowWaterOpen(); - WindowBase* WindowViewClippingOpen(); - WindowBase* WindowTransparencyOpen(); - WindowBase* WindowAssetPacksOpen(); + WindowBase* ThemesOpen(); + WindowBase* TitleExitOpen(); + WindowBase* TitleLogoOpen(); + WindowBase* TitleMenuOpen(); + WindowBase* TitleOptionsOpen(); + WindowBase* ViewportOpen(); + WindowBase* WaterOpen(); + WindowBase* ViewClippingOpen(); + WindowBase* TransparencyOpen(); + WindowBase* AssetPacksOpen(); // WC_FINANCES - WindowBase* WindowFinancesOpen(); - WindowBase* WindowFinancesResearchOpen(); - WindowBase* WindowFinancesMarketingOpen(); + WindowBase* FinancesOpen(); + WindowBase* FinancesResearchOpen(); + WindowBase* FinancesMarketingOpen(); // WC_PARK_INFORMATION - WindowBase* WindowParkAwardsOpen(); - WindowBase* WindowParkEntranceOpen(); - WindowBase* WindowParkGuestsOpen(); - WindowBase* WindowParkObjectiveOpen(); - WindowBase* WindowParkRatingOpen(); + WindowBase* ParkAwardsOpen(); + WindowBase* ParkEntranceOpen(); + WindowBase* ParkGuestsOpen(); + WindowBase* ParkObjectiveOpen(); + WindowBase* ParkRatingOpen(); - WindowBase* WindowBannerOpen(rct_windownumber number); - WindowBase* WindowRideDemolishPromptOpen(const Ride& ride); - WindowBase* WindowRideRefurbishPromptOpen(const Ride& ride); - WindowBase* WindowSignOpen(rct_windownumber number); - WindowBase* WindowSignSmallOpen(rct_windownumber number); - WindowBase* WindowPlayerOpen(uint8_t id); - WindowBase* WindowNewCampaignOpen(int16_t campaignType); + 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); + WindowBase* PlayerOpen(uint8_t id); + WindowBase* NewCampaignOpen(int16_t campaignType); - WindowBase* WindowInstallTrackOpen(const utf8* path); + WindowBase* InstallTrackOpen(const utf8* path); void WindowGuestListRefreshList(); - WindowBase* WindowGuestListOpen(); - WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index); - WindowBase* WindowStaffFirePromptOpen(Peep* peep); - WindowBase* WindowScenarioselectOpen(scenarioselect_callback callback); - WindowBase* WindowScenarioselectOpen(std::function callback); + WindowBase* GuestListOpen(); + WindowBase* GuestListOpenWithFilter(GuestListFilterType type, int32_t index); + WindowBase* StaffFirePromptOpen(Peep* peep); + WindowBase* ScenarioselectOpen(scenarioselect_callback callback); + WindowBase* ScenarioselectOpen(std::function callback); - WindowBase* WindowErrorOpen(StringId title, StringId message, const class Formatter& formatter); - WindowBase* WindowErrorOpen(std::string_view title, std::string_view message); + WindowBase* ErrorOpen(StringId title, StringId message, const class Formatter& formatter); + WindowBase* ErrorOpen(std::string_view title, std::string_view message); - WindowBase* WindowLoadsaveOpen( + WindowBase* LoadsaveOpen( int32_t type, std::string_view defaultPath, std::function callback, TrackDesign* trackDesign); - WindowBase* WindowTrackPlaceOpen(const struct TrackDesignFileRef* tdFileRef); - WindowBase* WindowTrackManageOpen(struct TrackDesignFileRef* tdFileRef); + WindowBase* TrackPlaceOpen(const struct TrackDesignFileRef* tdFileRef); + WindowBase* TrackManageOpen(struct TrackDesignFileRef* tdFileRef); void TrackPlaceClearProvisionalTemporarily(); void TrackPlaceRestoreProvisional(); - WindowBase* WindowMapOpen(); + WindowBase* MapOpen(); void WindowMapReset(); - WindowBase* WindowResearchOpen(); + WindowBase* ResearchOpen(); void WindowResearchDevelopmentMouseUp(WidgetIndex widgetIndex, WidgetIndex baseWidgetIndex); void WindowResearchDevelopmentPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); void WindowResearchDevelopmentDraw(WindowBase* w, DrawPixelInfo& dpi, WidgetIndex baseWidgetIndex); @@ -132,24 +132,24 @@ namespace OpenRCT2::Ui::Windows void WindowResearchFundingPrepareDraw(WindowBase* w, WidgetIndex baseWidgetIndex); void WindowResearchFundingDraw(WindowBase* w, DrawPixelInfo& dpi); - WindowBase* WindowNewRideOpen(); - WindowBase* WindowNewRideOpenResearch(); + WindowBase* NewRideOpen(); + WindowBase* NewRideOpenResearch(); void WindowNewRideInitVars(); void WindowNewRideFocus(RideSelection rideItem); - WindowBase* WindowRideListOpen(); + WindowBase* RideListOpen(); void WindowRideListRefreshList(WindowBase* w); - WindowBase* WindowRideMainOpen(const Ride& ride); - WindowBase* WindowRideOpenTrack(TileElement* tileElement); - WindowBase* WindowRideOpenVehicle(Vehicle* vehicle); + WindowBase* RideMainOpen(const Ride& ride); + WindowBase* RideOpenTrack(TileElement* tileElement); + WindowBase* RideOpenVehicle(Vehicle* vehicle); void WindowRideInvalidateVehicle(const Vehicle& vehicle); void WindowRidePaintResetVehicle(RideId rideIndex); void WindowRideMeasurementsDesignCancel(); // rct2: 0x00F635EE extern RideSelection _window_track_list_item; - WindowBase* WindowTrackListOpen(RideSelection item); + WindowBase* TrackListOpen(RideSelection item); void WindowTrackDesignListReloadTracks(); void WindowTrackDesignListSetBeingUpdated(bool beingUpdated); @@ -157,11 +157,11 @@ namespace OpenRCT2::Ui::Windows const Formatter& GetMapTooltip(); void WindowMapTooltipUpdateVisibility(); - WindowBase* WindowMazeConstructionOpen(); + WindowBase* MazeConstructionOpen(); void WindowMazeConstructionUpdatePressedWidgets(); - WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose); - WindowBase* WindowNetworkStatusOpenPassword(); + WindowBase* NetworkStatusOpen(const std::string& text, close_callback onClose); + WindowBase* NetworkStatusOpenPassword(); void WindowNetworkStatusClose(); void WindowTextInputKey(WindowBase* w, uint32_t keycode); @@ -176,18 +176,18 @@ namespace OpenRCT2::Ui::Windows std::string_view title, std::string_view description, std::string_view initialValue, size_t maxLength, std::function okCallback, std::function cancelCallback); - WindowBase* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); + WindowBase* ObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects); - WindowBase* WindowRideConstructionOpen(); + WindowBase* RideConstructionOpen(); void WindowRideConstructionUpdateActiveElementsImpl(); void WindowRideConstructionUpdateEnabledTrackPieces(); - WindowBase* WindowTopToolbarOpen(); + WindowBase* TopToolbarOpen(); bool LandToolIsActive(); bool ClearSceneryToolIsActive(); bool WaterToolIsActive(); - WindowBase* WindowSceneryOpen(); + WindowBase* SceneryOpen(); void WindowScenerySetSelectedItem( const ScenerySelection& sceneryconst, std::optional primary, const std::optional secondary, const std::optional tertiary, const std::optional rotation); @@ -198,23 +198,23 @@ namespace OpenRCT2::Ui::Windows const ScenerySelection WindowSceneryGetTabSelection(); extern uint8_t gToolbarDirtyFlags; - WindowBase* WindowGameBottomToolbarOpen(); + WindowBase* GameBottomToolbarOpen(); void WindowGameBottomToolbarInvalidateNewsItem(); - WindowBase* WindowEditorBottomToolbarOpen(); + WindowBase* EditorBottomToolbarOpen(); - WindowBase* WindowTileInspectorOpen(); + WindowBase* TileInspectorOpen(); void WindowTileInspectorClearClipboard(); - WindowBase* WindowEditorObjectSelectionOpen(); + WindowBase* EditorObjectSelectionOpen(); void WindowTooltipReset(const ScreenCoordsXY& screenCoords); void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords); void WindowTooltipOpen(WindowBase* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords); void WindowTooltipClose(); - WindowBase* WindowSceneryScatterOpen(); - WindowBase* WindowPatrolAreaOpen(EntityId staffId); + WindowBase* SceneryScatterOpen(); + WindowBase* PatrolAreaOpen(EntityId staffId); EntityId WindowPatrolAreaGetCurrentStaffId(); // clang-format off diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 3302aff33c..a6f6cebc80 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -2758,7 +2758,7 @@ void NetworkBase::Client_Handle_MAP([[maybe_unused]] NetworkConnection& connecti GameLoadScripts(); GameNotifyMapChanged(); _serverState.tick = GetGameState().CurrentTicks; - // WindowNetworkStatusOpen("Loaded new map from network"); + // NetworkStatusOpen("Loaded new map from network"); _serverState.state = NetworkServerStatus::Ok; _clientMapLoaded = true; gFirstTimeSaving = true; From b07b1e29dc1999ca7b945a0c729204abee40e8bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 11 Mar 2024 16:27:22 +0100 Subject: [PATCH 082/191] Android: Enable more features (networking, multiplayeri, vorbis) --- .../app/src/main/CMakeLists.txt | 80 ++++++++++++++++++- .../main/java/io/openrct2/GameActivity.java | 2 + 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index 54b77f329c..076a16bff7 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -20,7 +20,7 @@ endif() include(ExternalProject) ExternalProject_Add(libs - URL https://github.com/OpenRCT2/openrct2-dependencies-android/releases/download/v10/${ANDROID_ABI}-android-dynamic.tar.zst + URL https://github.com/OpenRCT2/openrct2-dependencies-android/releases/download/v11/${ANDROID_ABI}-android-dynamic.tar.zst SOURCE_DIR "${CMAKE_BINARY_DIR}/libs" @@ -29,6 +29,15 @@ ExternalProject_Add(libs INSTALL_COMMAND "" BUILD_BYPRODUCTS + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}curl${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}vorbis${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}vorbisfile${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}FLAC${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}brotlidec${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}brotlicommon${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}ogg${CMAKE_SHARED_LIBRARY_SUFFIX} + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}bz2${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}freetype${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}png16${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX} @@ -53,6 +62,15 @@ ExternalProject_Add(libs add_custom_command(TARGET libs POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} # COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/*.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libcurl.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libcrypto.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libvorbis.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libvorbisfile.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libFLAC.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libbrotlidec.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libbrotlicommon.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libogg.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libbz2.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libicudata.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libicuuc.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libicui18n.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} @@ -124,13 +142,67 @@ set_target_properties(ssl PROPERTIES IMPORTED_LOCATION ) add_dependencies(ssl libs) +add_library(curl SHARED IMPORTED) +set_target_properties(curl PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}curl${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(curl libs) + +add_library(crypto SHARED IMPORTED) +set_target_properties(crypto PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(crypto libs) + +add_library(vorbis SHARED IMPORTED) +set_target_properties(vorbis PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}vorbis${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(vorbis libs) + +add_library(vorbisfile SHARED IMPORTED) +set_target_properties(vorbisfile PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}vorbisfile${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(vorbisfile libs) + +add_library(FLAC SHARED IMPORTED) +set_target_properties(FLAC PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}FLAC${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(FLAC libs) + +add_library(brotlidec SHARED IMPORTED) +set_target_properties(brotlidec PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}brotlidec${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(brotlidec libs) + +add_library(brotlicommon SHARED IMPORTED) +set_target_properties(brotlicommon PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}brotlicommon${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(brotlicommon libs) + +add_library(ogg SHARED IMPORTED) +set_target_properties(ogg PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}ogg${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(ogg libs) + +add_library(bz2 SHARED IMPORTED) +set_target_properties(bz2 PROPERTIES IMPORTED_LOCATION + ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}bz2${CMAKE_SHARED_LIBRARY_SUFFIX} +) +add_dependencies(bz2 libs) + include_directories(SYSTEM "${CMAKE_BINARY_DIR}/libs/include") include_directories(SYSTEM "${CMAKE_BINARY_DIR}/libs/include/freetype2") include_directories(SYSTEM "${CMAKE_BINARY_DIR}/libs/include/SDL2") # now build app's shared lib -add_definitions(-DDISABLE_DISCORD_RPC -DDISABLE_HTTP -DDISABLE_NETWORK -DDISABLE_FLAC -DDISABLE_VORBIS -DDISABLE_OPENGL -DGL_GLEXT_PROTOTYPES -D__STDC_LIMIT_MACROS -DNO_TTF -DSDL_MAIN_HANDLED) +add_definitions(-DDISABLE_DISCORD_RPC -DDISABLE_OPENGL -DGL_GLEXT_PROTOTYPES -D__STDC_LIMIT_MACROS -DNO_TTF -DSDL_MAIN_HANDLED) # Enable scripting add_definitions(-DENABLE_SCRIPTING) @@ -183,10 +255,10 @@ file(GLOB_RECURSE OPENRCT2_CLI_SOURCES "${ORCT2_ROOT}/src/openrct2-cli/*.hpp") add_library(openrct2 SHARED ${LIBOPENRCT2_SOURCES}) -target_link_libraries(openrct2 android stdc++ log dl SDL2 png z icu icuuc icudata) +target_link_libraries(openrct2 android stdc++ log dl SDL2 png z icu icuuc icudata curl crypto ssl) add_library(openrct2-ui SHARED ${OPENRCT2_GUI_SOURCES}) -target_link_libraries(openrct2-ui openrct2 android stdc++ GLESv1_CM GLESv2 SDL2main speexdsp) +target_link_libraries(openrct2-ui openrct2 android stdc++ GLESv1_CM GLESv2 SDL2main speexdsp brotlicommon brotlidec bz2 freetype ogg vorbis vorbisfile FLAC) add_executable(openrct2-cli ${OPENRCT2_CLI_SOURCES}) target_link_libraries(openrct2-cli openrct2 android stdc++ GLESv1_CM GLESv2) diff --git a/src/openrct2-android/app/src/main/java/io/openrct2/GameActivity.java b/src/openrct2-android/app/src/main/java/io/openrct2/GameActivity.java index 56e51c4595..8ddfeaea6f 100644 --- a/src/openrct2-android/app/src/main/java/io/openrct2/GameActivity.java +++ b/src/openrct2-android/app/src/main/java/io/openrct2/GameActivity.java @@ -80,6 +80,8 @@ public class GameActivity extends SDLActivity { return new String[]{ "c++_shared", "speexdsp", + "bz2", + "freetype", "z", "png16", "SDL2", From 723b9ed5bc19c40439e1590cea3f54f6de2a9728 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 17 Mar 2024 23:29:15 +0100 Subject: [PATCH 083/191] Android: Update Java dependencies --- src/openrct2-android/app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2-android/app/build.gradle b/src/openrct2-android/app/build.gradle index fbd7d4b853..d149a175cf 100644 --- a/src/openrct2-android/app/build.gradle +++ b/src/openrct2-android/app/build.gradle @@ -45,8 +45,8 @@ android { } dependencies { - implementation 'commons-io:commons-io:2.6' - implementation 'androidx.appcompat:appcompat:1.4.0' + implementation 'commons-io:commons-io:2.13.0' + implementation 'androidx.appcompat:appcompat:1.6.1' implementation fileTree(include: ['*.jar'], dir: 'libs') } From 221877fa33a04d18e6a878accf9f69cd5f7899b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 17 Mar 2024 23:30:05 +0100 Subject: [PATCH 084/191] Android: Replace curl dependency with HttpAndroid Java implementation --- .../app/src/main/CMakeLists.txt | 10 +- .../main/java/io/openrct2/HttpAndroid.java | 122 ++++++++++++ src/openrct2/core/Http.Android.cpp | 179 ++++++++++++++++++ src/openrct2/core/Http.cURL.cpp | 2 +- 4 files changed, 303 insertions(+), 10 deletions(-) create mode 100644 src/openrct2-android/app/src/main/java/io/openrct2/HttpAndroid.java create mode 100644 src/openrct2/core/Http.Android.cpp diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index 076a16bff7..bac4e35970 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -29,7 +29,6 @@ ExternalProject_Add(libs INSTALL_COMMAND "" BUILD_BYPRODUCTS - ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}curl${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}vorbis${CMAKE_SHARED_LIBRARY_SUFFIX} ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}vorbisfile${CMAKE_SHARED_LIBRARY_SUFFIX} @@ -62,7 +61,6 @@ ExternalProject_Add(libs add_custom_command(TARGET libs POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} # COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/*.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libcurl.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libcrypto.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libvorbis.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_BINARY_DIR}/libs/lib/libvorbisfile.so" ${CMAKE_LIBRARY_OUTPUT_DIRECTORY} @@ -142,12 +140,6 @@ set_target_properties(ssl PROPERTIES IMPORTED_LOCATION ) add_dependencies(ssl libs) -add_library(curl SHARED IMPORTED) -set_target_properties(curl PROPERTIES IMPORTED_LOCATION - ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}curl${CMAKE_SHARED_LIBRARY_SUFFIX} -) -add_dependencies(curl libs) - add_library(crypto SHARED IMPORTED) set_target_properties(crypto PROPERTIES IMPORTED_LOCATION ${CMAKE_BINARY_DIR}/libs/lib/${CMAKE_SHARED_LIBRARY_PREFIX}crypto${CMAKE_SHARED_LIBRARY_SUFFIX} @@ -255,7 +247,7 @@ file(GLOB_RECURSE OPENRCT2_CLI_SOURCES "${ORCT2_ROOT}/src/openrct2-cli/*.hpp") add_library(openrct2 SHARED ${LIBOPENRCT2_SOURCES}) -target_link_libraries(openrct2 android stdc++ log dl SDL2 png z icu icuuc icudata curl crypto ssl) +target_link_libraries(openrct2 android stdc++ log dl SDL2 png z icu icuuc icudata crypto ssl) add_library(openrct2-ui SHARED ${OPENRCT2_GUI_SOURCES}) target_link_libraries(openrct2-ui openrct2 android stdc++ GLESv1_CM GLESv2 SDL2main speexdsp brotlicommon brotlidec bz2 freetype ogg vorbis vorbisfile FLAC) diff --git a/src/openrct2-android/app/src/main/java/io/openrct2/HttpAndroid.java b/src/openrct2-android/app/src/main/java/io/openrct2/HttpAndroid.java new file mode 100644 index 0000000000..ffb58a1062 --- /dev/null +++ b/src/openrct2-android/app/src/main/java/io/openrct2/HttpAndroid.java @@ -0,0 +1,122 @@ +package io.openrct2; + +import android.util.Log; + +import org.apache.commons.io.IOUtils; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URL; +import java.net.HttpURLConnection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class HttpAndroid { + private static final String TAG = "HttpAndroid"; + + // Corresponding Java enum for the C++ 'Status' enum + public enum Status { + Invalid(0), + Ok(200), + NotFound(404); + + private final int code; + Status(int code) { + this.code = code; + } + + public int getCode() { + return code; + } + } + + // Corresponding Java enum for the C++ 'Method' enum + public enum Method { + GET, + POST, + PUT + } + + // Java class equivalent to the C++ 'Response' struct + public static class Response { + Status status; + String contentType; + String body; + Map> headers; + String error; + + } + + // Java class equivalent to the C++ 'Request' struct + public static class Request { + String url; + Map headers; + Method method; + String body; + boolean forceIPv4; + + public Request() { + this.method = Method.GET; // Default method + } + } + + public static Response request(Request request) { + Response response = new Response(); + response.status = Status.Invalid; + response.error = "Request failed"; + try { + InputStream inputStream = null; + try { + URL url = new URL(request.url); + HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setRequestMethod(request.method.toString()); + connection.setConnectTimeout(10000); + connection.setReadTimeout(10000); + connection.setUseCaches(false); + connection.setDoInput(true); + connection.setInstanceFollowRedirects(true); + if (request.headers != null) { + for (Map.Entry entry : request.headers.entrySet()) { + connection.setRequestProperty(entry.getKey(), entry.getValue()); + } + } + connection.connect(); + if (request.body!= null) { + OutputStream os = connection.getOutputStream(); + os.write(request.body.getBytes()); + os.flush(); + os.close(); + } + int responseCode = connection.getResponseCode(); + if (responseCode == 200) { + inputStream = connection.getInputStream(); + } else { + inputStream = connection.getErrorStream(); + } + // Log + Log.d(TAG, "Request: " + request.url + ", response code: " + responseCode); + response.status = Status.Ok; + response.contentType = connection.getContentType(); + response.headers = connection.getHeaderFields(); + response.body = IOUtils.toString(inputStream, "UTF-8"); + response.error = null; + return response; + } catch (IOException e) { + Log.e(TAG, "Error while requesting " + request.url + ", error: " + e.getMessage(), e); + response.error = e.getMessage(); + return response; + } finally { + if (inputStream != null) { + inputStream.close(); + } + } + } catch (IOException e) { + Log.e(TAG, "Error while requesting " + request.url, e); + response.error = e.getMessage(); + return response; + } + } +} diff --git a/src/openrct2/core/Http.Android.cpp b/src/openrct2/core/Http.Android.cpp new file mode 100644 index 0000000000..67cb15eafc --- /dev/null +++ b/src/openrct2/core/Http.Android.cpp @@ -0,0 +1,179 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#if !defined(DISABLE_HTTP) && defined(__ANDROID__) + +# include "Http.h" + +# include "../Version.h" +# include "../platform/Platform.h" + +# include +# include +# include + +# define OPENRCT2_USER_AGENT "OpenRCT2/" OPENRCT2_VERSION + +namespace Http +{ + Response Do(const Request& req) + { + std::map headers = req.header; + headers["User-Agent"] = OPENRCT2_USER_AGENT; + // Lambda to convert jstring to string + auto jstringToString = [](JNIEnv* env, jstring jstr) -> std::string { + if (jstr == nullptr) + { + return ""; + } + const char* cstr = env->GetStringUTFChars(jstr, nullptr); + std::string str = cstr; + env->ReleaseStringUTFChars(jstr, cstr); + return str; + }; + + JNIEnv* env = (JNIEnv*)SDL_AndroidGetJNIEnv(); + + // Create request object + + jclass HttpAndroidClass = Platform::AndroidFindClass(env, "io/openrct2/HttpAndroid"); + jclass req_class = Platform::AndroidFindClass(env, "io/openrct2/HttpAndroid$Request"); + // New request object + jobject jniRequest = env->NewObject(req_class, env->GetMethodID(req_class, "", "()V")); + // Create request's headers map + jobject jniHeaders = env->NewObject( + env->FindClass("java/util/HashMap"), + env->GetMethodID(env->GetObjectClass(env->FindClass("java/util/HashMap")), "", "()V")); + // HashMap's put method + jmethodID putMethod = env->GetMethodID( + env->FindClass("java/util/HashMap"), "put", "(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;"); + for (const auto& header : headers) + { + jstring jniKey = env->NewStringUTF(header.first.c_str()); + jstring jniValue = env->NewStringUTF(header.second.c_str()); + env->CallObjectMethod(jniHeaders, putMethod, jniKey, jniValue); + } + env->SetObjectField(jniRequest, env->GetFieldID(req_class, "headers", "Ljava/util/Map;"), jniHeaders); + + jstring req_body = req.body.empty() ? nullptr : env->NewStringUTF(req.body.c_str()); + jstring url = req.url.empty() ? nullptr : env->NewStringUTF(req.url.c_str()); + env->SetObjectField(jniRequest, env->GetFieldID(req_class, "body", "Ljava/lang/String;"), req_body); + env->SetObjectField(jniRequest, env->GetFieldID(req_class, "url", "Ljava/lang/String;"), url); + if (req_body != nullptr) + { + env->ReleaseStringUTFChars(req_body, env->GetStringUTFChars(req_body, nullptr)); + } + if (url != nullptr) + { + env->ReleaseStringUTFChars(url, env->GetStringUTFChars(url, nullptr)); + } + std::string method = "GET"; + switch (req.method) + { + case Method::GET: + method = "GET"; + break; + case Method::POST: + method = "POST"; + break; + case Method::PUT: + method = "PUT"; + break; + } + env->SetObjectField( + jniRequest, env->GetFieldID(req_class, "method", "Lio/openrct2/HttpAndroid$Method;"), + env->GetStaticObjectField( + Platform::AndroidFindClass(env, "io/openrct2/HttpAndroid$Method"), + env->GetStaticFieldID( + Platform::AndroidFindClass(env, "io/openrct2/HttpAndroid$Method"), method.c_str(), + "Lio/openrct2/HttpAndroid$Method;"))); + // Call request method + jmethodID requestMethod = env->GetStaticMethodID( + HttpAndroidClass, "request", "(Lio/openrct2/HttpAndroid$Request;)Lio/openrct2/HttpAndroid$Response;"); + jobject jniResponse = env->CallStaticObjectMethod(HttpAndroidClass, requestMethod, jniRequest); + jfieldID statusField = env->GetFieldID(env->GetObjectClass(jniResponse), "status", "Lio/openrct2/HttpAndroid$Status;"); + jobject jniStatus = env->GetObjectField(jniResponse, statusField); + jclass statusClass = Platform::AndroidFindClass(env, "io/openrct2/HttpAndroid$Status"); + jmethodID getCodeMethod = env->GetMethodID(statusClass, "getCode", "()I"); + int code = env->CallIntMethod(jniStatus, getCodeMethod); + + Response response; + + // Get response's headers field + jclass responseClass = env->GetObjectClass(jniResponse); + jfieldID headersField = env->GetFieldID(responseClass, "headers", "Ljava/util/Map;"); + jobject jniHeadersMap = env->GetObjectField(jniResponse, headersField); + + jmethodID entrySetMethod = env->GetMethodID(env->GetObjectClass(jniHeadersMap), "entrySet", "()Ljava/util/Set;"); + jobject jniEntrySet = env->CallObjectMethod(jniHeadersMap, entrySetMethod); + jmethodID iteratorMethod = env->GetMethodID(env->GetObjectClass(jniEntrySet), "iterator", "()Ljava/util/Iterator;"); + jobject jniIterator = env->CallObjectMethod(jniEntrySet, iteratorMethod); + jmethodID hasNextMethod = env->GetMethodID(env->GetObjectClass(jniIterator), "hasNext", "()Z"); + jmethodID nextMethod = env->GetMethodID(env->GetObjectClass(jniIterator), "next", "()Ljava/lang/Object;"); + while (env->CallBooleanMethod(jniIterator, hasNextMethod)) + { + jobject jniNext = env->CallObjectMethod(jniIterator, nextMethod); + jmethodID getKeyMethod = env->GetMethodID(env->GetObjectClass(jniNext), "getKey", "()Ljava/lang/Object;"); + jmethodID getValueMethod = env->GetMethodID(env->GetObjectClass(jniNext), "getValue", "()Ljava/lang/Object;"); + jobject jniKey = env->CallObjectMethod(jniNext, getKeyMethod); + // The first key is always null for some reason, its value contains the status code + if (jniKey == nullptr) + { + env->DeleteLocalRef(jniKey); + env->DeleteLocalRef(jniNext); + continue; + } + jobject jniValue = env->CallObjectMethod(jniNext, getValueMethod); + // convert jniValue to string + jmethodID valueToStringMethod = env->GetMethodID(env->GetObjectClass(jniValue), "toString", "()Ljava/lang/String;"); + jstring jniValueString = (jstring)env->CallObjectMethod(jniValue, valueToStringMethod); + jstring jniKeyString = (jstring)jniKey; + const char* jniKeyChars = env->GetStringUTFChars(jniKeyString, nullptr); + const char* jniValueChars = env->GetStringUTFChars(jniValueString, nullptr); + std::string value = jniValueChars; + std::string key = jniKeyChars; + env->ReleaseStringUTFChars(jniKeyString, jniKeyChars); + env->ReleaseStringUTFChars(jniValueString, jniValueChars); + response.header[key] = value; + + // Cleanup + env->DeleteLocalRef(jniValue); + env->DeleteLocalRef(jniKey); + env->DeleteLocalRef(jniNext); + } + // Get response's body field and convert it to string + jfieldID bodyField = env->GetFieldID(responseClass, "body", "Ljava/lang/String;"); + jstring jniBody = (jstring)env->GetObjectField(jniResponse, bodyField); + // Get response's error field and convert it to string + jfieldID errorField = env->GetFieldID(responseClass, "error", "Ljava/lang/String;"); + jstring jniError = (jstring)env->GetObjectField(jniResponse, errorField); + // Get response's content type field and convert it to string + jfieldID contentTypeField = env->GetFieldID(responseClass, "contentType", "Ljava/lang/String;"); + jstring jniContentType = (jstring)env->GetObjectField(jniResponse, contentTypeField); + // Prepare response + response.error = jstringToString(env, jniError); + response.content_type = jstringToString(env, jniContentType); + response.status = static_cast(code); + response.body = jstringToString(env, jniBody); + + env->DeleteLocalRef(jniResponse); + env->DeleteLocalRef(jniStatus); + env->DeleteLocalRef(jniHeadersMap); + env->DeleteLocalRef(jniBody); + env->DeleteLocalRef(jniContentType); + env->DeleteLocalRef(jniError); + env->DeleteLocalRef(jniHeaders); + env->DeleteLocalRef(jniRequest); + + return response; + } + +} // namespace Http + +#endif diff --git a/src/openrct2/core/Http.cURL.cpp b/src/openrct2/core/Http.cURL.cpp index aef20b4127..67603998f9 100644 --- a/src/openrct2/core/Http.cURL.cpp +++ b/src/openrct2/core/Http.cURL.cpp @@ -7,7 +7,7 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ -#if !defined(DISABLE_HTTP) && !defined(_WIN32) +#if !defined(DISABLE_HTTP) && !defined(_WIN32) && !defined(__ANDROID__) # include "Http.h" From 3a6115b2b5686b7331314ea117cb5d2c090a672f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 17 Mar 2024 23:36:20 +0100 Subject: [PATCH 085/191] Android: Add changelog entry --- distribution/changelog.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 15f587b757..a3ebe2a45c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.10 (in development) ------------------------------------------------------------------------ - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. +- Improved: [#21561, #21631] Enable more features in Android build (plugins, networking, multiplayer, audio formats). - Improved: [#21599] Currency signs now use non-breaking spaces. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. @@ -67,7 +68,7 @@ - Fix: [#21039] Text rendering bleeds pixels through windows. - Fix: [#21054] “No entrance” style is selected by default in the track designer. - Fix: [#21145] [Plugin] setInterval/setTimeout handle conflict. -- Fix: [#21157] [Plugin] Widgets do not redraw correctly when updating disabled or visibility state. +- Fix: [#21157] [Plugin] Widgets do not redraw correctly when updating disabled or visibility state. - Fix: [#21158] [Plugin] Potential crash using setInterval/setTimeout within the callback. - Fix: [#21171] [Plugin] Crash creating entities with no more entity slots available. - Fix: [#21178] Inca Lost City’s scenario description incorrectly states there are height restrictions. From c166d69f22288ab9e32a20419d07fabfdb974eca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 17 Mar 2024 23:43:07 +0100 Subject: [PATCH 086/191] Android: Compile x86_64 as well, needed for emulator --- src/openrct2-android/app/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-android/app/build.gradle b/src/openrct2-android/app/build.gradle index d149a175cf..5041a40b6b 100644 --- a/src/openrct2-android/app/build.gradle +++ b/src/openrct2-android/app/build.gradle @@ -17,7 +17,7 @@ android { arguments '-DANDROID_STL=c++_shared' targets 'openrct2', 'openrct2-ui', 'openrct2-cli' // abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' - abiFilters 'arm64-v8a' + abiFilters 'arm64-v8a', 'x86_64' } } } From 5a70fd97fbaf83fcb4d67881f4d44d469217fbcf Mon Sep 17 00:00:00 2001 From: Duncan Date: Wed, 20 Mar 2024 11:14:52 +0000 Subject: [PATCH 087/191] Move vehicle sounds update into Ui library (#21577) * Move vehicle sounds update into Ui library * Add missing statics * Apply review comments * Sprinkle some const * Clang format accumulate --- src/openrct2-ui/WindowManager.cpp | 5 + src/openrct2-ui/interface/Window.cpp | 28 ++ src/openrct2-ui/interface/Window.h | 3 + src/openrct2-ui/libopenrct2ui.vcxproj | 2 + src/openrct2-ui/ride/VehicleSounds.cpp | 605 +++++++++++++++++++++++++ src/openrct2-ui/ride/VehicleSounds.h | 6 + src/openrct2/interface/Window.cpp | 25 - src/openrct2/interface/Window.h | 3 - src/openrct2/ride/Vehicle.cpp | 592 +----------------------- src/openrct2/ride/Vehicle.h | 4 - src/openrct2/windows/Intent.h | 1 + 11 files changed, 654 insertions(+), 620 deletions(-) create mode 100644 src/openrct2-ui/ride/VehicleSounds.cpp create mode 100644 src/openrct2-ui/ride/VehicleSounds.h diff --git a/src/openrct2-ui/WindowManager.cpp b/src/openrct2-ui/WindowManager.cpp index 7c98b8b031..f9f37aa088 100644 --- a/src/openrct2-ui/WindowManager.cpp +++ b/src/openrct2-ui/WindowManager.cpp @@ -10,6 +10,7 @@ #include "WindowManager.h" #include "interface/Theme.h" +#include "ride/VehicleSounds.h" #include "windows/Window.h" #include @@ -510,6 +511,10 @@ public: WindowInvalidateByClass(WindowClass::Research); break; + case INTENT_ACTION_UPDATE_VEHICLE_SOUNDS: + OpenRCT2::Audio::UpdateVehicleSounds(); + break; + case INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL: TrackPlaceClearProvisionalTemporarily(); break; diff --git a/src/openrct2-ui/interface/Window.cpp b/src/openrct2-ui/interface/Window.cpp index b594080f9a..f8c2936f76 100644 --- a/src/openrct2-ui/interface/Window.cpp +++ b/src/openrct2-ui/interface/Window.cpp @@ -832,3 +832,31 @@ ScreenCoordsXY WindowGetViewportSoundIconPos(WindowBase& w) const uint8_t buttonOffset = (gConfigInterface.WindowButtonsOnTheLeft) ? CloseButtonWidth + 2 : 0; return w.windowPos + ScreenCoordsXY{ 2 + buttonOffset, 2 }; } + +namespace OpenRCT2::Ui::Windows +{ + WindowBase* WindowGetListening() + { + for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) + { + auto& w = **it; + if (w.flags & WF_DEAD) + continue; + + auto viewport = w.viewport; + if (viewport != nullptr) + { + if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) + { + return &w; + } + } + } + return nullptr; + } + + WindowClass WindowGetClassification(const WindowBase& window) + { + return window.classification; + } +} // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/interface/Window.h b/src/openrct2-ui/interface/Window.h index 0356e779e7..4542f32638 100644 --- a/src/openrct2-ui/interface/Window.h +++ b/src/openrct2-ui/interface/Window.h @@ -70,4 +70,7 @@ namespace OpenRCT2::Ui::Windows void WindowTileInspectorKeyboardShortcutToggleInvisibility(); extern const StringId ColourSchemeNames[4]; + + WindowBase* WindowGetListening(); + WindowClass WindowGetClassification(const WindowBase& window); } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/libopenrct2ui.vcxproj b/src/openrct2-ui/libopenrct2ui.vcxproj index 358c1577d7..0ab8e83b43 100644 --- a/src/openrct2-ui/libopenrct2ui.vcxproj +++ b/src/openrct2-ui/libopenrct2ui.vcxproj @@ -74,6 +74,7 @@ + @@ -133,6 +134,7 @@ + diff --git a/src/openrct2-ui/ride/VehicleSounds.cpp b/src/openrct2-ui/ride/VehicleSounds.cpp new file mode 100644 index 0000000000..e848ffd36d --- /dev/null +++ b/src/openrct2-ui/ride/VehicleSounds.cpp @@ -0,0 +1,605 @@ +#include "VehicleSounds.h" + +#include "../interface/Viewport.h" +#include "../interface/Window.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace OpenRCT2::Audio +{ + namespace + { + template class TrainIterator; + template class Train + { + public: + explicit Train(T* vehicle) + : FirstCar(vehicle) + { + assert(FirstCar->IsHead()); + } + int32_t GetMass() const; + + friend class TrainIterator; + using iterator = TrainIterator; + iterator begin() const + { + return iterator{ FirstCar }; + } + iterator end() const + { + return iterator{}; + } + + private: + T* FirstCar; + }; + template class TrainIterator + { + public: + using iterator = TrainIterator; + using iterator_category = std::forward_iterator_tag; + using value_type = T; + using pointer = T*; + using reference = T&; + + TrainIterator() = default; + explicit TrainIterator(T* vehicle) + : Current(vehicle) + { + } + reference operator*() const + { + return *Current; + } + iterator& operator++() + { + Current = GetEntity(NextVehicleId); + if (Current != nullptr) + { + NextVehicleId = Current->next_vehicle_on_train; + } + return *this; + } + iterator operator++(int) + { + iterator temp = *this; + ++*this; + return temp; + } + bool operator!=(const iterator& other) const + { + return Current != other.Current; + } + + private: + T* Current = nullptr; + EntityId NextVehicleId = EntityId::GetNull(); + }; + } // namespace + + template int32_t Train::GetMass() const + { + return std::accumulate( + begin(), end(), 0, [](int32_t totalMass, const Vehicle& vehicle) { return totalMass + vehicle.mass; }); + } + + static bool SoundCanPlay(const Vehicle& vehicle) + { + if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) + return false; + + if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && GetGameState().EditorStep != EditorStep::RollercoasterDesigner) + return false; + + if (vehicle.sound1_id == SoundId::Null && vehicle.sound2_id == SoundId::Null) + return false; + + if (vehicle.x == LOCATION_NULL) + return false; + + if (g_music_tracking_viewport == nullptr) + return false; + + const auto quarter_w = g_music_tracking_viewport->view_width / 4; + const auto quarter_h = g_music_tracking_viewport->view_height / 4; + + auto left = g_music_tracking_viewport->viewPos.x; + auto bottom = g_music_tracking_viewport->viewPos.y; + + if (Ui::Windows::WindowGetClassification(*gWindowAudioExclusive) == WindowClass::MainWindow) + { + left -= quarter_w; + bottom -= quarter_h; + } + + if (left >= vehicle.SpriteData.SpriteRect.GetRight() || bottom >= vehicle.SpriteData.SpriteRect.GetBottom()) + return false; + + auto right = g_music_tracking_viewport->view_width + left; + auto top = g_music_tracking_viewport->view_height + bottom; + + if (Ui::Windows::WindowGetClassification(*gWindowAudioExclusive) == WindowClass::MainWindow) + { + right += quarter_w + quarter_w; + top += quarter_h + quarter_h; + } + + if (right < vehicle.SpriteData.SpriteRect.GetRight() || top < vehicle.SpriteData.SpriteRect.GetTop()) + return false; + + return true; + } + + /** + * + * rct2: 0x006BC2F3 + */ + static uint16_t GetSoundPriority(const Vehicle& vehicle) + { + int32_t result = Train(&vehicle).GetMass() + (std::abs(vehicle.velocity) >> 13); + + for (const auto& vehicleSound : gVehicleSoundList) + { + if (vehicleSound.id == vehicle.Id.ToUnderlying()) + { + // Vehicle sounds will get higher priority if they are already playing + return result + 300; + } + } + + return result; + } + + static VehicleSoundParams CreateSoundParam(const Vehicle& vehicle, uint16_t priority) + { + VehicleSoundParams param; + param.priority = priority; + int32_t panX = (vehicle.SpriteData.SpriteRect.GetLeft() / 2) + (vehicle.SpriteData.SpriteRect.GetRight() / 2) + - g_music_tracking_viewport->viewPos.x; + panX = g_music_tracking_viewport->zoom.ApplyInversedTo(panX); + panX += g_music_tracking_viewport->pos.x; + + uint16_t screenWidth = ContextGetWidth(); + if (screenWidth < 64) + { + screenWidth = 64; + } + param.pan_x = ((((panX * 65536) / screenWidth) - 0x8000) >> 4); + + int32_t panY = (vehicle.SpriteData.SpriteRect.GetTop() / 2) + (vehicle.SpriteData.SpriteRect.GetBottom() / 2) + - g_music_tracking_viewport->viewPos.y; + panY = g_music_tracking_viewport->zoom.ApplyInversedTo(panY); + panY += g_music_tracking_viewport->pos.y; + + uint16_t screenHeight = ContextGetHeight(); + if (screenHeight < 64) + { + screenHeight = 64; + } + param.pan_y = ((((panY * 65536) / screenHeight) - 0x8000) >> 4); + + int32_t frequency = std::abs(vehicle.velocity); + + const auto* rideType = vehicle.GetRideEntry(); + if (rideType != nullptr) + { + if (rideType->Cars[vehicle.vehicle_type].double_sound_frequency & 1) + { + frequency *= 2; + } + } + + // * 0.0105133... + frequency >>= 5; // /32 + frequency *= 5512; + frequency >>= 14; // /16384 + + frequency += 11025; + frequency += 16 * vehicle.sound_vector_factor; + param.frequency = static_cast(frequency); + param.id = vehicle.Id.ToUnderlying(); + param.volume = 0; + + if (vehicle.x != LOCATION_NULL) + { + auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ vehicle.x, vehicle.y }); + + // vehicle underground + if (surfaceElement != nullptr && surfaceElement->GetBaseZ() > vehicle.z) + { + param.volume = 0x30; + } + } + return param; + } + + /** + * + * rct2: 0x006BB9FF + */ + static void UpdateSoundParams( + const Vehicle& vehicle, FixedVector& vehicleSoundParamsList) + { + if (!SoundCanPlay(vehicle)) + return; + + uint16_t soundPriority = GetSoundPriority(vehicle); + // Find a sound param of lower priority to use + auto soundParamIter = std::find_if( + vehicleSoundParamsList.begin(), vehicleSoundParamsList.end(), + [soundPriority](const auto& param) { return soundPriority > param.priority; }); + + if (soundParamIter == std::end(vehicleSoundParamsList)) + { + if (vehicleSoundParamsList.size() < MaxVehicleSounds) + { + vehicleSoundParamsList.push_back(CreateSoundParam(vehicle, soundPriority)); + } + } + else + { + if (vehicleSoundParamsList.size() < MaxVehicleSounds) + { + // Shift all sound params down one if using a free space + vehicleSoundParamsList.insert(soundParamIter, CreateSoundParam(vehicle, soundPriority)); + } + else + { + *soundParamIter = CreateSoundParam(vehicle, soundPriority); + } + } + } + + static void VehicleSoundsUpdateWindowSetup() + { + g_music_tracking_viewport = nullptr; + + WindowBase* window = Ui::Windows::WindowGetListening(); + if (window == nullptr) + { + return; + } + + Viewport* viewport = WindowGetViewport(window); + if (viewport == nullptr) + { + return; + } + + g_music_tracking_viewport = viewport; + gWindowAudioExclusive = window; + if (viewport->zoom <= ZoomLevel{ 0 }) + gVolumeAdjustZoom = 0; + else if (viewport->zoom == ZoomLevel{ 1 }) + gVolumeAdjustZoom = 35; + else + gVolumeAdjustZoom = 70; + } + + static uint8_t VehicleSoundsUpdateGetPanVolume(VehicleSoundParams* sound_params) + { + uint8_t vol1 = 0xFF; + uint8_t vol2 = 0xFF; + + int16_t pan_y = std::abs(sound_params->pan_y); + pan_y = std::min(static_cast(0xFFF), pan_y); + pan_y -= 0x800; + if (pan_y > 0) + { + pan_y = (0x400 - pan_y) / 4; + vol1 = LoByte(pan_y); + if (static_cast(HiByte(pan_y)) != 0) + { + vol1 = 0xFF; + if (static_cast(HiByte(pan_y)) < 0) + { + vol1 = 0; + } + } + } + + int16_t pan_x = std::abs(sound_params->pan_x); + pan_x = std::min(static_cast(0xFFF), pan_x); + pan_x -= 0x800; + + if (pan_x > 0) + { + pan_x = (0x400 - pan_x) / 4; + vol2 = LoByte(pan_x); + if (static_cast(HiByte(pan_x)) != 0) + { + vol2 = 0xFF; + if (static_cast(HiByte(pan_x)) < 0) + { + vol2 = 0; + } + } + } + + vol1 = std::min(vol1, vol2); + return std::max(0, vol1 - gVolumeAdjustZoom); + } + + /* Returns the vehicle sound for a sound_param. + * + * If already playing returns sound. + * If not playing allocates a sound slot to sound_param->id. + * If no free slots returns nullptr. + */ + static VehicleSound* VehicleSoundsUpdateGetVehicleSound(VehicleSoundParams* sound_params) + { + // Search for already playing vehicle sound + for (auto& vehicleSound : gVehicleSoundList) + { + if (vehicleSound.id == sound_params->id) + return &vehicleSound; + } + + // No sound already playing + for (auto& vehicleSound : gVehicleSoundList) + { + // Use free slot + if (vehicleSound.id == SoundIdNull) + { + vehicleSound.id = sound_params->id; + vehicleSound.TrackSound.Id = SoundId::Null; + vehicleSound.OtherSound.Id = SoundId::Null; + vehicleSound.volume = 0x30; + return &vehicleSound; + } + } + + return nullptr; + } + + static bool IsLoopingSound(SoundId id) + { + switch (id) + { + case SoundId::LiftClassic: + case SoundId::TrackFrictionClassicWood: + case SoundId::FrictionClassic: + case SoundId::LiftFrictionWheels: + case SoundId::GoKartEngine: + case SoundId::TrackFrictionTrain: + case SoundId::TrackFrictionWater: + case SoundId::LiftArrow: + case SoundId::LiftWood: + case SoundId::TrackFrictionWood: + case SoundId::LiftWildMouse: + case SoundId::LiftBM: + case SoundId::TrackFrictionBM: + case SoundId::LiftRMC: + case SoundId::TrackFrictionRMC: + return true; + default: + return false; + } + } + + static bool IsFixedFrequencySound(SoundId id) + { + switch (id) + { + case SoundId::Scream1: + case SoundId::Scream2: + case SoundId::Scream3: + case SoundId::Scream4: + case SoundId::Scream5: + case SoundId::Scream6: + case SoundId::Scream7: + case SoundId::Scream8: + case SoundId::TrainWhistle: + case SoundId::TrainDeparting: + case SoundId::Tram: + return true; + default: + return false; + } + } + + static bool IsSpecialFrequencySound(SoundId id) + { + switch (id) + { + case SoundId::TrackFrictionBM: + case SoundId::TrackFrictionRMC: + return true; + default: + return false; + } + } + + enum class SoundType + { + TrackNoises, + OtherNoises, // e.g. Screams + }; + + template static uint16_t SoundFrequency(const SoundId id, uint16_t baseFrequency) + { + if constexpr (type == SoundType::TrackNoises) + { + if (IsSpecialFrequencySound(id)) + { + return (baseFrequency / 2) + 4000; + } + return baseFrequency; + } + else + { + if (IsFixedFrequencySound(id)) + { + return 22050; + } + return std::min((baseFrequency * 2) - 3248, 25700); + } + } + + template static bool ShouldUpdateChannelRate(const SoundId id) + { + return type == SoundType::TrackNoises || !IsFixedFrequencySound(id); + } + + template + static void UpdateSound(const SoundId id, int32_t volume, VehicleSoundParams* sound_params, Sound& sound, uint8_t panVol) + { + volume *= panVol; + volume = volume / 8; + volume = std::max(volume - 0x1FFF, -10000); + + if (sound.Channel != nullptr && sound.Channel->IsDone()) + { + sound.Id = SoundId::Null; + sound.Channel = nullptr; + } + if (id != sound.Id && sound.Id != SoundId::Null) + { + sound.Id = SoundId::Null; + sound.Channel->Stop(); + } + if (id == SoundId::Null) + { + return; + } + + if (sound.Id == SoundId::Null) + { + auto frequency = SoundFrequency(id, sound_params->frequency); + auto looping = IsLoopingSound(id); + auto pan = sound_params->pan_x; + auto channel = CreateAudioChannel( + id, looping, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), false); + if (channel != nullptr) + { + sound.Id = id; + sound.Pan = sound_params->pan_x; + sound.Volume = volume; + sound.Frequency = sound_params->frequency; + sound.Channel = channel; + } + else + { + sound.Id = SoundId::Null; + } + return; + } + if (volume != sound.Volume) + { + sound.Volume = volume; + sound.Channel->SetVolume(DStoMixerVolume(volume)); + } + if (sound_params->pan_x != sound.Pan) + { + sound.Pan = sound_params->pan_x; + sound.Channel->SetPan(DStoMixerPan(sound_params->pan_x)); + } + if (!(GetGameState().CurrentTicks & 3) && sound_params->frequency != sound.Frequency) + { + sound.Frequency = sound_params->frequency; + if (ShouldUpdateChannelRate(id)) + { + uint16_t frequency = SoundFrequency(id, sound_params->frequency); + sound.Channel->SetRate(DStoMixerRate(frequency)); + } + } + } + + /** + * + * rct2: 0x006BBC6B + */ + void UpdateVehicleSounds() + { + PROFILED_FUNCTION(); + + if (!IsAvailable()) + return; + + FixedVector vehicleSoundParamsList; + + VehicleSoundsUpdateWindowSetup(); + + for (auto vehicle : TrainManager::View()) + { + UpdateSoundParams(*vehicle, vehicleSoundParamsList); + } + + // Stop all playing sounds that no longer have priority to play after vehicle_update_sound_params + for (auto& vehicleSound : gVehicleSoundList) + { + if (vehicleSound.id != SoundIdNull) + { + bool keepPlaying = false; + for (auto vehicleSoundParams : vehicleSoundParamsList) + { + if (vehicleSound.id == vehicleSoundParams.id) + { + keepPlaying = true; + break; + } + } + + if (keepPlaying) + continue; + + if (vehicleSound.TrackSound.Id != SoundId::Null) + { + vehicleSound.TrackSound.Channel->Stop(); + } + if (vehicleSound.OtherSound.Id != SoundId::Null) + { + vehicleSound.OtherSound.Channel->Stop(); + } + vehicleSound.id = SoundIdNull; + } + } + + for (auto& vehicleSoundParams : vehicleSoundParamsList) + { + uint8_t panVol = VehicleSoundsUpdateGetPanVolume(&vehicleSoundParams); + + auto* vehicleSound = VehicleSoundsUpdateGetVehicleSound(&vehicleSoundParams); + // No free vehicle sound slots (RCT2 corrupts the pointer here) + if (vehicleSound == nullptr) + continue; + + // Move the Sound Volume towards the SoundsParam Volume + int32_t tempvolume = vehicleSound->volume; + if (tempvolume != vehicleSoundParams.volume) + { + if (tempvolume < vehicleSoundParams.volume) + { + tempvolume += 4; + } + else + { + tempvolume -= 4; + } + } + vehicleSound->volume = tempvolume; + panVol = std::max(0, panVol - tempvolume); + + Vehicle* vehicle = GetEntity(EntityId::FromUnderlying(vehicleSoundParams.id)); + if (vehicle != nullptr) + { + UpdateSound( + vehicle->sound1_id, vehicle->sound1_volume, &vehicleSoundParams, vehicleSound->TrackSound, panVol); + UpdateSound( + vehicle->sound2_id, vehicle->sound2_volume, &vehicleSoundParams, vehicleSound->OtherSound, panVol); + } + } + } +} // namespace OpenRCT2::Audio diff --git a/src/openrct2-ui/ride/VehicleSounds.h b/src/openrct2-ui/ride/VehicleSounds.h new file mode 100644 index 0000000000..509aa6006a --- /dev/null +++ b/src/openrct2-ui/ride/VehicleSounds.h @@ -0,0 +1,6 @@ +#pragma once + +namespace OpenRCT2::Audio +{ + void UpdateVehicleSounds(); +} diff --git a/src/openrct2/interface/Window.cpp b/src/openrct2/interface/Window.cpp index 4d7b2898a1..b1f34b9fb6 100644 --- a/src/openrct2/interface/Window.cpp +++ b/src/openrct2/interface/Window.cpp @@ -1841,31 +1841,6 @@ Viewport* WindowGetViewport(WindowBase* w) return w->viewport; } -WindowBase* WindowGetListening() -{ - for (auto it = g_window_list.rbegin(); it != g_window_list.rend(); it++) - { - auto& w = **it; - if (w.flags & WF_DEAD) - continue; - - auto viewport = w.viewport; - if (viewport != nullptr) - { - if (viewport->flags & VIEWPORT_FLAG_SOUND_ON) - { - return &w; - } - } - } - return nullptr; -} - -WindowClass WindowGetClassification(const WindowBase& window) -{ - return window.classification; -} - /** * * rct2: 0x006EAF26 diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 800a20d703..2f43fd04c7 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -643,6 +643,3 @@ money64 PlaceProvisionalTrackPiece( const CoordsXYZ& trackPos); extern RideConstructionState _rideConstructionState2; - -WindowBase* WindowGetListening(); -WindowClass WindowGetClassification(const WindowBase& window); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 06a6a5442b..ffe7b8e429 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -35,6 +35,8 @@ #include "../scenario/Scenario.h" #include "../scripting/HookEngine.h" #include "../scripting/ScriptEngine.h" +#include "../ui/UiContext.h" +#include "../ui/WindowManager.h" #include "../util/Util.h" #include "../windows/Intent.h" #include "../world/Map.h" @@ -577,596 +579,10 @@ Vehicle* TryGetVehicle(EntityId spriteIndex) return TryGetEntity(spriteIndex); } -namespace -{ - template class TrainIterator; - template class Train - { - public: - explicit Train(T* vehicle) - : FirstCar(vehicle) - { - assert(FirstCar->IsHead()); - } - int32_t Mass(); - - friend class TrainIterator; - using iterator = TrainIterator; - iterator begin() - { - return iterator{ FirstCar }; - } - iterator end() - { - return iterator{}; - } - - private: - T* FirstCar; - }; - template class TrainIterator - { - public: - using iterator = TrainIterator; - using iterator_category = std::forward_iterator_tag; - using value_type = T; - using pointer = T*; - using reference = T&; - - TrainIterator() = default; - explicit TrainIterator(T* vehicle) - : Current(vehicle) - { - } - reference operator*() - { - return *Current; - } - iterator& operator++() - { - Current = GetEntity(NextVehicleId); - if (Current != nullptr) - { - NextVehicleId = Current->next_vehicle_on_train; - } - return *this; - } - iterator operator++(int) - { - iterator temp = *this; - ++*this; - return temp; - } - bool operator!=(const iterator& other) - { - return Current != other.Current; - } - - private: - T* Current = nullptr; - EntityId NextVehicleId = EntityId::GetNull(); - }; -} // namespace - -template int32_t Train::Mass() -{ - int32_t totalMass = 0; - for (const auto& vehicle : *this) - { - totalMass += vehicle.mass; - } - - return totalMass; -} - -bool Vehicle::SoundCanPlay() const -{ - if (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) - return false; - - if ((gScreenFlags & SCREEN_FLAGS_TRACK_DESIGNER) && GetGameState().EditorStep != EditorStep::RollercoasterDesigner) - return false; - - if (sound1_id == OpenRCT2::Audio::SoundId::Null && sound2_id == OpenRCT2::Audio::SoundId::Null) - return false; - - if (x == LOCATION_NULL) - return false; - - if (g_music_tracking_viewport == nullptr) - return false; - - const auto quarter_w = g_music_tracking_viewport->view_width / 4; - const auto quarter_h = g_music_tracking_viewport->view_height / 4; - - auto left = g_music_tracking_viewport->viewPos.x; - auto bottom = g_music_tracking_viewport->viewPos.y; - - if (WindowGetClassification(*gWindowAudioExclusive) == WindowClass::MainWindow) - { - left -= quarter_w; - bottom -= quarter_h; - } - - if (left >= SpriteData.SpriteRect.GetRight() || bottom >= SpriteData.SpriteRect.GetBottom()) - return false; - - auto right = g_music_tracking_viewport->view_width + left; - auto top = g_music_tracking_viewport->view_height + bottom; - - if (WindowGetClassification(*gWindowAudioExclusive) == WindowClass::MainWindow) - { - right += quarter_w + quarter_w; - top += quarter_h + quarter_h; - } - - if (right < SpriteData.SpriteRect.GetRight() || top < SpriteData.SpriteRect.GetTop()) - return false; - - return true; -} - -/** - * - * rct2: 0x006BC2F3 - */ -uint16_t Vehicle::GetSoundPriority() const -{ - int32_t result = Train(this).Mass() + (std::abs(velocity) >> 13); - - for (const auto& vehicleSound : OpenRCT2::Audio::gVehicleSoundList) - { - if (vehicleSound.id == Id.ToUnderlying()) - { - // Vehicle sounds will get higher priority if they are already playing - return result + 300; - } - } - - return result; -} - -OpenRCT2::Audio::VehicleSoundParams Vehicle::CreateSoundParam(uint16_t priority) const -{ - OpenRCT2::Audio::VehicleSoundParams param; - param.priority = priority; - int32_t panX = (SpriteData.SpriteRect.GetLeft() / 2) + (SpriteData.SpriteRect.GetRight() / 2) - - g_music_tracking_viewport->viewPos.x; - panX = g_music_tracking_viewport->zoom.ApplyInversedTo(panX); - panX += g_music_tracking_viewport->pos.x; - - uint16_t screenWidth = ContextGetWidth(); - if (screenWidth < 64) - { - screenWidth = 64; - } - param.pan_x = ((((panX * 65536) / screenWidth) - 0x8000) >> 4); - - int32_t panY = (SpriteData.SpriteRect.GetTop() / 2) + (SpriteData.SpriteRect.GetBottom() / 2) - - g_music_tracking_viewport->viewPos.y; - panY = g_music_tracking_viewport->zoom.ApplyInversedTo(panY); - panY += g_music_tracking_viewport->pos.y; - - uint16_t screenHeight = ContextGetHeight(); - if (screenHeight < 64) - { - screenHeight = 64; - } - param.pan_y = ((((panY * 65536) / screenHeight) - 0x8000) >> 4); - - int32_t frequency = std::abs(velocity); - - const auto* rideType = GetRideEntry(); - if (rideType != nullptr) - { - if (rideType->Cars[vehicle_type].double_sound_frequency & 1) - { - frequency *= 2; - } - } - - // * 0.0105133... - frequency >>= 5; // /32 - frequency *= 5512; - frequency >>= 14; // /16384 - - frequency += 11025; - frequency += 16 * sound_vector_factor; - param.frequency = static_cast(frequency); - param.id = Id.ToUnderlying(); - param.volume = 0; - - if (x != LOCATION_NULL) - { - auto surfaceElement = MapGetSurfaceElementAt(CoordsXY{ x, y }); - - // vehicle underground - if (surfaceElement != nullptr && surfaceElement->GetBaseZ() > z) - { - param.volume = 0x30; - } - } - return param; -} - -/** - * - * rct2: 0x006BB9FF - */ -void Vehicle::UpdateSoundParams(std::vector& vehicleSoundParamsList) const -{ - if (!SoundCanPlay()) - return; - - uint16_t soundPriority = GetSoundPriority(); - // Find a sound param of lower priority to use - auto soundParamIter = std::find_if( - vehicleSoundParamsList.begin(), vehicleSoundParamsList.end(), - [soundPriority](const auto& param) { return soundPriority > param.priority; }); - - if (soundParamIter == std::end(vehicleSoundParamsList)) - { - if (vehicleSoundParamsList.size() < OpenRCT2::Audio::MaxVehicleSounds) - { - vehicleSoundParamsList.push_back(CreateSoundParam(soundPriority)); - } - } - else - { - if (vehicleSoundParamsList.size() < OpenRCT2::Audio::MaxVehicleSounds) - { - // Shift all sound params down one if using a free space - vehicleSoundParamsList.insert(soundParamIter, CreateSoundParam(soundPriority)); - } - else - { - *soundParamIter = CreateSoundParam(soundPriority); - } - } -} - -static void vehicle_sounds_update_window_setup() -{ - g_music_tracking_viewport = nullptr; - - WindowBase* window = WindowGetListening(); - if (window == nullptr) - { - return; - } - - Viewport* viewport = WindowGetViewport(window); - if (viewport == nullptr) - { - return; - } - - g_music_tracking_viewport = viewport; - gWindowAudioExclusive = window; - if (viewport->zoom <= ZoomLevel{ 0 }) - OpenRCT2::Audio::gVolumeAdjustZoom = 0; - else if (viewport->zoom == ZoomLevel{ 1 }) - OpenRCT2::Audio::gVolumeAdjustZoom = 35; - else - OpenRCT2::Audio::gVolumeAdjustZoom = 70; -} - -static uint8_t vehicle_sounds_update_get_pan_volume(OpenRCT2::Audio::VehicleSoundParams* sound_params) -{ - uint8_t vol1 = 0xFF; - uint8_t vol2 = 0xFF; - - int16_t pan_y = std::abs(sound_params->pan_y); - pan_y = std::min(static_cast(0xFFF), pan_y); - pan_y -= 0x800; - if (pan_y > 0) - { - pan_y = (0x400 - pan_y) / 4; - vol1 = LoByte(pan_y); - if (static_cast(HiByte(pan_y)) != 0) - { - vol1 = 0xFF; - if (static_cast(HiByte(pan_y)) < 0) - { - vol1 = 0; - } - } - } - - int16_t pan_x = std::abs(sound_params->pan_x); - pan_x = std::min(static_cast(0xFFF), pan_x); - pan_x -= 0x800; - - if (pan_x > 0) - { - pan_x = (0x400 - pan_x) / 4; - vol2 = LoByte(pan_x); - if (static_cast(HiByte(pan_x)) != 0) - { - vol2 = 0xFF; - if (static_cast(HiByte(pan_x)) < 0) - { - vol2 = 0; - } - } - } - - vol1 = std::min(vol1, vol2); - return std::max(0, vol1 - OpenRCT2::Audio::gVolumeAdjustZoom); -} - -/* Returns the vehicle sound for a sound_param. - * - * If already playing returns sound. - * If not playing allocates a sound slot to sound_param->id. - * If no free slots returns nullptr. - */ -static OpenRCT2::Audio::VehicleSound* vehicle_sounds_update_get_vehicle_sound(OpenRCT2::Audio::VehicleSoundParams* sound_params) -{ - // Search for already playing vehicle sound - for (auto& vehicleSound : OpenRCT2::Audio::gVehicleSoundList) - { - if (vehicleSound.id == sound_params->id) - return &vehicleSound; - } - - // No sound already playing - for (auto& vehicleSound : OpenRCT2::Audio::gVehicleSoundList) - { - // Use free slot - if (vehicleSound.id == OpenRCT2::Audio::SoundIdNull) - { - vehicleSound.id = sound_params->id; - vehicleSound.TrackSound.Id = OpenRCT2::Audio::SoundId::Null; - vehicleSound.OtherSound.Id = OpenRCT2::Audio::SoundId::Null; - vehicleSound.volume = 0x30; - return &vehicleSound; - } - } - - return nullptr; -} - -static bool IsLoopingSound(SoundId id) -{ - switch (id) - { - case SoundId::LiftClassic: - case SoundId::TrackFrictionClassicWood: - case SoundId::FrictionClassic: - case SoundId::LiftFrictionWheels: - case SoundId::GoKartEngine: - case SoundId::TrackFrictionTrain: - case SoundId::TrackFrictionWater: - case SoundId::LiftArrow: - case SoundId::LiftWood: - case SoundId::TrackFrictionWood: - case SoundId::LiftWildMouse: - case SoundId::LiftBM: - case SoundId::TrackFrictionBM: - case SoundId::LiftRMC: - case SoundId::TrackFrictionRMC: - return true; - default: - return false; - } -} - -static bool IsFixedFrequencySound(SoundId id) -{ - switch (id) - { - case SoundId::Scream1: - case SoundId::Scream2: - case SoundId::Scream3: - case SoundId::Scream4: - case SoundId::Scream5: - case SoundId::Scream6: - case SoundId::Scream7: - case SoundId::Scream8: - case SoundId::TrainWhistle: - case SoundId::TrainDeparting: - case SoundId::Tram: - return true; - default: - return false; - } -} - -static bool IsSpecialFrequencySound(SoundId id) -{ - switch (id) - { - case SoundId::TrackFrictionBM: - case SoundId::TrackFrictionRMC: - return true; - default: - return false; - } -} - -enum class SoundType -{ - TrackNoises, - OtherNoises, // e.g. Screams -}; - -template static uint16_t SoundFrequency(const OpenRCT2::Audio::SoundId id, uint16_t baseFrequency) -{ - if constexpr (type == SoundType::TrackNoises) - { - if (IsSpecialFrequencySound(id)) - { - return (baseFrequency / 2) + 4000; - } - return baseFrequency; - } - else - { - if (IsFixedFrequencySound(id)) - { - return 22050; - } - return std::min((baseFrequency * 2) - 3248, 25700); - } -} - -template static bool ShouldUpdateChannelRate(const OpenRCT2::Audio::SoundId id) -{ - return type == SoundType::TrackNoises || !IsFixedFrequencySound(id); -} - -template -static void UpdateSound( - const OpenRCT2::Audio::SoundId id, int32_t volume, OpenRCT2::Audio::VehicleSoundParams* sound_params, - OpenRCT2::Audio::Sound& sound, uint8_t panVol) -{ - volume *= panVol; - volume = volume / 8; - volume = std::max(volume - 0x1FFF, -10000); - - if (sound.Channel != nullptr && sound.Channel->IsDone()) - { - sound.Id = OpenRCT2::Audio::SoundId::Null; - sound.Channel = nullptr; - } - if (id != sound.Id && sound.Id != OpenRCT2::Audio::SoundId::Null) - { - sound.Id = OpenRCT2::Audio::SoundId::Null; - sound.Channel->Stop(); - } - if (id == OpenRCT2::Audio::SoundId::Null) - { - return; - } - - if (sound.Id == OpenRCT2::Audio::SoundId::Null) - { - auto frequency = SoundFrequency(id, sound_params->frequency); - auto looping = IsLoopingSound(id); - auto pan = sound_params->pan_x; - auto channel = CreateAudioChannel( - id, looping, DStoMixerVolume(volume), DStoMixerPan(pan), DStoMixerRate(frequency), false); - if (channel != nullptr) - { - sound.Id = id; - sound.Pan = sound_params->pan_x; - sound.Volume = volume; - sound.Frequency = sound_params->frequency; - sound.Channel = channel; - } - else - { - sound.Id = OpenRCT2::Audio::SoundId::Null; - } - return; - } - if (volume != sound.Volume) - { - sound.Volume = volume; - sound.Channel->SetVolume(DStoMixerVolume(volume)); - } - if (sound_params->pan_x != sound.Pan) - { - sound.Pan = sound_params->pan_x; - sound.Channel->SetPan(DStoMixerPan(sound_params->pan_x)); - } - if (!(GetGameState().CurrentTicks & 3) && sound_params->frequency != sound.Frequency) - { - sound.Frequency = sound_params->frequency; - if (ShouldUpdateChannelRate(id)) - { - uint16_t frequency = SoundFrequency(id, sound_params->frequency); - sound.Channel->SetRate(DStoMixerRate(frequency)); - } - } -} - -/** - * - * rct2: 0x006BBC6B - */ void VehicleSoundsUpdate() { - PROFILED_FUNCTION(); - - if (!OpenRCT2::Audio::IsAvailable()) - return; - - std::vector vehicleSoundParamsList; - vehicleSoundParamsList.reserve(OpenRCT2::Audio::MaxVehicleSounds); - - vehicle_sounds_update_window_setup(); - - for (auto vehicle : TrainManager::View()) - { - vehicle->UpdateSoundParams(vehicleSoundParamsList); - } - - // Stop all playing sounds that no longer have priority to play after vehicle_update_sound_params - for (auto& vehicle_sound : OpenRCT2::Audio::gVehicleSoundList) - { - if (vehicle_sound.id != OpenRCT2::Audio::SoundIdNull) - { - bool keepPlaying = false; - for (auto vehicleSoundParams : vehicleSoundParamsList) - { - if (vehicle_sound.id == vehicleSoundParams.id) - { - keepPlaying = true; - break; - } - } - - if (keepPlaying) - continue; - - if (vehicle_sound.TrackSound.Id != OpenRCT2::Audio::SoundId::Null) - { - vehicle_sound.TrackSound.Channel->Stop(); - } - if (vehicle_sound.OtherSound.Id != OpenRCT2::Audio::SoundId::Null) - { - vehicle_sound.OtherSound.Channel->Stop(); - } - vehicle_sound.id = OpenRCT2::Audio::SoundIdNull; - } - } - - for (auto& vehicleSoundParams : vehicleSoundParamsList) - { - uint8_t panVol = vehicle_sounds_update_get_pan_volume(&vehicleSoundParams); - - auto* vehicleSound = vehicle_sounds_update_get_vehicle_sound(&vehicleSoundParams); - // No free vehicle sound slots (RCT2 corrupts the pointer here) - if (vehicleSound == nullptr) - continue; - - // Move the Sound Volume towards the SoundsParam Volume - int32_t tempvolume = vehicleSound->volume; - if (tempvolume != vehicleSoundParams.volume) - { - if (tempvolume < vehicleSoundParams.volume) - { - tempvolume += 4; - } - else - { - tempvolume -= 4; - } - } - vehicleSound->volume = tempvolume; - panVol = std::max(0, panVol - tempvolume); - - Vehicle* vehicle = GetEntity(EntityId::FromUnderlying(vehicleSoundParams.id)); - if (vehicle != nullptr) - { - UpdateSound( - vehicle->sound1_id, vehicle->sound1_volume, &vehicleSoundParams, vehicleSound->TrackSound, panVol); - UpdateSound( - vehicle->sound2_id, vehicle->sound2_volume, &vehicleSoundParams, vehicleSound->OtherSound, panVol); - } - } + auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); + windowManager->BroadcastIntent(Intent(INTENT_ACTION_UPDATE_VEHICLE_SOUNDS)); } /** diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 3e25225f94..95dd53b5f6 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -222,7 +222,6 @@ struct Vehicle : EntityBase Vehicle* GetCar(size_t carIndex) const; void SetState(Vehicle::Status vehicleStatus, uint8_t subState = 0); bool IsGhost() const; - void UpdateSoundParams(std::vector& vehicleSoundParamsList) const; std::optional DodgemsCarWouldCollideAt(const CoordsXY& coords) const; int32_t UpdateTrackMotion(int32_t* outStation); int32_t CableLiftUpdateTrackMotion(); @@ -281,11 +280,8 @@ struct Vehicle : EntityBase friend void UpdateRotatingEnterprise(Vehicle& vehicle); private: - bool SoundCanPlay() const; - uint16_t GetSoundPriority() const; const VehicleInfo* GetMoveInfo() const; uint16_t GetTrackProgress() const; - OpenRCT2::Audio::VehicleSoundParams CreateSoundParam(uint16_t priority) const; void CableLiftUpdate(); bool CableLiftUpdateTrackMotionForwards(); bool CableLiftUpdateTrackMotionBackwards(); diff --git a/src/openrct2/windows/Intent.h b/src/openrct2/windows/Intent.h index ae2a699fd9..96e635c82e 100644 --- a/src/openrct2/windows/Intent.h +++ b/src/openrct2/windows/Intent.h @@ -43,6 +43,7 @@ enum IntentAction INTENT_ACTION_UPDATE_CASH, INTENT_ACTION_UPDATE_BANNER, INTENT_ACTION_UPDATE_RESEARCH, + INTENT_ACTION_UPDATE_VEHICLE_SOUNDS, INTENT_ACTION_TRACK_DESIGN_REMOVE_PROVISIONAL, INTENT_ACTION_TRACK_DESIGN_RESTORE_PROVISIONAL, INTENT_ACTION_SET_MAP_TOOLTIP, From 304ce22756ceec58ab724fef29150a2498ed3325 Mon Sep 17 00:00:00 2001 From: Stephan Spengler Date: Thu, 21 Mar 2024 14:11:52 +0100 Subject: [PATCH 088/191] Improve research documentation for plugin API --- distribution/openrct2.d.ts | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 60e5dde1ad..292151d457 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -3612,8 +3612,9 @@ declare global { /** * The amount of funding currently spent on research. + * 0: none, 1: minimum, 2: normal, 3: maximum */ - funding: ResearchFundingLevel; + funding: number; /** * The categories of research which should be prioritised. @@ -3663,7 +3664,7 @@ declare global { * E.g. gentle rides, thrill rides, shops etc. * Note: Any updates to this field are ignored by OpenRCT2, the category will be derived from the ride type. */ - readonly category?: ResearchCategory; + readonly category: RideResearchCategory; /** * The ride type. Each vehicle can have a seperate invention for each ride type. @@ -3677,7 +3678,7 @@ declare global { } interface SceneryResearchItem { - readonly category?: "scenery_group"; + readonly category: "scenery"; readonly type: "scenery"; /** @@ -3686,23 +3687,15 @@ declare global { readonly object: number; } - type ResearchItemType = "scenery" | "ride"; - - type ResearchCategory = + type RideResearchCategory = "transport" | "gentle" | "rollercoaster" | "thrill" | "water" | - "shop" | - "scenery"; + "shop"; - enum ResearchFundingLevel { - None, - Minimum, - Normal, - Maximum - } + type ResearchCategory = RideResearchCategory | "scenery"; type ResearchFundingStage = "initial_research" | From cb3b2a77e758a8102bf71147631035f184ef74a2 Mon Sep 17 00:00:00 2001 From: Jan Kelemen Date: Thu, 21 Mar 2024 22:50:18 +0100 Subject: [PATCH 089/191] Move gWidePathTileLoopPosition and gGrassSceneryTileLoopPosition to GameState_t --- src/openrct2/GameState.h | 3 +++ src/openrct2/park/ParkFile.cpp | 4 ++-- src/openrct2/rct2/S6Importer.cpp | 5 ++--- src/openrct2/world/Map.cpp | 30 ++++++++++++------------------ src/openrct2/world/Map.h | 3 --- 5 files changed, 19 insertions(+), 26 deletions(-) diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 15f6e127b4..7bf8f1ddea 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -109,6 +109,9 @@ namespace OpenRCT2 News::ItemQueues NewsItems; + uint16_t GrassSceneryTileLoopPosition; + CoordsXY WidePathTileLoopPosition; + colour_t StaffHandymanColour; colour_t StaffMechanicColour; colour_t StaffSecurityColour; diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index 4fcb146030..fe205516e6 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -549,8 +549,8 @@ namespace OpenRCT2 cs.ReadWrite(gameState.LandPrice); cs.ReadWrite(gameState.ConstructionRightsPrice); } - cs.ReadWrite(gGrassSceneryTileLoopPosition); - cs.ReadWrite(gWidePathTileLoopPosition); + cs.ReadWrite(gameState.GrassSceneryTileLoopPosition); + cs.ReadWrite(gameState.WidePathTileLoopPosition); auto& rideRatings = gameState.RideRatingUpdateStates; if (os.GetHeader().TargetVersion >= 21) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index d41c191381..6ead1df5e7 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -448,7 +448,7 @@ namespace RCT2 ImportRideRatingsCalcData(); ImportRideMeasurements(); gameState.NextGuestNumber = _s6.NextGuestIndex; - gGrassSceneryTileLoopPosition = _s6.GrassAndSceneryTilepos; + gameState.GrassSceneryTileLoopPosition = _s6.GrassAndSceneryTilepos; // unk_13CA73E // Pad13CA73F // unk_13CA740 @@ -496,8 +496,7 @@ namespace RCT2 // Pad13CE730 // rct1_scenario_flags - gWidePathTileLoopPosition.x = _s6.WidePathTileLoopX; - gWidePathTileLoopPosition.y = _s6.WidePathTileLoopY; + gameState.WidePathTileLoopPosition = { _s6.WidePathTileLoopX, _s6.WidePathTileLoopY }; // Pad13CE778 // Fix and set dynamic variables diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 6dea32e1a7..7c32ab9dab 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -88,9 +88,6 @@ CoordsXY gMapSelectPositionB; CoordsXYZ gMapSelectArrowPosition; uint8_t gMapSelectArrowDirection; -TileCoordsXY gWidePathTileLoopPosition; -uint16_t gGrassSceneryTileLoopPosition; - std::vector gMapSelectionTiles; bool gLandMountainMode; @@ -462,8 +459,8 @@ void MapInit(const TileCoordsXY& size) auto& gameState = GetGameState(); - gGrassSceneryTileLoopPosition = 0; - gWidePathTileLoopPosition = {}; + gameState.GrassSceneryTileLoopPosition = 0; + gameState.WidePathTileLoopPosition = {}; gameState.MapSize = size; MapRemoveOutOfRangeElements(); MapAnimationAutoCreate(); @@ -761,26 +758,23 @@ void MapUpdatePathWideFlags() // Presumably update_path_wide_flags is too computationally expensive to call for every // tile every update, so gWidePathTileLoopX and gWidePathTileLoopY store the x and y // progress. A maximum of 128 calls is done per update. - auto x = gWidePathTileLoopPosition.x; - auto y = gWidePathTileLoopPosition.y; + CoordsXY& loopPosition = GetGameState().WidePathTileLoopPosition; for (int32_t i = 0; i < 128; i++) { - FootpathUpdatePathWideFlags({ x, y }); + FootpathUpdatePathWideFlags(loopPosition); // Next x, y tile - x += COORDS_XY_STEP; - if (x >= MAXIMUM_MAP_SIZE_BIG) + loopPosition.x += COORDS_XY_STEP; + if (loopPosition.x >= MAXIMUM_MAP_SIZE_BIG) { - x = 0; - y += COORDS_XY_STEP; - if (y >= MAXIMUM_MAP_SIZE_BIG) + loopPosition.x = 0; + loopPosition.y += COORDS_XY_STEP; + if (loopPosition.y >= MAXIMUM_MAP_SIZE_BIG) { - y = 0; + loopPosition.y = 0; } } } - gWidePathTileLoopPosition.x = x; - gWidePathTileLoopPosition.y = y; } /** @@ -1266,7 +1260,7 @@ void MapUpdateTiles() int32_t x = 0; int32_t y = 0; - uint16_t interleaved_xy = gGrassSceneryTileLoopPosition; + uint16_t interleaved_xy = gameState.GrassSceneryTileLoopPosition; for (int32_t i = 0; i < 8; i++) { x = (x << 1) | (interleaved_xy & 1); @@ -1293,7 +1287,7 @@ void MapUpdateTiles() } } - gGrassSceneryTileLoopPosition++; + gameState.GrassSceneryTileLoopPosition++; } } diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index b83626a45e..837fcad2ae 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -107,9 +107,6 @@ enum extern const std::array CoordsDirectionDelta; extern const TileCoordsXY TileDirectionDelta[]; -extern TileCoordsXY gWidePathTileLoopPosition; -extern uint16_t gGrassSceneryTileLoopPosition; - CoordsXY GetMapSizeUnits(); CoordsXY GetMapSizeMinus2(); CoordsXY GetMapSizeMaxXY(); From 74364e2afc7378959f7ec7da0872da1939b30883 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 22 Mar 2024 02:51:11 +0100 Subject: [PATCH 090/191] Fix #21641: NPE when creating track iterator from invalid tile element --- distribution/changelog.txt | 1 + src/openrct2/ride/Track.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index a3ebe2a45c..9b8a275719 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. +- Fix: [#21641] Crash when creating track iterator from an invalid tile element. 0.4.9 (2024-03-02) ------------------------------------------------------------------------ diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index 113e00fa92..f633875149 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -733,6 +733,9 @@ bool TrackTypeIsHelix(track_type_t trackType) std::optional GetTrackSegmentOrigin(const CoordsXYE& posEl) { + if (posEl.element == nullptr) + return {}; + auto trackEl = posEl.element->AsTrack(); if (trackEl == nullptr) return {}; From 1470507d8e5f3073b26bbb37576de71dbce61292 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 22 Mar 2024 02:51:41 +0100 Subject: [PATCH 091/191] Fix Object Load Error and Scenery Scatter windows looking weird These two windows (and only these two) inherited from WindowBase, rather than Window, and as such regressed because of #21572. --- src/openrct2-ui/windows/ObjectLoadError.cpp | 2 +- src/openrct2-ui/windows/SceneryScatter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/ObjectLoadError.cpp b/src/openrct2-ui/windows/ObjectLoadError.cpp index ad141cf333..3eca21d95e 100644 --- a/src/openrct2-ui/windows/ObjectLoadError.cpp +++ b/src/openrct2-ui/windows/ObjectLoadError.cpp @@ -325,7 +325,7 @@ static Widget window_object_load_error_widgets[] = { } } - class ObjectLoadErrorWindow final : public WindowBase + class ObjectLoadErrorWindow final : public Window { private: std::vector _invalidEntries; diff --git a/src/openrct2-ui/windows/SceneryScatter.cpp b/src/openrct2-ui/windows/SceneryScatter.cpp index 2293b5810d..6da6ae4f27 100644 --- a/src/openrct2-ui/windows/SceneryScatter.cpp +++ b/src/openrct2-ui/windows/SceneryScatter.cpp @@ -53,7 +53,7 @@ static Widget _sceneryScatterWidgets[] = { }; // clang-format on - class SceneryScatterWindow final : public WindowBase + class SceneryScatterWindow final : public Window { public: void OnOpen() override From 51b0143b2d4ac4719185b33b42d5d112b0e336a9 Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Fri, 22 Mar 2024 04:01:40 +0000 Subject: [PATCH 092/191] Merge Localisation/master into OpenRCT2/develop --- data/language/nb-NO.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/language/nb-NO.txt b/data/language/nb-NO.txt index 8190171007..387fe4884c 100644 --- a/data/language/nb-NO.txt +++ b/data/language/nb-NO.txt @@ -3687,6 +3687,11 @@ STR_6614 :Kan ikke endre inngangsavgift til parken STR_6615 :Spor på denne ruten trenger vann STR_6616 :Handling ugyldig for denne personaltypen STR_6617 :Kan ikke bytte ut rute-element med seg selv +STR_6618 :Kan ikke begrense eller frigjøre objekt... +STR_6619 :Objekt-type kan ikke bli begrenset! +STR_6620 :Kunne ikke finne objekt! +STR_6621 :Begrens +STR_6622 :Begrens objekt til Scenario-redigerer og Sandkassemodus. ############# # Scenarios # From 693c422cd452e607f8b91a005ce7a3a097f79928 Mon Sep 17 00:00:00 2001 From: Andrew <5436387+fidwell@users.noreply.github.com> Date: Fri, 22 Mar 2024 06:20:48 -0400 Subject: [PATCH 093/191] Prevent TI hotkey from setting wall slope for non-slopeable objects (#21635) --- distribution/changelog.txt | 1 + src/openrct2-ui/input/Shortcuts.cpp | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 9b8a275719..1541297003 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -7,6 +7,7 @@ - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. +- Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. 0.4.9 (2024-03-02) diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index d589537f58..983f6746df 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -527,6 +528,12 @@ static void ShortcutToggleWallSlope() return; } + // Ensure a wall can be built on a slope + if (tileElement->AsWall()->GetEntry()->flags & WALL_SCENERY_CANT_BUILD_ON_SLOPE) + { + return; + } + int32_t currSlopeValue = tileElement->AsWall()->GetSlope(); int32_t newSlopeValue = (currSlopeValue + 1) % 3; From a972d231d790966ee845e6e9435d3b33d19c31bd Mon Sep 17 00:00:00 2001 From: Andrew <5436387+fidwell@users.noreply.github.com> Date: Fri, 22 Mar 2024 10:24:10 -0400 Subject: [PATCH 094/191] Add shortcut key for sorting tile elements (#21636) --- data/language/en-GB.txt | 1 + distribution/changelog.txt | 1 + src/openrct2-ui/input/ShortcutIds.h | 1 + src/openrct2-ui/input/Shortcuts.cpp | 1 + src/openrct2-ui/windows/TileInspector.cpp | 1 + src/openrct2/interface/Window.h | 1 + src/openrct2/localisation/StringIds.h | 2 ++ 7 files changed, 8 insertions(+) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 59d3c6ffa9..b483ae466b 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3693,6 +3693,7 @@ STR_6620 :Object not found! STR_6621 :Restrict STR_6622 :Restrict object to the Scenario Editor and Sandbox mode. STR_6623 :Type ‘help’ for a list of available commands. Type ‘hide’ to hide the console. +STR_6624 :Tile Inspector: Sort elements ############# # Scenarios # diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 1541297003..e76a4a740b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,5 +1,6 @@ 0.4.10 (in development) ------------------------------------------------------------------------ +- Feature: [#21636] Add shortcut key for sorting tile elements. - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. - Improved: [#21561, #21631] Enable more features in Android build (plugins, networking, multiplayer, audio formats). - Improved: [#21599] Currency signs now use non-breaking spaces. diff --git a/src/openrct2-ui/input/ShortcutIds.h b/src/openrct2-ui/input/ShortcutIds.h index 5aa7b9bffb..4cd02eb3f8 100644 --- a/src/openrct2-ui/input/ShortcutIds.h +++ b/src/openrct2-ui/input/ShortcutIds.h @@ -108,6 +108,7 @@ namespace OpenRCT2::Ui::ShortcutId constexpr std::string_view WindowTileInspectorToggleInvisibility = "window.tileinspector.toggle_invisibility"; constexpr std::string_view WindowTileInspectorCopy = "window.tileinspector.copy"; constexpr std::string_view WindowTileInspectorPaste = "window.tileinspector.paste"; + constexpr std::string_view WindowTileInspectorSort = "window.tileinspector.sort"; constexpr std::string_view WindowTileInspectorRemove = "window.tileinspector.remove"; constexpr std::string_view WindowTileInspectorMoveUp = "window.tileinspector.move_up"; constexpr std::string_view WindowTileInspectorMoveDown = "window.tileinspector.move_down"; diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 983f6746df..8324283ad1 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -883,6 +883,7 @@ void ShortcutManager::RegisterDefaultShortcuts() RegisterShortcut(ShortcutId::WindowTileInspectorToggleInvisibility, STR_SHORTCUT_TOGGLE_INVISIBILITY, WindowTileInspectorKeyboardShortcutToggleInvisibility); RegisterShortcut(ShortcutId::WindowTileInspectorCopy, STR_SHORTCUT_COPY_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_COPY)); RegisterShortcut(ShortcutId::WindowTileInspectorPaste, STR_SHORTCUT_PASTE_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE)); + RegisterShortcut(ShortcutId::WindowTileInspectorSort, STR_SHORTCUT_SORT_ELEMENTS, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_SORT)); RegisterShortcut(ShortcutId::WindowTileInspectorRemove, STR_SHORTCUT_REMOVE_ELEMENT, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE)); RegisterShortcut(ShortcutId::WindowTileInspectorMoveUp, STR_SHORTCUT_MOVE_ELEMENT_UP, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP)); RegisterShortcut(ShortcutId::WindowTileInspectorMoveDown, STR_SHORTCUT_MOVE_ELEMENT_DOWN, std::bind(TileInspectorMouseUp, WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN)); diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index ced4d1c53f..ebdff373d5 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -177,6 +177,7 @@ namespace OpenRCT2::Ui::Windows static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE == WIDX_BUTTON_ROTATE); static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_COPY == WIDX_BUTTON_COPY); static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE == WIDX_BUTTON_PASTE); + static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_SORT == WIDX_BUTTON_SORT); static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE == WIDX_BUTTON_REMOVE); static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP == WIDX_BUTTON_MOVE_UP); static_assert(WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN == WIDX_BUTTON_MOVE_DOWN); diff --git a/src/openrct2/interface/Window.h b/src/openrct2/interface/Window.h index 2f43fd04c7..139f6fcd89 100644 --- a/src/openrct2/interface/Window.h +++ b/src/openrct2/interface/Window.h @@ -366,6 +366,7 @@ constexpr int32_t WC_STAFF__WIDX_PICKUP = 9; constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_ROTATE = 13; constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_COPY = 16; constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_PASTE = 15; +constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_SORT = 14; constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_REMOVE = 10; constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_UP = 11; constexpr int32_t WC_TILE_INSPECTOR__WIDX_BUTTON_MOVE_DOWN = 12; diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 48f94f0f16..07ed17fae4 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -4037,6 +4037,8 @@ enum : uint16_t STR_CONSOLE_HELPER_TEXT = 6623, + STR_SHORTCUT_SORT_ELEMENTS = 6624, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; From cd5c56d8110fd65e50c12d07f1b1aaf06f42237a Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 10 Mar 2024 22:38:04 +0100 Subject: [PATCH 095/191] Add Classic Stand-Up Roller Coaster --- data/language/en-GB.txt | 2 + src/openrct2-ui/windows/NewRide.cpp | 1 + src/openrct2/libopenrct2.vcxproj | 2 + src/openrct2/localisation/StringIds.h | 2 + src/openrct2/rct1/Tables.cpp | 6 +- src/openrct2/ride/Ride.h | 1 + src/openrct2/ride/RideData.cpp | 2 + src/openrct2/ride/TrackPaint.h | 1 + .../coaster/ClassicStandUpRollerCoaster.cpp | 61 +++++++++++++ .../meta/ClassicStandUpRollerCoaster.h | 87 +++++++++++++++++++ .../ride/coaster/meta/StandUpRollerCoaster.h | 2 +- 11 files changed, 163 insertions(+), 4 deletions(-) create mode 100644 src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp create mode 100644 src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index b483ae466b..8fef46f9e5 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -98,6 +98,7 @@ STR_0093 :Hybrid Coaster STR_0094 :Single Rail Roller Coaster STR_0095 :Alpine Coaster STR_0096 :Classic Wooden Roller Coaster +STR_0097 :Classic Stand-up Roller Coaster STR_0512 :A compact roller coaster with a spiral lift hill and smooth, twisting drops. STR_0513 :A looping roller coaster where the riders ride in a standing position STR_0514 :Trains suspended beneath the roller coaster track swing out to the side around corners @@ -181,6 +182,7 @@ STR_0603 :A wooden style roller coaster with a steel track, allowing for stee STR_0604 :Riders ride single file on a narrow monorail track, as they race through tight inversions and direction changes STR_0605 :Riders toboggan down a meandering steel track, braking to control their speed STR_0606 :An older-style wooden roller coaster with a fast and rough ride, with plenty of air-time, some lateral G’s, and designed to feel ‘out-of-control’ +STR_0607 :A looping roller coaster where the riders ride in a standing position STR_0767 :Guest {INT32} STR_0768 :Handyman {INT32} STR_0769 :Mechanic {INT32} diff --git a/src/openrct2-ui/windows/NewRide.cpp b/src/openrct2-ui/windows/NewRide.cpp index a3422995f2..2f43010cff 100644 --- a/src/openrct2-ui/windows/NewRide.cpp +++ b/src/openrct2-ui/windows/NewRide.cpp @@ -80,6 +80,7 @@ namespace OpenRCT2::Ui::Windows RIDE_TYPE_MINE_TRAIN_COASTER, RIDE_TYPE_LOOPING_ROLLER_COASTER, RIDE_TYPE_STAND_UP_ROLLER_COASTER, + RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER, RIDE_TYPE_CORKSCREW_ROLLER_COASTER, RIDE_TYPE_HYPERCOASTER, RIDE_TYPE_LIM_LAUNCHED_ROLLER_COASTER, diff --git a/src/openrct2/libopenrct2.vcxproj b/src/openrct2/libopenrct2.vcxproj index 305315edf9..5bf4284f55 100644 --- a/src/openrct2/libopenrct2.vcxproj +++ b/src/openrct2/libopenrct2.vcxproj @@ -396,6 +396,7 @@ + @@ -901,6 +902,7 @@ + diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index 07ed17fae4..c97e25eb74 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -113,6 +113,7 @@ enum : uint16_t STR_RIDE_NAME_SINGLE_RAIL_ROLLER_COASTER = 94, STR_RIDE_NAME_ALPINE_COASTER = 95, STR_RIDE_NAME_CLASSIC_WOODEN_ROLLER_COASTER = 96, + STR_RIDE_NAME_CLASSIC_STAND_UP_ROLLER_COASTER = 97, STR_RIDE_DESCRIPTION_SPIRAL_ROLLER_COASTER = 512, STR_RIDE_DESCRIPTION_STAND_UP_ROLLER_COASTER = 513, @@ -206,6 +207,7 @@ enum : uint16_t STR_RIDE_DESCRIPTION_SINGLE_RAIL_ROLLER_COASTER = 604, STR_RIDE_DESCRIPTION_ALPINE_COASTER = 605, STR_RIDE_DESCRIPTION_CLASSIC_WOODEN_ROLLER_COASTER = 606, + STR_RIDE_DESCRIPTION_CLASSIC_STAND_UP_ROLLER_COASTER = 607, STR_GUEST_X = 767, STR_HANDYMAN_X = 768, diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 4a7bc17109..55344ef54d 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -173,7 +173,7 @@ namespace RCT1 static uint8_t map[] = { RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER,// RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER - RIDE_TYPE_STAND_UP_ROLLER_COASTER, // RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER + RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER, // RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER RIDE_TYPE_SUSPENDED_SWINGING_COASTER, // RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER RIDE_TYPE_INVERTED_ROLLER_COASTER, // RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER RIDE_TYPE_CLASSIC_MINI_ROLLER_COASTER, // RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER @@ -705,7 +705,7 @@ namespace RCT1 static constexpr const char * map[] = { "rct1.ride.wooden_rc_trains", // RCT1_RIDE_TYPE_WOODEN_ROLLER_COASTER - "rct2.ride.togst", // RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER + "rct1.ride.stand_up_trains", // RCT1_RIDE_TYPE_STAND_UP_STEEL_ROLLER_COASTER "rct1.ride.suspended_swinging_cars", // RCT1_RIDE_TYPE_SUSPENDED_ROLLER_COASTER "rct1ll.ride.4_across_inverted_trains", // RCT1_RIDE_TYPE_INVERTED_ROLLER_COASTER "rct1.ride.ladybird_trains", // RCT1_RIDE_TYPE_STEEL_MINI_ROLLER_COASTER @@ -807,7 +807,7 @@ namespace RCT1 "rct1.ride.inverted_trains", // VehicleType::InvertedCoasterTrain//NotinRCT2 "rct1.ride.suspended_swinging_cars", // VehicleType::SuspendedSwingingCars "rct1.ride.ladybird_trains", // VehicleType::LadybirdCars - "rct2.ride.togst", // VehicleType::StandupRollerCoasterCars + "rct1.ride.stand_up_trains", // VehicleType::StandupRollerCoasterCars "rct2.ride.wmspin", // VehicleType::SpinningCars "rct1.ride.single_person_swinging_cars", // VehicleType::SinglePersonSwingingChairs "rct2.ride.swans", // VehicleType::SwansPedalBoats diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 417754f84c..c60e26c1dc 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -611,6 +611,7 @@ enum RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER, RIDE_TYPE_ALPINE_COASTER, RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER, + RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER, RIDE_TYPE_COUNT }; diff --git a/src/openrct2/ride/RideData.cpp b/src/openrct2/ride/RideData.cpp index 623b742d6a..9741aa7dc7 100644 --- a/src/openrct2/ride/RideData.cpp +++ b/src/openrct2/ride/RideData.cpp @@ -34,6 +34,7 @@ #include "coaster/meta/AlpineCoaster.h" #include "coaster/meta/BobsleighCoaster.h" #include "coaster/meta/ClassicMiniRollerCoaster.h" +#include "coaster/meta/ClassicStandUpRollerCoaster.h" #include "coaster/meta/ClassicWoodenRollerCoaster.h" #include "coaster/meta/CompactInvertedCoaster.h" #include "coaster/meta/CorkscrewRollerCoaster.h" @@ -350,6 +351,7 @@ constexpr RideTypeDescriptor RideTypeDescriptors[RIDE_TYPE_COUNT] = { /* RIDE_TYPE_SINGLE_RAIL_ROLLER_COASTER */ SingleRailRollerCoasterRTD, /* RIDE_TYPE_ALPINE_COASTER */ AlpineCoasterRTD, /* RIDE_TYPE_CLASSIC_WOODEN_ROLLER_COASTER */ ClassicWoodenRollerCoasterRTD, + /* RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER */ ClassicStandUpRollerCoasterRTD, }; bool RideTypeDescriptor::HasFlag(uint64_t flag) const diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index 695f2ce357..a46fb967f6 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -494,3 +494,4 @@ namespace AlpineRC TRACK_PAINT_FUNCTION GetTrackPaintFunction(int32_t trackType); } TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicWoodenRC(int32_t trackType); +TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType); diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp new file mode 100644 index 0000000000..999d6b0030 --- /dev/null +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -0,0 +1,61 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#include "../Track.h" +#include "../TrackPaint.h" + +#include + +TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) +{ + switch (trackType) + { + case TrackElemType::FlatToLeftBank: + case TrackElemType::FlatToRightBank: + case TrackElemType::LeftBankToFlat: + case TrackElemType::RightBankToFlat: + case TrackElemType::BankedLeftQuarterTurn5Tiles: + case TrackElemType::BankedRightQuarterTurn5Tiles: + case TrackElemType::LeftBankToUp25: + case TrackElemType::RightBankToUp25: + case TrackElemType::Up25ToLeftBank: + case TrackElemType::Up25ToRightBank: + case TrackElemType::LeftBankToDown25: + case TrackElemType::RightBankToDown25: + case TrackElemType::Down25ToLeftBank: + case TrackElemType::Down25ToRightBank: + case TrackElemType::LeftBank: + case TrackElemType::RightBank: + + case TrackElemType::LeftEighthBankToDiag: + case TrackElemType::RightEighthBankToDiag: + case TrackElemType::LeftEighthBankToOrthogonal: + case TrackElemType::RightEighthBankToOrthogonal: + + case TrackElemType::LeftBankedQuarterTurn3Tiles: + case TrackElemType::RightBankedQuarterTurn3Tiles: + case TrackElemType::DiagFlatToLeftBank: + case TrackElemType::DiagFlatToRightBank: + case TrackElemType::DiagLeftBankToFlat: + case TrackElemType::DiagRightBankToFlat: + case TrackElemType::DiagLeftBankToUp25: + case TrackElemType::DiagRightBankToUp25: + case TrackElemType::DiagUp25ToLeftBank: + case TrackElemType::DiagUp25ToRightBank: + case TrackElemType::DiagLeftBankToDown25: + case TrackElemType::DiagRightBankToDown25: + case TrackElemType::DiagDown25ToLeftBank: + case TrackElemType::DiagDown25ToRightBank: + case TrackElemType::DiagLeftBank: + case TrackElemType::DiagRightBank: + return nullptr; + } + + return GetTrackPaintFunctionStandUpRC(trackType); +} diff --git a/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h new file mode 100644 index 0000000000..59c387a869 --- /dev/null +++ b/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h @@ -0,0 +1,87 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include "../../../sprites.h" +#include "../../RideData.h" +#include "../../ShopItem.h" +#include "../../Track.h" + +// clang-format off +constexpr RideTypeDescriptor ClassicStandUpRollerCoasterRTD = +{ + .AlternateType = RIDE_TYPE_NULL, + .Category = RIDE_CATEGORY_ROLLERCOASTER, + .EnabledTrackPieces = {TRACK_STRAIGHT, TRACK_STATION_END, TRACK_LIFT_HILL, TRACK_FLAT_ROLL_BANKING, TRACK_VERTICAL_LOOP, TRACK_SLOPE, TRACK_SLOPE_STEEP_UP, TRACK_SLOPE_STEEP_DOWN, TRACK_SLOPE_CURVE, TRACK_S_BEND, TRACK_CURVE_SMALL, TRACK_CURVE, TRACK_CURVE_LARGE, TRACK_HALF_LOOP, TRACK_CORKSCREW, TRACK_BRAKES, TRACK_ON_RIDE_PHOTO, TRACK_BLOCK_BRAKES, TRACK_DIAG_BRAKES, TRACK_DIAG_BLOCK_BRAKES}, + .ExtraTrackPieces = {}, + .CoveredTrackPieces = {}, + .StartTrackPiece = TrackElemType::EndStation, + .TrackPaintFunctions = TrackDrawerDescriptor(GetTrackPaintFunctionClassicStandUpRC), + .Flags = RIDE_TYPE_FLAGS_TRACK_HAS_3_COLOURS | RIDE_TYPE_FLAG_HAS_LEAVE_WHEN_ANOTHER_VEHICLE_ARRIVES_AT_STATION | + RIDE_TYPE_FLAGS_COMMON_COASTER | RIDE_TYPE_FLAGS_COMMON_COASTER_NON_ALT | + RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES | RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS | + RIDE_TYPE_FLAG_ALLOW_REVERSED_TRAINS, + .RideModes = EnumsToFlags(RideMode::ContinuousCircuit, RideMode::ContinuousCircuitBlockSectioned, RideMode::ReverseInclineLaunchedShuttle, RideMode::PoweredLaunchPasstrough, RideMode::PoweredLaunch), + .DefaultMode = RideMode::ContinuousCircuit, + .OperatingSettings = { 7, 27, 0, 0, 0, 0 }, + .Naming = { STR_RIDE_NAME_CLASSIC_STAND_UP_ROLLER_COASTER, STR_RIDE_DESCRIPTION_CLASSIC_STAND_UP_ROLLER_COASTER }, + .NameConvention = { RideComponentType::Train, RideComponentType::Track, RideComponentType::Station }, + .EnumName = nameof(RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER), + .AvailableBreakdowns = (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE), + .Heights = { 25, 24, 9, 11, }, + .MaxMass = 18, + .LiftData = { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }, + .RatingsMultipliers = { 50, 30, 10 }, + .UpkeepCosts = { 40, 20, 80, 10, 3, 10 }, + .BuildCosts = { 50.00_GBP, 2.50_GBP, 50, }, + .DefaultPrices = { 20, 20 }, + .DefaultMusic = MUSIC_OBJECT_TECHNO, + .PhotoItem = ShopItem::Photo, + .BonusValue = 90, + .ColourPresets = TRACK_COLOUR_PRESETS( + { COLOUR_BRIGHT_RED, COLOUR_BRIGHT_RED, COLOUR_BLACK }, + { COLOUR_BLACK, COLOUR_LIGHT_BLUE, COLOUR_BLACK }, + { COLOUR_LIGHT_ORANGE, COLOUR_WHITE, COLOUR_LIGHT_ORANGE }, + { COLOUR_BORDEAUX_RED, COLOUR_YELLOW, COLOUR_BORDEAUX_RED }, + { COLOUR_MOSS_GREEN, COLOUR_MOSS_GREEN, COLOUR_WHITE }, + { COLOUR_SATURATED_BROWN, COLOUR_LIGHT_ORANGE, COLOUR_SATURATED_BROWN }, + ), + .ColourPreview = { SPR_RIDE_DESIGN_PREVIEW_STAND_UP_ROLLER_COASTER_TRACK, SPR_RIDE_DESIGN_PREVIEW_STAND_UP_ROLLER_COASTER_SUPPORTS }, + .ColourKey = RideColourKey::Ride, + .Name = "classic_stand_up_rc", + .RatingsData = + { + RatingsCalculationType::Normal, + { RIDE_RATING(2, 50), RIDE_RATING(3, 00), RIDE_RATING(3, 00) }, + 17, + -1, + false, + { + { RatingsModifierType::BonusLength, 6000, 764, 0, 0 }, + { RatingsModifierType::BonusSynchronisation, 0, RIDE_RATING(0, 40), RIDE_RATING(0, 10), 0 }, + { RatingsModifierType::BonusTrainLength, 0, 187245, 0, 0 }, + { RatingsModifierType::BonusMaxSpeed, 0, 44281, 123987, 35424 }, + { RatingsModifierType::BonusAverageSpeed, 0, 291271, 436906, 0 }, + { RatingsModifierType::BonusDuration, 150, 26214, 0, 0 }, + { RatingsModifierType::BonusGForces, 0, 24576, 35746, 59578 }, + { RatingsModifierType::BonusTurns, 0, 26749, 34767, 45749 }, + { RatingsModifierType::BonusDrops, 0, 34952, 46811, 49152 }, + { RatingsModifierType::BonusSheltered, 0, 12850, 28398, 30427 }, + { RatingsModifierType::BonusReversedTrains, 0, 2, 20, 30 }, + { RatingsModifierType::BonusProximity, 0, 17893, 0, 0 }, + { RatingsModifierType::BonusScenery, 0, 5577, 0, 0 }, + { RatingsModifierType::RequirementDropHeight, 12, 2, 2, 2 }, + { RatingsModifierType::RequirementMaxSpeed, 0xA0000, 2, 2, 2 }, + { RatingsModifierType::RequirementNegativeGs, FIXED_2DP(0, 50), 2, 2, 2 }, + { RatingsModifierType::PenaltyLateralGs, 0, 24576, 35746, 59578 }, + }, + }, +}; +// clang-format on diff --git a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h index 7436991e68..31042f6a15 100644 --- a/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/StandUpRollerCoaster.h @@ -28,7 +28,7 @@ constexpr RideTypeDescriptor StandUpRollerCoasterRTD = RIDE_TYPE_FLAGS_COMMON_COASTER | RIDE_TYPE_FLAGS_COMMON_COASTER_NON_ALT | RIDE_TYPE_FLAG_PEEP_CHECK_GFORCES | RIDE_TYPE_FLAG_ALLOW_MULTIPLE_CIRCUITS | RIDE_TYPE_FLAG_ALLOW_REVERSED_TRAINS, - .RideModes = EnumsToFlags(RideMode::ContinuousCircuit, RideMode::ContinuousCircuitBlockSectioned, RideMode::ReverseInclineLaunchedShuttle, RideMode::PoweredLaunchPasstrough, RideMode::PoweredLaunch), + .RideModes = EnumsToFlags(RideMode::ContinuousCircuit, RideMode::ContinuousCircuitBlockSectioned), .DefaultMode = RideMode::ContinuousCircuit, .OperatingSettings = { 7, 27, 0, 0, 0, 0 }, .Naming = { STR_RIDE_NAME_STAND_UP_ROLLER_COASTER, STR_RIDE_DESCRIPTION_STAND_UP_ROLLER_COASTER }, From 1d324247bf0ab05a7e3f11dae07558e876f45e4b Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 10 Mar 2024 22:44:13 +0100 Subject: [PATCH 096/191] Add constants --- .../coaster/ClassicStandUpRollerCoaster.cpp | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 999d6b0030..a99bea93fb 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -9,9 +9,97 @@ #include "../Track.h" #include "../TrackPaint.h" +#include "../../sprites.h" #include +static constexpr ImageIndex kClassicStandUpRcFlatToRightBank0 = SPR_CSG_BEGIN + 67009; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank2 = SPR_CSG_BEGIN + 67010; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank0 = SPR_CSG_BEGIN + 67011; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBank2 = SPR_CSG_BEGIN + 67012; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank3 = SPR_CSG_BEGIN + 67013; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBank1 = SPR_CSG_BEGIN + 67014; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBank3 = SPR_CSG_BEGIN + 67015; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank1 = SPR_CSG_BEGIN + 67016; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_0 = SPR_CSG_BEGIN + 67017; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_1 = SPR_CSG_BEGIN + 67018; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_2 = SPR_CSG_BEGIN + 67019; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_3 = SPR_CSG_BEGIN + 67020; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_4 = SPR_CSG_BEGIN + 67021; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_0 = SPR_CSG_BEGIN + 67022; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_1 = SPR_CSG_BEGIN + 67023; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_2 = SPR_CSG_BEGIN + 67024; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_3 = SPR_CSG_BEGIN + 67025; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_4 = SPR_CSG_BEGIN + 67026; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_0 = SPR_CSG_BEGIN + 67027; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_1 = SPR_CSG_BEGIN + 67028; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_2 = SPR_CSG_BEGIN + 67029; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_3 = SPR_CSG_BEGIN + 67030; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_4 = SPR_CSG_BEGIN + 67031; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_0 = SPR_CSG_BEGIN + 67032; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_1 = SPR_CSG_BEGIN + 67033; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_2 = SPR_CSG_BEGIN + 67034; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_3 = SPR_CSG_BEGIN + 67035; +static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_4 = SPR_CSG_BEGIN + 67036; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked0 = SPR_CSG_BEGIN + 67037; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked1 = SPR_CSG_BEGIN + 67038; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked2 = SPR_CSG_BEGIN + 67039; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked3 = SPR_CSG_BEGIN + 67040; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked0 = SPR_CSG_BEGIN + 67041; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked1 = SPR_CSG_BEGIN + 67042; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked2 = SPR_CSG_BEGIN + 67043; +static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked3 = SPR_CSG_BEGIN + 67044; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp0 = SPR_CSG_BEGIN + 67045; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp1 = SPR_CSG_BEGIN + 67046; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp2 = SPR_CSG_BEGIN + 67047; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp3 = SPR_CSG_BEGIN + 67048; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp0 = SPR_CSG_BEGIN + 67049; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp1 = SPR_CSG_BEGIN + 67050; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp2 = SPR_CSG_BEGIN + 67051; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp3 = SPR_CSG_BEGIN + 67052; +static constexpr ImageIndex kClassicStandUpRcLeftBanked0 = SPR_CSG_BEGIN + 67053; +static constexpr ImageIndex kClassicStandUpRcLeftBanked1 = SPR_CSG_BEGIN + 67054; +static constexpr ImageIndex kClassicStandUpRcLeftBanked2 = SPR_CSG_BEGIN + 67055; +static constexpr ImageIndex kClassicStandUpRcLeftBanked3 = SPR_CSG_BEGIN + 67056; + +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked0_0 = SPR_CSG_BEGIN + 67229; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked0_1 = SPR_CSG_BEGIN + 67230; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked0_2 = SPR_CSG_BEGIN + 67231; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked1_0 = SPR_CSG_BEGIN + 67232; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked1_1 = SPR_CSG_BEGIN + 67233; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked1_2 = SPR_CSG_BEGIN + 67234; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked2_0 = SPR_CSG_BEGIN + 67235; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked2_1 = SPR_CSG_BEGIN + 67236; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked2_2 = SPR_CSG_BEGIN + 67237; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked3_0 = SPR_CSG_BEGIN + 67238; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked3_1 = SPR_CSG_BEGIN + 67239; +static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked3_2 = SPR_CSG_BEGIN + 67240; + +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag0 = SPR_CSG_BEGIN + 67421; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag1 = SPR_CSG_BEGIN + 67422; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag2 = SPR_CSG_BEGIN + 67423; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag3 = SPR_CSG_BEGIN + 67424; +static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag0 = SPR_CSG_BEGIN + 67425; +static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag1 = SPR_CSG_BEGIN + 67426; +static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag2 = SPR_CSG_BEGIN + 67427; +static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag3 = SPR_CSG_BEGIN + 67428; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag0 = SPR_CSG_BEGIN + 67433; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag1 = SPR_CSG_BEGIN + 67434; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag2 = SPR_CSG_BEGIN + 67435; +static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag3 = SPR_CSG_BEGIN + 67436; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag0 = SPR_CSG_BEGIN + 67437; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag1 = SPR_CSG_BEGIN + 67438; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag2 = SPR_CSG_BEGIN + 67439; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag3 = SPR_CSG_BEGIN + 67440; +static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag0 = SPR_CSG_BEGIN + 67441; +static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag1 = SPR_CSG_BEGIN + 67442; +static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag2 = SPR_CSG_BEGIN + 67443; +static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag3 = SPR_CSG_BEGIN + 67444; +static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag0 = SPR_CSG_BEGIN + 67445; +static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag1 = SPR_CSG_BEGIN + 67446; +static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag2 = SPR_CSG_BEGIN + 67447; +static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag3 = SPR_CSG_BEGIN + 67448; + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) From d21b411f438979911e6fc5038e1c4888d18dcd62 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sun, 10 Mar 2024 23:06:17 +0100 Subject: [PATCH 097/191] Implement flat-to-banked transitions --- .../coaster/ClassicStandUpRollerCoaster.cpp | 171 +++++++++++++----- 1 file changed, 123 insertions(+), 48 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index a99bea93fb..a3641cc354 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -13,6 +13,9 @@ #include +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-const-variable" + static constexpr ImageIndex kClassicStandUpRcFlatToRightBank0 = SPR_CSG_BEGIN + 67009; static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank2 = SPR_CSG_BEGIN + 67010; static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank0 = SPR_CSG_BEGIN + 67011; @@ -21,59 +24,59 @@ static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank3 = SPR_CSG_BEGIN + 6 static constexpr ImageIndex kClassicStandUpRcFlatToRightBank1 = SPR_CSG_BEGIN + 67014; static constexpr ImageIndex kClassicStandUpRcFlatToRightBank3 = SPR_CSG_BEGIN + 67015; static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank1 = SPR_CSG_BEGIN + 67016; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_0 = SPR_CSG_BEGIN + 67017; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_1 = SPR_CSG_BEGIN + 67018; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_2 = SPR_CSG_BEGIN + 67019; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_3 = SPR_CSG_BEGIN + 67020; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked0_4 = SPR_CSG_BEGIN + 67021; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_0 = SPR_CSG_BEGIN + 67022; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_1 = SPR_CSG_BEGIN + 67023; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_2 = SPR_CSG_BEGIN + 67024; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_3 = SPR_CSG_BEGIN + 67025; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked1_4 = SPR_CSG_BEGIN + 67026; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_0 = SPR_CSG_BEGIN + 67027; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_1 = SPR_CSG_BEGIN + 67028; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_2 = SPR_CSG_BEGIN + 67029; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_3 = SPR_CSG_BEGIN + 67030; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked2_4 = SPR_CSG_BEGIN + 67031; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_0 = SPR_CSG_BEGIN + 67032; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_1 = SPR_CSG_BEGIN + 67033; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_2 = SPR_CSG_BEGIN + 67034; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_3 = SPR_CSG_BEGIN + 67035; -static constexpr ImageIndex kClassicStandUpRcRightTurn5_TilesBanked3_4 = SPR_CSG_BEGIN + 67036; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked0 = SPR_CSG_BEGIN + 67037; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked1 = SPR_CSG_BEGIN + 67038; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked2 = SPR_CSG_BEGIN + 67039; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatRightBanked3 = SPR_CSG_BEGIN + 67040; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked0 = SPR_CSG_BEGIN + 67041; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked1 = SPR_CSG_BEGIN + 67042; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked2 = SPR_CSG_BEGIN + 67043; -static constexpr ImageIndex kClassicStandUpRc25_DegUpToFlatLeftBanked3 = SPR_CSG_BEGIN + 67044; -static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp0 = SPR_CSG_BEGIN + 67045; -static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp1 = SPR_CSG_BEGIN + 67046; -static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp2 = SPR_CSG_BEGIN + 67047; -static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25_DegUp3 = SPR_CSG_BEGIN + 67048; -static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp0 = SPR_CSG_BEGIN + 67049; -static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp1 = SPR_CSG_BEGIN + 67050; -static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp2 = SPR_CSG_BEGIN + 67051; -static constexpr ImageIndex kClassicStandUpRcRightBankedTo25_DegUp3 = SPR_CSG_BEGIN + 67052; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked0_0 = SPR_CSG_BEGIN + 67017; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked0_1 = SPR_CSG_BEGIN + 67018; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked0_2 = SPR_CSG_BEGIN + 67019; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked0_3 = SPR_CSG_BEGIN + 67020; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked0_4 = SPR_CSG_BEGIN + 67021; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked1_0 = SPR_CSG_BEGIN + 67022; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked1_1 = SPR_CSG_BEGIN + 67023; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked1_2 = SPR_CSG_BEGIN + 67024; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked1_3 = SPR_CSG_BEGIN + 67025; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked1_4 = SPR_CSG_BEGIN + 67026; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked2_0 = SPR_CSG_BEGIN + 67027; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked2_1 = SPR_CSG_BEGIN + 67028; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked2_2 = SPR_CSG_BEGIN + 67029; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked2_3 = SPR_CSG_BEGIN + 67030; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked2_4 = SPR_CSG_BEGIN + 67031; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked3_0 = SPR_CSG_BEGIN + 67032; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked3_1 = SPR_CSG_BEGIN + 67033; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked3_2 = SPR_CSG_BEGIN + 67034; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked3_3 = SPR_CSG_BEGIN + 67035; +static constexpr ImageIndex kClassicStandUpRcRightTurn5TilesBanked3_4 = SPR_CSG_BEGIN + 67036; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatRightBanked0 = SPR_CSG_BEGIN + 67037; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatRightBanked1 = SPR_CSG_BEGIN + 67038; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatRightBanked2 = SPR_CSG_BEGIN + 67039; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatRightBanked3 = SPR_CSG_BEGIN + 67040; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatLeftBanked0 = SPR_CSG_BEGIN + 67041; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatLeftBanked1 = SPR_CSG_BEGIN + 67042; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatLeftBanked2 = SPR_CSG_BEGIN + 67043; +static constexpr ImageIndex kClassicStandUpRc25DegUpToFlatLeftBanked3 = SPR_CSG_BEGIN + 67044; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25DegUp0 = SPR_CSG_BEGIN + 67045; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25DegUp1 = SPR_CSG_BEGIN + 67046; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25DegUp2 = SPR_CSG_BEGIN + 67047; +static constexpr ImageIndex kClassicStandUpRcLeftBankedTo25DegUp3 = SPR_CSG_BEGIN + 67048; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25DegUp0 = SPR_CSG_BEGIN + 67049; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25DegUp1 = SPR_CSG_BEGIN + 67050; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25DegUp2 = SPR_CSG_BEGIN + 67051; +static constexpr ImageIndex kClassicStandUpRcRightBankedTo25DegUp3 = SPR_CSG_BEGIN + 67052; static constexpr ImageIndex kClassicStandUpRcLeftBanked0 = SPR_CSG_BEGIN + 67053; static constexpr ImageIndex kClassicStandUpRcLeftBanked1 = SPR_CSG_BEGIN + 67054; static constexpr ImageIndex kClassicStandUpRcLeftBanked2 = SPR_CSG_BEGIN + 67055; static constexpr ImageIndex kClassicStandUpRcLeftBanked3 = SPR_CSG_BEGIN + 67056; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked0_0 = SPR_CSG_BEGIN + 67229; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked0_1 = SPR_CSG_BEGIN + 67230; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked0_2 = SPR_CSG_BEGIN + 67231; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked1_0 = SPR_CSG_BEGIN + 67232; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked1_1 = SPR_CSG_BEGIN + 67233; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked1_2 = SPR_CSG_BEGIN + 67234; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked2_0 = SPR_CSG_BEGIN + 67235; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked2_1 = SPR_CSG_BEGIN + 67236; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked2_2 = SPR_CSG_BEGIN + 67237; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked3_0 = SPR_CSG_BEGIN + 67238; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked3_1 = SPR_CSG_BEGIN + 67239; -static constexpr ImageIndex kClassicStandUpRcRightTurn3_TilesBanked3_2 = SPR_CSG_BEGIN + 67240; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked0_0 = SPR_CSG_BEGIN + 67229; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked0_1 = SPR_CSG_BEGIN + 67230; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked0_2 = SPR_CSG_BEGIN + 67231; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked1_0 = SPR_CSG_BEGIN + 67232; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked1_1 = SPR_CSG_BEGIN + 67233; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked1_2 = SPR_CSG_BEGIN + 67234; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked2_0 = SPR_CSG_BEGIN + 67235; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked2_1 = SPR_CSG_BEGIN + 67236; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked2_2 = SPR_CSG_BEGIN + 67237; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked3_0 = SPR_CSG_BEGIN + 67238; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked3_1 = SPR_CSG_BEGIN + 67239; +static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked3_2 = SPR_CSG_BEGIN + 67240; static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag0 = SPR_CSG_BEGIN + 67421; static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag1 = SPR_CSG_BEGIN + 67422; @@ -100,14 +103,86 @@ static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag1 = static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag2 = SPR_CSG_BEGIN + 67447; static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag3 = SPR_CSG_BEGIN + 67448; +#pragma GCC diagnostic pop + +static void classicStandUpRCTrackFlatToLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcFlatToLeftBank0, + kClassicStandUpRcFlatToLeftBank1, + kClassicStandUpRcFlatToLeftBank2, + kClassicStandUpRcFlatToLeftBank3, + }; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + } + + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); +} + +static void classicStandUpRCTrackFlatToRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcFlatToRightBank0, + kClassicStandUpRcFlatToRightBank1, + kClassicStandUpRcFlatToRightBank2, + kClassicStandUpRcFlatToRightBank3, + }; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + } + + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); +} + +static void classicStandUpRCTrackLeftBankToFlat( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + return classicStandUpRCTrackFlatToRightBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrackRightBankToFlat( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + return classicStandUpRCTrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) { case TrackElemType::FlatToLeftBank: + return classicStandUpRCTrackFlatToLeftBank; case TrackElemType::FlatToRightBank: + return classicStandUpRCTrackFlatToRightBank; case TrackElemType::LeftBankToFlat: + return classicStandUpRCTrackLeftBankToFlat; case TrackElemType::RightBankToFlat: + return classicStandUpRCTrackRightBankToFlat; case TrackElemType::BankedLeftQuarterTurn5Tiles: case TrackElemType::BankedRightQuarterTurn5Tiles: case TrackElemType::LeftBankToUp25: From 82d81674826b5e995b9ed942dc269dd0eb17e350 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 11 Mar 2024 00:00:36 +0100 Subject: [PATCH 098/191] Fix Classic Stand Up vehicle colours --- src/openrct2/rct1/Tables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/rct1/Tables.cpp b/src/openrct2/rct1/Tables.cpp index 55344ef54d..5b878a7495 100644 --- a/src/openrct2/rct1/Tables.cpp +++ b/src/openrct2/rct1/Tables.cpp @@ -275,7 +275,7 @@ namespace RCT1 { COPY_COLOUR_1, COPY_COLOUR_2, COPY_COLOUR_2 }, // RCT1_VEHICLE_TYPE_INVERTED_COASTER_TRAIN, // Not in RCT2 { COPY_COLOUR_1, COPY_COLOUR_2, COPY_COLOUR_2 }, // RCT1_VEHICLE_TYPE_SUSPENDED_SWINGING_CARS, { COPY_COLOUR_1, COPY_COLOUR_2, COLOUR_BLACK }, // RCT1_VEHICLE_TYPE_LADYBIRD_CARS, - { COPY_COLOUR_1, COPY_COLOUR_1, COPY_COLOUR_2 }, // RCT1_VEHICLE_TYPE_STANDUP_ROLLER_COASTER_CARS, + { COPY_COLOUR_1, COPY_COLOUR_2, COPY_COLOUR_2 }, // RCT1_VEHICLE_TYPE_STANDUP_ROLLER_COASTER_CARS, { COPY_COLOUR_1, COPY_COLOUR_2, COLOUR_BLACK }, // RCT1_VEHICLE_TYPE_SPINNING_CARS, { COPY_COLOUR_1, COPY_COLOUR_2, COLOUR_BLACK }, // RCT1_VEHICLE_TYPE_SINGLE_PERSON_SWINGING_CHAIRS, { COPY_COLOUR_1, COPY_COLOUR_2, COLOUR_BLACK }, // RCT1_VEHICLE_TYPE_SWANS_PEDAL_BOATS, From dfa5875c5ac8360e5e844a386586cd609b190723 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 11 Mar 2024 00:01:01 +0100 Subject: [PATCH 099/191] =?UTF-8?q?Implement=203=C3=973=20banked=20turn=20?= =?UTF-8?q?(pending=20calls=20to=20segment=20support=20height)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coaster/ClassicStandUpRollerCoaster.cpp | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index a3641cc354..869a535d99 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -171,6 +171,168 @@ static void classicStandUpRCTrackRightBankToFlat( return classicStandUpRCTrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } +static void classicStandUpRCTrackBankedRightQuarterTurn5( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + + switch (trackSequence) + { + case 0: + { + constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcRightTurn5TilesBanked0_0, + kClassicStandUpRcRightTurn5TilesBanked1_0, + kClassicStandUpRcRightTurn5TilesBanked2_0, + kClassicStandUpRcRightTurn5TilesBanked3_0, + }; + + PaintAddImageAsParentRotated(session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + switch (direction) + { + case 0: + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); + break; + case 3: + PaintUtilPushTunnelRight(session, height, TUNNEL_0); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, (direction + 3) % NumOrthogonalDirections), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + } + case 1: + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + + case 2: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_1), { 0, 16, height }, { 32, 16, 3 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_1), { 0, 16, height }, { 32, 16, 3 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_1), { 0, 0, height }, { 32, 16, 3 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_1), { 0, 0, height }, { 32, 16, 3 }); + break; + + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, (direction + 3) % NumOrthogonalDirections), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + + case 3: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_2), { 0, 0, height }, { 16, 16, 3 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_2), { 16, 0, height }, { 16, 16, 3 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_2), { 16, 16, height }, { 16, 16, 3 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_2), { 0, 16, height }, { 16, 16, 3 }); + break; + + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + + case 4: + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + + case 5: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_3), { 16, 0, height }, { 16, 32, 3 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_3), { 0, 0, height }, { 16, 32, 3 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_3), { 0, 0, height }, { 16, 32, 3 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_3), { 16, 0, height }, { 16, 32, 3 }); + break; + + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, (direction + 3) % NumOrthogonalDirections), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + + case 6: + { + constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcRightTurn5TilesBanked0_4, + kClassicStandUpRcRightTurn5TilesBanked1_4, + kClassicStandUpRcRightTurn5TilesBanked2_4, + kClassicStandUpRcRightTurn5TilesBanked3_4, + }; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 6, 0, height }, { 20, 32, 3 }); + + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + if (direction == 1 || direction == 0) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + } + PaintUtilSetSegmentSupportHeight( + session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + } + } +} + +static void classicStandUpRCTrackBankedLeftQuarterTurn5( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[trackSequence]; + direction = (direction + 1) % NumOrthogonalDirections; + return classicStandUpRCTrackBankedRightQuarterTurn5(session, ride, trackSequence, direction, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) @@ -184,7 +346,9 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) case TrackElemType::RightBankToFlat: return classicStandUpRCTrackRightBankToFlat; case TrackElemType::BankedLeftQuarterTurn5Tiles: + return classicStandUpRCTrackBankedLeftQuarterTurn5; case TrackElemType::BankedRightQuarterTurn5Tiles: + return classicStandUpRCTrackBankedRightQuarterTurn5; case TrackElemType::LeftBankToUp25: case TrackElemType::RightBankToUp25: case TrackElemType::Up25ToLeftBank: From 91e0f91cb0bbd2f1fd2e0a18000d0b5f0453d5f2 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Mon, 11 Mar 2024 00:22:07 +0100 Subject: [PATCH 100/191] Name segment constants in ClassicStandUpRollerCoaster.cpp --- .../ride/coaster/ClassicStandUpRollerCoaster.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 869a535d99..321889d37f 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -127,7 +127,7 @@ static void classicStandUpRCTrackFlatToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -153,7 +153,7 @@ static void classicStandUpRCTrackFlatToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, direction), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -203,7 +203,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D4, (direction + 3) % NumOrthogonalDirections), + kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -235,7 +235,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B8 | SEGMENT_C0 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_D0 | SEGMENT_D4, (direction + 3) % NumOrthogonalDirections), + PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -262,7 +262,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_BC | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D4, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -293,7 +293,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_B8 | SEGMENT_C4 | SEGMENT_C8 | SEGMENT_CC | SEGMENT_D0, (direction + 3) % NumOrthogonalDirections), + PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -317,7 +317,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(SEGMENT_B4 | SEGMENT_C4 | SEGMENT_CC | SEGMENT_D0, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); + session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } From 6602100d22def44588dbed3c70f979e0b82fd641 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 14 Mar 2024 23:36:50 +0100 Subject: [PATCH 101/191] Update for upstream changes --- .../coaster/ClassicStandUpRollerCoaster.cpp | 43 ++++++++++++++++--- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 321889d37f..c586f0b006 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -127,7 +127,10 @@ static void classicStandUpRCTrackFlatToLeftBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -153,7 +156,10 @@ static void classicStandUpRCTrackFlatToRightBank( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, direction), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -203,7 +209,10 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( - kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomRightSide, (direction + 3) % NumOrthogonalDirections), + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -235,7 +244,11 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentLeftCorner | kSegmentBottomCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentBottomLeftSide | kSegmentBottomRightSide, (direction + 3) % NumOrthogonalDirections), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -262,7 +275,13 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentRightCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomRightSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + (direction + 3) % NumOrthogonalDirections), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -293,7 +312,11 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } PaintUtilSetSegmentSupportHeight( session, - PaintUtilRotateSegments(kSegmentTopCorner | kSegmentLeftCorner | kSegmentCentre | kSegmentTopLeftSide | kSegmentTopRightSide | kSegmentBottomLeftSide, (direction + 3) % NumOrthogonalDirections), + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -317,7 +340,13 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( - session, PaintUtilRotateSegments(kSegmentTopCorner | kSegmentCentre | kSegmentTopRightSide | kSegmentBottomLeftSide, (direction + 3) % NumOrthogonalDirections), 0xFFFF, 0); + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide), + (direction + 3) % NumOrthogonalDirections), + 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } From 515951e6679b6cb45365253f80c199b831ab8bdd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 14 Mar 2024 23:50:40 +0100 Subject: [PATCH 102/191] Normalise PaintUtilRotateSegments() calls --- .../coaster/ClassicStandUpRollerCoaster.cpp | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index c586f0b006..50f24e26c7 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -181,7 +181,6 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - switch (trackSequence) { case 0: @@ -210,9 +209,9 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( session, PaintUtilRotateSegments( EnumsToFlags( - PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, - PaintSegment::bottomRightSide), - (direction + 3) % NumOrthogonalDirections), + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -246,9 +245,9 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( session, PaintUtilRotateSegments( EnumsToFlags( - PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, - PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), - (direction + 3) % NumOrthogonalDirections), + PaintSegment::bottomCorner, PaintSegment::rightCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -278,9 +277,8 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( session, PaintUtilRotateSegments( EnumsToFlags( - PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, - PaintSegment::bottomRightSide), - (direction + 3) % NumOrthogonalDirections), + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -314,9 +312,9 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( session, PaintUtilRotateSegments( EnumsToFlags( - PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, - PaintSegment::topRightSide, PaintSegment::bottomLeftSide), - (direction + 3) % NumOrthogonalDirections), + PaintSegment::leftCorner, PaintSegment::bottomCorner, PaintSegment::centre, + PaintSegment::bottomLeftSide, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; @@ -343,9 +341,9 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( session, PaintUtilRotateSegments( EnumsToFlags( - PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topRightSide, - PaintSegment::bottomLeftSide), - (direction + 3) % NumOrthogonalDirections), + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; From 3c4b0ba36ec48b5d583ed568d5eb8e9f194b8107 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 16 Mar 2024 20:20:49 +0100 Subject: [PATCH 103/191] =?UTF-8?q?Consolidate=20PaintUtilSetGeneralSuppor?= =?UTF-8?q?tHeight()=20calls=20for=203=C3=973?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ride/coaster/ClassicStandUpRollerCoaster.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 50f24e26c7..5dd7aee5b2 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -213,11 +213,9 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintSegment::topRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } case 1: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: @@ -249,7 +247,6 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide, PaintSegment::topRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: @@ -280,11 +277,9 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 4: - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 5: @@ -316,7 +311,6 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintSegment::bottomLeftSide, PaintSegment::topLeftSide, PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 6: @@ -345,10 +339,11 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } } + + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classicStandUpRCTrackBankedLeftQuarterTurn5( From 73441bff5d592292060f89d2a355e11bf5d8f7b7 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 16 Mar 2024 20:22:01 +0100 Subject: [PATCH 104/191] Implement remaining orthogonal banked pieces --- .../coaster/ClassicStandUpRollerCoaster.cpp | 219 ++++++++++++++++++ 1 file changed, 219 insertions(+) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 5dd7aee5b2..74731a155e 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -355,6 +355,215 @@ static void classicStandUpRCTrackBankedLeftQuarterTurn5( return classicStandUpRCTrackBankedRightQuarterTurn5(session, ride, trackSequence, direction, height, trackElement); } +static void classicStandUpRCTrackLeftBankTo25DegUp( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcLeftBankedTo25DegUp0, + kClassicStandUpRcLeftBankedTo25DegUp1, + kClassicStandUpRcLeftBankedTo25DegUp2, + kClassicStandUpRcLeftBankedTo25DegUp3, + }; + + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 3, height, session.SupportColours); + } + + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + } + else + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); +} + +static void classicStandUpRCTrackRightBankTo25DegUp( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcRightBankedTo25DegUp0, + kClassicStandUpRcRightBankedTo25DegUp1, + kClassicStandUpRcRightBankedTo25DegUp2, + kClassicStandUpRcRightBankedTo25DegUp3, + }; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 3, height, session.SupportColours); + } + + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + } + else + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_2); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); +} + +static void classicStandUpRCTrack25DegUpToLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRc25DegUpToFlatLeftBanked0, + kClassicStandUpRc25DegUpToFlatLeftBanked1, + kClassicStandUpRc25DegUpToFlatLeftBanked2, + kClassicStandUpRc25DegUpToFlatLeftBanked3, + }; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 6, height, session.SupportColours); + } + + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); + } + else + { + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); +} + +static void classicStandUpRCTrack25DegUpToRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRc25DegUpToFlatRightBanked0, + kClassicStandUpRc25DegUpToFlatRightBanked1, + kClassicStandUpRc25DegUpToFlatRightBanked2, + kClassicStandUpRc25DegUpToFlatRightBanked3, + }; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 6, height, session.SupportColours); + } + + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); + } + else + { + PaintUtilPushTunnelRotated(session, direction, height + 8, TUNNEL_12); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 40, 0x20); +} + +static void classicStandUpRCTrackLeftBankTo25DegDown( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrack25DegUpToRightBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrackRightBankTo25DegDown( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrack25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrack25DegDownToLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrack25DegDownToRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrackLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[NumOrthogonalDirections] = { + kClassicStandUpRcLeftBanked0, + kClassicStandUpRcLeftBanked1, + kClassicStandUpRcLeftBanked2, + kClassicStandUpRcLeftBanked3, + } ; + + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) + { + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + } + + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); +} + +static void classicStandUpRCTrackRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + return classicStandUpRCTrackLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) @@ -372,15 +581,25 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) case TrackElemType::BankedRightQuarterTurn5Tiles: return classicStandUpRCTrackBankedRightQuarterTurn5; case TrackElemType::LeftBankToUp25: + return classicStandUpRCTrackLeftBankTo25DegUp; case TrackElemType::RightBankToUp25: + return classicStandUpRCTrackRightBankTo25DegUp; case TrackElemType::Up25ToLeftBank: + return classicStandUpRCTrack25DegUpToLeftBank; case TrackElemType::Up25ToRightBank: + return classicStandUpRCTrack25DegUpToRightBank; case TrackElemType::LeftBankToDown25: + return classicStandUpRCTrackLeftBankTo25DegDown; case TrackElemType::RightBankToDown25: + return classicStandUpRCTrackRightBankTo25DegDown; case TrackElemType::Down25ToLeftBank: + return classicStandUpRCTrack25DegDownToLeftBank; case TrackElemType::Down25ToRightBank: + return classicStandUpRCTrack25DegDownToRightBank; case TrackElemType::LeftBank: + return classicStandUpRCTrackLeftBank; case TrackElemType::RightBank: + return classicStandUpRCTrackRightBank; case TrackElemType::LeftEighthBankToDiag: case TrackElemType::RightEighthBankToDiag: From eb058d4fe33d6a06ea5ce71126422107bae8c403 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 16 Mar 2024 21:06:52 +0100 Subject: [PATCH 105/191] Implement 45 degree banked corners --- .../coaster/ClassicStandUpRollerCoaster.cpp | 373 ++++++++++++++++++ 1 file changed, 373 insertions(+) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 74731a155e..598a6ba78d 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -78,6 +78,40 @@ static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked3_0 = SPR_CSG_ static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked3_1 = SPR_CSG_BEGIN + 67239; static constexpr ImageIndex kClassicStandUpRcRightTurn3TilesBanked3_2 = SPR_CSG_BEGIN + 67240; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag0_0 = SPR_CSG_BEGIN + 67361; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag0_1 = SPR_CSG_BEGIN + 67362; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag0_2 = SPR_CSG_BEGIN + 67363; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag0_3 = SPR_CSG_BEGIN + 67364; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag1_0 = SPR_CSG_BEGIN + 67365; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag1_1 = SPR_CSG_BEGIN + 67366; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag1_2 = SPR_CSG_BEGIN + 67367; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag1_3 = SPR_CSG_BEGIN + 67368; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag2_0 = SPR_CSG_BEGIN + 67369; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag2_1 = SPR_CSG_BEGIN + 67370; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag2_2 = SPR_CSG_BEGIN + 67371; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag2_3 = SPR_CSG_BEGIN + 67372; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag3_0 = SPR_CSG_BEGIN + 67373; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag3_1 = SPR_CSG_BEGIN + 67374; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag3_2 = SPR_CSG_BEGIN + 67375; +static constexpr ImageIndex kClassicStandUpRcRightBankedOrthogonalToDiag3_3 = SPR_CSG_BEGIN + 67376; + +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag0_0 = SPR_CSG_BEGIN + 67377; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag0_1 = SPR_CSG_BEGIN + 67378; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag0_2 = SPR_CSG_BEGIN + 67379; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag0_3 = SPR_CSG_BEGIN + 67380; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag1_0 = SPR_CSG_BEGIN + 67381; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag1_1 = SPR_CSG_BEGIN + 67382; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag1_2 = SPR_CSG_BEGIN + 67383; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag1_3 = SPR_CSG_BEGIN + 67384; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag2_0 = SPR_CSG_BEGIN + 67385; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag2_1 = SPR_CSG_BEGIN + 67386; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag2_2 = SPR_CSG_BEGIN + 67387; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag2_3 = SPR_CSG_BEGIN + 67388; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_0 = SPR_CSG_BEGIN + 67389; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 = SPR_CSG_BEGIN + 67390; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 = SPR_CSG_BEGIN + 67391; +static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 = SPR_CSG_BEGIN + 67392; + static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag0 = SPR_CSG_BEGIN + 67421; static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag1 = SPR_CSG_BEGIN + 67422; static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag2 = SPR_CSG_BEGIN + 67423; @@ -103,6 +137,8 @@ static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag1 = static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag2 = SPR_CSG_BEGIN + 67447; static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag3 = SPR_CSG_BEGIN + 67448; + + #pragma GCC diagnostic pop static void classicStandUpRCTrackFlatToLeftBank( @@ -564,6 +600,339 @@ static void classicStandUpRCTrackRightBank( return classicStandUpRCTrackLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } +static void classicStandUpRCTrackLeftEighthBankToDiag( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[5][NumOrthogonalDirections] = { + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_0, kClassicStandUpRcLeftBankedOrthogonalToDiag1_0, kClassicStandUpRcLeftBankedOrthogonalToDiag2_0, kClassicStandUpRcLeftBankedOrthogonalToDiag3_0 }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_1, kClassicStandUpRcLeftBankedOrthogonalToDiag1_1, kClassicStandUpRcLeftBankedOrthogonalToDiag2_1, kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_2, kClassicStandUpRcLeftBankedOrthogonalToDiag1_2, kClassicStandUpRcLeftBankedOrthogonalToDiag2_2, kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 }, + { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_3, kClassicStandUpRcLeftBankedOrthogonalToDiag1_3, kClassicStandUpRcLeftBankedOrthogonalToDiag2_3, kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 }, + }; + + const auto imageId = map[trackSequence][direction]; + + switch (trackSequence) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 6, height }, { 32, 20, 3 } }); + + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 32, 16, 3 } }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 34, 16, 3 } }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 32, 16, 3 } }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 32, 16, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide, PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 2: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 16, 16, 3 } }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 16, height }, { 16, 16, 3 } }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 0, height }, { 16, 16, 3 } }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 16, 16, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 3: + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 4: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 16, height }, { 16, 16, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 16, 18, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 16, 16, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 0, height }, { 16, 16, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + } +} + +static void classicStandUpRCTrackRightEighthBankToDiag( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[5][NumOrthogonalDirections] = { + { kClassicStandUpRcRightBankedOrthogonalToDiag0_0, kClassicStandUpRcRightBankedOrthogonalToDiag1_0, kClassicStandUpRcRightBankedOrthogonalToDiag2_0, kClassicStandUpRcRightBankedOrthogonalToDiag3_0 }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_1, kClassicStandUpRcRightBankedOrthogonalToDiag1_1, kClassicStandUpRcRightBankedOrthogonalToDiag2_1, kClassicStandUpRcRightBankedOrthogonalToDiag3_1 }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_2, kClassicStandUpRcRightBankedOrthogonalToDiag1_2, kClassicStandUpRcRightBankedOrthogonalToDiag2_2, kClassicStandUpRcRightBankedOrthogonalToDiag3_2 }, + { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_3, kClassicStandUpRcRightBankedOrthogonalToDiag1_3, kClassicStandUpRcRightBankedOrthogonalToDiag2_3, kClassicStandUpRcRightBankedOrthogonalToDiag3_3 }, + }; + + const auto imageId = map[trackSequence][direction]; + + switch (trackSequence) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); + + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + if (direction == 0 || direction == 3) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags(PaintSegment::centre, PaintSegment::topRightSide, PaintSegment::bottomLeftSide), direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 32, 16, 3 } }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 32, 16, 3 } }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 34, 16, 3 } }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 32, 16, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 2: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 16, 16, 3 } }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 0, height }, { 16, 16, 3 } }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 4, 4, height }, { 28, 28, 3 } }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 16, 16, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 3: + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 4: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 0, height }, { 16, 16, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 0, height }, { 16, 16, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 16, height }, { 16, 18, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 16, 16, height }, { 16, 16, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide, + PaintSegment::bottomLeftSide, PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + } +} + +static void classicStandUpRCTrackLeftEighthDiagBankToOrthogonal( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + direction = (direction + 2) % NumOrthogonalDirections; + classicStandUpRCTrackRightEighthBankToDiag(session, ride, trackSequence, direction, height, trackElement); +} + +static void classicStandUpRCTrackRightEighthDiagBankToOrthogonal( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapLeftEighthTurnToOrthogonal[trackSequence]; + direction = (direction + 3) % NumOrthogonalDirections; + classicStandUpRCTrackLeftEighthBankToDiag(session, ride, trackSequence, direction, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) @@ -602,9 +971,13 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) return classicStandUpRCTrackRightBank; case TrackElemType::LeftEighthBankToDiag: + return classicStandUpRCTrackLeftEighthBankToDiag; case TrackElemType::RightEighthBankToDiag: + return classicStandUpRCTrackRightEighthBankToDiag; case TrackElemType::LeftEighthBankToOrthogonal: + return classicStandUpRCTrackLeftEighthDiagBankToOrthogonal; case TrackElemType::RightEighthBankToOrthogonal: + return classicStandUpRCTrackRightEighthDiagBankToOrthogonal; case TrackElemType::LeftBankedQuarterTurn3Tiles: case TrackElemType::RightBankedQuarterTurn3Tiles: From 9b1603a37a34a274167045020ac4dd0848c06936 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 16 Mar 2024 21:35:22 +0100 Subject: [PATCH 106/191] =?UTF-8?q?Implement=202=C3=972=20turns?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../coaster/ClassicStandUpRollerCoaster.cpp | 108 ++++++++++++++++++ 1 file changed, 108 insertions(+) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 598a6ba78d..9c6a472f5c 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -933,6 +933,112 @@ static void classicStandUpRCTrackRightEighthDiagBankToOrthogonal( classicStandUpRCTrackLeftEighthBankToDiag(session, ride, trackSequence, direction, height, trackElement); } +static void classicStandUpRCTrackRightBankedQuarterTurn3( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + static constexpr ImageIndex map[4][NumOrthogonalDirections] = { + { kClassicStandUpRcRightTurn3TilesBanked0_0, kClassicStandUpRcRightTurn3TilesBanked1_0, kClassicStandUpRcRightTurn3TilesBanked2_0, kClassicStandUpRcRightTurn3TilesBanked3_0 }, + { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kClassicStandUpRcRightTurn3TilesBanked0_1, kClassicStandUpRcRightTurn3TilesBanked1_1, kClassicStandUpRcRightTurn3TilesBanked2_1, kClassicStandUpRcRightTurn3TilesBanked3_1 }, + + { kClassicStandUpRcRightTurn3TilesBanked0_2, kClassicStandUpRcRightTurn3TilesBanked1_2, kClassicStandUpRcRightTurn3TilesBanked2_2, kClassicStandUpRcRightTurn3TilesBanked3_2 }, + }; + + auto imageId = map[trackSequence][direction]; + + switch (trackSequence) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 6, height }, { 32, 20, 3 }); + + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + switch (direction) + { + case 0: + PaintUtilPushTunnelLeft(session, height, TUNNEL_0); + break; + case 3: + PaintUtilPushTunnelRight(session, height, TUNNEL_0); + break; + + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::topRightSide), + direction), + 0xFFFF, 0); + break; + case 1: + break; + case 2: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 16, 16, height }, { 16, 16, 3 }); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 16, height }, { 16, 16, 3 }); + break; + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { 16, 16, 3 }); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 16, 0, height }, { 16, 16, 3 }); + break; + + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + break; + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(imageId), { 6, 0, height }, { 20, 32, 3 }); + + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); + if (direction == 0 || direction == 1) + { + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + break; + } + + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); +} + +static void classicStandUpRCTrackLeftBankedQuarterTurn3( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapLeftQuarterTurn3TilesToRightQuarterTurn3Tiles[trackSequence]; + direction = (direction + 1) % NumOrthogonalDirections; + classicStandUpRCTrackRightBankedQuarterTurn3(session, ride, trackSequence, direction, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) @@ -980,7 +1086,9 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) return classicStandUpRCTrackRightEighthDiagBankToOrthogonal; case TrackElemType::LeftBankedQuarterTurn3Tiles: + return classicStandUpRCTrackLeftBankedQuarterTurn3; case TrackElemType::RightBankedQuarterTurn3Tiles: + return classicStandUpRCTrackRightBankedQuarterTurn3; case TrackElemType::DiagFlatToLeftBank: case TrackElemType::DiagFlatToRightBank: case TrackElemType::DiagLeftBankToFlat: From b66f687880a2f323b6a83dec594275835a11b2c3 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 16 Mar 2024 22:09:45 +0100 Subject: [PATCH 107/191] Implement diagonal flat parts --- src/openrct2/ride/TrackPaint.cpp | 7 + src/openrct2/ride/TrackPaint.h | 2 + .../coaster/ClassicStandUpRollerCoaster.cpp | 218 +++++++++++++++--- 3 files changed, 199 insertions(+), 28 deletions(-) diff --git a/src/openrct2/ride/TrackPaint.cpp b/src/openrct2/ride/TrackPaint.cpp index 69735b0e89..b4ad3fba81 100644 --- a/src/openrct2/ride/TrackPaint.cpp +++ b/src/openrct2/ride/TrackPaint.cpp @@ -1347,6 +1347,13 @@ const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[] = { 6, 4, 5, 3, 1, 2, 0, }; +const uint8_t mapReversedDiagonalStraight[4] = { + 3, + 2, + 1, + 0, +}; + constexpr CoordsXY defaultRightQuarterTurn5TilesOffsets[4][5] = { { { 0, 6 }, diff --git a/src/openrct2/ride/TrackPaint.h b/src/openrct2/ride/TrackPaint.h index a46fb967f6..3f47862be2 100644 --- a/src/openrct2/ride/TrackPaint.h +++ b/src/openrct2/ride/TrackPaint.h @@ -247,6 +247,8 @@ extern const uint32_t trackSpritesSubmarineRideMiniHelicoptersQuarterTurn3Tiles[ extern const uint32_t trackSpritesSubmarineRideMiniHelicoptersQuarterTurn1Tile[4]; extern const uint8_t mapLeftQuarterTurn5TilesToRightQuarterTurn5Tiles[]; +extern const Direction mapReversedDiagonalStraight[]; + extern const CoordsXY defaultRightQuarterTurn5TilesOffsets[4][5]; extern const CoordsXYZ defaultRightQuarterTurn5TilesBoundOffsets[4][5]; extern const CoordsXY defaultRightQuarterTurn5TilesBoundLengths[4][5]; diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 9c6a472f5c..523cfe39bf 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -112,32 +112,34 @@ static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 = SPR static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 = SPR_CSG_BEGIN + 67391; static constexpr ImageIndex kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 = SPR_CSG_BEGIN + 67392; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag0 = SPR_CSG_BEGIN + 67421; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag1 = SPR_CSG_BEGIN + 67422; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag2 = SPR_CSG_BEGIN + 67423; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightDiag3 = SPR_CSG_BEGIN + 67424; -static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag0 = SPR_CSG_BEGIN + 67425; -static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag1 = SPR_CSG_BEGIN + 67426; -static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag2 = SPR_CSG_BEGIN + 67427; -static constexpr ImageIndex kClassicStandUpRcRightBankedToFlatStraightDiag3 = SPR_CSG_BEGIN + 67428; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag0 = SPR_CSG_BEGIN + 67433; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag1 = SPR_CSG_BEGIN + 67434; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag2 = SPR_CSG_BEGIN + 67435; -static constexpr ImageIndex kClassicStandUpRcRightBankedStraightToDownDiag3 = SPR_CSG_BEGIN + 67436; -static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag0 = SPR_CSG_BEGIN + 67437; -static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag1 = SPR_CSG_BEGIN + 67438; -static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag2 = SPR_CSG_BEGIN + 67439; -static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightToDownDiag3 = SPR_CSG_BEGIN + 67440; -static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag0 = SPR_CSG_BEGIN + 67441; -static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag1 = SPR_CSG_BEGIN + 67442; -static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag2 = SPR_CSG_BEGIN + 67443; -static constexpr ImageIndex kClassicStandUpRcDownStraightToRightBankedFlatDiag3 = SPR_CSG_BEGIN + 67444; -static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag0 = SPR_CSG_BEGIN + 67445; -static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag1 = SPR_CSG_BEGIN + 67446; -static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag2 = SPR_CSG_BEGIN + 67447; -static constexpr ImageIndex kClassicStandUpRcDownStraightToLeftBankedFlatDiag3 = SPR_CSG_BEGIN + 67448; - - +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightDiag0 = SPR_CSG_BEGIN + 67421; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightDiag1 = SPR_CSG_BEGIN + 67422; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightDiag2 = SPR_CSG_BEGIN + 67423; +static constexpr ImageIndex kClassicStandUpRcLeftBankedStraightDiag3 = SPR_CSG_BEGIN + 67424; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBankDiag0 = SPR_CSG_BEGIN + 67425; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBankDiag1 = SPR_CSG_BEGIN + 67426; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBankDiag2 = SPR_CSG_BEGIN + 67427; +static constexpr ImageIndex kClassicStandUpRcFlatToLeftBankDiag3 = SPR_CSG_BEGIN + 67428; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBankDiag0 = SPR_CSG_BEGIN + 67429; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBankDiag1 = SPR_CSG_BEGIN + 67430; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBankDiag2 = SPR_CSG_BEGIN + 67431; +static constexpr ImageIndex kClassicStandUpRcFlatToRightBankDiag3 = SPR_CSG_BEGIN + 67432; +static constexpr ImageIndex kClassicStandUpRc25DegUpToLeftBankDiag0 = SPR_CSG_BEGIN + 67433; +static constexpr ImageIndex kClassicStandUpRc25DegUpToLeftBankDiag1 = SPR_CSG_BEGIN + 67434; +static constexpr ImageIndex kClassicStandUpRc25DegUpToLeftBankDiag2 = SPR_CSG_BEGIN + 67435; +static constexpr ImageIndex kClassicStandUpRc25DegUpToLeftBankDiag3 = SPR_CSG_BEGIN + 67436; +static constexpr ImageIndex kClassicStandUpRc25DegUpToRightBankDiag0 = SPR_CSG_BEGIN + 67437; +static constexpr ImageIndex kClassicStandUpRc25DegUpToRightBankDiag1 = SPR_CSG_BEGIN + 67438; +static constexpr ImageIndex kClassicStandUpRc25DegUpToRightBankDiag2 = SPR_CSG_BEGIN + 67439; +static constexpr ImageIndex kClassicStandUpRc25DegUpToRightBankDiag3 = SPR_CSG_BEGIN + 67440; +static constexpr ImageIndex kClassicStandUpRcLeftBankTo25DegUpDiag0 = SPR_CSG_BEGIN + 67441; +static constexpr ImageIndex kClassicStandUpRcLeftBankTo25DegUpDiag1 = SPR_CSG_BEGIN + 67442; +static constexpr ImageIndex kClassicStandUpRcLeftBankTo25DegUpDiag2 = SPR_CSG_BEGIN + 67443; +static constexpr ImageIndex kClassicStandUpRcLeftBankTo25DegUpDiag3 = SPR_CSG_BEGIN + 67444; +static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag0 = SPR_CSG_BEGIN + 67445; +static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag1 = SPR_CSG_BEGIN + 67446; +static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag2 = SPR_CSG_BEGIN + 67447; +static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag3 = SPR_CSG_BEGIN + 67448; #pragma GCC diagnostic pop @@ -1039,6 +1041,160 @@ static void classicStandUpRCTrackLeftBankedQuarterTurn3( classicStandUpRCTrackRightBankedQuarterTurn3(session, ride, trackSequence, direction, height, trackElement); } +template +static inline void classicStandUpRCTrackDiagFlatWithBank( + PaintSession& session, uint8_t trackSequence, uint8_t direction, int32_t height) +{ + switch (trackSequence) + { + case 0: + switch (direction) + { + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img3), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img0), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 2: + switch (direction) + { + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img2), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + case 3: + switch (direction) + { + case 0: + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img1), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); + break; + case 2: + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + break; + case 3: + MetalASupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + break; + } + + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); + break; + } +} + +static void classicStandUpRCTrackDiagFlatToLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiagFlatWithBank< + kClassicStandUpRcFlatToLeftBankDiag0, kClassicStandUpRcFlatToLeftBankDiag1, kClassicStandUpRcFlatToLeftBankDiag2, + kClassicStandUpRcFlatToLeftBankDiag3>(session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiagFlatToRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiagFlatWithBank< + kClassicStandUpRcFlatToRightBankDiag0, kClassicStandUpRcFlatToRightBankDiag1, kClassicStandUpRcFlatToRightBankDiag2, + kClassicStandUpRcFlatToRightBankDiag3>(session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiagLeftBankToFlat( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + return classicStandUpRCTrackDiagFlatToRightBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrackDiagRightBankToFlat( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + return classicStandUpRCTrackDiagFlatToLeftBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + +static void classicStandUpRCTrackDiagLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiagFlatWithBank< + kClassicStandUpRcLeftBankedStraightDiag0, kClassicStandUpRcLeftBankedStraightDiag1, + kClassicStandUpRcLeftBankedStraightDiag2, kClassicStandUpRcLeftBankedStraightDiag3>( + session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiagRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + return classicStandUpRCTrackDiagLeftBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) @@ -1090,9 +1246,13 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) case TrackElemType::RightBankedQuarterTurn3Tiles: return classicStandUpRCTrackRightBankedQuarterTurn3; case TrackElemType::DiagFlatToLeftBank: + return classicStandUpRCTrackDiagFlatToLeftBank; case TrackElemType::DiagFlatToRightBank: + return classicStandUpRCTrackDiagFlatToRightBank; case TrackElemType::DiagLeftBankToFlat: + return classicStandUpRCTrackDiagLeftBankToFlat; case TrackElemType::DiagRightBankToFlat: + return classicStandUpRCTrackDiagRightBankToFlat; case TrackElemType::DiagLeftBankToUp25: case TrackElemType::DiagRightBankToUp25: case TrackElemType::DiagUp25ToLeftBank: @@ -1101,9 +1261,11 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) case TrackElemType::DiagRightBankToDown25: case TrackElemType::DiagDown25ToLeftBank: case TrackElemType::DiagDown25ToRightBank: - case TrackElemType::DiagLeftBank: - case TrackElemType::DiagRightBank: return nullptr; + case TrackElemType::DiagLeftBank: + return classicStandUpRCTrackDiagLeftBank; + case TrackElemType::DiagRightBank: + return classicStandUpRCTrackDiagRightBank; } return GetTrackPaintFunctionStandUpRC(trackType); From 9982749defd27958ba09a2b3b0dc78f97b586794 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Mar 2024 12:42:40 +0100 Subject: [PATCH 108/191] Implement diagonal-sloped-straight-to-bank sections --- .../coaster/ClassicStandUpRollerCoaster.cpp | 286 +++++++++++++++++- 1 file changed, 280 insertions(+), 6 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 523cfe39bf..384378051c 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -13,9 +13,6 @@ #include -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-const-variable" - static constexpr ImageIndex kClassicStandUpRcFlatToRightBank0 = SPR_CSG_BEGIN + 67009; static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank2 = SPR_CSG_BEGIN + 67010; static constexpr ImageIndex kClassicStandUpRcFlatToLeftBank0 = SPR_CSG_BEGIN + 67011; @@ -141,8 +138,6 @@ static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag1 = SPR_CSG_B static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag2 = SPR_CSG_BEGIN + 67447; static constexpr ImageIndex kClassicStandUpRcRightBankTo25DegUpDiag3 = SPR_CSG_BEGIN + 67448; -#pragma GCC diagnostic pop - static void classicStandUpRCTrackFlatToLeftBank( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) @@ -1195,6 +1190,278 @@ static void classicStandUpRCTrackDiagRightBank( session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } +template +static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( + PaintSession& session, uint8_t trackSequence, uint8_t direction, int32_t height) +{ + switch (trackSequence) + { + case 0: + switch (direction) + { + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img3), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img0), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); + break; + case 2: + switch (direction) + { + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img2), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); + break; + case 3: + switch (direction) + { + case 0: + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img1), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); + break; + case 2: + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); + break; + case 3: + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); + break; + } +} + +static void classicStandUpRCTrackDiagLeftBankTo25DegUp( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiagFlatTo25DegUpBanked< + kClassicStandUpRcLeftBankTo25DegUpDiag0, kClassicStandUpRcLeftBankTo25DegUpDiag1, + kClassicStandUpRcLeftBankTo25DegUpDiag2, kClassicStandUpRcLeftBankTo25DegUpDiag3>( + session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiagRightBankTo25DegUp( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiagFlatTo25DegUpBanked< + kClassicStandUpRcRightBankTo25DegUpDiag0, kClassicStandUpRcRightBankTo25DegUpDiag1, + kClassicStandUpRcRightBankTo25DegUpDiag2, kClassicStandUpRcRightBankTo25DegUpDiag3>( + session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiag25DegDownToLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + direction = (direction + 2) % NumOrthogonalDirections; + classicStandUpRCTrackDiagRightBankTo25DegUp(session, ride, trackSequence, direction, height, trackElement); +} + +static void classicStandUpRCTrackDiag25DegDownToRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + direction = (direction + 2) % NumOrthogonalDirections; + classicStandUpRCTrackDiagLeftBankTo25DegUp(session, ride, trackSequence, direction, height, trackElement); +} + +template +static void classicStandUpRCTrackDiag25DegUpToFlatBanked( + PaintSession& session, uint8_t trackSequence, uint8_t direction, int32_t height) +{ + switch (trackSequence) + { + case 0: + switch (direction) + { + case 3: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img3), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::rightCorner, PaintSegment::centre, PaintSegment::topRightSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); + break; + case 1: + switch (direction) + { + case 0: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img0), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); + break; + case 2: + switch (direction) + { + case 2: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img2), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::bottomCorner, PaintSegment::centre, PaintSegment::bottomLeftSide, + PaintSegment::bottomRightSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); + break; + case 3: + switch (direction) + { + case 0: + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); + break; + case 1: + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(img1), { -16, -16, height }, + { { -16, -16, height }, { 32, 32, 3 } }); + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 4, height, session.SupportColours); + break; + case 2: + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); + break; + case 3: + MetalBSupportsPaintSetup( + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 4, height, session.SupportColours); + break; + } + PaintUtilSetSegmentSupportHeight( + session, + PaintUtilRotateSegments( + EnumsToFlags( + PaintSegment::leftCorner, PaintSegment::centre, PaintSegment::topLeftSide, + PaintSegment::bottomLeftSide), + direction), + 0xFFFF, 0); + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); + break; + } +} + +static void classicStandUpRCTrackDiag25DegUpToLeftBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiag25DegUpToFlatBanked< + kClassicStandUpRc25DegUpToLeftBankDiag0, kClassicStandUpRc25DegUpToLeftBankDiag1, + kClassicStandUpRc25DegUpToLeftBankDiag2, kClassicStandUpRc25DegUpToLeftBankDiag3>( + session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiag25DegUpToRightBank( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + classicStandUpRCTrackDiag25DegUpToFlatBanked< + kClassicStandUpRc25DegUpToRightBankDiag0, kClassicStandUpRc25DegUpToRightBankDiag1, + kClassicStandUpRc25DegUpToRightBankDiag2, kClassicStandUpRc25DegUpToRightBankDiag3>( + session, trackSequence, direction, height); +} + +static void classicStandUpRCTrackDiagLeftBankTo25DegDown( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + direction = (direction + 2) % NumOrthogonalDirections; + classicStandUpRCTrackDiag25DegUpToRightBank(session, ride, trackSequence, direction, height, trackElement); +} + +static void classicStandUpRCTrackDiagRightBankTo25DegDown( + PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, + const TrackElement& trackElement) +{ + trackSequence = mapReversedDiagonalStraight[trackSequence]; + direction = (direction + 2) % NumOrthogonalDirections; + classicStandUpRCTrackDiag25DegUpToLeftBank(session, ride, trackSequence, direction, height, trackElement); +} + TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { switch (trackType) @@ -1254,14 +1521,21 @@ TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) case TrackElemType::DiagRightBankToFlat: return classicStandUpRCTrackDiagRightBankToFlat; case TrackElemType::DiagLeftBankToUp25: + return classicStandUpRCTrackDiagLeftBankTo25DegUp; case TrackElemType::DiagRightBankToUp25: + return classicStandUpRCTrackDiagRightBankTo25DegUp; case TrackElemType::DiagUp25ToLeftBank: + return classicStandUpRCTrackDiag25DegUpToLeftBank; case TrackElemType::DiagUp25ToRightBank: + return classicStandUpRCTrackDiag25DegUpToRightBank; case TrackElemType::DiagLeftBankToDown25: + return classicStandUpRCTrackDiagLeftBankTo25DegDown; case TrackElemType::DiagRightBankToDown25: + return classicStandUpRCTrackDiagRightBankTo25DegDown; case TrackElemType::DiagDown25ToLeftBank: + return classicStandUpRCTrackDiag25DegDownToLeftBank; case TrackElemType::DiagDown25ToRightBank: - return nullptr; + return classicStandUpRCTrackDiag25DegDownToRightBank; case TrackElemType::DiagLeftBank: return classicStandUpRCTrackDiagLeftBank; case TrackElemType::DiagRightBank: From 00e1f504f5ffe14da234b7eb0120824ad736d751 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Mar 2024 12:55:02 +0100 Subject: [PATCH 109/191] Create rotated version of support functions --- src/openrct2/paint/support/MetalSupports.cpp | 36 ++++++++++++++++++++ src/openrct2/paint/support/MetalSupports.h | 6 ++++ 2 files changed, 42 insertions(+) diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index b9b15ab2c6..08f266f67e 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -178,6 +178,26 @@ static constexpr uint8_t metal_supports_slope_image_map[] = { }; // clang-format on +static constexpr MetalSupportPlace kMetalSupportPlacementRotated[][NumOrthogonalDirections] = { + { MetalSupportPlace::TopCorner, MetalSupportPlace::RightCorner, MetalSupportPlace::BottomCorner, + MetalSupportPlace::LeftCorner }, + { MetalSupportPlace::LeftCorner, MetalSupportPlace::TopCorner, MetalSupportPlace::RightCorner, + MetalSupportPlace::BottomCorner }, + { MetalSupportPlace::RightCorner, MetalSupportPlace::BottomCorner, MetalSupportPlace::LeftCorner, + MetalSupportPlace::TopCorner }, + { MetalSupportPlace::BottomCorner, MetalSupportPlace::LeftCorner, MetalSupportPlace::TopCorner, + MetalSupportPlace::RightCorner }, + { MetalSupportPlace::Centre, MetalSupportPlace::Centre, MetalSupportPlace::Centre, MetalSupportPlace::Centre }, + { MetalSupportPlace::TopLeftSide, MetalSupportPlace::TopRightSide, MetalSupportPlace::BottomRightSide, + MetalSupportPlace::BottomLeftSide }, + { MetalSupportPlace::TopRightSide, MetalSupportPlace::BottomRightSide, MetalSupportPlace::BottomLeftSide, + MetalSupportPlace::TopLeftSide }, + { MetalSupportPlace::BottomLeftSide, MetalSupportPlace::BottomLeftSide, MetalSupportPlace::TopLeftSide, + MetalSupportPlace::TopRightSide }, + { MetalSupportPlace::BottomRightSide, MetalSupportPlace::TopLeftSide, MetalSupportPlace::TopRightSide, + MetalSupportPlace::BottomRightSide }, +}; + /** * Metal pole supports * @param supportType (edi) @@ -374,6 +394,14 @@ bool MetalASupportsPaintSetup( return true; } +bool MetalASupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, + int32_t special, int32_t height, ImageId imageTemplate) +{ + placement = kMetalSupportPlacementRotated[EnumValue(placement)][direction]; + return MetalASupportsPaintSetup(session, supportTypeMember, placement, special, height, imageTemplate); +} + /** * Metal pole supports * rct2: 0x00663584 @@ -559,6 +587,14 @@ bool MetalBSupportsPaintSetup( return false; // AND } +bool MetalBSupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, + int32_t special, int32_t height, ImageId imageTemplate) +{ + placement = kMetalSupportPlacementRotated[EnumValue(placement)][direction]; + return MetalBSupportsPaintSetup(session, supportTypeMember, placement, special, height, imageTemplate); +} + constexpr uint8_t MetalSupportTypeCount = 13; constexpr MetalSupportType RotatedMetalSupports[MetalSupportTypeCount][NumOrthogonalDirections] = { { MetalSupportType::Tubes, MetalSupportType::Tubes, MetalSupportType::Tubes, MetalSupportType::Tubes }, diff --git a/src/openrct2/paint/support/MetalSupports.h b/src/openrct2/paint/support/MetalSupports.h index 40c74e4288..c1e3b95db1 100644 --- a/src/openrct2/paint/support/MetalSupports.h +++ b/src/openrct2/paint/support/MetalSupports.h @@ -95,9 +95,15 @@ struct PaintSession; bool MetalASupportsPaintSetup( PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, ImageId imageTemplate); +bool MetalASupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, + int32_t special, int32_t height, ImageId imageTemplate); bool MetalBSupportsPaintSetup( PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, int32_t special, int32_t height, ImageId imageTemplate); +bool MetalBSupportsPaintSetupRotated( + PaintSession& session, MetalSupportType supportTypeMember, MetalSupportPlace placement, Direction direction, + int32_t special, int32_t height, ImageId imageTemplate); void DrawSupportsSideBySide( PaintSession& session, Direction direction, uint16_t height, ImageId colour, MetalSupportType type, int32_t special = 0); bool PathPoleSupportsPaintSetup( From d6ce38185f9783932f05243cde048267ec938af7 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Mar 2024 13:03:50 +0100 Subject: [PATCH 110/191] Consolidate support and general support height calls --- .../coaster/ClassicStandUpRollerCoaster.cpp | 90 +++++-------------- 1 file changed, 20 insertions(+), 70 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 384378051c..5cf3977a55 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -717,31 +717,26 @@ static void classicStandUpRCTrackLeftEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, direction, 0, height, session.SupportColours); + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -874,31 +869,26 @@ static void classicStandUpRCTrackRightEighthBankToDiag( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 16, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 0, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 16, height }, { 16, 18, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 16, 16, height }, { 16, 16, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1059,7 +1049,6 @@ static inline void classicStandUpRCTrackDiagFlatWithBank( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 1: switch (direction) @@ -1077,7 +1066,6 @@ static inline void classicStandUpRCTrackDiagFlatWithBank( PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 2: switch (direction) @@ -1096,31 +1084,18 @@ static inline void classicStandUpRCTrackDiagFlatWithBank( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; case 3: switch (direction) { - case 0: - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(img1), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); - break; - case 2: - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalASupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; } + MetalASupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, @@ -1130,9 +1105,10 @@ static inline void classicStandUpRCTrackDiagFlatWithBank( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); break; } + + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } static void classicStandUpRCTrackDiagFlatToLeftBank( @@ -1213,7 +1189,6 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 1: switch (direction) @@ -1231,7 +1206,6 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 2: switch (direction) @@ -1250,31 +1224,19 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 0, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(img1), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 0, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 0, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 0, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1283,9 +1245,10 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); break; } + + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } static void classicStandUpRCTrackDiagLeftBankTo25DegUp( @@ -1349,7 +1312,6 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 1: switch (direction) @@ -1367,7 +1329,6 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( PaintSegment::topCorner, PaintSegment::centre, PaintSegment::topLeftSide, PaintSegment::topRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 2: switch (direction) @@ -1386,31 +1347,19 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( PaintSegment::bottomRightSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; case 3: switch (direction) { - case 0: - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, 4, height, session.SupportColours); - break; case 1: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(img1), { -16, -16, height }, { { -16, -16, height }, { 32, 32, 3 } }); - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::TopCorner, 4, height, session.SupportColours); - break; - case 2: - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::RightCorner, 4, height, session.SupportColours); - break; - case 3: - MetalBSupportsPaintSetup( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, 4, height, session.SupportColours); break; } + MetalBSupportsPaintSetupRotated( + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1419,9 +1368,10 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( PaintSegment::bottomLeftSide), direction), 0xFFFF, 0); - PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); break; } + + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } static void classicStandUpRCTrackDiag25DegUpToLeftBank( From 246569440454d100ed10ebcb1651506156a9c774 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Mar 2024 13:48:07 +0100 Subject: [PATCH 111/191] Fix formatting --- .../coaster/ClassicStandUpRollerCoaster.cpp | 201 ++++++++++-------- 1 file changed, 114 insertions(+), 87 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 5cf3977a55..af521e3a51 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -7,9 +7,9 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#include "../../sprites.h" #include "../Track.h" #include "../TrackPaint.h" -#include "../../sprites.h" #include @@ -148,16 +148,16 @@ static void classicStandUpRCTrackFlatToLeftBank( kClassicStandUpRcFlatToLeftBank2, kClassicStandUpRcFlatToLeftBank3, }; - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); - + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); } - + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( session, @@ -177,16 +177,16 @@ static void classicStandUpRCTrackFlatToRightBank( kClassicStandUpRcFlatToRightBank2, kClassicStandUpRcFlatToRightBank3, }; - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); - + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); } - + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( session, @@ -200,14 +200,16 @@ static void classicStandUpRCTrackLeftBankToFlat( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - return classicStandUpRCTrackFlatToRightBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + return classicStandUpRCTrackFlatToRightBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrackRightBankToFlat( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - return classicStandUpRCTrackFlatToLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + return classicStandUpRCTrackFlatToLeftBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrackBankedRightQuarterTurn5( @@ -225,7 +227,8 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( kClassicStandUpRcRightTurn5TilesBanked3_0, }; - PaintAddImageAsParentRotated(session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); + PaintAddImageAsParentRotated( + session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); @@ -250,27 +253,30 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( } case 1: break; - + case 2: switch (direction) { case 0: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_1), { 0, 16, height }, { 32, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_1), + { 0, 16, height }, { 32, 16, 3 }); break; case 1: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_1), { 0, 16, height }, { 32, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_1), + { 0, 16, height }, { 32, 16, 3 }); break; case 2: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_1), { 0, 0, height }, { 32, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_1), + { 0, 0, height }, { 32, 16, 3 }); break; case 3: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_1), { 0, 0, height }, { 32, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_1), + { 0, 0, height }, { 32, 16, 3 }); break; - } PaintUtilSetSegmentSupportHeight( session, @@ -281,27 +287,30 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( direction), 0xFFFF, 0); break; - + case 3: switch (direction) { case 0: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_2), { 0, 0, height }, { 16, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_2), + { 0, 0, height }, { 16, 16, 3 }); break; case 1: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_2), { 16, 0, height }, { 16, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_2), + { 16, 0, height }, { 16, 16, 3 }); break; case 2: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_2), { 16, 16, height }, { 16, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_2), + { 16, 16, height }, { 16, 16, 3 }); break; case 3: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_2), { 0, 16, height }, { 16, 16, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_2), + { 0, 16, height }, { 16, 16, 3 }); break; - } PaintUtilSetSegmentSupportHeight( session, @@ -311,30 +320,33 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( direction), 0xFFFF, 0); break; - + case 4: break; - + case 5: switch (direction) { case 0: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_3), { 16, 0, height }, { 16, 32, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked0_3), + { 16, 0, height }, { 16, 32, 3 }); break; case 1: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_3), { 0, 0, height }, { 16, 32, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked1_3), + { 0, 0, height }, { 16, 32, 3 }); break; case 2: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_3), { 0, 0, height }, { 16, 32, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked2_3), + { 0, 0, height }, { 16, 32, 3 }); break; case 3: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_3), { 16, 0, height }, { 16, 32, 3 }); + session, direction, session.TrackColours.WithIndex(kClassicStandUpRcRightTurn5TilesBanked3_3), + { 16, 0, height }, { 16, 32, 3 }); break; - } PaintUtilSetSegmentSupportHeight( session, @@ -354,10 +366,10 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( kClassicStandUpRcRightTurn5TilesBanked2_4, kClassicStandUpRcRightTurn5TilesBanked3_4, }; - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 6, 0, height }, { 20, 32, 3 }); - + MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction == 1 || direction == 0) @@ -375,7 +387,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( break; } } - + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -398,8 +410,7 @@ static void classicStandUpRCTrackLeftBankTo25DegUp( kClassicStandUpRcLeftBankedTo25DegUp2, kClassicStandUpRcLeftBankedTo25DegUp3, }; - - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); @@ -408,7 +419,7 @@ static void classicStandUpRCTrackLeftBankTo25DegUp( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 3, height, session.SupportColours); } - + if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); @@ -435,16 +446,16 @@ static void classicStandUpRCTrackRightBankTo25DegUp( kClassicStandUpRcRightBankedTo25DegUp2, kClassicStandUpRcRightBankedTo25DegUp3, }; - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); - + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 3, height, session.SupportColours); } - + if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); @@ -471,7 +482,7 @@ static void classicStandUpRCTrack25DegUpToLeftBank( kClassicStandUpRc25DegUpToFlatLeftBanked2, kClassicStandUpRc25DegUpToFlatLeftBanked3, }; - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); @@ -480,7 +491,7 @@ static void classicStandUpRCTrack25DegUpToLeftBank( MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 6, height, session.SupportColours); } - + if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); @@ -507,16 +518,16 @@ static void classicStandUpRCTrack25DegUpToRightBank( kClassicStandUpRc25DegUpToFlatRightBanked2, kClassicStandUpRc25DegUpToFlatRightBanked3, }; - + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); - + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 6, height, session.SupportColours); } - + if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_0); @@ -537,28 +548,32 @@ static void classicStandUpRCTrackLeftBankTo25DegDown( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - classicStandUpRCTrack25DegUpToRightBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + classicStandUpRCTrack25DegUpToRightBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrackRightBankTo25DegDown( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - classicStandUpRCTrack25DegUpToLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + classicStandUpRCTrack25DegUpToLeftBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrack25DegDownToLeftBank( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - classicStandUpRCTrackRightBankTo25DegUp(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + classicStandUpRCTrackRightBankTo25DegUp( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrack25DegDownToRightBank( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - classicStandUpRCTrackLeftBankTo25DegUp(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + classicStandUpRCTrackLeftBankTo25DegUp( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrackLeftBank( @@ -570,17 +585,17 @@ static void classicStandUpRCTrackLeftBank( kClassicStandUpRcLeftBanked1, kClassicStandUpRcLeftBanked2, kClassicStandUpRcLeftBanked3, - } ; - + }; + PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(map[direction]), { 0, 6, height }, { 32, 20, 3 }); - + if (TrackPaintUtilShouldPaintSupports(session.MapPosition)) { MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); } - + PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); PaintUtilSetSegmentSupportHeight( session, @@ -594,7 +609,8 @@ static void classicStandUpRCTrackRightBank( PaintSession& session, const Ride& ride, uint8_t trackSequence, uint8_t direction, int32_t height, const TrackElement& trackElement) { - return classicStandUpRCTrackLeftBank(session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); + return classicStandUpRCTrackLeftBank( + session, ride, trackSequence, (direction + 2) % NumOrthogonalDirections, height, trackElement); } static void classicStandUpRCTrackLeftEighthBankToDiag( @@ -602,22 +618,26 @@ static void classicStandUpRCTrackLeftEighthBankToDiag( const TrackElement& trackElement) { static constexpr ImageIndex map[5][NumOrthogonalDirections] = { - { kClassicStandUpRcLeftBankedOrthogonalToDiag0_0, kClassicStandUpRcLeftBankedOrthogonalToDiag1_0, kClassicStandUpRcLeftBankedOrthogonalToDiag2_0, kClassicStandUpRcLeftBankedOrthogonalToDiag3_0 }, - { kClassicStandUpRcLeftBankedOrthogonalToDiag0_1, kClassicStandUpRcLeftBankedOrthogonalToDiag1_1, kClassicStandUpRcLeftBankedOrthogonalToDiag2_1, kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 }, - { kClassicStandUpRcLeftBankedOrthogonalToDiag0_2, kClassicStandUpRcLeftBankedOrthogonalToDiag1_2, kClassicStandUpRcLeftBankedOrthogonalToDiag2_2, kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, - { kClassicStandUpRcLeftBankedOrthogonalToDiag0_3, kClassicStandUpRcLeftBankedOrthogonalToDiag1_3, kClassicStandUpRcLeftBankedOrthogonalToDiag2_3, kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_0, kClassicStandUpRcLeftBankedOrthogonalToDiag1_0, + kClassicStandUpRcLeftBankedOrthogonalToDiag2_0, kClassicStandUpRcLeftBankedOrthogonalToDiag3_0 }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_1, kClassicStandUpRcLeftBankedOrthogonalToDiag1_1, + kClassicStandUpRcLeftBankedOrthogonalToDiag2_1, kClassicStandUpRcLeftBankedOrthogonalToDiag3_1 }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_2, kClassicStandUpRcLeftBankedOrthogonalToDiag1_2, + kClassicStandUpRcLeftBankedOrthogonalToDiag2_2, kClassicStandUpRcLeftBankedOrthogonalToDiag3_2 }, + { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kClassicStandUpRcLeftBankedOrthogonalToDiag0_3, kClassicStandUpRcLeftBankedOrthogonalToDiag1_3, + kClassicStandUpRcLeftBankedOrthogonalToDiag2_3, kClassicStandUpRcLeftBankedOrthogonalToDiag3_3 }, }; - + const auto imageId = map[trackSequence][direction]; - + switch (trackSequence) { case 0: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - + MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction == 0 || direction == 3) @@ -735,8 +755,9 @@ static void classicStandUpRCTrackLeftEighthBankToDiag( break; } MetalASupportsPaintSetupRotated( - session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, direction, 0, height, session.SupportColours); - + session, MetalSupportType::Tubes, MetalSupportPlace::BottomCorner, direction, 0, height, + session.SupportColours); + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -755,21 +776,26 @@ static void classicStandUpRCTrackRightEighthBankToDiag( const TrackElement& trackElement) { static constexpr ImageIndex map[5][NumOrthogonalDirections] = { - { kClassicStandUpRcRightBankedOrthogonalToDiag0_0, kClassicStandUpRcRightBankedOrthogonalToDiag1_0, kClassicStandUpRcRightBankedOrthogonalToDiag2_0, kClassicStandUpRcRightBankedOrthogonalToDiag3_0 }, - { kClassicStandUpRcRightBankedOrthogonalToDiag0_1, kClassicStandUpRcRightBankedOrthogonalToDiag1_1, kClassicStandUpRcRightBankedOrthogonalToDiag2_1, kClassicStandUpRcRightBankedOrthogonalToDiag3_1 }, - { kClassicStandUpRcRightBankedOrthogonalToDiag0_2, kClassicStandUpRcRightBankedOrthogonalToDiag1_2, kClassicStandUpRcRightBankedOrthogonalToDiag2_2, kClassicStandUpRcRightBankedOrthogonalToDiag3_2 }, - { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, - { kClassicStandUpRcRightBankedOrthogonalToDiag0_3, kClassicStandUpRcRightBankedOrthogonalToDiag1_3, kClassicStandUpRcRightBankedOrthogonalToDiag2_3, kClassicStandUpRcRightBankedOrthogonalToDiag3_3 }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_0, kClassicStandUpRcRightBankedOrthogonalToDiag1_0, + kClassicStandUpRcRightBankedOrthogonalToDiag2_0, kClassicStandUpRcRightBankedOrthogonalToDiag3_0 }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_1, kClassicStandUpRcRightBankedOrthogonalToDiag1_1, + kClassicStandUpRcRightBankedOrthogonalToDiag2_1, kClassicStandUpRcRightBankedOrthogonalToDiag3_1 }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_2, kClassicStandUpRcRightBankedOrthogonalToDiag1_2, + kClassicStandUpRcRightBankedOrthogonalToDiag2_2, kClassicStandUpRcRightBankedOrthogonalToDiag3_2 }, + { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, + { kClassicStandUpRcRightBankedOrthogonalToDiag0_3, kClassicStandUpRcRightBankedOrthogonalToDiag1_3, + kClassicStandUpRcRightBankedOrthogonalToDiag2_3, kClassicStandUpRcRightBankedOrthogonalToDiag3_3 }, }; - + const auto imageId = map[trackSequence][direction]; - + switch (trackSequence) { case 0: PaintAddImageAsParentRotated( - session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, { { 0, 6, height }, { 32, 20, 3 } }); - + session, direction, session.TrackColours.WithIndex(imageId), { 0, 0, height }, + { { 0, 6, height }, { 32, 20, 3 } }); + MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction == 0 || direction == 3) @@ -888,7 +914,7 @@ static void classicStandUpRCTrackRightEighthBankToDiag( } MetalASupportsPaintSetupRotated( session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); - + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -925,15 +951,18 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( const TrackElement& trackElement) { static constexpr ImageIndex map[4][NumOrthogonalDirections] = { - { kClassicStandUpRcRightTurn3TilesBanked0_0, kClassicStandUpRcRightTurn3TilesBanked1_0, kClassicStandUpRcRightTurn3TilesBanked2_0, kClassicStandUpRcRightTurn3TilesBanked3_0 }, + { kClassicStandUpRcRightTurn3TilesBanked0_0, kClassicStandUpRcRightTurn3TilesBanked1_0, + kClassicStandUpRcRightTurn3TilesBanked2_0, kClassicStandUpRcRightTurn3TilesBanked3_0 }, { ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined, ImageIndexUndefined }, - { kClassicStandUpRcRightTurn3TilesBanked0_1, kClassicStandUpRcRightTurn3TilesBanked1_1, kClassicStandUpRcRightTurn3TilesBanked2_1, kClassicStandUpRcRightTurn3TilesBanked3_1 }, - - { kClassicStandUpRcRightTurn3TilesBanked0_2, kClassicStandUpRcRightTurn3TilesBanked1_2, kClassicStandUpRcRightTurn3TilesBanked2_2, kClassicStandUpRcRightTurn3TilesBanked3_2 }, + { kClassicStandUpRcRightTurn3TilesBanked0_1, kClassicStandUpRcRightTurn3TilesBanked1_1, + kClassicStandUpRcRightTurn3TilesBanked2_1, kClassicStandUpRcRightTurn3TilesBanked3_1 }, + + { kClassicStandUpRcRightTurn3TilesBanked0_2, kClassicStandUpRcRightTurn3TilesBanked1_2, + kClassicStandUpRcRightTurn3TilesBanked2_2, kClassicStandUpRcRightTurn3TilesBanked3_2 }, }; - + auto imageId = map[trackSequence][direction]; - + switch (trackSequence) { case 0: @@ -950,7 +979,6 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( case 3: PaintUtilPushTunnelRight(session, height, TUNNEL_0); break; - } PaintUtilSetSegmentSupportHeight( session, @@ -982,7 +1010,6 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 16, 0, height }, { 16, 16, 3 }); break; - } PaintUtilSetSegmentSupportHeight( session, @@ -996,7 +1023,7 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( case 3: PaintAddImageAsParentRotated( session, direction, session.TrackColours.WithIndex(imageId), { 6, 0, height }, { 20, 32, 3 }); - + MetalASupportsPaintSetup( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction == 0 || direction == 1) @@ -1013,7 +1040,7 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( 0xFFFF, 0); break; } - + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1107,7 +1134,7 @@ static inline void classicStandUpRCTrackDiagFlatWithBank( 0xFFFF, 0); break; } - + PaintUtilSetGeneralSupportHeight(session, height + 32, 0x20); } @@ -1236,7 +1263,7 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( } MetalBSupportsPaintSetupRotated( session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); - + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1247,7 +1274,7 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( 0xFFFF, 0); break; } - + PaintUtilSetGeneralSupportHeight(session, height + 48, 0x20); } @@ -1359,7 +1386,7 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( } MetalBSupportsPaintSetupRotated( session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); - + PaintUtilSetSegmentSupportHeight( session, PaintUtilRotateSegments( @@ -1370,7 +1397,7 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( 0xFFFF, 0); break; } - + PaintUtilSetGeneralSupportHeight(session, height + 56, 0x20); } From d94ebee33eee5f1e1b7b08dd2fa50549f5659232 Mon Sep 17 00:00:00 2001 From: ZeeMaji <42477864+ZeeMaji@users.noreply.github.com> Date: Wed, 20 Mar 2024 09:38:58 -0400 Subject: [PATCH 112/191] Add improved description --- data/language/en-GB.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 8fef46f9e5..30b97ba615 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -182,7 +182,7 @@ STR_0603 :A wooden style roller coaster with a steel track, allowing for stee STR_0604 :Riders ride single file on a narrow monorail track, as they race through tight inversions and direction changes STR_0605 :Riders toboggan down a meandering steel track, braking to control their speed STR_0606 :An older-style wooden roller coaster with a fast and rough ride, with plenty of air-time, some lateral G’s, and designed to feel ‘out-of-control’ -STR_0607 :A looping roller coaster where the riders ride in a standing position +STR_0607 :An intense, older-style steel looping roller coaster where the riders ride in a standing position STR_0767 :Guest {INT32} STR_0768 :Handyman {INT32} STR_0769 :Mechanic {INT32} From 8614517e142046f030b68bde1c265f970ceaf873 Mon Sep 17 00:00:00 2001 From: ZeeMaji <42477864+ZeeMaji@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:40:05 -0400 Subject: [PATCH 113/191] Accurate max build height for classic --- src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h b/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h index 59c387a869..2807d3068e 100644 --- a/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h +++ b/src/openrct2/ride/coaster/meta/ClassicStandUpRollerCoaster.h @@ -35,7 +35,7 @@ constexpr RideTypeDescriptor ClassicStandUpRollerCoasterRTD = .NameConvention = { RideComponentType::Train, RideComponentType::Track, RideComponentType::Station }, .EnumName = nameof(RIDE_TYPE_CLASSIC_STAND_UP_ROLLER_COASTER), .AvailableBreakdowns = (1 << BREAKDOWN_SAFETY_CUT_OUT) | (1 << BREAKDOWN_RESTRAINTS_STUCK_CLOSED) | (1 << BREAKDOWN_RESTRAINTS_STUCK_OPEN) | (1 << BREAKDOWN_VEHICLE_MALFUNCTION) | (1 << BREAKDOWN_BRAKES_FAILURE), - .Heights = { 25, 24, 9, 11, }, + .Heights = { 30, 24, 9, 11, }, .MaxMass = 18, .LiftData = { OpenRCT2::Audio::SoundId::LiftClassic, 4, 6 }, .RatingsMultipliers = { 50, 30, 10 }, From c1c71003eb4e8435ecb6f809d22f60098e1ffaae Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Mar 2024 20:07:57 +0100 Subject: [PATCH 114/191] Add fallback for people without RCT1 --- src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index af521e3a51..5162197f88 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -1441,6 +1441,11 @@ static void classicStandUpRCTrackDiagRightBankTo25DegDown( TRACK_PAINT_FUNCTION GetTrackPaintFunctionClassicStandUpRC(int32_t trackType) { + if (!IsCsgLoaded()) + { + return GetTrackPaintFunctionStandUpRC(trackType); + } + switch (trackType) { case TrackElemType::FlatToLeftBank: From 24807932c3b8efb5c8b3c80f14784b630faa7c66 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Wed, 20 Mar 2024 20:31:02 +0100 Subject: [PATCH 115/191] Fix flat-to-diagonal supports not quite reaching the track --- src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index 5162197f88..f4a210e123 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -1262,7 +1262,7 @@ static void classicStandUpRCTrackDiagFlatTo25DegUpBanked( break; } MetalBSupportsPaintSetupRotated( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 0, height, session.SupportColours); + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, @@ -1385,7 +1385,7 @@ static void classicStandUpRCTrackDiag25DegUpToFlatBanked( break; } MetalBSupportsPaintSetupRotated( - session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 4, height, session.SupportColours); + session, MetalSupportType::Tubes, MetalSupportPlace::LeftCorner, direction, 8, height, session.SupportColours); PaintUtilSetSegmentSupportHeight( session, From bc27179b076d9966c4a55ec437a372c2ba07fa64 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Mar 2024 13:12:27 +0100 Subject: [PATCH 116/191] Pull in objects release v1.4.1 --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f62a0bb62..10f4aa3bfc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,9 @@ set(TITLE_SEQUENCE_VERSION "0.4.6") set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip") set(TITLE_SEQUENCE_SHA1 "80fefc6ebbabc42a6f4703412daa5c62f661420d") -set(OBJECTS_VERSION "1.4.0") +set(OBJECTS_VERSION "1.4.1") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") -set(OBJECTS_SHA1 "f512e230ffa2f16109209e4f30e7d7bf4fe21fc0") +set(OBJECTS_SHA1 "8f9cf7fa50abddf8f7dab0f039431dbc0272c145") set(OPENSFX_VERSION "1.0.5") set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip") diff --git a/openrct2.proj b/openrct2.proj index 05ee7c1376..2ce7df5e00 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -45,8 +45,8 @@ bd338aa3da9a357fb996dcaa6cea02c4f906718c https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.6/title-sequences.zip 80fefc6ebbabc42a6f4703412daa5c62f661420d - https://github.com/OpenRCT2/objects/releases/download/v1.4.0/objects.zip - f512e230ffa2f16109209e4f30e7d7bf4fe21fc0 + https://github.com/OpenRCT2/objects/releases/download/v1.4.1/objects.zip + 8f9cf7fa50abddf8f7dab0f039431dbc0272c145 https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.5/opensound.zip b1b1f1b241d2cbff63a1889c4dc5a09bdf769bfb https://github.com/OpenRCT2/OpenMusic/releases/download/v1.5/openmusic.zip From 40394389efd6a45db5fdb4bc66164b63e095ec51 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Mar 2024 13:12:54 +0100 Subject: [PATCH 117/191] Add Classic Stand-Up and objects release to changelog --- distribution/changelog.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e76a4a740b..dd0f10ecaf 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,15 +1,29 @@ 0.4.10 (in development) ------------------------------------------------------------------------ +- Feature: [#18171] Add port of the RCT1 Stand-Up Roller Coaster. - Feature: [#21636] Add shortcut key for sorting tile elements. +- Feature: [objects#294] Add scenery versions of wooden truss supports. +- Feature: [objects#295] Flipped version of wooden post. - Improved: [#21424] Extra viewports can now rotate independently from the main viewport. - Improved: [#21561, #21631] Enable more features in Android build (plugins, networking, multiplayer, audio formats). - Improved: [#21599] Currency signs now use non-breaking spaces. +- Improved: [objects#157] Added sloped images for many walls. +- Improved: [objects#288] Better map colours and more sensible prices for RCT1 land surfaces. +- Improved: [objects#292] Vehicle colour cleanups for WW/TT vehicles. +- Improved: [objects#299] More accurate ratings modifiers for RCT1 vehicles. +- Improved: [objects#309] Updated names for dodgems and flying saucers vehicles. +- Improved: [objects#313] buildMenuPriority for dodgems and flying saucers vehicles. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. - Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. +- Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. +- Fix: [objects#296] Incorrect wall placement around large Kremlin/drab pieces. +- Fix: [objects#300] Incorrect Colosseum and volcano corner clearances. +- Fix: [objects#319] Incorrect diagonal slope images used for RCT1 corkscrew. +- Fix: [objects#320] Incorrect Mandarin Duck boats capacity. 0.4.9 (2024-03-02) ------------------------------------------------------------------------ From 02e412d9a140bf226fa482d85a9ade02caa78d65 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Fri, 22 Mar 2024 18:42:47 +0100 Subject: [PATCH 118/191] Pull in objects release v1.4.2 --- CMakeLists.txt | 4 ++-- openrct2.proj | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 10f4aa3bfc..fb3af2fe45 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,9 @@ set(TITLE_SEQUENCE_VERSION "0.4.6") set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip") set(TITLE_SEQUENCE_SHA1 "80fefc6ebbabc42a6f4703412daa5c62f661420d") -set(OBJECTS_VERSION "1.4.1") +set(OBJECTS_VERSION "1.4.2") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") -set(OBJECTS_SHA1 "8f9cf7fa50abddf8f7dab0f039431dbc0272c145") +set(OBJECTS_SHA1 "2adc4cb66a6446533d67097bdf44cd9c5882fea3") set(OPENSFX_VERSION "1.0.5") set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip") diff --git a/openrct2.proj b/openrct2.proj index 2ce7df5e00..d34fcceb46 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -45,8 +45,8 @@ bd338aa3da9a357fb996dcaa6cea02c4f906718c https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.6/title-sequences.zip 80fefc6ebbabc42a6f4703412daa5c62f661420d - https://github.com/OpenRCT2/objects/releases/download/v1.4.1/objects.zip - 8f9cf7fa50abddf8f7dab0f039431dbc0272c145 + https://github.com/OpenRCT2/objects/releases/download/v1.4.2/objects.zip + 2adc4cb66a6446533d67097bdf44cd9c5882fea3 https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.5/opensound.zip b1b1f1b241d2cbff63a1889c4dc5a09bdf769bfb https://github.com/OpenRCT2/OpenMusic/releases/download/v1.5/openmusic.zip From 6eb96b1b07b507379df8d8e66d50fbab82e01857 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Fri, 22 Mar 2024 21:39:04 +0100 Subject: [PATCH 119/191] Fix #21604: Scenario selector shows incorrect guest objectives --- src/openrct2-ui/interface/Objective.cpp | 53 ++++++++++++++++++++++ src/openrct2-ui/interface/Objective.h | 17 +++++++ src/openrct2-ui/libopenrct2ui.vcxproj | 4 +- src/openrct2-ui/windows/Park.cpp | 34 +------------- src/openrct2-ui/windows/ScenarioSelect.cpp | 26 +++-------- 5 files changed, 82 insertions(+), 52 deletions(-) create mode 100644 src/openrct2-ui/interface/Objective.cpp create mode 100644 src/openrct2-ui/interface/Objective.h diff --git a/src/openrct2-ui/interface/Objective.cpp b/src/openrct2-ui/interface/Objective.cpp new file mode 100644 index 0000000000..0e48b81c95 --- /dev/null +++ b/src/openrct2-ui/interface/Objective.cpp @@ -0,0 +1,53 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#include "Objective.h" + +#include +#include +#include +#include +#include +#include + +void formatObjective(Formatter& ft, Objective objective) +{ + if (objective.Type == OBJECTIVE_BUILD_THE_BEST) + { + StringId rideTypeString = STR_NONE; + auto rideTypeId = objective.RideId; + if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) + { + rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; + } + ft.Add(rideTypeString); + } + else if (objective.Type == OBJECTIVE_GUESTS_BY) + { + ft.Add(objective.NumGuests); + ft.Add(DateGetTotalMonths(MONTH_OCTOBER, objective.Year)); + } + else if (objective.Type == OBJECTIVE_GUESTS_AND_RATING) + { + ft.Add(objective.NumGuests); + } + else if (objective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH) + { + ft.Add(objective.MinimumLength); + } + else + { + ft.Add(objective.NumGuests); + ft.Add(DateGetTotalMonths(MONTH_OCTOBER, objective.Year)); + if (objective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) + ft.Add(objective.MinimumExcitement); + else + ft.Add(objective.Currency); + } +} diff --git a/src/openrct2-ui/interface/Objective.h b/src/openrct2-ui/interface/Objective.h new file mode 100644 index 0000000000..d7cf2da51f --- /dev/null +++ b/src/openrct2-ui/interface/Objective.h @@ -0,0 +1,17 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + +#include + +class Formatter; +struct Objective; + +void formatObjective(Formatter& ft, Objective objective); diff --git a/src/openrct2-ui/libopenrct2ui.vcxproj b/src/openrct2-ui/libopenrct2ui.vcxproj index 0ab8e83b43..986e72712f 100644 --- a/src/openrct2-ui/libopenrct2ui.vcxproj +++ b/src/openrct2-ui/libopenrct2ui.vcxproj @@ -69,6 +69,7 @@ + @@ -129,6 +130,7 @@ + @@ -248,4 +250,4 @@ - \ No newline at end of file + diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 17d79524db..99e23e55e0 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1092,38 +1093,7 @@ static constexpr WindowParkAward _parkAwards[] = { // Objective ft = Formatter(); - if (gameState.ScenarioObjective.Type == OBJECTIVE_BUILD_THE_BEST) - { - StringId rideTypeString = STR_NONE; - auto rideTypeId = gameState.ScenarioObjective.RideId; - if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) - { - rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; - } - ft.Add(rideTypeString); - } - else if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_BY) - { - ft.Add(gameState.ScenarioObjective.NumGuests); - ft.Add(DateGetTotalMonths(MONTH_OCTOBER, gameState.ScenarioObjective.Year)); - } - else if (gameState.ScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING) - { - ft.Add(gameState.ScenarioObjective.NumGuests); - } - else if (gameState.ScenarioObjective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH) - { - ft.Add(gameState.ScenarioObjective.MinimumLength); - } - else - { - ft.Add(0); // Unused value by other objective messages - ft.Add(DateGetTotalMonths(MONTH_OCTOBER, gameState.ScenarioObjective.Year)); - if (gameState.ScenarioObjective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS) - ft.Add(gameState.ScenarioObjective.MinimumExcitement); - else - ft.Add(gameState.ScenarioObjective.Currency); - } + formatObjective(ft, gameState.ScenarioObjective); screenCoords.y += DrawTextWrapped(dpi, screenCoords, 221, ObjectiveNames[gameState.ScenarioObjective.Type], ft); screenCoords.y += 5; diff --git a/src/openrct2-ui/windows/ScenarioSelect.cpp b/src/openrct2-ui/windows/ScenarioSelect.cpp index 8996b3faf2..d40760ae41 100644 --- a/src/openrct2-ui/windows/ScenarioSelect.cpp +++ b/src/openrct2-ui/windows/ScenarioSelect.cpp @@ -9,6 +9,7 @@ #include "../interface/Theme.h" +#include #include #include #include @@ -244,27 +245,14 @@ static Widget _scenarioSelectWidgets[] = { screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_BLACK_STRING, ft) + 5; // Scenario objective + Objective objective = { .Type = scenario->ObjectiveType, + .Year = scenario->ObjectiveArg1, + .NumGuests = static_cast(scenario->ObjectiveArg3), + .Currency = scenario->ObjectiveArg2 }; + ft = Formatter(); ft.Add(ObjectiveNames[scenario->ObjectiveType]); - if (scenario->ObjectiveType == OBJECTIVE_BUILD_THE_BEST) - { - StringId rideTypeString = STR_NONE; - auto rideTypeId = scenario->ObjectiveArg3; - if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT) - { - rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name; - } - ft.Add(rideTypeString); - } - else - { - ft.Add(scenario->ObjectiveArg3); - ft.Add(DateGetTotalMonths(MONTH_OCTOBER, scenario->ObjectiveArg1)); - if (scenario->ObjectiveType == OBJECTIVE_FINISH_5_ROLLERCOASTERS) - ft.Add(scenario->ObjectiveArg2); - else - ft.Add(scenario->ObjectiveArg2); - } + formatObjective(ft, objective); screenPos.y += DrawTextWrapped(dpi, screenPos, 170, STR_OBJECTIVE, ft) + 5; // Scenario score From 2b2091130baa1f215277c7dacac87988b19e61bd Mon Sep 17 00:00:00 2001 From: OpenRCT2 git bot Date: Sat, 23 Mar 2024 04:01:49 +0000 Subject: [PATCH 120/191] Merge Localisation/master into OpenRCT2/develop --- data/language/de-DE.txt | 10 ++++++++++ data/language/es-ES.txt | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/data/language/de-DE.txt b/data/language/de-DE.txt index 5a2359882c..c3d431c1b5 100644 --- a/data/language/de-DE.txt +++ b/data/language/de-DE.txt @@ -3678,6 +3678,16 @@ STR_6609 :Streckenblock konnte nicht gefunden werden STR_6610 :Wegelement konnte nicht gefunden werden STR_6611 :Wandelement konnte nicht gefunden werden STR_6612 :Bannerelement konnte nicht gefunden werden +STR_6613 :Objekt neu laden +STR_6614 :Parkeintrittsgeld kann nicht geändert werden +STR_6615 :Streckenabschnitt auf dieser Kachel benötigt Wasser +STR_6616 :Aktion ungültig für diesen Personaltyp +STR_6617 :Kachelelement kann nicht mit sich selbst vertauscht werden +STR_6618 :Objekt kann weder eingeschränkt werden noch kann die Einschränkung zurückgenommen werden … +STR_6619 :Objekttyp kann nicht eingeschränkt werden! +STR_6620 :Objekt nicht gefunden! +STR_6621 :Einschränken +STR_6622 :Objekt auf den Szenario-Editor und dem Sandkastenmodus einschränken ############# # Scenarios # diff --git a/data/language/es-ES.txt b/data/language/es-ES.txt index 789053d6cc..3272aba042 100644 --- a/data/language/es-ES.txt +++ b/data/language/es-ES.txt @@ -3686,6 +3686,15 @@ STR_6610 :Elemento de camino no encontrado STR_6611 :Elemento de muro no encontrado STR_6612 :Elemento de banner no encontrado STR_6613 :Recargar objeto +STR_6614 :No se puede cambiar el precio de la entrada al parque +STR_6615 :La vía en esta casilla necesita agua +STR_6616 :Acción no válida para ese tipo de trabajador +STR_6617 :No se puede intercambiar el elemento de la casilla consigo mismo +STR_6618 :No se puede poner ni quitar restricción al objeto… +STR_6619 :¡Este tipo de objeto no puede ser restringido! +STR_6620 :¡Objeto no encontrado! +STR_6621 :Restringir +STR_6622 :Restringir objeto al Editor de Escenarios y el modo Sandbox. ############## # Escenarios # From bc926057eb988d16fa3cf01769a3b2fe7a205699 Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 23 Mar 2024 12:39:00 +0100 Subject: [PATCH 121/191] Fix #21419: Cannot build walls under sloped terrain Co-authored-by: Gymnasiast --- distribution/changelog.txt | 1 + src/openrct2/actions/WallPlaceAction.cpp | 21 ++++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e76a4a740b..b5858d8699 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Improved: [#21599] Currency signs now use non-breaking spaces. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#21419] Cannot place walls underground beneath sloped tiles with clearance checks disabled. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. - Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 70ad9cf55b..7e196949dc 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -82,9 +82,10 @@ GameActions::Result WallPlaceAction::Query() const return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_OFF_EDGE_OF_MAP); } + auto& gameState = GetGameState(); auto mapSizeMax = GetMapSizeMaxXY(); if (!(gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) && !(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) - && !GetGameState().Cheats.SandboxMode) + && !gameState.Cheats.SandboxMode) { if (_loc.z == 0) { @@ -141,14 +142,14 @@ GameActions::Result WallPlaceAction::Query() const { uint16_t waterHeight = surfaceElement->GetWaterHeight(); - if (targetHeight < waterHeight && !GetGameState().Cheats.DisableClearanceChecks) + if (targetHeight < waterHeight && !gameState.Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CANT_BUILD_THIS_UNDERWATER); } } - if (targetHeight < surfaceElement->GetBaseZ() && !GetGameState().Cheats.DisableClearanceChecks) + if (targetHeight < surfaceElement->GetBaseZ() && !gameState.Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); @@ -161,7 +162,7 @@ GameActions::Result WallPlaceAction::Query() const newBaseHeight += 2; if (surfaceElement->GetSlope() & (1 << newEdge)) { - if (targetHeight / 8 < newBaseHeight) + if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); @@ -177,7 +178,7 @@ GameActions::Result WallPlaceAction::Query() const if (surfaceElement->GetSlope() & (1 << newEdge)) { newBaseHeight += 2; - if (targetHeight / 8 < newBaseHeight) + if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, @@ -192,7 +193,7 @@ GameActions::Result WallPlaceAction::Query() const newEdge = (_edge + 3) & 3; if (surfaceElement->GetSlope() & (1 << newEdge)) { - if (targetHeight / 8 < newBaseHeight) + if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, STR_CAN_ONLY_BUILD_THIS_ABOVE_GROUND); @@ -208,7 +209,7 @@ GameActions::Result WallPlaceAction::Query() const if (surfaceElement->GetSlope() & (1 << newEdge)) { newBaseHeight += 2; - if (targetHeight / 8 < newBaseHeight) + if (targetHeight / 8 < newBaseHeight && !gameState.Cheats.DisableClearanceChecks) { return GameActions::Result( GameActions::Status::Disallowed, STR_CANT_BUILD_THIS_HERE, @@ -251,7 +252,7 @@ GameActions::Result WallPlaceAction::Query() const clearanceHeight += wallEntry->height; bool wallAcrossTrack = false; - if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !GetGameState().Cheats.DisableClearanceChecks) + if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gameState.Cheats.DisableClearanceChecks) { auto result = WallCheckObstruction(wallEntry, targetHeight / 8, clearanceHeight, &wallAcrossTrack); if (result.Error != GameActions::Status::Ok) @@ -276,6 +277,8 @@ GameActions::Result WallPlaceAction::Query() const GameActions::Result WallPlaceAction::Execute() const { auto res = GameActions::Result(); + auto& gameState = GetGameState(); + res.ErrorTitle = STR_CANT_BUILD_THIS_HERE; res.Position = _loc; @@ -326,7 +329,7 @@ GameActions::Result WallPlaceAction::Execute() const clearanceHeight += wallEntry->height; bool wallAcrossTrack = false; - if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !GetGameState().Cheats.DisableClearanceChecks) + if (!(GetFlags() & GAME_COMMAND_FLAG_TRACK_DESIGN) && !gameState.Cheats.DisableClearanceChecks) { auto result = WallCheckObstruction(wallEntry, targetHeight / COORDS_Z_STEP, clearanceHeight, &wallAcrossTrack); if (result.Error != GameActions::Status::Ok) From 249c8259c1969904f54e60a2f240b9ced374d6d9 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Sun, 24 Mar 2024 11:29:40 +0000 Subject: [PATCH 122/191] Fix #20338: Scenery Picker Hotkey not selected with re-paint tool --- distribution/changelog.txt | 1 + src/openrct2-ui/input/Shortcuts.cpp | 1 - src/openrct2-ui/windows/Scenery.cpp | 12 +----------- 3 files changed, 2 insertions(+), 12 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index b5858d8699..74a0c359bb 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Improved: [#21599] Currency signs now use non-breaking spaces. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#20338] Cannot select Scenery Picker or Scatter Tool when the scenery recolouring tool is active. - Fix: [#21419] Cannot place walls underground beneath sloped tiles with clearance checks disabled. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. diff --git a/src/openrct2-ui/input/Shortcuts.cpp b/src/openrct2-ui/input/Shortcuts.cpp index 8324283ad1..386a7f34e1 100644 --- a/src/openrct2-ui/input/Shortcuts.cpp +++ b/src/openrct2-ui/input/Shortcuts.cpp @@ -466,7 +466,6 @@ static void ShortcutOpenSceneryPicker() window_scenery = WindowFindByClass(WindowClass::Scenery); if (window_scenery != nullptr && !WidgetIsDisabled(*window_scenery, WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON) - && window_scenery->widgets[WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON].type != WindowWidgetType::Empty && !gWindowSceneryEyedropperEnabled) { window_scenery->OnMouseUp(WC_SCENERY__WIDX_SCENERY_EYEDROPPER_BUTTON); diff --git a/src/openrct2-ui/windows/Scenery.cpp b/src/openrct2-ui/windows/Scenery.cpp index 5730eee5ee..755f40e25b 100644 --- a/src/openrct2-ui/windows/Scenery.cpp +++ b/src/openrct2-ui/windows/Scenery.cpp @@ -631,24 +631,15 @@ static Widget WindowSceneryBaseWidgets[] = { pressed_widgets |= (1uLL << WIDX_SCENERY_BUILD_CLUSTER_BUTTON); widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; - widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::Empty; widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::Empty; widgets[WIDX_RESTRICT_SCENERY].type = WindowWidgetType::Empty; - if (!(gWindowSceneryPaintEnabled & 1)) - { - widgets[WIDX_SCENERY_EYEDROPPER_BUTTON].type = WindowWidgetType::FlatBtn; - } - const auto tabSelectedScenery = GetSelectedScenery(tabIndex); if (!tabSelectedScenery.IsUndefined()) { if (tabSelectedScenery.SceneryType == SCENERY_TYPE_SMALL) { - if (!(gWindowSceneryPaintEnabled & 1)) - { - widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; - } + widgets[WIDX_SCENERY_BUILD_CLUSTER_BUTTON].type = WindowWidgetType::FlatBtn; auto* sceneryEntry = OpenRCT2::ObjectManager::GetObjectEntry( tabSelectedScenery.EntryIndex); @@ -685,7 +676,6 @@ static Widget WindowSceneryBaseWidgets[] = { widgets[WIDX_SCENERY_PRIMARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; widgets[WIDX_SCENERY_SECONDARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; widgets[WIDX_SCENERY_TERTIARY_COLOUR_BUTTON].type = WindowWidgetType::ColourBtn; - widgets[WIDX_SCENERY_ROTATE_OBJECTS_BUTTON].type = WindowWidgetType::Empty; } else if (!tabSelectedScenery.IsUndefined()) { From 0581b1edd328901141fb77883b4423e39cb7a28f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 24 Mar 2024 21:21:18 +0100 Subject: [PATCH 123/191] Fix #18413: Trying to set tooltip using null vehicle (#21662) --- distribution/changelog.txt | 1 + src/openrct2/ride/Vehicle.cpp | 2 ++ 2 files changed, 3 insertions(+) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 74a0c359bb..4e51bcc83e 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -6,6 +6,7 @@ - Improved: [#21599] Currency signs now use non-breaking spaces. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. - Fix: [#910] Extra viewport does not preserve the location when rotating. +- Fix: [#18413] Crash when mouse over a hacked train. - Fix: [#20338] Cannot select Scenery Picker or Scatter Tool when the scenery recolouring tool is active. - Fix: [#21419] Cannot place walls underground beneath sloped tiles with clearance checks disabled. - Fix: [#21434] Number of guests overflows in objective text. diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index ffe7b8e429..5f0d003950 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5055,6 +5055,8 @@ void Vehicle::SetMapToolbar() const if (curRide != nullptr && curRide->type < RIDE_TYPE_COUNT) { const Vehicle* vehicle = GetHead(); + if (vehicle == nullptr) + return; size_t vehicleIndex; for (vehicleIndex = 0; vehicleIndex < std::size(curRide->vehicles); vehicleIndex++) From 13e9ff84c2136818747a01d83c07234fd7c76a3f Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 24 Mar 2024 22:49:50 +0100 Subject: [PATCH 124/191] Part of #21421: Replace define with constexpr (#21626) * Part of #21421: Refactor RIDE_INITIAL_RELIABILITY in Ride.h * Part of #21421: Refactor STATION_DEPART_FLAG and STATION_DEPART_MASK * Part of #21421: Refactor MAX_STATION_PLATFORM_LENGTH * Part of #21421: Refactor RIDE_RATING_UNDEFINED * Part of #21421: Refactor TRACK_BLOCK_END * Part of #21421: Refactor TRACK_PREVIEW_IMAGE_SIZE * Part of #21421: Refactor based on feedback * Part of #21421: Fix signed/unsigned mismatch on Win * Improved consistency kTrackPreviewImageSize Co-authored-by: Michael Steenbeek * Part of #21421: kMaxStationPlatformLength to int8 --------- Co-authored-by: Michael Steenbeek --- src/openrct2-ui/windows/InstallTrack.cpp | 4 +- src/openrct2-ui/windows/Ride.cpp | 2 +- src/openrct2-ui/windows/TrackList.cpp | 4 +- src/openrct2/actions/RideCreateAction.cpp | 4 +- src/openrct2/entity/Guest.cpp | 4 +- src/openrct2/ride/Ride.cpp | 12 +- src/openrct2/ride/Ride.h | 6 +- src/openrct2/ride/RideRatings.h | 2 +- src/openrct2/ride/Station.cpp | 40 +- src/openrct2/ride/Track.cpp | 2 +- src/openrct2/ride/Track.h | 2 +- src/openrct2/ride/TrackData.cpp | 604 +++++++++++----------- src/openrct2/ride/TrackDesign.cpp | 4 +- src/openrct2/ride/TrackDesign.h | 2 +- src/openrct2/ride/Vehicle.cpp | 12 +- 15 files changed, 352 insertions(+), 352 deletions(-) diff --git a/src/openrct2-ui/windows/InstallTrack.cpp b/src/openrct2-ui/windows/InstallTrack.cpp index 0ea2d19d33..62661b9d0d 100644 --- a/src/openrct2-ui/windows/InstallTrack.cpp +++ b/src/openrct2-ui/windows/InstallTrack.cpp @@ -74,7 +74,7 @@ static Widget window_install_track_widgets[] = { _trackDesign = std::move(trackDesign); _trackPath = path; _trackName = GetNameFromTrackPath(path); - _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); + _trackDesignPreviewPixels.resize(4 * kTrackPreviewImageSize); UpdatePreview(); Invalidate(); @@ -157,7 +157,7 @@ static Widget window_install_track_widgets[] = { GfxFillRect(dpi, { screenPos, screenPos + ScreenCoordsXY{ 369, 216 } }, colour); G1Element g1temp = {}; - g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); + g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * kTrackPreviewImageSize); g1temp.width = 370; g1temp.height = 217; g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; diff --git a/src/openrct2-ui/windows/Ride.cpp b/src/openrct2-ui/windows/Ride.cpp index b5b1b73b64..d943d21522 100644 --- a/src/openrct2-ui/windows/Ride.cpp +++ b/src/openrct2-ui/windows/Ride.cpp @@ -5287,7 +5287,7 @@ static_assert(std::size(RatingNames) == 6); disabled_widgets |= (1uLL << WIDX_SAVE_TRACK_DESIGN); if (ride->lifecycle_flags & RIDE_LIFECYCLE_TESTED) { - if (ride->excitement != RIDE_RATING_UNDEFINED) + if (ride->excitement != kRideRatingUndefined) { disabled_widgets &= ~(1uLL << WIDX_SAVE_TRACK_DESIGN); widgets[WIDX_SAVE_TRACK_DESIGN].tooltip = STR_SAVE_TRACK_DESIGN; diff --git a/src/openrct2-ui/windows/TrackList.cpp b/src/openrct2-ui/windows/TrackList.cpp index 9623bc6435..6c360c2b29 100644 --- a/src/openrct2-ui/windows/TrackList.cpp +++ b/src/openrct2-ui/windows/TrackList.cpp @@ -243,7 +243,7 @@ static Widget _trackListWidgets[] = { gTrackDesignSceneryToggle = false; WindowPushOthersRight(*this); _currentTrackPieceDirection = 2; - _trackDesignPreviewPixels.resize(4 * TRACK_PREVIEW_IMAGE_SIZE); + _trackDesignPreviewPixels.resize(4 * kTrackPreviewImageSize); _loadedTrackDesign = nullptr; _loadedTrackDesignIndex = TRACK_DESIGN_INDEX_UNLOADED; @@ -505,7 +505,7 @@ static Widget _trackListWidgets[] = { screenPos = windowPos + ScreenCoordsXY{ tdWidget.midX(), tdWidget.midY() }; G1Element g1temp = {}; - g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE); + g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * kTrackPreviewImageSize); g1temp.width = 370; g1temp.height = 217; g1temp.flags = G1_FLAG_HAS_TRANSPARENCY; diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 22d2d74cd2..39fa6b6c1c 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -204,7 +204,7 @@ GameActions::Result RideCreateAction::Execute() const ride->lift_hill_speed = rtd.LiftData.minimum_speed; ride->measurement = {}; - ride->excitement = RIDE_RATING_UNDEFINED; + ride->excitement = kRideRatingUndefined; ride->cur_num_customers = 0; ride->num_customers_timeout = 0; ride->chairlift_bullwheel_rotation = 0; @@ -300,7 +300,7 @@ GameActions::Result RideCreateAction::Execute() const ride->breakdown_reason = 255; ride->upkeep_cost = kMoney64Undefined; - ride->reliability = RIDE_INITIAL_RELIABILITY; + ride->reliability = kRideInitialReliability; ride->unreliability_factor = 1; ride->inspection_interval = RIDE_INSPECTION_EVERY_30_MINUTES; ride->last_inspection = 0; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index f36b2f24b5..567b9ff2e6 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -6276,7 +6276,7 @@ static bool PeepShouldWatchRide(TileElement* tileElement) } // This is most likely to have peeps watch new rides - if (ride->excitement == RIDE_RATING_UNDEFINED) + if (ride->excitement == kRideRatingUndefined) { return true; } @@ -6320,7 +6320,7 @@ bool Loc690FD0(Peep* peep, RideId* rideToView, uint8_t* rideSeatToView, TileElem return false; *rideToView = ride->id; - if (ride->excitement == RIDE_RATING_UNDEFINED) + if (ride->excitement == kRideRatingUndefined) { *rideSeatToView = 1; if (ride->status != RideStatus::Open) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 0280f6a545..9aae063032 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -1417,7 +1417,7 @@ static void RideBreakdownUpdate(Ride& ride) if (!ride.CanBreakDown()) { - ride.reliability = RIDE_INITIAL_RELIABILITY; + ride.reliability = kRideInitialReliability; return; } @@ -1433,7 +1433,7 @@ static void RideBreakdownUpdate(Ride& ride) // a 0.8% chance, less the breakdown factor which accumulates as the game // continues. if ((ride.reliability == 0 - || static_cast(ScenarioRand() & 0x2FFFFF) <= 1 + RIDE_INITIAL_RELIABILITY - ride.reliability) + || static_cast(ScenarioRand() & 0x2FFFFF) <= 1u + kRideInitialReliability - ride.reliability) && !GetGameState().Cheats.DisableAllBreakdowns) { int32_t breakdownReason = RideGetNewBreakdownProblem(ride); @@ -3631,7 +3631,7 @@ ResultWithMessage Ride::CreateVehicles(const CoordsXYE& element, bool isApplying lifecycle_flags |= RIDE_LIFECYCLE_ON_TRACK; for (int32_t i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++) { - stations[i].Depart = (stations[i].Depart & STATION_DEPART_FLAG) | 1; + stations[i].Depart = (stations[i].Depart & kStationDepartFlag) | 1; } // @@ -4633,7 +4633,7 @@ bool RideHasAnyTrackElements(const Ride& ride) void InvalidateTestResults(Ride& ride) { ride.measurement = {}; - ride.excitement = RIDE_RATING_UNDEFINED; + ride.excitement = kRideRatingUndefined; ride.lifecycle_flags &= ~RIDE_LIFECYCLE_TESTED; ride.lifecycle_flags &= ~RIDE_LIFECYCLE_TEST_IN_PROGRESS; if (ride.lifecycle_flags & RIDE_LIFECYCLE_ON_TRACK) @@ -5299,7 +5299,7 @@ void Ride::Renew() { // Set build date to current date (so the ride is brand new) build_date = GetDate().GetMonthsElapsed(); - reliability = RIDE_INITIAL_RELIABILITY; + reliability = kRideInitialReliability; } RideClassification Ride::GetClassification() const @@ -5434,7 +5434,7 @@ bool RideHasStationShelter(const Ride& ride) bool RideHasRatings(const Ride& ride) { - return ride.excitement != RIDE_RATING_UNDEFINED; + return ride.excitement != kRideRatingUndefined; } int32_t GetBoosterSpeed(ride_type_t rideType, int32_t rawSpeed) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 417754f84c..3669f0e84c 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -905,10 +905,10 @@ enum constexpr uint8_t kMaxRideMeasurements = 8; constexpr money64 RIDE_VALUE_UNDEFINED = kMoney64Undefined; -#define RIDE_INITIAL_RELIABILITY ((100 << 8) | 0xFF) // Upper byte is percentage, lower byte is "decimal". +constexpr uint16_t kRideInitialReliability = ((100 << 8) | 0xFF); // Upper byte is percentage, lower byte is "decimal". -#define STATION_DEPART_FLAG (1 << 7) -#define STATION_DEPART_MASK (~STATION_DEPART_FLAG) +constexpr uint8_t kStationDepartFlag = (1 << 7); +constexpr uint8_t kStationDepartMask = static_cast(~kStationDepartFlag); constexpr uint16_t kCurrentTurnCountMask = 0xF800; constexpr uint16_t kTurnMask1Element = 0x001F; diff --git a/src/openrct2/ride/RideRatings.h b/src/openrct2/ride/RideRatings.h index 27c16bd617..257f617106 100644 --- a/src/openrct2/ride/RideRatings.h +++ b/src/openrct2/ride/RideRatings.h @@ -19,7 +19,7 @@ using track_type_t = uint16_t; // Convenience function for writing ride ratings. The result is a 16 bit signed // integer. To create the ride rating 3.65 type RIDE_RATING(3,65) #define RIDE_RATING(whole, fraction) FIXED_2DP(whole, fraction) -#define RIDE_RATING_UNDEFINED static_cast(static_cast(0xFFFF)) +constexpr ride_rating kRideRatingUndefined = 0xFFFFu; #pragma pack(push, 1) diff --git a/src/openrct2/ride/Station.cpp b/src/openrct2/ride/Station.cpp index e43a3c1053..69ace102fb 100644 --- a/src/openrct2/ride/Station.cpp +++ b/src/openrct2/ride/Station.cpp @@ -66,16 +66,16 @@ static void RideUpdateStationBlockSection(Ride& ride, StationIndex stationIndex) if ((ride.status == RideStatus::Closed && ride.num_riders == 0) || (tileElement != nullptr && tileElement->AsTrack()->IsBrakeClosed())) { - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; - if ((station.Depart & STATION_DEPART_FLAG) || (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight())) + if ((station.Depart & kStationDepartFlag) || (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight())) RideInvalidateStationStart(ride, stationIndex, false); } else { - if (!(station.Depart & STATION_DEPART_FLAG)) + if (!(station.Depart & kStationDepartFlag)) { - station.Depart |= STATION_DEPART_FLAG; + station.Depart |= kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, true); } else if (tileElement != nullptr && tileElement->AsTrack()->HasGreenLight()) @@ -97,7 +97,7 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) // but since dodgems do not have station lights there is no point. if (ride.status == RideStatus::Closed || (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))) { - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; return; } @@ -116,12 +116,12 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) // End match ride.lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; return; } // Continue match - station.Depart |= STATION_DEPART_FLAG; + station.Depart |= kStationDepartFlag; } else { @@ -134,14 +134,14 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) if (vehicle->status != Vehicle::Status::WaitingToDepart) { - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; return; } } // Begin the match ride.lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; - station.Depart |= STATION_DEPART_FLAG; + station.Depart |= kStationDepartFlag; ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; } } @@ -153,7 +153,7 @@ static void RideUpdateStationDodgems(Ride& ride, StationIndex stationIndex) static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex) { auto& station = ride.GetStation(stationIndex); - int32_t time = station.Depart & STATION_DEPART_MASK; + int32_t time = station.Depart & kStationDepartMask; const auto currentTicks = GetGameState().CurrentTicks; if ((ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED)) || (ride.status == RideStatus::Closed && ride.num_riders == 0)) @@ -168,7 +168,7 @@ static void RideUpdateStationNormal(Ride& ride, StationIndex stationIndex) { if (time == 0) { - station.Depart |= STATION_DEPART_FLAG; + station.Depart |= kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, true); } else @@ -191,9 +191,9 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) auto& station = ride.GetStation(stationIndex); if (ride.status == RideStatus::Closed || (ride.lifecycle_flags & (RIDE_LIFECYCLE_BROKEN_DOWN | RIDE_LIFECYCLE_CRASHED))) { - if (station.Depart & STATION_DEPART_FLAG) + if (station.Depart & kStationDepartFlag) { - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, false); } return; @@ -224,9 +224,9 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) // Race is over ride.lifecycle_flags &= ~RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; - if (station.Depart & STATION_DEPART_FLAG) + if (station.Depart & kStationDepartFlag) { - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, false); } return; @@ -234,7 +234,7 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) } // Continue racing - station.Depart |= STATION_DEPART_FLAG; + station.Depart |= kStationDepartFlag; } else { @@ -247,9 +247,9 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) if (vehicle->status != Vehicle::Status::WaitingToDepart && vehicle->status != Vehicle::Status::Departing) { - if (station.Depart & STATION_DEPART_FLAG) + if (station.Depart & kStationDepartFlag) { - station.Depart &= ~STATION_DEPART_FLAG; + station.Depart &= ~kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, false); } return; @@ -259,9 +259,9 @@ static void RideUpdateStationRace(Ride& ride, StationIndex stationIndex) // Begin the race RideRaceInitVehicleSpeeds(ride); ride.lifecycle_flags |= RIDE_LIFECYCLE_PASS_STATION_NO_STOPPING; - if (!(station.Depart & STATION_DEPART_FLAG)) + if (!(station.Depart & kStationDepartFlag)) { - station.Depart |= STATION_DEPART_FLAG; + station.Depart |= kStationDepartFlag; RideInvalidateStationStart(ride, stationIndex, true); } ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_MAIN | RIDE_INVALIDATE_RIDE_LIST; diff --git a/src/openrct2/ride/Track.cpp b/src/openrct2/ride/Track.cpp index f633875149..c660cec881 100644 --- a/src/openrct2/ride/Track.cpp +++ b/src/openrct2/ride/Track.cpp @@ -197,7 +197,7 @@ ResultWithMessage TrackAddStationElement(CoordsXYZD loc, RideId rideIndex, int32 return { false, STR_NO_MORE_STATIONS_ALLOWED_ON_THIS_RIDE }; } - if (stationLength > MAX_STATION_PLATFORM_LENGTH) + if (stationLength > kMaxStationPlatformLength) { return { false, STR_STATION_PLATFORM_TOO_LONG }; } diff --git a/src/openrct2/ride/Track.h b/src/openrct2/ride/Track.h index 6796ca2c0c..4bb779476d 100644 --- a/src/openrct2/ride/Track.h +++ b/src/openrct2/ride/Track.h @@ -123,7 +123,7 @@ enum TRACK_ELEMENT_COLOUR_SEAT_ROTATION_MASK = 0b11110000, }; -#define MAX_STATION_PLATFORM_LENGTH 32 +constexpr int8_t kMaxStationPlatformLength = 32; constexpr uint16_t const MAX_TRACK_HEIGHT = 254 * COORDS_Z_STEP; constexpr uint8_t const DEFAULT_SEAT_ROTATION = 4; diff --git a/src/openrct2/ride/TrackData.cpp b/src/openrct2/ride/TrackData.cpp index f093d636b1..b37108a215 100644 --- a/src/openrct2/ride/TrackData.cpp +++ b/src/openrct2/ride/TrackData.cpp @@ -705,86 +705,86 @@ static constexpr uint8_t TrackSequenceProperties[][MaxSequencesPerPiece] = { }; static_assert(std::size(TrackSequenceProperties) == TrackElemType::Count); -#define TRACK_BLOCK_END { 255, 255, 255, 255, 255, {255, 255}, 255 } +constexpr PreviewTrack kTrackBlockEnd { 255, 255, 255, 255, 255, {255, 255}, 255 }; static constexpr PreviewTrack TrackBlocks000[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks001[] = { { 0, 0, 0, 0, 0,{ 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks002[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks003[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks004[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks005[] = { { 0, 0, 0, 0, 64, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks006[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks007[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks008[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks009[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks010[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks011[] = { { 0, 0, 0, 0, 64, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks012[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks013[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks014[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks015[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks016[] = { @@ -795,7 +795,7 @@ static constexpr PreviewTrack TrackBlocks016[] = { { 4, -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 0, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks017[] = { @@ -806,27 +806,27 @@ static constexpr PreviewTrack TrackBlocks017[] = { { 4, -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 0, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks018[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks019[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks020[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks021[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks022[] = { @@ -837,7 +837,7 @@ static constexpr PreviewTrack TrackBlocks022[] = { { 4, -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 0, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks023[] = { @@ -848,57 +848,57 @@ static constexpr PreviewTrack TrackBlocks023[] = { { 4, -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 0, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks024[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks025[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks026[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks027[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks028[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks029[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks030[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks031[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks032[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks033[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks034[] = { @@ -909,7 +909,7 @@ static constexpr PreviewTrack TrackBlocks034[] = { { 4, -32, -64, 48, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 32, 16, { 0b0111, 0b0100 }, 0 }, { 6, -64, -64, 48, 16, { 0b1111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks035[] = { @@ -920,7 +920,7 @@ static constexpr PreviewTrack TrackBlocks035[] = { { 4, -32, 64, 48, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 32, 16, { 0b1011, 0b1000 }, 0 }, { 6, -64, 64, 48, 16, { 0b1111, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks036[] = { @@ -931,7 +931,7 @@ static constexpr PreviewTrack TrackBlocks036[] = { { 4, -32, -64, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 16, 16, { 0b0111, 0b0001 }, 0 }, { 6, -64, -64, 0, 16, { 0b1111, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks037[] = { @@ -942,7 +942,7 @@ static constexpr PreviewTrack TrackBlocks037[] = { { 4, -32, 64, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 16, 16, { 0b1011, 0b0010 }, 0 }, { 6, -64, 64, 0, 16, { 0b1111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks038[] = { @@ -950,7 +950,7 @@ static constexpr PreviewTrack TrackBlocks038[] = { { 1, -32, 0, 0, 0, { 0b0111, 0 }, 0 }, { 2, -32, -32, 0, 0, { 0b1101, 0 }, 0 }, { 3, -64, -32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks039[] = { @@ -958,7 +958,7 @@ static constexpr PreviewTrack TrackBlocks039[] = { { 1, -32, 0, 0, 0, { 0b1011, 0 }, 0 }, { 2, -32, 32, 0, 0, { 0b1110, 0 }, 0 }, { 3, -64, 32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // LeftVerticalLoop @@ -973,7 +973,7 @@ static constexpr PreviewTrack TrackBlocks040[] = { { 7, 32, -32, 32, 96, { 0b1000, 0 }, 0 }, { 8, 0, -32, 16, 16, { 0b1111, 0b0011 }, 0 }, { 9, -32, -32, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // RightVerticalLoop @@ -988,7 +988,7 @@ static constexpr PreviewTrack TrackBlocks041[] = { { 7, 32, 32, 32, 96, { 0b0100, 0 }, 0 }, { 8, 0, 32, 16, 16, { 0b1111, 0b0011 }, 0 }, { 9, -32, 32, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks042[] = { @@ -996,7 +996,7 @@ static constexpr PreviewTrack TrackBlocks042[] = { { 1, 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 0, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks043[] = { @@ -1004,7 +1004,7 @@ static constexpr PreviewTrack TrackBlocks043[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 0, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks044[] = { @@ -1012,7 +1012,7 @@ static constexpr PreviewTrack TrackBlocks044[] = { { 1, 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 0, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks045[] = { @@ -1020,7 +1020,7 @@ static constexpr PreviewTrack TrackBlocks045[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 0, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks046[] = { @@ -1028,7 +1028,7 @@ static constexpr PreviewTrack TrackBlocks046[] = { { 1, 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 16, 16,{ 0b0111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks047[] = { @@ -1036,7 +1036,7 @@ static constexpr PreviewTrack TrackBlocks047[] = { { 1, 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 16, 16,{ 0b1011, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks048[] = { @@ -1044,7 +1044,7 @@ static constexpr PreviewTrack TrackBlocks048[] = { { 1, 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 16, { 0b0111, 0b0001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks049[] = { @@ -1052,45 +1052,45 @@ static constexpr PreviewTrack TrackBlocks049[] = { { 1, 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 16, { 0b1011, 0b0010 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks050[] = { { 0, 0, 0, 0, 0, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks051[] = { { 0, 0, 0, 0, 0, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks052[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 16, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks053[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 16, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks054[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, -16, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, -16, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks055[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, -16, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, -16, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // HalfLoopUp @@ -1099,7 +1099,7 @@ static constexpr PreviewTrack TrackBlocks056[] = { { 1, -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, { 2, -64, 0, 32, 96,{ 0b0011, 0 }, 0 }, { 3, -32, 0, 120, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // HalfLoopDown @@ -1108,55 +1108,55 @@ static constexpr PreviewTrack TrackBlocks057[] = { { 1, -32, 0, -120, 96,{ 0b0011, 0 }, 0 }, { 2, 0, 0, -136, 16, { 0b1111, 0b1100 }, 0 }, { 3, 32, 0, -152, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks058[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 24, 32, { 0b0111, 0 }, 0 }, { 2, -32, -32, 48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks059[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 24, 32, { 0b1011, 0 }, 0 }, { 2, -32, 32, 48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks060[] = { { 0, 0, 0, -32, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -56, 32, { 0b0111, 0 }, 0 }, { 2, -32, -32, -80, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks061[] = { { 0, 0, 0, -32, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -56, 32, { 0b1011, 0 }, 0 }, { 2, -32, 32, -80, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks062[] = { { 0, 0, 0, 0, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks063[] = { { 0, 0, 0, 0, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks064[] = { { 0, 0, 0, 0, 24, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks065[] = { { 0, 0, 0, 0, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks066[] = { @@ -1169,78 +1169,78 @@ static constexpr PreviewTrack TrackBlocks066[] = { { 6, 32, -32, 0, 0, { 0b1111, 0 }, 0 }, { 7, 32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 8, 32, 0, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks067[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, 32, 0, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks068[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks069[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks070[] = { { 0, 0, 0, 0, 64, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks071[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks072[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks073[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks074[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks075[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks076[] = { { 0, 0, 0, 0, 64, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks077[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks078[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks079[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks080[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks081[] = { @@ -1251,7 +1251,7 @@ static constexpr PreviewTrack TrackBlocks081[] = { { 4, -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 0, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks082[] = { @@ -1262,7 +1262,7 @@ static constexpr PreviewTrack TrackBlocks082[] = { { 4, -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 0, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks083[] = { @@ -1270,7 +1270,7 @@ static constexpr PreviewTrack TrackBlocks083[] = { { 1, -32, 0, 0, 0, { 0b0111, 0 }, 0 }, { 2, -32, -32, 0, 0, { 0b1101, 0 }, 0 }, { 3, -64, -32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks084[] = { @@ -1278,7 +1278,7 @@ static constexpr PreviewTrack TrackBlocks084[] = { { 1, -32, 0, 0, 0, { 0b1011, 0 }, 0 }, { 2, -32, 32, 0, 0, { 0b1110, 0 }, 0 }, { 3, -64, 32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks085[] = { @@ -1286,7 +1286,7 @@ static constexpr PreviewTrack TrackBlocks085[] = { { 1, 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 0, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks086[] = { @@ -1294,7 +1294,7 @@ static constexpr PreviewTrack TrackBlocks086[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 0, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks087[] = { @@ -1306,7 +1306,7 @@ static constexpr PreviewTrack TrackBlocks087[] = { { 5, 0, -64, 8, 0, { 0b0100, 0b0000 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 6, -32, -96, 8, 4, { 0b0001, 0 }, 0 }, { 7, 0, -96, 8, 4, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks088[] = { @@ -1318,7 +1318,7 @@ static constexpr PreviewTrack TrackBlocks088[] = { { 5, 0, 64, 8, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 6, -32, 96, 8, 4, { 0b0010, 0 }, 0 }, { 7, 0, 96, 8, 4, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks089[] = { @@ -1330,7 +1330,7 @@ static constexpr PreviewTrack TrackBlocks089[] = { { 5, 0, -64, 0, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 6, -32, -96, 0, 0, { 0b0001, 0 }, 0 }, { 7, 0, -96, 0, 0, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks090[] = { @@ -1342,7 +1342,7 @@ static constexpr PreviewTrack TrackBlocks090[] = { { 5, 0, 64, 0, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 6, -32, 96, 0, 0, { 0b0010, 0 }, 0 }, { 7, 0, 96, 0, 0, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks091[] = { @@ -1360,7 +1360,7 @@ static constexpr PreviewTrack TrackBlocks091[] = { { 11, 0, -128, 8, 4, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 12, -32, -160, 8, 4, { 0b1011, 0 }, 0 }, { 13, 0, -160, 8, 4, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks092[] = { @@ -1378,7 +1378,7 @@ static constexpr PreviewTrack TrackBlocks092[] = { { 11, 0, 128, 8, 4, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 12, -32, 160, 8, 4, { 0b0111, 0 }, 0 }, { 13, 0, 160, 8, 4, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks093[] = { @@ -1396,7 +1396,7 @@ static constexpr PreviewTrack TrackBlocks093[] = { { 11, 0, -128, 0, 0, { 0b0100, 0b0000 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 12, -32, -160, 0, 0, { 0b1011, 0 }, 0 }, { 13, 0, -160, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks094[] = { @@ -1414,42 +1414,42 @@ static constexpr PreviewTrack TrackBlocks094[] = { { 11, 0, 128, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 12, -32, 160, 0, 0, { 0b0111, 0 }, 0 }, { 13, 0, 160, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks095[] = { { 0, 0, 0, 0, 64, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks096[] = { { 0, 0, 0, 0, 64, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks097[] = { { 0, 0, 0, 0, 64, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks098[] = { { 0, 0, 0, 0, 64, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks099[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks100[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks101[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks102[] = { @@ -1460,7 +1460,7 @@ static constexpr PreviewTrack TrackBlocks102[] = { { 4, -32, -64, 0, 12, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 12, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 12, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks103[] = { @@ -1471,7 +1471,7 @@ static constexpr PreviewTrack TrackBlocks103[] = { { 4, -32, 64, 0, 12, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 12, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 12, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks104[] = { @@ -1482,7 +1482,7 @@ static constexpr PreviewTrack TrackBlocks104[] = { { 4, -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 0, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks105[] = { @@ -1493,7 +1493,7 @@ static constexpr PreviewTrack TrackBlocks105[] = { { 4, -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 0, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks106[] = { @@ -1504,7 +1504,7 @@ static constexpr PreviewTrack TrackBlocks106[] = { { 4, -32, -64, 0, 12, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 12, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 12, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks107[] = { @@ -1515,7 +1515,7 @@ static constexpr PreviewTrack TrackBlocks107[] = { { 4, -32, 64, 0, 12, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 12, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 12, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks108[] = { @@ -1526,7 +1526,7 @@ static constexpr PreviewTrack TrackBlocks108[] = { { 4, -32, -64, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 0, 0, { 0b0111, 0 }, 0 }, { 6, -64, -64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks109[] = { @@ -1537,42 +1537,42 @@ static constexpr PreviewTrack TrackBlocks109[] = { { 4, -32, 64, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 0, 0, { 0b1011, 0 }, 0 }, { 6, -64, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks110[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks111[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks112[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks113[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks114[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks115[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks116[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks117[] = { @@ -1581,7 +1581,7 @@ static constexpr PreviewTrack TrackBlocks117[] = { { 2, -64, 0, 0, 16, { 0b1111, 0 }, 0 }, { 3, -96, 0, 0, 16, { 0b1111, 0 }, 0 }, { 4, -128, 0, 0, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks118[] = { @@ -1589,7 +1589,7 @@ static constexpr PreviewTrack TrackBlocks118[] = { { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 16, 24, { 0b1111, 0 }, 0 }, { 3, -96, 0, 40, 48, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks119[] = { @@ -1597,12 +1597,12 @@ static constexpr PreviewTrack TrackBlocks119[] = { { 1, -32, 0, 40, 48, { 0b1111, 0 }, 0 }, { 2, -64, 0, 64, 24, { 0b1111, 0 }, 0 }, { 3, -96, 0, 80, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks120[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks121[] = { @@ -1610,7 +1610,7 @@ static constexpr PreviewTrack TrackBlocks121[] = { { 1, -32, 0, 16, 24, { 0b1111, 0 }, 0 }, { 2, -64, 0, 0, 16, { 0b1111, 0 }, 0 }, { 3, -96, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks122[] = { @@ -1618,7 +1618,7 @@ static constexpr PreviewTrack TrackBlocks122[] = { { 1, -32, 0, 64, 24, { 0b1111, 0 }, 0 }, { 2, -64, 0, 40, 48, { 0b1111, 0 }, 0 }, { 3, -96, 0, 0, 48, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks123[] = { @@ -1626,7 +1626,7 @@ static constexpr PreviewTrack TrackBlocks123[] = { { 1, -32, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, { 2, -64, 0, -32, 32, { 0b1111, 0b0011 }, 0 }, { 3, -96, 0, -96, 64, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks124[] = { @@ -1637,52 +1637,52 @@ static constexpr PreviewTrack TrackBlocks124[] = { { 4, -128, 0, 0, 160, { 0b1111, 0 }, 0 }, { 5, -192, 0, 0, 208, { 0b1111, 0 }, 0 }, { 6, -160, 0, 0, 208, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks125[] = { { 0, 0, 0, 0, 48, { 0b1111, 0 }, 0 }, { 1, 32, 0, 0, 48, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks126[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks127[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks128[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b1100 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks129[] = { { 0, 0, 0, 0, 32, { 0b1111, 0b0011 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks130[] = { { 0, 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks131[] = { { 0, 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks132[] = { { 0, 0, 0, 0, 24, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks133[] = { @@ -1691,7 +1691,7 @@ static constexpr PreviewTrack TrackBlocks133[] = { { 2, -32, -32, 0, 0, { 0b1000, 0 }, 0 }, { 3, -64, 0, 0, 0, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, -32, 0, 0, { 0b0001, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks134[] = { @@ -1700,7 +1700,7 @@ static constexpr PreviewTrack TrackBlocks134[] = { { 2, -32, 32, 0, 0, { 0b0100, 0 }, 0 }, { 3, -64, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks135[] = { @@ -1709,7 +1709,7 @@ static constexpr PreviewTrack TrackBlocks135[] = { { 2, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 4, -64, 32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks136[] = { @@ -1718,7 +1718,7 @@ static constexpr PreviewTrack TrackBlocks136[] = { { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 4, -32, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks137[] = { @@ -1727,7 +1727,7 @@ static constexpr PreviewTrack TrackBlocks137[] = { { 2, -32, -32, 0, 0, { 0b1000, 0 }, 0 }, { 3, -64, 0, 0, 0, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, -32, 0, 0, { 0b0001, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks138[] = { @@ -1736,7 +1736,7 @@ static constexpr PreviewTrack TrackBlocks138[] = { { 2, -32, 32, 0, 0, { 0b0100, 0 }, 0 }, { 3, -64, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks139[] = { @@ -1745,7 +1745,7 @@ static constexpr PreviewTrack TrackBlocks139[] = { { 2, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 4, -64, 32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks140[] = { @@ -1754,7 +1754,7 @@ static constexpr PreviewTrack TrackBlocks140[] = { { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 4, -32, 64, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks141[] = { @@ -1762,7 +1762,7 @@ static constexpr PreviewTrack TrackBlocks141[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks142[] = { @@ -1770,7 +1770,7 @@ static constexpr PreviewTrack TrackBlocks142[] = { { 1, 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 16, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks143[] = { @@ -1778,7 +1778,7 @@ static constexpr PreviewTrack TrackBlocks143[] = { { 1, 0, 32, 0, 64, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 64, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 64, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks144[] = { @@ -1786,7 +1786,7 @@ static constexpr PreviewTrack TrackBlocks144[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks145[] = { @@ -1794,7 +1794,7 @@ static constexpr PreviewTrack TrackBlocks145[] = { { 1, 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 32, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks146[] = { @@ -1802,7 +1802,7 @@ static constexpr PreviewTrack TrackBlocks146[] = { { 1, 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 32, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks147[] = { @@ -1810,7 +1810,7 @@ static constexpr PreviewTrack TrackBlocks147[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks148[] = { @@ -1818,7 +1818,7 @@ static constexpr PreviewTrack TrackBlocks148[] = { { 1, 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 16, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks149[] = { @@ -1826,7 +1826,7 @@ static constexpr PreviewTrack TrackBlocks149[] = { { 1, 0, 32, 0, 64, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 64, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 64, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks150[] = { @@ -1834,7 +1834,7 @@ static constexpr PreviewTrack TrackBlocks150[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks151[] = { @@ -1842,7 +1842,7 @@ static constexpr PreviewTrack TrackBlocks151[] = { { 1, 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 32, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks152[] = { @@ -1850,7 +1850,7 @@ static constexpr PreviewTrack TrackBlocks152[] = { { 1, 0, 32, 0, 32, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 32, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 32, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks153[] = { @@ -1858,7 +1858,7 @@ static constexpr PreviewTrack TrackBlocks153[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks154[] = { @@ -1866,7 +1866,7 @@ static constexpr PreviewTrack TrackBlocks154[] = { { 1, 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 24, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks155[] = { @@ -1874,7 +1874,7 @@ static constexpr PreviewTrack TrackBlocks155[] = { { 1, 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 24, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks156[] = { @@ -1882,7 +1882,7 @@ static constexpr PreviewTrack TrackBlocks156[] = { { 1, 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 24, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks157[] = { @@ -1890,7 +1890,7 @@ static constexpr PreviewTrack TrackBlocks157[] = { { 1, 0, 32, 0, 24, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 24, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 24, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks158[] = { @@ -1898,7 +1898,7 @@ static constexpr PreviewTrack TrackBlocks158[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks159[] = { @@ -1906,7 +1906,7 @@ static constexpr PreviewTrack TrackBlocks159[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks160[] = { @@ -1914,7 +1914,7 @@ static constexpr PreviewTrack TrackBlocks160[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks161[] = { @@ -1922,7 +1922,7 @@ static constexpr PreviewTrack TrackBlocks161[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks162[] = { @@ -1930,7 +1930,7 @@ static constexpr PreviewTrack TrackBlocks162[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks163[] = { @@ -1938,7 +1938,7 @@ static constexpr PreviewTrack TrackBlocks163[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks164[] = { @@ -1946,7 +1946,7 @@ static constexpr PreviewTrack TrackBlocks164[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks165[] = { @@ -1954,7 +1954,7 @@ static constexpr PreviewTrack TrackBlocks165[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks166[] = { @@ -1962,7 +1962,7 @@ static constexpr PreviewTrack TrackBlocks166[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks167[] = { @@ -1970,7 +1970,7 @@ static constexpr PreviewTrack TrackBlocks167[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks168[] = { @@ -1978,7 +1978,7 @@ static constexpr PreviewTrack TrackBlocks168[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks169[] = { @@ -1986,7 +1986,7 @@ static constexpr PreviewTrack TrackBlocks169[] = { { 1, 0, 32, 0, 8, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 8, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks170[] = { @@ -1994,7 +1994,7 @@ static constexpr PreviewTrack TrackBlocks170[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks171[] = { @@ -2002,45 +2002,45 @@ static constexpr PreviewTrack TrackBlocks171[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 0, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 0, 0, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks172[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks173[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks174[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 0, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks175[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 0, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks176[] = { { 0, 0, 0, -32, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -32, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, -32, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks177[] = { { 0, 0, 0, -32, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -32, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, -32, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks178[] = { @@ -2048,7 +2048,7 @@ static constexpr PreviewTrack TrackBlocks178[] = { { 1, 0, -32, 0, 16, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 16, { 0b0010, 0 }, 0 }, { 3, -32, -32, 16, 16,{ 0b0111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks179[] = { @@ -2056,7 +2056,7 @@ static constexpr PreviewTrack TrackBlocks179[] = { { 1, 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 16, { 0b0001, 0 }, 0 }, { 3, -32, 32, 16, 16,{ 0b1011, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks180[] = { @@ -2064,7 +2064,7 @@ static constexpr PreviewTrack TrackBlocks180[] = { { 1, 0, -32, 0, 16, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 16, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 0, { 0b0111, 0b0001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks181[] = { @@ -2072,12 +2072,12 @@ static constexpr PreviewTrack TrackBlocks181[] = { { 1, 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 16, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 0, { 0b1011, 0b0010 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks182[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // LeftLargeHalfLoopUp @@ -2089,7 +2089,7 @@ static constexpr PreviewTrack TrackBlocks183[] = { { 4, -128, -32, 120, 96, { 0b1111, 0 }, 0 }, { 5, -96, -32, 64, 192, { 0b1111, 0 }, 0 }, { 6, -64, -32, 248, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // RightLargeHalfLoopUp @@ -2101,7 +2101,7 @@ static constexpr PreviewTrack TrackBlocks184[] = { { 4, -128, 32, 120, 96, { 0b1111, 0 }, 0 }, { 5, -96, 32, 64, 192, { 0b1111, 0 }, 0 }, { 6, -64, 32, 248, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // LeftLargeHalfLoopDown @@ -2113,7 +2113,7 @@ static constexpr PreviewTrack TrackBlocks185[] = { { 4, 0, -32, -248, 56, { 0b1111, 0 }, 0 }, { 5, 32, -32, -264, 40, { 0b1111, 0b1100 }, 0 }, { 6, 64, -32, -280, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // RightLargeHalfLoopDown @@ -2125,35 +2125,35 @@ static constexpr PreviewTrack TrackBlocks186[] = { { 4, 0, 32, -248, 56, { 0b1111, 0 }, 0 }, { 5, 32, 32, -264, 40, { 0b1111, 0b1100 }, 0 }, { 6, 64, 32, -280, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks187[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, -16, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, -16, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks188[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, -16, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, -16, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks189[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 16, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks190[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 16, { 0b1111, 0 }, 0 }, { 2, -64, 0, 16, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // FlyerHalfLoopUninvertedUp @@ -2162,7 +2162,7 @@ static constexpr PreviewTrack TrackBlocks191[] = { { 1, -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, { 2, -64, 0, 32, 96,{ 0b0011, 0 }, 0 }, { 3, -32, 0, 120, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; // FlyerHalfLoopInvertedDown @@ -2171,35 +2171,35 @@ static constexpr PreviewTrack TrackBlocks192[] = { { 1, -32, 0, -88, 96,{ 0b0011, 0 }, 0 }, { 2, 0, 0, -104, 16, { 0b1111, 0b1100 }, 0 }, { 3, 32, 0, -120, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks193[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 24, 32, { 0b0111, 0 }, 0 }, { 2, -32, -32, 48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks194[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 24, 32, { 0b1011, 0 }, 0 }, { 2, -32, 32, 48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks195[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -24, 32, { 0b0111, 0 }, 0 }, { 2, -32, -32, -48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks196[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -24, 32, { 0b1011, 0 }, 0 }, { 2, -32, 32, -48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks197[] = { @@ -2207,7 +2207,7 @@ static constexpr PreviewTrack TrackBlocks197[] = { { 1, -32, 0, 0, 32, { 0b1111, 0 }, 0 }, { 2, -64, 0, 16, 0, { 0b1111, 0 }, 0 }, { 3, 0, 0, 32, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks198[] = { @@ -2215,7 +2215,7 @@ static constexpr PreviewTrack TrackBlocks198[] = { { 1, -32, 0, -32, 32, { 0b1111, 0 }, 0 }, { 2, -64, 0, -16, 0, { 0b1111, 0 }, 0 }, { 3, 0, 0, -32, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks199[] = { @@ -2225,7 +2225,7 @@ static constexpr PreviewTrack TrackBlocks199[] = { { 3, -96, 0, 0, 0, { 0b1111, 0 }, 0 }, { 4, -128, 0, 0, 0, { 0b1111, 0 }, 0 }, { 5, -160, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks200[] = { @@ -2235,39 +2235,39 @@ static constexpr PreviewTrack TrackBlocks200[] = { { 3, -96, 0, 0, 0, { 0b1111, 0 }, 0 }, { 4, -128, 0, 0, 0, { 0b1111, 0 }, 0 }, { 5, -160, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks201[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks202[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks203[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks204[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 2, -32, 32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks205[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, { 1, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 2, -32, -32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks206[] = { @@ -2275,14 +2275,14 @@ static constexpr PreviewTrack TrackBlocks206[] = { { 1, -32, 0, -40, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 2, -64, 0, -96, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 3, -96, 0, -96, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks207[] = { { 0, 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 56, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 2, 64, 0, 96, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks208[] = { @@ -2290,7 +2290,7 @@ static constexpr PreviewTrack TrackBlocks208[] = { { 1, -32, 0, -72, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 2, -64, 0, -128, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 3, -96, 0, -128, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks209[] = { @@ -2298,7 +2298,7 @@ static constexpr PreviewTrack TrackBlocks209[] = { { 1, 0, -32, 0, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 8, { 0b0111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks210[] = { @@ -2306,7 +2306,7 @@ static constexpr PreviewTrack TrackBlocks210[] = { { 1, 0, 32, 0, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 0, 8, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 8, { 0b1011, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks211[] = { @@ -2316,7 +2316,7 @@ static constexpr PreviewTrack TrackBlocks211[] = { { 3, -64, -32, 0, 0, { 0b1111, 0 }, 0 }, { 4, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 5, -64, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks212[] = { @@ -2326,7 +2326,7 @@ static constexpr PreviewTrack TrackBlocks212[] = { { 3, -64, 32, 0, 0, { 0b1111, 0 }, 0 }, { 4, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 5, -64, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks213[] = { @@ -2334,13 +2334,13 @@ static constexpr PreviewTrack TrackBlocks213[] = { { 1, 32, 0, 0, 32, { 0b1111, 0 }, 0 }, { 2, -64, 0, 0, 32, { 0b1111, 0 }, 0 }, { 3, -32, 0, 0, 32, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks214[] = { { 0, 0, 0, 0, 48, { 0b1111, 0 }, 0 }, { 1, 32, 0, 0, 48, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks215[] = { @@ -2351,12 +2351,12 @@ static constexpr PreviewTrack TrackBlocks215[] = { { 4, -96, 0, 0, 48, { 0b1111, 0 }, 0 }, { 5, -128, 0, 0, 32, { 0b1111, 0 }, 0 }, { 6, -160, 0, 0, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks216[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks217[] = { @@ -2364,7 +2364,7 @@ static constexpr PreviewTrack TrackBlocks217[] = { { 1, 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 16, 16,{ 0b0111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks218[] = { @@ -2372,7 +2372,7 @@ static constexpr PreviewTrack TrackBlocks218[] = { { 1, 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 16, 16,{ 0b1011, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks219[] = { @@ -2380,7 +2380,7 @@ static constexpr PreviewTrack TrackBlocks219[] = { { 1, 0, -32, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0010, 0 }, 0 }, { 3, -32, -32, 0, 16, { 0b0111, 0b0001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks220[] = { @@ -2388,7 +2388,7 @@ static constexpr PreviewTrack TrackBlocks220[] = { { 1, 0, 32, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 2, -32, 0, 16, 0, { 0b0001, 0 }, 0 }, { 3, -32, 32, 0, 16, { 0b1011, 0b0010 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks221[] = { @@ -2399,7 +2399,7 @@ static constexpr PreviewTrack TrackBlocks221[] = { { 4, -32, -64, 48, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 32, 16, { 0b0111, 0b0100 }, 0 }, { 6, -64, -64, 48, 16, { 0b1111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks222[] = { @@ -2410,7 +2410,7 @@ static constexpr PreviewTrack TrackBlocks222[] = { { 4, -32, 64, 48, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 32, 16, { 0b1011, 0b1000 }, 0 }, { 6, -64, 64, 48, 16, { 0b1111, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks223[] = { @@ -2421,7 +2421,7 @@ static constexpr PreviewTrack TrackBlocks223[] = { { 4, -32, -64, 16, 0, { 0b1000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, -32, 16, 16, { 0b0111, 0b0001 }, 0 }, { 6, -64, -64, 0, 16, { 0b1111, 0b1001 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks224[] = { @@ -2432,158 +2432,158 @@ static constexpr PreviewTrack TrackBlocks224[] = { { 4, -32, 64, 16, 0, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 5, -64, 32, 16, 16, { 0b1011, 0b0010 }, 0 }, { 6, -64, 64, 0, 16, { 0b1111, 0b0110 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks225[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks226[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks227[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks228[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks229[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks230[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks231[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks232[] = { { 0, 0, 0, 0, 16, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks233[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks234[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks235[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks236[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks237[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks238[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks239[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks240[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks241[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks242[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks243[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks244[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks245[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks246[] = { { 0, 0, 0, 0, 8, { 0b1111, 0b0011 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks247[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks248[] = { { 0, 0, 0, 0, 8, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks249[] = { { 0, 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 0, 32, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks250[] = { { 0, 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 0, -32, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks251[] = { { 0, 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 0, 32, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks252[] = { { 0, 0, 0, 0, 72, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 0, -32, 0, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks253[] = { { 0, 0, 0, 0, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 56, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 2, 64, 0, 96, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks254[] = { @@ -2591,19 +2591,19 @@ static constexpr PreviewTrack TrackBlocks254[] = { { 1, -32, 0, -72, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 2, -64, 0, -128, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 3, -96, 0, -128, 0, { 0b0000, 0 }, RCT_PREVIEW_TRACK_FLAG_0 | RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocks255[] = { { 0, 0, 0, 32, 56, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 1, 32, 0, 88, 32, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, { 2, 64, 0, 128, 16, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_IS_VERTICAL }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRotationControlToggle[] = { { 0, 0, 0, 0, 0, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack1x4A[] = { @@ -2611,7 +2611,7 @@ static constexpr PreviewTrack TrackBlocksFlatTrack1x4A[] = { { 1, -64, 0, 0, 0, { 0b1111, 0 }, 0 }, { 2, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 3, 32, 0, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack2x2[] = { @@ -2619,7 +2619,7 @@ static constexpr PreviewTrack TrackBlocksFlatTrack2x2[] = { { 1, 0, 32, 0, 0, { 0b1111, 0 }, 0 }, { 2, 32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 3, 32, 32, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack4x4[] = { @@ -2639,7 +2639,7 @@ static constexpr PreviewTrack TrackBlocksFlatTrack4x4[] = { { 13, 96, 32, 0, 0, { 0b1111, 0 }, 0 }, { 14, 96, 64, 0, 0, { 0b1111, 0 }, 0 }, { 15, 96, 96, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack2x4[] = { @@ -2651,7 +2651,7 @@ static constexpr PreviewTrack TrackBlocksFlatTrack2x4[] = { { 5, 32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 6, 32, 64, 0, 0, { 0b1111, 0 }, 0 }, { 7, 32, 96, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack1x5[] = { @@ -2660,12 +2660,12 @@ static constexpr PreviewTrack TrackBlocksFlatTrack1x5[] = { { 2, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 3, 32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 4, 64, 0, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack1x1A[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack1x4B[] = { @@ -2673,12 +2673,12 @@ static constexpr PreviewTrack TrackBlocksFlatTrack1x4B[] = { { 1, -64, 0, 0, 0, { 0b1111, 0 }, 0 }, { 2, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 3, 32, 0, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack1x1B[] = { { 0, 0, 0, 0, 0, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack1x4C[] = { @@ -2686,7 +2686,7 @@ static constexpr PreviewTrack TrackBlocksFlatTrack1x4C[] = { { 1, -64, 0, 0, 0, { 0b1111, 0 }, 0 }, { 2, -32, 0, 0, 0, { 0b1111, 0 }, 0 }, { 3, 32, 0, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlatTrack3x3[] = { @@ -2699,7 +2699,7 @@ static constexpr PreviewTrack TrackBlocksFlatTrack3x3[] = { { 6, 32, -32, 0, 0, { 0b1111, 0 }, 0 }, { 7, 32, 32, 0, 0, { 0b1111, 0 }, 0 }, { 8, 32, 0, 0, 0, { 0b1111, 0 }, RCT_PREVIEW_TRACK_FLAG_1 }, - TRACK_BLOCK_END + kTrackBlockEnd }; @@ -2710,7 +2710,7 @@ static constexpr PreviewTrack TrackBlocksLeftLargeCorkscrewUp[] = { { 3, -32, -32, 32, 24, { 0b1000, 0 }, 0 }, { 4, -64, -32, 48, 40, { 0b1111, 0 }, 0 }, { 5, -64, -64, 72, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightLargeCorkscrewUp[] = { @@ -2720,7 +2720,7 @@ static constexpr PreviewTrack TrackBlocksRightLargeCorkscrewUp[] = { { 3, -32, 32, 32, 24, { 0b0100, 0 }, 0 }, { 4, -64, 32, 48, 40, { 0b1111, 0 }, 0 }, { 5, -64, 64, 72, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftLargeCorkscrewDown[] = { @@ -2730,7 +2730,7 @@ static constexpr PreviewTrack TrackBlocksLeftLargeCorkscrewDown[] = { { 3, -64, 0, -80, 24, { 0b0111, 0 }, 0 }, { 4, -64, -32, -104, 32, { 0b1111, 0 }, 0 }, { 5, -64, -64, -112, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightLargeCorkscrewDown[] = { @@ -2740,7 +2740,7 @@ static constexpr PreviewTrack TrackBlocksRightLargeCorkscrewDown[] = { { 3, -64, 0, -80, 24, { 0b1011, 0 }, 0 }, { 4, -64, 32, -104, 32, { 0b1111, 0 }, 0 }, { 5, -64, 64, -112, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftMediumHalfLoopUp[] = { @@ -2749,7 +2749,7 @@ static constexpr PreviewTrack TrackBlocksLeftMediumHalfLoopUp[] = { { 2, -64, 0, 56,120, { 0b1111, 0 }, 0 }, { 3, -64, -32, 56,120, { 0b1111, 0 }, 0 }, { 4, -32, -32,168, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightMediumHalfLoopUp[] = { @@ -2758,7 +2758,7 @@ static constexpr PreviewTrack TrackBlocksRightMediumHalfLoopUp[] = { { 2, -64, 0, 56,120, { 0b1111, 0 }, 0 }, { 3, -64, 32, 56,120, { 0b1111, 0 }, 0 }, { 4, -32, 32,168, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftMediumHalfLoopDown[] = { @@ -2767,7 +2767,7 @@ static constexpr PreviewTrack TrackBlocksLeftMediumHalfLoopDown[] = { { 2, -32, -32, -160,120, { 0b1111, 0 }, 0 }, { 3, 0, -32, -200, 48, { 0b1111, 0 }, 0 }, { 4, 32, -32, -216, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightMediumHalfLoopDown[] = { @@ -2776,35 +2776,35 @@ static constexpr PreviewTrack TrackBlocksRightMediumHalfLoopDown[] = { { 2, -32, 32, -160, 120, { 0b1111, 0 }, 0 }, { 3, 0, 32, -200, 48, { 0b1111, 0 }, 0 }, { 4, 32, 32, -216, 24, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftZeroGRollUp[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 8, 24, { 0b1111, 0 }, 0 }, { 2, -64, 0, 24, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightZeroGRollUp[] = { { 0, 0, 0, 0, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, 8, 24, { 0b1111, 0 }, 0 }, { 2, -64, 0, 24, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftZeroGRollDown[] = { { 0, 0, 0, -32, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -48, 24, { 0b1111, 0 }, 0 }, { 2, -64, 0, -56, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightZeroGRollDown[] = { { 0, 0, 0 ,-32, 16, { 0b1111, 0 }, 0 }, { 1, -32, 0, -48, 24, { 0b1111, 0 }, 0 }, { 2, -64, 0, -56, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; @@ -2813,7 +2813,7 @@ static constexpr PreviewTrack TrackBlocksLeftLargeZeroGRollUp[] = { { 1, -32, 0, 56, 48, { 0b1111, 0 }, 0 }, { 2, -64, 0, 96, 40, { 0b1111, 0 }, 0 }, { 3, -96, 0,120, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightLargeZeroGRollUp[] = { @@ -2821,7 +2821,7 @@ static constexpr PreviewTrack TrackBlocksRightLargeZeroGRollUp[] = { { 1, -32, 0, 56, 48, { 0b1111, 0 }, 0 }, { 2, -64, 0, 96, 40, { 0b1111, 0 }, 0 }, { 3, -96, 0, 120, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftLargeZeroGRollDown[] = { @@ -2829,7 +2829,7 @@ static constexpr PreviewTrack TrackBlocksLeftLargeZeroGRollDown[] = { { 1, -32, 0, -56, 40, { 0b1111, 0 }, 0 }, { 2, -64, 0, -96, 48, { 0b1111, 0 }, 0 }, { 3, -96, 0, -152, 64, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightLargeZeroGRollDown[] = { @@ -2837,7 +2837,7 @@ static constexpr PreviewTrack TrackBlocksRightLargeZeroGRollDown[] = { { 1, -32, 0, -56, 40, { 0b1111, 0 }, 0 }, { 2, -64, 0, -96, 48, { 0b1111, 0 }, 0 }, { 3, -96, 0, -152, 64, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopUninvertedUp[] = { @@ -2848,7 +2848,7 @@ static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopUninvertedUp[] = { 4, -128, -32, 120, 96, { 0b1111, 0 }, 0 }, { 5, -96, -32, 64, 192, { 0b1111, 0 }, 0 }, { 6, -64, -32, 248, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopUninvertedUp[] = { @@ -2859,7 +2859,7 @@ static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopUninvertedUp[] = { 4, -128, 32, 120, 96, { 0b1111, 0 }, 0 }, { 5, -96, 32, 64, 192, { 0b1111, 0 }, 0 }, { 6, -64, 32, 248, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopInvertedDown[] = { @@ -2870,7 +2870,7 @@ static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopInvertedDown[] = { 4, 0, -32, -216, 56, { 0b1111, 0 }, 0 }, { 5, 32, -32, -232, 40, { 0b1111, 0b1100 }, 0 }, { 6, 64, -32, -248, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopInvertedDown[] = { @@ -2881,7 +2881,7 @@ static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopInvertedDown[] = { 4, 0, 32, -216, 56, { 0b1111, 0 }, 0 }, { 5, 32, 32, -232, 40, { 0b1111, 0b1100 }, 0 }, { 6, 64, 32, -248, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopInvertedUp[] = { @@ -2892,7 +2892,7 @@ static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopInvertedUp[] = { { 4, -128, -32, 120, 96, { 0b1111, 0 }, 0 }, { 5, -96, -32, 64, 192, { 0b1111, 0 }, 0 }, { 6, -64, -32, 248, 32, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopInvertedUp[] = { @@ -2903,7 +2903,7 @@ static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopInvertedUp[] = { { 4, -128, 32, 120, 96, { 0b1111, 0 }, 0 }, { 5, -96, 32, 64, 192, { 0b1111, 0 }, 0 }, { 6, -64, 32, 248, 32, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopUninvertedDown[] = { @@ -2914,7 +2914,7 @@ static constexpr PreviewTrack TrackBlocksLeftFlyerLargeHalfLoopUninvertedDown[] { 4, 0, -32, -248, 56, { 0b1111, 0 }, 0 }, { 5, 32, -32, -264, 40, { 0b1111, 0b1100 }, 0 }, { 6, 64, -32, -280, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopUninvertedDown[] = { @@ -2925,7 +2925,7 @@ static constexpr PreviewTrack TrackBlocksRightFlyerLargeHalfLoopUninvertedDown[] { 4, 0, 32, -248, 56, { 0b1111, 0 }, 0 }, { 5, 32, 32, -264, 40, { 0b1111, 0b1100 }, 0 }, { 6, 64, 32, -280, 24, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlyerHalfLoopUpInverted[] = { @@ -2933,7 +2933,7 @@ static constexpr PreviewTrack TrackBlocksFlyerHalfLoopUpInverted[] = { { 1, -32, 0, 16, 16, { 0b1111, 0b1100 }, 0 }, { 2, -64, 0, 32, 96,{ 0b0011, 0 }, 0 }, { 3, -32, 0, 120, 32, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksFlyerHalfLoopDownUpright[] = { @@ -2941,7 +2941,7 @@ static constexpr PreviewTrack TrackBlocksFlyerHalfLoopDownUpright[] = { { 1, -32, 0, -120, 96,{ 0b0011, 0 }, 0 }, { 2, 0, 0, -136, 16, { 0b1111, 0b1100 }, 0 }, { 3, 32, 0, -152, 16, { 0b1111, 0b1100 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftEighthToDiagUp25[] = { @@ -2950,7 +2950,7 @@ static constexpr PreviewTrack TrackBlocksLeftEighthToDiagUp25[] = { { 2, -32, -32, 32, 16, { 0b1000, 0 }, 0 }, { 3, -64, 0, 32, 16, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, -32, 32, 24, { 0b0001, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightEighthToDiagUp25[] = { @@ -2959,7 +2959,7 @@ static constexpr PreviewTrack TrackBlocksRightEighthToDiagUp25[] = { { 2, -32, 32, 32, 16, { 0b0100, 0 }, 0 }, { 3, -64, 0, 32, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, 32, 32, 24, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftEighthToDiagDown25[] = { @@ -2968,7 +2968,7 @@ static constexpr PreviewTrack TrackBlocksLeftEighthToDiagDown25[] = { { 2, -32, -32, -48, 16, { 0b1000, 0 }, 0 }, { 3, -64, 0, -48, 16, { 0b0010, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, -32, -48, 16, { 0b0001, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightEighthToDiagDown25[] = { @@ -2977,7 +2977,7 @@ static constexpr PreviewTrack TrackBlocksRightEighthToDiagDown25[] = { { 2, -32, 32, -48, 16, { 0b0100, 0 }, 0 }, { 3, -64, 0, -48, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 4, -64, 32, -48, 16, { 0b0010, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftEighthToOrthogonalUp25[] = { @@ -2986,7 +2986,7 @@ static constexpr PreviewTrack TrackBlocksLeftEighthToOrthogonalUp25[] = { { 2, 0, 32, 0, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 16, 16, { 0b1111, 0 }, 0 }, { 4, -64, 32, 32, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightEighthToOrthogonalUp25[] = { @@ -2995,7 +2995,7 @@ static constexpr PreviewTrack TrackBlocksRightEighthToOrthogonalUp25[] = { { 2, -32, 0, 0, 16, { 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, 16, 16, { 0b1111, 0 }, 0 }, { 4, -32, 64, 32, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksLeftEighthToOrthogonalDown25[] = { @@ -3004,7 +3004,7 @@ static constexpr PreviewTrack TrackBlocksLeftEighthToOrthogonalDown25[] = { { 2, 0, 32, -16, 16, { 0b0100, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, -32, 32, { 0b1111, 0 }, 0 }, { 4, -64, 32, -48, 16, { 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; static constexpr PreviewTrack TrackBlocksRightEighthToOrthogonalDown25[] = { @@ -3013,7 +3013,7 @@ static constexpr PreviewTrack TrackBlocksRightEighthToOrthogonalDown25[] = { { 2, -32, 0, -16, 16,{ 0b0001, 0 }, RCT_PREVIEW_TRACK_FLAG_0 }, { 3, -32, 32, -32, 32,{ 0b1111, 0 }, 0 }, { 4, -32, 64, -48, 16,{ 0b1111, 0 }, 0 }, - TRACK_BLOCK_END + kTrackBlockEnd }; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index 8e45f2c5b0..deb4d3a898 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2016,7 +2016,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) uint8_t flags; if (!TrackDesignPlacePreview(tds, td6, &cost, &ride, &flags)) { - std::fill_n(pixels, TRACK_PREVIEW_IMAGE_SIZE * 4, 0x00); + std::fill_n(pixels, kTrackPreviewImageSize * 4, 0x00); UnstashMap(); return; } @@ -2085,7 +2085,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) view.rotation = i; ViewportRender(dpi, &view, { {}, ScreenCoordsXY{ size_x, size_y } }); - dpi.bits += TRACK_PREVIEW_IMAGE_SIZE; + dpi.bits += kTrackPreviewImageSize; } ride->Delete(); diff --git a/src/openrct2/ride/TrackDesign.h b/src/openrct2/ride/TrackDesign.h index 800d4904eb..faf5ae735f 100644 --- a/src/openrct2/ride/TrackDesign.h +++ b/src/openrct2/ride/TrackDesign.h @@ -21,7 +21,7 @@ struct Ride; struct ResultWithMessage; -#define TRACK_PREVIEW_IMAGE_SIZE (370 * 217) +constexpr uint32_t kTrackPreviewImageSize = 370 * 217; struct TrackDesignState { diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index 5f0d003950..e5d9a107eb 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1795,7 +1795,7 @@ void Vehicle::UpdateWaitingToDepart() if (!skipCheck) { - if (!(currentStation.Depart & STATION_DEPART_FLAG)) + if (!(currentStation.Depart & kStationDepartFlag)) return; } @@ -2015,7 +2015,7 @@ static bool try_add_synchronised_station(const CoordsXYZ& coords) /* Station is not ready to depart, so just return; * vehicle_id for this station is SPRITE_INDEX_NULL. */ - if (!(ride->GetStation(stationIndex).Depart & STATION_DEPART_FLAG)) + if (!(ride->GetStation(stationIndex).Depart & kStationDepartFlag)) { return true; } @@ -2138,7 +2138,7 @@ static bool ride_station_can_depart_synchronised(const Ride& ride, StationIndex { if (sv_ride->IsBlockSectioned()) { - if (!(sv_ride->GetStation(sv->stationIndex).Depart & STATION_DEPART_FLAG)) + if (!(sv_ride->GetStation(sv->stationIndex).Depart & kStationDepartFlag)) { sv = _synchronisedVehicles; RideId rideId = RideId::GetNull(); @@ -2444,7 +2444,7 @@ void Vehicle::UpdateDepartingBoatHire() return; auto& station = curRide->GetStation(current_station); - station.Depart &= STATION_DEPART_FLAG; + station.Depart &= kStationDepartFlag; uint8_t waitingTime = std::max(curRide->min_waiting_time, static_cast(3)); waitingTime = std::min(waitingTime, static_cast(127)); station.Depart |= waitingTime; @@ -2717,7 +2717,7 @@ void Vehicle::FinishDeparting() if (curRide->mode != RideMode::Race && !curRide->IsBlockSectioned()) { auto& currentStation = curRide->GetStation(current_station); - currentStation.Depart &= STATION_DEPART_FLAG; + currentStation.Depart &= kStationDepartFlag; uint8_t waitingTime = 3; if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) { @@ -3562,7 +3562,7 @@ void Vehicle::UpdateTravellingCableLift() // This is slightly different to the vanilla function auto& currentStation = curRide->GetStation(current_station); - currentStation.Depart &= STATION_DEPART_FLAG; + currentStation.Depart &= kStationDepartFlag; uint8_t waitingTime = 3; if (curRide->depart_flags & RIDE_DEPART_WAIT_FOR_MINIMUM_LENGTH) { From 2c4c2da31981de5625a16e7b5232db98bad0c327 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 14:20:38 +0100 Subject: [PATCH 125/191] Part of #21421: Refactor VEHICLE_SEAT_PAIR_FLAG --- src/openrct2/object/RideObject.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 2 +- src/openrct2/ride/Vehicle.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/openrct2/object/RideObject.cpp b/src/openrct2/object/RideObject.cpp index f5ce445d68..5dd997e63a 100644 --- a/src/openrct2/object/RideObject.cpp +++ b/src/openrct2/object/RideObject.cpp @@ -714,7 +714,7 @@ CarEntry RideObject::ReadJsonCar([[maybe_unused]] IReadObjectContext* context, j car.num_seats = Json::GetNumber(jCar["numSeats"]); if (Json::GetBoolean(jCar["seatsInPairs"], true) && car.num_seats > 1) { - car.num_seats |= VEHICLE_SEAT_PAIR_FLAG; + car.num_seats |= kVehicleSeatPairFlag; } car.sprite_width = Json::GetNumber(jCar["spriteWidth"]); diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index e5d9a107eb..c48ce37031 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -5115,7 +5115,7 @@ Vehicle* Vehicle::TrainTail() const int32_t Vehicle::IsUsedInPairs() const { - return num_seats & VEHICLE_SEAT_PAIR_FLAG; + return num_seats & kVehicleSeatPairFlag; } /** diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 95dd53b5f6..5fcebdfc9b 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -516,7 +516,7 @@ enum SOUND_RANGE_NONE = 255 }; -#define VEHICLE_SEAT_PAIR_FLAG 0x80 +constexpr uint8_t kVehicleSeatPairFlag{ 0x80 }; #define VEHICLE_SEAT_NUM_MASK 0x7F Vehicle* TryGetVehicle(EntityId spriteIndex); From b60483f25d046714e17078202ea48224d1ecfb0e Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 14:23:32 +0100 Subject: [PATCH 126/191] Part of #21421: Refactor VEHICLE_SEAT_NUM_MASK --- src/openrct2/entity/Guest.cpp | 2 +- src/openrct2/ride/Vehicle.h | 2 +- src/openrct2/scripting/bindings/entity/ScVehicle.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 567b9ff2e6..b7d7cc9be2 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -2581,7 +2581,7 @@ bool Guest::FindVehicleToEnter(const Ride& ride, std::vector& car_array car_array.push_back(i); return true; } - num_seats &= VEHICLE_SEAT_NUM_MASK; + num_seats &= kVehicleSeatNumMask; } if (num_seats == vehicle->next_free_seat) continue; diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index 5fcebdfc9b..a7e8704983 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -517,7 +517,7 @@ enum }; constexpr uint8_t kVehicleSeatPairFlag{ 0x80 }; -#define VEHICLE_SEAT_NUM_MASK 0x7F +constexpr uint8_t kVehicleSeatNumMask{ 0x7F }; Vehicle* TryGetVehicle(EntityId spriteIndex); void VehicleUpdateAll(); diff --git a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp index 41ace4a6c3..abd7a939fb 100644 --- a/src/openrct2/scripting/bindings/entity/ScVehicle.cpp +++ b/src/openrct2/scripting/bindings/entity/ScVehicle.cpp @@ -155,7 +155,7 @@ namespace OpenRCT2::Scripting uint8_t ScVehicle::numSeats_get() const { auto vehicle = GetVehicle(); - return vehicle != nullptr ? vehicle->num_seats & VEHICLE_SEAT_NUM_MASK : 0; + return vehicle != nullptr ? vehicle->num_seats & kVehicleSeatNumMask : 0; } void ScVehicle::numSeats_set(uint8_t value) { @@ -163,8 +163,8 @@ namespace OpenRCT2::Scripting auto vehicle = GetVehicle(); if (vehicle != nullptr) { - vehicle->num_seats &= ~VEHICLE_SEAT_NUM_MASK; - vehicle->num_seats |= value & VEHICLE_SEAT_NUM_MASK; + vehicle->num_seats &= ~kVehicleSeatNumMask; + vehicle->num_seats |= value & kVehicleSeatNumMask; } } From ef81a6376e1e8345c9ecc1a8976b92a4620e1fe5 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 14:38:21 +0100 Subject: [PATCH 127/191] Part of #21421: Refactor MINIMUM_MAP_SIZE_TECHNICAL --- src/openrct2-ui/windows/Map.cpp | 2 +- src/openrct2-ui/windows/MapGen.cpp | 4 ++-- src/openrct2/actions/MapChangeSizeAction.cpp | 2 +- src/openrct2/world/Map.h | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 554c4a8e4e..b2afdc70a1 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -691,7 +691,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { // The practical size is 2 lower than the technical size size += 2; - size = std::clamp(size, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); + size = std::clamp(size, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); TileCoordsXY newMapSize = GetGameState().MapSize; if (_resizeDirection != ResizeDirection::X) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 89e7943a85..791b07afb6 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -405,9 +405,9 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { _resizeDirection = ResizeDirection::Both; if (_resizeDirection != ResizeDirection::X) - _mapSize.y = std::clamp(_mapSize.y + sizeOffset, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); + _mapSize.y = std::clamp(_mapSize.y + sizeOffset, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); if (_resizeDirection != ResizeDirection::Y) - _mapSize.x = std::clamp(_mapSize.x + sizeOffset, MINIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL); + _mapSize.x = std::clamp(_mapSize.x + sizeOffset, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); } void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) diff --git a/src/openrct2/actions/MapChangeSizeAction.cpp b/src/openrct2/actions/MapChangeSizeAction.cpp index 9ceeb8711e..bcd6b1a433 100644 --- a/src/openrct2/actions/MapChangeSizeAction.cpp +++ b/src/openrct2/actions/MapChangeSizeAction.cpp @@ -39,7 +39,7 @@ GameActions::Result MapChangeSizeAction::Query() const { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); } - if (_targetSize.x < MINIMUM_MAP_SIZE_TECHNICAL || _targetSize.y < MINIMUM_MAP_SIZE_TECHNICAL) + if (_targetSize.x < kMinimumMapSizeTechnical || _targetSize.y < kMinimumMapSizeTechnical) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); } diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 837fcad2ae..99afb700b1 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -25,9 +25,9 @@ constexpr uint8_t kMaximumWaterHeight = 254; */ constexpr uint8_t kMapBaseZ = 7; -#define MINIMUM_MAP_SIZE_TECHNICAL 5 +constexpr uint8_t kMinimumMapSizeTechnical{ 5 }; #define MAXIMUM_MAP_SIZE_TECHNICAL 1001 -#define MINIMUM_MAP_SIZE_PRACTICAL (MINIMUM_MAP_SIZE_TECHNICAL - 2) +#define MINIMUM_MAP_SIZE_PRACTICAL (kMinimumMapSizeTechnical - 2) #define MAXIMUM_MAP_SIZE_PRACTICAL (MAXIMUM_MAP_SIZE_TECHNICAL - 2) constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * MAXIMUM_MAP_SIZE_TECHNICAL; constexpr int32_t MAXIMUM_TILE_START_XY = MAXIMUM_MAP_SIZE_BIG - COORDS_XY_STEP; From ffb8b4d44bd00cbfec19273b36a1d39d1f99e84c Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 14:41:36 +0100 Subject: [PATCH 128/191] Part of #21421: Refactor MAXIMUM_MAP_SIZE_TECHNICAL --- src/openrct2-ui/windows/Map.cpp | 22 ++++++++++---------- src/openrct2-ui/windows/MapGen.cpp | 4 ++-- src/openrct2-ui/windows/RideConstruction.cpp | 2 +- src/openrct2-ui/windows/TileInspector.cpp | 8 +++---- src/openrct2/Game.cpp | 4 ++-- src/openrct2/actions/MapChangeSizeAction.cpp | 2 +- src/openrct2/entity/EntityRegistry.cpp | 6 +++--- src/openrct2/entity/PatrolArea.h | 6 +++--- src/openrct2/paint/Paint.h | 4 ++-- src/openrct2/rct1/S4Importer.cpp | 4 ++-- src/openrct2/rct2/S6Importer.cpp | 4 ++-- src/openrct2/ride/TrackDesign.cpp | 2 +- src/openrct2/world/Map.cpp | 20 +++++++++--------- src/openrct2/world/Map.h | 10 ++++----- 14 files changed, 49 insertions(+), 49 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index b2afdc70a1..720a98fdf2 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -55,7 +55,7 @@ namespace OpenRCT2::Ui::Windows return MapColour2((colour & 0xFF00) >> 8, PALETTE_INDEX_10); } - constexpr int32_t MAP_WINDOW_MAP_SIZE = MAXIMUM_MAP_SIZE_TECHNICAL * 2; + constexpr int32_t MAP_WINDOW_MAP_SIZE = kMaximumMapSizeTechnical * 2; static constexpr StringId WINDOW_TITLE = STR_MAP_LABEL; static constexpr int32_t WH = 259; @@ -131,10 +131,10 @@ static Widget window_map_widgets[] = { // used in transforming viewport view coordinates to minimap coordinates // rct2: 0x00981BBC static constexpr ScreenCoordsXY MiniMapOffsets[] = { - { MAXIMUM_MAP_SIZE_TECHNICAL - 8, 0 }, - { 2 * MAXIMUM_MAP_SIZE_TECHNICAL - 8, MAXIMUM_MAP_SIZE_TECHNICAL }, - { MAXIMUM_MAP_SIZE_TECHNICAL - 8, 2 * MAXIMUM_MAP_SIZE_TECHNICAL }, - { 0 - 8, MAXIMUM_MAP_SIZE_TECHNICAL }, + { kMaximumMapSizeTechnical - 8, 0 }, + { 2 * kMaximumMapSizeTechnical - 8, kMaximumMapSizeTechnical }, + { kMaximumMapSizeTechnical - 8, 2 * kMaximumMapSizeTechnical }, + { 0 - 8, kMaximumMapSizeTechnical }, }; // clang-format on @@ -691,7 +691,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { // The practical size is 2 lower than the technical size size += 2; - size = std::clamp(size, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); + size = std::clamp(size, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); TileCoordsXY newMapSize = GetGameState().MapSize; if (_resizeDirection != ResizeDirection::X) @@ -1069,7 +1069,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { int32_t x = 0, y = 0, dx = 0, dy = 0; - int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + MAXIMUM_MAP_SIZE_TECHNICAL - 1; + int32_t pos = (_currentLine * (MAP_WINDOW_MAP_SIZE - 1)) + kMaximumMapSizeTechnical - 1; auto destinationPosition = ScreenCoordsXY{ pos % MAP_WINDOW_MAP_SIZE, pos / MAP_WINDOW_MAP_SIZE }; auto destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; switch (GetCurrentRotation()) @@ -1100,7 +1100,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { break; } - for (int32_t i = 0; i < MAXIMUM_MAP_SIZE_TECHNICAL; i++) + for (int32_t i = 0; i < kMaximumMapSizeTechnical; i++) { if (!MapIsEdge({ x, y })) { @@ -1125,7 +1125,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { destination = _mapImageData.data() + (destinationPosition.y * MAP_WINDOW_MAP_SIZE) + destinationPosition.x; } _currentLine++; - if (_currentLine >= MAXIMUM_MAP_SIZE_TECHNICAL) + if (_currentLine >= kMaximumMapSizeTechnical) _currentLine = 0; } @@ -1414,7 +1414,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { CoordsXY ScreenToMap(ScreenCoordsXY screenCoords) { - screenCoords.x = ((screenCoords.x + 8) - MAXIMUM_MAP_SIZE_TECHNICAL) / 2; + screenCoords.x = ((screenCoords.x + 8) - kMaximumMapSizeTechnical) / 2; screenCoords.y = ((screenCoords.y + 8)) / 2; auto location = TileCoordsXY(screenCoords.y - screenCoords.x, screenCoords.x + screenCoords.y).ToCoordsXY(); @@ -1457,7 +1457,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { x /= 32; y /= 32; - return { -x + y + MAXIMUM_MAP_SIZE_TECHNICAL - 8, x + y - 8 }; + return { -x + y + kMaximumMapSizeTechnical - 8, x + y - 8 }; } void ResizeMap() diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 791b07afb6..da06a46037 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -405,9 +405,9 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { _resizeDirection = ResizeDirection::Both; if (_resizeDirection != ResizeDirection::X) - _mapSize.y = std::clamp(_mapSize.y + sizeOffset, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); + _mapSize.y = std::clamp(_mapSize.y + sizeOffset, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); if (_resizeDirection != ResizeDirection::Y) - _mapSize.x = std::clamp(_mapSize.x + sizeOffset, kMinimumMapSizeTechnical, MAXIMUM_MAP_SIZE_TECHNICAL); + _mapSize.x = std::clamp(_mapSize.x + sizeOffset, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); } void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) diff --git a/src/openrct2-ui/windows/RideConstruction.cpp b/src/openrct2-ui/windows/RideConstruction.cpp index f3ce047542..da0e4f13d1 100644 --- a/src/openrct2-ui/windows/RideConstruction.cpp +++ b/src/openrct2-ui/windows/RideConstruction.cpp @@ -2628,7 +2628,7 @@ static Widget _rideConstructionWidgets[] = { auto& gameState = OpenRCT2::GetGameState(); auto preserveMapSize = gameState.MapSize; - gameState.MapSize = { MAXIMUM_MAP_SIZE_TECHNICAL, MAXIMUM_MAP_SIZE_TECHNICAL }; + gameState.MapSize = { kMaximumMapSizeTechnical, kMaximumMapSizeTechnical }; // Setup non changing parts of the temporary track tile element tempTrackTileElement.SetType(TileElementType::Track); diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index ebdff373d5..569df05ada 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -742,7 +742,7 @@ static uint64_t PageDisabledWidgets[] = { { case WIDX_SPINNER_X_INCREASE: windowTileInspectorTile.x = std::min( - windowTileInspectorTile.x + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); + windowTileInspectorTile.x + 1, kMaximumMapSizeTechnical - 1); _toolMap.x = std::min(_toolMap.x + 32, MAXIMUM_TILE_START_XY); LoadTile(nullptr); break; @@ -755,7 +755,7 @@ static uint64_t PageDisabledWidgets[] = { case WIDX_SPINNER_Y_INCREASE: windowTileInspectorTile.y = std::min( - windowTileInspectorTile.y + 1, MAXIMUM_MAP_SIZE_TECHNICAL - 1); + windowTileInspectorTile.y + 1, kMaximumMapSizeTechnical - 1); _toolMap.y = std::min(_toolMap.y + 32, MAXIMUM_TILE_START_XY); LoadTile(nullptr); break; @@ -2075,10 +2075,10 @@ static uint64_t PageDisabledWidgets[] = { } // X and Y spinners SetWidgetDisabledAndInvalidate( - WIDX_SPINNER_X_INCREASE, !(_tileSelected && ((_toolMap.x / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); + WIDX_SPINNER_X_INCREASE, !(_tileSelected && ((_toolMap.x / 32) < kMaximumMapSizeTechnical - 1))); SetWidgetDisabledAndInvalidate(WIDX_SPINNER_X_DECREASE, !(_tileSelected && ((_toolMap.x / 32) > 0))); SetWidgetDisabledAndInvalidate( - WIDX_SPINNER_Y_INCREASE, !(_tileSelected && ((_toolMap.y / 32) < MAXIMUM_MAP_SIZE_TECHNICAL - 1))); + WIDX_SPINNER_Y_INCREASE, !(_tileSelected && ((_toolMap.y / 32) < kMaximumMapSizeTechnical - 1))); SetWidgetDisabledAndInvalidate(WIDX_SPINNER_Y_DECREASE, !(_tileSelected && ((_toolMap.y / 32) > 0))); // Sort buttons diff --git a/src/openrct2/Game.cpp b/src/openrct2/Game.cpp index c7c857e031..bc2e86661b 100644 --- a/src/openrct2/Game.cpp +++ b/src/openrct2/Game.cpp @@ -450,9 +450,9 @@ static void FixInvalidSurfaces() // Fixes broken saves where a surface element could be null // and broken saves with incorrect invisible map border tiles - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (int32_t y = 0; y < kMaximumMapSizeTechnical; y++) { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (int32_t x = 0; x < kMaximumMapSizeTechnical; x++) { auto* surfaceElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }); diff --git a/src/openrct2/actions/MapChangeSizeAction.cpp b/src/openrct2/actions/MapChangeSizeAction.cpp index bcd6b1a433..1c5bf1fc75 100644 --- a/src/openrct2/actions/MapChangeSizeAction.cpp +++ b/src/openrct2/actions/MapChangeSizeAction.cpp @@ -35,7 +35,7 @@ void MapChangeSizeAction::Serialise(DataSerialiser& stream) GameActions::Result MapChangeSizeAction::Query() const { - if (_targetSize.x > MAXIMUM_MAP_SIZE_TECHNICAL || _targetSize.y > MAXIMUM_MAP_SIZE_TECHNICAL) + if (_targetSize.x > kMaximumMapSizeTechnical || _targetSize.y > kMaximumMapSizeTechnical) { return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); } diff --git a/src/openrct2/entity/EntityRegistry.cpp b/src/openrct2/entity/EntityRegistry.cpp index 47f50f8afe..2567d24e76 100644 --- a/src/openrct2/entity/EntityRegistry.cpp +++ b/src/openrct2/entity/EntityRegistry.cpp @@ -44,7 +44,7 @@ static std::vector _freeIdList; static bool _entityFlashingList[MAX_ENTITIES]; -constexpr const uint32_t SPATIAL_INDEX_SIZE = (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) + 1; +constexpr const uint32_t SPATIAL_INDEX_SIZE = (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) + 1; constexpr uint32_t SPATIAL_INDEX_LOCATION_NULL = SPATIAL_INDEX_SIZE - 1; static std::array, SPATIAL_INDEX_SIZE> gEntitySpatialIndex; @@ -60,10 +60,10 @@ static constexpr size_t GetSpatialIndexOffset(const CoordsXY& loc) const auto tileX = std::abs(loc.x) / COORDS_XY_STEP; const auto tileY = std::abs(loc.y) / COORDS_XY_STEP; - if (tileX >= MAXIMUM_MAP_SIZE_TECHNICAL || tileY >= MAXIMUM_MAP_SIZE_TECHNICAL) + if (tileX >= kMaximumMapSizeTechnical || tileY >= kMaximumMapSizeTechnical) return SPATIAL_INDEX_LOCATION_NULL; - return tileX * MAXIMUM_MAP_SIZE_TECHNICAL + tileY; + return tileX * kMaximumMapSizeTechnical + tileY; } constexpr bool EntityTypeIsMiscEntity(const EntityType type) diff --git a/src/openrct2/entity/PatrolArea.h b/src/openrct2/entity/PatrolArea.h index ded2ec1fbe..053df61c58 100644 --- a/src/openrct2/entity/PatrolArea.h +++ b/src/openrct2/entity/PatrolArea.h @@ -17,7 +17,7 @@ // 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 = MAXIMUM_MAP_SIZE_TECHNICAL / 4; +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; class PatrolArea @@ -32,8 +32,8 @@ private: std::vector SortedTiles; }; - static constexpr auto CellColumns = (MAXIMUM_MAP_SIZE_TECHNICAL + (Cell::Width - 1)) / Cell::Width; - static constexpr auto CellRows = (MAXIMUM_MAP_SIZE_TECHNICAL + (Cell::Height - 1)) / Cell::Height; + static constexpr auto CellColumns = (kMaximumMapSizeTechnical + (Cell::Width - 1)) / Cell::Width; + static constexpr auto CellRows = (kMaximumMapSizeTechnical + (Cell::Height - 1)) / Cell::Height; static constexpr auto NumCells = CellColumns * CellRows; std::array Areas; diff --git a/src/openrct2/paint/Paint.h b/src/openrct2/paint/Paint.h index 3bd4dc19e8..b958bcc304 100644 --- a/src/openrct2/paint/Paint.h +++ b/src/openrct2/paint/Paint.h @@ -121,9 +121,9 @@ struct TunnelEntry uint8_t type; }; -// The maximum size must be MAXIMUM_MAP_SIZE_TECHNICAL multiplied by 2 because +// The maximum size must be kMaximumMapSizeTechnical multiplied by 2 because // the quadrant index is based on the x and y components combined. -static constexpr int32_t MaxPaintQuadrants = MAXIMUM_MAP_SIZE_TECHNICAL * 2; +static constexpr int32_t MaxPaintQuadrants = kMaximumMapSizeTechnical * 2; #define TUNNEL_MAX_COUNT 65 diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index be2f25b2f5..725ad9abee 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -1528,9 +1528,9 @@ namespace RCT1 std::vector tileElements; const auto maxSize = _s4.MapSize == 0 ? Limits::MaxMapSize : _s4.MapSize; - for (TileCoordsXY coords = { 0, 0 }; coords.y < MAXIMUM_MAP_SIZE_TECHNICAL; coords.y++) + for (TileCoordsXY coords = { 0, 0 }; coords.y < kMaximumMapSizeTechnical; coords.y++) { - for (coords.x = 0; coords.x < MAXIMUM_MAP_SIZE_TECHNICAL; coords.x++) + for (coords.x = 0; coords.x < kMaximumMapSizeTechnical; coords.x++) { auto tileAdded = false; if (coords.x < maxSize && coords.y < maxSize) diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 6ead1df5e7..4a7d9f8811 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1802,9 +1802,9 @@ namespace RCT2 bool nextElementInvisible = false; bool restOfTileInvisible = false; const auto maxSize = std::min(Limits::MaxMapSize, _s6.MapSize); - for (TileCoordsXY coords = { 0, 0 }; coords.y < MAXIMUM_MAP_SIZE_TECHNICAL; coords.y++) + for (TileCoordsXY coords = { 0, 0 }; coords.y < kMaximumMapSizeTechnical; coords.y++) { - for (coords.x = 0; coords.x < MAXIMUM_MAP_SIZE_TECHNICAL; coords.x++) + for (coords.x = 0; coords.x < kMaximumMapSizeTechnical; coords.x++) { nextElementInvisible = false; restOfTileInvisible = false; diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index deb4d3a898..bb066ab599 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -2098,7 +2098,7 @@ void TrackDesignDrawPreview(TrackDesign* td6, uint8_t* pixels) */ static void TrackDesignPreviewClearMap() { - auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; + auto numTiles = kMaximumMapSizeTechnical * kMaximumMapSizeTechnical; GetGameState().MapSize = TRACK_DESIGN_PREVIEW_MAP_SIZE; diff --git a/src/openrct2/world/Map.cpp b/src/openrct2/world/Map.cpp index 7c32ab9dab..048420be30 100644 --- a/src/openrct2/world/Map.cpp +++ b/src/openrct2/world/Map.cpp @@ -152,7 +152,7 @@ void SetTileElements(std::vector&& tileElements) auto& gameState = GetGameState(); gameState.TileElements = std::move(tileElements); _tileIndex = TilePointerIndex( - MAXIMUM_MAP_SIZE_TECHNICAL, gameState.TileElements.data(), gameState.TileElements.size()); + kMaximumMapSizeTechnical, gameState.TileElements.data(), gameState.TileElements.size()); _tileElementsInUse = gameState.TileElements.size(); } @@ -177,9 +177,9 @@ std::vector GetReorganisedTileElementsWithoutGhosts() { std::vector newElements; newElements.reserve(std::max(MIN_TILE_ELEMENTS, GetGameState().TileElements.size())); - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (int32_t y = 0; y < kMaximumMapSizeTechnical; y++) { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (int32_t x = 0; x < kMaximumMapSizeTechnical; x++) { auto oldSize = newElements.size(); @@ -217,9 +217,9 @@ static void ReorganiseTileElements(size_t capacity) std::vector newElements; newElements.reserve(std::max(MIN_TILE_ELEMENTS, capacity)); - for (int32_t y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (int32_t y = 0; y < kMaximumMapSizeTechnical; y++) { - for (int32_t x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (int32_t x = 0; x < kMaximumMapSizeTechnical; x++) { const auto* element = MapGetFirstElementAt(TileCoordsXY{ x, y }); if (element == nullptr) @@ -336,8 +336,8 @@ void TileElementIteratorRestartForTile(TileElementIterator* it) static bool IsTileLocationValid(const TileCoordsXY& coords) { - const bool is_x_valid = coords.x < MAXIMUM_MAP_SIZE_TECHNICAL && coords.x >= 0; - const bool is_y_valid = coords.y < MAXIMUM_MAP_SIZE_TECHNICAL && coords.y >= 0; + const bool is_x_valid = coords.x < kMaximumMapSizeTechnical && coords.x >= 0; + const bool is_y_valid = coords.y < kMaximumMapSizeTechnical && coords.y >= 0; return is_x_valid && is_y_valid; } @@ -454,7 +454,7 @@ BannerElement* MapGetBannerElementAt(const CoordsXYZ& bannerPos, uint8_t positio */ void MapInit(const TileCoordsXY& size) { - auto numTiles = MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL; + auto numTiles = kMaximumMapSizeTechnical * kMaximumMapSizeTechnical; SetTileElements(std::vector(numTiles, GetDefaultSurfaceElement())); auto& gameState = GetGameState(); @@ -1420,7 +1420,7 @@ static void MapExtendBoundarySurfaceExtendTile(const SurfaceElement& sourceTile, void MapExtendBoundarySurfaceY() { auto y = GetGameState().MapSize.y - 2; - for (auto x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; x++) + for (auto x = 0; x < kMaximumMapSizeTechnical; x++) { auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y - 1 }); auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }); @@ -1440,7 +1440,7 @@ void MapExtendBoundarySurfaceY() void MapExtendBoundarySurfaceX() { auto x = GetGameState().MapSize.x - 2; - for (auto y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; y++) + for (auto y = 0; y < kMaximumMapSizeTechnical; y++) { auto existingTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x - 1, y }); auto newTileElement = MapGetSurfaceElementAt(TileCoordsXY{ x, y }); diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 99afb700b1..184ec86314 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -26,10 +26,10 @@ constexpr uint8_t kMaximumWaterHeight = 254; constexpr uint8_t kMapBaseZ = 7; constexpr uint8_t kMinimumMapSizeTechnical{ 5 }; -#define MAXIMUM_MAP_SIZE_TECHNICAL 1001 +constexpr uint16_t kMaximumMapSizeTechnical{ 1001 }; #define MINIMUM_MAP_SIZE_PRACTICAL (kMinimumMapSizeTechnical - 2) -#define MAXIMUM_MAP_SIZE_PRACTICAL (MAXIMUM_MAP_SIZE_TECHNICAL - 2) -constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * MAXIMUM_MAP_SIZE_TECHNICAL; +#define MAXIMUM_MAP_SIZE_PRACTICAL (kMaximumMapSizeTechnical - 2) +constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * kMaximumMapSizeTechnical; constexpr int32_t MAXIMUM_TILE_START_XY = MAXIMUM_MAP_SIZE_BIG - COORDS_XY_STEP; constexpr const int32_t LAND_HEIGHT_STEP = 2 * COORDS_Z_STEP; constexpr const int32_t WATER_HEIGHT_STEP = 2 * COORDS_Z_STEP; @@ -40,11 +40,11 @@ constexpr uint8_t ConstructionRightsClearanceSmall = 3; // Same as previous, but in big coords. constexpr const uint8_t ConstructionRightsClearanceBig = 3 * COORDS_Z_STEP; -#define MAP_MINIMUM_X_Y (-MAXIMUM_MAP_SIZE_TECHNICAL) +#define MAP_MINIMUM_X_Y (-kMaximumMapSizeTechnical) constexpr uint32_t MAX_TILE_ELEMENTS_WITH_SPARE_ROOM = 0x1000000; constexpr uint32_t MAX_TILE_ELEMENTS = MAX_TILE_ELEMENTS_WITH_SPARE_ROOM - 512; -#define MAX_TILE_TILE_ELEMENT_POINTERS (MAXIMUM_MAP_SIZE_TECHNICAL * MAXIMUM_MAP_SIZE_TECHNICAL) +#define MAX_TILE_TILE_ELEMENT_POINTERS (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) #define TILE_UNDEFINED_TILE_ELEMENT NULL From e5ff6b271a65b43381e7beb46e3eb42f7c952c74 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 15:14:35 +0100 Subject: [PATCH 129/191] Part of #21421: Refactor TILE_ELEMENT_QUADRANT_MASK --- src/openrct2/rct12/RCT12.cpp | 4 ++-- src/openrct2/world/SmallScenery.cpp | 4 ++-- src/openrct2/world/TileElement.h | 2 +- src/openrct2/world/Wall.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index cbe4c1a41e..c6425262bc 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -308,7 +308,7 @@ uint8_t RCT12SmallSceneryElement::GetAge() const uint8_t RCT12SmallSceneryElement::GetSceneryQuadrant() const { - return (this->Type & TILE_ELEMENT_QUADRANT_MASK) >> 6; + return (this->Type & kTileElementQuadrantMask) >> 6; } colour_t RCT12SmallSceneryElement::GetPrimaryColour() const @@ -358,7 +358,7 @@ uint8_t RCT12WallElement::GetEntryIndex() const uint8_t RCT12WallElement::GetSlope() const { - return (Type & TILE_ELEMENT_QUADRANT_MASK) >> 6; + return (Type & kTileElementQuadrantMask) >> 6; } colour_t RCT12WallElement::GetPrimaryColour() const diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index 6c48010373..34d1017b51 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -28,12 +28,12 @@ uint8_t SmallSceneryElement::GetSceneryQuadrant() const { - return (this->Type & TILE_ELEMENT_QUADRANT_MASK) >> 6; + return (this->Type & kTileElementQuadrantMask) >> 6; } void SmallSceneryElement::SetSceneryQuadrant(uint8_t newQuadrant) { - Type &= ~TILE_ELEMENT_QUADRANT_MASK; + Type &= ~kTileElementQuadrantMask; Type |= (newQuadrant << 6); } diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index d0d6a58b3d..c30991abc4 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -700,7 +700,7 @@ enum MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT = (1 << 7), }; -#define TILE_ELEMENT_QUADRANT_MASK 0b11000000 +constexpr uint8_t kTileElementQuadrantMask{ 0b11000000 }; #define TILE_ELEMENT_TYPE_MASK 0b00111100 #define TILE_ELEMENT_DIRECTION_MASK 0b00000011 #define TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK 0b00001111 diff --git a/src/openrct2/world/Wall.cpp b/src/openrct2/world/Wall.cpp index 44b07e1b01..f889baccfd 100644 --- a/src/openrct2/world/Wall.cpp +++ b/src/openrct2/world/Wall.cpp @@ -82,12 +82,12 @@ void WallRemoveIntersectingWalls(const CoordsXYRangedZ& wallPos, Direction direc uint8_t WallElement::GetSlope() const { - return (Type & TILE_ELEMENT_QUADRANT_MASK) >> 6; + return (Type & kTileElementQuadrantMask) >> 6; } void WallElement::SetSlope(uint8_t newSlope) { - Type &= ~TILE_ELEMENT_QUADRANT_MASK; + Type &= ~kTileElementQuadrantMask; Type |= (newSlope << 6); } From c6def2d0a90d37d43ca35f63ce019cd467ef02d2 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 15:17:01 +0100 Subject: [PATCH 130/191] Part of #21421: Refactor TILE_ELEMENT_TYPE_MASK --- src/openrct2/rct12/RCT12.cpp | 2 +- src/openrct2/world/TileElement.h | 2 +- src/openrct2/world/TileElementBase.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index c6425262bc..5cb2039b19 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -31,7 +31,7 @@ using namespace OpenRCT2; RCT12TileElementType RCT12TileElementBase::GetType() const { - auto elem_type = static_cast((this->Type & TILE_ELEMENT_TYPE_MASK) >> 2); + auto elem_type = static_cast((this->Type & kTileElementTypeMask) >> 2); switch (elem_type) { case RCT12TileElementType::Surface: diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index c30991abc4..21615f17d9 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -701,7 +701,7 @@ enum }; constexpr uint8_t kTileElementQuadrantMask{ 0b11000000 }; -#define TILE_ELEMENT_TYPE_MASK 0b00111100 +constexpr uint8_t kTileElementTypeMask{ 0b00111100 }; #define TILE_ELEMENT_DIRECTION_MASK 0b00000011 #define TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK 0b00001111 diff --git a/src/openrct2/world/TileElementBase.cpp b/src/openrct2/world/TileElementBase.cpp index e25bb596a5..de48fba9ce 100644 --- a/src/openrct2/world/TileElementBase.cpp +++ b/src/openrct2/world/TileElementBase.cpp @@ -12,13 +12,13 @@ TileElementType TileElementBase::GetType() const { - return static_cast((this->Type & TILE_ELEMENT_TYPE_MASK) >> 2); + return static_cast((this->Type & kTileElementTypeMask) >> 2); } void TileElementBase::SetType(TileElementType newType) { - this->Type &= ~TILE_ELEMENT_TYPE_MASK; - this->Type |= ((EnumValue(newType) << 2) & TILE_ELEMENT_TYPE_MASK); + this->Type &= ~kTileElementTypeMask; + this->Type |= ((EnumValue(newType) << 2) & kTileElementTypeMask); } Direction TileElementBase::GetDirection() const From 24688ad5a357d82b9b1d625015e662bdac21437d Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 17 Mar 2024 15:20:06 +0100 Subject: [PATCH 131/191] Part of #21421: Refactor TILE_ELEMENT_DIRECTION_MASK --- src/openrct2/actions/FootpathLayoutPlaceAction.cpp | 4 ++-- src/openrct2/actions/FootpathPlaceAction.cpp | 4 ++-- src/openrct2/actions/WallPlaceAction.cpp | 6 +++--- src/openrct2/rct12/RCT12.cpp | 2 +- src/openrct2/ride/Ride.cpp | 4 ++-- src/openrct2/ride/TrackDesign.cpp | 4 ++-- src/openrct2/world/Footpath.cpp | 6 +++--- src/openrct2/world/TileElement.h | 2 +- src/openrct2/world/TileElementBase.cpp | 8 ++++---- src/openrct2/world/TileInspector.cpp | 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp index 0be2ad2a47..734c2d5b38 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp @@ -135,7 +135,7 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertQuery(GameActions::R auto zHigh = zLow + PATH_CLEARANCE; if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & TILE_ELEMENT_DIRECTION_MASK); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); zHigh += PATH_HEIGHT_STEP; } @@ -205,7 +205,7 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertExecute(GameActions: auto zHigh = zLow + PATH_CLEARANCE; if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & TILE_ELEMENT_DIRECTION_MASK); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); zHigh += PATH_HEIGHT_STEP; } diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 05385e3d64..4ea04b0f3d 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -282,7 +282,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result auto zHigh = zLow + PATH_CLEARANCE; if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & TILE_ELEMENT_DIRECTION_MASK); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); zHigh += PATH_HEIGHT_STEP; } @@ -351,7 +351,7 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul auto zHigh = zLow + PATH_CLEARANCE; if (_slope & FOOTPATH_PROPERTIES_FLAG_IS_SLOPED) { - quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & TILE_ELEMENT_DIRECTION_MASK); + quarterTile = QuarterTile{ 0b1111, 0b1100 }.Rotate(_slope & kTileElementDirectionMask); zHigh += PATH_HEIGHT_STEP; } diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index 7e196949dc..e771fc8110 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -412,7 +412,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( using namespace OpenRCT2::TrackMetaData; const auto& ted = GetTrackElementDescriptor(trackType); int32_t sequence = trackElement->GetSequenceIndex(); - int32_t direction = (_edge - trackElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; + int32_t direction = (_edge - trackElement->GetDirection()) & kTileElementDirectionMask; auto ride = GetRide(trackElement->GetRideIndex()); if (ride == nullptr) { @@ -484,7 +484,7 @@ bool WallPlaceAction::WallCheckObstructionWithTrack( return false; } - direction = (trackElement->GetDirection() + ted.Coordinates.rotation_end) & TILE_ELEMENT_DIRECTION_MASK; + direction = (trackElement->GetDirection() + ted.Coordinates.rotation_end) & kTileElementDirectionMask; if (direction != _edge) { return false; @@ -561,7 +561,7 @@ GameActions::Result WallPlaceAction::WallCheckObstruction( auto sequence = largeSceneryElement->GetSequenceIndex(); const LargeSceneryTile& tile = sceneryEntry->tiles[sequence]; - int32_t direction = ((_edge - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK) + 8; + int32_t direction = ((_edge - tileElement->GetDirection()) & kTileElementDirectionMask) + 8; if (!(tile.flags & (1 << direction))) { MapGetObstructionErrorText(tileElement, res); diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 5cb2039b19..7486f1d121 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -54,7 +54,7 @@ RCT12TileElementType RCT12TileElementBase::GetType() const uint8_t RCT12TileElementBase::GetDirection() const { - return this->Type & TILE_ELEMENT_DIRECTION_MASK; + return this->Type & kTileElementDirectionMask; } uint8_t RCT12TileElementBase::GetOccupiedQuadrants() const diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 9aae063032..8669914da8 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -618,7 +618,7 @@ bool TrackBlockGetNext(CoordsXYE* input, CoordsXYE* output, int32_t* z, int32_t* OriginZ -= trackBlock->z; OriginZ += trackCoordinate.z_end; - uint8_t directionStart = ((trackCoordinate.rotation_end + rotation) & TILE_ELEMENT_DIRECTION_MASK) + uint8_t directionStart = ((trackCoordinate.rotation_end + rotation) & kTileElementDirectionMask) | (trackCoordinate.rotation_end & TRACK_BLOCK_2); return TrackBlockGetNextFromZero({ coords, OriginZ }, *ride, directionStart, output, z, direction, false); @@ -757,7 +757,7 @@ bool TrackBlockGetPrevious(const CoordsXYE& trackPos, TrackBeginEnd* outTrackBeg z -= trackBlock->z; z += trackCoordinate.z_begin; - rotation = ((trackCoordinate.rotation_begin + rotation) & TILE_ELEMENT_DIRECTION_MASK) + rotation = ((trackCoordinate.rotation_begin + rotation) & kTileElementDirectionMask) | (trackCoordinate.rotation_begin & TRACK_BLOCK_2); return TrackBlockGetPreviousFromZero({ coords, z }, *ride, rotation, outTrackBeginEnd); diff --git a/src/openrct2/ride/TrackDesign.cpp b/src/openrct2/ride/TrackDesign.cpp index bb066ab599..e852fb6e17 100644 --- a/src/openrct2/ride/TrackDesign.cpp +++ b/src/openrct2/ride/TrackDesign.cpp @@ -307,7 +307,7 @@ ResultWithMessage TrackDesign::CreateTrackDesignTrack(TrackDesignState& tds, con Direction entranceDirection = tileElement->GetDirection(); entranceDirection -= _saveDirection; - entranceDirection &= TILE_ELEMENT_DIRECTION_MASK; + entranceDirection &= kTileElementDirectionMask; mapLocation -= tds.Origin; // Rotate entrance coordinates backwards to the correct direction @@ -973,7 +973,7 @@ static GameActions::Result TrackDesignPlaceSceneryElementRemoveGhost( } int32_t z = scenery.loc.z + originZ; - uint8_t sceneryRotation = (rotation + scenery.flags) & TILE_ELEMENT_DIRECTION_MASK; + uint8_t sceneryRotation = (rotation + scenery.flags) & kTileElementDirectionMask; const uint32_t flags = GAME_COMMAND_FLAG_APPLY | GAME_COMMAND_FLAG_ALLOW_DURING_PAUSED | GAME_COMMAND_FLAG_NO_SPEND | GAME_COMMAND_FLAG_GHOST; std::unique_ptr ga; diff --git a/src/openrct2/world/Footpath.cpp b/src/openrct2/world/Footpath.cpp index c54adceb7f..69f02d8560 100644 --- a/src/openrct2/world/Footpath.cpp +++ b/src/openrct2/world/Footpath.cpp @@ -887,7 +887,7 @@ static void Loc6A6D7E( { return; } - uint16_t dx = DirectionReverse((direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); + uint16_t dx = DirectionReverse((direction - tileElement->GetDirection()) & kTileElementDirectionMask); if (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { @@ -973,7 +973,7 @@ static void Loc6A6C85( { return; } - uint16_t dx = (direction - tileElementPos.element->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK; + uint16_t dx = (direction - tileElementPos.element->GetDirection()) & kTileElementDirectionMask; if (!(ted.SequenceProperties[trackSequence] & (1 << dx))) { return; @@ -2215,7 +2215,7 @@ bool TileElementWantsPathConnectionTowards(const TileCoordsXYZD& coords, const T const auto& ted = GetTrackElementDescriptor(trackType); if (ted.SequenceProperties[trackSequence] & TRACK_SEQUENCE_FLAG_CONNECTS_TO_PATH) { - uint16_t dx = ((coords.direction - tileElement->GetDirection()) & TILE_ELEMENT_DIRECTION_MASK); + uint16_t dx = ((coords.direction - tileElement->GetDirection()) & kTileElementDirectionMask); if (ted.SequenceProperties[trackSequence] & (1 << dx)) { // Track element has the flags required for the given direction diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 21615f17d9..73fc8046fc 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -702,7 +702,7 @@ enum constexpr uint8_t kTileElementQuadrantMask{ 0b11000000 }; constexpr uint8_t kTileElementTypeMask{ 0b00111100 }; -#define TILE_ELEMENT_DIRECTION_MASK 0b00000011 +constexpr uint8_t kTileElementDirectionMask{ 0b00000011 }; #define TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK 0b00001111 enum diff --git a/src/openrct2/world/TileElementBase.cpp b/src/openrct2/world/TileElementBase.cpp index de48fba9ce..ff817f8878 100644 --- a/src/openrct2/world/TileElementBase.cpp +++ b/src/openrct2/world/TileElementBase.cpp @@ -23,18 +23,18 @@ void TileElementBase::SetType(TileElementType newType) Direction TileElementBase::GetDirection() const { - return this->Type & TILE_ELEMENT_DIRECTION_MASK; + return this->Type & kTileElementDirectionMask; } void TileElementBase::SetDirection(Direction direction) { - this->Type &= ~TILE_ELEMENT_DIRECTION_MASK; - this->Type |= (direction & TILE_ELEMENT_DIRECTION_MASK); + this->Type &= ~kTileElementDirectionMask; + this->Type |= (direction & kTileElementDirectionMask); } Direction TileElementBase::GetDirectionWithOffset(uint8_t offset) const { - return ((this->Type & TILE_ELEMENT_DIRECTION_MASK) + offset) & TILE_ELEMENT_DIRECTION_MASK; + return ((this->Type & kTileElementDirectionMask) + offset) & kTileElementDirectionMask; } bool TileElementBase::IsLastForTile() const diff --git a/src/openrct2/world/TileInspector.cpp b/src/openrct2/world/TileInspector.cpp index 7a76295e1e..ecbb9f6a31 100644 --- a/src/openrct2/world/TileInspector.cpp +++ b/src/openrct2/world/TileInspector.cpp @@ -219,7 +219,7 @@ namespace OpenRCT2::TileInspector case TileElementType::Path: if (tileElement->AsPath()->IsSloped()) { - newRotation = (tileElement->AsPath()->GetSlopeDirection() + 1) & TILE_ELEMENT_DIRECTION_MASK; + newRotation = (tileElement->AsPath()->GetSlopeDirection() + 1) & kTileElementDirectionMask; tileElement->AsPath()->SetSlopeDirection(newRotation); } pathEdges = tileElement->AsPath()->GetEdges(); From eb4c64abc4896066e8256a5ad309a78c6f2da4e1 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sat, 23 Mar 2024 10:38:16 +0100 Subject: [PATCH 132/191] Part of #21421: improved consistency for var decl --- src/openrct2/world/Map.h | 4 ++-- src/openrct2/world/TileElement.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 184ec86314..917337ad7f 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -25,8 +25,8 @@ constexpr uint8_t kMaximumWaterHeight = 254; */ constexpr uint8_t kMapBaseZ = 7; -constexpr uint8_t kMinimumMapSizeTechnical{ 5 }; -constexpr uint16_t kMaximumMapSizeTechnical{ 1001 }; +constexpr uint8_t kMinimumMapSizeTechnical = 5 ; +constexpr uint16_t kMaximumMapSizeTechnical = 1001 ; #define MINIMUM_MAP_SIZE_PRACTICAL (kMinimumMapSizeTechnical - 2) #define MAXIMUM_MAP_SIZE_PRACTICAL (kMaximumMapSizeTechnical - 2) constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * kMaximumMapSizeTechnical; diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index 73fc8046fc..cf865d6256 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -700,9 +700,9 @@ enum MAP_ELEM_TRACK_SEQUENCE_GREEN_LIGHT = (1 << 7), }; -constexpr uint8_t kTileElementQuadrantMask{ 0b11000000 }; -constexpr uint8_t kTileElementTypeMask{ 0b00111100 }; -constexpr uint8_t kTileElementDirectionMask{ 0b00000011 }; +constexpr uint8_t kTileElementQuadrantMask = 0b11000000; +constexpr uint8_t kTileElementTypeMask = 0b00111100; +constexpr uint8_t kTileElementDirectionMask = 0b00000011; #define TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK 0b00001111 enum From 026e12d22e8bf754287f2feaaf5ad867ac258b6d Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 24 Mar 2024 20:54:03 +0100 Subject: [PATCH 133/191] Part of #21421: refactor MPH(x) as literal --- src/openrct2/ride/VehicleRiderControl.cpp | 181 +++++++++++----------- 1 file changed, 92 insertions(+), 89 deletions(-) diff --git a/src/openrct2/ride/VehicleRiderControl.cpp b/src/openrct2/ride/VehicleRiderControl.cpp index ff35bf1494..6aae115706 100644 --- a/src/openrct2/ride/VehicleRiderControl.cpp +++ b/src/openrct2/ride/VehicleRiderControl.cpp @@ -10,7 +10,10 @@ #include "../entity/EntityRegistry.h" #include "Vehicle.h" -#define MPH(x) (x * 29127) +constexpr int operator"" _MPH(unsigned long long x) +{ + return x * 29127; +} // Acceleration to apply when rider is braking constexpr int32_t minBrake = (1 << 16); @@ -20,7 +23,7 @@ constexpr int32_t minBrake = (1 << 16); constexpr int32_t maxBrake = (12 << 16); // Velocity above which riders will attempt to maintain separation from the vehicle in front -constexpr int32_t minFollowVelocity = MPH(4); +constexpr int32_t minFollowVelocity = 4_MPH; // Minimum separation distance that riders will allow (regardless of followDistance) constexpr int32_t minFollowDistance = 32; @@ -35,92 +38,92 @@ struct RiderControlSettings }; static RiderControlSettings riderTable[256] = { - { MPH(22), MPH(11), MPH(10), 10 }, { MPH(23), MPH(10), MPH(5), 9 }, { MPH(23), MPH(8), MPH(7), 11 }, - { MPH(27), MPH(17), MPH(12), 6 }, { MPH(25), MPH(18), MPH(15), 6 }, { MPH(23), MPH(14), MPH(12), 9 }, - { MPH(20), MPH(12), MPH(12), 5 }, { MPH(23), MPH(10), MPH(5), 11 }, { MPH(26), MPH(9), MPH(4), 11 }, - { MPH(16), MPH(11), MPH(9), 7 }, { MPH(28), MPH(10), MPH(9), 10 }, { MPH(24), MPH(18), MPH(8), 4 }, - { MPH(23), MPH(15), MPH(13), 5 }, { MPH(18), MPH(10), MPH(10), 10 }, { MPH(25), MPH(15), MPH(8), 9 }, - { MPH(18), MPH(12), MPH(12), 7 }, { MPH(24), MPH(14), MPH(7), 7 }, { MPH(27), MPH(19), MPH(13), 7 }, - { MPH(26), MPH(19), MPH(9), 5 }, { MPH(22), MPH(10), MPH(6), 9 }, { MPH(20), MPH(12), MPH(11), 10 }, - { MPH(27), MPH(16), MPH(12), 7 }, { MPH(22), MPH(13), MPH(10), 7 }, { MPH(23), MPH(11), MPH(10), 11 }, - { MPH(17), MPH(10), MPH(9), 8 }, { MPH(19), MPH(13), MPH(10), 5 }, { MPH(14), MPH(8), MPH(11), 10 }, - { MPH(22), MPH(15), MPH(12), 8 }, { MPH(15), MPH(7), MPH(8), 8 }, { MPH(23), MPH(17), MPH(14), 4 }, - { MPH(25), MPH(14), MPH(13), 7 }, { MPH(22), MPH(8), MPH(6), 13 }, { MPH(27), MPH(11), MPH(6), 11 }, - { MPH(19), MPH(10), MPH(9), 11 }, { MPH(24), MPH(13), MPH(11), 7 }, { MPH(12), MPH(7), MPH(8), 7 }, - { MPH(27), MPH(11), MPH(5), 9 }, { MPH(15), MPH(9), MPH(7), 7 }, { MPH(16), MPH(10), MPH(9), 8 }, - { MPH(11), MPH(7), MPH(7), 9 }, { MPH(25), MPH(17), MPH(9), 6 }, { MPH(22), MPH(10), MPH(4), 13 }, - { MPH(25), MPH(13), MPH(7), 10 }, { MPH(28), MPH(18), MPH(10), 5 }, { MPH(21), MPH(11), MPH(10), 10 }, - { MPH(23), MPH(11), MPH(11), 7 }, { MPH(21), MPH(15), MPH(8), 5 }, { MPH(27), MPH(14), MPH(6), 9 }, - { MPH(26), MPH(17), MPH(12), 6 }, { MPH(17), MPH(7), MPH(6), 12 }, { MPH(17), MPH(9), MPH(8), 9 }, - { MPH(17), MPH(10), MPH(12), 6 }, { MPH(20), MPH(10), MPH(9), 9 }, { MPH(26), MPH(14), MPH(10), 7 }, - { MPH(28), MPH(14), MPH(7), 12 }, { MPH(24), MPH(11), MPH(7), 9 }, { MPH(26), MPH(12), MPH(6), 8 }, - { MPH(24), MPH(12), MPH(11), 9 }, { MPH(24), MPH(11), MPH(5), 7 }, { MPH(29), MPH(21), MPH(16), 5 }, - { MPH(22), MPH(13), MPH(13), 5 }, { MPH(27), MPH(20), MPH(12), 6 }, { MPH(21), MPH(14), MPH(7), 9 }, - { MPH(27), MPH(18), MPH(7), 6 }, { MPH(19), MPH(12), MPH(12), 6 }, { MPH(25), MPH(18), MPH(9), 7 }, - { MPH(20), MPH(10), MPH(10), 10 }, { MPH(19), MPH(9), MPH(7), 9 }, { MPH(24), MPH(14), MPH(7), 7 }, - { MPH(25), MPH(12), MPH(10), 10 }, { MPH(24), MPH(15), MPH(8), 7 }, { MPH(23), MPH(11), MPH(6), 8 }, - { MPH(18), MPH(11), MPH(7), 9 }, { MPH(23), MPH(8), MPH(5), 11 }, { MPH(12), MPH(8), MPH(12), 8 }, - { MPH(22), MPH(14), MPH(12), 9 }, { MPH(25), MPH(13), MPH(14), 8 }, { MPH(26), MPH(12), MPH(5), 12 }, - { MPH(29), MPH(15), MPH(6), 10 }, { MPH(20), MPH(12), MPH(8), 9 }, { MPH(25), MPH(13), MPH(10), 8 }, - { MPH(23), MPH(12), MPH(8), 9 }, { MPH(20), MPH(11), MPH(5), 11 }, { MPH(22), MPH(11), MPH(5), 11 }, - { MPH(21), MPH(9), MPH(6), 9 }, { MPH(28), MPH(13), MPH(8), 10 }, { MPH(27), MPH(14), MPH(10), 11 }, - { MPH(22), MPH(16), MPH(10), 5 }, { MPH(25), MPH(14), MPH(9), 6 }, { MPH(20), MPH(10), MPH(7), 10 }, - { MPH(24), MPH(15), MPH(13), 7 }, { MPH(22), MPH(11), MPH(4), 9 }, { MPH(19), MPH(9), MPH(4), 12 }, - { MPH(19), MPH(11), MPH(8), 7 }, { MPH(24), MPH(16), MPH(15), 5 }, { MPH(15), MPH(11), MPH(9), 7 }, - { MPH(25), MPH(10), MPH(7), 10 }, { MPH(23), MPH(11), MPH(5), 9 }, { MPH(24), MPH(13), MPH(11), 8 }, - { MPH(26), MPH(16), MPH(9), 8 }, { MPH(25), MPH(16), MPH(10), 6 }, { MPH(26), MPH(16), MPH(8), 6 }, - { MPH(26), MPH(16), MPH(12), 7 }, { MPH(25), MPH(11), MPH(10), 11 }, { MPH(21), MPH(13), MPH(13), 6 }, - { MPH(9), MPH(6), MPH(4), 11 }, { MPH(26), MPH(11), MPH(5), 10 }, { MPH(25), MPH(18), MPH(14), 5 }, - { MPH(26), MPH(16), MPH(9), 4 }, { MPH(24), MPH(11), MPH(11), 9 }, { MPH(26), MPH(16), MPH(11), 8 }, - { MPH(29), MPH(12), MPH(5), 10 }, { MPH(26), MPH(11), MPH(4), 12 }, { MPH(19), MPH(9), MPH(12), 8 }, - { MPH(18), MPH(8), MPH(5), 12 }, { MPH(28), MPH(11), MPH(4), 10 }, { MPH(25), MPH(16), MPH(10), 8 }, - { MPH(29), MPH(17), MPH(12), 6 }, { MPH(18), MPH(11), MPH(10), 8 }, { MPH(25), MPH(10), MPH(9), 10 }, - { MPH(25), MPH(12), MPH(6), 12 }, { MPH(23), MPH(12), MPH(8), 8 }, { MPH(27), MPH(9), MPH(9), 11 }, - { MPH(27), MPH(19), MPH(10), 3 }, { MPH(28), MPH(12), MPH(10), 8 }, { MPH(25), MPH(14), MPH(10), 7 }, - { MPH(28), MPH(17), MPH(8), 7 }, { MPH(24), MPH(13), MPH(4), 9 }, { MPH(25), MPH(12), MPH(8), 9 }, - { MPH(18), MPH(9), MPH(6), 13 }, { MPH(19), MPH(8), MPH(7), 11 }, { MPH(28), MPH(12), MPH(7), 10 }, - { MPH(21), MPH(10), MPH(6), 9 }, { MPH(26), MPH(13), MPH(8), 9 }, { MPH(21), MPH(12), MPH(12), 6 }, - { MPH(25), MPH(15), MPH(8), 5 }, { MPH(17), MPH(12), MPH(13), 7 }, { MPH(20), MPH(9), MPH(6), 12 }, - { MPH(27), MPH(18), MPH(13), 5 }, { MPH(22), MPH(14), MPH(14), 5 }, { MPH(19), MPH(12), MPH(15), 5 }, - { MPH(26), MPH(13), MPH(10), 10 }, { MPH(23), MPH(11), MPH(8), 10 }, { MPH(28), MPH(17), MPH(11), 8 }, - { MPH(23), MPH(9), MPH(5), 10 }, { MPH(20), MPH(11), MPH(10), 7 }, { MPH(24), MPH(9), MPH(7), 12 }, - { MPH(25), MPH(13), MPH(8), 8 }, { MPH(25), MPH(18), MPH(14), 6 }, { MPH(22), MPH(16), MPH(12), 7 }, - { MPH(21), MPH(12), MPH(11), 8 }, { MPH(22), MPH(16), MPH(10), 6 }, { MPH(21), MPH(15), MPH(11), 6 }, - { MPH(24), MPH(16), MPH(12), 7 }, { MPH(28), MPH(21), MPH(9), 4 }, { MPH(26), MPH(14), MPH(12), 8 }, - { MPH(23), MPH(13), MPH(8), 7 }, { MPH(26), MPH(16), MPH(14), 7 }, { MPH(23), MPH(14), MPH(8), 7 }, - { MPH(21), MPH(13), MPH(8), 7 }, { MPH(26), MPH(17), MPH(7), 6 }, { MPH(28), MPH(10), MPH(9), 10 }, - { MPH(28), MPH(11), MPH(6), 12 }, { MPH(21), MPH(9), MPH(9), 10 }, { MPH(27), MPH(12), MPH(10), 9 }, - { MPH(20), MPH(10), MPH(11), 8 }, { MPH(26), MPH(17), MPH(15), 6 }, { MPH(23), MPH(9), MPH(6), 11 }, - { MPH(26), MPH(17), MPH(10), 8 }, { MPH(22), MPH(13), MPH(12), 9 }, { MPH(24), MPH(12), MPH(11), 8 }, - { MPH(27), MPH(17), MPH(9), 7 }, { MPH(27), MPH(14), MPH(7), 10 }, { MPH(26), MPH(9), MPH(6), 9 }, - { MPH(23), MPH(10), MPH(11), 9 }, { MPH(30), MPH(23), MPH(10), 3 }, { MPH(14), MPH(7), MPH(7), 10 }, - { MPH(25), MPH(12), MPH(9), 10 }, { MPH(20), MPH(12), MPH(8), 4 }, { MPH(24), MPH(16), MPH(12), 7 }, - { MPH(24), MPH(13), MPH(6), 10 }, { MPH(24), MPH(14), MPH(9), 5 }, { MPH(27), MPH(14), MPH(7), 8 }, - { MPH(26), MPH(12), MPH(9), 9 }, { MPH(23), MPH(14), MPH(8), 8 }, { MPH(25), MPH(16), MPH(11), 6 }, - { MPH(29), MPH(17), MPH(7), 9 }, { MPH(25), MPH(17), MPH(15), 5 }, { MPH(27), MPH(16), MPH(11), 4 }, - { MPH(13), MPH(8), MPH(10), 10 }, { MPH(27), MPH(17), MPH(8), 7 }, { MPH(22), MPH(13), MPH(6), 7 }, - { MPH(25), MPH(18), MPH(16), 4 }, { MPH(23), MPH(12), MPH(6), 8 }, { MPH(22), MPH(16), MPH(12), 5 }, - { MPH(25), MPH(14), MPH(10), 6 }, { MPH(19), MPH(11), MPH(10), 8 }, { MPH(24), MPH(10), MPH(10), 8 }, - { MPH(27), MPH(17), MPH(12), 7 }, { MPH(27), MPH(16), MPH(12), 5 }, { MPH(24), MPH(16), MPH(8), 7 }, - { MPH(20), MPH(9), MPH(8), 9 }, { MPH(27), MPH(19), MPH(15), 4 }, { MPH(21), MPH(10), MPH(11), 8 }, - { MPH(17), MPH(8), MPH(5), 11 }, { MPH(16), MPH(10), MPH(10), 8 }, { MPH(29), MPH(18), MPH(10), 7 }, - { MPH(23), MPH(16), MPH(14), 5 }, { MPH(16), MPH(8), MPH(6), 10 }, { MPH(24), MPH(10), MPH(8), 11 }, - { MPH(21), MPH(11), MPH(7), 11 }, { MPH(26), MPH(13), MPH(8), 7 }, { MPH(22), MPH(10), MPH(8), 11 }, - { MPH(25), MPH(13), MPH(11), 9 }, { MPH(24), MPH(15), MPH(8), 5 }, { MPH(26), MPH(12), MPH(6), 8 }, - { MPH(21), MPH(15), MPH(15), 7 }, { MPH(28), MPH(19), MPH(14), 6 }, { MPH(23), MPH(14), MPH(9), 8 }, - { MPH(25), MPH(13), MPH(6), 9 }, { MPH(18), MPH(11), MPH(12), 7 }, { MPH(22), MPH(13), MPH(7), 6 }, - { MPH(23), MPH(13), MPH(7), 8 }, { MPH(27), MPH(18), MPH(9), 5 }, { MPH(20), MPH(9), MPH(6), 10 }, - { MPH(29), MPH(9), MPH(9), 12 }, { MPH(26), MPH(12), MPH(9), 11 }, { MPH(27), MPH(10), MPH(5), 11 }, - { MPH(26), MPH(20), MPH(9), 3 }, { MPH(18), MPH(10), MPH(11), 8 }, { MPH(28), MPH(16), MPH(12), 8 }, - { MPH(13), MPH(9), MPH(7), 9 }, { MPH(24), MPH(15), MPH(9), 6 }, { MPH(20), MPH(11), MPH(9), 8 }, - { MPH(24), MPH(15), MPH(12), 4 }, { MPH(24), MPH(14), MPH(9), 5 }, { MPH(22), MPH(11), MPH(8), 10 }, - { MPH(24), MPH(11), MPH(10), 10 }, { MPH(24), MPH(17), MPH(10), 7 }, { MPH(28), MPH(18), MPH(13), 7 }, - { MPH(23), MPH(11), MPH(8), 12 }, { MPH(25), MPH(12), MPH(11), 8 }, { MPH(21), MPH(10), MPH(11), 8 }, - { MPH(15), MPH(8), MPH(7), 10 }, { MPH(26), MPH(16), MPH(9), 8 }, { MPH(21), MPH(10), MPH(9), 10 }, - { MPH(27), MPH(17), MPH(16), 6 }, { MPH(22), MPH(12), MPH(6), 9 }, { MPH(25), MPH(9), MPH(4), 11 }, - { MPH(26), MPH(16), MPH(13), 9 }, { MPH(26), MPH(19), MPH(11), 6 }, { MPH(24), MPH(15), MPH(13), 7 }, - { MPH(16), MPH(9), MPH(10), 8 }, { MPH(21), MPH(11), MPH(7), 6 }, { MPH(28), MPH(20), MPH(15), 6 }, - { MPH(25), MPH(15), MPH(9), 6 } + { 22_MPH, 11_MPH, 10_MPH, 10 }, { 23_MPH, 10_MPH, 5_MPH, 9 }, { 23_MPH, 8_MPH, 7_MPH, 11 }, + { 27_MPH, 17_MPH, 12_MPH, 6 }, { 25_MPH, 18_MPH, 15_MPH, 6 }, { 23_MPH, 14_MPH, 12_MPH, 9 }, + { 20_MPH, 12_MPH, 12_MPH, 5 }, { 23_MPH, 10_MPH, 5_MPH, 11 }, { 26_MPH, 9_MPH, 4_MPH, 11 }, + { 16_MPH, 11_MPH, 9_MPH, 7 }, { 28_MPH, 10_MPH, 9_MPH, 10 }, { 24_MPH, 18_MPH, 8_MPH, 4 }, + { 23_MPH, 15_MPH, 13_MPH, 5 }, { 18_MPH, 10_MPH, 10_MPH, 10 }, { 25_MPH, 15_MPH, 8_MPH, 9 }, + { 18_MPH, 12_MPH, 12_MPH, 7 }, { 24_MPH, 14_MPH, 7_MPH, 7 }, { 27_MPH, 19_MPH, 13_MPH, 7 }, + { 26_MPH, 19_MPH, 9_MPH, 5 }, { 22_MPH, 10_MPH, 6_MPH, 9 }, { 20_MPH, 12_MPH, 11_MPH, 10 }, + { 27_MPH, 16_MPH, 12_MPH, 7 }, { 22_MPH, 13_MPH, 10_MPH, 7 }, { 23_MPH, 11_MPH, 10_MPH, 11 }, + { 17_MPH, 10_MPH, 9_MPH, 8 }, { 19_MPH, 13_MPH, 10_MPH, 5 }, { 14_MPH, 8_MPH, 11_MPH, 10 }, + { 22_MPH, 15_MPH, 12_MPH, 8 }, { 15_MPH, 7_MPH, 8_MPH, 8 }, { 23_MPH, 17_MPH, 14_MPH, 4 }, + { 25_MPH, 14_MPH, 13_MPH, 7 }, { 22_MPH, 8_MPH, 6_MPH, 13 }, { 27_MPH, 11_MPH, 6_MPH, 11 }, + { 19_MPH, 10_MPH, 9_MPH, 11 }, { 24_MPH, 13_MPH, 11_MPH, 7 }, { 12_MPH, 7_MPH, 8_MPH, 7 }, + { 27_MPH, 11_MPH, 5_MPH, 9 }, { 15_MPH, 9_MPH, 7_MPH, 7 }, { 16_MPH, 10_MPH, 9_MPH, 8 }, + { 11_MPH, 7_MPH, 7_MPH, 9 }, { 25_MPH, 17_MPH, 9_MPH, 6 }, { 22_MPH, 10_MPH, 4_MPH, 13 }, + { 25_MPH, 13_MPH, 7_MPH, 10 }, { 28_MPH, 18_MPH, 10_MPH, 5 }, { 21_MPH, 11_MPH, 10_MPH, 10 }, + { 23_MPH, 11_MPH, 11_MPH, 7 }, { 21_MPH, 15_MPH, 8_MPH, 5 }, { 27_MPH, 14_MPH, 6_MPH, 9 }, + { 26_MPH, 17_MPH, 12_MPH, 6 }, { 17_MPH, 7_MPH, 6_MPH, 12 }, { 17_MPH, 9_MPH, 8_MPH, 9 }, + { 17_MPH, 10_MPH, 12_MPH, 6 }, { 20_MPH, 10_MPH, 9_MPH, 9 }, { 26_MPH, 14_MPH, 10_MPH, 7 }, + { 28_MPH, 14_MPH, 7_MPH, 12 }, { 24_MPH, 11_MPH, 7_MPH, 9 }, { 26_MPH, 12_MPH, 6_MPH, 8 }, + { 24_MPH, 12_MPH, 11_MPH, 9 }, { 24_MPH, 11_MPH, 5_MPH, 7 }, { 29_MPH, 21_MPH, 16_MPH, 5 }, + { 22_MPH, 13_MPH, 13_MPH, 5 }, { 27_MPH, 20_MPH, 12_MPH, 6 }, { 21_MPH, 14_MPH, 7_MPH, 9 }, + { 27_MPH, 18_MPH, 7_MPH, 6 }, { 19_MPH, 12_MPH, 12_MPH, 6 }, { 25_MPH, 18_MPH, 9_MPH, 7 }, + { 20_MPH, 10_MPH, 10_MPH, 10 }, { 19_MPH, 9_MPH, 7_MPH, 9 }, { 24_MPH, 14_MPH, 7_MPH, 7 }, + { 25_MPH, 12_MPH, 10_MPH, 10 }, { 24_MPH, 15_MPH, 8_MPH, 7 }, { 23_MPH, 11_MPH, 6_MPH, 8 }, + { 18_MPH, 11_MPH, 7_MPH, 9 }, { 23_MPH, 8_MPH, 5_MPH, 11 }, { 12_MPH, 8_MPH, 12_MPH, 8 }, + { 22_MPH, 14_MPH, 12_MPH, 9 }, { 25_MPH, 13_MPH, 14_MPH, 8 }, { 26_MPH, 12_MPH, 5_MPH, 12 }, + { 29_MPH, 15_MPH, 6_MPH, 10 }, { 20_MPH, 12_MPH, 8_MPH, 9 }, { 25_MPH, 13_MPH, 10_MPH, 8 }, + { 23_MPH, 12_MPH, 8_MPH, 9 }, { 20_MPH, 11_MPH, 5_MPH, 11 }, { 22_MPH, 11_MPH, 5_MPH, 11 }, + { 21_MPH, 9_MPH, 6_MPH, 9 }, { 28_MPH, 13_MPH, 8_MPH, 10 }, { 27_MPH, 14_MPH, 10_MPH, 11 }, + { 22_MPH, 16_MPH, 10_MPH, 5 }, { 25_MPH, 14_MPH, 9_MPH, 6 }, { 20_MPH, 10_MPH, 7_MPH, 10 }, + { 24_MPH, 15_MPH, 13_MPH, 7 }, { 22_MPH, 11_MPH, 4_MPH, 9 }, { 19_MPH, 9_MPH, 4_MPH, 12 }, + { 19_MPH, 11_MPH, 8_MPH, 7 }, { 24_MPH, 16_MPH, 15_MPH, 5 }, { 15_MPH, 11_MPH, 9_MPH, 7 }, + { 25_MPH, 10_MPH, 7_MPH, 10 }, { 23_MPH, 11_MPH, 5_MPH, 9 }, { 24_MPH, 13_MPH, 11_MPH, 8 }, + { 26_MPH, 16_MPH, 9_MPH, 8 }, { 25_MPH, 16_MPH, 10_MPH, 6 }, { 26_MPH, 16_MPH, 8_MPH, 6 }, + { 26_MPH, 16_MPH, 12_MPH, 7 }, { 25_MPH, 11_MPH, 10_MPH, 11 }, { 21_MPH, 13_MPH, 13_MPH, 6 }, + { 9_MPH, 6_MPH, 4_MPH, 11 }, { 26_MPH, 11_MPH, 5_MPH, 10 }, { 25_MPH, 18_MPH, 14_MPH, 5 }, + { 26_MPH, 16_MPH, 9_MPH, 4 }, { 24_MPH, 11_MPH, 11_MPH, 9 }, { 26_MPH, 16_MPH, 11_MPH, 8 }, + { 29_MPH, 12_MPH, 5_MPH, 10 }, { 26_MPH, 11_MPH, 4_MPH, 12 }, { 19_MPH, 9_MPH, 12_MPH, 8 }, + { 18_MPH, 8_MPH, 5_MPH, 12 }, { 28_MPH, 11_MPH, 4_MPH, 10 }, { 25_MPH, 16_MPH, 10_MPH, 8 }, + { 29_MPH, 17_MPH, 12_MPH, 6 }, { 18_MPH, 11_MPH, 10_MPH, 8 }, { 25_MPH, 10_MPH, 9_MPH, 10 }, + { 25_MPH, 12_MPH, 6_MPH, 12 }, { 23_MPH, 12_MPH, 8_MPH, 8 }, { 27_MPH, 9_MPH, 9_MPH, 11 }, + { 27_MPH, 19_MPH, 10_MPH, 3 }, { 28_MPH, 12_MPH, 10_MPH, 8 }, { 25_MPH, 14_MPH, 10_MPH, 7 }, + { 28_MPH, 17_MPH, 8_MPH, 7 }, { 24_MPH, 13_MPH, 4_MPH, 9 }, { 25_MPH, 12_MPH, 8_MPH, 9 }, + { 18_MPH, 9_MPH, 6_MPH, 13 }, { 19_MPH, 8_MPH, 7_MPH, 11 }, { 28_MPH, 12_MPH, 7_MPH, 10 }, + { 21_MPH, 10_MPH, 6_MPH, 9 }, { 26_MPH, 13_MPH, 8_MPH, 9 }, { 21_MPH, 12_MPH, 12_MPH, 6 }, + { 25_MPH, 15_MPH, 8_MPH, 5 }, { 17_MPH, 12_MPH, 13_MPH, 7 }, { 20_MPH, 9_MPH, 6_MPH, 12 }, + { 27_MPH, 18_MPH, 13_MPH, 5 }, { 22_MPH, 14_MPH, 14_MPH, 5 }, { 19_MPH, 12_MPH, 15_MPH, 5 }, + { 26_MPH, 13_MPH, 10_MPH, 10 }, { 23_MPH, 11_MPH, 8_MPH, 10 }, { 28_MPH, 17_MPH, 11_MPH, 8 }, + { 23_MPH, 9_MPH, 5_MPH, 10 }, { 20_MPH, 11_MPH, 10_MPH, 7 }, { 24_MPH, 9_MPH, 7_MPH, 12 }, + { 25_MPH, 13_MPH, 8_MPH, 8 }, { 25_MPH, 18_MPH, 14_MPH, 6 }, { 22_MPH, 16_MPH, 12_MPH, 7 }, + { 21_MPH, 12_MPH, 11_MPH, 8 }, { 22_MPH, 16_MPH, 10_MPH, 6 }, { 21_MPH, 15_MPH, 11_MPH, 6 }, + { 24_MPH, 16_MPH, 12_MPH, 7 }, { 28_MPH, 21_MPH, 9_MPH, 4 }, { 26_MPH, 14_MPH, 12_MPH, 8 }, + { 23_MPH, 13_MPH, 8_MPH, 7 }, { 26_MPH, 16_MPH, 14_MPH, 7 }, { 23_MPH, 14_MPH, 8_MPH, 7 }, + { 21_MPH, 13_MPH, 8_MPH, 7 }, { 26_MPH, 17_MPH, 7_MPH, 6 }, { 28_MPH, 10_MPH, 9_MPH, 10 }, + { 28_MPH, 11_MPH, 6_MPH, 12 }, { 21_MPH, 9_MPH, 9_MPH, 10 }, { 27_MPH, 12_MPH, 10_MPH, 9 }, + { 20_MPH, 10_MPH, 11_MPH, 8 }, { 26_MPH, 17_MPH, 15_MPH, 6 }, { 23_MPH, 9_MPH, 6_MPH, 11 }, + { 26_MPH, 17_MPH, 10_MPH, 8 }, { 22_MPH, 13_MPH, 12_MPH, 9 }, { 24_MPH, 12_MPH, 11_MPH, 8 }, + { 27_MPH, 17_MPH, 9_MPH, 7 }, { 27_MPH, 14_MPH, 7_MPH, 10 }, { 26_MPH, 9_MPH, 6_MPH, 9 }, + { 23_MPH, 10_MPH, 11_MPH, 9 }, { 30_MPH, 23_MPH, 10_MPH, 3 }, { 14_MPH, 7_MPH, 7_MPH, 10 }, + { 25_MPH, 12_MPH, 9_MPH, 10 }, { 20_MPH, 12_MPH, 8_MPH, 4 }, { 24_MPH, 16_MPH, 12_MPH, 7 }, + { 24_MPH, 13_MPH, 6_MPH, 10 }, { 24_MPH, 14_MPH, 9_MPH, 5 }, { 27_MPH, 14_MPH, 7_MPH, 8 }, + { 26_MPH, 12_MPH, 9_MPH, 9 }, { 23_MPH, 14_MPH, 8_MPH, 8 }, { 25_MPH, 16_MPH, 11_MPH, 6 }, + { 29_MPH, 17_MPH, 7_MPH, 9 }, { 25_MPH, 17_MPH, 15_MPH, 5 }, { 27_MPH, 16_MPH, 11_MPH, 4 }, + { 13_MPH, 8_MPH, 10_MPH, 10 }, { 27_MPH, 17_MPH, 8_MPH, 7 }, { 22_MPH, 13_MPH, 6_MPH, 7 }, + { 25_MPH, 18_MPH, 16_MPH, 4 }, { 23_MPH, 12_MPH, 6_MPH, 8 }, { 22_MPH, 16_MPH, 12_MPH, 5 }, + { 25_MPH, 14_MPH, 10_MPH, 6 }, { 19_MPH, 11_MPH, 10_MPH, 8 }, { 24_MPH, 10_MPH, 10_MPH, 8 }, + { 27_MPH, 17_MPH, 12_MPH, 7 }, { 27_MPH, 16_MPH, 12_MPH, 5 }, { 24_MPH, 16_MPH, 8_MPH, 7 }, + { 20_MPH, 9_MPH, 8_MPH, 9 }, { 27_MPH, 19_MPH, 15_MPH, 4 }, { 21_MPH, 10_MPH, 11_MPH, 8 }, + { 17_MPH, 8_MPH, 5_MPH, 11 }, { 16_MPH, 10_MPH, 10_MPH, 8 }, { 29_MPH, 18_MPH, 10_MPH, 7 }, + { 23_MPH, 16_MPH, 14_MPH, 5 }, { 16_MPH, 8_MPH, 6_MPH, 10 }, { 24_MPH, 10_MPH, 8_MPH, 11 }, + { 21_MPH, 11_MPH, 7_MPH, 11 }, { 26_MPH, 13_MPH, 8_MPH, 7 }, { 22_MPH, 10_MPH, 8_MPH, 11 }, + { 25_MPH, 13_MPH, 11_MPH, 9 }, { 24_MPH, 15_MPH, 8_MPH, 5 }, { 26_MPH, 12_MPH, 6_MPH, 8 }, + { 21_MPH, 15_MPH, 15_MPH, 7 }, { 28_MPH, 19_MPH, 14_MPH, 6 }, { 23_MPH, 14_MPH, 9_MPH, 8 }, + { 25_MPH, 13_MPH, 6_MPH, 9 }, { 18_MPH, 11_MPH, 12_MPH, 7 }, { 22_MPH, 13_MPH, 7_MPH, 6 }, + { 23_MPH, 13_MPH, 7_MPH, 8 }, { 27_MPH, 18_MPH, 9_MPH, 5 }, { 20_MPH, 9_MPH, 6_MPH, 10 }, + { 29_MPH, 9_MPH, 9_MPH, 12 }, { 26_MPH, 12_MPH, 9_MPH, 11 }, { 27_MPH, 10_MPH, 5_MPH, 11 }, + { 26_MPH, 20_MPH, 9_MPH, 3 }, { 18_MPH, 10_MPH, 11_MPH, 8 }, { 28_MPH, 16_MPH, 12_MPH, 8 }, + { 13_MPH, 9_MPH, 7_MPH, 9 }, { 24_MPH, 15_MPH, 9_MPH, 6 }, { 20_MPH, 11_MPH, 9_MPH, 8 }, + { 24_MPH, 15_MPH, 12_MPH, 4 }, { 24_MPH, 14_MPH, 9_MPH, 5 }, { 22_MPH, 11_MPH, 8_MPH, 10 }, + { 24_MPH, 11_MPH, 10_MPH, 10 }, { 24_MPH, 17_MPH, 10_MPH, 7 }, { 28_MPH, 18_MPH, 13_MPH, 7 }, + { 23_MPH, 11_MPH, 8_MPH, 12 }, { 25_MPH, 12_MPH, 11_MPH, 8 }, { 21_MPH, 10_MPH, 11_MPH, 8 }, + { 15_MPH, 8_MPH, 7_MPH, 10 }, { 26_MPH, 16_MPH, 9_MPH, 8 }, { 21_MPH, 10_MPH, 9_MPH, 10 }, + { 27_MPH, 17_MPH, 16_MPH, 6 }, { 22_MPH, 12_MPH, 6_MPH, 9 }, { 25_MPH, 9_MPH, 4_MPH, 11 }, + { 26_MPH, 16_MPH, 13_MPH, 9 }, { 26_MPH, 19_MPH, 11_MPH, 6 }, { 24_MPH, 15_MPH, 13_MPH, 7 }, + { 16_MPH, 9_MPH, 10_MPH, 8 }, { 21_MPH, 11_MPH, 7_MPH, 6 }, { 28_MPH, 20_MPH, 15_MPH, 6 }, + { 25_MPH, 15_MPH, 9_MPH, 6 } }; int32_t Vehicle::CalculateRiderBraking() const @@ -139,7 +142,7 @@ int32_t Vehicle::CalculateRiderBraking() const int32_t relativeVelocity = velocity - prevVehicle->velocity; int32_t z_diff = abs(z - prevVehicle->z); - if (distance < followDistance && z_diff < 16 && relativeVelocity > -MPH(2)) + if (distance < followDistance && z_diff < 16 && relativeVelocity > -2_MPH) { if (distance < followDistance / 2 || relativeVelocity > riderSettings.brakeThreshold) { From fe84bb3e7e2f8fc2ad271f0f00488fad364f08b8 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Sun, 24 Mar 2024 21:05:30 +0100 Subject: [PATCH 134/191] Adding my name to list of contribs --- contributors.md | 1 + 1 file changed, 1 insertion(+) diff --git a/contributors.md b/contributors.md index a85cd73001..91018072cb 100644 --- a/contributors.md +++ b/contributors.md @@ -121,6 +121,7 @@ Appreciation for contributors who have provided substantial work, but are no lon * Alex Parisi (alex-parisi) - Added API for returning metadata from all registered plugins. ## Bug fixes & Refactors +* Claudio Tiecher (janclod) * (KirilAngelov) * (halfbro) * (Myrtle) From 5d2ecf71e578db2529078236e09134c672be566b Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Mon, 25 Mar 2024 16:46:44 +0100 Subject: [PATCH 135/191] Part of #21421: apply clang-formatting --- src/openrct2-ui/windows/MapGen.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index da06a46037..5942199498 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -405,9 +405,13 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { _resizeDirection = ResizeDirection::Both; if (_resizeDirection != ResizeDirection::X) - _mapSize.y = std::clamp(_mapSize.y + sizeOffset, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); + _mapSize.y = std::clamp( + _mapSize.y + sizeOffset, static_cast(kMinimumMapSizeTechnical), + static_cast(kMaximumMapSizeTechnical)); if (_resizeDirection != ResizeDirection::Y) - _mapSize.x = std::clamp(_mapSize.x + sizeOffset, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); + _mapSize.x = std::clamp( + _mapSize.x + sizeOffset, static_cast(kMinimumMapSizeTechnical), + static_cast(kMaximumMapSizeTechnical)); } void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) From 4d99fec550a3cbbb6e4f1b445ee53090e0c26242 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Mon, 25 Mar 2024 16:56:04 +0100 Subject: [PATCH 136/191] Part of #21421: apply more clang-formatting --- src/openrct2-ui/windows/Map.cpp | 3 ++- src/openrct2-ui/windows/TileInspector.cpp | 6 ++---- src/openrct2/world/Map.h | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 720a98fdf2..1787e5d40e 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -691,7 +691,8 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { { // The practical size is 2 lower than the technical size size += 2; - size = std::clamp(size, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); + size = std::clamp( + size, static_cast(kMinimumMapSizeTechnical), static_cast(kMaximumMapSizeTechnical)); TileCoordsXY newMapSize = GetGameState().MapSize; if (_resizeDirection != ResizeDirection::X) diff --git a/src/openrct2-ui/windows/TileInspector.cpp b/src/openrct2-ui/windows/TileInspector.cpp index 569df05ada..cff7c067d2 100644 --- a/src/openrct2-ui/windows/TileInspector.cpp +++ b/src/openrct2-ui/windows/TileInspector.cpp @@ -741,8 +741,7 @@ static uint64_t PageDisabledWidgets[] = { switch (widgetIndex) { case WIDX_SPINNER_X_INCREASE: - windowTileInspectorTile.x = std::min( - windowTileInspectorTile.x + 1, kMaximumMapSizeTechnical - 1); + windowTileInspectorTile.x = std::min(windowTileInspectorTile.x + 1, kMaximumMapSizeTechnical - 1); _toolMap.x = std::min(_toolMap.x + 32, MAXIMUM_TILE_START_XY); LoadTile(nullptr); break; @@ -754,8 +753,7 @@ static uint64_t PageDisabledWidgets[] = { break; case WIDX_SPINNER_Y_INCREASE: - windowTileInspectorTile.y = std::min( - windowTileInspectorTile.y + 1, kMaximumMapSizeTechnical - 1); + windowTileInspectorTile.y = std::min(windowTileInspectorTile.y + 1, kMaximumMapSizeTechnical - 1); _toolMap.y = std::min(_toolMap.y + 32, MAXIMUM_TILE_START_XY); LoadTile(nullptr); break; diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 917337ad7f..06e730e5e1 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -25,8 +25,8 @@ constexpr uint8_t kMaximumWaterHeight = 254; */ constexpr uint8_t kMapBaseZ = 7; -constexpr uint8_t kMinimumMapSizeTechnical = 5 ; -constexpr uint16_t kMaximumMapSizeTechnical = 1001 ; +constexpr uint8_t kMinimumMapSizeTechnical = 5; +constexpr uint16_t kMaximumMapSizeTechnical = 1001; #define MINIMUM_MAP_SIZE_PRACTICAL (kMinimumMapSizeTechnical - 2) #define MAXIMUM_MAP_SIZE_PRACTICAL (kMaximumMapSizeTechnical - 2) constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * kMaximumMapSizeTechnical; From a1fd280a271cdd6ada7890b660a1c0879490724a Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Mon, 25 Mar 2024 17:09:25 +0100 Subject: [PATCH 137/191] Part of #21421: refactor also test --- test/tests/TileElementsView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/tests/TileElementsView.cpp b/test/tests/TileElementsView.cpp index c9924015e9..983ba2bf82 100644 --- a/test/tests/TileElementsView.cpp +++ b/test/tests/TileElementsView.cpp @@ -117,9 +117,9 @@ template bool CompareLists(const CoordsXY& pos) template void CheckMapTiles() { - for (int y = 0; y < MAXIMUM_MAP_SIZE_TECHNICAL; ++y) + for (int y = 0; y < kMaximumMapSizeTechnical; ++y) { - for (int x = 0; x < MAXIMUM_MAP_SIZE_TECHNICAL; ++x) + for (int x = 0; x < kMaximumMapSizeTechnical; ++x) { auto pos = TileCoordsXY(x, y).ToCoordsXY(); From fb4928734361dec5cc643204c7e959c0185a2091 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 26 Mar 2024 00:34:16 +0100 Subject: [PATCH 138/191] Bump network version for object changes --- src/openrct2/network/NetworkBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index a6f6cebc80..4b38f2189c 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -46,7 +46,7 @@ using namespace OpenRCT2; // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "0" +#define NETWORK_STREAM_VERSION "1" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION From be6a4cf5d93640eb94635727d960396e388ea9cc Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Tue, 26 Mar 2024 10:34:56 +0100 Subject: [PATCH 139/191] Part of #21421: make var decl consistent --- src/openrct2/ride/Vehicle.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/ride/Vehicle.h b/src/openrct2/ride/Vehicle.h index a7e8704983..cfb8c660a4 100644 --- a/src/openrct2/ride/Vehicle.h +++ b/src/openrct2/ride/Vehicle.h @@ -516,8 +516,8 @@ enum SOUND_RANGE_NONE = 255 }; -constexpr uint8_t kVehicleSeatPairFlag{ 0x80 }; -constexpr uint8_t kVehicleSeatNumMask{ 0x7F }; +constexpr uint8_t kVehicleSeatPairFlag = 0x80; +constexpr uint8_t kVehicleSeatNumMask = 0x7F; Vehicle* TryGetVehicle(EntityId spriteIndex); void VehicleUpdateAll(); From 2913a0686a18b4136d612f22b65228ef136f1644 Mon Sep 17 00:00:00 2001 From: Stephan Spengler Date: Tue, 26 Mar 2024 12:42:09 +0100 Subject: [PATCH 140/191] Add banner properties to plugin API for large scenery, walls and banners --- distribution/changelog.txt | 1 + distribution/openrct2.d.ts | 22 +++- src/openrct2/scripting/ScriptEngine.h | 2 +- .../bindings/world/ScTileElement.cpp | 113 +++++++++++++++++- .../bindings/world/ScTileElement.hpp | 6 + 5 files changed, 137 insertions(+), 7 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index e541bd8b81..880b7a8b8b 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -1,6 +1,7 @@ 0.4.10 (in development) ------------------------------------------------------------------------ - Feature: [#18171] Add port of the RCT1 Stand-Up Roller Coaster. +- Feature: [#21590] [Plugin] Plugins can now read and write banner properties of tile elements. - Feature: [#21636] Add shortcut key for sorting tile elements. - Feature: [objects#294] Add scenery versions of wooden truss supports. - Feature: [objects#295] Flipped version of wooden post. diff --git a/distribution/openrct2.d.ts b/distribution/openrct2.d.ts index 292151d457..c09138fa6c 100644 --- a/distribution/openrct2.d.ts +++ b/distribution/openrct2.d.ts @@ -1558,10 +1558,14 @@ declare global { direction: Direction; object: number; primaryColour: number; + /** If the element is a banner, this is the text colour. */ secondaryColour: number; tertiaryColour: number; - bannerIndex: number | null; slope: Direction; + /** Writing to bannerIndex is deprecated and may result in uncontrolled behaviour. */ + readonly bannerIndex: number | null; + /** If the element is a banner, this is its text. */ + bannerText: string | null; } interface EntranceElement extends BaseTileElement { @@ -1582,16 +1586,28 @@ declare global { direction: Direction; object: number; primaryColour: number; + /** If the element is a banner, this is the text colour. */ secondaryColour: number; tertiaryColour: number; - bannerIndex: number | null; sequence: number; + /** Writing to bannerIndex is deprecated and may result in uncontrolled behaviour. */ + readonly bannerIndex: number | null; + /** If the element is a banner, this is its text. */ + bannerText: string | null; } interface BannerElement extends BaseTileElement { type: "banner"; + direction: Direction; - bannerIndex: number; + object: number; + primaryColour: number; + /** This is the text colour. */ + secondaryColour: number; + /** Writing to bannerIndex is deprecated and may result in uncontrolled behaviour. */ + readonly bannerIndex: number; + bannerText: string; + isNoEntry: boolean; } /** diff --git a/src/openrct2/scripting/ScriptEngine.h b/src/openrct2/scripting/ScriptEngine.h index ba37b88962..dcc7019303 100644 --- a/src/openrct2/scripting/ScriptEngine.h +++ b/src/openrct2/scripting/ScriptEngine.h @@ -47,7 +47,7 @@ namespace OpenRCT2 namespace OpenRCT2::Scripting { - static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 83; + static constexpr int32_t OPENRCT2_PLUGIN_API_VERSION = 84; // Versions marking breaking changes. static constexpr int32_t API_VERSION_33_PEEP_DEPRECATION = 33; diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.cpp b/src/openrct2/scripting/bindings/world/ScTileElement.cpp index 53c5111eef..2d90305dbf 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.cpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.cpp @@ -1153,6 +1153,12 @@ namespace OpenRCT2::Scripting duk_push_int(ctx, el->GetEntranceType()); break; } + case TileElementType::Banner: + { + auto* el = _element->AsBanner(); + duk_push_int(ctx, el->GetBanner()->type); + break; + } default: { duk_push_null(ctx); @@ -1207,6 +1213,13 @@ namespace OpenRCT2::Scripting Invalidate(); break; } + case TileElementType::Banner: + { + auto* el = _element->AsBanner(); + el->GetBanner()->type = index; + Invalidate(); + break; + } default: break; } @@ -1314,6 +1327,12 @@ namespace OpenRCT2::Scripting duk_push_int(ctx, el->GetPrimaryColour()); break; } + case TileElementType::Banner: + { + auto* el = _element->AsBanner(); + duk_push_int(ctx, el->GetBanner()->colour); + break; + } default: { duk_push_null(ctx); @@ -1348,6 +1367,13 @@ namespace OpenRCT2::Scripting Invalidate(); break; } + case TileElementType::Banner: + { + auto* el = _element->AsBanner(); + el->GetBanner()->colour = value; + Invalidate(); + break; + } default: break; } @@ -1377,6 +1403,12 @@ namespace OpenRCT2::Scripting duk_push_int(ctx, el->GetSecondaryColour()); break; } + case TileElementType::Banner: + { + auto* el = _element->AsBanner(); + duk_push_int(ctx, el->GetBanner()->text_colour); + break; + } default: { duk_push_null(ctx); @@ -1411,6 +1443,13 @@ namespace OpenRCT2::Scripting Invalidate(); break; } + case TileElementType::Banner: + { + auto* el = _element->AsBanner(); + el->GetBanner()->text_colour = value; + Invalidate(); + break; + } default: break; } @@ -2040,13 +2079,75 @@ namespace OpenRCT2::Scripting duk_push_uint(ctx, _element->GetOwner()); return DukValue::take_from_stack(ctx); } - void ScTileElement::owner_set(uint8_t value) { ThrowIfGameStateNotMutable(); _element->SetOwner(value); } + DukValue ScTileElement::bannerText_get() const + { + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto* ctx = scriptEngine.GetContext(); + BannerIndex idx = _element->GetBannerIndex(); + if (idx == BannerIndex::GetNull()) + duk_push_null(ctx); + else + duk_push_string(ctx, GetBanner(idx)->GetText().c_str()); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::bannerText_set(std::string value) + { + ThrowIfGameStateNotMutable(); + BannerIndex idx = _element->GetBannerIndex(); + if (idx != BannerIndex::GetNull()) + { + auto banner = GetBanner(idx); + banner->text = value; + if (_element->GetType() != TileElementType::Banner) + { + if (value.empty()) + banner->ride_index = BannerGetClosestRideIndex({ banner->position.ToCoordsXY(), 16 }); + else + banner->ride_index = RideId::GetNull(); + + if (banner->ride_index.IsNull()) + banner->flags &= ~BANNER_FLAG_LINKED_TO_RIDE; + else + banner->flags |= BANNER_FLAG_LINKED_TO_RIDE; + } + } + } + + DukValue ScTileElement::isNoEntry_get() const + { + auto& scriptEngine = GetContext()->GetScriptEngine(); + auto* ctx = scriptEngine.GetContext(); + auto* el = _element->AsBanner(); + if (el != nullptr) + duk_push_boolean(ctx, (el->GetBanner()->flags & BANNER_FLAG_NO_ENTRY) != 0); + else + duk_push_null(ctx); + return DukValue::take_from_stack(ctx); + } + void ScTileElement::isNoEntry_set(bool value) + { + ThrowIfGameStateNotMutable(); + auto* el = _element->AsBanner(); + if (el != nullptr) + { + if (value) + { + el->GetBanner()->flags |= BANNER_FLAG_NO_ENTRY; + } + else + { + el->GetBanner()->flags &= ~BANNER_FLAG_NO_ENTRY; + } + Invalidate(); + } + } + void ScTileElement::Invalidate() { MapInvalidateTileFull(_coords); @@ -2070,17 +2171,20 @@ namespace OpenRCT2::Scripting // Track | Small Scenery | Wall | Entrance | Large Scenery | Banner dukglue_register_property(ctx, &ScTileElement::direction_get, &ScTileElement::direction_set, "direction"); - // Path | Small Scenery | Wall | Entrance | Large Scenery + // Path | Small Scenery | Wall | Entrance | Large Scenery | Banner dukglue_register_property(ctx, &ScTileElement::object_get, &ScTileElement::object_set, "object"); - // Small Scenery | Wall | Large Scenery + // Small Scenery | Wall | Large Scenery | Banner dukglue_register_property(ctx, &ScTileElement::primaryColour_get, &ScTileElement::primaryColour_set, "primaryColour"); dukglue_register_property( ctx, &ScTileElement::secondaryColour_get, &ScTileElement::secondaryColour_set, "secondaryColour"); + + // Small Scenery | Wall | Large Scenery dukglue_register_property( ctx, &ScTileElement::tertiaryColour_get, &ScTileElement::tertiaryColour_set, "tertiaryColour"); // Wall | Large Scenery | Banner + dukglue_register_property(ctx, &ScTileElement::bannerText_get, &ScTileElement::bannerText_set, "bannerText"); dukglue_register_property(ctx, &ScTileElement::bannerIndex_get, &ScTileElement::bannerIndex_set, "bannerIndex"); // Path | Track | Entrance @@ -2152,6 +2256,9 @@ namespace OpenRCT2::Scripting ctx, &ScTileElement::footpathObject_get, &ScTileElement::footpathObject_set, "footpathObject"); dukglue_register_property( ctx, &ScTileElement::footpathSurfaceObject_get, &ScTileElement::footpathSurfaceObject_set, "footpathSurfaceObject"); + + // Banner only + dukglue_register_property(ctx, &ScTileElement::isNoEntry_get, &ScTileElement::isNoEntry_set, "isNoEntry"); } } // namespace OpenRCT2::Scripting diff --git a/src/openrct2/scripting/bindings/world/ScTileElement.hpp b/src/openrct2/scripting/bindings/world/ScTileElement.hpp index 4c0ad05c03..31499a24d4 100644 --- a/src/openrct2/scripting/bindings/world/ScTileElement.hpp +++ b/src/openrct2/scripting/bindings/world/ScTileElement.hpp @@ -205,6 +205,12 @@ namespace OpenRCT2::Scripting DukValue owner_get() const; void owner_set(uint8_t value); + DukValue bannerText_get() const; + void bannerText_set(std::string value); + + DukValue isNoEntry_get() const; + void isNoEntry_set(bool value); + void Invalidate(); public: From 43507671b5727826f6d9ef9467debea5ad20885c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 26 Mar 2024 12:46:34 +0100 Subject: [PATCH 141/191] Fix crash on null ride in Guest::UpdateRideLeaveExit (#21668) --- distribution/changelog.txt | 1 + src/openrct2/entity/Guest.cpp | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 880b7a8b8b..36f979021c 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -23,6 +23,7 @@ - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. - Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. +- Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit. - Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. - Fix: [objects#296] Incorrect wall placement around large Kremlin/drab pieces. - Fix: [objects#300] Incorrect Colosseum and volcano corner clearances. diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index b7d7cc9be2..8d11e2534c 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -5025,17 +5025,20 @@ void Guest::UpdateRideLeaveExit() return; } - OnExitRide(*ride); - - if (ride != nullptr && (PeepFlags & PEEP_FLAGS_TRACKING)) + if (ride != nullptr) { - auto ft = Formatter(); - FormatNameTo(ft); - ride->FormatNameTo(ft); + OnExitRide(*ride); - if (gConfigNotifications.GuestLeftRide) + if (PeepFlags & PEEP_FLAGS_TRACKING) { - News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, Id, ft); + auto ft = Formatter(); + FormatNameTo(ft); + ride->FormatNameTo(ft); + + if (gConfigNotifications.GuestLeftRide) + { + News::AddItemToQueue(News::ItemType::PeepOnRide, STR_PEEP_TRACKING_LEFT_RIDE_X, Id, ft); + } } } From 7c65a372aadea38c16b2396a80a378d8830c35d0 Mon Sep 17 00:00:00 2001 From: reversebottle Date: Tue, 26 Mar 2024 08:24:25 -0400 Subject: [PATCH 142/191] Add kParkRatingHistorySize constant --- src/openrct2-ui/windows/Park.cpp | 2 +- src/openrct2/GameState.h | 3 ++- src/openrct2/rct1/RCT1.h | 3 ++- src/openrct2/rct2/RCT2.h | 3 ++- src/openrct2/world/Park.h | 1 + 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/openrct2-ui/windows/Park.cpp b/src/openrct2-ui/windows/Park.cpp index 99e23e55e0..02310b3c7a 100644 --- a/src/openrct2-ui/windows/Park.cpp +++ b/src/openrct2-ui/windows/Park.cpp @@ -731,7 +731,7 @@ static constexpr WindowParkAward _parkAwards[] = { // Graph screenPos = windowPos + ScreenCoordsXY{ widget->left + 47, widget->top + 26 }; - Graph::Draw(dpi, GetGameState().ParkRatingHistory, 32, screenPos); + Graph::Draw(dpi, GetGameState().ParkRatingHistory, kParkRatingHistorySize, screenPos); } #pragma endregion diff --git a/src/openrct2/GameState.h b/src/openrct2/GameState.h index 7bf8f1ddea..3a6538e627 100644 --- a/src/openrct2/GameState.h +++ b/src/openrct2/GameState.h @@ -24,6 +24,7 @@ #include "world/Banner.h" #include "world/Climate.h" #include "world/Location.hpp" +#include "world/Park.h" #include #include @@ -52,7 +53,7 @@ namespace OpenRCT2 money64 ConstructionRightsPrice; money64 CurrentExpenditure; money64 CurrentProfit; - uint8_t ParkRatingHistory[32]; + uint8_t ParkRatingHistory[kParkRatingHistorySize]; uint32_t GuestsInParkHistory[32]; ClimateType Climate; ClimateState ClimateCurrent; diff --git a/src/openrct2/rct1/RCT1.h b/src/openrct2/rct1/RCT1.h index 88a43c6fdd..7ba5978708 100644 --- a/src/openrct2/rct1/RCT1.h +++ b/src/openrct2/rct1/RCT1.h @@ -11,6 +11,7 @@ #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" +#include "../world/Park.h" #include "Limits.h" namespace RCT1 @@ -772,7 +773,7 @@ namespace RCT1 uint16_t AvailableBanners; uint8_t Unk1990AA[94]; uint16_t ParkRating; - uint8_t ParkRatingHistory[32]; + uint8_t ParkRatingHistory[kParkRatingHistorySize]; uint8_t GuestsInParkHistory[32]; uint8_t ResearchPriority; uint8_t ResearchProgressStage; diff --git a/src/openrct2/rct2/RCT2.h b/src/openrct2/rct2/RCT2.h index 61ea286cd9..16ddbbe13d 100644 --- a/src/openrct2/rct2/RCT2.h +++ b/src/openrct2/rct2/RCT2.h @@ -13,6 +13,7 @@ #include "../core/FileSystem.hpp" #include "../rct12/RCT12.h" #include "../ride/RideRatings.h" +#include "../world/Park.h" #include "Limits.h" #include @@ -889,7 +890,7 @@ namespace RCT2 uint16_t ParkRating; // Ignored in scenario - uint8_t ParkRatingHistory[32]; + uint8_t ParkRatingHistory[kParkRatingHistorySize]; uint8_t GuestsInParkHistory[32]; // SC6[10] diff --git a/src/openrct2/world/Park.h b/src/openrct2/world/Park.h index ce5a53d8be..b11488dfa7 100644 --- a/src/openrct2/world/Park.h +++ b/src/openrct2/world/Park.h @@ -16,6 +16,7 @@ constexpr auto MAX_ENTRANCE_FEE = 999.00_GBP; constexpr uint8_t ParkRatingHistoryUndefined = std::numeric_limits::max(); constexpr uint32_t GuestsInParkHistoryUndefined = std::numeric_limits::max(); +constexpr uint8_t kParkRatingHistorySize = 32; constexpr uint8_t ParkNameMaxLength = 128; constexpr uint8_t ScenarioNameMaxLength = 128; constexpr uint16_t ScenarioDetailsNameMaxLength = 256; From bf20a6d14674f193a2c18ba2f35b1e5d15392d96 Mon Sep 17 00:00:00 2001 From: Harry Hopkinson <63599884+Harry-Hopkinson@users.noreply.github.com> Date: Tue, 26 Mar 2024 12:53:32 +0000 Subject: [PATCH 143/191] Fix #21317: Track designer allows proceeding without an object selected Co-authored-by: Gymnasiast --- distribution/changelog.txt | 2 + .../windows/EditorBottomToolbar.cpp | 23 +----------- .../windows/EditorObjectSelection.cpp | 37 ++++++++++++++++++- src/openrct2-ui/windows/Window.h | 1 + 4 files changed, 40 insertions(+), 23 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 36f979021c..eb7820597f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -18,6 +18,8 @@ - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#18413] Crash when mouse over a hacked train. - Fix: [#20338] Cannot select Scenery Picker or Scatter Tool when the scenery recolouring tool is active. +- Fix: [#21317] Track designer allows proceeding without an object selected. +- Fix: [#21360] If the object selection is missing certain types, the Object Selection window will switch to an incorrect tab. - Fix: [#21419] Cannot place walls underground beneath sloped tiles with clearance checks disabled. - Fix: [#21434] Number of guests overflows in objective text. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. diff --git a/src/openrct2-ui/windows/EditorBottomToolbar.cpp b/src/openrct2-ui/windows/EditorBottomToolbar.cpp index 4e8308eddb..b8b3adb368 100644 --- a/src/openrct2-ui/windows/EditorBottomToolbar.cpp +++ b/src/openrct2-ui/windows/EditorBottomToolbar.cpp @@ -186,30 +186,9 @@ static Widget _editorBottomToolbarWidgets[] = { GfxInvalidateScreen(); } - bool CheckObjectSelection() const - { - WindowBase* w; - - auto [missingObjectType, errorString] = Editor::CheckObjectSelection(); - if (missingObjectType == ObjectType::None) - { - WindowCloseByClass(WindowClass::EditorObjectSelection); - return true; - } - - ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); - w = WindowFindByClass(WindowClass::EditorObjectSelection); - if (w != nullptr) - { - // Click tab with missing object - w->OnMouseUp(WC_EDITOR_OBJECT_SELECTION__WIDX_TAB_1 + EnumValue(missingObjectType)); - } - return false; - } - void JumpForwardFromObjectSelection() const { - if (!CheckObjectSelection()) + if (!EditorObjectSelectionWindowCheck()) return; FinishObjectSelection(); diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index d460443d17..35df6ed24b 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -357,7 +357,9 @@ static std::vector _window_editor_object_selection_widgets = { switch (widgetIndex) { case WIDX_CLOSE: - WindowClose(*this); + if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !EditorObjectSelectionWindowCheck()) + return; + if (gScreenFlags & SCREEN_FLAGS_EDITOR) { FinishObjectSelection(); @@ -1108,6 +1110,18 @@ static std::vector _window_editor_object_selection_widgets = { DrawDebugData(dpi); } + void GoToTab(ObjectType objectType) + { + for (size_t offset = 0; offset < std::size(TabOrder); offset++) + { + if (TabOrder[offset] == objectType) + { + SetPage(offset); + return; + } + } + } + private: void InitWidgets() { @@ -1660,4 +1674,25 @@ static std::vector _window_editor_object_selection_widgets = { if (showFallbackWarning) ContextShowError(STR_OBJECT_SELECTION_FALLBACK_IMAGES_WARNING, STR_EMPTY, Formatter::Common()); } + + bool EditorObjectSelectionWindowCheck() + { + WindowBase* w; + + auto [missingObjectType, errorString] = Editor::CheckObjectSelection(); + if (missingObjectType == ObjectType::None) + { + WindowCloseByClass(WindowClass::EditorObjectSelection); + return true; + } + + ContextShowError(STR_INVALID_SELECTION_OF_OBJECTS, errorString, {}); + w = WindowFindByClass(WindowClass::EditorObjectSelection); + if (w != nullptr) + { + // Click tab with missing object + static_cast(w)->GoToTab(missingObjectType); + } + return false; + } } // namespace OpenRCT2::Ui::Windows diff --git a/src/openrct2-ui/windows/Window.h b/src/openrct2-ui/windows/Window.h index c750d60d1d..2219833e1f 100644 --- a/src/openrct2-ui/windows/Window.h +++ b/src/openrct2-ui/windows/Window.h @@ -207,6 +207,7 @@ namespace OpenRCT2::Ui::Windows void WindowTileInspectorClearClipboard(); WindowBase* EditorObjectSelectionOpen(); + bool EditorObjectSelectionWindowCheck(); void WindowTooltipReset(const ScreenCoordsXY& screenCoords); void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoords); From 03b0c1e884dec69392062a04cf2f9f226a23ae00 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 26 Mar 2024 16:28:51 +0100 Subject: [PATCH 144/191] Fix compilation error on 64-bit MSVC builds (#21677) --- src/openrct2-ui/windows/EditorObjectSelection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 35df6ed24b..32a2b797d2 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1116,7 +1116,7 @@ static std::vector _window_editor_object_selection_widgets = { { if (TabOrder[offset] == objectType) { - SetPage(offset); + SetPage(static_cast(offset)); return; } } From 8e563edcbeff1974d8febd0554ac63f5b33d06a1 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Wed, 27 Mar 2024 18:40:07 +0100 Subject: [PATCH 145/191] Fix #21673: Incorrect tunnels on Classic Stand-Up --- src/openrct2/paint/support/MetalSupports.cpp | 6 +++--- src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index 08f266f67e..8e511f3760 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -192,10 +192,10 @@ static constexpr MetalSupportPlace kMetalSupportPlacementRotated[][NumOrthogonal MetalSupportPlace::BottomLeftSide }, { MetalSupportPlace::TopRightSide, MetalSupportPlace::BottomRightSide, MetalSupportPlace::BottomLeftSide, MetalSupportPlace::TopLeftSide }, - { MetalSupportPlace::BottomLeftSide, MetalSupportPlace::BottomLeftSide, MetalSupportPlace::TopLeftSide, - MetalSupportPlace::TopRightSide }, - { MetalSupportPlace::BottomRightSide, MetalSupportPlace::TopLeftSide, MetalSupportPlace::TopRightSide, + { MetalSupportPlace::BottomLeftSide, MetalSupportPlace::TopLeftSide, MetalSupportPlace::TopRightSide, MetalSupportPlace::BottomRightSide }, + { MetalSupportPlace::BottomRightSide, MetalSupportPlace::BottomLeftSide, MetalSupportPlace::TopLeftSide, + MetalSupportPlace::TopRightSide }, }; /** diff --git a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp index f4a210e123..46ab987077 100644 --- a/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/ClassicStandUpRollerCoaster.cpp @@ -374,7 +374,7 @@ static void classicStandUpRCTrackBankedRightQuarterTurn5( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction == 1 || direction == 0) { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction ^ 1, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( session, @@ -1028,7 +1028,7 @@ static void classicStandUpRCTrackRightBankedQuarterTurn3( session, MetalSupportType::Tubes, MetalSupportPlace::Centre, 0, height, session.SupportColours); if (direction == 0 || direction == 1) { - PaintUtilPushTunnelRotated(session, direction, height, TUNNEL_0); + PaintUtilPushTunnelRotated(session, direction ^ 1, height, TUNNEL_0); } PaintUtilSetSegmentSupportHeight( session, From 98c3c8b22c250ef80ec04f9807d5ad2e0bbf8147 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 27 Mar 2024 20:39:16 +0100 Subject: [PATCH 146/191] Add missing header to ObjectEntryManager.h --- src/openrct2/object/ObjectEntryManager.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/openrct2/object/ObjectEntryManager.h b/src/openrct2/object/ObjectEntryManager.h index 84b170e00d..de8a1a143d 100644 --- a/src/openrct2/object/ObjectEntryManager.h +++ b/src/openrct2/object/ObjectEntryManager.h @@ -1,3 +1,14 @@ +/***************************************************************************** + * Copyright (c) 2014-2024 OpenRCT2 developers + * + * For a complete list of all authors, please refer to contributors.md + * Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2 + * + * OpenRCT2 is licensed under the GNU General Public License version 3. + *****************************************************************************/ + +#pragma once + #include "ObjectTypes.h" namespace OpenRCT2::ObjectManager From e1735645006bfe57d1955b954bedb5cb18eeef82 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Wed, 27 Mar 2024 20:39:37 +0100 Subject: [PATCH 147/191] Add missing pragma once to TileElementsView.h --- src/openrct2/world/TileElementsView.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/openrct2/world/TileElementsView.h b/src/openrct2/world/TileElementsView.h index c4912b8564..a8bef7a87a 100644 --- a/src/openrct2/world/TileElementsView.h +++ b/src/openrct2/world/TileElementsView.h @@ -7,6 +7,8 @@ * OpenRCT2 is licensed under the GNU General Public License version 3. *****************************************************************************/ +#pragma once + #include "Location.hpp" #include "Map.h" #include "TileElement.h" From 854d4e6fa483b5733786863a4223b21c1ebc131f Mon Sep 17 00:00:00 2001 From: reversebottle Date: Wed, 27 Mar 2024 19:12:55 -0400 Subject: [PATCH 148/191] Fix #21652: set correct color on save overwrite first open (#21666) --- distribution/changelog.txt | 1 + src/openrct2-ui/windows/LoadSave.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index eb7820597f..ca39beee3f 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -25,6 +25,7 @@ - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. - Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. +- Fix: [#21652] Dialog window to confirm overwriting files does not apply the theme colours correctly. - Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit. - Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. - Fix: [objects#296] Incorrect wall placement around large Kremlin/drab pieces. diff --git a/src/openrct2-ui/windows/LoadSave.cpp b/src/openrct2-ui/windows/LoadSave.cpp index 81bb0eadef..dd5f9dd067 100644 --- a/src/openrct2-ui/windows/LoadSave.cpp +++ b/src/openrct2-ui/windows/LoadSave.cpp @@ -1116,7 +1116,6 @@ static Widget window_loadsave_widgets[] = void OnOpen() override { widgets = window_overwrite_prompt_widgets; - colours[0] = TRANSLUCENT(COLOUR_BORDEAUX_RED); } void OnMouseUp(WidgetIndex widgetIndex) override From afb4dcf728bf3a78eaefb06d6375bbe1e767071e Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 28 Mar 2024 00:34:01 +0100 Subject: [PATCH 149/191] Drop Ubuntu Focal v20.04 from the CI roster --- .github/workflows/ci.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b639e83628..e050fb0f54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -302,11 +302,6 @@ jobs: matrix: include: # Use `-fno-var-tracking-assignments` to reduce amount of produced debug information. This is necessary due to 100MiB limit of GitHub / openrct2.org API. - # For focal the debug information still takes too much space, so reduce amount of debug info to minimum using `-g1` (`-g` means `-g2`), which is enough for backtraces only. - - platform: x86_64 - distro: focal - image: openrct2/openrct2-build:14-focal - build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g1 -gz" -DWITH_TESTS=off - platform: x86_64 distro: jammy image: openrct2/openrct2-build:14-jammy @@ -316,9 +311,9 @@ jobs: image: openrct2/openrct2-build:14-bullseye build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz -fno-var-tracking-assignments" -DWITH_TESTS=off - platform: i686 - distro: focal - image: openrct2/openrct2-build:14-focal32 - build_flags: -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -g1 -gz" -DWITH_TESTS=off + distro: jammy + image: openrct2/openrct2-build:14-jammy32 + build_flags: -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -g -gz" -DWITH_TESTS=off steps: - name: Checkout uses: actions/checkout@v4 @@ -356,7 +351,7 @@ jobs: name: Linux (x86_64, AppImage) runs-on: ubuntu-latest needs: check-code-formatting - container: openrct2/openrct2-build:14-focal + container: openrct2/openrct2-build:14-jammy steps: - name: Checkout uses: actions/checkout@v4 From abc02511e11d5644022058154bcd58651038e92e Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 28 Mar 2024 00:37:32 +0100 Subject: [PATCH 150/191] Show distro vendor in CI roster --- .github/workflows/ci.yml | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e050fb0f54..73c25c02e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -293,7 +293,7 @@ jobs: echo 'Not going to push build' fi linux-portable: - name: Linux (${{ matrix.platform }}, ${{ matrix.distro }}, portable) + name: ${{ matrix.distro }} Linux (${{ matrix.release }}, ${{ matrix.platform }}, portable) runs-on: ubuntu-latest needs: check-code-formatting container: ${{ matrix.image }} @@ -303,15 +303,18 @@ jobs: include: # Use `-fno-var-tracking-assignments` to reduce amount of produced debug information. This is necessary due to 100MiB limit of GitHub / openrct2.org API. - platform: x86_64 - distro: jammy + distro: Ubuntu + release: jammy image: openrct2/openrct2-build:14-jammy build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz -fno-var-tracking-assignments" - platform: x86_64 - distro: bullseye + distro: Debian + release: bullseye image: openrct2/openrct2-build:14-bullseye build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz -fno-var-tracking-assignments" -DWITH_TESTS=off - platform: i686 - distro: jammy + distro: Ubuntu + release: jammy image: openrct2/openrct2-build:14-jammy32 build_flags: -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -g -gz" -DWITH_TESTS=off steps: @@ -348,7 +351,7 @@ jobs: echo 'Not going to push build' fi linux-appimage: - name: Linux (x86_64, AppImage) + name: Ubuntu Linux (AppImage, x86_64) runs-on: ubuntu-latest needs: check-code-formatting container: openrct2/openrct2-build:14-jammy @@ -381,7 +384,7 @@ jobs: echo 'Not going to push build' fi linux-docker: - name: Linux (docker) + name: Ubuntu Linux (Docker) needs: check-code-formatting if: github.repository == 'OpenRCT2/OpenRCT2' runs-on: ubuntu-latest @@ -406,7 +409,7 @@ jobs: echo 'Image not pushed' fi linux-clang: - name: Linux (Debug, [http, network, flac, vorbis OpenGL] disabled) using clang + name: Ubuntu Linux (jammy, debug, [http, network, flac, vorbis OpenGL] disabled) using clang runs-on: ubuntu-latest needs: check-code-formatting container: openrct2/openrct2-build:14-jammy @@ -422,7 +425,7 @@ jobs: - name: Build OpenRCT2 run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_NETWORK=ON -DDISABLE_HTTP=ON -DDISABLE_FLAC=ON -DDISABLE_VORBIS=ON -DDISABLE_OPENGL=ON linux-clang-tests: - name: Linux (Debug) using clang, coverage enabled + name: Ubuntu Linux (debug) using clang, coverage enabled runs-on: ubuntu-latest needs: check-code-formatting container: openrct2/openrct2-build:14-jammy From 66ca0388ed3e87ea30c41279aabcae4ecc169e4c Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 28 Mar 2024 00:10:33 +0100 Subject: [PATCH 151/191] Move Android build fully to C++20 as well --- src/openrct2-android/app/src/main/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index bac4e35970..afaf4dabcc 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -209,9 +209,12 @@ set(COMMON_COMPILE_OPTIONS "${COMMON_COMPILE_OPTIONS} -fPIC") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--undefined=Java_org_libsdl_app_SDLActivity_nativeInit") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++1z ${COMMON_COMPILE_OPTIONS} -Wnon-virtual-dtor") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++20 ${COMMON_COMPILE_OPTIONS} -Wnon-virtual-dtor") get_filename_component(ORCT2_ROOT "${CMAKE_SOURCE_DIR}/../../../../../" REALPATH) +# Enable char8_t<->char conversion :( +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-char8_t -Wno-deprecated-declarations") + list(APPEND CMAKE_MODULE_PATH "${ORCT2_ROOT}/cmake") find_package(CCache) From db18c712fef7f26fd468ec59bd5774fd2d0c986c Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Thu, 28 Mar 2024 14:04:54 +0100 Subject: [PATCH 152/191] Remove frowny faces regarding char8_t<->char conversion --- CMakeLists.txt | 4 ++-- src/openrct2-android/app/src/main/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb3af2fe45..b42e9a313b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -277,7 +277,7 @@ if (MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4244") # C4244: 'conversion_type': conversion from 'type1' to 'type2', possible loss of data set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4068") # C4068: unknown pragma - # Enable char8_t<->char conversion :( + # Enable char8_t<->char conversion set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zc:char8_t-") add_definitions(-D_CRT_SECURE_NO_WARNINGS) @@ -334,7 +334,7 @@ else () set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unknown-pragmas -Wno-missing-braces -Wno-comment -Wnonnull -Wno-unused-parameter -Wno-attributes") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG=${DEBUG_LEVEL}") - # Enable char8_t<->char conversion :( + # Enable char8_t<->char conversion set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-char8_t -Wno-deprecated-declarations") if(APPLE) diff --git a/src/openrct2-android/app/src/main/CMakeLists.txt b/src/openrct2-android/app/src/main/CMakeLists.txt index afaf4dabcc..4e3dfb59db 100644 --- a/src/openrct2-android/app/src/main/CMakeLists.txt +++ b/src/openrct2-android/app/src/main/CMakeLists.txt @@ -212,7 +212,7 @@ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++20 ${COMMON_COMPILE_OPTIONS} -Wnon-virtual-dtor") get_filename_component(ORCT2_ROOT "${CMAKE_SOURCE_DIR}/../../../../../" REALPATH) -# Enable char8_t<->char conversion :( +# Enable char8_t<->char conversion set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-char8_t -Wno-deprecated-declarations") list(APPEND CMAKE_MODULE_PATH "${ORCT2_ROOT}/cmake") From d48b75fb86445bfb171eda46b4ae70b34ebffdfa Mon Sep 17 00:00:00 2001 From: mrmbernardi Date: Thu, 28 Mar 2024 23:28:54 +0100 Subject: [PATCH 153/191] Refactor TTF drawing (#21621) --- .../engines/opengl/OpenGLDrawingEngine.cpp | 29 ++-- src/openrct2/drawing/Drawing.String.cpp | 133 ++---------------- src/openrct2/drawing/IDrawingContext.h | 5 +- src/openrct2/drawing/ScrollingText.cpp | 5 +- src/openrct2/drawing/TTF.cpp | 9 -- src/openrct2/drawing/TTF.h | 3 +- src/openrct2/drawing/TTFSDLPort.cpp | 15 +- src/openrct2/drawing/X8DrawingEngine.cpp | 99 ++++++++++++- src/openrct2/drawing/X8DrawingEngine.h | 7 +- 9 files changed, 139 insertions(+), 166 deletions(-) diff --git a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp index 81ef8d588f..a06afd3ef2 100644 --- a/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/opengl/OpenGLDrawingEngine.cpp @@ -37,7 +37,6 @@ # include # include # include -# include using namespace OpenRCT2; using namespace OpenRCT2::Drawing; @@ -74,6 +73,8 @@ private: int32_t _drawCount = 0; + uint32_t _ttfGlId = 0; + struct { LineCommandBatch lines; @@ -110,8 +111,7 @@ public: void DrawSpriteSolid(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, uint8_t colour) override; void DrawGlyph(DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) override; void DrawTTFBitmap( - DrawPixelInfo& dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, - int32_t y, uint8_t hinting_threshold) override; + DrawPixelInfo& dpi, TextDrawInfo* info, TTFSurface* surface, int32_t x, int32_t y, uint8_t hintingThreshold) override; void FlushCommandBuffers(); @@ -908,17 +908,25 @@ void OpenGLDrawingContext::DrawGlyph(DrawPixelInfo& dpi, const ImageId image, in } void OpenGLDrawingContext::DrawTTFBitmap( - DrawPixelInfo& dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, int32_t x, - int32_t y, uint8_t hinting_threshold) + DrawPixelInfo& dpi, TextDrawInfo* info, TTFSurface* surface, int32_t x, int32_t y, uint8_t hintingThreshold) { +# ifndef NO_TTF CalculcateClipping(dpi); - const auto texture = _textureCache->GetOrLoadBitmapTexture(image, pixels, width, height); + auto baseId = uint32_t(0x7FFFF) - 1024; + auto imageId = baseId + _ttfGlId; + _engine.InvalidateImage(imageId); + const auto texture = _textureCache->GetOrLoadBitmapTexture(imageId, surface->pixels, surface->w, surface->h); + _ttfGlId++; + if (_ttfGlId >= 1023) + { + _ttfGlId = 0; + } int32_t drawOffsetX = 0; int32_t drawOffsetY = 0; - int32_t drawWidth = static_cast(width); - int32_t drawHeight = static_cast(height); + int32_t drawWidth = static_cast(surface->w); + int32_t drawHeight = static_cast(surface->h); int32_t left = x + drawOffsetX; int32_t top = y + drawOffsetY; @@ -976,7 +984,7 @@ void OpenGLDrawingContext::DrawTTFBitmap( command.bounds = { left + 1, top + 1, right + 1, bottom + 1 }; command.depth = _drawCount++; } - auto& cmdBuf = hinting_threshold > 0 ? _commandBuffers.transparent : _commandBuffers.rects; + auto& cmdBuf = hintingThreshold > 0 ? _commandBuffers.transparent : _commandBuffers.rects; DrawRectCommand& command = cmdBuf.allocate(); command.clip = { _clipLeft, _clipTop, _clipRight, _clipBottom }; command.texColourAtlas = texture.index; @@ -984,10 +992,11 @@ void OpenGLDrawingContext::DrawTTFBitmap( command.texMaskAtlas = 0; command.texMaskBounds = { 0.0f, 0.0f, 0.0f, 0.0f }; command.palettes = { 0, 0, 0 }; - command.flags = DrawRectCommand::FLAG_TTF_TEXT | (hinting_threshold << 8); + command.flags = DrawRectCommand::FLAG_TTF_TEXT | (hintingThreshold << 8); command.colour = info->palette[1]; command.bounds = { left, top, right, bottom }; command.depth = _drawCount++; +# endif // NO_TTF } void OpenGLDrawingContext::FlushCommandBuffers() diff --git a/src/openrct2/drawing/Drawing.String.cpp b/src/openrct2/drawing/Drawing.String.cpp index 8d6ac1fd11..e8c484da69 100644 --- a/src/openrct2/drawing/Drawing.String.cpp +++ b/src/openrct2/drawing/Drawing.String.cpp @@ -21,7 +21,6 @@ #include "../localisation/LocalisationService.h" #include "../platform/Platform.h" #include "../sprites.h" -#include "../util/Util.h" #include "TTF.h" #include @@ -509,7 +508,6 @@ static void TTFDrawStringRawSprite(DrawPixelInfo& dpi, std::string_view text, Te #ifndef NO_TTF -static int _ttfGlId = 0; static void TTFDrawStringRawTTF(DrawPixelInfo& dpi, std::string_view text, TextDrawInfo* info) { if (!TTFInitialise()) @@ -528,135 +526,20 @@ static void TTFDrawStringRawTTF(DrawPixelInfo& dpi, std::string_view text, TextD return; } - uint8_t colour = info->palette[1]; TTFSurface* surface = TTFSurfaceCacheGetOrAdd(fontDesc->font, text); if (surface == nullptr) return; - int32_t drawX = info->x + fontDesc->offset_x; - int32_t drawY = info->y + fontDesc->offset_y; - int32_t width = surface->w; - int32_t height = surface->h; - bool use_hinting = gConfigFonts.EnableHinting && fontDesc->hinting_threshold > 0; - - if (OpenRCT2::GetContext()->GetDrawingEngineType() == DrawingEngine::OpenGL) + auto drawingEngine = dpi.DrawingEngine; + if (drawingEngine != nullptr) { - auto baseId = uint32_t(0x7FFFF) - 1024; - auto imageId = baseId + _ttfGlId; - auto drawingEngine = dpi.DrawingEngine; - auto drawingContext = drawingEngine->GetDrawingContext(); - uint8_t hint_thresh = use_hinting ? fontDesc->hinting_threshold : 0; - drawingEngine->InvalidateImage(imageId); - drawingContext->DrawTTFBitmap( - dpi, info, imageId, surface->pixels, surface->pitch, surface->h, drawX, drawY, hint_thresh); - - _ttfGlId++; - if (_ttfGlId >= 1023) - { - _ttfGlId = 0; - } - info->x += width; - return; - } - - int32_t overflowX = (dpi.x + dpi.width) - (drawX + width); - int32_t overflowY = (dpi.y + dpi.height) - (drawY + height); - if (overflowX < 0) - width += overflowX; - if (overflowY < 0) - height += overflowY; - int32_t skipX = drawX - dpi.x; - int32_t skipY = drawY - dpi.y; - info->x += width; - - auto src = static_cast(surface->pixels); - uint8_t* dst = dpi.bits; - - int32_t srcXStart = 0; - int32_t srcYStart = 0; - if (skipX < 0) - { - width += skipX; - src += -skipX; - srcXStart += -skipX; - skipX = 0; - } - if (skipY < 0) - { - height += skipY; - src += (-skipY * surface->pitch); - srcYStart += -skipY; - skipY = 0; - } - - dst += skipX; - dst += skipY * (dpi.width + dpi.pitch); - - int32_t srcScanSkip = surface->pitch - width; - int32_t dstScanSkip = dpi.width + dpi.pitch - width; - uint8_t* dst_orig = dst; - - // Draw shadow/outline - if (info->flags & (TEXT_DRAW_FLAG_OUTLINE | TEXT_DRAW_FLAG_INSET)) - { - for (int32_t yy = 0; yy < height; yy++) - { - for (int32_t xx = 0; xx < width; xx++) - { - if (info->flags & TEXT_DRAW_FLAG_OUTLINE) - { - if (GetPixel(*surface, xx + srcXStart + 1, yy + srcYStart) - || GetPixel(*surface, xx + srcXStart - 1, yy + srcYStart) - || GetPixel(*surface, xx + srcXStart, yy + srcYStart + 1) - || GetPixel(*surface, xx + srcXStart, yy + srcYStart - 1)) - { - *dst = info->palette[3]; - } - } - if (info->flags & TEXT_DRAW_FLAG_INSET) - { - if (GetPixel(*surface, xx + srcXStart - 1, yy + srcYStart - 1)) - { - *dst = info->palette[3]; - } - } - dst++; - } - // Skip any remaining bits - dst += dstScanSkip; - } - } - dst = dst_orig; - for (int32_t yy = 0; yy < height; yy++) - { - for (int32_t xx = 0; xx < width; xx++) - { - if (*src != 0) - { - if (*src > 180 || !use_hinting) - { - // Centre of the glyph: use full colour. - *dst = colour; - } - else if (use_hinting && *src > fontDesc->hinting_threshold) - { - // Simulate font hinting by shading the background colour instead. - if (info->flags & TEXT_DRAW_FLAG_OUTLINE) - { - *dst = BlendColours(colour, info->palette[3]); - } - else - { - *dst = BlendColours(colour, *dst); - } - } - } - src++; - dst++; - } - src += srcScanSkip; - dst += dstScanSkip; + int32_t drawX = info->x + fontDesc->offset_x; + int32_t drawY = info->y + fontDesc->offset_y; + uint8_t hintThresh = gConfigFonts.EnableHinting ? fontDesc->hinting_threshold : 0; + OpenRCT2::Drawing::IDrawingContext* dc = drawingEngine->GetDrawingContext(); + dc->DrawTTFBitmap(dpi, info, surface, drawX, drawY, hintThresh); } + info->x += surface->w; } #endif // NO_TTF diff --git a/src/openrct2/drawing/IDrawingContext.h b/src/openrct2/drawing/IDrawingContext.h index 9bff8c72fb..6ea2938bac 100644 --- a/src/openrct2/drawing/IDrawingContext.h +++ b/src/openrct2/drawing/IDrawingContext.h @@ -11,6 +11,7 @@ #include "../common.h" #include "Drawing.h" +#include "TTF.h" namespace OpenRCT2::Drawing { @@ -33,8 +34,8 @@ namespace OpenRCT2::Drawing virtual void DrawGlyph( DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& palette) abstract; virtual void DrawTTFBitmap( - DrawPixelInfo& dpi, TextDrawInfo* info, ImageIndex image, const void* pixels, int32_t width, int32_t height, - int32_t x, int32_t y, uint8_t hinting_threshold) abstract; + DrawPixelInfo& dpi, TextDrawInfo* info, TTFSurface* surface, int32_t x, int32_t y, + uint8_t hintingThreshold) abstract; }; } // namespace OpenRCT2::Drawing diff --git a/src/openrct2/drawing/ScrollingText.cpp b/src/openrct2/drawing/ScrollingText.cpp index 4a1f76791b..a6d3604630 100644 --- a/src/openrct2/drawing/ScrollingText.cpp +++ b/src/openrct2/drawing/ScrollingText.cpp @@ -1577,12 +1577,11 @@ static void ScrollingTextSetBitmapForTTF( return; } - int32_t pitch = surface->pitch; int32_t width = surface->w; auto src = static_cast(surface->pixels); // Pitch offset - src += 2 * pitch; + src += 2 * width; // Line height offset int32_t min_vpos = -fontDesc->offset_y; @@ -1608,7 +1607,7 @@ static void ScrollingTextSetBitmapForTTF( for (int32_t y = min_vpos; y < max_vpos; y++) { - uint8_t src_pixel = src[y * pitch + x]; + uint8_t src_pixel = src[y * width + x]; if ((!use_hinting && src_pixel != 0) || src_pixel > 140) { // Centre of the glyph: use full colour. diff --git a/src/openrct2/drawing/TTF.cpp b/src/openrct2/drawing/TTF.cpp index 7c48db277a..ce61a0a273 100644 --- a/src/openrct2/drawing/TTF.cpp +++ b/src/openrct2/drawing/TTF.cpp @@ -9,7 +9,6 @@ #ifndef NO_TTF -# include # include # pragma clang diagnostic push # pragma clang diagnostic ignored "-Wdocumentation" @@ -21,7 +20,6 @@ # include "../config/Config.h" # include "../core/Numerics.hpp" # include "../core/String.hpp" -# include "../localisation/Localisation.h" # include "../localisation/LocalisationService.h" # include "../platform/Platform.h" # include "TTF.h" @@ -374,13 +372,6 @@ void TTFFreeSurface(TTFSurface* surface) free(surface); } -uint8_t GetPixel(const TTFSurface& surface, int32_t x, int32_t y) -{ - if (x < 0 || y < 0 || x >= surface.w || y >= surface.h) - return 0; - return static_cast(surface.pixels)[y * surface.pitch + x]; -} - #else # include "TTF.h" diff --git a/src/openrct2/drawing/TTF.h b/src/openrct2/drawing/TTF.h index 273fb48f90..8c9cdce7e1 100644 --- a/src/openrct2/drawing/TTF.h +++ b/src/openrct2/drawing/TTF.h @@ -15,6 +15,7 @@ bool TTFInitialise(); void TTFDispose(); +struct TTFSurface; #ifndef NO_TTF @@ -23,7 +24,6 @@ struct TTFSurface const void* pixels; int32_t w; int32_t h; - int32_t pitch; }; TTFFontDescriptor* TTFGetFontFromSpriteBase(FontStyle fontStyle); @@ -43,6 +43,5 @@ void TTF_CloseFont(TTF_Font* font); void TTF_SetFontHinting(TTF_Font* font, int hinting); int TTF_GetFontHinting(const TTF_Font* font); void TTF_Quit(void); -uint8_t GetPixel(const TTFSurface& surface, int32_t x, int32_t y); #endif // NO_TTF diff --git a/src/openrct2/drawing/TTFSDLPort.cpp b/src/openrct2/drawing/TTFSDLPort.cpp index f26b35b86c..1bc216c0ea 100644 --- a/src/openrct2/drawing/TTFSDLPort.cpp +++ b/src/openrct2/drawing/TTFSDLPort.cpp @@ -216,7 +216,7 @@ static void TTF_initLineMectrics(const TTF_Font* font, const TTFSurface* textbuf dst = const_cast(static_cast(textbuf->pixels)); if (row > 0) { - dst += row * textbuf->pitch; + dst += row * textbuf->w; } height = font->underline_height; @@ -236,7 +236,7 @@ outline into account. static void TTF_drawLine_Solid(const TTF_Font* font, const TTFSurface* textbuf, const int row) { int line; - uint8_t* dst_check = const_cast(static_cast(textbuf->pixels)) + textbuf->pitch * textbuf->h; + uint8_t* dst_check = const_cast(static_cast(textbuf->pixels)) + textbuf->w * textbuf->h; uint8_t* dst; int height; @@ -247,7 +247,7 @@ static void TTF_drawLine_Solid(const TTF_Font* font, const TTFSurface* textbuf, { /* 1 because 0 is the bg color */ std::fill_n(dst, textbuf->w, 0x01); - dst += textbuf->pitch; + dst += textbuf->w; } } @@ -258,7 +258,7 @@ static void TTF_drawLine_Solid(const TTF_Font* font, const TTFSurface* textbuf, static void TTF_drawLine_Shaded(const TTF_Font* font, const TTFSurface* textbuf, const int row) { int line; - uint8_t* dst_check = const_cast(static_cast(textbuf->pixels)) + textbuf->pitch * textbuf->h; + uint8_t* dst_check = const_cast(static_cast(textbuf->pixels)) + textbuf->w * textbuf->h; uint8_t* dst; int height; @@ -268,7 +268,7 @@ static void TTF_drawLine_Shaded(const TTF_Font* font, const TTFSurface* textbuf, for (line = height; line > 0 && dst < dst_check; --line) { std::fill_n(dst, textbuf->w, NUM_GRAYS - 1); - dst += textbuf->pitch; + dst += textbuf->w; } } @@ -1299,12 +1299,11 @@ TTFSurface* TTF_RenderUTF8(TTF_Font* font, const char* text, bool shaded) } textbuf->w = width; textbuf->h = height; - textbuf->pitch = width; textbuf->pixels = calloc(1, width * height); /* Adding bound checking to avoid all kinds of memory corruption errors that may occur. */ - dst_check = const_cast(static_cast(textbuf->pixels)) + textbuf->pitch * textbuf->h; + dst_check = const_cast(static_cast(textbuf->pixels)) + textbuf->w * textbuf->h; /* check kerning */ use_kerning = FT_HAS_KERNING(font->face) && font->kerning; @@ -1363,7 +1362,7 @@ TTFSurface* TTF_RenderUTF8(TTF_Font* font, const char* text, bool shaded) { continue; } - dst = const_cast(static_cast(textbuf->pixels)) + (row + glyph->yoffset) * textbuf->pitch + dst = const_cast(static_cast(textbuf->pixels)) + (row + glyph->yoffset) * textbuf->w + xstart + glyph->minx; src = current->buffer + row * current->pitch; diff --git a/src/openrct2/drawing/X8DrawingEngine.cpp b/src/openrct2/drawing/X8DrawingEngine.cpp index c7f54ec56f..5af091d8ab 100644 --- a/src/openrct2/drawing/X8DrawingEngine.cpp +++ b/src/openrct2/drawing/X8DrawingEngine.cpp @@ -10,7 +10,6 @@ #include "X8DrawingEngine.h" #include "../Context.h" -#include "../Game.h" #include "../Intro.h" #include "../config/Config.h" #include "../core/Numerics.hpp" @@ -19,7 +18,6 @@ #include "../interface/Window.h" #include "../ui/UiContext.h" #include "../util/Util.h" -#include "../world/Climate.h" #include "Drawing.h" #include "IDrawingContext.h" #include "IDrawingEngine.h" @@ -743,3 +741,100 @@ void X8DrawingContext::DrawGlyph(DrawPixelInfo& dpi, const ImageId image, int32_ { GfxDrawSpritePaletteSetSoftware(dpi, image, { x, y }, paletteMap); } + +#ifndef NO_TTF +template +static void DrawTTFBitmapInternal( + DrawPixelInfo& dpi, uint8_t colour, TTFSurface* surface, int32_t x, int32_t y, uint8_t hintingThreshold) +{ + const int32_t surfaceWidth = surface->w; + int32_t width = surfaceWidth; + int32_t height = surface->h; + + const int32_t overflowX = (dpi.x + dpi.width) - (x + width); + const int32_t overflowY = (dpi.y + dpi.height) - (y + height); + if (overflowX < 0) + width += overflowX; + if (overflowY < 0) + height += overflowY; + int32_t skipX = x - dpi.x; + int32_t skipY = y - dpi.y; + + auto src = static_cast(surface->pixels); + uint8_t* dst = dpi.bits; + + if (skipX < 0) + { + width += skipX; + src += -skipX; + skipX = 0; + } + if (skipY < 0) + { + height += skipY; + src += (-skipY * surfaceWidth); + skipY = 0; + } + + dst += skipX; + dst += skipY * (dpi.width + dpi.pitch); + + const int32_t srcScanSkip = surfaceWidth - width; + const int32_t dstScanSkip = dpi.width + dpi.pitch - width; + for (int32_t yy = 0; yy < height; yy++) + { + for (int32_t xx = 0; xx < width; xx++) + { + if (*src != 0) + { + if constexpr (TUseHinting) + { + if (*src > 180) + { + // Centre of the glyph: use full colour. + *dst = colour; + } + else if (*src > hintingThreshold) + { + *dst = BlendColours(colour, *dst); + } + } + else + { + *dst = colour; + } + } + src++; + dst++; + } + src += srcScanSkip; + dst += dstScanSkip; + } +} +#endif // NO_TTF + +void X8DrawingContext::DrawTTFBitmap( + DrawPixelInfo& dpi, TextDrawInfo* info, TTFSurface* surface, int32_t x, int32_t y, uint8_t hintingThreshold) +{ +#ifndef NO_TTF + const uint8_t fgColor = info->palette[1]; + const uint8_t bgColor = info->palette[3]; + + if (info->flags & TEXT_DRAW_FLAG_OUTLINE) + { + DrawTTFBitmapInternal(dpi, bgColor, surface, x + 1, y, 0); + DrawTTFBitmapInternal(dpi, bgColor, surface, x - 1, y, 0); + DrawTTFBitmapInternal(dpi, bgColor, surface, x, y + 1, 0); + DrawTTFBitmapInternal(dpi, bgColor, surface, x, y - 1, 0); + } + if (info->flags & TEXT_DRAW_FLAG_INSET) + { + DrawTTFBitmapInternal(dpi, bgColor, surface, x + 1, y + 1, 0); + } + + if (hintingThreshold > 0) + DrawTTFBitmapInternal(dpi, fgColor, surface, x, y, hintingThreshold); + else + DrawTTFBitmapInternal(dpi, fgColor, surface, x, y, 0); +#endif // NO_TTF +} \ No newline at end of file diff --git a/src/openrct2/drawing/X8DrawingEngine.h b/src/openrct2/drawing/X8DrawingEngine.h index 97bc0b93bc..4a3ea69ee3 100644 --- a/src/openrct2/drawing/X8DrawingEngine.h +++ b/src/openrct2/drawing/X8DrawingEngine.h @@ -9,7 +9,6 @@ #pragma once -#include "../common.h" #include "IDrawingContext.h" #include "IDrawingEngine.h" @@ -148,10 +147,8 @@ namespace OpenRCT2 void DrawGlyph( DrawPixelInfo& dpi, const ImageId image, int32_t x, int32_t y, const PaletteMap& paletteMap) override; void DrawTTFBitmap( - DrawPixelInfo& dpi, TextDrawInfo* info, uint32_t image, const void* pixels, int32_t width, int32_t height, - int32_t x, int32_t y, uint8_t hinting_threshold) override - { - } + DrawPixelInfo& dpi, TextDrawInfo* info, TTFSurface* surface, int32_t x, int32_t y, + uint8_t hintingThreshold) override; }; } // namespace Drawing } // namespace OpenRCT2 From b5fdcf9a173d3ffd24755fd970675f7754fc0ae2 Mon Sep 17 00:00:00 2001 From: Ryan Gudonis Date: Thu, 28 Mar 2024 19:11:30 -0400 Subject: [PATCH 154/191] Change difficulty order for Wacky Worlds scenarios --- distribution/changelog.txt | 1 + src/openrct2/scenario/ScenarioSources.cpp | 26 +++++++++++------------ 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ca39beee3f..27236e3755 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -15,6 +15,7 @@ - Improved: [objects#309] Updated names for dodgems and flying saucers vehicles. - Improved: [objects#313] buildMenuPriority for dodgems and flying saucers vehicles. - Change: [#21529] Classify “Southern Sands”, “Tiny Towers”, “Nevermore Park”, “Pacifica” as expert scenarios. +- Change: [#21545] Reorder Wacky Worlds scenarios and adjust their difficulty classification. - Fix: [#910] Extra viewport does not preserve the location when rotating. - Fix: [#18413] Crash when mouse over a hacked train. - Fix: [#20338] Cannot select Scenery Picker or Scatter Tool when the scenery recolouring tool is active. diff --git a/src/openrct2/scenario/ScenarioSources.cpp b/src/openrct2/scenario/ScenarioSources.cpp index 373420e8bd..e9bbee8360 100644 --- a/src/openrct2/scenario/ScenarioSources.cpp +++ b/src/openrct2/scenario/ScenarioSources.cpp @@ -235,23 +235,23 @@ namespace ScenarioSources // RCT2: Wacky Worlds static constexpr ScenarioTitleDescriptor ScenarioTitlesRCT2WW[] = { - { SC_UNIDENTIFIED, "Africa - Victoria Falls", SCENARIO_CATEGORY_BEGINNER }, - { SC_UNIDENTIFIED, "Asia - Great Wall of China Tourism Enhancement", SCENARIO_CATEGORY_BEGINNER }, { SC_UNIDENTIFIED, "North America - Grand Canyon", SCENARIO_CATEGORY_BEGINNER }, - { SC_UNIDENTIFIED, "South America - Rio Carnival", SCENARIO_CATEGORY_BEGINNER }, - { SC_UNIDENTIFIED, "Africa - African Diamond Mine", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "Asia - Great Wall of China Tourism Enhancement", SCENARIO_CATEGORY_BEGINNER }, + { SC_UNIDENTIFIED, "Africa - African Diamond Mine", SCENARIO_CATEGORY_BEGINNER }, + { SC_UNIDENTIFIED, "Australasia - Ayers Rock", SCENARIO_CATEGORY_BEGINNER }, + { SC_UNIDENTIFIED, "North America - Rollercoaster Heaven", SCENARIO_CATEGORY_BEGINNER }, + { SC_UNIDENTIFIED, "Africa - Oasis", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "South America - Rio Carnival", SCENARIO_CATEGORY_CHALLENGING }, { SC_UNIDENTIFIED, "Asia - Maharaja Palace", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Australasia - Ayers Rock", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Europe - European Cultural Festival", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "North America - Rollercoaster Heaven", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "South America - Inca Lost City", SCENARIO_CATEGORY_CHALLENGING }, - { SC_UNIDENTIFIED, "Africa - Oasis", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "Africa - Victoria Falls", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "N. America - Extreme Hawaiian Island", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "South America - Rain Forest Plateau", SCENARIO_CATEGORY_CHALLENGING }, + { SC_UNIDENTIFIED, "Europe - Renovation", SCENARIO_CATEGORY_CHALLENGING }, { SC_UNIDENTIFIED, "Antarctic - Ecological Salvage", SCENARIO_CATEGORY_EXPERT }, - { SC_UNIDENTIFIED, "Asia - Japanese Coastal Reclaim", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "Europe - European Cultural Festival", SCENARIO_CATEGORY_EXPERT }, { SC_UNIDENTIFIED, "Australasia - Fun at the Beach", SCENARIO_CATEGORY_EXPERT }, - { SC_UNIDENTIFIED, "Europe - Renovation", SCENARIO_CATEGORY_EXPERT }, - { SC_UNIDENTIFIED, "N. America - Extreme Hawaiian Island", SCENARIO_CATEGORY_EXPERT }, - { SC_UNIDENTIFIED, "South America - Rain Forest Plateau", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "South America - Inca Lost City", SCENARIO_CATEGORY_EXPERT }, + { SC_UNIDENTIFIED, "Asia - Japanese Coastal Reclaim", SCENARIO_CATEGORY_EXPERT }, }; // RCT2: Time Twister From 23958186bd98ec745183b20d0de72908646ceaaf Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 21:31:03 -0700 Subject: [PATCH 155/191] Change `LOG_ERROR` to `LOG_WARNING` for errors --- src/openrct2/actions/BannerSetNameAction.cpp | 4 ++-- .../actions/FootpathAdditionRemoveAction.cpp | 4 ++-- src/openrct2/actions/GameSetSpeedAction.cpp | 4 ++-- src/openrct2/actions/GuestSetNameAction.cpp | 4 ++-- src/openrct2/actions/LandBuyRightsAction.cpp | 4 ++-- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- .../actions/LargeSceneryRemoveAction.cpp | 4 ++-- src/openrct2/actions/RideCreateAction.cpp | 2 +- src/openrct2/actions/RideDemolishAction.cpp | 4 ++-- .../actions/RideEntranceExitPlaceAction.cpp | 6 ++--- .../actions/RideEntranceExitRemoveAction.cpp | 8 +++---- .../actions/RideFreezeRatingAction.cpp | 4 ++-- .../actions/RideSetAppearanceAction.cpp | 10 ++++---- src/openrct2/actions/RideSetNameAction.cpp | 4 ++-- src/openrct2/actions/RideSetPriceAction.cpp | 8 +++---- src/openrct2/actions/RideSetSettingAction.cpp | 24 +++++++++---------- src/openrct2/actions/RideSetStatusAction.cpp | 6 ++--- src/openrct2/actions/RideSetVehicleAction.cpp | 12 +++++----- src/openrct2/actions/SignSetNameAction.cpp | 4 ++-- src/openrct2/actions/SignSetStyleAction.cpp | 6 ++--- .../actions/StaffSetCostumeAction.cpp | 6 ++--- src/openrct2/actions/StaffSetNameAction.cpp | 4 ++-- src/openrct2/actions/StaffSetOrdersAction.cpp | 4 ++-- src/openrct2/actions/TrackDesignAction.cpp | 4 ++-- src/openrct2/actions/TrackPlaceAction.cpp | 16 ++++++------- src/openrct2/actions/TrackRemoveAction.cpp | 22 ++++++++--------- .../actions/TrackSetBrakeSpeedAction.cpp | 2 +- 27 files changed, 91 insertions(+), 91 deletions(-) diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index b50523e7d8..c532252765 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -47,7 +47,7 @@ GameActions::Result BannerSetNameAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex); + LOG_ERROR("Invalid banner id, banner id = %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); } return GameActions::Result(); @@ -58,7 +58,7 @@ GameActions::Result BannerSetNameAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_WARNING("Invalid banner id, banner id = %d", _bannerIndex); + LOG_ERROR("Invalid banner id, banner id = %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); } diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index a8f7b9be87..435bdd453e 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -69,14 +69,14 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { - LOG_WARNING("Could not find path element."); + LOG_ERROR("Could not find path element."); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) { - LOG_WARNING("Could not find path element."); + LOG_ERROR("Could not find path element."); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } diff --git a/src/openrct2/actions/GameSetSpeedAction.cpp b/src/openrct2/actions/GameSetSpeedAction.cpp index 6e30aed3a0..6d44cd8376 100644 --- a/src/openrct2/actions/GameSetSpeedAction.cpp +++ b/src/openrct2/actions/GameSetSpeedAction.cpp @@ -39,7 +39,7 @@ GameActions::Result GameSetSpeedAction::Query() const if (!IsValidSpeed(_speed)) { - LOG_WARNING("Invalid game command for speed %u", _speed); + LOG_ERROR("Invalid game command for speed %u", _speed); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -53,7 +53,7 @@ GameActions::Result GameSetSpeedAction::Execute() const if (!IsValidSpeed(_speed)) { - LOG_WARNING("Invalid game command for speed %u", _speed); + LOG_ERROR("Invalid game command for speed %u", _speed); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 0f82e1bc46..df50e840ec 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -64,7 +64,7 @@ GameActions::Result GuestSetNameAction::Query() const auto guest = TryGetEntity(_spriteIndex); if (guest == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); } @@ -76,7 +76,7 @@ GameActions::Result GuestSetNameAction::Execute() const auto guest = TryGetEntity(_spriteIndex); if (guest == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); } diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index e976375579..71c0f54824 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -113,7 +113,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& { if (_setting >= LandBuyRightSetting::Count) { - LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting); + LOG_ERROR("Tried calling buy land rights with an incorrect setting. setting = %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } @@ -170,7 +170,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& return res; default: - LOG_WARNING("Tried calling buy land rights with an incorrect setting. setting = %u", _setting); + LOG_ERROR("Tried calling buy land rights with an incorrect setting. setting = %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } } diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 9ffc1cc6fe..f3f4998542 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -205,7 +205,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& return res; } default: - LOG_WARNING("Tried calling set land rights with an incorrect setting. setting = %u", _setting); + LOG_ERROR("Tried calling set land rights with an incorrect setting. setting = %u", _setting); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 1c265f6bda..402dabffda 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -65,7 +65,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex); if (tileElement == nullptr) { - LOG_WARNING("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); + LOG_ERROR("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } @@ -147,7 +147,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex); if (tileElement == nullptr) { - LOG_WARNING("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); + LOG_ERROR("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 39fa6b6c1c..759af38287 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -130,7 +130,7 @@ GameActions::Result RideCreateAction::Execute() const const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); if (rideEntry == nullptr) { - LOG_WARNING("Invalid request for ride %u", rideIndex); + LOG_ERROR("Invalid request for ride %u", rideIndex); return GameActions::Result(GameActions::Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 6b73159231..2663905ce9 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -60,7 +60,7 @@ GameActions::Result RideDemolishAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE); } @@ -105,7 +105,7 @@ GameActions::Result RideDemolishAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE); } diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 53f6054bc6..3aa4acc02b 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -58,13 +58,13 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide) { - LOG_WARNING("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying()); + LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } @@ -143,7 +143,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index 29e6b60d44..103e31b0a7 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -69,7 +69,7 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } @@ -99,7 +99,7 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const } else if (entranceElement == nullptr) { - LOG_WARNING( + LOG_ERROR( "Entrance element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(), _stationNum.ToUnderlying()); return GameActions::Result( @@ -114,7 +114,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } @@ -137,7 +137,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const } else if (entranceElement == nullptr) { - LOG_WARNING( + LOG_ERROR( "Entrance element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(), _stationNum); return GameActions::Result( diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index 0784279540..5e3ad0321c 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -34,13 +34,13 @@ GameActions::Result RideFreezeRatingAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } if (_value <= 0) { - LOG_WARNING("Rating value must be positive", _rideIndex.ToUnderlying()); + LOG_ERROR("Rating value must be positive", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 31ae303b03..d3c16c3b63 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -53,7 +53,7 @@ GameActions::Result RideSetAppearanceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } @@ -64,7 +64,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::TrackColourSupports: if (_index >= std::size(ride->track_colour)) { - LOG_WARNING("Invalid game command, index %d out of bounds", _index); + LOG_ERROR("Invalid game command, index %d out of bounds", _index); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -74,7 +74,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::VehicleColourTertiary: if (_index >= std::size(ride->vehicle_colours)) { - LOG_WARNING("Invalid game command, index %d out of bounds", _index); + LOG_ERROR("Invalid game command, index %d out of bounds", _index); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -84,7 +84,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::SellingItemColourIsRandom: break; default: - LOG_WARNING("Invalid game command, type %d not recognised", _type); + LOG_ERROR("Invalid game command, type %d not recognised", _type); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -97,7 +97,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 9a1498c6c5..0f6e2a3009 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -50,7 +50,7 @@ GameActions::Result RideSetNameAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE); } @@ -68,7 +68,7 @@ GameActions::Result RideSetNameAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE); } diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index b418b07f6d..dc17141888 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -54,14 +54,14 @@ GameActions::Result RideSetPriceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); } @@ -77,14 +77,14 @@ GameActions::Result RideSetPriceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 619d07529d..ce61b7f6b1 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -48,7 +48,7 @@ GameActions::Result RideSetSettingAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid ride: #%u.", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride: #%u.", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } @@ -69,7 +69,7 @@ GameActions::Result RideSetSettingAction::Query() const if (!RideIsModeValid(*ride) && !GetGameState().Cheats.ShowAllOperatingModes) { - LOG_WARNING("Invalid ride mode: %u", _value); + LOG_ERROR("Invalid ride mode: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; @@ -78,21 +78,21 @@ GameActions::Result RideSetSettingAction::Query() const case RideSetSetting::MinWaitingTime: if (_value > 250) { - LOG_WARNING("Invalid minimum waiting time: %u", _value); + LOG_ERROR("Invalid minimum waiting time: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::MaxWaitingTime: if (_value > 250) { - LOG_WARNING("Invalid maximum waiting time: %u", _value); + LOG_ERROR("Invalid maximum waiting time: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::Operation: if (!RideIsValidOperationOption(*ride)) { - LOG_WARNING("Invalid operation option value: %u", _value); + LOG_ERROR("Invalid operation option value: %u", _value); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, GetOperationErrorMessage(*ride)); } @@ -100,7 +100,7 @@ GameActions::Result RideSetSettingAction::Query() const case RideSetSetting::InspectionInterval: if (_value > RIDE_INSPECTION_NEVER) { - LOG_WARNING("Invalid inspection interval: %u", _value); + LOG_ERROR("Invalid inspection interval: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; @@ -112,7 +112,7 @@ GameActions::Result RideSetSettingAction::Query() const auto musicObj = objManager.GetLoadedObject(ObjectType::Music, _value); if (musicObj == nullptr) { - LOG_WARNING("Invalid music style: %u", _value); + LOG_ERROR("Invalid music style: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; @@ -120,7 +120,7 @@ GameActions::Result RideSetSettingAction::Query() const case RideSetSetting::LiftHillSpeed: if (!RideIsValidLiftHillSpeed(*ride)) { - LOG_WARNING("Invalid lift hill speed: %u", _value); + LOG_ERROR("Invalid lift hill speed: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; @@ -134,19 +134,19 @@ GameActions::Result RideSetSettingAction::Query() const if (!RideIsValidNumCircuits()) { - LOG_WARNING("Invalid number of circuits: %u", _value); + LOG_ERROR("Invalid number of circuits: %u", _value); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; case RideSetSetting::RideType: if (!GetGameState().Cheats.AllowArbitraryRideTypeChanges) { - LOG_WARNING("Arbitrary ride type changes not allowed."); + LOG_ERROR("Arbitrary ride type changes not allowed."); return GameActions::Result(GameActions::Status::Disallowed, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } break; default: - LOG_WARNING("Invalid RideSetSetting: %u", static_cast(_setting)); + LOG_ERROR("Invalid RideSetSetting: %u", static_cast(_setting)); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } @@ -158,7 +158,7 @@ GameActions::Result RideSetSettingAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid ride: #%u.", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride: #%u.", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 9817890559..1a09f71da3 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -60,7 +60,7 @@ GameActions::Result RideSetStatusAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = STR_NONE; @@ -69,7 +69,7 @@ GameActions::Result RideSetStatusAction::Query() const if (_status >= RideStatus::Count) { - LOG_WARNING("Invalid ride status %u for ride %u", EnumValue(_status), _rideIndex.ToUnderlying()); + 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; @@ -124,7 +124,7 @@ GameActions::Result RideSetStatusAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = STR_NONE; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 783a4a9b50..0c393c2753 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -66,14 +66,14 @@ GameActions::Result RideSetVehicleAction::Query() const { if (_type >= RideSetVehicleType::Count) { - LOG_WARNING("Invalid type. type = %d", _type); + LOG_ERROR("Invalid type. type = %d", _type); } auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } @@ -103,7 +103,7 @@ GameActions::Result RideSetVehicleAction::Query() const auto rideEntry = GetRideEntryByIndex(_value); if (rideEntry == nullptr) { - LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype); + LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } @@ -131,7 +131,7 @@ GameActions::Result RideSetVehicleAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } @@ -154,7 +154,7 @@ GameActions::Result RideSetVehicleAction::Execute() const auto rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype); + LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } uint8_t clampValue = _value; @@ -177,7 +177,7 @@ GameActions::Result RideSetVehicleAction::Execute() const auto rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_WARNING("Invalid ride entry, ride->subtype = %d", ride->subtype); + LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index a57bf50393..a11b9f2108 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -48,7 +48,7 @@ GameActions::Result SignSetNameAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_WARNING("Invalid game command for setting sign name, banner id = %d", _bannerIndex); + LOG_ERROR("Invalid game command for setting sign name, banner id = %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } return GameActions::Result(); @@ -59,7 +59,7 @@ GameActions::Result SignSetNameAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_WARNING("Invalid game command for setting sign name, banner id = %d", _bannerIndex); + LOG_ERROR("Invalid game command for setting sign name, banner id = %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 35d65a9e8a..ef6063a7a1 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -59,12 +59,12 @@ GameActions::Result SignSetStyleAction::Query() const TileElement* tileElement = BannerGetTileElement(_bannerIndex); if (tileElement == nullptr) { - LOG_WARNING("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); + LOG_ERROR("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (tileElement->GetType() != TileElementType::LargeScenery) { - LOG_WARNING("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex); + LOG_ERROR("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } @@ -74,7 +74,7 @@ GameActions::Result SignSetStyleAction::Query() const if (wallElement == nullptr) { - LOG_WARNING("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); + LOG_ERROR("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 099462e2d4..2b00142885 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -71,14 +71,14 @@ GameActions::Result StaffSetCostumeAction::Query() const auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } auto spriteType = EntertainerCostumeToSprite(_costume); if (EnumValue(spriteType) > std::size(peep_slow_walking_types)) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -90,7 +90,7 @@ GameActions::Result StaffSetCostumeAction::Execute() const auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index d9a4302200..e22c22f2bf 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -55,7 +55,7 @@ GameActions::Result StaffSetNameAction::Query() const auto staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); } @@ -67,7 +67,7 @@ GameActions::Result StaffSetNameAction::Execute() const auto staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); } diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index 995fe6513b..8830c1e27c 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -53,7 +53,7 @@ GameActions::Result StaffSetOrdersAction::Query() const if (staff == nullptr || (staff->AssignedStaffType != StaffType::Handyman && staff->AssignedStaffType != StaffType::Mechanic)) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); } @@ -66,7 +66,7 @@ GameActions::Result StaffSetOrdersAction::Execute() const auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_WARNING("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } staff->StaffOrders = _ordersId; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 7f74c6006f..1394ef3745 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -90,7 +90,7 @@ GameActions::Result TrackDesignAction::Query() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for track placement, ride id = %d", rideIndex); + LOG_ERROR("Invalid game command for track placement, ride id = %d", rideIndex); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -163,7 +163,7 @@ GameActions::Result TrackDesignAction::Execute() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid game command for track placement, ride id = %d", rideIndex); + LOG_ERROR("Invalid game command for track placement, ride id = %d", rideIndex); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index ff85c0d611..21188c1508 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -72,21 +72,21 @@ GameActions::Result TrackPlaceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_WARNING("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } if (!DirectionValid(_origin.direction)) { - LOG_WARNING("Invalid direction for track placement, direction = %d", _origin.direction); + LOG_ERROR("Invalid direction for track placement, direction = %d", _origin.direction); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -99,7 +99,7 @@ GameActions::Result TrackPlaceAction::Query() const if (_rideType > RIDE_TYPE_COUNT) { - LOG_WARNING("Invalid ride type for track placement, rideType = %d", _rideType); + LOG_ERROR("Invalid ride type for track placement, rideType = %d", _rideType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -189,7 +189,7 @@ GameActions::Result TrackPlaceAction::Query() const if (!CheckMapCapacity(numElements)) { - LOG_WARNING("Not enough free map elements to place track."); + LOG_ERROR("Not enough free map elements to place track."); return GameActions::Result( GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); @@ -413,7 +413,7 @@ GameActions::Result TrackPlaceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_WARNING("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -421,7 +421,7 @@ GameActions::Result TrackPlaceAction::Execute() const const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_WARNING("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); + LOG_ERROR("Invalid ride subtype for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -558,7 +558,7 @@ GameActions::Result TrackPlaceAction::Execute() const auto* trackElement = TileElementInsert(mapLoc, quarterTile.GetBaseQuarterOccupied()); if (trackElement == nullptr) { - LOG_WARNING("Cannot create track element for ride = %d", _rideIndex.ToUnderlying()); + LOG_ERROR("Cannot create track element for ride = %d", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::NoFreeElements, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_TILE_ELEMENT_LIMIT_REACHED); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 0a1008531e..c13dc12c26 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -110,7 +110,7 @@ GameActions::Result TrackRemoveAction::Query() const if (!found) { - LOG_WARNING( + LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); @@ -129,13 +129,13 @@ GameActions::Result TrackRemoveAction::Query() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_WARNING("Ride not found. ride index = %d.", rideIndex); + LOG_ERROR("Ride not found. ride index = %d.", rideIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } if (ride->type >= RIDE_TYPE_COUNT) { - LOG_WARNING("Ride type not found. ride type = %d.", ride->type); + LOG_ERROR("Ride type not found. ride type = %d.", ride->type); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } const auto& ted = GetTrackElementDescriptor(trackType); @@ -143,7 +143,7 @@ GameActions::Result TrackRemoveAction::Query() const const PreviewTrack* trackBlock = ted.GetBlockForSequence(sequenceIndex); if (trackBlock == nullptr) { - LOG_WARNING("Track block %d not found for track type %d.", sequenceIndex, trackType); + LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } @@ -204,7 +204,7 @@ GameActions::Result TrackRemoveAction::Query() const if (!found) { - LOG_WARNING( + LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z, _origin.direction, trackBlock->index); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); @@ -224,7 +224,7 @@ GameActions::Result TrackRemoveAction::Query() const auto* surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { - LOG_WARNING("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); + LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } @@ -311,7 +311,7 @@ GameActions::Result TrackRemoveAction::Execute() const if (!found) { - LOG_WARNING( + LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); @@ -324,7 +324,7 @@ GameActions::Result TrackRemoveAction::Execute() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_WARNING("Ride not found. ride index = %d.", rideIndex); + LOG_ERROR("Ride not found. ride index = %d.", rideIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } const auto& ted = GetTrackElementDescriptor(trackType); @@ -332,7 +332,7 @@ GameActions::Result TrackRemoveAction::Execute() const const PreviewTrack* trackBlock = ted.GetBlockForSequence(sequenceIndex); if (trackBlock == nullptr) { - LOG_WARNING("Track block %d not found for track type %d.", sequenceIndex, trackType); + LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType); return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } @@ -388,7 +388,7 @@ GameActions::Result TrackRemoveAction::Execute() const if (!found) { - LOG_WARNING( + LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z, _origin.direction, trackBlock->index); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); @@ -408,7 +408,7 @@ GameActions::Result TrackRemoveAction::Execute() const auto* surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { - LOG_WARNING("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); + LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); } diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index 8513f03a57..00d03c67b1 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -63,7 +63,7 @@ GameActions::Result TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting) con TileElement* tileElement = MapGetTrackElementAtOfType(_loc, _trackType); if (tileElement == nullptr) { - LOG_WARNING("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y); + LOG_ERROR("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); } From 338cca6760af5985ab56a6df070f781b4248ab17 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 21:35:48 -0700 Subject: [PATCH 156/191] Add missing `%u` in format strings --- src/openrct2/actions/BannerPlaceAction.cpp | 4 ++-- src/openrct2/actions/BannerRemoveAction.cpp | 8 ++++---- src/openrct2/actions/RideFreezeRatingAction.cpp | 2 +- src/openrct2/actions/SignSetStyleAction.cpp | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index cb498d19e0..092233014f 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -98,7 +98,7 @@ GameActions::Result BannerPlaceAction::Query() const auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(_bannerType); if (bannerEntry == nullptr) { - LOG_ERROR("Invalid banner object type. bannerType = ", _bannerType); + LOG_ERROR("Invalid banner object type. bannerType = %u", _bannerType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -126,7 +126,7 @@ GameActions::Result BannerPlaceAction::Execute() const auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(_bannerType); if (bannerEntry == nullptr) { - LOG_ERROR("Invalid banner object type. bannerType = ", _bannerType); + LOG_ERROR("Invalid banner object type. bannerType = %u", _bannerType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index c0321349be..33274c9954 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -70,14 +70,14 @@ GameActions::Result BannerRemoveAction::Query() const auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { - LOG_ERROR("Invalid banner index. index = ", bannerIndex); + LOG_ERROR("Invalid banner index. index = %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - LOG_ERROR("Invalid banner index. index = ", bannerIndex); + LOG_ERROR("Invalid banner index. index = %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } @@ -109,14 +109,14 @@ GameActions::Result BannerRemoveAction::Execute() const auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { - LOG_ERROR("Invalid banner index. index = ", bannerIndex); + LOG_ERROR("Invalid banner index. index = %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - LOG_ERROR("Invalid banner index. index = ", bannerIndex); + LOG_ERROR("Invalid banner index. index = %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index 5e3ad0321c..47dcf13df8 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -40,7 +40,7 @@ GameActions::Result RideFreezeRatingAction::Query() const if (_value <= 0) { - LOG_ERROR("Rating value must be positive", _rideIndex.ToUnderlying()); + LOG_ERROR("Rating value must be positive: %u", _rideIndex.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index ef6063a7a1..66a7bbf765 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -50,7 +50,7 @@ GameActions::Result SignSetStyleAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id. id = ", _bannerIndex); + LOG_ERROR("Invalid banner id. id = %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -87,7 +87,7 @@ GameActions::Result SignSetStyleAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id. id = ", _bannerIndex); + LOG_ERROR("Invalid banner id. id = %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } From 125fa12d6f3fdc9ada0970f4b808c7ab6905e7e6 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 21:55:44 -0700 Subject: [PATCH 157/191] Remove redundant word ("index. index = %u") --- src/openrct2/actions/BannerRemoveAction.cpp | 8 ++++---- src/openrct2/actions/BannerSetColourAction.cpp | 4 ++-- src/openrct2/actions/BannerSetStyleAction.cpp | 8 ++++---- src/openrct2/actions/LandBuyRightsAction.cpp | 4 ++-- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/LargeScenerySetColourAction.cpp | 6 +++--- src/openrct2/actions/RideSetVehicleAction.cpp | 4 ++-- src/openrct2/actions/SignSetStyleAction.cpp | 4 ++-- src/openrct2/actions/StaffFireAction.cpp | 6 +++--- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/src/openrct2/actions/BannerRemoveAction.cpp b/src/openrct2/actions/BannerRemoveAction.cpp index 33274c9954..993baf955b 100644 --- a/src/openrct2/actions/BannerRemoveAction.cpp +++ b/src/openrct2/actions/BannerRemoveAction.cpp @@ -70,14 +70,14 @@ GameActions::Result BannerRemoveAction::Query() const auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { - LOG_ERROR("Invalid banner index. index = %u", bannerIndex); + LOG_ERROR("Invalid banner index %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - LOG_ERROR("Invalid banner index. index = %u", bannerIndex); + LOG_ERROR("Invalid banner index %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } @@ -109,14 +109,14 @@ GameActions::Result BannerRemoveAction::Execute() const auto bannerIndex = bannerElement->GetIndex(); if (bannerIndex == BannerIndex::GetNull()) { - LOG_ERROR("Invalid banner index. index = %u", bannerIndex); + LOG_ERROR("Invalid banner index %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } auto banner = bannerElement->GetBanner(); if (banner == nullptr) { - LOG_ERROR("Invalid banner index. index = %u", bannerIndex); + LOG_ERROR("Invalid banner index %u", bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_NONE); } diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index bcaae63230..95c421986f 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -66,7 +66,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const if (_primaryColour > 31) { - LOG_ERROR("Invalid primary colour: colour = %u", _primaryColour); + LOG_ERROR("Invalid primary colour %u", _primaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -87,7 +87,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const auto banner = GetBanner(index); if (banner == nullptr) { - LOG_ERROR("Invalid banner index: index = %u", index); + LOG_ERROR("Invalid banner index %u", index); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 73ef718e83..f4b18de9ee 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -49,7 +49,7 @@ GameActions::Result BannerSetStyleAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner index: index = %u", _bannerIndex); + LOG_ERROR("Invalid banner index %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -70,7 +70,7 @@ GameActions::Result BannerSetStyleAction::Query() const case BannerSetStyleType::PrimaryColour: if (_parameter > COLOUR_COUNT) { - LOG_ERROR("Invalid primary colour: colour = %u", _parameter); + LOG_ERROR("Invalid primary colour %u", _parameter); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } break; @@ -78,7 +78,7 @@ GameActions::Result BannerSetStyleAction::Query() const case BannerSetStyleType::TextColour: if (_parameter > 13) { - LOG_ERROR("Invalid text colour: colour = %u", _parameter); + LOG_ERROR("Invalid text colour %u", _parameter); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } break; @@ -103,7 +103,7 @@ GameActions::Result BannerSetStyleAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner index: index = %u", _bannerIndex); + LOG_ERROR("Invalid banner index %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 71c0f54824..36d7c73ab1 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -113,7 +113,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& { if (_setting >= LandBuyRightSetting::Count) { - LOG_ERROR("Tried calling buy land rights with an incorrect setting. setting = %u", _setting); + LOG_ERROR("Tried calling buy land rights with an incorrect setting %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } @@ -170,7 +170,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& return res; default: - LOG_ERROR("Tried calling buy land rights with an incorrect setting. setting = %u", _setting); + LOG_ERROR("Tried calling buy land rights with an incorrect setting %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } } diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index f3f4998542..223bd50e9a 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -205,7 +205,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& return res; } default: - LOG_ERROR("Tried calling set land rights with an incorrect setting. setting = %u", _setting); + LOG_ERROR("Tried calling set land rights with an incorrect setting %u", _setting); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index e53ecefda1..45baec04fb 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -75,19 +75,19 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (_primaryColour >= COLOUR_COUNT) { - LOG_ERROR("Invalid primary colour: colour = %u", _primaryColour); + LOG_ERROR("Invalid primary colour %u", _primaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_secondaryColour >= COLOUR_COUNT) { - LOG_ERROR("Invalid secondary colour: colour = %u", _secondaryColour); + LOG_ERROR("Invalid secondary colour %u", _secondaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (_tertiaryColour >= COLOUR_COUNT) { - LOG_ERROR("Invalid tertiary colour: colour = %u", _tertiaryColour); + LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 0c393c2753..2215d0c820 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -66,7 +66,7 @@ GameActions::Result RideSetVehicleAction::Query() const { if (_type >= RideSetVehicleType::Count) { - LOG_ERROR("Invalid type. type = %d", _type); + LOG_ERROR("Invalid type %d", _type); } auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; @@ -97,7 +97,7 @@ GameActions::Result RideSetVehicleAction::Query() const { if (!RideIsVehicleTypeValid(*ride)) { - LOG_ERROR("Invalid vehicle type. type = %d", _value); + LOG_ERROR("Invalid vehicle type %d", _value); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } auto rideEntry = GetRideEntryByIndex(_value); diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 66a7bbf765..21bea7e237 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -50,7 +50,7 @@ GameActions::Result SignSetStyleAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id. id = %u", _bannerIndex); + LOG_ERROR("Invalid banner id %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -87,7 +87,7 @@ GameActions::Result SignSetStyleAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id. id = %u", _bannerIndex); + LOG_ERROR("Invalid banner id %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index 9bf45c6a93..bc5542de69 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -38,7 +38,7 @@ GameActions::Result StaffFireAction::Query() const { if (_spriteId.ToUnderlying() >= MAX_ENTITIES || _spriteId.IsNull()) { - LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId); + LOG_ERROR("Invalid spriteId %u", _spriteId); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -46,7 +46,7 @@ GameActions::Result StaffFireAction::Query() const auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { - LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId); + LOG_ERROR("Invalid spriteId %u", _spriteId); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } @@ -67,7 +67,7 @@ GameActions::Result StaffFireAction::Execute() const auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { - LOG_ERROR("Invalid spriteId. spriteId = %u", _spriteId); + LOG_ERROR("Invalid spriteId %u", _spriteId); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } WindowCloseByClass(WindowClass::FirePrompt); From 13abc3441c8e97e78c0ae8820df7691e27a391e6 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 22:36:26 -0700 Subject: [PATCH 158/191] Change "invalid game command" messages --- src/openrct2/actions/GameSetSpeedAction.cpp | 4 ++-- src/openrct2/actions/GuestSetNameAction.cpp | 4 ++-- .../actions/LargeSceneryPlaceAction.cpp | 22 +++++++++++++------ .../actions/LargeSceneryRemoveAction.cpp | 4 ++-- src/openrct2/actions/RideDemolishAction.cpp | 4 ++-- .../actions/RideEntranceExitPlaceAction.cpp | 4 ++-- .../actions/RideFreezeRatingAction.cpp | 2 +- .../actions/RideSetAppearanceAction.cpp | 10 ++++----- src/openrct2/actions/RideSetNameAction.cpp | 4 ++-- src/openrct2/actions/RideSetPriceAction.cpp | 8 +++---- src/openrct2/actions/RideSetStatusAction.cpp | 4 ++-- src/openrct2/actions/RideSetVehicleAction.cpp | 4 ++-- src/openrct2/actions/SignSetNameAction.cpp | 4 ++-- src/openrct2/actions/SignSetStyleAction.cpp | 7 +++--- .../actions/StaffSetCostumeAction.cpp | 6 ++--- src/openrct2/actions/StaffSetNameAction.cpp | 4 ++-- src/openrct2/actions/StaffSetOrdersAction.cpp | 4 ++-- src/openrct2/actions/TrackDesignAction.cpp | 4 ++-- .../actions/TrackSetBrakeSpeedAction.cpp | 2 +- 19 files changed, 57 insertions(+), 48 deletions(-) diff --git a/src/openrct2/actions/GameSetSpeedAction.cpp b/src/openrct2/actions/GameSetSpeedAction.cpp index 6d44cd8376..258ba06df6 100644 --- a/src/openrct2/actions/GameSetSpeedAction.cpp +++ b/src/openrct2/actions/GameSetSpeedAction.cpp @@ -39,7 +39,7 @@ GameActions::Result GameSetSpeedAction::Query() const if (!IsValidSpeed(_speed)) { - LOG_ERROR("Invalid game command for speed %u", _speed); + LOG_ERROR("Invalid speed %u", _speed); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -53,7 +53,7 @@ GameActions::Result GameSetSpeedAction::Execute() const if (!IsValidSpeed(_speed)) { - LOG_ERROR("Invalid game command for speed %u", _speed); + LOG_ERROR("Invalid speed %u", _speed); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index df50e840ec..3483753cca 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -64,7 +64,7 @@ GameActions::Result GuestSetNameAction::Query() const auto guest = TryGetEntity(_spriteIndex); if (guest == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Guest not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); } @@ -76,7 +76,7 @@ GameActions::Result GuestSetNameAction::Execute() const auto guest = TryGetEntity(_spriteIndex); if (guest == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Guest not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); } diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index c0a2e50c58..966e2a10da 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -70,24 +70,32 @@ GameActions::Result LargeSceneryPlaceAction::Query() const money64 supportsCost = 0; - if (_primaryColour >= COLOUR_COUNT || _secondaryColour >= COLOUR_COUNT || _tertiaryColour >= COLOUR_COUNT) + if (_primaryColour >= COLOUR_COUNT) { - LOG_ERROR( - "Invalid game command for scenery placement, primaryColour = %u, secondaryColour = %u", _primaryColour, - _secondaryColour); + LOG_ERROR("Invalid primary colour %u", _primaryColour); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + } + if (_secondaryColour >= COLOUR_COUNT) + { + LOG_ERROR("Invalid secondary colour %u", _secondaryColour); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + } + if (_tertiaryColour >= COLOUR_COUNT) + { + LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS) { - LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); + LOG_ERROR("Invalid sceneryType %u", _sceneryType); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { - LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); + LOG_ERROR("Scenery entry not found for sceneryType %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -201,7 +209,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { - LOG_ERROR("Invalid game command for scenery placement, sceneryType = %u", _sceneryType); + LOG_ERROR("Scenery entry not found for sceneryType = %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 402dabffda..edcef4dc92 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -65,7 +65,7 @@ GameActions::Result LargeSceneryRemoveAction::Query() const TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex); if (tileElement == nullptr) { - LOG_ERROR("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); + LOG_ERROR("No large scenery element to remove at x = %d, y = %d", _loc.x, _loc.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } @@ -147,7 +147,7 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const TileElement* tileElement = FindLargeSceneryElement(_loc, _tileIndex); if (tileElement == nullptr) { - LOG_ERROR("Invalid game command for scenery removal, x = %d, y = %d", _loc.x, _loc.y); + LOG_ERROR("No large scenery element to remove at %d, y = %d", _loc.x, _loc.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index 2663905ce9..ab3d37d749 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -60,7 +60,7 @@ GameActions::Result RideDemolishAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE); } @@ -105,7 +105,7 @@ GameActions::Result RideDemolishAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE); } diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 3aa4acc02b..11e2081516 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -58,7 +58,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } @@ -143,7 +143,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); } diff --git a/src/openrct2/actions/RideFreezeRatingAction.cpp b/src/openrct2/actions/RideFreezeRatingAction.cpp index 47dcf13df8..8d21ac88e4 100644 --- a/src/openrct2/actions/RideFreezeRatingAction.cpp +++ b/src/openrct2/actions/RideFreezeRatingAction.cpp @@ -34,7 +34,7 @@ GameActions::Result RideFreezeRatingAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index d3c16c3b63..1a8d4fa1b6 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -53,7 +53,7 @@ GameActions::Result RideSetAppearanceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } @@ -64,7 +64,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::TrackColourSupports: if (_index >= std::size(ride->track_colour)) { - LOG_ERROR("Invalid game command, index %d out of bounds", _index); + LOG_ERROR("Invalid track colour %u", _index); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -74,7 +74,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::VehicleColourTertiary: if (_index >= std::size(ride->vehicle_colours)) { - LOG_ERROR("Invalid game command, index %d out of bounds", _index); + LOG_ERROR("Invalid vehicle colour %u", _index); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -84,7 +84,7 @@ GameActions::Result RideSetAppearanceAction::Query() const case RideSetAppearanceType::SellingItemColourIsRandom: break; default: - LOG_ERROR("Invalid game command, type %d not recognised", _type); + LOG_ERROR("Invalid ride appearance type %u", _type); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -97,7 +97,7 @@ GameActions::Result RideSetAppearanceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 0f6e2a3009..572a2ee138 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -50,7 +50,7 @@ GameActions::Result RideSetNameAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE); } @@ -68,7 +68,7 @@ GameActions::Result RideSetNameAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE); } diff --git a/src/openrct2/actions/RideSetPriceAction.cpp b/src/openrct2/actions/RideSetPriceAction.cpp index dc17141888..18c2361f3c 100644 --- a/src/openrct2/actions/RideSetPriceAction.cpp +++ b/src/openrct2/actions/RideSetPriceAction.cpp @@ -54,14 +54,14 @@ GameActions::Result RideSetPriceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride entry not found for ride subtype %u", ride->subtype); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); } @@ -77,14 +77,14 @@ GameActions::Result RideSetPriceAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride entry not found for ride subtype %u", ride->subtype); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_OBJECT_ENTRY_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 1a09f71da3..11889fca79 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -60,7 +60,7 @@ GameActions::Result RideSetStatusAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = STR_NONE; @@ -124,7 +124,7 @@ GameActions::Result RideSetStatusAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for ride %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; res.ErrorMessage = STR_NONE; diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 2215d0c820..b976ed7df3 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -73,7 +73,7 @@ GameActions::Result RideSetVehicleAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } @@ -131,7 +131,7 @@ GameActions::Result RideSetVehicleAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command, ride_id = %u", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } diff --git a/src/openrct2/actions/SignSetNameAction.cpp b/src/openrct2/actions/SignSetNameAction.cpp index a11b9f2108..0761bd6a06 100644 --- a/src/openrct2/actions/SignSetNameAction.cpp +++ b/src/openrct2/actions/SignSetNameAction.cpp @@ -48,7 +48,7 @@ GameActions::Result SignSetNameAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid game command for setting sign name, banner id = %d", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } return GameActions::Result(); @@ -59,7 +59,7 @@ GameActions::Result SignSetNameAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid game command for setting sign name, banner id = %d", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_SIGN, STR_NONE); } diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 21bea7e237..5c5d96eb99 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -59,12 +59,13 @@ GameActions::Result SignSetStyleAction::Query() const TileElement* tileElement = BannerGetTileElement(_bannerIndex); if (tileElement == nullptr) { - LOG_ERROR("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); + LOG_ERROR("Banner tile element not found for bannerIndex %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } if (tileElement->GetType() != TileElementType::LargeScenery) { - LOG_ERROR("Invalid game command for setting sign style, banner id '%d' is not large", _bannerIndex); + 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); } } @@ -74,7 +75,7 @@ GameActions::Result SignSetStyleAction::Query() const if (wallElement == nullptr) { - LOG_ERROR("Invalid game command for setting sign style, banner id '%d' not found", _bannerIndex); + LOG_ERROR("Wall element not found for bannerIndex", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } } diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 2b00142885..4f9a3b0822 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -71,14 +71,14 @@ GameActions::Result StaffSetCostumeAction::Query() const auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } auto spriteType = EntertainerCostumeToSprite(_costume); if (EnumValue(spriteType) > std::size(peep_slow_walking_types)) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Invalid entertainer costume %u", _costume); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -90,7 +90,7 @@ GameActions::Result StaffSetCostumeAction::Execute() const auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index e22c22f2bf..d572db757f 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -55,7 +55,7 @@ GameActions::Result StaffSetNameAction::Query() const auto staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); } @@ -67,7 +67,7 @@ GameActions::Result StaffSetNameAction::Execute() const auto staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); } diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index 8830c1e27c..c2459a9782 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -53,7 +53,7 @@ GameActions::Result StaffSetOrdersAction::Query() const if (staff == nullptr || (staff->AssignedStaffType != StaffType::Handyman && staff->AssignedStaffType != StaffType::Mechanic)) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Staff orders can't be changed for staff of type %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); } @@ -66,7 +66,7 @@ GameActions::Result StaffSetOrdersAction::Execute() const auto* staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { - LOG_ERROR("Invalid game command for sprite %u", _spriteIndex); + LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } staff->StaffOrders = _ordersId; diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index 1394ef3745..ff1e0a9651 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -90,7 +90,7 @@ GameActions::Result TrackDesignAction::Query() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for track placement, ride id = %d", rideIndex); + LOG_ERROR("Ride not found for rideIndex %d", rideIndex); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } @@ -163,7 +163,7 @@ GameActions::Result TrackDesignAction::Execute() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid game command for track placement, ride id = %d", rideIndex); + LOG_ERROR("Ride not found for rideIndex %d", rideIndex); return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); } diff --git a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp index 00d03c67b1..9a96d6dcd9 100644 --- a/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp +++ b/src/openrct2/actions/TrackSetBrakeSpeedAction.cpp @@ -63,7 +63,7 @@ GameActions::Result TrackSetBrakeSpeedAction::QueryExecute(bool isExecuting) con TileElement* tileElement = MapGetTrackElementAtOfType(_loc, _trackType); if (tileElement == nullptr) { - LOG_ERROR("Invalid game command for setting brakes speed. x = %d, y = %d", _loc.x, _loc.y); + LOG_ERROR("Track element of type %u not found at x = %d, y = %d, z = %d", _trackType, _loc.x, _loc.y, _loc.z); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_TILE_ELEMENT_NOT_FOUND); } From 87ee06b7a48f1d854a48692a508e374dd85fcdda Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 22:45:25 -0700 Subject: [PATCH 159/191] Use `STR_ERR_RIDE_NOT_FOUND` when `ride==nullptr` --- src/openrct2/actions/RideDemolishAction.cpp | 4 ++-- src/openrct2/actions/RideEntranceExitPlaceAction.cpp | 4 ++-- src/openrct2/actions/RideSetNameAction.cpp | 6 ++++-- src/openrct2/actions/RideSetStatusAction.cpp | 4 ++-- src/openrct2/actions/RideSetVehicleAction.cpp | 4 ++-- src/openrct2/actions/TrackDesignAction.cpp | 6 ++++-- src/openrct2/actions/TrackRemoveAction.cpp | 6 ++++-- 7 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index ab3d37d749..c340274aca 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -61,7 +61,7 @@ GameActions::Result RideDemolishAction::Query() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); } if ((ride->lifecycle_flags & (RIDE_LIFECYCLE_INDESTRUCTIBLE | RIDE_LIFECYCLE_INDESTRUCTIBLE_TRACK) @@ -106,7 +106,7 @@ GameActions::Result RideDemolishAction::Execute() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DEMOLISH_RIDE, STR_ERR_RIDE_NOT_FOUND); } switch (_modifyType) diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index 11e2081516..cb16533a3c 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -59,7 +59,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND); } if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide) @@ -144,7 +144,7 @@ GameActions::Result RideEntranceExitPlaceAction::Execute() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_RIDE_NOT_FOUND); } if (!(GetFlags() & GAME_COMMAND_FLAG_GHOST)) diff --git a/src/openrct2/actions/RideSetNameAction.cpp b/src/openrct2/actions/RideSetNameAction.cpp index 572a2ee138..50117ba058 100644 --- a/src/openrct2/actions/RideSetNameAction.cpp +++ b/src/openrct2/actions/RideSetNameAction.cpp @@ -51,7 +51,8 @@ GameActions::Result RideSetNameAction::Query() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); } if (!_name.empty() && Ride::NameExists(_name, ride->id)) @@ -69,7 +70,8 @@ GameActions::Result RideSetNameAction::Execute() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_RENAME_RIDE_ATTRACTION, STR_ERR_RIDE_NOT_FOUND); } if (_name.empty()) diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index 11889fca79..daa37bc1f4 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -63,7 +63,7 @@ GameActions::Result RideSetStatusAction::Query() const LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -127,7 +127,7 @@ GameActions::Result RideSetStatusAction::Execute() const LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); res.Error = GameActions::Status::InvalidParameters; res.ErrorTitle = STR_RIDE_DESCRIPTION_UNKNOWN; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index b976ed7df3..1df9875ff0 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -74,7 +74,7 @@ GameActions::Result RideSetVehicleAction::Query() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); } if (ride->lifecycle_flags & RIDE_LIFECYCLE_BROKEN_DOWN) @@ -132,7 +132,7 @@ GameActions::Result RideSetVehicleAction::Execute() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_RIDE_NOT_FOUND); } switch (_type) diff --git a/src/openrct2/actions/TrackDesignAction.cpp b/src/openrct2/actions/TrackDesignAction.cpp index ff1e0a9651..989294fac2 100644 --- a/src/openrct2/actions/TrackDesignAction.cpp +++ b/src/openrct2/actions/TrackDesignAction.cpp @@ -91,7 +91,8 @@ GameActions::Result TrackDesignAction::Query() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %d", rideIndex); - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } bool placeScenery = true; @@ -164,7 +165,8 @@ GameActions::Result TrackDesignAction::Execute() const if (ride == nullptr) { LOG_ERROR("Ride not found for rideIndex %d", rideIndex); - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_ERR_RIDE_NOT_FOUND); } // Query first, this is required again to determine if scenery is available. diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index c13dc12c26..845afde32d 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -130,7 +130,8 @@ GameActions::Result TrackRemoveAction::Query() const if (ride == nullptr) { LOG_ERROR("Ride not found. ride index = %d.", rideIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); } if (ride->type >= RIDE_TYPE_COUNT) @@ -325,7 +326,8 @@ GameActions::Result TrackRemoveAction::Execute() const if (ride == nullptr) { LOG_ERROR("Ride not found. ride index = %d.", rideIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); } const auto& ted = GetTrackElementDescriptor(trackType); auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex(); From 9e702d8b658de907c6df3238e82d1157f1ed623b Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 22:54:56 -0700 Subject: [PATCH 160/191] Missed an instance of `ride == nullptr` --- src/openrct2/actions/RideSetSettingAction.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index ce61b7f6b1..e96d18a2ef 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -48,8 +48,9 @@ GameActions::Result RideSetSettingAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid ride: #%u.", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + LOG_ERROR("Ride not found for rideIndex %u.", _rideIndex.ToUnderlying()); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND); } switch (_setting) From a1517a4fcb148cbfafcb7f655b84d664fdc249ed Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 23:07:20 -0700 Subject: [PATCH 161/191] Use "X not found for Y" message style --- src/openrct2/actions/BalloonPressAction.cpp | 4 ++-- src/openrct2/actions/BannerPlaceAction.cpp | 4 ++-- src/openrct2/actions/BannerSetNameAction.cpp | 4 ++-- src/openrct2/actions/BannerSetStyleAction.cpp | 8 ++++---- src/openrct2/actions/GuestSetFlagsAction.cpp | 4 ++-- src/openrct2/actions/GuestSetNameAction.cpp | 4 ++-- src/openrct2/actions/LargeSceneryPlaceAction.cpp | 4 ++-- src/openrct2/actions/RideEntranceExitRemoveAction.cpp | 4 ++-- src/openrct2/actions/RideSetSettingAction.cpp | 5 +++-- src/openrct2/actions/RideSetVehicleAction.cpp | 6 +++--- src/openrct2/actions/SignSetStyleAction.cpp | 2 +- src/openrct2/actions/StaffFireAction.cpp | 4 ++-- src/openrct2/actions/StaffSetPatrolAreaAction.cpp | 2 +- 13 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/openrct2/actions/BalloonPressAction.cpp b/src/openrct2/actions/BalloonPressAction.cpp index f8e4fdc052..a59db7fe23 100644 --- a/src/openrct2/actions/BalloonPressAction.cpp +++ b/src/openrct2/actions/BalloonPressAction.cpp @@ -39,7 +39,7 @@ GameActions::Result BalloonPressAction::Query() const auto balloon = TryGetEntity(_spriteIndex); if (balloon == nullptr) { - LOG_ERROR("Tried getting invalid sprite for balloon: %u", _spriteIndex); + LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND); } @@ -51,7 +51,7 @@ GameActions::Result BalloonPressAction::Execute() const auto balloon = TryGetEntity(_spriteIndex); if (balloon == nullptr) { - LOG_ERROR("Tried getting invalid sprite for balloon: %u", _spriteIndex); + LOG_ERROR("Balloon not found for spriteIndex %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_BALLOON_NOT_FOUND); } diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 092233014f..043adcd996 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -98,7 +98,7 @@ GameActions::Result BannerPlaceAction::Query() const auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(_bannerType); if (bannerEntry == nullptr) { - LOG_ERROR("Invalid banner object type. bannerType = %u", _bannerType); + LOG_ERROR("Banner entry not found for bannerType %u", _bannerType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -126,7 +126,7 @@ GameActions::Result BannerPlaceAction::Execute() const auto* bannerEntry = OpenRCT2::ObjectManager::GetObjectEntry(_bannerType); if (bannerEntry == nullptr) { - LOG_ERROR("Invalid banner object type. bannerType = %u", _bannerType); + LOG_ERROR("Banner entry not found for bannerType %u", _bannerType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index c532252765..ca09e86f3d 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -47,7 +47,7 @@ GameActions::Result BannerSetNameAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id, banner id = %d", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); } return GameActions::Result(); @@ -58,7 +58,7 @@ GameActions::Result BannerSetNameAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id, banner id = %d", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); } diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index f4b18de9ee..389e772b2e 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -49,7 +49,7 @@ GameActions::Result BannerSetStyleAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner index %u", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -61,7 +61,7 @@ GameActions::Result BannerSetStyleAction::Query() const if (tileElement == nullptr) { - LOG_ERROR("Could not find banner index = %u", _bannerIndex); + LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -103,7 +103,7 @@ GameActions::Result BannerSetStyleAction::Execute() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner index %u", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } @@ -115,7 +115,7 @@ GameActions::Result BannerSetStyleAction::Execute() const if (tileElement == nullptr) { - LOG_ERROR("Could not find banner index = %u", _bannerIndex); + LOG_ERROR("Banner tile element not found for bannerIndex &u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/GuestSetFlagsAction.cpp b/src/openrct2/actions/GuestSetFlagsAction.cpp index 9a5f67ceef..eb70337657 100644 --- a/src/openrct2/actions/GuestSetFlagsAction.cpp +++ b/src/openrct2/actions/GuestSetFlagsAction.cpp @@ -42,7 +42,7 @@ GameActions::Result GuestSetFlagsAction::Query() const auto* peep = TryGetEntity(_peepId); if (peep == nullptr) { - LOG_ERROR("Used invalid sprite index for peep: %u", _peepId.ToUnderlying()); + 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(); @@ -53,7 +53,7 @@ GameActions::Result GuestSetFlagsAction::Execute() const auto* peep = TryGetEntity(_peepId); if (peep == nullptr) { - LOG_ERROR("Used invalid sprite index for peep: %u", _peepId.ToUnderlying()); + LOG_ERROR("Guest entity not found for peepID %u", _peepId.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_THIS, STR_NONE); } diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index 3483753cca..a1e0ebda35 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -64,7 +64,7 @@ GameActions::Result GuestSetNameAction::Query() const auto guest = TryGetEntity(_spriteIndex); if (guest == nullptr) { - LOG_ERROR("Guest not found for spriteIndex %u", _spriteIndex); + LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); } @@ -76,7 +76,7 @@ GameActions::Result GuestSetNameAction::Execute() const auto guest = TryGetEntity(_spriteIndex); if (guest == nullptr) { - LOG_ERROR("Guest not found for spriteIndex %u", _spriteIndex); + LOG_ERROR("Guest entity not found for spriteIndex %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); } diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 966e2a10da..6fdc7facb1 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -95,7 +95,7 @@ GameActions::Result LargeSceneryPlaceAction::Query() const auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { - LOG_ERROR("Scenery entry not found for sceneryType %u", _sceneryType); + LOG_ERROR("Large scenery entry not found for sceneryType %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -209,7 +209,7 @@ GameActions::Result LargeSceneryPlaceAction::Execute() const auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { - LOG_ERROR("Scenery entry not found for sceneryType = %u", _sceneryType); + LOG_ERROR("Large scenery entry not found for sceneryType = %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index 103e31b0a7..b4bdde8ec9 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -69,7 +69,7 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } @@ -114,7 +114,7 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid ride id %u for entrance/exit removal", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_RIDE_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index e96d18a2ef..9600d5b0a6 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -159,8 +159,9 @@ GameActions::Result RideSetSettingAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid ride: #%u.", _rideIndex.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex.ToUnderlying()); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_RIDE_NOT_FOUND); } switch (_setting) diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index 1df9875ff0..b811aef423 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -103,7 +103,7 @@ GameActions::Result RideSetVehicleAction::Query() const auto rideEntry = GetRideEntryByIndex(_value); if (rideEntry == nullptr) { - LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype); + LOG_ERROR("Ride entry not found for _value %d", _value); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } @@ -154,7 +154,7 @@ GameActions::Result RideSetVehicleAction::Execute() const auto rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype); + LOG_ERROR("Ride entry not found for index %d", ride->subtype); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } uint8_t clampValue = _value; @@ -177,7 +177,7 @@ GameActions::Result RideSetVehicleAction::Execute() const auto rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) { - LOG_ERROR("Invalid ride entry, ride->subtype = %d", ride->subtype); + LOG_ERROR("Ride entry not found for index %d", ride->subtype); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } diff --git a/src/openrct2/actions/SignSetStyleAction.cpp b/src/openrct2/actions/SignSetStyleAction.cpp index 5c5d96eb99..025e3f5742 100644 --- a/src/openrct2/actions/SignSetStyleAction.cpp +++ b/src/openrct2/actions/SignSetStyleAction.cpp @@ -50,7 +50,7 @@ GameActions::Result SignSetStyleAction::Query() const auto banner = GetBanner(_bannerIndex); if (banner == nullptr) { - LOG_ERROR("Invalid banner id %u", _bannerIndex); + LOG_ERROR("Banner not found for bannerIndex %u", _bannerIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/StaffFireAction.cpp b/src/openrct2/actions/StaffFireAction.cpp index bc5542de69..9cfc0dc218 100644 --- a/src/openrct2/actions/StaffFireAction.cpp +++ b/src/openrct2/actions/StaffFireAction.cpp @@ -46,7 +46,7 @@ GameActions::Result StaffFireAction::Query() const auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { - LOG_ERROR("Invalid spriteId %u", _spriteId); + 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); } @@ -67,7 +67,7 @@ GameActions::Result StaffFireAction::Execute() const auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { - LOG_ERROR("Invalid spriteId %u", _spriteId); + 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); diff --git a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp index 7317222be8..a2f235a972 100644 --- a/src/openrct2/actions/StaffSetPatrolAreaAction.cpp +++ b/src/openrct2/actions/StaffSetPatrolAreaAction.cpp @@ -60,7 +60,7 @@ GameActions::Result StaffSetPatrolAreaAction::QueryExecute(bool executing) const auto staff = TryGetEntity(_spriteId); if (staff == nullptr) { - LOG_ERROR("Invalid entity ID: %u", _spriteId.ToUnderlying()); + LOG_ERROR("Staff entity not found for spriteID %u", _spriteId.ToUnderlying()); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_STAFF_NOT_FOUND); } From f49fe68cc6d257aea61626a47c560c38fa454b5d Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 23:27:06 -0700 Subject: [PATCH 162/191] Improve messages for default case in switch stmt --- src/openrct2/actions/BannerSetStyleAction.cpp | 4 ++-- src/openrct2/actions/CheatSetAction.cpp | 2 +- src/openrct2/actions/LandBuyRightsAction.cpp | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/LandSmoothAction.cpp | 2 +- src/openrct2/actions/PeepPickupAction.cpp | 4 ++-- src/openrct2/actions/RideSetSettingAction.cpp | 2 +- src/openrct2/actions/RideSetStatusAction.cpp | 2 +- src/openrct2/actions/RideSetVehicleAction.cpp | 4 ++-- src/openrct2/actions/ScenarioSetSettingAction.cpp | 2 +- src/openrct2/actions/TileModifyAction.cpp | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 389e772b2e..7b4e515b2a 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -90,7 +90,7 @@ GameActions::Result BannerSetStyleAction::Query() const } break; default: - LOG_ERROR("Invalid type: %u", _type); + LOG_ERROR("Invalid banner style type %u", _type); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } return res; @@ -147,7 +147,7 @@ GameActions::Result BannerSetStyleAction::Execute() const break; } default: - LOG_ERROR("Invalid type: %u", _type); + LOG_ERROR("Invalid banner style type %u", _type); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); } diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 929ad83a06..7de0876370 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -259,7 +259,7 @@ GameActions::Result CheatSetAction::Execute() const break; default: { - LOG_ERROR("Unabled cheat: %d", _cheatType.id); + LOG_ERROR("Invalid cheat type %d", _cheatType.id); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 36d7c73ab1..a5c299f66d 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -170,7 +170,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& return res; default: - LOG_ERROR("Tried calling buy land rights with an incorrect setting %u", _setting); + LOG_ERROR("Invalid land buying setting %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } } diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index 223bd50e9a..e186ebe565 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -205,7 +205,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& return res; } default: - LOG_ERROR("Tried calling set land rights with an incorrect setting %u", _setting); + LOG_ERROR("Invalid setting %u to set land rights", _setting); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index bd311172d4..f60c26e8b1 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -607,7 +607,7 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const break; } default: - LOG_ERROR("Invalid map selection %u", _selectionType); + LOG_ERROR("Invalid map selection type %u", _selectionType); return GameActions::Result(GameActions::Status::InvalidParameters, std::get(res.ErrorTitle), STR_NONE); } // switch selectionType diff --git a/src/openrct2/actions/PeepPickupAction.cpp b/src/openrct2/actions/PeepPickupAction.cpp index 6cee870058..3978d3ddee 100644 --- a/src/openrct2/actions/PeepPickupAction.cpp +++ b/src/openrct2/actions/PeepPickupAction.cpp @@ -106,7 +106,7 @@ GameActions::Result PeepPickupAction::Query() const } break; default: - LOG_ERROR("Invalid pickup type: %u", _type); + LOG_ERROR("Invalid peep pickup type %u", _type); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } return res; @@ -175,7 +175,7 @@ GameActions::Result PeepPickupAction::Execute() const CancelConcurrentPickups(peep); break; default: - LOG_ERROR("Invalid pickup type: %u", _type); + LOG_ERROR("Invalid peep pickup type %u", _type); return GameActions::Result(GameActions::Status::InvalidParameters, STR_ERR_CANT_PLACE_PERSON_HERE, STR_NONE); } return res; diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 9600d5b0a6..4d1b926937 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -147,7 +147,7 @@ GameActions::Result RideSetSettingAction::Query() const } break; default: - LOG_ERROR("Invalid RideSetSetting: %u", static_cast(_setting)); + LOG_ERROR("Invalid ride setting %u", static_cast(_setting)); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); } diff --git a/src/openrct2/actions/RideSetStatusAction.cpp b/src/openrct2/actions/RideSetStatusAction.cpp index daa37bc1f4..f39cefb0c2 100644 --- a/src/openrct2/actions/RideSetStatusAction.cpp +++ b/src/openrct2/actions/RideSetStatusAction.cpp @@ -238,7 +238,7 @@ GameActions::Result RideSetStatusAction::Execute() const break; } default: - Guard::Assert(false, "Invalid status passed: %u", _status); + Guard::Assert(false, "Invalid ride status %u", _status); break; } auto windowManager = OpenRCT2::GetContext()->GetUiContext()->GetWindowManager(); diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index b811aef423..a852bfc866 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -118,7 +118,7 @@ GameActions::Result RideSetVehicleAction::Query() const } default: - LOG_ERROR("Unknown vehicle command. type = %d", _type); + LOG_ERROR("Invalid ride vehicle setting %d", _type); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } @@ -200,7 +200,7 @@ GameActions::Result RideSetVehicleAction::Execute() const } default: - LOG_ERROR("Unknown vehicle command. type = %d", _type); + LOG_ERROR("Invalid ride vehicle setting %d", _type); return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); } diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index bc64961cc0..2cf1857ca7 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -264,7 +264,7 @@ GameActions::Result ScenarioSetSettingAction::Execute() const break; } default: - LOG_ERROR("Invalid setting: %u", _setting); + LOG_ERROR("Invalid scenario setting %u", _setting); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/TileModifyAction.cpp b/src/openrct2/actions/TileModifyAction.cpp index 44da0b27d4..67fcd5677a 100644 --- a/src/openrct2/actions/TileModifyAction.cpp +++ b/src/openrct2/actions/TileModifyAction.cpp @@ -230,7 +230,7 @@ GameActions::Result TileModifyAction::QueryExecute(bool isExecuting) const break; } default: - LOG_ERROR("invalid instruction"); + LOG_ERROR("Invalid tile modification type %u", _setting); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } From 257c2d45d3a7440c44c0771def2ca4ac7d1ed74b Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 23:28:46 -0700 Subject: [PATCH 163/191] Change `if(elem!=nullptr)` to `if(elem==nullptr)` --- src/openrct2/actions/LargeSceneryRemoveAction.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index edcef4dc92..d79ce0ed53 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -184,14 +184,14 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const } auto* sceneryElement = FindLargeSceneryElement(currentTile, i); - if (sceneryElement != nullptr) + if (sceneryElement == nullptr) { - MapInvalidateTileFull(currentTile); - TileElementRemove(sceneryElement); + LOG_ERROR("Tile not found when trying to remove element!"); } else { - LOG_ERROR("Tile not found when trying to remove element!"); + MapInvalidateTileFull(currentTile); + TileElementRemove(sceneryElement); } } From 226fc4cb008b84d4e4dee3e9e74301dc5287217a Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 23:36:22 -0700 Subject: [PATCH 164/191] Add location to error messages --- src/openrct2/actions/FootpathAdditionPlaceAction.cpp | 4 ++-- src/openrct2/actions/FootpathAdditionRemoveAction.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index e4d78a015a..09038e1b1b 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -77,7 +77,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { - LOG_ERROR("Could not find path element."); + LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } @@ -153,7 +153,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const if (pathElement == nullptr) { - LOG_ERROR("Could not find path element."); + LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 435bdd453e..92af2ad446 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -69,14 +69,14 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { - LOG_ERROR("Could not find path element."); + LOG_ERROR("Could not find path element 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); } auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) { - LOG_ERROR("Could not find path element."); + LOG_ERROR("Could not find path element 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); } @@ -101,7 +101,7 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const if (pathElement == nullptr) { - LOG_ERROR("Could not find path element."); + LOG_ERROR("Could not find path element 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); } From 40537a17faa8d35c328abe1e9d91bdbc3a77196d Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 23:52:06 -0700 Subject: [PATCH 165/191] General cleanup of existing error messages --- src/openrct2/actions/LandBuyRightsAction.cpp | 2 +- src/openrct2/actions/RideCreateAction.cpp | 4 +++- .../actions/RideEntranceExitRemoveAction.cpp | 8 ++++---- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/actions/ScenarioSetSettingAction.cpp | 2 +- src/openrct2/actions/StaffHireNewAction.cpp | 12 +++--------- src/openrct2/actions/SurfaceSetStyleAction.cpp | 4 ++-- src/openrct2/actions/TrackPlaceAction.cpp | 4 ++-- src/openrct2/actions/TrackRemoveAction.cpp | 2 +- src/openrct2/actions/WallSetColourAction.cpp | 8 ++++++-- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index a5c299f66d..c48d333031 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -113,7 +113,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& { if (_setting >= LandBuyRightSetting::Count) { - LOG_ERROR("Tried calling buy land rights with an incorrect setting %u", _setting); + LOG_ERROR("Invalid land buying setting %u", _setting); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_NONE); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 759af38287..d6b86e9472 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -130,7 +130,9 @@ GameActions::Result RideCreateAction::Execute() const const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); if (rideEntry == nullptr) { - LOG_ERROR("Invalid request for ride %u", rideIndex); + LOG_ERROR( + "Ride entry not found for index rideEntryIndex %u (from rideType %u, subType %u)", rideEntryIndex, _rideType, + _subType); return GameActions::Result(GameActions::Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp index b4bdde8ec9..232f8ccad9 100644 --- a/src/openrct2/actions/RideEntranceExitRemoveAction.cpp +++ b/src/openrct2/actions/RideEntranceExitRemoveAction.cpp @@ -100,8 +100,8 @@ GameActions::Result RideEntranceExitRemoveAction::Query() const else if (entranceElement == nullptr) { LOG_ERROR( - "Entrance element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, _rideIndex.ToUnderlying(), - _stationNum.ToUnderlying()); + "Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %u", _loc.x, _loc.y, + _rideIndex.ToUnderlying(), _stationNum.ToUnderlying()); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); } @@ -138,8 +138,8 @@ GameActions::Result RideEntranceExitRemoveAction::Execute() const else if (entranceElement == nullptr) { LOG_ERROR( - "Entrance element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, _rideIndex.ToUnderlying(), - _stationNum); + "Entrance/exit element not found. x = %d, y = %d, ride = %u, station = %d", _loc.x, _loc.y, + _rideIndex.ToUnderlying(), _stationNum); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ENTRANCE_ELEMENT_NOT_FOUND); } diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index a852bfc866..fc9892e309 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -66,7 +66,7 @@ GameActions::Result RideSetVehicleAction::Query() const { if (_type >= RideSetVehicleType::Count) { - LOG_ERROR("Invalid type %d", _type); + LOG_ERROR("Invalid ride vehicle type %d", _type); } auto errTitle = SetVehicleTypeErrorTitle[EnumValue(_type)]; diff --git a/src/openrct2/actions/ScenarioSetSettingAction.cpp b/src/openrct2/actions/ScenarioSetSettingAction.cpp index 2cf1857ca7..87043377e8 100644 --- a/src/openrct2/actions/ScenarioSetSettingAction.cpp +++ b/src/openrct2/actions/ScenarioSetSettingAction.cpp @@ -39,7 +39,7 @@ GameActions::Result ScenarioSetSettingAction::Query() const { if (_setting >= ScenarioSetSetting::Count) { - LOG_ERROR("Invalid setting: %u", _setting); + LOG_ERROR("Invalid scenario setting: %u", _setting); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 421383008a..3eadb187b9 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -85,9 +85,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const if (_staffType >= static_cast(StaffType::Count)) { - // Invalid staff type. - LOG_ERROR("Tried to use invalid staff type: %u", static_cast(_staffType)); - + LOG_ERROR("Invalid staff type %u", static_cast(_staffType)); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); } @@ -100,18 +98,14 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const { if (static_cast(_entertainerType) >= static_cast(EntertainerCostume::Count)) { - // Invalid entertainer costume - LOG_ERROR("Tried to use invalid entertainer type: %u", static_cast(_entertainerType)); - + LOG_ERROR("Invalid entertainer type %u", static_cast(_entertainerType)); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); } uint32_t availableCostumes = StaffGetAvailableEntertainerCostumes(); if (!(availableCostumes & (1 << static_cast(_entertainerType)))) { - // Entertainer costume unavailable - LOG_ERROR("Tried to use unavailable entertainer type: %u", static_cast(_entertainerType)); - + LOG_ERROR("Unavailable entertainer costume %u", static_cast(_entertainerType)); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); } } diff --git a/src/openrct2/actions/SurfaceSetStyleAction.cpp b/src/openrct2/actions/SurfaceSetStyleAction.cpp index 7e3205cdfd..658f38f2ea 100644 --- a/src/openrct2/actions/SurfaceSetStyleAction.cpp +++ b/src/openrct2/actions/SurfaceSetStyleAction.cpp @@ -58,7 +58,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const if (surfaceObj == nullptr) { - LOG_ERROR("Invalid surface style."); + LOG_ERROR("Invalid surface style %u", _surfaceStyle); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE); } @@ -70,7 +70,7 @@ GameActions::Result SurfaceSetStyleAction::Query() const if (edgeObj == nullptr) { - LOG_ERROR("Invalid edge style."); + LOG_ERROR("Invalid edge style %u", _edgeStyle); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CHANGE_LAND_TYPE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index 21188c1508..d35a951756 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -72,9 +72,9 @@ GameActions::Result TrackPlaceAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { - LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); + LOG_ERROR("Ride not found for rideIndex %d", _rideIndex.ToUnderlying()); 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, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); if (rideEntry == nullptr) diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index 845afde32d..ed25b558d2 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -129,7 +129,7 @@ GameActions::Result TrackRemoveAction::Query() const auto ride = GetRide(rideIndex); if (ride == nullptr) { - LOG_ERROR("Ride not found. ride index = %d.", rideIndex); + LOG_ERROR("Ride not found for rideIndex %d.", rideIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_RIDE_NOT_FOUND); } diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 917d120a6e..7690a8bc61 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -87,7 +87,9 @@ GameActions::Result WallSetColourAction::Query() const auto* wallEntry = wallElement->GetEntry(); if (wallEntry == nullptr) { - LOG_ERROR("Could not find wall object"); + 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); } @@ -139,7 +141,9 @@ GameActions::Result WallSetColourAction::Execute() const auto* wallEntry = wallElement->GetEntry(); if (wallEntry == nullptr) { - LOG_ERROR("Could not find wall object"); + 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); } From d1f740c786681fbbab4adae1f71c411574580eb0 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sat, 16 Mar 2024 23:58:10 -0700 Subject: [PATCH 166/191] Change "Could not find X" to "No X" --- src/openrct2/actions/BannerSetColourAction.cpp | 2 +- src/openrct2/actions/FootpathAdditionPlaceAction.cpp | 4 ++-- src/openrct2/actions/FootpathAdditionRemoveAction.cpp | 6 +++--- src/openrct2/actions/LandBuyRightsAction.cpp | 2 +- src/openrct2/actions/LandSetRightsAction.cpp | 2 +- src/openrct2/actions/ParkEntranceRemoveAction.cpp | 4 ++-- src/openrct2/actions/WaterSetHeightAction.cpp | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 95c421986f..25732f1364 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -79,7 +79,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const if (bannerElement == nullptr) { - LOG_ERROR("Could not find banner at: x = %d, y = %d, z = %d, direction = %u", _loc.x, _loc.y, _loc.z, _loc.direction); + LOG_ERROR("No banner 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); } diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 09038e1b1b..963a191b2d 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -77,7 +77,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { - LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } @@ -153,7 +153,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const if (pathElement == nullptr) { - LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); } diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 92af2ad446..3b0e25673f 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -69,14 +69,14 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const auto tileElement = MapGetFootpathElement(_loc); if (tileElement == nullptr) { - LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + LOG_ERROR("No path element 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); } auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) { - LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + LOG_ERROR("No path element 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); } @@ -101,7 +101,7 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const if (pathElement == nullptr) { - LOG_ERROR("Could not find path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + LOG_ERROR("No path element 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); } diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index c48d333031..70847ee2a2 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -120,7 +120,7 @@ GameActions::Result LandBuyRightsAction::MapBuyLandRightsForTile(const CoordsXY& SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { - LOG_ERROR("Could not find surface. x = %d, y = %d", loc.x, loc.y); + LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_NONE); } diff --git a/src/openrct2/actions/LandSetRightsAction.cpp b/src/openrct2/actions/LandSetRightsAction.cpp index e186ebe565..4c46710c6f 100644 --- a/src/openrct2/actions/LandSetRightsAction.cpp +++ b/src/openrct2/actions/LandSetRightsAction.cpp @@ -116,7 +116,7 @@ GameActions::Result LandSetRightsAction::MapBuyLandRightsForTile(const CoordsXY& SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { - LOG_ERROR("Could not find surface. x = %d, y = %d", loc.x, loc.y); + LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } diff --git a/src/openrct2/actions/ParkEntranceRemoveAction.cpp b/src/openrct2/actions/ParkEntranceRemoveAction.cpp index 31616d0ba7..8aeaa39793 100644 --- a/src/openrct2/actions/ParkEntranceRemoveAction.cpp +++ b/src/openrct2/actions/ParkEntranceRemoveAction.cpp @@ -57,7 +57,7 @@ GameActions::Result ParkEntranceRemoveAction::Query() const } if (ParkEntranceGetIndex(_loc) == -1) { - LOG_ERROR("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + 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 res; @@ -73,7 +73,7 @@ GameActions::Result ParkEntranceRemoveAction::Execute() const auto entranceIndex = ParkEntranceGetIndex(_loc); if (entranceIndex == -1) { - LOG_ERROR("Could not find entrance at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); + 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); } diff --git a/src/openrct2/actions/WaterSetHeightAction.cpp b/src/openrct2/actions/WaterSetHeightAction.cpp index c16193793f..ab472abb02 100644 --- a/src/openrct2/actions/WaterSetHeightAction.cpp +++ b/src/openrct2/actions/WaterSetHeightAction.cpp @@ -76,7 +76,7 @@ GameActions::Result WaterSetHeightAction::Query() const SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) { - LOG_ERROR("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); + LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } @@ -123,7 +123,7 @@ GameActions::Result WaterSetHeightAction::Execute() const SurfaceElement* surfaceElement = MapGetSurfaceElementAt(_coords); if (surfaceElement == nullptr) { - LOG_ERROR("Could not find surface element at: x %u, y %u", _coords.x, _coords.y); + LOG_ERROR("No surface element at: x %u, y %u", _coords.x, _coords.y); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } From 1f698dfc765640ce34fbcd91100a81babd0e3291 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sun, 17 Mar 2024 00:19:56 -0700 Subject: [PATCH 167/191] Add `LOG_ERROR` calls --- src/openrct2/actions/CheatSetAction.cpp | 7 +++++++ src/openrct2/actions/ClimateSetAction.cpp | 1 + .../actions/FootpathAdditionPlaceAction.cpp | 2 ++ .../actions/LargeScenerySetColourAction.cpp | 2 +- src/openrct2/actions/MazePlaceTrackAction.cpp | 6 ++++-- src/openrct2/actions/MazeSetTrackAction.cpp | 6 ++++-- src/openrct2/actions/ParkSetDateAction.cpp | 15 ++++++++++++++- src/openrct2/actions/ParkSetEntranceFeeAction.cpp | 14 +++++++++++--- src/openrct2/actions/ParkSetNameAction.cpp | 1 + src/openrct2/actions/ParkSetParameterAction.cpp | 2 ++ .../actions/ParkSetResearchFundingAction.cpp | 1 + src/openrct2/actions/RideCreateAction.cpp | 4 ++++ src/openrct2/actions/RideDemolishAction.cpp | 5 +++-- src/openrct2/actions/SmallSceneryPlaceAction.cpp | 2 ++ src/openrct2/actions/SmallSceneryRemoveAction.cpp | 3 +++ src/openrct2/actions/StaffSetColourAction.cpp | 1 + src/openrct2/actions/StaffSetCostumeAction.cpp | 1 + src/openrct2/actions/StaffSetNameAction.cpp | 1 + src/openrct2/actions/StaffSetOrdersAction.cpp | 1 + 19 files changed, 64 insertions(+), 11 deletions(-) diff --git a/src/openrct2/actions/CheatSetAction.cpp b/src/openrct2/actions/CheatSetAction.cpp index 7de0876370..30d2c73b4f 100644 --- a/src/openrct2/actions/CheatSetAction.cpp +++ b/src/openrct2/actions/CheatSetAction.cpp @@ -72,6 +72,7 @@ GameActions::Result CheatSetAction::Query() const { if (static_cast(_cheatType) >= static_cast(CheatType::Count)) { + LOG_ERROR("Invalid cheat type %u", _cheatType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -80,11 +81,17 @@ GameActions::Result CheatSetAction::Query() const if (_param1 < validRange.first.first || _param1 > validRange.first.second) { + LOG_ERROR( + "The first cheat parameter is out of range. Value = %d, min = %d, max = %d", _param1, validRange.first.first, + validRange.first.second); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } if (_param2 < validRange.second.first || _param2 > validRange.second.second) { + LOG_ERROR( + "The second cheat parameter is out of range. Value = %d, min = %d, max = %d", _param2, validRange.second.first, + validRange.second.second); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/ClimateSetAction.cpp b/src/openrct2/actions/ClimateSetAction.cpp index 6b3b3f99a0..a93198d916 100644 --- a/src/openrct2/actions/ClimateSetAction.cpp +++ b/src/openrct2/actions/ClimateSetAction.cpp @@ -37,6 +37,7 @@ GameActions::Result ClimateSetAction::Query() const { if (_climate >= ClimateType::Count) { + LOG_ERROR("Invalid climate type %u", _climate); return GameActions::Result(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_NONE); } diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 963a191b2d..16946685b1 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -99,6 +99,7 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry(_entryIndex); if (pathAdditionEntry == nullptr) { + LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -167,6 +168,7 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const auto* pathAdditionEntry = OpenRCT2::ObjectManager::GetObjectEntry(_entryIndex); if (pathAdditionEntry == nullptr) { + LOG_ERROR("Unknown footpath addition entry for entryIndex %d", _entryIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 45baec04fb..5bf3b72493 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -110,7 +110,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (sceneryEntry == nullptr) { - LOG_ERROR("Could not find scenery object. type = %u", largeElement->GetEntryIndex()); + LOG_ERROR("Scenery element doesn't have scenery entry"); return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REPAINT_THIS, STR_NONE); } // Work out the base tile coordinates (Tile with index 0) diff --git a/src/openrct2/actions/MazePlaceTrackAction.cpp b/src/openrct2/actions/MazePlaceTrackAction.cpp index 00d7329912..f0f4019c22 100644 --- a/src/openrct2/actions/MazePlaceTrackAction.cpp +++ b/src/openrct2/actions/MazePlaceTrackAction.cpp @@ -122,8 +122,9 @@ GameActions::Result MazePlaceTrackAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr || ride->type == RIDE_TYPE_NULL) { + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); res.Error = GameActions::Status::InvalidParameters; - res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS; + res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -143,8 +144,9 @@ GameActions::Result MazePlaceTrackAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); res.Error = GameActions::Status::InvalidParameters; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 87c1da6a0d..43d1996952 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -168,8 +168,9 @@ GameActions::Result MazeSetTrackAction::Query() const auto ride = GetRide(_rideIndex); if (ride == nullptr || ride->type == RIDE_CRASH_TYPE_NONE) { + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); res.Error = GameActions::Status::NoClearance; - res.ErrorMessage = STR_INVALID_SELECTION_OF_OBJECTS; + res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } @@ -192,8 +193,9 @@ GameActions::Result MazeSetTrackAction::Execute() const auto ride = GetRide(_rideIndex); if (ride == nullptr) { + LOG_ERROR("Ride not found for rideIndex %u", _rideIndex); res.Error = GameActions::Status::InvalidParameters; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = STR_ERR_RIDE_NOT_FOUND; return res; } diff --git a/src/openrct2/actions/ParkSetDateAction.cpp b/src/openrct2/actions/ParkSetDateAction.cpp index c3cffccb5e..9df4808a6a 100644 --- a/src/openrct2/actions/ParkSetDateAction.cpp +++ b/src/openrct2/actions/ParkSetDateAction.cpp @@ -45,8 +45,21 @@ void ParkSetDateAction::Serialise(DataSerialiser& stream) GameActions::Result ParkSetDateAction::Query() const { - if (_year < 0 || _year >= kMaxYear || _month < 0 || _month >= MONTH_COUNT || _day < 0 || _day >= 31) + if (_year < 0 || _year >= kMaxYear) { + LOG_ERROR("Invalid park date year %d", _year); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + } + if (_month < 0 || _month >= MONTH_COUNT) + { + LOG_ERROR("Invalid park date month %d", _year); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + } + if (_day < 0 || _day >= 31) + { + LOG_ERROR("Invalid park date day %d", _year); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index 773f607717..d506f09cf7 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -42,17 +42,25 @@ void ParkSetEntranceFeeAction::Serialise(DataSerialiser& stream) GameActions::Result ParkSetEntranceFeeAction::Query() const { - bool noMoney = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0; - bool forceFreeEntry = !ParkEntranceFeeUnlocked(); - if (noMoney || forceFreeEntry) + if ((GetGameState().ParkFlags & 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); } + + if (!ParkEntranceFeeUnlocked()) + { + LOG_ERROR("Park entrance fee is locked"); + return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); + } + if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE) { + LOG_ERROR("Invalid park entrance fee %d", _fee); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } + return GameActions::Result(); } diff --git a/src/openrct2/actions/ParkSetNameAction.cpp b/src/openrct2/actions/ParkSetNameAction.cpp index 2969319f15..549d99a1bf 100644 --- a/src/openrct2/actions/ParkSetNameAction.cpp +++ b/src/openrct2/actions/ParkSetNameAction.cpp @@ -47,6 +47,7 @@ GameActions::Result ParkSetNameAction::Query() const { if (_name.empty()) { + LOG_ERROR("Can't set park name to empty string"); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_PARK, STR_INVALID_NAME_FOR_PARK); } return GameActions::Result(); diff --git a/src/openrct2/actions/ParkSetParameterAction.cpp b/src/openrct2/actions/ParkSetParameterAction.cpp index 0da59e5072..83d4ad1030 100644 --- a/src/openrct2/actions/ParkSetParameterAction.cpp +++ b/src/openrct2/actions/ParkSetParameterAction.cpp @@ -44,6 +44,7 @@ GameActions::Result ParkSetParameterAction::Query() const { if (_parameter >= ParkParameter::Count) { + LOG_ERROR("Invalid park parameter %d", _parameter); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } @@ -77,6 +78,7 @@ GameActions::Result ParkSetParameterAction::Execute() const WindowInvalidateByClass(WindowClass::Ride); break; default: + LOG_ERROR("Invalid park parameter %d", _parameter); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/ParkSetResearchFundingAction.cpp b/src/openrct2/actions/ParkSetResearchFundingAction.cpp index 23867fadc3..ccb0f955eb 100644 --- a/src/openrct2/actions/ParkSetResearchFundingAction.cpp +++ b/src/openrct2/actions/ParkSetResearchFundingAction.cpp @@ -47,6 +47,7 @@ GameActions::Result ParkSetResearchFundingAction::Query() const { if (_fundingAmount >= RESEARCH_FUNDING_COUNT) { + LOG_ERROR("Invalid research funding amount %d", _fundingAmount); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index d6b86e9472..64976dee44 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -83,6 +83,7 @@ GameActions::Result RideCreateAction::Query() const if (_rideType >= RIDE_TYPE_COUNT) { + LOG_ERROR("Invalid ride type %d", _rideType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); } @@ -90,6 +91,7 @@ GameActions::Result RideCreateAction::Query() const int32_t rideEntryIndex = RideGetEntryIndex(_rideType, _subType); if (rideEntryIndex >= MAX_RIDE_OBJECTS) { + LOG_ERROR("Ride entry not found for rideType %d, subType %d", _rideType, _subType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_INVALID_RIDE_TYPE); } @@ -97,12 +99,14 @@ GameActions::Result RideCreateAction::Query() const const auto& colourPresets = GetRideTypeDescriptor(_rideType).ColourPresets; if (_colour1 >= colourPresets.count) { + LOG_ERROR("Can't create ride, invalid colour preset %d", _colour1); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_NONE); } const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); if (rideEntry == nullptr) { + LOG_ERROR("Ride entry not found for rideEntryIndex %d", rideEntryIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index c340274aca..dbcd2e83a0 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -115,9 +115,10 @@ GameActions::Result RideDemolishAction::Execute() const return DemolishRide(*ride); case RIDE_MODIFY_RENEW: return RefurbishRide(*ride); + default: + LOG_ERROR("Unknown ride demolish type %d", _modifyType); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); } - - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); } GameActions::Result RideDemolishAction::DemolishRide(Ride& ride) const diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 0b9c2a5909..961f161de9 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -121,6 +121,7 @@ GameActions::Result SmallSceneryPlaceAction::Query() const auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { + LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } @@ -316,6 +317,7 @@ GameActions::Result SmallSceneryPlaceAction::Execute() const auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); if (sceneryEntry == nullptr) { + LOG_ERROR("Small scenery object entry not found for sceneryType %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); } diff --git a/src/openrct2/actions/SmallSceneryRemoveAction.cpp b/src/openrct2/actions/SmallSceneryRemoveAction.cpp index fc70ff8c4f..b52f741923 100644 --- a/src/openrct2/actions/SmallSceneryRemoveAction.cpp +++ b/src/openrct2/actions/SmallSceneryRemoveAction.cpp @@ -66,6 +66,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const auto* entry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); if (entry == nullptr) { + LOG_ERROR("Invalid small scenery type %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } @@ -102,6 +103,7 @@ GameActions::Result SmallSceneryRemoveAction::Query() const TileElement* tileElement = FindSceneryElement(); if (tileElement == nullptr) { + LOG_ERROR("Small scenery of type %u not found at x = %d, y = %d, z = &d", _sceneryType, _loc.x, _loc.y, _loc.z); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } @@ -116,6 +118,7 @@ GameActions::Result SmallSceneryRemoveAction::Execute() const auto* entry = OpenRCT2::ObjectManager::GetObjectEntry(_sceneryType); if (entry == nullptr) { + LOG_ERROR("Invalid small scenery type %u", _sceneryType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_CANT_REMOVE_THIS, STR_INVALID_SELECTION_OF_OBJECTS); } diff --git a/src/openrct2/actions/StaffSetColourAction.cpp b/src/openrct2/actions/StaffSetColourAction.cpp index 515ca77f4a..e88b14559b 100644 --- a/src/openrct2/actions/StaffSetColourAction.cpp +++ b/src/openrct2/actions/StaffSetColourAction.cpp @@ -47,6 +47,7 @@ GameActions::Result StaffSetColourAction::Query() const auto staffType = static_cast(_staffType); if (staffType != StaffType::Handyman && staffType != StaffType::Mechanic && staffType != StaffType::Security) { + LOG_ERROR("Staff color can't be changed for staff type %d", _staffType); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_ACTION_INVALID_FOR_THAT_STAFF_TYPE); } diff --git a/src/openrct2/actions/StaffSetCostumeAction.cpp b/src/openrct2/actions/StaffSetCostumeAction.cpp index 4f9a3b0822..72e822a6ce 100644 --- a/src/openrct2/actions/StaffSetCostumeAction.cpp +++ b/src/openrct2/actions/StaffSetCostumeAction.cpp @@ -64,6 +64,7 @@ GameActions::Result StaffSetCostumeAction::Query() const { if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) { + LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index d572db757f..209c40f264 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -49,6 +49,7 @@ GameActions::Result StaffSetNameAction::Query() const { if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) { + LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); } diff --git a/src/openrct2/actions/StaffSetOrdersAction.cpp b/src/openrct2/actions/StaffSetOrdersAction.cpp index c2459a9782..8ecac4c61d 100644 --- a/src/openrct2/actions/StaffSetOrdersAction.cpp +++ b/src/openrct2/actions/StaffSetOrdersAction.cpp @@ -45,6 +45,7 @@ GameActions::Result StaffSetOrdersAction::Query() const { if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) { + LOG_ERROR("Invalid sprite index %u", _spriteIndex); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } From 276ff311cf65cd36abd5aadfb3ac8ccce5747d12 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sun, 17 Mar 2024 00:20:29 -0700 Subject: [PATCH 168/191] Add `LOG_WARNING` about bugged scenery entry --- src/openrct2/actions/LargeSceneryRemoveAction.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index d79ce0ed53..879ec229f8 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -73,7 +73,10 @@ GameActions::Result LargeSceneryRemoveAction::Query() const auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); // If we have a bugged scenery entry, do not touch the tile element. if (sceneryEntry == nullptr) - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE); + { + 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_UNKNOWN_OBJECT_TYPE); auto rotatedOffsets = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].x_offset, sceneryEntry->tiles[_tileIndex].y_offset }.Rotate(_loc.direction), @@ -155,7 +158,10 @@ GameActions::Result LargeSceneryRemoveAction::Execute() const auto* sceneryEntry = tileElement->AsLargeScenery()->GetEntry(); // If we have a bugged scenery entry, do not touch the tile element. 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); + } tileElement->RemoveBannerEntry(); From 2b1d5ad9b704124686bbdc9cc143b80fb67e9fc4 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sun, 17 Mar 2024 00:48:36 -0700 Subject: [PATCH 169/191] Use specific error stringIDs --- src/openrct2/actions/BannerPlaceAction.cpp | 4 +-- .../actions/BannerSetColourAction.cpp | 2 +- src/openrct2/actions/BannerSetNameAction.cpp | 6 +++-- src/openrct2/actions/BannerSetStyleAction.cpp | 18 ++++++++----- src/openrct2/actions/ClimateSetAction.cpp | 2 +- .../actions/FootpathAdditionPlaceAction.cpp | 6 +++-- .../actions/FootpathAdditionRemoveAction.cpp | 9 ++++--- .../actions/FootpathLayoutPlaceAction.cpp | 6 +++-- src/openrct2/actions/FootpathPlaceAction.cpp | 9 ++++--- src/openrct2/actions/FootpathRemoveAction.cpp | 3 ++- src/openrct2/actions/GuestSetNameAction.cpp | 2 +- src/openrct2/actions/LandBuyRightsAction.cpp | 7 ++--- src/openrct2/actions/LandSmoothAction.cpp | 3 ++- .../actions/LargeSceneryPlaceAction.cpp | 3 ++- .../actions/LargeScenerySetColourAction.cpp | 2 +- src/openrct2/actions/MapChangeSizeAction.cpp | 6 +++-- src/openrct2/actions/MazeSetTrackAction.cpp | 2 +- src/openrct2/actions/ParkMarketingAction.cpp | 3 ++- src/openrct2/actions/PeepSpawnPlaceAction.cpp | 3 ++- src/openrct2/actions/RideDemolishAction.cpp | 2 +- .../actions/RideEntranceExitPlaceAction.cpp | 2 +- src/openrct2/actions/RideSetSettingAction.cpp | 24 +++++++++++------ src/openrct2/actions/RideSetVehicleAction.cpp | 4 +-- .../actions/SmallSceneryPlaceAction.cpp | 3 ++- src/openrct2/actions/StaffHireNewAction.cpp | 8 +++--- src/openrct2/actions/StaffSetNameAction.cpp | 9 ++++--- src/openrct2/actions/TrackPlaceAction.cpp | 17 +++++++----- src/openrct2/actions/TrackRemoveAction.cpp | 27 ++++++++++++------- src/openrct2/actions/WallPlaceAction.cpp | 9 ++++--- src/openrct2/actions/WallSetColourAction.cpp | 3 ++- 30 files changed, 131 insertions(+), 73 deletions(-) diff --git a/src/openrct2/actions/BannerPlaceAction.cpp b/src/openrct2/actions/BannerPlaceAction.cpp index 043adcd996..19830294b6 100644 --- a/src/openrct2/actions/BannerPlaceAction.cpp +++ b/src/openrct2/actions/BannerPlaceAction.cpp @@ -100,7 +100,7 @@ GameActions::Result BannerPlaceAction::Query() const { LOG_ERROR("Banner entry not found for bannerType %u", _bannerType); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } res.Cost = bannerEntry->price; @@ -128,7 +128,7 @@ GameActions::Result BannerPlaceAction::Execute() const { LOG_ERROR("Banner entry not found for bannerType %u", _bannerType); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_UNKNOWN_OBJECT_TYPE); + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } auto banner = CreateBanner(); diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index 25732f1364..b2e6a8c256 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -80,7 +80,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const if (bannerElement == nullptr) { LOG_ERROR("No banner 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, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } auto index = bannerElement->GetIndex(); diff --git a/src/openrct2/actions/BannerSetNameAction.cpp b/src/openrct2/actions/BannerSetNameAction.cpp index ca09e86f3d..a9c52faafa 100644 --- a/src/openrct2/actions/BannerSetNameAction.cpp +++ b/src/openrct2/actions/BannerSetNameAction.cpp @@ -48,7 +48,8 @@ GameActions::Result BannerSetNameAction::Query() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } return GameActions::Result(); } @@ -59,7 +60,8 @@ GameActions::Result BannerSetNameAction::Execute() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_RENAME_BANNER, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } banner->text = _name; diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 7b4e515b2a..95faf21054 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -50,7 +50,8 @@ GameActions::Result BannerSetStyleAction::Query() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } res.Expenditure = ExpenditureType::Landscaping; @@ -62,7 +63,8 @@ GameActions::Result BannerSetStyleAction::Query() const if (tileElement == nullptr) { LOG_ERROR("Banner tile element not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } switch (_type) @@ -91,7 +93,8 @@ GameActions::Result BannerSetStyleAction::Query() const break; default: LOG_ERROR("Invalid banner style type %u", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } return res; } @@ -104,7 +107,8 @@ GameActions::Result BannerSetStyleAction::Execute() const if (banner == nullptr) { LOG_ERROR("Banner not found for bannerIndex %d", _bannerIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } res.Expenditure = ExpenditureType::Landscaping; @@ -133,7 +137,8 @@ GameActions::Result BannerSetStyleAction::Execute() const if (bannerElement == 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, STR_ERR_BANNER_ELEMENT_NOT_FOUND); } banner->flags &= ~BANNER_FLAG_NO_ENTRY; @@ -148,7 +153,8 @@ GameActions::Result BannerSetStyleAction::Execute() const } default: LOG_ERROR("Invalid banner style type %u", _type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } auto intent = Intent(INTENT_ACTION_UPDATE_BANNER); diff --git a/src/openrct2/actions/ClimateSetAction.cpp b/src/openrct2/actions/ClimateSetAction.cpp index a93198d916..09ec9a08a7 100644 --- a/src/openrct2/actions/ClimateSetAction.cpp +++ b/src/openrct2/actions/ClimateSetAction.cpp @@ -38,7 +38,7 @@ GameActions::Result ClimateSetAction::Query() const if (_climate >= ClimateType::Count) { LOG_ERROR("Invalid climate type %u", _climate); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_INVALID_CLIMATE_ID, STR_ERR_VALUE_OUT_OF_RANGE); } return GameActions::Result(); diff --git a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp index 16946685b1..e49cdd8849 100644 --- a/src/openrct2/actions/FootpathAdditionPlaceAction.cpp +++ b/src/openrct2/actions/FootpathAdditionPlaceAction.cpp @@ -78,7 +78,8 @@ GameActions::Result FootpathAdditionPlaceAction::Query() const if (tileElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); } auto pathElement = tileElement->AsPath(); @@ -155,7 +156,8 @@ GameActions::Result FootpathAdditionPlaceAction::Execute() const if (pathElement == nullptr) { LOG_ERROR("No path element at x = %d, y = %d, z = %d", _loc.x, _loc.y, _loc.z); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_PATH_ELEMENT_NOT_FOUND); } // No change diff --git a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp index 3b0e25673f..2bff554683 100644 --- a/src/openrct2/actions/FootpathAdditionRemoveAction.cpp +++ b/src/openrct2/actions/FootpathAdditionRemoveAction.cpp @@ -70,14 +70,16 @@ GameActions::Result FootpathAdditionRemoveAction::Query() const if (tileElement == nullptr) { LOG_ERROR("No path element 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, STR_ERR_PATH_ELEMENT_NOT_FOUND); } auto pathElement = tileElement->AsPath(); if (pathElement == nullptr) { LOG_ERROR("No path element 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, STR_ERR_PATH_ELEMENT_NOT_FOUND); } if (!pathElement->AdditionIsGhost() && (GetFlags() & GAME_COMMAND_FLAG_GHOST)) @@ -102,7 +104,8 @@ GameActions::Result FootpathAdditionRemoveAction::Execute() const if (pathElement == nullptr) { LOG_ERROR("No path element 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, STR_ERR_PATH_ELEMENT_NOT_FOUND); } pathElement->SetAddition(0); diff --git a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp index 734c2d5b38..c24cfaac2e 100644 --- a/src/openrct2/actions/FootpathLayoutPlaceAction.cpp +++ b/src/openrct2/actions/FootpathLayoutPlaceAction.cpp @@ -177,7 +177,8 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertQuery(GameActions::R if (surfaceElement == nullptr) { 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, + STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP; @@ -241,7 +242,8 @@ GameActions::Result FootpathLayoutPlaceAction::ElementInsertExecute(GameActions: if (surfaceElement == nullptr) { 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, + STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP; diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index 4ea04b0f3d..a082cb6097 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -101,7 +101,8 @@ GameActions::Result FootpathPlaceAction::Query() const if (_direction != INVALID_DIRECTION && !DirectionValid(_direction)) { LOG_ERROR("Direction invalid. direction = %u", _direction); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } FootpathProvisionalRemove(); @@ -323,7 +324,8 @@ GameActions::Result FootpathPlaceAction::ElementInsertQuery(GameActions::Result auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP; @@ -386,7 +388,8 @@ GameActions::Result FootpathPlaceAction::ElementInsertExecute(GameActions::Resul auto surfaceElement = MapGetSurfaceElementAt(_loc); if (surfaceElement == nullptr) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_BUILD_FOOTPATH_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = zLow - surfaceElement->GetBaseZ(); res.Cost += supportHeight < 0 ? 20.00_GBP : (supportHeight / PATH_HEIGHT_STEP) * 5.00_GBP; diff --git a/src/openrct2/actions/FootpathRemoveAction.cpp b/src/openrct2/actions/FootpathRemoveAction.cpp index 8f11c358df..44b35a5ad9 100644 --- a/src/openrct2/actions/FootpathRemoveAction.cpp +++ b/src/openrct2/actions/FootpathRemoveAction.cpp @@ -68,7 +68,8 @@ GameActions::Result FootpathRemoveAction::Query() const TileElement* footpathElement = GetFootpathElement(); if (footpathElement == nullptr) { - 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, STR_ERR_PATH_ELEMENT_NOT_FOUND); } res.Cost = GetRefundPrice(footpathElement); diff --git a/src/openrct2/actions/GuestSetNameAction.cpp b/src/openrct2/actions/GuestSetNameAction.cpp index a1e0ebda35..8532362fee 100644 --- a/src/openrct2/actions/GuestSetNameAction.cpp +++ b/src/openrct2/actions/GuestSetNameAction.cpp @@ -58,7 +58,7 @@ GameActions::Result GuestSetNameAction::Query() const { if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_NAME_GUEST, STR_ERR_VALUE_OUT_OF_RANGE); } auto guest = TryGetEntity(_spriteIndex); diff --git a/src/openrct2/actions/LandBuyRightsAction.cpp b/src/openrct2/actions/LandBuyRightsAction.cpp index 70847ee2a2..4f486ecfd2 100644 --- a/src/openrct2/actions/LandBuyRightsAction.cpp +++ b/src/openrct2/actions/LandBuyRightsAction.cpp @@ -114,14 +114,15 @@ 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_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } SurfaceElement* surfaceElement = MapGetSurfaceElementAt(loc); if (surfaceElement == nullptr) { LOG_ERROR("No surface at x = %d, y = %d", loc.x, loc.y); - return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, _ErrorTitles[EnumValue(_setting)], STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto res = GameActions::Result(); @@ -171,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_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, _ErrorTitles[0], STR_ERR_VALUE_OUT_OF_RANGE); } } diff --git a/src/openrct2/actions/LandSmoothAction.cpp b/src/openrct2/actions/LandSmoothAction.cpp index f60c26e8b1..581eac460a 100644 --- a/src/openrct2/actions/LandSmoothAction.cpp +++ b/src/openrct2/actions/LandSmoothAction.cpp @@ -608,7 +608,8 @@ GameActions::Result LandSmoothAction::SmoothLand(bool isExecuting) const } default: LOG_ERROR("Invalid map selection type %u", _selectionType); - return GameActions::Result(GameActions::Status::InvalidParameters, std::get(res.ErrorTitle), STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, std::get(res.ErrorTitle), STR_ERR_VALUE_OUT_OF_RANGE); } // switch selectionType // Raise / lower the land tool selection area diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 6fdc7facb1..12821a21cc 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -89,7 +89,8 @@ GameActions::Result LargeSceneryPlaceAction::Query() const if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS) { LOG_ERROR("Invalid 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, STR_ERR_VALUE_OUT_OF_RANGE); } auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 5bf3b72493..90175a07bc 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -70,7 +70,7 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (_loc.x < 0 || _loc.y < 0 || _loc.x > mapSizeMax.x || _loc.y > mapSizeMax.y) { LOG_ERROR("Invalid x / y coordinates: x = %d, y = %d", _loc.x, _loc.y); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } if (_primaryColour >= COLOUR_COUNT) diff --git a/src/openrct2/actions/MapChangeSizeAction.cpp b/src/openrct2/actions/MapChangeSizeAction.cpp index 1c5bf1fc75..031627beeb 100644 --- a/src/openrct2/actions/MapChangeSizeAction.cpp +++ b/src/openrct2/actions/MapChangeSizeAction.cpp @@ -37,11 +37,13 @@ GameActions::Result MapChangeSizeAction::Query() const { if (_targetSize.x > kMaximumMapSizeTechnical || _targetSize.y > kMaximumMapSizeTechnical) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_INCREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE); } if (_targetSize.x < kMinimumMapSizeTechnical || _targetSize.y < kMinimumMapSizeTechnical) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_DECREASE_MAP_SIZE_ANY_FURTHER, STR_ERR_VALUE_OUT_OF_RANGE); } return GameActions::Result(); } diff --git a/src/openrct2/actions/MazeSetTrackAction.cpp b/src/openrct2/actions/MazeSetTrackAction.cpp index 43d1996952..a28b73aa81 100644 --- a/src/openrct2/actions/MazeSetTrackAction.cpp +++ b/src/openrct2/actions/MazeSetTrackAction.cpp @@ -288,7 +288,7 @@ GameActions::Result MazeSetTrackAction::Execute() const { LOG_ERROR("No surface found"); res.Error = GameActions::Status::Unknown; - res.ErrorMessage = STR_NONE; + res.ErrorMessage = STR_ERR_SURFACE_ELEMENT_NOT_FOUND; return res; } diff --git a/src/openrct2/actions/ParkMarketingAction.cpp b/src/openrct2/actions/ParkMarketingAction.cpp index 63d181d37b..1912dd663d 100644 --- a/src/openrct2/actions/ParkMarketingAction.cpp +++ b/src/openrct2/actions/ParkMarketingAction.cpp @@ -53,7 +53,8 @@ GameActions::Result ParkMarketingAction::Query() const { if (static_cast(_type) >= std::size(AdvertisingCampaignPricePerWeek) || _numWeeks >= 256) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_START_MARKETING_CAMPAIGN, STR_ERR_VALUE_OUT_OF_RANGE); } if (GetGameState().ParkFlags & PARK_FLAGS_FORBID_MARKETING_CAMPAIGN) { diff --git a/src/openrct2/actions/PeepSpawnPlaceAction.cpp b/src/openrct2/actions/PeepSpawnPlaceAction.cpp index fb6c2134ad..25a3732626 100644 --- a/src/openrct2/actions/PeepSpawnPlaceAction.cpp +++ b/src/openrct2/actions/PeepSpawnPlaceAction.cpp @@ -74,7 +74,8 @@ GameActions::Result PeepSpawnPlaceAction::Query() const auto surfaceMapElement = MapGetSurfaceElementAt(_location); if (surfaceMapElement == nullptr) { - return GameActions::Result(GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_ERR_CANT_PLACE_PEEP_SPAWN_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (surfaceMapElement->GetOwnership() != OWNERSHIP_UNOWNED) { diff --git a/src/openrct2/actions/RideDemolishAction.cpp b/src/openrct2/actions/RideDemolishAction.cpp index dbcd2e83a0..113c4fd675 100644 --- a/src/openrct2/actions/RideDemolishAction.cpp +++ b/src/openrct2/actions/RideDemolishAction.cpp @@ -117,7 +117,7 @@ GameActions::Result RideDemolishAction::Execute() const return RefurbishRide(*ride); default: LOG_ERROR("Unknown ride demolish type %d", _modifyType); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_DO_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } } diff --git a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp index cb16533a3c..25c83501d6 100644 --- a/src/openrct2/actions/RideEntranceExitPlaceAction.cpp +++ b/src/openrct2/actions/RideEntranceExitPlaceAction.cpp @@ -65,7 +65,7 @@ GameActions::Result RideEntranceExitPlaceAction::Query() const if (_stationNum.ToUnderlying() >= Limits::MaxStationsPerRide) { LOG_ERROR("Invalid station number for ride. stationNum: %u", _stationNum.ToUnderlying()); - return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errorTitle, STR_ERR_VALUE_OUT_OF_RANGE); } if (ride->status != RideStatus::Closed && ride->status != RideStatus::Simulating) diff --git a/src/openrct2/actions/RideSetSettingAction.cpp b/src/openrct2/actions/RideSetSettingAction.cpp index 4d1b926937..8a8a8a12c8 100644 --- a/src/openrct2/actions/RideSetSettingAction.cpp +++ b/src/openrct2/actions/RideSetSettingAction.cpp @@ -71,7 +71,8 @@ GameActions::Result RideSetSettingAction::Query() const if (!RideIsModeValid(*ride) && !GetGameState().Cheats.ShowAllOperatingModes) { LOG_ERROR("Invalid ride mode: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::Departure: @@ -80,14 +81,16 @@ GameActions::Result RideSetSettingAction::Query() const if (_value > 250) { LOG_ERROR("Invalid minimum waiting time: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::MaxWaitingTime: if (_value > 250) { LOG_ERROR("Invalid maximum waiting time: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::Operation: @@ -102,7 +105,8 @@ GameActions::Result RideSetSettingAction::Query() const if (_value > RIDE_INSPECTION_NEVER) { LOG_ERROR("Invalid inspection interval: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::Music: @@ -114,7 +118,8 @@ GameActions::Result RideSetSettingAction::Query() const if (musicObj == nullptr) { LOG_ERROR("Invalid music style: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; } @@ -122,7 +127,8 @@ GameActions::Result RideSetSettingAction::Query() const if (!RideIsValidLiftHillSpeed(*ride)) { LOG_ERROR("Invalid lift hill speed: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::NumCircuits: @@ -136,7 +142,8 @@ GameActions::Result RideSetSettingAction::Query() const if (!RideIsValidNumCircuits()) { LOG_ERROR("Invalid number of circuits: %u", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } break; case RideSetSetting::RideType: @@ -148,7 +155,8 @@ GameActions::Result RideSetSettingAction::Query() const break; default: LOG_ERROR("Invalid ride setting %u", static_cast(_setting)); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_CHANGE_OPERATING_MODE, STR_ERR_VALUE_OUT_OF_RANGE); } return GameActions::Result(); diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index fc9892e309..cf7f60c1c7 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -98,7 +98,7 @@ GameActions::Result RideSetVehicleAction::Query() const if (!RideIsVehicleTypeValid(*ride)) { LOG_ERROR("Invalid vehicle type %d", _value); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_VALUE_OUT_OF_RANGE); } auto rideEntry = GetRideEntryByIndex(_value); if (rideEntry == nullptr) @@ -119,7 +119,7 @@ GameActions::Result RideSetVehicleAction::Query() 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, STR_ERR_VALUE_OUT_OF_RANGE); } return GameActions::Result(); diff --git a/src/openrct2/actions/SmallSceneryPlaceAction.cpp b/src/openrct2/actions/SmallSceneryPlaceAction.cpp index 961f161de9..4237b5b20a 100644 --- a/src/openrct2/actions/SmallSceneryPlaceAction.cpp +++ b/src/openrct2/actions/SmallSceneryPlaceAction.cpp @@ -115,7 +115,8 @@ GameActions::Result SmallSceneryPlaceAction::Query() const auto maxSizeMax = GetMapSizeMaxXY(); if (!_trackDesignDrawingPreview && (_loc.x > maxSizeMax.x || _loc.y > maxSizeMax.y)) { - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_VALUE_OUT_OF_RANGE); } auto* sceneryEntry = ObjectManager::GetObjectEntry(_sceneryType); diff --git a/src/openrct2/actions/StaffHireNewAction.cpp b/src/openrct2/actions/StaffHireNewAction.cpp index 3eadb187b9..27708f73b2 100644 --- a/src/openrct2/actions/StaffHireNewAction.cpp +++ b/src/openrct2/actions/StaffHireNewAction.cpp @@ -86,7 +86,7 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const if (_staffType >= static_cast(StaffType::Count)) { LOG_ERROR("Invalid staff type %u", static_cast(_staffType)); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); } if (GetNumFreeEntities() < 400) @@ -99,14 +99,16 @@ GameActions::Result StaffHireNewAction::QueryExecute(bool execute) const if (static_cast(_entertainerType) >= static_cast(EntertainerCostume::Count)) { LOG_ERROR("Invalid entertainer type %u", static_cast(_entertainerType)); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); } uint32_t availableCostumes = StaffGetAvailableEntertainerCostumes(); if (!(availableCostumes & (1 << static_cast(_entertainerType)))) { LOG_ERROR("Unavailable entertainer costume %u", static_cast(_entertainerType)); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_HIRE_NEW_STAFF, STR_ERR_VALUE_OUT_OF_RANGE); } } diff --git a/src/openrct2/actions/StaffSetNameAction.cpp b/src/openrct2/actions/StaffSetNameAction.cpp index 209c40f264..9844f50a7b 100644 --- a/src/openrct2/actions/StaffSetNameAction.cpp +++ b/src/openrct2/actions/StaffSetNameAction.cpp @@ -50,14 +50,16 @@ GameActions::Result StaffSetNameAction::Query() const if (_spriteIndex.ToUnderlying() >= MAX_ENTITIES || _spriteIndex.IsNull()) { LOG_ERROR("Invalid sprite index %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_VALUE_OUT_OF_RANGE); } auto staff = TryGetEntity(_spriteIndex); if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND); } return GameActions::Result(); @@ -69,7 +71,8 @@ GameActions::Result StaffSetNameAction::Execute() const if (staff == nullptr) { LOG_ERROR("Staff entity not found for spriteIndex %u", _spriteIndex); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_STAFF_ERROR_CANT_NAME_STAFF_MEMBER, STR_ERR_STAFF_NOT_FOUND); } auto curName = staff->GetName(); diff --git a/src/openrct2/actions/TrackPlaceAction.cpp b/src/openrct2/actions/TrackPlaceAction.cpp index d35a951756..c20f2c1ae7 100644 --- a/src/openrct2/actions/TrackPlaceAction.cpp +++ b/src/openrct2/actions/TrackPlaceAction.cpp @@ -88,7 +88,7 @@ GameActions::Result TrackPlaceAction::Query() const { LOG_ERROR("Invalid direction for track placement, direction = %d", _origin.direction); 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, STR_ERR_VALUE_OUT_OF_RANGE); } if (_rideType != ride->type && !GetGameState().Cheats.AllowArbitraryRideTypeChanges) @@ -101,7 +101,7 @@ GameActions::Result TrackPlaceAction::Query() const { LOG_ERROR("Invalid ride type for track placement, rideType = %d", _rideType); 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, STR_ERR_VALUE_OUT_OF_RANGE); } auto res = GameActions::Result(); @@ -312,7 +312,8 @@ GameActions::Result TrackPlaceAction::Query() const if (surfaceElement == nullptr) { return GameActions::Result( - GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } auto waterHeight = surfaceElement->GetWaterHeight(); @@ -359,7 +360,9 @@ GameActions::Result TrackPlaceAction::Query() const auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (!GetGameState().Cheats.DisableSupportLimits) @@ -415,7 +418,7 @@ GameActions::Result TrackPlaceAction::Execute() const { LOG_ERROR("Invalid ride for track placement, rideIndex = %d", _rideIndex.ToUnderlying()); 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, STR_ERR_RIDE_NOT_FOUND); } const auto* rideEntry = GetRideEntryByIndex(ride->subtype); @@ -530,7 +533,9 @@ GameActions::Result TrackPlaceAction::Execute() const auto surfaceElement = MapGetSurfaceElementAt(mapLoc); if (surfaceElement == nullptr) { - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_CONSTRUCT_THIS_HERE, + STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int32_t supportHeight = baseZ - surfaceElement->GetBaseZ(); diff --git a/src/openrct2/actions/TrackRemoveAction.cpp b/src/openrct2/actions/TrackRemoveAction.cpp index ed25b558d2..b02824a06c 100644 --- a/src/openrct2/actions/TrackRemoveAction.cpp +++ b/src/openrct2/actions/TrackRemoveAction.cpp @@ -113,7 +113,8 @@ GameActions::Result TrackRemoveAction::Query() const LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } if (tileElement->AsTrack()->IsIndestructible()) @@ -137,7 +138,8 @@ GameActions::Result TrackRemoveAction::Query() const if (ride->type >= RIDE_TYPE_COUNT) { LOG_ERROR("Ride type not found. ride type = %d.", ride->type); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_VALUE_OUT_OF_RANGE); } const auto& ted = GetTrackElementDescriptor(trackType); auto sequenceIndex = tileElement->AsTrack()->GetSequenceIndex(); @@ -145,7 +147,8 @@ GameActions::Result TrackRemoveAction::Query() const if (trackBlock == nullptr) { LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND); } auto startLoc = _origin; @@ -208,7 +211,8 @@ GameActions::Result TrackRemoveAction::Query() const LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z, _origin.direction, trackBlock->index); - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } int32_t entranceDirections = std::get<0>(ted.SequenceProperties); @@ -226,7 +230,8 @@ GameActions::Result TrackRemoveAction::Query() const if (surfaceElement == nullptr) { LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int8_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight; @@ -315,7 +320,8 @@ GameActions::Result TrackRemoveAction::Execute() const LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", _origin.x, _origin.y, _origin.z, _origin.direction, _sequence); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } RideId rideIndex = tileElement->AsTrack()->GetRideIndex(); @@ -335,7 +341,8 @@ GameActions::Result TrackRemoveAction::Execute() const if (trackBlock == nullptr) { LOG_ERROR("Track block %d not found for track type %d.", sequenceIndex, trackType); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_BLOCK_NOT_FOUND); } auto startLoc = _origin; @@ -393,7 +400,8 @@ GameActions::Result TrackRemoveAction::Execute() const LOG_ERROR( "Track Element not found. x = %d, y = %d, z = %d, d = %d, seq = %d.", mapLoc.x, mapLoc.y, mapLoc.z, _origin.direction, trackBlock->index); - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_TRACK_ELEMENT_NOT_FOUND); } int32_t entranceDirections = std::get<0>(ted.SequenceProperties); @@ -411,7 +419,8 @@ GameActions::Result TrackRemoveAction::Execute() const if (surfaceElement == nullptr) { LOG_ERROR("Surface Element not found. x = %d, y = %d", mapLoc.x, mapLoc.y); - return GameActions::Result(GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::Unknown, STR_RIDE_CONSTRUCTION_CANT_REMOVE_THIS, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } int8_t _support_height = tileElement->BaseHeight - surfaceElement->BaseHeight; diff --git a/src/openrct2/actions/WallPlaceAction.cpp b/src/openrct2/actions/WallPlaceAction.cpp index e771fc8110..319a8dfbbe 100644 --- a/src/openrct2/actions/WallPlaceAction.cpp +++ b/src/openrct2/actions/WallPlaceAction.cpp @@ -118,7 +118,8 @@ GameActions::Result WallPlaceAction::Query() const if (surfaceElement == nullptr) { LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } targetHeight = surfaceElement->GetBaseZ(); @@ -135,7 +136,8 @@ GameActions::Result WallPlaceAction::Query() const if (surfaceElement == nullptr) { LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } if (surfaceElement->GetWaterHeight() > 0) @@ -299,7 +301,8 @@ GameActions::Result WallPlaceAction::Execute() const if (surfaceElement == nullptr) { LOG_ERROR("Surface element not found at %d, %d.", _loc.x, _loc.y); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_BUILD_THIS_HERE, STR_ERR_SURFACE_ELEMENT_NOT_FOUND); } targetHeight = surfaceElement->GetBaseZ(); diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 7690a8bc61..359624f09d 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -76,7 +76,8 @@ GameActions::Result WallSetColourAction::Query() 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, STR_ERR_WALL_ELEMENT_NOT_FOUND); } if ((GetFlags() & GAME_COMMAND_FLAG_GHOST) && !(wallElement->IsGhost())) From 322321645b89247f28e6c0cf075f7036192f4c08 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sun, 17 Mar 2024 01:00:23 -0700 Subject: [PATCH 170/191] Add `STR_ERR_INVALID_COLOUR` --- data/language/en-GB.txt | 1 + src/openrct2/actions/BannerSetColourAction.cpp | 2 +- src/openrct2/actions/BannerSetStyleAction.cpp | 6 ++++-- src/openrct2/actions/LargeSceneryPlaceAction.cpp | 6 +++--- src/openrct2/actions/LargeScenerySetColourAction.cpp | 6 +++--- src/openrct2/actions/RideCreateAction.cpp | 3 ++- src/openrct2/actions/RideSetAppearanceAction.cpp | 4 ++-- src/openrct2/actions/RideSetVehicleAction.cpp | 2 +- src/openrct2/actions/WallSetColourAction.cpp | 4 ++-- src/openrct2/localisation/StringIds.h | 2 ++ 10 files changed, 21 insertions(+), 15 deletions(-) diff --git a/data/language/en-GB.txt b/data/language/en-GB.txt index 30b97ba615..ff5d99048e 100644 --- a/data/language/en-GB.txt +++ b/data/language/en-GB.txt @@ -3696,6 +3696,7 @@ STR_6621 :Restrict STR_6622 :Restrict object to the Scenario Editor and Sandbox mode. STR_6623 :Type ‘help’ for a list of available commands. Type ‘hide’ to hide the console. STR_6624 :Tile Inspector: Sort elements +STR_6625 :Invalid colour ############# # Scenarios # diff --git a/src/openrct2/actions/BannerSetColourAction.cpp b/src/openrct2/actions/BannerSetColourAction.cpp index b2e6a8c256..f2b210ce65 100644 --- a/src/openrct2/actions/BannerSetColourAction.cpp +++ b/src/openrct2/actions/BannerSetColourAction.cpp @@ -67,7 +67,7 @@ GameActions::Result BannerSetColourAction::QueryExecute(bool isExecuting) const if (_primaryColour > 31) { LOG_ERROR("Invalid primary colour %u", _primaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } if (!MapCanBuildAt({ _loc.x, _loc.y, _loc.z - 16 })) diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 95faf21054..041dceccee 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -73,7 +73,8 @@ GameActions::Result BannerSetStyleAction::Query() const if (_parameter > COLOUR_COUNT) { LOG_ERROR("Invalid primary colour %u", _parameter); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } break; @@ -81,7 +82,8 @@ GameActions::Result BannerSetStyleAction::Query() const if (_parameter > 13) { LOG_ERROR("Invalid text colour %u", _parameter); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result( + GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } break; case BannerSetStyleType::NoEntry: diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 12821a21cc..5371ad529e 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -73,17 +73,17 @@ GameActions::Result LargeSceneryPlaceAction::Query() const if (_primaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid primary colour %u", _primaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid secondary colour %u", _secondaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS) diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index 90175a07bc..c53dc3c00e 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -76,19 +76,19 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) if (_primaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid primary colour %u", _primaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid secondary colour %u", _secondaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } auto largeElement = MapGetLargeScenerySegment(_loc, _tileIndex); diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 64976dee44..10440ca355 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -100,7 +100,8 @@ GameActions::Result RideCreateAction::Query() const if (_colour1 >= colourPresets.count) { LOG_ERROR("Can't create ride, invalid colour preset %d", _colour1); - 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, STR_ERR_INVALID_COLOUR); } const auto* rideEntry = GetRideEntryByIndex(rideEntryIndex); diff --git a/src/openrct2/actions/RideSetAppearanceAction.cpp b/src/openrct2/actions/RideSetAppearanceAction.cpp index 1a8d4fa1b6..3d6582103c 100644 --- a/src/openrct2/actions/RideSetAppearanceAction.cpp +++ b/src/openrct2/actions/RideSetAppearanceAction.cpp @@ -66,7 +66,7 @@ GameActions::Result RideSetAppearanceAction::Query() const { LOG_ERROR("Invalid track colour %u", _index); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR); } break; case RideSetAppearanceType::VehicleColourBody: @@ -76,7 +76,7 @@ GameActions::Result RideSetAppearanceAction::Query() const { LOG_ERROR("Invalid vehicle colour %u", _index); return GameActions::Result( - GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); + GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_INVALID_COLOUR); } break; case RideSetAppearanceType::VehicleColourScheme: diff --git a/src/openrct2/actions/RideSetVehicleAction.cpp b/src/openrct2/actions/RideSetVehicleAction.cpp index cf7f60c1c7..337f0979f3 100644 --- a/src/openrct2/actions/RideSetVehicleAction.cpp +++ b/src/openrct2/actions/RideSetVehicleAction.cpp @@ -112,7 +112,7 @@ GameActions::Result RideSetVehicleAction::Query() const if (_colour >= presetList->count && _colour != 255 && _colour != 0) { LOG_ERROR("Unknown vehicle colour preset. colour = %d", _colour); - return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, errTitle, STR_ERR_INVALID_COLOUR); } break; } diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 359624f09d..2b0583b91c 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -97,13 +97,13 @@ GameActions::Result WallSetColourAction::Query() const if (_primaryColour >= COLOUR_COUNT) { LOG_ERROR("Primary colour invalid: colour = %d", _primaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Secondary colour invalid: colour = %d", _secondaryColour); - return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_NONE); + return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) diff --git a/src/openrct2/localisation/StringIds.h b/src/openrct2/localisation/StringIds.h index c97e25eb74..3afad4e011 100644 --- a/src/openrct2/localisation/StringIds.h +++ b/src/openrct2/localisation/StringIds.h @@ -4041,6 +4041,8 @@ enum : uint16_t STR_SHORTCUT_SORT_ELEMENTS = 6624, + STR_ERR_INVALID_COLOUR = 6625, + // Have to include resource strings (from scenarios and objects) for the time being now that language is partially working /* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings }; From 869d1b398be9638cc6ddaf2b080ae3889f4f6318 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sun, 24 Mar 2024 21:04:55 -0700 Subject: [PATCH 171/191] Assign variable in condition for documentation --- src/openrct2/actions/ParkSetEntranceFeeAction.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index d506f09cf7..63cfebb965 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -42,19 +42,17 @@ void ParkSetEntranceFeeAction::Serialise(DataSerialiser& stream) GameActions::Result ParkSetEntranceFeeAction::Query() const { - if ((GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0) + if (bool noMoney = (GetGameState().ParkFlags & 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); } - - if (!ParkEntranceFeeUnlocked()) + else if (bool forceFreeEntry = !ParkEntranceFeeUnlocked()) { LOG_ERROR("Park entrance fee is locked"); return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); } - - if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE) + else if (_fee < 0.00_GBP || _fee > MAX_ENTRANCE_FEE) { LOG_ERROR("Invalid park entrance fee %d", _fee); return GameActions::Result( From c4b7845c26040a7692e058a4194018c9f1c58ff5 Mon Sep 17 00:00:00 2001 From: Peter Froud Date: Sun, 24 Mar 2024 21:07:34 -0700 Subject: [PATCH 172/191] Use `if... else if` --- src/openrct2/actions/LargeSceneryPlaceAction.cpp | 7 +++---- src/openrct2/actions/LargeScenerySetColourAction.cpp | 6 ++---- src/openrct2/actions/ParkSetDateAction.cpp | 4 ++-- src/openrct2/actions/WallSetColourAction.cpp | 6 ++---- 4 files changed, 9 insertions(+), 14 deletions(-) diff --git a/src/openrct2/actions/LargeSceneryPlaceAction.cpp b/src/openrct2/actions/LargeSceneryPlaceAction.cpp index 5371ad529e..832afdd52e 100644 --- a/src/openrct2/actions/LargeSceneryPlaceAction.cpp +++ b/src/openrct2/actions/LargeSceneryPlaceAction.cpp @@ -75,18 +75,17 @@ GameActions::Result LargeSceneryPlaceAction::Query() const LOG_ERROR("Invalid primary colour %u", _primaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } - if (_secondaryColour >= COLOUR_COUNT) + else if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid secondary colour %u", _secondaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } - if (_tertiaryColour >= COLOUR_COUNT) + else if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_POSITION_THIS_HERE, STR_ERR_INVALID_COLOUR); } - - if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS) + else if (_sceneryType >= MAX_LARGE_SCENERY_OBJECTS) { LOG_ERROR("Invalid sceneryType %u", _sceneryType); return GameActions::Result( diff --git a/src/openrct2/actions/LargeScenerySetColourAction.cpp b/src/openrct2/actions/LargeScenerySetColourAction.cpp index c53dc3c00e..687a016b75 100644 --- a/src/openrct2/actions/LargeScenerySetColourAction.cpp +++ b/src/openrct2/actions/LargeScenerySetColourAction.cpp @@ -78,14 +78,12 @@ GameActions::Result LargeScenerySetColourAction::QueryExecute(bool isExecuting) LOG_ERROR("Invalid primary colour %u", _primaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } - - if (_secondaryColour >= COLOUR_COUNT) + else if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid secondary colour %u", _secondaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } - - if (_tertiaryColour >= COLOUR_COUNT) + else if (_tertiaryColour >= COLOUR_COUNT) { LOG_ERROR("Invalid tertiary colour %u", _tertiaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); diff --git a/src/openrct2/actions/ParkSetDateAction.cpp b/src/openrct2/actions/ParkSetDateAction.cpp index 9df4808a6a..fdd0ab99ef 100644 --- a/src/openrct2/actions/ParkSetDateAction.cpp +++ b/src/openrct2/actions/ParkSetDateAction.cpp @@ -51,13 +51,13 @@ GameActions::Result ParkSetDateAction::Query() const return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } - if (_month < 0 || _month >= MONTH_COUNT) + else if (_month < 0 || _month >= MONTH_COUNT) { LOG_ERROR("Invalid park date month %d", _year); return GameActions::Result( GameActions::Status::InvalidParameters, STR_ERR_INVALID_PARAMETER, STR_ERR_VALUE_OUT_OF_RANGE); } - if (_day < 0 || _day >= 31) + else if (_day < 0 || _day >= 31) { LOG_ERROR("Invalid park date day %d", _year); return GameActions::Result( diff --git a/src/openrct2/actions/WallSetColourAction.cpp b/src/openrct2/actions/WallSetColourAction.cpp index 2b0583b91c..6754f37b0c 100644 --- a/src/openrct2/actions/WallSetColourAction.cpp +++ b/src/openrct2/actions/WallSetColourAction.cpp @@ -99,14 +99,12 @@ GameActions::Result WallSetColourAction::Query() const LOG_ERROR("Primary colour invalid: colour = %d", _primaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } - - if (_secondaryColour >= COLOUR_COUNT) + else if (_secondaryColour >= COLOUR_COUNT) { LOG_ERROR("Secondary colour invalid: colour = %d", _secondaryColour); return GameActions::Result(GameActions::Status::InvalidParameters, STR_CANT_REPAINT_THIS, STR_ERR_INVALID_COLOUR); } - - if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) + else if (wallEntry->flags & WALL_SCENERY_HAS_TERTIARY_COLOUR) { if (_tertiaryColour >= COLOUR_COUNT) { From 18232341c8850ac841a6f983d8b8a6d5366faf95 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 30 Mar 2024 17:31:59 +0100 Subject: [PATCH 173/191] Remove unused variables --- src/openrct2/actions/ParkSetEntranceFeeAction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp index 63cfebb965..89c235745c 100644 --- a/src/openrct2/actions/ParkSetEntranceFeeAction.cpp +++ b/src/openrct2/actions/ParkSetEntranceFeeAction.cpp @@ -42,12 +42,12 @@ void ParkSetEntranceFeeAction::Serialise(DataSerialiser& stream) GameActions::Result ParkSetEntranceFeeAction::Query() const { - if (bool noMoney = (GetGameState().ParkFlags & PARK_FLAGS_NO_MONEY) != 0) + if ((GetGameState().ParkFlags & 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); } - else if (bool forceFreeEntry = !ParkEntranceFeeUnlocked()) + else if (!ParkEntranceFeeUnlocked()) { LOG_ERROR("Park entrance fee is locked"); return GameActions::Result(GameActions::Status::Disallowed, STR_ERR_CANT_CHANGE_PARK_ENTRANCE_FEE, STR_NONE); From eb2cda6a56058e7fa6b26f46ee9f76d7b2e780ab Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Mar 2024 17:58:08 +0100 Subject: [PATCH 174/191] Replace `"forceBmp": true` with `"format": "raw"` --- resources/g2/sprites.json | 792 ++++++++++++++--------------- src/openrct2/CommandLineSprite.cpp | 2 +- 2 files changed, 397 insertions(+), 397 deletions(-) diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index f7aa6dd278..d2f4bd51f3 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -314,242 +314,242 @@ { "path": "palette_map/palette_map_dark_olive_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_dark_olive_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_saturated_brown_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_bordeaux_red_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_bordeaux_red_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_grass_green_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_grass_green_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_olive_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_olive_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_saturated_green_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_tan_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_tan_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_dull_purple_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_dull_green_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_dull_green_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_saturated_purple_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_saturated_purple_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_orange_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_aqua_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_magenta_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_dull_brown_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_dull_brown_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_invisible.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_void.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dark_olive_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dark_olive_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_saturated_brown_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_bordeaux_red_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_bordeaux_red_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_grass_green_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_grass_green_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_olive_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_olive_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_saturated_green_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_tan_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_tan_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dull_purple_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dull_green_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dull_green_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_saturated_purple_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_saturated_purple_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_orange_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_aqua_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_magenta_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dull_brown_dark.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_dull_brown_light.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_invisible.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "palette_map/palette_map_glass_void.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "surface/glassy_recolourable.png", @@ -581,1961 +581,1961 @@ "path": "font/latin/ae-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/ae-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-stroke-uc-small.png", "x": -1, "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-stroke-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1028-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1041-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1043-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1044-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1046-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1047-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1048-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1049-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1051-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1055-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1059-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1060-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1062-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1063-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1064-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1065-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1066-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1067-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1068-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1069-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1070-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1071-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1073-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1074-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1075-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1076-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1078-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1079-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1080-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1081-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1082-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1083-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1084-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1085-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1087-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1090-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1092-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1094-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1095-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1096-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1097-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1099-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1100-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1101-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1102-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1103-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1108-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1168-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1169-small.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/german-openquotes-small.png", "y": 6, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/guilder-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-breve-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/i-with-dot-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-cedilla-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-breve-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/i-without-dot-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-cedilla-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/interpunct-small.png", "y": 3, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/a-breve-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-comma-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-comma-small.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/ellipsis-small.png", "y": 6, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-caron-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-acute-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-acute-small.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-double-acute-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-double-acute-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/oe-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/oe-small.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-double-acute-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-double-acute-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/d-caron-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/d-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/e-caron-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/e-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/n-caron-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/n-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/r-caron-uc-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/r-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-caron-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-caron-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-caron-small.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-ring-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-ring-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/w-circumflex-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/w-circumflex-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-circumflex-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-circumflex-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/z-caron-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/z-caron-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/rouble-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-small.png", "x": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/l-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-circumflex-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-circumflex-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-circumflex-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-circumflex-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/h-circumflex-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/h-circumflex-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-circumflex-uc-small.png", "x": -1, "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-circumflex-small.png", "x": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-circumflex-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-circumflex-small.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-breve-uc-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-breve-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/left-brace-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/vertical-bar-small.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/right-brace-small.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/tilde-small.png", "y": 3, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/eye.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/ae-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/ae-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-stroke-uc-bold.png", "x": -1, "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-stroke-bold.png", "x": 0, "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1028-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1041-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1043-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1044-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1046-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1047-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1048-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1049-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1051-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1055-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1059-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1060-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1062-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1063-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1064-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1065-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1066-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1067-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1068-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1069-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1070-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1071-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1073-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1074-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1075-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1076-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1078-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1079-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1080-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1081-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1082-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1083-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1084-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1085-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1087-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1090-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1092-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1094-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1095-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1096-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1097-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1099-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1100-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1101-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1102-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1103-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1108-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1168-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1169-bold.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/german-openquotes-bold.png", "y": 5, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/guilder-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-breve-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/i-with-dot-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-cedilla-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-breve-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/i-without-dot-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-cedilla-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/interpunct-bold.png", "y": 3, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/a-breve-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-comma-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-comma-bold.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/ellipsis-bold.png", "y": 6, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-acute-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-acute-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-double-acute-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-double-acute-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/oe-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/oe-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-double-acute-uc-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-double-acute-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/d-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/d-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/e-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/e-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/n-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/n-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/r-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/r-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-ring-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-ring-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/w-circumflex-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/w-circumflex-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-circumflex-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-circumflex-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/z-caron-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/z-caron-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/rouble-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-bold.png", "x": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/l-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-circumflex-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-circumflex-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-circumflex-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-circumflex-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/h-circumflex-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/h-circumflex-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-circumflex-uc-bold.png", "x": -1, "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-circumflex-bold.png", "x": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-circumflex-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-circumflex-bold.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-breve-uc-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-breve-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/left-brace-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/vertical-bar-bold.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/right-brace-bold.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/tilde-bold.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/eye.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/ae-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/ae-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-stroke-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-stroke-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1028-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1041-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1043-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1044-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1046-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1047-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1048-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1049-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1051-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1055-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1059-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1060-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1062-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1063-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1064-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1065-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1066-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1067-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1068-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1069-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1070-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1071-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1073-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1074-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1075-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1076-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1078-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1079-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1080-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1081-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1082-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1083-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1084-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1085-tiny.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1087-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1090-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1092-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1094-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1095-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1096-tiny.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1097-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1099-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1100-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1101-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1102-tiny.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1103-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1108-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1168-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/cyrillic/U1169-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/german-openquotes-tiny.png", "y": 4, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/guilder-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-breve-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/i-with-dot-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-cedilla-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-breve-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/i-without-dot-tiny.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-cedilla-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/interpunct-tiny.png", "y": 2, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/a-breve-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-comma-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-comma-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/ellipsis-tiny.png", "y": 4, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-caron-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-caron-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-acute-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-acute-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-double-acute-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/o-double-acute-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/oe-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/oe-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-double-acute-uc-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-double-acute-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/d-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/d-caron-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/e-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/e-caron-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/n-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/n-caron-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/r-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/r-caron-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-caron-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/t-caron-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-ring-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-ring-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/w-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/w-circumflex-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/y-circumflex-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/z-caron-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/z-caron-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/rouble-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-tiny.png", "x": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/l-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/c-circumflex-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/g-circumflex-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/h-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/h-circumflex-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/j-circumflex-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-circumflex-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/s-circumflex-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-breve-uc-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/latin/u-breve-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/left-brace-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/vertical-bar-tiny.png", "y": -1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/right-brace-tiny.png", "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/tilde-tiny.png", "y": 1, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "font/eye-tiny.png", "y": 0, "palette": "keep", - "forceBmp": true + "format": "raw" }, { "path": "track/junior/flat_to_steep_1.png" diff --git a/src/openrct2/CommandLineSprite.cpp b/src/openrct2/CommandLineSprite.cpp index fa8d1c2138..9d054ef77c 100644 --- a/src/openrct2/CommandLineSprite.cpp +++ b/src/openrct2/CommandLineSprite.cpp @@ -584,7 +584,7 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) auto palette = (Json::GetString(jsonSprite["palette"]) == "keep") ? ImageImporter::Palette::KeepIndices : ImageImporter::Palette::OpenRCT2; - bool forceBmp = !jsonSprite["palette"].is_null() && Json::GetBoolean(jsonSprite["forceBmp"]); + bool forceBmp = !jsonSprite["palette"].is_null() && Json::GetString(jsonSprite["format"]) == "raw"; auto imagePath = Path::GetAbsolute(Path::Combine(directoryPath, strPath)); From c232aa9b0cb0d81f4b530c9ddf60d9ea0d264f2d Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Mar 2024 18:27:07 +0100 Subject: [PATCH 175/191] Create import meta object, use single method for JSON parsing --- src/openrct2-ui/scripting/CustomImages.cpp | 27 +++-- src/openrct2/CommandLineSprite.cpp | 39 ++---- src/openrct2/CommandLineSprite.h | 2 +- src/openrct2/command_line/SpriteCommands.cpp | 2 +- src/openrct2/drawing/ImageImporter.cpp | 119 +++++++++++-------- src/openrct2/drawing/ImageImporter.h | 69 ++++++----- src/openrct2/object/ImageTable.cpp | 33 +---- test/tests/ImageImporterTests.cpp | 3 +- 8 files changed, 148 insertions(+), 146 deletions(-) diff --git a/src/openrct2-ui/scripting/CustomImages.cpp b/src/openrct2-ui/scripting/CustomImages.cpp index e2700b8740..c3839c7cae 100644 --- a/src/openrct2-ui/scripting/CustomImages.cpp +++ b/src/openrct2-ui/scripting/CustomImages.cpp @@ -275,6 +275,21 @@ namespace OpenRCT2::Scripting return unpadded; } + static ImportMode getImportModeFromPalette(const PixelDataPaletteKind& palette) + { + switch (palette) + { + case PixelDataPaletteKind::Closest: + return ImportMode::Closest; + case PixelDataPaletteKind::Dither: + return ImportMode::Dithering; + case PixelDataPaletteKind::None: + case PixelDataPaletteKind::Keep: + default: + return ImportMode::Default; + } + } + static std::vector GetBufferFromPixelData(duk_context* ctx, PixelData& pixelData) { std::vector imageData; @@ -303,18 +318,14 @@ namespace OpenRCT2::Scripting case PixelDataKind::Png: { auto imageFormat = pixelData.Palette == PixelDataPaletteKind::Keep ? IMAGE_FORMAT::PNG : IMAGE_FORMAT::PNG_32; - auto palette = pixelData.Palette == PixelDataPaletteKind::Keep ? ImageImporter::Palette::KeepIndices - : ImageImporter::Palette::OpenRCT2; - auto importMode = ImageImporter::ImportMode::Default; - if (pixelData.Palette == PixelDataPaletteKind::Closest) - importMode = ImageImporter::ImportMode::Closest; - else if (pixelData.Palette == PixelDataPaletteKind::Dither) - importMode = ImageImporter::ImportMode::Dithering; + auto palette = pixelData.Palette == PixelDataPaletteKind::Keep ? Palette::KeepIndices : Palette::OpenRCT2; + auto importMode = getImportModeFromPalette(pixelData.Palette); auto pngData = DukGetDataFromBufferLikeObject(pixelData.Data); auto image = Imaging::ReadFromBuffer(pngData, imageFormat); + ImageImportMeta meta = { { 0, 0 }, palette, ImportFlags::RLE, importMode }; ImageImporter importer; - auto importResult = importer.Import(image, 0, 0, palette, ImageImporter::ImportFlags::RLE, importMode); + auto importResult = importer.Import(image, meta); pixelData.Type = PixelDataKind::Rle; pixelData.Width = importResult.Element.width; diff --git a/src/openrct2/CommandLineSprite.cpp b/src/openrct2/CommandLineSprite.cpp index 9d054ef77c..ffe578309d 100644 --- a/src/openrct2/CommandLineSprite.cpp +++ b/src/openrct2/CommandLineSprite.cpp @@ -225,21 +225,12 @@ static bool SpriteImageExport(const G1Element& spriteElement, u8string_view outP } } -static std::optional SpriteImageImport( - const char* path, int16_t x_offset, int16_t y_offset, ImageImporter::Palette palette, bool forceBmp, - ImageImporter::ImportMode mode) +static std::optional SpriteImageImport(u8string_view path, ImageImportMeta meta) { try { auto format = IMAGE_FORMAT::PNG_32; - auto flags = ImageImporter::ImportFlags::None; - - if (!forceBmp) - { - flags = ImageImporter::ImportFlags::RLE; - } - - if (palette == ImageImporter::Palette::KeepIndices) + if (meta.palette == Palette::KeepIndices) { format = IMAGE_FORMAT::PNG; } @@ -247,7 +238,7 @@ static std::optional SpriteImageImport( ImageImporter importer; auto image = Imaging::ReadFromFile(path, format); - return importer.Import(image, x_offset, y_offset, palette, flags, mode); + return importer.Import(image, meta); } catch (const std::exception& e) { @@ -483,21 +474,21 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) const utf8* spriteFilePath = argv[1]; const utf8* imagePath = argv[2]; - int16_t x_offset = 0; - int16_t y_offset = 0; + int16_t xOffset = 0; + int16_t yOffset = 0; if (argc == 5) { char* endptr; - x_offset = strtol(argv[3], &endptr, 0); + xOffset = strtol(argv[3], &endptr, 0); if (*endptr != 0) { fprintf(stderr, "X offset must be an integer\n"); return -1; } - y_offset = strtol(argv[4], &endptr, 0); + yOffset = strtol(argv[4], &endptr, 0); if (*endptr != 0) { fprintf(stderr, "Y offset must be an integer\n"); @@ -505,8 +496,8 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) } } - auto importResult = SpriteImageImport( - imagePath, x_offset, y_offset, ImageImporter::Palette::OpenRCT2, false, gSpriteMode); + ImageImportMeta meta = { { xOffset, yOffset }, Palette::OpenRCT2, ImportFlags::RLE, gSpriteMode }; + auto importResult = SpriteImageImport(imagePath, meta); if (!importResult.has_value()) return -1; @@ -579,18 +570,12 @@ int32_t CommandLineForSprite(const char** argv, int32_t argc) } std::string strPath = Json::GetString(path); - json_t x_offset = jsonSprite["x"]; - json_t y_offset = jsonSprite["y"]; - - auto palette = (Json::GetString(jsonSprite["palette"]) == "keep") ? ImageImporter::Palette::KeepIndices - : ImageImporter::Palette::OpenRCT2; - bool forceBmp = !jsonSprite["palette"].is_null() && Json::GetString(jsonSprite["format"]) == "raw"; + auto meta = createImageImportMetaFromJson(jsonSprite); + meta.importMode = gSpriteMode; auto imagePath = Path::GetAbsolute(Path::Combine(directoryPath, strPath)); - auto importResult = SpriteImageImport( - imagePath.c_str(), Json::GetNumber(x_offset), Json::GetNumber(y_offset), palette, forceBmp, - gSpriteMode); + auto importResult = SpriteImageImport(imagePath, meta); if (importResult == std::nullopt) { fprintf(stderr, "Could not import image file: %s\nCanceling\n", imagePath.c_str()); diff --git a/src/openrct2/CommandLineSprite.h b/src/openrct2/CommandLineSprite.h index ec31c9505a..726722ec10 100644 --- a/src/openrct2/CommandLineSprite.h +++ b/src/openrct2/CommandLineSprite.h @@ -13,4 +13,4 @@ #include "drawing/ImageImporter.h" int32_t CommandLineForSprite(const char** argv, int32_t argc); -extern OpenRCT2::Drawing::ImageImporter::ImportMode gSpriteMode; +extern OpenRCT2::Drawing::ImportMode gSpriteMode; diff --git a/src/openrct2/command_line/SpriteCommands.cpp b/src/openrct2/command_line/SpriteCommands.cpp index 6bb5ca1b0c..7e13e9791f 100644 --- a/src/openrct2/command_line/SpriteCommands.cpp +++ b/src/openrct2/command_line/SpriteCommands.cpp @@ -16,7 +16,7 @@ #define SZ_CLOSEST "closest" #define SZ_DITHERING "dithering" -using ImportMode = OpenRCT2::Drawing::ImageImporter::ImportMode; +using ImportMode = OpenRCT2::Drawing::ImportMode; ImportMode gSpriteMode = ImportMode::Default; diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index 2d5354f10a..e28a882c93 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -10,6 +10,7 @@ #include "ImageImporter.h" #include "../core/Imaging.h" +#include "../core/Json.hpp" #include #include @@ -20,36 +21,35 @@ using ImportResult = ImageImporter::ImportResult; constexpr int32_t PALETTE_TRANSPARENT = -1; -ImportResult ImageImporter::Import( - const Image& image, int32_t offsetX, int32_t offsetY, Palette palette, ImportFlags flags, ImportMode mode) const +ImportResult ImageImporter::Import(const Image& image, ImageImportMeta& meta) const { - return Import(image, 0, 0, image.Width, image.Height, offsetX, offsetY, palette, flags, mode); -} + if (meta.srcSize.width == 0) + meta.srcSize.width = image.Width; -ImportResult ImageImporter::Import( - const Image& image, int32_t srcX, int32_t srcY, int32_t width, int32_t height, int32_t offsetX, int32_t offsetY, - Palette palette, ImportFlags flags, ImportMode mode) const -{ - if (width > 256 || height > 256) + if (meta.srcSize.height == 0) + meta.srcSize.height = image.Height; + + if (meta.srcSize.width > 256 || meta.srcSize.height > 256) { throw std::invalid_argument("Only images 256x256 or less are supported."); } - if (palette == Palette::KeepIndices && image.Depth != 8) + if (meta.palette == Palette::KeepIndices && image.Depth != 8) { throw std::invalid_argument("Image is not paletted, it has bit depth of " + std::to_string(image.Depth)); } + const bool isRLE = meta.importFlags & ImportFlags::RLE; - auto pixels = GetPixels(image.Pixels.data(), image.Stride, srcX, srcY, width, height, palette, flags, mode); - auto buffer = flags & ImportFlags::RLE ? EncodeRLE(pixels.data(), width, height) : EncodeRaw(pixels.data(), width, height); + auto pixels = GetPixels(image, meta); + auto buffer = isRLE ? EncodeRLE(pixels.data(), meta.srcSize) : EncodeRaw(pixels.data(), meta.srcSize); G1Element outElement; - outElement.width = width; - outElement.height = height; - outElement.flags = (flags & ImportFlags::RLE ? G1_FLAG_RLE_COMPRESSION : G1_FLAG_HAS_TRANSPARENCY); - outElement.x_offset = offsetX; - outElement.y_offset = offsetY; - outElement.zoomed_offset = 0; + outElement.width = meta.srcSize.width; + outElement.height = meta.srcSize.height; + outElement.flags = isRLE ? G1_FLAG_RLE_COMPRESSION : G1_FLAG_HAS_TRANSPARENCY; + outElement.x_offset = meta.offset.x; + outElement.y_offset = meta.offset.y; + outElement.zoomed_offset = meta.zoomedOffset; ImportResult result; result.Element = outElement; @@ -58,44 +58,43 @@ ImportResult ImageImporter::Import( return result; } -std::vector ImageImporter::GetPixels( - const uint8_t* pixels, uint32_t pitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height, Palette palette, - ImportFlags flags, ImportMode mode) +std::vector ImageImporter::GetPixels(const Image& image, const ImageImportMeta& meta) { + const uint8_t* pixels = image.Pixels.data(); std::vector buffer; - buffer.reserve(width * height); + buffer.reserve(meta.srcSize.width * meta.srcSize.height); // A larger range is needed for proper dithering auto palettedSrc = pixels; std::unique_ptr rgbaSrcBuffer; - if (palette != Palette::KeepIndices) + if (meta.palette != Palette::KeepIndices) { - rgbaSrcBuffer = std::make_unique(height * width * 4); + rgbaSrcBuffer = std::make_unique(meta.srcSize.height * meta.srcSize.width * 4); } auto rgbaSrc = rgbaSrcBuffer.get(); - if (palette != Palette::KeepIndices) + if (meta.palette != Palette::KeepIndices) { - auto src = pixels + (srcY * pitch) + (srcX * 4); + auto src = pixels + (meta.srcOffset.y * image.Stride) + (meta.srcOffset.x * 4); auto dst = rgbaSrc; - for (uint32_t y = 0; y < height; y++) + for (auto y = 0; y < meta.srcSize.height; y++) { - for (uint32_t x = 0; x < width * 4; x++) + for (auto x = 0; x < meta.srcSize.width * 4; x++) { *dst = static_cast(*src); src++; dst++; } - src += (pitch - (width * 4)); + src += (image.Stride - (meta.srcSize.width * 4)); } } - if (palette == Palette::KeepIndices) + if (meta.palette == Palette::KeepIndices) { - palettedSrc += srcX + srcY * pitch; - for (uint32_t y = 0; y < height; y++) + palettedSrc += meta.srcOffset.x + meta.srcOffset.y * image.Stride; + for (auto y = 0; y < meta.srcSize.height; y++) { - for (uint32_t x = 0; x < width; x++) + for (auto x = 0; x < meta.srcSize.width; x++) { int32_t paletteIndex = *palettedSrc; // The 1st index is always transparent @@ -106,16 +105,17 @@ std::vector ImageImporter::GetPixels( palettedSrc += 1; buffer.push_back(paletteIndex); } - palettedSrc += (pitch - width); + palettedSrc += (image.Stride - meta.srcSize.width); } } else { - for (uint32_t y = 0; y < height; y++) + for (auto y = 0; y < meta.srcSize.height; y++) { - for (uint32_t x = 0; x < width; x++) + for (auto x = 0; x < meta.srcSize.width; x++) { - auto paletteIndex = CalculatePaletteIndex(mode, rgbaSrc, x, y, width, height); + auto paletteIndex = CalculatePaletteIndex( + meta.importMode, rgbaSrc, x, y, meta.srcSize.width, meta.srcSize.height); rgbaSrc += 4; buffer.push_back(paletteIndex); } @@ -125,11 +125,11 @@ std::vector ImageImporter::GetPixels( return buffer; } -std::vector ImageImporter::EncodeRaw(const int32_t* pixels, uint32_t width, uint32_t height) +std::vector ImageImporter::EncodeRaw(const int32_t* pixels, ScreenSize size) { - auto bufferLength = width * height; + auto bufferLength = size.width * size.height; std::vector buffer(bufferLength); - for (size_t i = 0; i < bufferLength; i++) + for (auto i = 0; i < bufferLength; i++) { auto p = pixels[i]; buffer[i] = (p == PALETTE_TRANSPARENT ? 0 : static_cast(p)); @@ -137,7 +137,7 @@ std::vector ImageImporter::EncodeRaw(const int32_t* pixels, uint32_t wi return buffer; } -std::vector ImageImporter::EncodeRLE(const int32_t* pixels, uint32_t width, uint32_t height) +std::vector ImageImporter::EncodeRLE(const int32_t* pixels, ScreenSize size) { struct RLECode { @@ -146,12 +146,12 @@ std::vector ImageImporter::EncodeRLE(const int32_t* pixels, uint32_t wi }; auto src = pixels; - std::vector buffer((height * 2) + (width * height * 16)); + std::vector buffer((size.height * 2) + (size.width * size.height * 16)); - std::fill_n(buffer.data(), (height * 2) + (width * height * 16), 0x00); + std::fill_n(buffer.data(), (size.height * 2) + (size.width * size.height * 16), 0x00); auto yOffsets = reinterpret_cast(buffer.data()); - auto dst = buffer.data() + (height * 2); - for (uint32_t y = 0; y < height; y++) + auto dst = buffer.data() + (size.height * 2); + for (auto y = 0; y < size.height; y++) { yOffsets[y] = static_cast(dst - buffer.data()); @@ -162,7 +162,7 @@ std::vector ImageImporter::EncodeRLE(const int32_t* pixels, uint32_t wi auto startX = 0; auto npixels = 0; bool pushRun = false; - for (uint32_t x = 0; x < width; x++) + for (auto x = 0; x < size.width; x++) { int32_t paletteIndex = *src++; if (paletteIndex == PALETTE_TRANSPARENT) @@ -184,7 +184,7 @@ std::vector ImageImporter::EncodeRLE(const int32_t* pixels, uint32_t wi npixels++; *dst++ = static_cast(paletteIndex); } - if (npixels == 127 || x == width - 1) + if (npixels == 127 || x == size.width - 1) { pushRun = true; } @@ -197,7 +197,7 @@ std::vector ImageImporter::EncodeRLE(const int32_t* pixels, uint32_t wi currentCode->NumPixels = npixels; currentCode->OffsetX = startX; - if (x == width - 1) + if (x == size.width - 1) { currentCode->NumPixels |= 0x80; } @@ -381,3 +381,26 @@ int32_t ImageImporter::GetClosestPaletteIndex(const GamePalette& palette, const } return bestMatch; } + +namespace OpenRCT2::Drawing +{ + ImageImportMeta createImageImportMetaFromJson(json_t& input) + { + auto xOffset = Json::GetNumber(input["x"]); + auto yOffset = Json::GetNumber(input["y"]); + auto keepPalette = Json::GetString(input["palette"]) == "keep"; + auto palette = keepPalette ? Palette::KeepIndices : Palette::OpenRCT2; + + auto raw = Json::GetString(input["format"]) == "raw"; + auto flags = raw ? ImportFlags::None : ImportFlags::RLE; + + auto srcX = Json::GetNumber(input["srcX"]); + auto srcY = Json::GetNumber(input["srcY"]); + auto srcWidth = Json::GetNumber(input["srcWidth"]); + auto srcHeight = Json::GetNumber(input["srcHeight"]); + auto zoomedOffset = Json::GetNumber(input["zoom"]); + + return ImageImportMeta{ { xOffset, yOffset }, palette, flags, ImportMode::Default, { srcX, srcY }, + { srcWidth, srcHeight }, zoomedOffset }; + }; +} // namespace OpenRCT2::Drawing diff --git a/src/openrct2/drawing/ImageImporter.h b/src/openrct2/drawing/ImageImporter.h index 8566c4e2a3..e9ec90feb7 100644 --- a/src/openrct2/drawing/ImageImporter.h +++ b/src/openrct2/drawing/ImageImporter.h @@ -10,6 +10,7 @@ #pragma once #include "../core/Imaging.h" +#include "../core/JsonFwd.hpp" #include "Drawing.h" #include @@ -19,6 +20,36 @@ struct Image; namespace OpenRCT2::Drawing { + enum class ImportMode : uint8_t + { + Default, + Closest, + Dithering, + }; + + enum ImportFlags : uint8_t + { + None = 0, + RLE = 1 << 1, + }; + + enum class Palette : uint8_t + { + OpenRCT2, + KeepIndices, + }; + + struct ImageImportMeta + { + ScreenCoordsXY offset{}; + Palette palette = Palette::OpenRCT2; + ImportFlags importFlags = ImportFlags::RLE; + ImportMode importMode = ImportMode::Default; + ScreenCoordsXY srcOffset{}; + ScreenSize srcSize{}; + int32_t zoomedOffset{}; + }; + /** * Imports images to the internal RCT G1 format. */ @@ -31,32 +62,7 @@ namespace OpenRCT2::Drawing std::vector Buffer; }; - enum class ImportMode : uint8_t - { - Default, - Closest, - Dithering, - }; - - enum ImportFlags : uint8_t - { - None = 0, - RLE = 1 << 1, - }; - - enum class Palette : uint8_t - { - OpenRCT2, - KeepIndices, - }; - - ImportResult Import( - const Image& image, int32_t srcX, int32_t srcY, int32_t width, int32_t height, int32_t offsetX, int32_t offsetY, - Palette palette = Palette::OpenRCT2, ImportFlags flags = ImportFlags::None, - ImportMode mode = ImportMode::Default) const; - ImportResult Import( - const Image& image, int32_t offsetX = 0, int32_t offsetY = 0, Palette palette = Palette::OpenRCT2, - ImportFlags flags = ImportFlags::None, ImportMode mode = ImportMode::Default) const; + ImportResult Import(const Image& image, ImageImportMeta& meta) const; private: enum class PaletteIndexType : uint8_t @@ -68,11 +74,9 @@ namespace OpenRCT2::Drawing Special, }; - static std::vector GetPixels( - const uint8_t* pixels, uint32_t pitch, uint32_t srcX, uint32_t srcY, uint32_t width, uint32_t height, - Palette palette, ImportFlags flags, ImportMode mode); - static std::vector EncodeRaw(const int32_t* pixels, uint32_t width, uint32_t height); - static std::vector EncodeRLE(const int32_t* pixels, uint32_t width, uint32_t height); + static std::vector GetPixels(const Image& image, const ImageImportMeta& meta); + static std::vector EncodeRaw(const int32_t* pixels, ScreenSize size); + static std::vector EncodeRLE(const int32_t* pixels, ScreenSize size); static int32_t CalculatePaletteIndex( ImportMode mode, int16_t* rgbaSrc, int32_t x, int32_t y, int32_t width, int32_t height); @@ -83,6 +87,9 @@ namespace OpenRCT2::Drawing static PaletteIndexType GetPaletteIndexType(int32_t paletteIndex); static int32_t GetClosestPaletteIndex(const GamePalette& palette, const int16_t* colour); }; + + // Note: jsonSprite is deliberately left non-const: json_t behaviour changes when const. + ImageImportMeta createImageImportMetaFromJson(json_t& input); } // namespace OpenRCT2::Drawing constexpr GamePalette StandardPalette = { { diff --git a/src/openrct2/object/ImageTable.cpp b/src/openrct2/object/ImageTable.cpp index dcd8d788c7..3ac0b90a8c 100644 --- a/src/openrct2/object/ImageTable.cpp +++ b/src/openrct2/object/ImageTable.cpp @@ -161,9 +161,10 @@ std::vector> ImageTable::ParseImages( { auto imageData = context->GetData(s); auto image = Imaging::ReadFromBuffer(imageData); + auto meta = ImageImportMeta{}; ImageImporter importer; - auto importResult = importer.Import(image, 0, 0, ImageImporter::Palette::OpenRCT2, ImageImporter::ImportFlags::RLE); + auto importResult = importer.Import(image, meta); result.push_back(std::make_unique(importResult.Element)); } @@ -183,30 +184,11 @@ std::vector> ImageTable::ParseImages( Guard::Assert(el.is_object(), "ImageTable::ParseImages expects parameter el to be object"); auto path = Json::GetString(el["path"]); - auto x = Json::GetNumber(el["x"]); - auto y = Json::GetNumber(el["y"]); - auto srcX = Json::GetNumber(el["srcX"]); - auto srcY = Json::GetNumber(el["srcY"]); - auto srcWidth = Json::GetNumber(el["srcWidth"]); - auto srcHeight = Json::GetNumber(el["srcHeight"]); - auto raw = Json::GetString(el["format"]) == "raw"; - auto keepPalette = Json::GetString(el["palette"]) == "keep"; - auto zoomOffset = Json::GetNumber(el["zoom"]); + auto meta = createImageImportMetaFromJson(el); std::vector> result; try { - auto flags = ImageImporter::ImportFlags::None; - auto palette = ImageImporter::Palette::OpenRCT2; - if (!raw) - { - flags = static_cast(flags | ImageImporter::ImportFlags::RLE); - } - if (keepPalette) - { - palette = ImageImporter::Palette::KeepIndices; - } - auto itSource = std::find_if( imageSources.begin(), imageSources.end(), [&path](const std::pair& item) { return item.first == path; }); @@ -216,16 +198,9 @@ std::vector> ImageTable::ParseImages( } auto& image = itSource->second; - if (srcWidth == 0) - srcWidth = image.Width; - - if (srcHeight == 0) - srcHeight = image.Height; - ImageImporter importer; - auto importResult = importer.Import(image, srcX, srcY, srcWidth, srcHeight, x, y, palette, flags); + auto importResult = importer.Import(image, meta); auto g1element = importResult.Element; - g1element.zoomed_offset = zoomOffset; result.push_back(std::make_unique(g1element)); } catch (const std::exception& e) diff --git a/test/tests/ImageImporterTests.cpp b/test/tests/ImageImporterTests.cpp index cfe50c4fa9..ec5d232f87 100644 --- a/test/tests/ImageImporterTests.cpp +++ b/test/tests/ImageImporterTests.cpp @@ -41,7 +41,8 @@ TEST_F(ImageImporterTests, Import_Logo) ImageImporter importer; auto image = Imaging::ReadFromFile(logoPath, IMAGE_FORMAT::PNG_32); - auto result = importer.Import(image, 3, 5, ImageImporter::Palette::OpenRCT2, ImageImporter::ImportFlags::RLE); + auto meta = ImageImportMeta{ .offset = { 3, 5 } }; + auto result = importer.Import(image, meta); ASSERT_EQ(result.Buffer.data(), result.Element.offset); ASSERT_EQ(128, result.Element.width); From 88eca0d518957dd61650bb71f136a20482d847dd Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Thu, 21 Mar 2024 18:39:38 +0100 Subject: [PATCH 176/191] Move everything in ImageImporter.cpp into namespace --- src/openrct2/drawing/ImageImporter.cpp | 606 ++++++++++++------------- 1 file changed, 302 insertions(+), 304 deletions(-) diff --git a/src/openrct2/drawing/ImageImporter.cpp b/src/openrct2/drawing/ImageImporter.cpp index e28a882c93..c5fc730faa 100644 --- a/src/openrct2/drawing/ImageImporter.cpp +++ b/src/openrct2/drawing/ImageImporter.cpp @@ -16,374 +16,372 @@ #include #include -using namespace OpenRCT2::Drawing; -using ImportResult = ImageImporter::ImportResult; - -constexpr int32_t PALETTE_TRANSPARENT = -1; - -ImportResult ImageImporter::Import(const Image& image, ImageImportMeta& meta) const +namespace OpenRCT2::Drawing { - if (meta.srcSize.width == 0) - meta.srcSize.width = image.Width; + constexpr int32_t PALETTE_TRANSPARENT = -1; - if (meta.srcSize.height == 0) - meta.srcSize.height = image.Height; - - if (meta.srcSize.width > 256 || meta.srcSize.height > 256) + ImageImporter::ImportResult ImageImporter::Import(const Image& image, ImageImportMeta& meta) const { - throw std::invalid_argument("Only images 256x256 or less are supported."); - } + if (meta.srcSize.width == 0) + meta.srcSize.width = image.Width; - if (meta.palette == Palette::KeepIndices && image.Depth != 8) - { - throw std::invalid_argument("Image is not paletted, it has bit depth of " + std::to_string(image.Depth)); - } - const bool isRLE = meta.importFlags & ImportFlags::RLE; + if (meta.srcSize.height == 0) + meta.srcSize.height = image.Height; - auto pixels = GetPixels(image, meta); - auto buffer = isRLE ? EncodeRLE(pixels.data(), meta.srcSize) : EncodeRaw(pixels.data(), meta.srcSize); - - G1Element outElement; - outElement.width = meta.srcSize.width; - outElement.height = meta.srcSize.height; - outElement.flags = isRLE ? G1_FLAG_RLE_COMPRESSION : G1_FLAG_HAS_TRANSPARENCY; - outElement.x_offset = meta.offset.x; - outElement.y_offset = meta.offset.y; - outElement.zoomed_offset = meta.zoomedOffset; - - ImportResult result; - result.Element = outElement; - result.Buffer = std::move(buffer); - result.Element.offset = result.Buffer.data(); - return result; -} - -std::vector ImageImporter::GetPixels(const Image& image, const ImageImportMeta& meta) -{ - const uint8_t* pixels = image.Pixels.data(); - std::vector buffer; - buffer.reserve(meta.srcSize.width * meta.srcSize.height); - - // A larger range is needed for proper dithering - auto palettedSrc = pixels; - std::unique_ptr rgbaSrcBuffer; - if (meta.palette != Palette::KeepIndices) - { - rgbaSrcBuffer = std::make_unique(meta.srcSize.height * meta.srcSize.width * 4); - } - - auto rgbaSrc = rgbaSrcBuffer.get(); - if (meta.palette != Palette::KeepIndices) - { - auto src = pixels + (meta.srcOffset.y * image.Stride) + (meta.srcOffset.x * 4); - auto dst = rgbaSrc; - for (auto y = 0; y < meta.srcSize.height; y++) + if (meta.srcSize.width > 256 || meta.srcSize.height > 256) { - for (auto x = 0; x < meta.srcSize.width * 4; x++) - { - *dst = static_cast(*src); - src++; - dst++; - } - src += (image.Stride - (meta.srcSize.width * 4)); + throw std::invalid_argument("Only images 256x256 or less are supported."); } + + if (meta.palette == Palette::KeepIndices && image.Depth != 8) + { + throw std::invalid_argument("Image is not paletted, it has bit depth of " + std::to_string(image.Depth)); + } + const bool isRLE = meta.importFlags & ImportFlags::RLE; + + auto pixels = GetPixels(image, meta); + auto buffer = isRLE ? EncodeRLE(pixels.data(), meta.srcSize) : EncodeRaw(pixels.data(), meta.srcSize); + + G1Element outElement; + outElement.width = meta.srcSize.width; + outElement.height = meta.srcSize.height; + outElement.flags = isRLE ? G1_FLAG_RLE_COMPRESSION : G1_FLAG_HAS_TRANSPARENCY; + outElement.x_offset = meta.offset.x; + outElement.y_offset = meta.offset.y; + outElement.zoomed_offset = meta.zoomedOffset; + + ImageImporter::ImportResult result; + result.Element = outElement; + result.Buffer = std::move(buffer); + result.Element.offset = result.Buffer.data(); + return result; } - if (meta.palette == Palette::KeepIndices) + std::vector ImageImporter::GetPixels(const Image& image, const ImageImportMeta& meta) { - palettedSrc += meta.srcOffset.x + meta.srcOffset.y * image.Stride; - for (auto y = 0; y < meta.srcSize.height; y++) + const uint8_t* pixels = image.Pixels.data(); + std::vector buffer; + buffer.reserve(meta.srcSize.width * meta.srcSize.height); + + // A larger range is needed for proper dithering + auto palettedSrc = pixels; + std::unique_ptr rgbaSrcBuffer; + if (meta.palette != Palette::KeepIndices) { - for (auto x = 0; x < meta.srcSize.width; x++) + rgbaSrcBuffer = std::make_unique(meta.srcSize.height * meta.srcSize.width * 4); + } + + auto rgbaSrc = rgbaSrcBuffer.get(); + if (meta.palette != Palette::KeepIndices) + { + auto src = pixels + (meta.srcOffset.y * image.Stride) + (meta.srcOffset.x * 4); + auto dst = rgbaSrc; + for (auto y = 0; y < meta.srcSize.height; y++) { - int32_t paletteIndex = *palettedSrc; - // The 1st index is always transparent - if (paletteIndex == 0) + for (auto x = 0; x < meta.srcSize.width * 4; x++) { - paletteIndex = PALETTE_TRANSPARENT; + *dst = static_cast(*src); + src++; + dst++; } - palettedSrc += 1; - buffer.push_back(paletteIndex); - } - palettedSrc += (image.Stride - meta.srcSize.width); - } - } - else - { - for (auto y = 0; y < meta.srcSize.height; y++) - { - for (auto x = 0; x < meta.srcSize.width; x++) - { - auto paletteIndex = CalculatePaletteIndex( - meta.importMode, rgbaSrc, x, y, meta.srcSize.width, meta.srcSize.height); - rgbaSrc += 4; - buffer.push_back(paletteIndex); + src += (image.Stride - (meta.srcSize.width * 4)); } } - } - return buffer; -} - -std::vector ImageImporter::EncodeRaw(const int32_t* pixels, ScreenSize size) -{ - auto bufferLength = size.width * size.height; - std::vector buffer(bufferLength); - for (auto i = 0; i < bufferLength; i++) - { - auto p = pixels[i]; - buffer[i] = (p == PALETTE_TRANSPARENT ? 0 : static_cast(p)); - } - return buffer; -} - -std::vector ImageImporter::EncodeRLE(const int32_t* pixels, ScreenSize size) -{ - struct RLECode - { - uint8_t NumPixels{}; - uint8_t OffsetX{}; - }; - - auto src = pixels; - std::vector buffer((size.height * 2) + (size.width * size.height * 16)); - - std::fill_n(buffer.data(), (size.height * 2) + (size.width * size.height * 16), 0x00); - auto yOffsets = reinterpret_cast(buffer.data()); - auto dst = buffer.data() + (size.height * 2); - for (auto y = 0; y < size.height; y++) - { - yOffsets[y] = static_cast(dst - buffer.data()); - - auto previousCode = static_cast(nullptr); - auto currentCode = reinterpret_cast(dst); - dst += 2; - - auto startX = 0; - auto npixels = 0; - bool pushRun = false; - for (auto x = 0; x < size.width; x++) + if (meta.palette == Palette::KeepIndices) { - int32_t paletteIndex = *src++; - if (paletteIndex == PALETTE_TRANSPARENT) + palettedSrc += meta.srcOffset.x + meta.srcOffset.y * image.Stride; + for (auto y = 0; y < meta.srcSize.height; y++) { - if (npixels != 0) + for (auto x = 0; x < meta.srcSize.width; x++) { - x--; - src--; - pushRun = true; - } - } - else - { - if (npixels == 0) - { - startX = x; - } - - npixels++; - *dst++ = static_cast(paletteIndex); - } - if (npixels == 127 || x == size.width - 1) - { - pushRun = true; - } - - if (pushRun) - { - if (npixels > 0) - { - previousCode = currentCode; - currentCode->NumPixels = npixels; - currentCode->OffsetX = startX; - - if (x == size.width - 1) + int32_t paletteIndex = *palettedSrc; + // The 1st index is always transparent + if (paletteIndex == 0) { - currentCode->NumPixels |= 0x80; + paletteIndex = PALETTE_TRANSPARENT; } + palettedSrc += 1; + buffer.push_back(paletteIndex); + } + palettedSrc += (image.Stride - meta.srcSize.width); + } + } + else + { + for (auto y = 0; y < meta.srcSize.height; y++) + { + for (auto x = 0; x < meta.srcSize.width; x++) + { + auto paletteIndex = CalculatePaletteIndex( + meta.importMode, rgbaSrc, x, y, meta.srcSize.width, meta.srcSize.height); + rgbaSrc += 4; + buffer.push_back(paletteIndex); + } + } + } - currentCode = reinterpret_cast(dst); - dst += 2; + return buffer; + } + + std::vector ImageImporter::EncodeRaw(const int32_t* pixels, ScreenSize size) + { + auto bufferLength = size.width * size.height; + std::vector buffer(bufferLength); + for (auto i = 0; i < bufferLength; i++) + { + auto p = pixels[i]; + buffer[i] = (p == PALETTE_TRANSPARENT ? 0 : static_cast(p)); + } + return buffer; + } + + std::vector ImageImporter::EncodeRLE(const int32_t* pixels, ScreenSize size) + { + struct RLECode + { + uint8_t NumPixels{}; + uint8_t OffsetX{}; + }; + + auto src = pixels; + std::vector buffer((size.height * 2) + (size.width * size.height * 16)); + + std::fill_n(buffer.data(), (size.height * 2) + (size.width * size.height * 16), 0x00); + auto yOffsets = reinterpret_cast(buffer.data()); + auto dst = buffer.data() + (size.height * 2); + for (auto y = 0; y < size.height; y++) + { + yOffsets[y] = static_cast(dst - buffer.data()); + + auto previousCode = static_cast(nullptr); + auto currentCode = reinterpret_cast(dst); + dst += 2; + + auto startX = 0; + auto npixels = 0; + bool pushRun = false; + for (auto x = 0; x < size.width; x++) + { + int32_t paletteIndex = *src++; + if (paletteIndex == PALETTE_TRANSPARENT) + { + if (npixels != 0) + { + x--; + src--; + pushRun = true; + } } else { - if (previousCode == nullptr) + if (npixels == 0) { - currentCode->NumPixels = 0x80; - currentCode->OffsetX = 0; + startX = x; + } + + npixels++; + *dst++ = static_cast(paletteIndex); + } + if (npixels == 127 || x == size.width - 1) + { + pushRun = true; + } + + if (pushRun) + { + if (npixels > 0) + { + previousCode = currentCode; + currentCode->NumPixels = npixels; + currentCode->OffsetX = startX; + + if (x == size.width - 1) + { + currentCode->NumPixels |= 0x80; + } + + currentCode = reinterpret_cast(dst); + dst += 2; } else { - previousCode->NumPixels |= 0x80; - dst -= 2; + if (previousCode == nullptr) + { + currentCode->NumPixels = 0x80; + currentCode->OffsetX = 0; + } + else + { + previousCode->NumPixels |= 0x80; + dst -= 2; + } } - } - startX = 0; - npixels = 0; - pushRun = false; + startX = 0; + npixels = 0; + pushRun = false; + } } } + + auto bufferLength = static_cast(dst - buffer.data()); + buffer.resize(bufferLength); + return buffer; } - auto bufferLength = static_cast(dst - buffer.data()); - buffer.resize(bufferLength); - return buffer; -} - -int32_t ImageImporter::CalculatePaletteIndex( - ImportMode mode, int16_t* rgbaSrc, int32_t x, int32_t y, int32_t width, int32_t height) -{ - auto& palette = StandardPalette; - auto paletteIndex = GetPaletteIndex(palette, rgbaSrc); - if ((mode == ImportMode::Closest || mode == ImportMode::Dithering) && !IsInPalette(palette, rgbaSrc)) + int32_t ImageImporter::CalculatePaletteIndex( + ImportMode mode, int16_t* rgbaSrc, int32_t x, int32_t y, int32_t width, int32_t height) { - paletteIndex = GetClosestPaletteIndex(palette, rgbaSrc); - if (mode == ImportMode::Dithering) + auto& palette = StandardPalette; + auto paletteIndex = GetPaletteIndex(palette, rgbaSrc); + if ((mode == ImportMode::Closest || mode == ImportMode::Dithering) && !IsInPalette(palette, rgbaSrc)) { - auto dr = rgbaSrc[0] - static_cast(palette[paletteIndex].Red); - auto dg = rgbaSrc[1] - static_cast(palette[paletteIndex].Green); - auto db = rgbaSrc[2] - static_cast(palette[paletteIndex].Blue); - - // We don't want to dither remappable colours with nonremappable colours, etc - PaletteIndexType thisIndexType = GetPaletteIndexType(paletteIndex); - - if (x + 1 < width) + paletteIndex = GetClosestPaletteIndex(palette, rgbaSrc); + if (mode == ImportMode::Dithering) { - if (!IsInPalette(palette, rgbaSrc + 4) - && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4))) - { - // Right - rgbaSrc[4] += dr * 7 / 16; - rgbaSrc[5] += dg * 7 / 16; - rgbaSrc[6] += db * 7 / 16; - } - } + auto dr = rgbaSrc[0] - static_cast(palette[paletteIndex].Red); + auto dg = rgbaSrc[1] - static_cast(palette[paletteIndex].Green); + auto db = rgbaSrc[2] - static_cast(palette[paletteIndex].Blue); - if (y + 1 < height) - { - if (x > 0) - { - if (!IsInPalette(palette, rgbaSrc + 4 * (width - 1)) - && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * (width - 1)))) - { - // Bottom left - rgbaSrc[4 * (width - 1)] += dr * 3 / 16; - rgbaSrc[4 * (width - 1) + 1] += dg * 3 / 16; - rgbaSrc[4 * (width - 1) + 2] += db * 3 / 16; - } - } - - // Bottom - if (!IsInPalette(palette, rgbaSrc + 4 * width) - && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * width))) - { - rgbaSrc[4 * width] += dr * 5 / 16; - rgbaSrc[4 * width + 1] += dg * 5 / 16; - rgbaSrc[4 * width + 2] += db * 5 / 16; - } + // We don't want to dither remappable colours with nonremappable colours, etc + PaletteIndexType thisIndexType = GetPaletteIndexType(paletteIndex); if (x + 1 < width) { - if (!IsInPalette(palette, rgbaSrc + 4 * (width + 1)) - && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * (width + 1)))) + if (!IsInPalette(palette, rgbaSrc + 4) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4))) { - // Bottom right - rgbaSrc[4 * (width + 1)] += dr * 1 / 16; - rgbaSrc[4 * (width + 1) + 1] += dg * 1 / 16; - rgbaSrc[4 * (width + 1) + 2] += db * 1 / 16; + // Right + rgbaSrc[4] += dr * 7 / 16; + rgbaSrc[5] += dg * 7 / 16; + rgbaSrc[6] += db * 7 / 16; + } + } + + if (y + 1 < height) + { + if (x > 0) + { + if (!IsInPalette(palette, rgbaSrc + 4 * (width - 1)) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * (width - 1)))) + { + // Bottom left + rgbaSrc[4 * (width - 1)] += dr * 3 / 16; + rgbaSrc[4 * (width - 1) + 1] += dg * 3 / 16; + rgbaSrc[4 * (width - 1) + 2] += db * 3 / 16; + } + } + + // Bottom + if (!IsInPalette(palette, rgbaSrc + 4 * width) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * width))) + { + rgbaSrc[4 * width] += dr * 5 / 16; + rgbaSrc[4 * width + 1] += dg * 5 / 16; + rgbaSrc[4 * width + 2] += db * 5 / 16; + } + + if (x + 1 < width) + { + if (!IsInPalette(palette, rgbaSrc + 4 * (width + 1)) + && thisIndexType == GetPaletteIndexType(GetClosestPaletteIndex(palette, rgbaSrc + 4 * (width + 1)))) + { + // Bottom right + rgbaSrc[4 * (width + 1)] += dr * 1 / 16; + rgbaSrc[4 * (width + 1) + 1] += dg * 1 / 16; + rgbaSrc[4 * (width + 1) + 2] += db * 1 / 16; + } } } } } + + return paletteIndex; } - return paletteIndex; -} - -int32_t ImageImporter::GetPaletteIndex(const GamePalette& palette, int16_t* colour) -{ - if (!IsTransparentPixel(colour)) + int32_t ImageImporter::GetPaletteIndex(const GamePalette& palette, int16_t* colour) { - for (uint32_t i = 0; i < PALETTE_SIZE; i++) + if (!IsTransparentPixel(colour)) { - if (static_cast(palette[i].Red) == colour[0] && static_cast(palette[i].Green) == colour[1] - && static_cast(palette[i].Blue) == colour[2]) + for (uint32_t i = 0; i < PALETTE_SIZE; i++) { - return i; + if (static_cast(palette[i].Red) == colour[0] && static_cast(palette[i].Green) == colour[1] + && static_cast(palette[i].Blue) == colour[2]) + { + return i; + } } } + return PALETTE_TRANSPARENT; } - return PALETTE_TRANSPARENT; -} -bool ImageImporter::IsTransparentPixel(const int16_t* colour) -{ - return colour[3] < 128; -} - -/** - * @returns true if this colour is in the standard palette. - */ -bool ImageImporter::IsInPalette(const GamePalette& palette, int16_t* colour) -{ - return !(GetPaletteIndex(palette, colour) == PALETTE_TRANSPARENT && !IsTransparentPixel(colour)); -} - -/** - * @returns true if palette index is an index not used for a special purpose. - */ -bool ImageImporter::IsChangablePixel(int32_t paletteIndex) -{ - PaletteIndexType entryType = GetPaletteIndexType(paletteIndex); - return entryType != PaletteIndexType::Special && entryType != PaletteIndexType::PrimaryRemap; -} - -/** - * @returns the type of palette entry this is. - */ -ImageImporter::PaletteIndexType ImageImporter::GetPaletteIndexType(int32_t paletteIndex) -{ - if (paletteIndex <= 9) - return PaletteIndexType::Special; - if (paletteIndex >= 230 && paletteIndex <= 239) - return PaletteIndexType::Special; - if (paletteIndex == 255) - return PaletteIndexType::Special; - if (paletteIndex >= 243 && paletteIndex <= 254) - return PaletteIndexType::PrimaryRemap; - if (paletteIndex >= 202 && paletteIndex <= 213) - return PaletteIndexType::SecondaryRemap; - if (paletteIndex >= 46 && paletteIndex <= 57) - return PaletteIndexType::TertiaryRemap; - return PaletteIndexType::Normal; -} - -int32_t ImageImporter::GetClosestPaletteIndex(const GamePalette& palette, const int16_t* colour) -{ - auto smallestError = static_cast(-1); - auto bestMatch = PALETTE_TRANSPARENT; - for (uint32_t x = 0; x < PALETTE_SIZE; x++) + bool ImageImporter::IsTransparentPixel(const int16_t* colour) { - if (IsChangablePixel(x)) - { - uint32_t error = (static_cast(palette[x].Red) - colour[0]) - * (static_cast(palette[x].Red) - colour[0]) - + (static_cast(palette[x].Green) - colour[1]) * (static_cast(palette[x].Green) - colour[1]) - + (static_cast(palette[x].Blue) - colour[2]) * (static_cast(palette[x].Blue) - colour[2]); + return colour[3] < 128; + } - if (smallestError == static_cast(-1) || smallestError > error) + /** + * @returns true if this colour is in the standard palette. + */ + bool ImageImporter::IsInPalette(const GamePalette& palette, int16_t* colour) + { + return !(GetPaletteIndex(palette, colour) == PALETTE_TRANSPARENT && !IsTransparentPixel(colour)); + } + + /** + * @returns true if palette index is an index not used for a special purpose. + */ + bool ImageImporter::IsChangablePixel(int32_t paletteIndex) + { + PaletteIndexType entryType = GetPaletteIndexType(paletteIndex); + return entryType != PaletteIndexType::Special && entryType != PaletteIndexType::PrimaryRemap; + } + + /** + * @returns the type of palette entry this is. + */ + ImageImporter::PaletteIndexType ImageImporter::GetPaletteIndexType(int32_t paletteIndex) + { + if (paletteIndex <= 9) + return PaletteIndexType::Special; + if (paletteIndex >= 230 && paletteIndex <= 239) + return PaletteIndexType::Special; + if (paletteIndex == 255) + return PaletteIndexType::Special; + if (paletteIndex >= 243 && paletteIndex <= 254) + return PaletteIndexType::PrimaryRemap; + if (paletteIndex >= 202 && paletteIndex <= 213) + return PaletteIndexType::SecondaryRemap; + if (paletteIndex >= 46 && paletteIndex <= 57) + return PaletteIndexType::TertiaryRemap; + return PaletteIndexType::Normal; + } + + int32_t ImageImporter::GetClosestPaletteIndex(const GamePalette& palette, const int16_t* colour) + { + auto smallestError = static_cast(-1); + auto bestMatch = PALETTE_TRANSPARENT; + for (uint32_t x = 0; x < PALETTE_SIZE; x++) + { + if (IsChangablePixel(x)) { - bestMatch = x; - smallestError = error; + uint32_t error = (static_cast(palette[x].Red) - colour[0]) + * (static_cast(palette[x].Red) - colour[0]) + + (static_cast(palette[x].Green) - colour[1]) + * (static_cast(palette[x].Green) - colour[1]) + + (static_cast(palette[x].Blue) - colour[2]) * (static_cast(palette[x].Blue) - colour[2]); + + if (smallestError == static_cast(-1) || smallestError > error) + { + bestMatch = x; + smallestError = error; + } } } + return bestMatch; } - return bestMatch; -} -namespace OpenRCT2::Drawing -{ ImageImportMeta createImageImportMetaFromJson(json_t& input) { auto xOffset = Json::GetNumber(input["x"]); From d969a4f80d56d8d13bb1380c170b6eebd6bef90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 3 Mar 2024 12:47:50 +0200 Subject: [PATCH 177/191] Default initialize all members in Ride --- src/openrct2/ride/Ride.h | 216 +++++++++++++++++++-------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 3615d13a89..e78ad272b6 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -50,20 +50,20 @@ constexpr uint16_t const MAZE_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP; struct RideStation { + static constexpr uint8_t NO_TRAIN = std::numeric_limits::max(); + CoordsXY Start; - uint8_t Height; - uint8_t Length; - uint8_t Depart; - uint8_t TrainAtStation; + uint8_t Height{}; + uint8_t Length{}; + uint8_t Depart{}; + uint8_t TrainAtStation{ NO_TRAIN }; TileCoordsXYZD Entrance; TileCoordsXYZD Exit; - int32_t SegmentLength; // Length of track between this station and the next. - uint16_t SegmentTime; // Time for train to reach the next station from this station. - uint8_t QueueTime; - uint16_t QueueLength; - EntityId LastPeepInQueue; - - static constexpr uint8_t NO_TRAIN = std::numeric_limits::max(); + int32_t SegmentLength{}; // Length of track between this station and the next. + uint16_t SegmentTime{}; // Time for train to reach the next station from this station. + uint8_t QueueTime{}; + uint16_t QueueLength{}; + EntityId LastPeepInQueue{ EntityId::GetNull() }; int32_t GetBaseZ() const; void SetBaseZ(int32_t newZ); @@ -113,20 +113,20 @@ enum class RideStatus : uint8_t; */ struct Ride { - RideId id = RideId::GetNull(); - ride_type_t type = RIDE_TYPE_NULL; + RideId id{ RideId::GetNull() }; + ride_type_t type{ RIDE_TYPE_NULL }; // pointer to static info. for example, wild mouse type is 0x36, subtype is // 0x4c. - ObjectEntryIndex subtype; - RideMode mode; - uint8_t colour_scheme_type; - VehicleColour vehicle_colours[OpenRCT2::Limits::MaxVehicleColours]; + ObjectEntryIndex subtype{ OBJECT_ENTRY_INDEX_NULL }; + RideMode mode{}; + uint8_t colour_scheme_type{}; + VehicleColour vehicle_colours[OpenRCT2::Limits::MaxVehicleColours]{}; // 0 = closed, 1 = open, 2 = test - RideStatus status; + RideStatus status{}; std::string custom_name; - uint16_t default_name_number; + uint16_t default_name_number{}; CoordsXY overall_view; - EntityId vehicles[OpenRCT2::Limits::MaxTrainsPerRide + 1]; // Points to the first car in the train + EntityId vehicles[OpenRCT2::Limits::MaxTrainsPerRide + 1]{}; // Points to the first car in the train uint8_t depart_flags; uint8_t num_stations; uint8_t NumTrains; @@ -145,54 +145,54 @@ struct Ride uint8_t NumLaps; uint8_t launch_speed; uint8_t speed; - uint8_t rotations; + uint8_t rotations{}; }; - uint8_t boat_hire_return_direction; + uint8_t boat_hire_return_direction{}; TileCoordsXY boat_hire_return_position; // bits 0 through 4 are the number of helix sections // bit 5: spinning tunnel, water splash, or rapids // bit 6: log reverser, waterfall // bit 7: whirlpool - uint8_t special_track_elements; + uint8_t special_track_elements{}; // Divide this value by 29127 to get the human-readable max speed // (in RCT2, display_speed = (max_speed * 9) >> 18) - int32_t max_speed; - int32_t average_speed; - uint8_t current_test_segment; - uint8_t average_speed_test_timeout; - fixed16_2dp max_positive_vertical_g; - fixed16_2dp max_negative_vertical_g; - fixed16_2dp max_lateral_g; - fixed16_2dp previous_vertical_g; - fixed16_2dp previous_lateral_g; - uint32_t testing_flags; + int32_t max_speed{}; + int32_t average_speed{}; + uint8_t current_test_segment{}; + uint8_t average_speed_test_timeout{}; + fixed16_2dp max_positive_vertical_g{}; + fixed16_2dp max_negative_vertical_g{}; + fixed16_2dp max_lateral_g{}; + fixed16_2dp previous_vertical_g{}; + fixed16_2dp previous_lateral_g{}; + uint32_t testing_flags{}; // x y z map location of the current track piece during a test // this is to prevent counting special tracks multiple times TileCoordsXYZ CurTestTrackLocation; // Next 3 variables are related (XXXX XYYY ZZZa aaaa) - uint16_t turn_count_default; // X = current turn count - uint16_t turn_count_banked; - uint16_t turn_count_sloped; // X = number turns > 3 elements + uint16_t turn_count_default{}; // X = current turn count + uint16_t turn_count_banked{}; + uint16_t turn_count_sloped{}; // X = number turns > 3 elements // Y is number of powered lifts, X is drops - uint8_t drops; // (YYXX XXXX) - uint8_t start_drop_height; - uint8_t highest_drop_height; - int32_t sheltered_length; + uint8_t drops{}; // (YYXX XXXX) + uint8_t start_drop_height{}; + uint8_t highest_drop_height{}; + int32_t sheltered_length{}; // Unused always 0? Should affect nausea - uint16_t var_11C; - uint8_t num_sheltered_sections; // (?abY YYYY) + uint16_t var_11C{}; + uint8_t num_sheltered_sections{}; // (?abY YYYY) // Customer counter in the current 960 game tick (about 30 seconds) interval - uint16_t cur_num_customers; + uint16_t cur_num_customers{}; // Counts ticks to update customer intervals, resets each 960 game ticks. - uint16_t num_customers_timeout; + uint16_t num_customers_timeout{}; // Customer count in the last 10 * 960 game ticks (sliding window) - uint16_t num_customers[OpenRCT2::Limits::CustomerHistorySize]; - money64 price[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]; + uint16_t num_customers[OpenRCT2::Limits::CustomerHistorySize]{}; + money64 price[RCT2::ObjectLimits::MaxShopItemsPerRideEntry]{}; TileCoordsXYZ ChairliftBullwheelLocation[2]; union { - RatingTuple ratings; + RatingTuple ratings{}; struct { ride_rating excitement; @@ -200,39 +200,39 @@ struct Ride ride_rating nausea; }; }; - money64 value; - uint16_t chairlift_bullwheel_rotation; - uint8_t satisfaction; - uint8_t satisfaction_time_out; - uint8_t satisfaction_next; + money64 value{}; + uint16_t chairlift_bullwheel_rotation{}; + uint8_t satisfaction{}; + uint8_t satisfaction_time_out{}; + uint8_t satisfaction_next{}; // Various flags stating whether a window needs to be refreshed - uint8_t window_invalidate_flags; - uint32_t total_customers; - money64 total_profit; - uint8_t popularity; - uint8_t popularity_time_out; // Updated every purchase and ?possibly by time? - uint8_t popularity_next; // When timeout reached this will be the next popularity - uint16_t num_riders; - uint8_t music_tune_id; - uint8_t slide_in_use; + uint8_t window_invalidate_flags{}; + uint32_t total_customers{}; + money64 total_profit{}; + uint8_t popularity{}; + uint8_t popularity_time_out{}; // Updated every purchase and ?possibly by time? + uint8_t popularity_next{}; // When timeout reached this will be the next popularity + uint16_t num_riders{}; + uint8_t music_tune_id{}; + uint8_t slide_in_use{}; union { EntityId slide_peep; - uint16_t maze_tiles; + uint16_t maze_tiles{}; }; - uint8_t slide_peep_t_shirt_colour; - uint8_t spiral_slide_progress; - int32_t build_date; - money64 upkeep_cost; - EntityId race_winner; - uint32_t music_position; - uint8_t breakdown_reason_pending; - uint8_t mechanic_status; - EntityId mechanic; - StationIndex inspection_station; - uint8_t broken_vehicle; - uint8_t broken_car; - uint8_t breakdown_reason; + uint8_t slide_peep_t_shirt_colour{}; + uint8_t spiral_slide_progress{}; + int32_t build_date{}; + money64 upkeep_cost{}; + EntityId race_winner{}; + uint32_t music_position{}; + uint8_t breakdown_reason_pending{}; + uint8_t mechanic_status{}; + EntityId mechanic{ EntityId::GetNull() }; + StationIndex inspection_station{ StationIndex::GetNull() }; + uint8_t broken_vehicle{}; + uint8_t broken_car{}; + uint8_t breakdown_reason{}; union { struct @@ -240,52 +240,52 @@ struct Ride uint8_t reliability_subvalue; // 0 - 255, acts like the decimals for reliability_percentage uint8_t reliability_percentage; // Starts at 100 and decreases from there. }; - uint16_t reliability; + uint16_t reliability{}; }; // Small constant used to increase the unreliability as the game continues, // making breakdowns more and more likely. - uint8_t unreliability_factor; + uint8_t unreliability_factor{}; // Range from [0, 100] - uint8_t downtime; - uint8_t inspection_interval; - uint8_t last_inspection; - uint8_t downtime_history[OpenRCT2::Limits::DowntimeHistorySize]; - uint32_t no_primary_items_sold; - uint32_t no_secondary_items_sold; - uint8_t breakdown_sound_modifier; + uint8_t downtime{}; + uint8_t inspection_interval{}; + uint8_t last_inspection{}; + uint8_t downtime_history[OpenRCT2::Limits::DowntimeHistorySize]{}; + uint32_t no_primary_items_sold{}; + uint32_t no_secondary_items_sold{}; + uint8_t breakdown_sound_modifier{}; // Used to oscillate the sound when ride breaks down. // 0 = no change, 255 = max change - uint8_t not_fixed_timeout; - uint8_t last_crash_type; - uint8_t connected_message_throttle; - money64 income_per_hour; - money64 profit; - TrackColour track_colour[OpenRCT2::Limits::NumColourSchemes]; - ObjectEntryIndex music; - ObjectEntryIndex entrance_style; - uint16_t vehicle_change_timeout; - uint8_t num_block_brakes; - uint8_t lift_hill_speed; - uint32_t guests_favourite; - uint32_t lifecycle_flags; - uint16_t total_air_time; - StationIndex current_test_station; - uint8_t num_circuits; - CoordsXYZ CableLiftLoc; - EntityId cable_lift; + uint8_t not_fixed_timeout{}; + uint8_t last_crash_type{}; + uint8_t connected_message_throttle{}; + money64 income_per_hour{}; + money64 profit{}; + TrackColour track_colour[OpenRCT2::Limits::NumColourSchemes]{}; + ObjectEntryIndex music{ OBJECT_ENTRY_INDEX_NULL }; + ObjectEntryIndex entrance_style{ OBJECT_ENTRY_INDEX_NULL }; + uint16_t vehicle_change_timeout{}; + uint8_t num_block_brakes{}; + uint8_t lift_hill_speed{}; + uint32_t guests_favourite{}; + uint32_t lifecycle_flags{}; + uint16_t total_air_time{}; + StationIndex current_test_station{ StationIndex::GetNull() }; + uint8_t num_circuits{}; + CoordsXYZ CableLiftLoc{}; + EntityId cable_lift{ EntityId::GetNull() }; // These two fields are used to warn users about issues. // Such issue can be hacked rides with incompatible options set. // They don't require export/import. - uint8_t current_issues; - uint32_t last_issue_time; + uint8_t current_issues{}; + uint32_t last_issue_time{}; // TO-DO: those friend functions are temporary, find a way to not access the private fields friend void UpdateSpiralSlide(Ride& ride); friend void UpdateChairlift(Ride& ride); private: - std::array stations; + std::array stations{}; public: RideStation& GetStation(StationIndex stationIndex = StationIndex::FromUnderlying(0)); @@ -299,9 +299,9 @@ public: StationIndex::UnderlyingType GetStationNumber(StationIndex in) const; public: - uint16_t inversions; - uint16_t holes; - uint8_t sheltered_eighths; + uint16_t inversions{}; + uint16_t holes{}; + uint8_t sheltered_eighths{}; std::unique_ptr measurement; From e3343f263f6f8fcbab812215f1169c257a061ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 3 Mar 2024 13:55:47 +0200 Subject: [PATCH 178/191] Default initialize newly created Rides --- src/openrct2/ride/Ride.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 8669914da8..26782267d4 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -176,6 +176,12 @@ Ride* RideAllocateAtIndex(RideId index) auto result = &GetGameState().Rides[idx]; assert(result->id == RideId::GetNull()); + // Initialize the ride to all the defaults. + *result = Ride{}; + + // Because it is default initialized to zero rather than the magic constant for Null, fill the array. + std::fill(std::begin(result->vehicles), std::end(result->vehicles), EntityId::GetNull()); + result->id = index; return result; } From f14b86426d969e53684d0d78b6f0cd7011529e26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 3 Mar 2024 14:05:31 +0200 Subject: [PATCH 179/191] Remove some unnecessary field assignments in RideCreateAction --- src/openrct2/actions/RideCreateAction.cpp | 36 ----------------------- 1 file changed, 36 deletions(-) diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 10440ca355..25f7568733 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -141,7 +141,6 @@ GameActions::Result RideCreateAction::Execute() const return GameActions::Result(GameActions::Status::Unknown, STR_CANT_CREATE_NEW_RIDE_ATTRACTION, STR_UNKNOWN_OBJECT_TYPE); } - ride->id = rideIndex; ride->type = _rideType; ride->subtype = rideEntryIndex; ride->SetColourPreset(_colour1); @@ -161,12 +160,7 @@ GameActions::Result RideCreateAction::Execute() const station.Height = 0; } - std::fill(std::begin(ride->vehicles), std::end(ride->vehicles), EntityId::GetNull()); - ride->status = RideStatus::Closed; - ride->lifecycle_flags = 0; - ride->vehicle_change_timeout = 0; - ride->num_stations = 0; ride->NumTrains = 1; if (GetGameState().Cheats.DisableTrainLengthLimit) { @@ -210,16 +204,7 @@ GameActions::Result RideCreateAction::Execute() const ride->lift_hill_speed = rtd.LiftData.minimum_speed; - ride->measurement = {}; ride->excitement = kRideRatingUndefined; - ride->cur_num_customers = 0; - ride->num_customers_timeout = 0; - ride->chairlift_bullwheel_rotation = 0; - - for (auto& price : ride->price) - { - price = 0; - } auto& gameState = GetGameState(); if (!(gameState.ParkFlags & PARK_FLAGS_NO_MONEY)) @@ -288,20 +273,9 @@ GameActions::Result RideCreateAction::Execute() const } } - std::fill(std::begin(ride->num_customers), std::end(ride->num_customers), 0); ride->value = RIDE_VALUE_UNDEFINED; ride->satisfaction = 255; - ride->satisfaction_time_out = 0; - ride->satisfaction_next = 0; ride->popularity = 255; - ride->popularity_time_out = 0; - ride->popularity_next = 0; - ride->window_invalidate_flags = 0; - ride->total_customers = 0; - ride->total_profit = 0; - ride->num_riders = 0; - ride->slide_in_use = 0; - ride->maze_tiles = 0; ride->build_date = GetDate().GetMonthsElapsed(); ride->music_tune_id = TUNE_ID_NULL; @@ -310,16 +284,9 @@ GameActions::Result RideCreateAction::Execute() const ride->reliability = kRideInitialReliability; ride->unreliability_factor = 1; ride->inspection_interval = RIDE_INSPECTION_EVERY_30_MINUTES; - ride->last_inspection = 0; - ride->downtime = 0; - std::fill_n(ride->downtime_history, sizeof(ride->downtime_history), 0x00); - ride->no_primary_items_sold = 0; - ride->no_secondary_items_sold = 0; ride->last_crash_type = RIDE_CRASH_TYPE_NONE; ride->income_per_hour = kMoney64Undefined; ride->profit = kMoney64Undefined; - ride->connected_message_throttle = 0; - ride->drops = 0; ride->entrance_style = OBJECT_ENTRY_INDEX_NULL; if (rtd.HasFlag(RIDE_TYPE_FLAG_HAS_ENTRANCE_EXIT)) @@ -327,9 +294,6 @@ GameActions::Result RideCreateAction::Execute() const ride->entrance_style = _entranceObjectIndex; } - ride->num_block_brakes = 0; - ride->guests_favourite = 0; - ride->num_circuits = 1; ride->mode = ride->GetDefaultMode(); ride->MinCarsPerTrain = rideEntry->min_cars_in_train; From 84d1f502b115b7d8b8111a6e6b1f5643020acf60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=CE=B6eh=20Matt?= <5415177+ZehMatt@users.noreply.github.com> Date: Sun, 3 Mar 2024 17:53:44 +0200 Subject: [PATCH 180/191] Rename NO_TRAIN to kNoTrain --- src/openrct2/actions/RideCreateAction.cpp | 2 +- src/openrct2/entity/Guest.cpp | 2 +- src/openrct2/rct1/S4Importer.cpp | 2 +- src/openrct2/rct2/S6Importer.cpp | 2 +- src/openrct2/ride/Ride.h | 4 ++-- src/openrct2/ride/RideConstruction.cpp | 2 +- src/openrct2/ride/Vehicle.cpp | 12 ++++++------ 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/openrct2/actions/RideCreateAction.cpp b/src/openrct2/actions/RideCreateAction.cpp index 25f7568733..7512bc69a8 100644 --- a/src/openrct2/actions/RideCreateAction.cpp +++ b/src/openrct2/actions/RideCreateAction.cpp @@ -152,7 +152,7 @@ GameActions::Result RideCreateAction::Execute() const station.Start.SetNull(); station.Entrance.SetNull(); station.Exit.SetNull(); - station.TrainAtStation = RideStation::NO_TRAIN; + station.TrainAtStation = RideStation::kNoTrain; station.QueueTime = 0; station.SegmentLength = 0; station.QueueLength = 0; diff --git a/src/openrct2/entity/Guest.cpp b/src/openrct2/entity/Guest.cpp index 8d11e2534c..0dee7da7cd 100644 --- a/src/openrct2/entity/Guest.cpp +++ b/src/openrct2/entity/Guest.cpp @@ -2533,7 +2533,7 @@ void Guest::GoToRideEntrance(const Ride& ride) bool Guest::FindVehicleToEnter(const Ride& ride, std::vector& car_array) { - uint8_t chosen_train = RideStation::NO_TRAIN; + uint8_t chosen_train = RideStation::kNoTrain; if (ride.mode == RideMode::Dodgems || ride.mode == RideMode::Race) { diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 725ad9abee..69ebdcaff1 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -916,7 +916,7 @@ namespace RCT1 { auto& dstStation = dst->GetStation(StationIndex::FromUnderlying(i)); dstStation.Start.SetNull(); - dstStation.TrainAtStation = RideStation::NO_TRAIN; + dstStation.TrainAtStation = RideStation::kNoTrain; dstStation.Entrance.SetNull(); dstStation.Exit.SetNull(); dstStation.LastPeepInQueue = EntityId::GetNull(); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 4a7d9f8811..94373ba570 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -1397,7 +1397,7 @@ namespace RCT2 auto& destStation = dst->GetStation(stationIndex); destStation.Start.SetNull(); - destStation.TrainAtStation = RideStation::NO_TRAIN; + destStation.TrainAtStation = RideStation::kNoTrain; destStation.Entrance.SetNull(); destStation.Exit.SetNull(); destStation.LastPeepInQueue = EntityId::GetNull(); diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index e78ad272b6..2e18ef7125 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -50,13 +50,13 @@ constexpr uint16_t const MAZE_CLEARANCE_HEIGHT = 4 * COORDS_Z_STEP; struct RideStation { - static constexpr uint8_t NO_TRAIN = std::numeric_limits::max(); + static constexpr uint8_t kNoTrain = std::numeric_limits::max(); CoordsXY Start; uint8_t Height{}; uint8_t Length{}; uint8_t Depart{}; - uint8_t TrainAtStation{ NO_TRAIN }; + uint8_t TrainAtStation{ kNoTrain }; TileCoordsXYZD Entrance; TileCoordsXYZD Exit; int32_t SegmentLength{}; // Length of track between this station and the next. diff --git a/src/openrct2/ride/RideConstruction.cpp b/src/openrct2/ride/RideConstruction.cpp index c133283391..4cfca9604f 100644 --- a/src/openrct2/ride/RideConstruction.cpp +++ b/src/openrct2/ride/RideConstruction.cpp @@ -198,7 +198,7 @@ void Ride::RemoveVehicles() } for (size_t i = 0; i < OpenRCT2::Limits::MaxStationsPerRide; i++) - stations[i].TrainAtStation = RideStation::NO_TRAIN; + stations[i].TrainAtStation = RideStation::kNoTrain; // Also clean up orphaned vehicles for good measure. for (auto* vehicle : TrainManager::View()) diff --git a/src/openrct2/ride/Vehicle.cpp b/src/openrct2/ride/Vehicle.cpp index c48ce37031..462038b032 100644 --- a/src/openrct2/ride/Vehicle.cpp +++ b/src/openrct2/ride/Vehicle.cpp @@ -1460,7 +1460,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se // Boat Hire with passengers on it. if (curRide->status != RideStatus::Closed || (curRide->num_riders != 0 && curRide->type != RIDE_TYPE_BOAT_HIRE)) { - curRide->GetStation(current_station).TrainAtStation = RideStation::NO_TRAIN; + curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; sub_state = 2; return; } @@ -1471,7 +1471,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se uint8_t seat = ((-Pitch) / 8) & 0xF; if (!peep[seat].IsNull()) { - curRide->GetStation(current_station).TrainAtStation = RideStation::NO_TRAIN; + curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; SetState(Vehicle::Status::UnloadingPassengers); return; } @@ -1479,7 +1479,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se if (num_peeps == 0) return; - curRide->GetStation(current_station).TrainAtStation = RideStation::NO_TRAIN; + curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; sub_state = 2; return; } @@ -1487,7 +1487,7 @@ void Vehicle::TrainReadyToDepart(uint8_t num_peeps_on_train, uint8_t num_used_se if (num_peeps_on_train == 0) return; - curRide->GetStation(current_station).TrainAtStation = RideStation::NO_TRAIN; + curRide->GetStation(current_station).TrainAtStation = RideStation::kNoTrain; SetState(Vehicle::Status::WaitingForPassengers); } @@ -1532,7 +1532,7 @@ void Vehicle::UpdateWaitingForPassengers() auto& station = curRide->GetStation(current_station); if (station.Entrance.IsNull()) { - station.TrainAtStation = RideStation::NO_TRAIN; + station.TrainAtStation = RideStation::kNoTrain; sub_state = 2; return; } @@ -1543,7 +1543,7 @@ void Vehicle::UpdateWaitingForPassengers() return; } - if (station.TrainAtStation != RideStation::NO_TRAIN) + if (station.TrainAtStation != RideStation::kNoTrain) return; station.TrainAtStation = trainIndex.value(); From d8ba574e6cc81a96b93ebd53b0e9423ec4a72811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Sun, 31 Mar 2024 00:12:24 +0100 Subject: [PATCH 181/191] Default-initialise more members of Ride (#21694) It seems they got omitted in https://github.com/OpenRCT2/OpenRCT2/pull/21514 --- src/openrct2/ride/Ride.h | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/openrct2/ride/Ride.h b/src/openrct2/ride/Ride.h index 2e18ef7125..9ae087ed4b 100644 --- a/src/openrct2/ride/Ride.h +++ b/src/openrct2/ride/Ride.h @@ -127,17 +127,17 @@ struct Ride uint16_t default_name_number{}; CoordsXY overall_view; EntityId vehicles[OpenRCT2::Limits::MaxTrainsPerRide + 1]{}; // Points to the first car in the train - uint8_t depart_flags; - uint8_t num_stations; - uint8_t NumTrains; - uint8_t num_cars_per_train; - uint8_t ProposedNumTrains; - uint8_t proposed_num_cars_per_train; - uint8_t max_trains; - uint8_t MinCarsPerTrain; - uint8_t MaxCarsPerTrain; - uint8_t min_waiting_time; - uint8_t max_waiting_time; + uint8_t depart_flags{}; + uint8_t num_stations{}; + uint8_t NumTrains{}; + uint8_t num_cars_per_train{}; + uint8_t ProposedNumTrains{}; + uint8_t proposed_num_cars_per_train{}; + uint8_t max_trains{}; + uint8_t MinCarsPerTrain{}; + uint8_t MaxCarsPerTrain{}; + uint8_t min_waiting_time{}; + uint8_t max_waiting_time{}; union { uint8_t operation_option; From 0668f0fb92ad66863512b76b407b534c8f7230a2 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 31 Mar 2024 17:57:14 +0200 Subject: [PATCH 182/191] Fix #21695: Cannot remove large scenery --- src/openrct2/actions/LargeSceneryRemoveAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/actions/LargeSceneryRemoveAction.cpp b/src/openrct2/actions/LargeSceneryRemoveAction.cpp index 879ec229f8..ff8bb62ee1 100644 --- a/src/openrct2/actions/LargeSceneryRemoveAction.cpp +++ b/src/openrct2/actions/LargeSceneryRemoveAction.cpp @@ -75,8 +75,8 @@ GameActions::Result LargeSceneryRemoveAction::Query() 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_UNKNOWN_OBJECT_TYPE); } - return GameActions::Result(GameActions::Status::Unknown, STR_CANT_REMOVE_THIS, STR_UNKNOWN_OBJECT_TYPE); auto rotatedOffsets = CoordsXYZ{ CoordsXY{ sceneryEntry->tiles[_tileIndex].x_offset, sceneryEntry->tiles[_tileIndex].y_offset }.Rotate(_loc.direction), From 19a65d1642abd6deb0173fbde653589e0e715474 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Sun, 31 Mar 2024 19:25:19 +0200 Subject: [PATCH 183/191] Bump network version for large scenery fix (#21699) --- src/openrct2/network/NetworkBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 4b38f2189c..23e02b884b 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -46,7 +46,7 @@ using namespace OpenRCT2; // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "1" +#define NETWORK_STREAM_VERSION "2" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION From 06081eb23d896861f71fc548dd767d7da1e212dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Mon, 1 Apr 2024 00:23:37 +0200 Subject: [PATCH 184/191] Fix #21691: Use correct iterator in RideCheckTrackContainsBanked (#21701) --- distribution/changelog.txt | 1 + src/openrct2/ride/Ride.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index 27236e3755..f0ffa63cfa 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -28,6 +28,7 @@ - Fix: [#21641] Crash when creating track iterator from an invalid tile element. - Fix: [#21652] Dialog window to confirm overwriting files does not apply the theme colours correctly. - Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit. +- Fix: [#21691] Crash when validating rides which can't contain banked track. - Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. - Fix: [objects#296] Incorrect wall placement around large Kremlin/drab pieces. - Fix: [objects#300] Incorrect Colosseum and volcano corner clearances. diff --git a/src/openrct2/ride/Ride.cpp b/src/openrct2/ride/Ride.cpp index 26782267d4..d0300a5cf3 100644 --- a/src/openrct2/ride/Ride.cpp +++ b/src/openrct2/ride/Ride.cpp @@ -2858,7 +2858,7 @@ static bool RideCheckTrackContainsBanked(const CoordsXYE& input, CoordsXYE* outp while (TrackCircuitIteratorNext(&it)) { - auto trackType = output->element->AsTrack()->GetTrackType(); + auto trackType = it.current.element->AsTrack()->GetTrackType(); const auto& ted = GetTrackElementDescriptor(trackType); if (ted.Flags & TRACK_ELEM_FLAG_BANKED) { From 9062049be1c35c54462c0d7427769e492d8a4627 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 1 Apr 2024 00:28:17 +0200 Subject: [PATCH 185/191] Fix sound effects not working with RCTC base, fix audio object conflict MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to this overwriting of object IDs, loading the sound effects would not work on RCTC. This overwriting also caused object conflicts which weren’t always won by the RCTC one. This fixes both problems by using non-clashing names, and only renaming one to `rct2.audio.base`, the name expected by the asset packs. --- CMakeLists.txt | 4 ++-- distribution/changelog.txt | 2 ++ openrct2.proj | 4 ++-- src/openrct2/audio/Audio.cpp | 23 +++-------------------- src/openrct2/audio/audio.h | 4 +++- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/object/ObjectFactory.cpp | 18 +++++++++++++++--- 7 files changed, 28 insertions(+), 29 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b42e9a313b..b309dc5a99 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,9 +64,9 @@ set(TITLE_SEQUENCE_VERSION "0.4.6") set(TITLE_SEQUENCE_URL "https://github.com/OpenRCT2/title-sequences/releases/download/v${TITLE_SEQUENCE_VERSION}/title-sequences.zip") set(TITLE_SEQUENCE_SHA1 "80fefc6ebbabc42a6f4703412daa5c62f661420d") -set(OBJECTS_VERSION "1.4.2") +set(OBJECTS_VERSION "1.4.3") set(OBJECTS_URL "https://github.com/OpenRCT2/objects/releases/download/v${OBJECTS_VERSION}/objects.zip") -set(OBJECTS_SHA1 "2adc4cb66a6446533d67097bdf44cd9c5882fea3") +set(OBJECTS_SHA1 "ac78210ef46465c0f51bbffd6fe21845092af48e") set(OPENSFX_VERSION "1.0.5") set(OPENSFX_URL "https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v${OPENSFX_VERSION}/opensound.zip") diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f0ffa63cfa..c5625c81f3 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -27,6 +27,8 @@ - Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. - Fix: [#21652] Dialog window to confirm overwriting files does not apply the theme colours correctly. +- Fix: [#21654] No sound effects when using RCT Classic as an asset base. +- Fix: [#21654] Extraneous reports of an object conflict between `rct2.audio.base` and `rct2.audio.base.rctc`. - Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit. - Fix: [#21691] Crash when validating rides which can't contain banked track. - Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. diff --git a/openrct2.proj b/openrct2.proj index d34fcceb46..7cd2c43a3a 100644 --- a/openrct2.proj +++ b/openrct2.proj @@ -45,8 +45,8 @@ bd338aa3da9a357fb996dcaa6cea02c4f906718c https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.6/title-sequences.zip 80fefc6ebbabc42a6f4703412daa5c62f661420d - https://github.com/OpenRCT2/objects/releases/download/v1.4.2/objects.zip - 2adc4cb66a6446533d67097bdf44cd9c5882fea3 + https://github.com/OpenRCT2/objects/releases/download/v1.4.3/objects.zip + ac78210ef46465c0f51bbffd6fe21845092af48e https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.5/opensound.zip b1b1f1b241d2cbff63a1889c4dc5a09bdf769bfb https://github.com/OpenRCT2/OpenMusic/releases/download/v1.5/openmusic.zip diff --git a/src/openrct2/audio/Audio.cpp b/src/openrct2/audio/Audio.cpp index d2173ecba9..e9a6e221e3 100644 --- a/src/openrct2/audio/Audio.cpp +++ b/src/openrct2/audio/Audio.cpp @@ -101,27 +101,10 @@ namespace OpenRCT2::Audio { auto& objManager = GetContext()->GetObjectManager(); - Object* baseAudio{}; - - // We have a different audio object for RCT Classic - auto env = GetContext()->GetPlatformEnvironment(); - if (env->IsUsingClassic()) + Object* baseAudio = objManager.LoadObject(AudioObjectIdentifiers::RCT2); + if (baseAudio != nullptr) { - baseAudio = objManager.LoadObject(AudioObjectIdentifiers::RCTCBase); - if (baseAudio != nullptr) - { - _soundsAudioObjectEntryIndex = objManager.GetLoadedObjectEntryIndex(baseAudio); - } - } - - if (baseAudio == nullptr) - { - // Fallback to vanilla RCT2 audio object - baseAudio = objManager.LoadObject(AudioObjectIdentifiers::RCT2Base); - if (baseAudio != nullptr) - { - _soundsAudioObjectEntryIndex = objManager.GetLoadedObjectEntryIndex(baseAudio); - } + _soundsAudioObjectEntryIndex = objManager.GetLoadedObjectEntryIndex(baseAudio); } objManager.LoadObject(AudioObjectIdentifiers::OpenRCT2Additional); diff --git a/src/openrct2/audio/audio.h b/src/openrct2/audio/audio.h index 1fe76571d6..5d34b28a26 100644 --- a/src/openrct2/audio/audio.h +++ b/src/openrct2/audio/audio.h @@ -140,7 +140,9 @@ namespace OpenRCT2::Audio namespace AudioObjectIdentifiers { constexpr std::string_view RCT1Title = "rct1.audio.title"; - constexpr std::string_view RCT2Base = "rct2.audio.base"; + // virtual name, used by either RCT2Base or RCTCBase, depending on which one is loaded. + constexpr std::string_view RCT2 = "rct2.audio.base"; + constexpr std::string_view RCT2Base = "rct2.audio.base.rct2"; constexpr std::string_view RCTCBase = "rct2.audio.base.rctc"; constexpr std::string_view RCT2Title = "rct2.audio.title"; constexpr std::string_view OpenRCT2Title = "openrct2.audio.title"; diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 23e02b884b..54f7ed66cd 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -46,7 +46,7 @@ using namespace OpenRCT2; // It is used for making sure only compatible builds get connected, even within // single OpenRCT2 version. -#define NETWORK_STREAM_VERSION "2" +#define NETWORK_STREAM_VERSION "3" #define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION diff --git a/src/openrct2/object/ObjectFactory.cpp b/src/openrct2/object/ObjectFactory.cpp index f10790f7b5..1942f5fae6 100644 --- a/src/openrct2/object/ObjectFactory.cpp +++ b/src/openrct2/object/ObjectFactory.cpp @@ -9,7 +9,9 @@ #include "ObjectFactory.h" +#include "../Context.h" #include "../OpenRCT2.h" +#include "../PlatformEnvironment.h" #include "../audio/audio.h" #include "../core/Console.hpp" #include "../core/File.h" @@ -500,6 +502,12 @@ namespace ObjectFactory } } + static bool isUsingClassic() + { + auto env = OpenRCT2::GetContext()->GetPlatformEnvironment(); + return env->IsUsingClassic(); + } + std::unique_ptr CreateObjectFromJson( IObjectRepository& objectRepository, json_t& jRoot, const IFileDataRetriever* fileRetriever, bool loadImageTable) { @@ -517,9 +525,13 @@ namespace ObjectFactory { auto id = Json::GetString(jRoot["id"]); - // HACK Disguise RCT Classic audio as RCT2 audio so asset packs override correctly - if (id == OpenRCT2::Audio::AudioObjectIdentifiers::RCTCBase) - id = OpenRCT2::Audio::AudioObjectIdentifiers::RCT2Base; + // Base audio files are renamed to a common, virtual name so asset packs can override it correctly. + const bool isRCT2BaseAudio = id == OpenRCT2::Audio::AudioObjectIdentifiers::RCT2Base && !isUsingClassic(); + const bool isRCTCBaseAudio = id == OpenRCT2::Audio::AudioObjectIdentifiers::RCTCBase && isUsingClassic(); + if (isRCT2BaseAudio || isRCTCBaseAudio) + { + id = OpenRCT2::Audio::AudioObjectIdentifiers::RCT2; + } auto version = VersionTuple(Json::GetString(jRoot["version"])); ObjectEntryDescriptor descriptor; From a94e6c54d85f6514519a61262abca42129728eb9 Mon Sep 17 00:00:00 2001 From: Claudio Tiecher Date: Mon, 1 Apr 2024 12:00:32 +0200 Subject: [PATCH 186/191] Part of #21421: replace define with constexpr (#21679) --- src/openrct2-ui/input/MouseInput.cpp | 4 ++-- src/openrct2-ui/windows/Footpath.cpp | 4 ++-- src/openrct2-ui/windows/Map.cpp | 4 ++-- src/openrct2-ui/windows/MapGen.cpp | 4 ++-- src/openrct2/Context.cpp | 2 +- src/openrct2/GameState.cpp | 2 +- src/openrct2/actions/FootpathPlaceAction.cpp | 2 +- src/openrct2/actions/GameAction.cpp | 2 +- src/openrct2/actions/LandLowerAction.cpp | 6 +++--- src/openrct2/actions/LandRaiseAction.cpp | 2 +- src/openrct2/actions/LandSetHeightAction.cpp | 14 +++++++------- src/openrct2/config/Config.cpp | 2 +- src/openrct2/entity/Staff.cpp | 4 ++-- src/openrct2/interface/Viewport.cpp | 8 ++++---- src/openrct2/network/NetworkBase.cpp | 2 +- src/openrct2/paint/support/MetalSupports.cpp | 6 +++--- src/openrct2/paint/support/WoodenSupports.cpp | 12 ++++++------ .../paint/tile_element/Paint.SmallScenery.cpp | 4 ++-- src/openrct2/paint/tile_element/Paint.Surface.cpp | 4 ++-- src/openrct2/rct12/RCT12.cpp | 8 ++++---- src/openrct2/ride/VehicleRiderControl.cpp | 2 +- src/openrct2/scenario/Scenario.cpp | 4 ++-- src/openrct2/scenario/Scenario.h | 7 ++----- src/openrct2/title/Command/LoadScenario.h | 4 ++-- src/openrct2/world/Map.h | 9 +++------ src/openrct2/world/MapGen.cpp | 4 ++-- src/openrct2/world/Scenery.h | 4 ++-- src/openrct2/world/SmallScenery.cpp | 2 +- src/openrct2/world/Surface.cpp | 12 ++++++------ src/openrct2/world/Surface.h | 12 ++++++------ src/openrct2/world/TileElement.h | 2 +- src/openrct2/world/TileElementBase.cpp | 6 +++--- 32 files changed, 79 insertions(+), 85 deletions(-) diff --git a/src/openrct2-ui/input/MouseInput.cpp b/src/openrct2-ui/input/MouseInput.cpp index 6c55f56e16..03b44c2b8a 100644 --- a/src/openrct2-ui/input/MouseInput.cpp +++ b/src/openrct2-ui/input/MouseInput.cpp @@ -1697,11 +1697,11 @@ void InputScrollViewport(const ScreenCoordsXY& scrollScreenCoords) // Clamp to the map minimum value int32_t at_map_edge = 0; int32_t at_map_edge_dy = 0; - if (mapCoord.x < MAP_MINIMUM_X_Y || mapCoord.y < MAP_MINIMUM_X_Y) + if (mapCoord.x < kMapMinimumXY || mapCoord.y < kMapMinimumXY) { at_map_edge = 1; } - if (mapCoord_dy.x < MAP_MINIMUM_X_Y || mapCoord_dy.y < MAP_MINIMUM_X_Y) + if (mapCoord_dy.x < kMapMinimumXY || mapCoord_dy.y < kMapMinimumXY) { at_map_edge_dy = 1; } diff --git a/src/openrct2-ui/windows/Footpath.cpp b/src/openrct2-ui/windows/Footpath.cpp index 627e41c1cd..31b63b6115 100644 --- a/src/openrct2-ui/windows/Footpath.cpp +++ b/src/openrct2-ui/windows/Footpath.cpp @@ -815,7 +815,7 @@ static constexpr uint8_t ConstructionPreviewImages[][4] = { auto surfaceElement = info.Element->AsSurface(); if (surfaceElement != nullptr) { - slope = DefaultPathSlope[surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; + slope = DefaultPathSlope[surfaceElement->GetSlope() & kTileElementSurfaceRaisedCornersMask]; } break; } @@ -920,7 +920,7 @@ static constexpr uint8_t ConstructionPreviewImages[][4] = { switch (info.SpriteType) { case ViewportInteractionItem::Terrain: - slope = DefaultPathSlope[info.Element->AsSurface()->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK]; + slope = DefaultPathSlope[info.Element->AsSurface()->GetSlope() & kTileElementSurfaceRaisedCornersMask]; break; case ViewportInteractionItem::Footpath: slope = info.Element->AsPath()->GetSlopeDirection(); diff --git a/src/openrct2-ui/windows/Map.cpp b/src/openrct2-ui/windows/Map.cpp index 1787e5d40e..a5318e8fa0 100644 --- a/src/openrct2-ui/windows/Map.cpp +++ b/src/openrct2-ui/windows/Map.cpp @@ -1408,8 +1408,8 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = { _resizeDirection = (callingWidget == WIDX_MAP_SIZE_SPINNER_Y) ? ResizeDirection::Y : ResizeDirection::X; Formatter ft; - ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); - ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); + ft.Add(kMinimumMapSizePractical); + ft.Add(kMaximumMapSizePractical); TextInputOpen(callingWidget, STR_MAP_SIZE_2, STR_ENTER_MAP_SIZE, ft, STR_NONE, STR_NONE, 4); } diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index 5942199498..0f8b55182b 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -417,8 +417,8 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = { void InputMapSize(WidgetIndex callingWidget, int32_t currentValue) { Formatter ft; - ft.Add(MINIMUM_MAP_SIZE_PRACTICAL); - ft.Add(MAXIMUM_MAP_SIZE_PRACTICAL); + ft.Add(kMinimumMapSizePractical); + ft.Add(kMaximumMapSizePractical); // Practical map size is 2 lower than the technical map size currentValue -= 2; diff --git a/src/openrct2/Context.cpp b/src/openrct2/Context.cpp index a3bf35234f..972fa59bd9 100644 --- a/src/openrct2/Context.cpp +++ b/src/openrct2/Context.cpp @@ -659,7 +659,7 @@ namespace OpenRCT2 MapAnimationAutoCreate(); EntityTweener::Get().Reset(); gScreenAge = 0; - gLastAutoSaveUpdate = AUTOSAVE_PAUSE; + gLastAutoSaveUpdate = kAutosavePause; #ifndef DISABLE_NETWORK bool sendMap = false; diff --git a/src/openrct2/GameState.cpp b/src/openrct2/GameState.cpp index 72c88181af..d6a11d58ed 100644 --- a/src/openrct2/GameState.cpp +++ b/src/openrct2/GameState.cpp @@ -358,7 +358,7 @@ void GameState::UpdateLogic() // WindowDispatchUpdateAll(); // Start autosave timer after update - if (gLastAutoSaveUpdate == AUTOSAVE_PAUSE) + if (gLastAutoSaveUpdate == kAutosavePause) { gLastAutoSaveUpdate = Platform::GetTicks(); } diff --git a/src/openrct2/actions/FootpathPlaceAction.cpp b/src/openrct2/actions/FootpathPlaceAction.cpp index a082cb6097..c8eab3d63a 100644 --- a/src/openrct2/actions/FootpathPlaceAction.cpp +++ b/src/openrct2/actions/FootpathPlaceAction.cpp @@ -139,7 +139,7 @@ GameActions::Result FootpathPlaceAction::Execute() const auto zLow = _loc.z; auto zHigh = zLow + PATH_CLEARANCE; WallRemoveIntersectingWalls( - { _loc, zLow, zHigh + ((_slope & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) ? 16 : 0) }, + { _loc, zLow, zHigh + ((_slope & kTileElementSurfaceRaisedCornersMask) ? 16 : 0) }, DirectionReverse(_direction)); WallRemoveIntersectingWalls( { _loc.x - CoordsDirectionDelta[_direction].x, _loc.y - CoordsDirectionDelta[_direction].y, zLow, zHigh }, diff --git a/src/openrct2/actions/GameAction.cpp b/src/openrct2/actions/GameAction.cpp index 9a10edff70..2db04d6d86 100644 --- a/src/openrct2/actions/GameAction.cpp +++ b/src/openrct2/actions/GameAction.cpp @@ -422,7 +422,7 @@ namespace GameActions } // Allow autosave to commence - if (gLastAutoSaveUpdate == AUTOSAVE_PAUSE) + if (gLastAutoSaveUpdate == kAutosavePause) { gLastAutoSaveUpdate = Platform::GetTicks(); } diff --git a/src/openrct2/actions/LandLowerAction.cpp b/src/openrct2/actions/LandLowerAction.cpp index 3280a28a99..4e363d09bb 100644 --- a/src/openrct2/actions/LandLowerAction.cpp +++ b/src/openrct2/actions/LandLowerAction.cpp @@ -104,9 +104,9 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const withinOwnership = true; uint8_t height = surfaceElement->BaseHeight; - if (surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) + if (surfaceElement->GetSlope() & kTileElementSurfaceRaisedCornersMask) height += 2; - if (surfaceElement->GetSlope() & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG) + if (surfaceElement->GetSlope() & kTileElementSurfaceDiagonalFlag) height += 2; if (height < maxHeight) @@ -118,7 +118,7 @@ GameActions::Result LandLowerAction::QueryExecute(bool isExecuting) const if (newSlope & SURFACE_STYLE_FLAG_RAISE_OR_LOWER_BASE_HEIGHT) height -= 2; - newSlope &= TILE_ELEMENT_SURFACE_SLOPE_MASK; + newSlope &= kTileElementSurfaceSlopeMask; auto landSetHeightAction = LandSetHeightAction({ x, y }, height, newSlope); landSetHeightAction.SetFlags(GetFlags()); diff --git a/src/openrct2/actions/LandRaiseAction.cpp b/src/openrct2/actions/LandRaiseAction.cpp index 4ec0329399..3e0ccbdcb2 100644 --- a/src/openrct2/actions/LandRaiseAction.cpp +++ b/src/openrct2/actions/LandRaiseAction.cpp @@ -122,7 +122,7 @@ GameActions::Result LandRaiseAction::QueryExecute(bool isExecuting) const height += 2; } } - newSlope &= TILE_ELEMENT_SURFACE_SLOPE_MASK; + newSlope &= kTileElementSurfaceSlopeMask; auto landSetHeightAction = LandSetHeightAction({ x, y }, height, newSlope); landSetHeightAction.SetFlags(GetFlags()); diff --git a/src/openrct2/actions/LandSetHeightAction.cpp b/src/openrct2/actions/LandSetHeightAction.cpp index f350cc6783..11ae1abaa2 100644 --- a/src/openrct2/actions/LandSetHeightAction.cpp +++ b/src/openrct2/actions/LandSetHeightAction.cpp @@ -127,10 +127,10 @@ GameActions::Result LandSetHeightAction::Query() const if (!GetGameState().Cheats.DisableClearanceChecks) { uint8_t zCorner = _height; - if (_style & TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) + if (_style & kTileElementSurfaceRaisedCornersMask) { zCorner += 2; - if (_style & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG) + if (_style & kTileElementSurfaceDiagonalFlag) { zCorner += 2; } @@ -197,12 +197,12 @@ StringId LandSetHeightAction::CheckParameters() const return STR_TOO_HIGH; } - if (_height > kMaximumLandHeight - 2 && (_style & TILE_ELEMENT_SURFACE_SLOPE_MASK) != 0) + if (_height > kMaximumLandHeight - 2 && (_style & kTileElementSurfaceSlopeMask) != 0) { return STR_TOO_HIGH; } - if (_height == kMaximumLandHeight - 2 && (_style & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG)) + if (_height == kMaximumLandHeight - 2 && (_style & kTileElementSurfaceDiagonalFlag)) { return STR_TOO_HIGH; } @@ -302,10 +302,10 @@ TileElement* LandSetHeightAction::CheckFloatingStructures(TileElement* surfaceEl uint32_t waterHeight = surfaceElement->AsSurface()->GetWaterHeight(); if (waterHeight != 0) { - if (_style & TILE_ELEMENT_SURFACE_SLOPE_MASK) + if (_style & kTileElementSurfaceSlopeMask) { zCorner += 2; - if (_style & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG) + if (_style & kTileElementSurfaceDiagonalFlag) { zCorner += 2; } @@ -325,7 +325,7 @@ money64 LandSetHeightAction::GetSurfaceHeightChangeCost(SurfaceElement* surfaceE for (Direction i : ALL_DIRECTIONS) { int32_t cornerHeight = TileElementGetCornerHeight(surfaceElement, i); - cornerHeight -= MapGetCornerHeight(_height, _style & TILE_ELEMENT_SURFACE_SLOPE_MASK, i); + cornerHeight -= MapGetCornerHeight(_height, _style & kTileElementSurfaceSlopeMask, i); cost += 2.50_GBP * abs(cornerHeight); } return cost; diff --git a/src/openrct2/config/Config.cpp b/src/openrct2/config/Config.cpp index 9bcb48b865..5153cb83cb 100644 --- a/src/openrct2/config/Config.cpp +++ b/src/openrct2/config/Config.cpp @@ -146,7 +146,7 @@ namespace Config auto model = &gConfigGeneral; model->AlwaysShowGridlines = reader->GetBoolean("always_show_gridlines", false); model->AutosaveFrequency = reader->GetInt32("autosave", AUTOSAVE_EVERY_5MINUTES); - model->AutosaveAmount = reader->GetInt32("autosave_amount", DEFAULT_NUM_AUTOSAVES_TO_KEEP); + model->AutosaveAmount = reader->GetInt32("autosave_amount", kDefaultNumAutosavesToKeep); model->ConfirmationPrompt = reader->GetBoolean("confirmation_prompt", false); model->CurrencyFormat = reader->GetEnum( "currency_format", Platform::GetLocaleCurrency(), Enum_Currency); diff --git a/src/openrct2/entity/Staff.cpp b/src/openrct2/entity/Staff.cpp index af60d6e0ae..50873e7edc 100644 --- a/src/openrct2/entity/Staff.cpp +++ b/src/openrct2/entity/Staff.cpp @@ -1549,14 +1549,14 @@ bool Staff::UpdatePatrollingFindWatering() continue; } - if (tile_element->AsSmallScenery()->GetAge() < SCENERY_WITHER_AGE_THRESHOLD_2) + if (tile_element->AsSmallScenery()->GetAge() < kSceneryWitherAgeThreshold2) { if (chosen_position >= 4) { continue; } - if (tile_element->AsSmallScenery()->GetAge() < SCENERY_WITHER_AGE_THRESHOLD_1) + if (tile_element->AsSmallScenery()->GetAge() < kSceneryWitherAgeThreshold1) { continue; } diff --git a/src/openrct2/interface/Viewport.cpp b/src/openrct2/interface/Viewport.cpp index 346bdda872..36d90407f2 100644 --- a/src/openrct2/interface/Viewport.cpp +++ b/src/openrct2/interface/Viewport.cpp @@ -643,14 +643,14 @@ void ViewportUpdatePosition(WindowBase* window) // Clamp to the map minimum value int32_t at_map_edge = 0; - if (mapCoord.x < MAP_MINIMUM_X_Y) + if (mapCoord.x < kMapMinimumXY) { - mapCoord.x = MAP_MINIMUM_X_Y; + mapCoord.x = kMapMinimumXY; at_map_edge = 1; } - if (mapCoord.y < MAP_MINIMUM_X_Y) + if (mapCoord.y < kMapMinimumXY) { - mapCoord.y = MAP_MINIMUM_X_Y; + mapCoord.y = kMapMinimumXY; at_map_edge = 1; } diff --git a/src/openrct2/network/NetworkBase.cpp b/src/openrct2/network/NetworkBase.cpp index 54f7ed66cd..79700af5c3 100644 --- a/src/openrct2/network/NetworkBase.cpp +++ b/src/openrct2/network/NetworkBase.cpp @@ -2805,7 +2805,7 @@ bool NetworkBase::LoadMap(IStream* stream) EntityTweener::Get().Reset(); MapAnimationAutoCreate(); - gLastAutoSaveUpdate = AUTOSAVE_PAUSE; + gLastAutoSaveUpdate = kAutosavePause; result = true; } catch (const std::exception& e) diff --git a/src/openrct2/paint/support/MetalSupports.cpp b/src/openrct2/paint/support/MetalSupports.cpp index 8e511f3760..de7e41b04d 100644 --- a/src/openrct2/paint/support/MetalSupports.cpp +++ b/src/openrct2/paint/support/MetalSupports.cpp @@ -287,7 +287,7 @@ bool MetalASupportsPaintSetup( int8_t yOffset = SupportBoundBoxes[segment].y; uint32_t imageIndex = _97B15C[supportType].base_id; - imageIndex += metal_supports_slope_image_map[supportSegments[segment].slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]; + imageIndex += metal_supports_slope_image_map[supportSegments[segment].slope & kTileElementSurfaceSlopeMask]; auto image_id = imageTemplate.WithIndex(imageIndex); PaintAddImageAsParent(session, image_id, { xOffset, yOffset, supportSegments[segment].height }, { 0, 0, 5 }); @@ -493,7 +493,7 @@ bool MetalBSupportsPaintSetup( } else { - uint32_t imageOffset = metal_supports_slope_image_map[supportSegments[segment].slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]; + uint32_t imageOffset = metal_supports_slope_image_map[supportSegments[segment].slope & kTileElementSurfaceSlopeMask]; uint32_t imageId = _97B15C[supportType].base_id + imageOffset; PaintAddImageAsParent( @@ -679,7 +679,7 @@ bool PathPoleSupportsPaintSetup( } else { - uint8_t imageOffset = metal_supports_slope_image_map[supportSegments[segment].slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]; + uint8_t imageOffset = metal_supports_slope_image_map[supportSegments[segment].slope & kTileElementSurfaceSlopeMask]; baseHeight = supportSegments[segment].height; PaintAddImageAsParent( diff --git a/src/openrct2/paint/support/WoodenSupports.cpp b/src/openrct2/paint/support/WoodenSupports.cpp index c9fb7f1176..2c14a51ffc 100644 --- a/src/openrct2/paint/support/WoodenSupports.cpp +++ b/src/openrct2/paint/support/WoodenSupports.cpp @@ -447,7 +447,7 @@ bool WoodenASupportsPaintSetup( } else { - auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]); + auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & kTileElementSurfaceSlopeMask]); PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { { 0, 0, baseHeight + 2 }, { 32, 32, 11 } }); PaintAddImageAsParent( @@ -475,7 +475,7 @@ bool WoodenASupportsPaintSetup( } else { - auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]); + auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & kTileElementSurfaceSlopeMask]); PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { { 0, 0, baseHeight + 2 }, { 32, 32, 11 } }); hasSupports = true; } @@ -579,7 +579,7 @@ bool WoodenBSupportsPaintSetup( } else { - auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]); + auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & kTileElementSurfaceSlopeMask]); PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { { 0, 0, baseHeight + 2 }, { 32, 32, 11 } }); PaintAddImageAsParent( @@ -607,7 +607,7 @@ bool WoodenBSupportsPaintSetup( } else { - auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & TILE_ELEMENT_SURFACE_SLOPE_MASK]); + auto imageId = imageTemplate.WithIndex(imageIndex + word_97B3C4[slope & kTileElementSurfaceSlopeMask]); PaintAddImageAsParent(session, imageId, { 0, 0, baseHeight }, { { 0, 0, baseHeight + 2 }, { 32, 32, 3 } }); hasSupports = true; } @@ -704,7 +704,7 @@ bool PathBoxSupportsPaintSetup( return false; } - uint32_t imageId = supportOrientationOffset + word_97B3C4[session.Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] + uint32_t imageId = supportOrientationOffset + word_97B3C4[session.Support.slope & kTileElementSurfaceSlopeMask] + pathPaintInfo.BridgeImageId; PaintAddImageAsParent( @@ -725,7 +725,7 @@ bool PathBoxSupportsPaintSetup( return false; } - uint32_t ebx = supportOrientationOffset + word_97B3C4[session.Support.slope & TILE_ELEMENT_SURFACE_SLOPE_MASK] + uint32_t ebx = supportOrientationOffset + word_97B3C4[session.Support.slope & kTileElementSurfaceSlopeMask] + pathPaintInfo.BridgeImageId; PaintAddImageAsParent( diff --git a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp index 132ede111b..5934ae8700 100644 --- a/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp +++ b/src/openrct2/paint/tile_element/Paint.SmallScenery.cpp @@ -180,11 +180,11 @@ static void PaintSmallSceneryBody( ImageIndex baseImageIndex = sceneryEntry->image + direction; if (sceneryEntry->HasFlag(SMALL_SCENERY_FLAG_CAN_WITHER)) { - if (sceneryElement.GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_1) + if (sceneryElement.GetAge() >= kSceneryWitherAgeThreshold1) { baseImageIndex += 4; } - if (sceneryElement.GetAge() >= SCENERY_WITHER_AGE_THRESHOLD_2) + if (sceneryElement.GetAge() >= kSceneryWitherAgeThreshold2) { baseImageIndex += 4; } diff --git a/src/openrct2/paint/tile_element/Paint.Surface.cpp b/src/openrct2/paint/tile_element/Paint.Surface.cpp index 2d7ac5dd33..82d873806c 100644 --- a/src/openrct2/paint/tile_element/Paint.Surface.cpp +++ b/src/openrct2/paint/tile_element/Paint.Surface.cpp @@ -926,14 +926,14 @@ static std::pair SurfaceGetHeightAboveWater( { localHeight += LAND_HEIGHT_STEP; - if (waterHeight != localHeight || !(localSurfaceShape & TILE_ELEMENT_SURFACE_DIAGONAL_FLAG)) + if (waterHeight != localHeight || !(localSurfaceShape & static_cast(kTileElementSurfaceDiagonalFlag))) { localHeight = waterHeight; localSurfaceShape = TILE_ELEMENT_SLOPE_FLAT; } else { - localSurfaceShape = Numerics::ror4(surfaceShape ^ TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK, 2); + localSurfaceShape = Numerics::ror4(surfaceShape ^ static_cast(kTileElementSurfaceRaisedCornersMask), 2); } } } diff --git a/src/openrct2/rct12/RCT12.cpp b/src/openrct2/rct12/RCT12.cpp index 7486f1d121..1be2bb0782 100644 --- a/src/openrct2/rct12/RCT12.cpp +++ b/src/openrct2/rct12/RCT12.cpp @@ -59,7 +59,7 @@ uint8_t RCT12TileElementBase::GetDirection() const uint8_t RCT12TileElementBase::GetOccupiedQuadrants() const { - return Flags & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK; + return Flags & kTileElementOccupiedQuadrantsMask; } bool RCT12TileElementBase::IsLastForTile() const @@ -74,7 +74,7 @@ bool RCT12TileElementBase::IsGhost() const uint8_t RCT12SurfaceElement::GetSlope() const { - return (Slope & TILE_ELEMENT_SURFACE_SLOPE_MASK); + return (Slope & kTileElementSurfaceSlopeMask); } uint32_t RCT12SurfaceElement::GetSurfaceStyle() const @@ -99,7 +99,7 @@ uint8_t RCT12SurfaceElement::GetGrassLength() const uint8_t RCT12SurfaceElement::GetOwnership() const { - return (Ownership & TILE_ELEMENT_SURFACE_OWNERSHIP_MASK); + return (Ownership & kTileElementSurfaceOwnershipMask); } uint32_t RCT12SurfaceElement::GetWaterHeight() const @@ -109,7 +109,7 @@ uint32_t RCT12SurfaceElement::GetWaterHeight() const uint8_t RCT12SurfaceElement::GetParkFences() const { - return (Ownership & TILE_ELEMENT_SURFACE_PARK_FENCE_MASK); + return (Ownership & kTileElementSurfaceParkFenceMask); } bool RCT12SurfaceElement::HasTrackThatNeedsWater() const diff --git a/src/openrct2/ride/VehicleRiderControl.cpp b/src/openrct2/ride/VehicleRiderControl.cpp index 6aae115706..86be123f87 100644 --- a/src/openrct2/ride/VehicleRiderControl.cpp +++ b/src/openrct2/ride/VehicleRiderControl.cpp @@ -10,7 +10,7 @@ #include "../entity/EntityRegistry.h" #include "Vehicle.h" -constexpr int operator"" _MPH(unsigned long long x) +constexpr int operator"" _MPH(unsigned long long x) noexcept { return x * 29127; } diff --git a/src/openrct2/scenario/Scenario.cpp b/src/openrct2/scenario/Scenario.cpp index 024663555f..b46897c785 100644 --- a/src/openrct2/scenario/Scenario.cpp +++ b/src/openrct2/scenario/Scenario.cpp @@ -256,7 +256,7 @@ static void ScenarioCheckEntranceFeeTooHigh() void ScenarioAutosaveCheck() { - if (gLastAutoSaveUpdate == AUTOSAVE_PAUSE) + if (gLastAutoSaveUpdate == kAutosavePause) return; // Milliseconds since last save @@ -284,7 +284,7 @@ void ScenarioAutosaveCheck() if (shouldSave) { - gLastAutoSaveUpdate = AUTOSAVE_PAUSE; + gLastAutoSaveUpdate = kAutosavePause; GameAutosave(); } } diff --git a/src/openrct2/scenario/Scenario.h b/src/openrct2/scenario/Scenario.h index fe6c61fe95..ce82e5d489 100644 --- a/src/openrct2/scenario/Scenario.h +++ b/src/openrct2/scenario/Scenario.h @@ -43,9 +43,6 @@ enum S6_TYPE_SCENARIO }; -#define S6_RCT2_VERSION 120001 -#define S6_MAGIC_NUMBER 0x00031144 - enum SCENARIO_CATEGORY { // RCT2 categories (keep order) @@ -151,8 +148,8 @@ enum AUTOSAVE_NEVER }; -#define AUTOSAVE_PAUSE 0 -#define DEFAULT_NUM_AUTOSAVES_TO_KEEP 10 +constexpr uint8_t kAutosavePause = 0; +constexpr uint8_t kDefaultNumAutosavesToKeep = 10; static constexpr money64 COMPANY_VALUE_ON_FAILED_OBJECTIVE = 0x8000000000000001; diff --git a/src/openrct2/title/Command/LoadScenario.h b/src/openrct2/title/Command/LoadScenario.h index 4a7840300d..a8caaf9ae5 100644 --- a/src/openrct2/title/Command/LoadScenario.h +++ b/src/openrct2/title/Command/LoadScenario.h @@ -13,7 +13,7 @@ #include -#define TITLE_COMMAND_SCENARIO_LENGTH 64 +constexpr uint8_t kTitleCommandScenarioLength = 64; namespace OpenRCT2::Title { @@ -22,7 +22,7 @@ namespace OpenRCT2::Title static constexpr const char* Name = "Load Scenario Command"; static constexpr const char* ScriptingName = "loadsc"; - utf8 Scenario[TITLE_COMMAND_SCENARIO_LENGTH]{}; + utf8 Scenario[kTitleCommandScenarioLength]{}; int16_t operator()(int16_t timer); }; diff --git a/src/openrct2/world/Map.h b/src/openrct2/world/Map.h index 06e730e5e1..eb19182265 100644 --- a/src/openrct2/world/Map.h +++ b/src/openrct2/world/Map.h @@ -27,8 +27,8 @@ constexpr uint8_t kMapBaseZ = 7; constexpr uint8_t kMinimumMapSizeTechnical = 5; constexpr uint16_t kMaximumMapSizeTechnical = 1001; -#define MINIMUM_MAP_SIZE_PRACTICAL (kMinimumMapSizeTechnical - 2) -#define MAXIMUM_MAP_SIZE_PRACTICAL (kMaximumMapSizeTechnical - 2) +constexpr int16_t kMinimumMapSizePractical = (kMinimumMapSizeTechnical - 2); +constexpr int16_t kMaximumMapSizePractical = (kMaximumMapSizeTechnical - 2); constexpr const int32_t MAXIMUM_MAP_SIZE_BIG = COORDS_XY_STEP * kMaximumMapSizeTechnical; constexpr int32_t MAXIMUM_TILE_START_XY = MAXIMUM_MAP_SIZE_BIG - COORDS_XY_STEP; constexpr const int32_t LAND_HEIGHT_STEP = 2 * COORDS_Z_STEP; @@ -40,13 +40,10 @@ constexpr uint8_t ConstructionRightsClearanceSmall = 3; // Same as previous, but in big coords. constexpr const uint8_t ConstructionRightsClearanceBig = 3 * COORDS_Z_STEP; -#define MAP_MINIMUM_X_Y (-kMaximumMapSizeTechnical) +constexpr int16_t kMapMinimumXY = (-kMaximumMapSizeTechnical); constexpr uint32_t MAX_TILE_ELEMENTS_WITH_SPARE_ROOM = 0x1000000; constexpr uint32_t MAX_TILE_ELEMENTS = MAX_TILE_ELEMENTS_WITH_SPARE_ROOM - 512; -#define MAX_TILE_TILE_ELEMENT_POINTERS (kMaximumMapSizeTechnical * kMaximumMapSizeTechnical) - -#define TILE_UNDEFINED_TILE_ELEMENT NULL using PeepSpawn = CoordsXYZD; diff --git a/src/openrct2/world/MapGen.cpp b/src/openrct2/world/MapGen.cpp index c035acd20c..b3a57e112c 100644 --- a/src/openrct2/world/MapGen.cpp +++ b/src/openrct2/world/MapGen.cpp @@ -693,8 +693,8 @@ bool MapGenLoadHeightmap(const utf8* path) try { auto image = Imaging::ReadFromFile(path, format); - auto width = std::min(image.Width, MAXIMUM_MAP_SIZE_PRACTICAL); - auto height = std::min(image.Height, MAXIMUM_MAP_SIZE_PRACTICAL); + auto width = std::min(image.Width, kMaximumMapSizePractical); + auto height = std::min(image.Height, kMaximumMapSizePractical); if (width != image.Width || height != image.Height) { ContextShowError(STR_HEIGHT_MAP_ERROR, STR_ERROR_HEIHGT_MAP_TOO_BIG, {}); diff --git a/src/openrct2/world/Scenery.h b/src/openrct2/world/Scenery.h index eaa5d50cdd..b30c1795b4 100644 --- a/src/openrct2/world/Scenery.h +++ b/src/openrct2/world/Scenery.h @@ -15,8 +15,8 @@ #include -#define SCENERY_WITHER_AGE_THRESHOLD_1 0x28 -#define SCENERY_WITHER_AGE_THRESHOLD_2 0x37 +constexpr uint8_t kSceneryWitherAgeThreshold1 = 0x28; +constexpr uint8_t kSceneryWitherAgeThreshold2 = 0x37; enum { diff --git a/src/openrct2/world/SmallScenery.cpp b/src/openrct2/world/SmallScenery.cpp index 34d1017b51..d154a5aacf 100644 --- a/src/openrct2/world/SmallScenery.cpp +++ b/src/openrct2/world/SmallScenery.cpp @@ -67,7 +67,7 @@ void SmallSceneryElement::IncreaseAge(const CoordsXY& sceneryPos) uint8_t newAge = age++; // Only invalidate tiles when scenery crosses the withering thresholds, and can be withered. - if (newAge == SCENERY_WITHER_AGE_THRESHOLD_1 || newAge == SCENERY_WITHER_AGE_THRESHOLD_2) + if (newAge == kSceneryWitherAgeThreshold1 || newAge == kSceneryWitherAgeThreshold2) { auto* sceneryEntry = GetEntry(); diff --git a/src/openrct2/world/Surface.cpp b/src/openrct2/world/Surface.cpp index 6340cb7fe3..015df092f2 100644 --- a/src/openrct2/world/Surface.cpp +++ b/src/openrct2/world/Surface.cpp @@ -192,24 +192,24 @@ void SurfaceElement::UpdateGrassLength(const CoordsXY& coords) uint8_t SurfaceElement::GetOwnership() const { - return (Ownership & TILE_ELEMENT_SURFACE_OWNERSHIP_MASK); + return (Ownership & kTileElementSurfaceOwnershipMask); } void SurfaceElement::SetOwnership(uint8_t newOwnership) { - Ownership &= ~TILE_ELEMENT_SURFACE_OWNERSHIP_MASK; - Ownership |= (newOwnership & TILE_ELEMENT_SURFACE_OWNERSHIP_MASK); + Ownership &= ~kTileElementSurfaceOwnershipMask; + Ownership |= (newOwnership & kTileElementSurfaceOwnershipMask); } uint8_t SurfaceElement::GetParkFences() const { - return (Ownership & TILE_ELEMENT_SURFACE_PARK_FENCE_MASK); + return (Ownership & kTileElementSurfaceParkFenceMask); } void SurfaceElement::SetParkFences(uint8_t newParkFences) { - Ownership &= ~TILE_ELEMENT_SURFACE_PARK_FENCE_MASK; - Ownership |= (newParkFences & TILE_ELEMENT_SURFACE_PARK_FENCE_MASK); + Ownership &= ~kTileElementSurfaceParkFenceMask; + Ownership |= (newParkFences & kTileElementSurfaceParkFenceMask); } uint8_t SurfaceElement::GetSlope() const diff --git a/src/openrct2/world/Surface.h b/src/openrct2/world/Surface.h index 266e96f2e3..04b3511b58 100644 --- a/src/openrct2/world/Surface.h +++ b/src/openrct2/world/Surface.h @@ -111,10 +111,10 @@ enum }; // Surface -#define TILE_ELEMENT_SURFACE_DIAGONAL_FLAG 0x10 // in TileElement.properties.surface.slope -#define TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK 0x0F // in TileElement.properties.surface.slope -#define TILE_ELEMENT_SURFACE_SLOPE_MASK \ - (TILE_ELEMENT_SURFACE_DIAGONAL_FLAG | TILE_ELEMENT_SURFACE_RAISED_CORNERS_MASK) // in TileElement.properties.surface.slope +constexpr uint8_t kTileElementSurfaceDiagonalFlag = 0x10; // in TileElement.properties.surface.slope +constexpr uint8_t kTileElementSurfaceRaisedCornersMask = 0x0F; // in TileElement.properties.surface.slope +constexpr uint8_t kTileElementSurfaceSlopeMask + = (kTileElementSurfaceDiagonalFlag | kTileElementSurfaceRaisedCornersMask); // in TileElement.properties.surface.slope -#define TILE_ELEMENT_SURFACE_OWNERSHIP_MASK 0xF0 -#define TILE_ELEMENT_SURFACE_PARK_FENCE_MASK 0x0F +constexpr uint8_t kTileElementSurfaceOwnershipMask = 0xF0; +constexpr uint8_t kTileElementSurfaceParkFenceMask = 0x0F; diff --git a/src/openrct2/world/TileElement.h b/src/openrct2/world/TileElement.h index cf865d6256..52ce7c4a22 100644 --- a/src/openrct2/world/TileElement.h +++ b/src/openrct2/world/TileElement.h @@ -703,7 +703,7 @@ enum constexpr uint8_t kTileElementQuadrantMask = 0b11000000; constexpr uint8_t kTileElementTypeMask = 0b00111100; constexpr uint8_t kTileElementDirectionMask = 0b00000011; -#define TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK 0b00001111 +constexpr uint8_t kTileElementOccupiedQuadrantsMask = 0b00001111; enum { diff --git a/src/openrct2/world/TileElementBase.cpp b/src/openrct2/world/TileElementBase.cpp index ff817f8878..d06f672737 100644 --- a/src/openrct2/world/TileElementBase.cpp +++ b/src/openrct2/world/TileElementBase.cpp @@ -87,13 +87,13 @@ void TileElementBase::Remove() uint8_t TileElementBase::GetOccupiedQuadrants() const { - return Flags & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK; + return Flags & kTileElementOccupiedQuadrantsMask; } void TileElementBase::SetOccupiedQuadrants(uint8_t quadrants) { - Flags &= ~TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK; - Flags |= (quadrants & TILE_ELEMENT_OCCUPIED_QUADRANTS_MASK); + Flags &= ~kTileElementOccupiedQuadrantsMask; + Flags |= (quadrants & kTileElementOccupiedQuadrantsMask); } int32_t TileElementBase::GetBaseZ() const From 6ea091841f87df9be34a7fbce31f0a62781861ee Mon Sep 17 00:00:00 2001 From: John Kastner Date: Mon, 1 Apr 2024 18:40:14 -0400 Subject: [PATCH 187/191] Fix memory leak loading malformed `SawyerChunk` (#21508) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix memory leak loading malformed `SawyerChunk` A temporary buffer was not free'd after failing to parse in `SawyerChunkReader::ReadChunkTrack`. Fix this following the pattern used in `SawyerChunkReader::ReadChunk` by wrapping the relevant code in a `try` block with `FreeLargeTempBuffer` called when an exception is caught. * Use unique_ptr * Remove `AllocateLargeTempBuffer` --------- Co-authored-by: Michał Janiszewski --- src/openrct2/rct12/SawyerChunk.cpp | 9 +--- src/openrct2/rct12/SawyerChunk.h | 9 ++-- src/openrct2/rct12/SawyerChunkReader.cpp | 58 +++++------------------- src/openrct2/rct12/SawyerChunkReader.h | 8 ---- 4 files changed, 18 insertions(+), 66 deletions(-) diff --git a/src/openrct2/rct12/SawyerChunk.cpp b/src/openrct2/rct12/SawyerChunk.cpp index 65779a1bb3..1f77f6b551 100644 --- a/src/openrct2/rct12/SawyerChunk.cpp +++ b/src/openrct2/rct12/SawyerChunk.cpp @@ -12,14 +12,9 @@ #include "../core/Memory.hpp" #include "SawyerChunkReader.h" -SawyerChunk::SawyerChunk(SAWYER_ENCODING encoding, void* data, size_t length) +SawyerChunk::SawyerChunk(SAWYER_ENCODING encoding, std::unique_ptr data, size_t length) { _encoding = encoding; - _data = data; + _data = std::move(data); _length = length; } - -SawyerChunk::~SawyerChunk() -{ - SawyerChunkReader::FreeChunk(_data); -} diff --git a/src/openrct2/rct12/SawyerChunk.h b/src/openrct2/rct12/SawyerChunk.h index 1a6a4ca5af..05e8bc2d7a 100644 --- a/src/openrct2/rct12/SawyerChunk.h +++ b/src/openrct2/rct12/SawyerChunk.h @@ -11,6 +11,8 @@ #include "../common.h" +#include + /** * The type of encoding / compression for a sawyer encoded chunk. */ @@ -28,14 +30,14 @@ enum class SAWYER_ENCODING : uint8_t class SawyerChunk final { private: - void* _data = nullptr; + std::unique_ptr _data; size_t _length = 0; SAWYER_ENCODING _encoding = SAWYER_ENCODING::NONE; public: const void* GetData() const { - return _data; + return _data.get(); } size_t GetLength() const { @@ -46,6 +48,5 @@ public: return _encoding; } - SawyerChunk(SAWYER_ENCODING encoding, void* data, size_t length); - ~SawyerChunk(); + SawyerChunk(SAWYER_ENCODING encoding, std::unique_ptr data, size_t length); }; diff --git a/src/openrct2/rct12/SawyerChunkReader.cpp b/src/openrct2/rct12/SawyerChunkReader.cpp index eaf4220583..df1e38b95f 100644 --- a/src/openrct2/rct12/SawyerChunkReader.cpp +++ b/src/openrct2/rct12/SawyerChunkReader.cpp @@ -71,22 +71,15 @@ std::shared_ptr SawyerChunkReader::ReadChunk() throw SawyerChunkException(EXCEPTION_MSG_CORRUPT_CHUNK_SIZE); } - auto buffer = static_cast(AllocateLargeTempBuffer()); - try + auto buffer = std::make_unique(MAX_UNCOMPRESSED_CHUNK_SIZE); + size_t uncompressedLength = DecodeChunk( + buffer.get(), MAX_UNCOMPRESSED_CHUNK_SIZE, compressedData.get(), header); + if (uncompressedLength == 0) { - size_t uncompressedLength = DecodeChunk(buffer, MAX_UNCOMPRESSED_CHUNK_SIZE, compressedData.get(), header); - if (uncompressedLength == 0) - { - throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK); - } - return std::make_shared( - static_cast(header.encoding), buffer, uncompressedLength); - } - catch (const std::exception&) - { - FreeLargeTempBuffer(buffer); - throw; + throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK); } + return std::make_shared( + static_cast(header.encoding), std::move(buffer), uncompressedLength); } default: throw SawyerChunkException(EXCEPTION_MSG_INVALID_CHUNK_ENCODING); @@ -119,14 +112,14 @@ std::shared_ptr SawyerChunkReader::ReadChunkTrack() throw SawyerChunkException(EXCEPTION_MSG_CORRUPT_CHUNK_SIZE); } - auto buffer = static_cast(AllocateLargeTempBuffer()); + auto buffer = std::make_unique(MAX_UNCOMPRESSED_CHUNK_SIZE); SawyerCodingChunkHeader header{ CHUNK_ENCODING_RLE, compressedDataLength }; - size_t uncompressedLength = DecodeChunk(buffer, MAX_UNCOMPRESSED_CHUNK_SIZE, compressedData.get(), header); + size_t uncompressedLength = DecodeChunk(buffer.get(), MAX_UNCOMPRESSED_CHUNK_SIZE, compressedData.get(), header); if (uncompressedLength == 0) { throw SawyerChunkException(EXCEPTION_MSG_ZERO_SIZED_CHUNK); } - return std::make_shared(SAWYER_ENCODING::RLE, buffer, uncompressedLength); + return std::make_shared(SAWYER_ENCODING::RLE, std::move(buffer), uncompressedLength); } catch (const std::exception&) { @@ -157,11 +150,6 @@ void SawyerChunkReader::ReadChunk(void* dst, size_t length) } } -void SawyerChunkReader::FreeChunk(void* data) -{ - FreeLargeTempBuffer(data); -} - size_t SawyerChunkReader::DecodeChunk(void* dst, size_t dstCapacity, const void* src, const SawyerCodingChunkHeader& header) { size_t resultLength; @@ -192,8 +180,7 @@ size_t SawyerChunkReader::DecodeChunk(void* dst, size_t dstCapacity, const void* size_t SawyerChunkReader::DecodeChunkRLERepeat(void* dst, size_t dstCapacity, const void* src, size_t srcLength) { - auto immBuffer = std::unique_ptr( - static_cast(AllocateLargeTempBuffer()), &FreeLargeTempBuffer); + auto immBuffer = std::make_unique(MAX_UNCOMPRESSED_CHUNK_SIZE); auto immLength = DecodeChunkRLE(immBuffer.get(), MAX_UNCOMPRESSED_CHUNK_SIZE, src, srcLength); auto size = DecodeChunkRepeat(dst, dstCapacity, immBuffer.get(), immLength); return size; @@ -301,26 +288,3 @@ size_t SawyerChunkReader::DecodeChunkRotate(void* dst, size_t dstCapacity, const } return srcLength; } - -void* SawyerChunkReader::AllocateLargeTempBuffer() -{ -#ifdef __USE_HEAP_ALLOC__ - auto buffer = HeapAlloc(GetProcessHeap(), 0, MAX_UNCOMPRESSED_CHUNK_SIZE); -#else - auto buffer = std::malloc(MAX_UNCOMPRESSED_CHUNK_SIZE); -#endif - if (buffer == nullptr) - { - throw std::runtime_error("Unable to allocate large temporary buffer."); - } - return buffer; -} - -void SawyerChunkReader::FreeLargeTempBuffer(void* buffer) -{ -#ifdef __USE_HEAP_ALLOC__ - HeapFree(GetProcessHeap(), 0, buffer); -#else - std::free(buffer); -#endif -} diff --git a/src/openrct2/rct12/SawyerChunkReader.h b/src/openrct2/rct12/SawyerChunkReader.h index 60c1e5c572..5bbdc3a79b 100644 --- a/src/openrct2/rct12/SawyerChunkReader.h +++ b/src/openrct2/rct12/SawyerChunkReader.h @@ -85,18 +85,10 @@ public: return result; } - /** - * Frees the chunk data, to be used when destructing SawyerChunks - */ - static void FreeChunk(void* data); - private: static size_t DecodeChunk(void* dst, size_t dstCapacity, const void* src, const SawyerCodingChunkHeader& header); static size_t DecodeChunkRLERepeat(void* dst, size_t dstCapacity, const void* src, size_t srcLength); static size_t DecodeChunkRLE(void* dst, size_t dstCapacity, const void* src, size_t srcLength); static size_t DecodeChunkRepeat(void* dst, size_t dstCapacity, const void* src, size_t srcLength); static size_t DecodeChunkRotate(void* dst, size_t dstCapacity, const void* src, size_t srcLength); - - static void* AllocateLargeTempBuffer(); - static void FreeLargeTempBuffer(void* buffer); }; From dfcb527ada39bab7bd97fabe48f89f58a482086d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 2 Apr 2024 00:52:40 +0200 Subject: [PATCH 188/191] Ensure TTF system is torn down in correct order (#21707) `TTFDispose` uses `gCurrentTTFFontSet` to deallocate internal resources. Having the function called after global variable got changed meant it tried to deallocate incorrect font and would subsequently call `FT_Done_Face` on a struct having internal data set to nullptr. Reproduction is fairly easy: 1. launch the game in Korean (I made sure to have all the indexes primed for this language beforehand - i.e. launch it twice), 2. switch to Japanese, 3. switch back to Korean Fixes #21664 --- distribution/changelog.txt | 1 + src/openrct2/interface/Fonts.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index c5625c81f3..ff56564fe6 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -29,6 +29,7 @@ - Fix: [#21652] Dialog window to confirm overwriting files does not apply the theme colours correctly. - Fix: [#21654] No sound effects when using RCT Classic as an asset base. - Fix: [#21654] Extraneous reports of an object conflict between `rct2.audio.base` and `rct2.audio.base.rctc`. +- Fix: [#21664] Crash when switching between languages that use TTF. - Fix: [#21668] Crash when on null ride in Guest::UpdateRideLeaveExit. - Fix: [#21691] Crash when validating rides which can't contain banked track. - Fix: [objects#290] “Haunted Mansion” cars have a non-functional third remap colour. diff --git a/src/openrct2/interface/Fonts.cpp b/src/openrct2/interface/Fonts.cpp index c9e561e026..d32fdff674 100644 --- a/src/openrct2/interface/Fonts.cpp +++ b/src/openrct2/interface/Fonts.cpp @@ -117,10 +117,11 @@ static void LoadSpriteFont(LocalisationService& localisationService) #ifndef NO_TTF static bool LoadFont(LocalisationService& localisationService, TTFFontSetDescriptor* font) { + TTFDispose(); localisationService.UseTrueTypeFont(true); + gCurrentTTFFontSet = font; - TTFDispose(); bool fontInitialised = TTFInitialise(); return fontInitialised; } From 6b734fda6b2e207dc38c33a513ae8206cb07ab5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 2 Apr 2024 18:06:58 +0200 Subject: [PATCH 189/191] Fix #21591: Banner text colors are not working properly (#21709) * Fix #21591: Banner text colors are not working properly --- src/openrct2/actions/BannerSetStyleAction.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/openrct2/actions/BannerSetStyleAction.cpp b/src/openrct2/actions/BannerSetStyleAction.cpp index 041dceccee..e86478f3ed 100644 --- a/src/openrct2/actions/BannerSetStyleAction.cpp +++ b/src/openrct2/actions/BannerSetStyleAction.cpp @@ -163,5 +163,8 @@ GameActions::Result BannerSetStyleAction::Execute() const intent.PutExtra(INTENT_EXTRA_BANNER_INDEX, _bannerIndex); ContextBroadcastIntent(&intent); + ScrollingTextInvalidate(); + GfxInvalidateScreen(); + return res; } From 3461ac38ca3231ce7654123892c2fa1605a9f8e7 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 2 Apr 2024 22:05:48 +0200 Subject: [PATCH 190/191] Fix #21522: incorrect support drawing on Hybrid and Wooden (#21710) * Fix #21522: incorrect support drawing on Hybrid and Wooden * Add changelog entry --- distribution/changelog.txt | 1 + src/openrct2/ride/coaster/HybridCoaster.cpp | 157 +++++------------- .../ride/coaster/WoodenRollerCoaster.cpp | 65 ++------ 3 files changed, 51 insertions(+), 172 deletions(-) diff --git a/distribution/changelog.txt b/distribution/changelog.txt index ff56564fe6..905b3beec4 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -23,6 +23,7 @@ - Fix: [#21360] If the object selection is missing certain types, the Object Selection window will switch to an incorrect tab. - Fix: [#21419] Cannot place walls underground beneath sloped tiles with clearance checks disabled. - Fix: [#21434] Number of guests overflows in objective text. +- Fix: [#21522] Supports for 3×3 turns and 45 degree turns on the Hybrid Coaster and Wooden Roller Coaster not drawn correctly. - Fix: [#21543] Crash with creating a TrackIterator with invalid arguments. - Fix: [#21635] Tile inspector hotkey can set wall slope for non-slopeable objects. - Fix: [#21641] Crash when creating track iterator from an invalid tile element. diff --git a/src/openrct2/ride/coaster/HybridCoaster.cpp b/src/openrct2/ride/coaster/HybridCoaster.cpp index ec179003eb..a8aa4fb49c 100644 --- a/src/openrct2/ride/coaster/HybridCoaster.cpp +++ b/src/openrct2/ride/coaster/HybridCoaster.cpp @@ -5450,35 +5450,27 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 1), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 3), { 6, 0, height }, { 20, 34, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 5), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 7), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); + break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionPrev(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 2: @@ -5583,35 +5575,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 9), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 11), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 13), { 6, 0, height }, { 20, 34, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE + 15), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 0: @@ -5844,35 +5827,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 4), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 9), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 14), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 19), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionPrev(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 2: @@ -6089,35 +6063,26 @@ namespace HybridRC PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 24), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 29), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 34), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE + 39), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 0: @@ -7203,9 +7168,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 1), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -7216,9 +7178,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 5), { 6, 0, height }, { { 27, 0, height }, { 1, 34, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -7229,20 +7188,17 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 8), { 6, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 10), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionPrev(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 2: @@ -7272,18 +7228,12 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 11), { 0, 6, height }, { 32, 20, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 13), { 0, 6, height }, { 32, 20, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -7294,20 +7244,17 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 17), { 0, 6, height }, { { 0, 27, height }, { 34, 1, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 20), { 0, 6, height }, { 32, 20, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); if (direction == 0 || direction == 3) { PaintUtilPushTunnelRotated(session, direction, height - 8, TUNNEL_SQUARE_7); @@ -7356,9 +7303,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 12), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -7369,9 +7313,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 15), { 6, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -7382,20 +7323,17 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 19), { 6, 0, height }, { { 27, 0, height }, { 1, 34, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_SMALL_CURVE_BANKED + 21), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 0: @@ -7661,9 +7599,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 4), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -7674,9 +7609,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 14), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -7687,20 +7619,17 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 20), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 25), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionPrev(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 2: @@ -7950,9 +7879,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 30), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -7963,9 +7889,6 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 36), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -7976,20 +7899,17 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 46), { 0, 0, height }, { { 27, 0, height }, { 1, 32, 34 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_GENTLE_MEDIUM_CURVE_BANKED + 51), { 0, 0, height }, { { 6, 0, height }, { 20, 32, 3 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 0: @@ -11852,34 +11772,29 @@ namespace HybridRC session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 10), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetup( - session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; case 1: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 12), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetup( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, height, session.SupportColours); break; case 2: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 15), { 6, 0, height }, { 20, 34, 3 }); - WoodenASupportsPaintSetup( - session, WoodenSupportType::Truss, WoodenSupportSubType::NwSe, height, session.SupportColours); break; case 3: PaintAddImageAsParentRotated( session, direction, GetTrackColour(session).WithIndex(SPR_G2_HYBRID_TRACK_TURN_BANK_TRANSITION + 17), { 6, 0, height }, { 20, 32, 3 }); - WoodenASupportsPaintSetup( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, height, session.SupportColours); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours); switch (direction) { case 0: @@ -12527,8 +12442,9 @@ namespace HybridRC PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - WoodenASupportsPaintSetup( - session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height + 16, session.SupportColours); + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, + session.SupportColours); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); @@ -14358,8 +14274,9 @@ namespace HybridRC PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; case 2: - WoodenASupportsPaintSetup( - session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, height + 16, session.SupportColours); + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::Corner0, direction, height + 16, + session.SupportColours); PaintUtilSetSegmentSupportHeight(session, PaintUtilRotateSegments(kSegmentsAll, direction), 0xFFFF, 0); PaintUtilSetGeneralSupportHeight(session, height + 72, 0x20); break; diff --git a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp index 43df1b783e..264ff23bf0 100644 --- a/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp +++ b/src/openrct2/ride/coaster/WoodenRollerCoaster.cpp @@ -2585,10 +2585,6 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24651), { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, - (direction + 3) % NumOrthogonalDirections, height, session.SupportColours, - WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -2603,10 +2599,6 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24682), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, - (direction + 3) % NumOrthogonalDirections, height, session.SupportColours, - WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -2621,10 +2613,6 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24684), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, - (direction + 3) % NumOrthogonalDirections, height, session.SupportColours, - WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( @@ -2639,12 +2627,11 @@ static void WoodenRCTrackLeftQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24688), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, - (direction + 3) % NumOrthogonalDirections, height, session.SupportColours, - WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionPrev(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 2: @@ -2966,9 +2953,7 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24670), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); + break; case 1: PaintAddImageAsParentRotated( @@ -2983,9 +2968,6 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24672), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -3000,9 +2982,6 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24677), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( @@ -3011,11 +2990,11 @@ static void WoodenRCTrackRightQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(24646), { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 0: @@ -14687,9 +14666,6 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25191), { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -14704,9 +14680,6 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25222), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -14721,9 +14694,6 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25224), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( @@ -14738,11 +14708,11 @@ static void WoodenRCTrackLeftBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25228), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionPrev(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 2: @@ -15064,9 +15034,6 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25210), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 1: PaintAddImageAsParentRotated( @@ -15081,9 +15048,6 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25212), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 2: PaintAddImageAsParentRotated( @@ -15098,9 +15062,6 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25217), { 0, 0, height }, { { 2, 0, height + 67 }, { 27, 32, 0 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; case 3: PaintAddImageAsParentRotated( @@ -15109,11 +15070,11 @@ static void WoodenRCTrackRightBankedQuarterTurn525DegUp( PaintAddImageAsChildRotated( session, direction, WoodenRCGetRailsColour(session).WithIndex(25186), { 0, 0, height }, { { 2, 0, height }, { 27, 32, 2 } }); - WoodenASupportsPaintSetupRotated( - session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, direction, height, - session.SupportColours, WoodenSupportTransitionType::Up25Deg); break; } + WoodenASupportsPaintSetupRotated( + session, WoodenSupportType::Truss, WoodenSupportSubType::NeSw, DirectionNext(direction), height, + session.SupportColours, WoodenSupportTransitionType::Up25Deg); switch (direction) { case 0: From c8f91d3f357593ca30527ba2a0d59c720ba782a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 2 Apr 2024 22:11:17 +0200 Subject: [PATCH 191/191] Update backtrace token for upcoming release --- src/openrct2/platform/Crash.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openrct2/platform/Crash.cpp b/src/openrct2/platform/Crash.cpp index 0c94a03a2f..1f418d0fc6 100644 --- a/src/openrct2/platform/Crash.cpp +++ b/src/openrct2/platform/Crash.cpp @@ -57,7 +57,7 @@ static const wchar_t* _wszCommitSha1Short = WSZ(""); static const wchar_t* _wszArchitecture = WSZ(OPENRCT2_ARCHITECTURE); static std::map _uploadFiles; -# define BACKTRACE_TOKEN "029f8349236e87bd851f381f518f251698f0bb6efad167c6afeac151bbf14d9e" +# define BACKTRACE_TOKEN "a647c0d5b2b416665cba6a1054397d3074eedd13d68a66efc0c0729ffce7c8bb" using namespace OpenRCT2;